# -*- mode: snippet -*-
# name: ADR - Architectural Decision Record
# key: ;adr
# --
`(make-string (1+ (or (org-current-level) 0)) ?*)` ${1:`(let ((max-id 0)) (save-excursion (goto-char (point-min)) (while (re-search-forward (concat "^\\*+ ADR-\\([0-9]+\\)") nil t) (setq max-id (max max-id (string-to-number (match-string 1)))))) (format "ADR-%04d" (1+ max-id)))`} - ${2:Subject}

| *ID*      | $1             |
| *Subject* | $2             |
| *Status*  | ${3:Proposed}  |
| *Date*    | `(format-time-string "%Y-%m-%d")` |

`(make-string (+ 2 (or (org-current-level) 0)) ?*)` Problem statement
:PROPERTIES:
:UNNUMBERED: notoc
:END:

`(make-string (+ 2 (or (org-current-level) 0)) ?*)` Decision
:PROPERTIES:
:UNNUMBERED: notoc
:END:

`(make-string (+ 2 (or (org-current-level) 0)) ?*)` Alternatives
:PROPERTIES:
:UNNUMBERED: notoc
:END:

`(make-string (+ 2 (or (org-current-level) 0)) ?*)` Justification
:PROPERTIES:
:UNNUMBERED: notoc
:END:

`(make-string (+ 2 (or (org-current-level) 0)) ?*)` Implications
:PROPERTIES:
:UNNUMBERED: notoc
:END:

`(make-string (+ 2 (or (org-current-level) 0)) ?*)` Derived requirements
:PROPERTIES:
:UNNUMBERED: notoc
:END:
$0
