@frehilm/ordna-cli 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,215 @@
1
+ # Ordna — Agent Guide
2
+
3
+ This project uses **Ordna**, a Git-native project management framework. Tasks
4
+ are markdown files in `tasks/`, the Kanban board is *derived* from those files,
5
+ and Git is the source of truth. There is no database, no API key, no central
6
+ board file. If you can read and write a markdown file, you can manage tasks.
7
+
8
+ This document describes:
9
+
10
+ 1. The repository layout
11
+ 2. The task file format
12
+ 3. The config file (`.ordna/config.yaml`)
13
+ 4. The `ordna` CLI
14
+
15
+ ---
16
+
17
+ ## 1. Repository layout
18
+
19
+ ```
20
+ tasks/
21
+ T-001.md # one file per task
22
+ T-002.md
23
+ .ordna/
24
+ config.yaml # optional — see §3
25
+ ```
26
+
27
+ The `tasks/` folder is the entire schema. Adding a file creates a task;
28
+ deleting a file removes one. The Kanban board is computed from the `status`
29
+ field of each file. There is no separate board state to keep in sync.
30
+
31
+ ---
32
+
33
+ ## 2. Task file format
34
+
35
+ Each task is a single markdown file with **YAML frontmatter** and a body
36
+ divided into well-known sections.
37
+
38
+ ### Filename
39
+
40
+ `tasks/<id>.md` where `<id>` is `idPrefix` + zero-padded number. With defaults
41
+ (`idPrefix: T`, `zeroPaddedIds: 3`): `T-001.md`, `T-002.md`, `T-042.md`.
42
+
43
+ ### Frontmatter
44
+
45
+ ```yaml
46
+ ---
47
+ id: T-001
48
+ title: Implement payment flow
49
+ status: todo
50
+ assignee: null
51
+ priority: high
52
+ tags: [payments]
53
+ depends_on: []
54
+ created_at: 2026-04-30
55
+ updated_at: 2026-04-30
56
+ ---
57
+ ```
58
+
59
+ | Field | Type | Notes |
60
+ |---------------|----------------------------------------|--------------------------------------------------------------------|
61
+ | `id` | string | Must match the filename. |
62
+ | `title` | string | Plain text. |
63
+ | `status` | string | One of the configured statuses (default: `todo` / `doing` / `done`). |
64
+ | `assignee` | string \| null | Username, freeform. |
65
+ | `priority` | `high` \| `medium` \| `low` \| null | |
66
+ | `tags` | string[] | Empty list `[]` if none. |
67
+ | `depends_on` | string[] | Task IDs (e.g. `[T-002, T-007]`). Empty list if none. |
68
+ | `created_at` | ISO date `YYYY-MM-DD` | |
69
+ | `updated_at` | ISO date `YYYY-MM-DD` | Bump to today on every edit. |
70
+
71
+ Extra frontmatter keys are preserved on write but ignored by the board.
72
+
73
+ ### Body sections (Ordna schema, default)
74
+
75
+ ```markdown
76
+ ## Goal
77
+ What this task accomplishes.
78
+
79
+ ## Acceptance Criteria
80
+ - [ ] Criterion one
81
+ - [ ] Criterion two
82
+
83
+ ## Notes
84
+ Anything that doesn't fit elsewhere.
85
+
86
+ ## Progress
87
+ Append-only log of what has happened so far.
88
+ ```
89
+
90
+ The `Acceptance Criteria` checkboxes (`- [ ]` / `- [x]`) are the source of
91
+ truth for AC progress — they are parsed structurally; there is no separate
92
+ frontmatter field for them.
93
+
94
+ ### Backlog.md compatibility
95
+
96
+ Ordna can read repos that follow the
97
+ [Backlog.md](https://github.com/MrLesk/Backlog.md) schema. When
98
+ `.ordna/config.yaml` sets `schema: backlog`, files are *written* with:
99
+
100
+ - Frontmatter aliases: `labels` (instead of `tags`), `dependencies` (instead
101
+ of `depends_on`), `createdDate` / `updatedDate` (instead of `created_at` /
102
+ `updated_at`).
103
+ - Body sections: `## Description`, `## Acceptance Criteria`,
104
+ `## Implementation Plan`, `## Implementation Notes`, `## Final Summary`.
105
+
106
+ The parser accepts **both** schemas regardless of mode; only the writer
107
+ follows the configured schema. Inspect `.ordna/config.yaml` before guessing
108
+ which schema a repo uses.
109
+
110
+ ### Status model
111
+
112
+ Default: `todo → doing → done`. Statuses are configurable via
113
+ `.ordna/config.yaml`, but with no config file present, exactly these three
114
+ exist and form the Kanban columns left-to-right.
115
+
116
+ Moving a task to `done` while any task in its `depends_on` list is not yet
117
+ `done` is **rejected** by the CLI. Either complete the dependencies first or
118
+ remove them.
119
+
120
+ ### IDs
121
+
122
+ IDs are zero-padded with the configured prefix. Defaults: prefix `T`, 3-digit
123
+ padding → `T-001`, `T-002`, …, `T-1000`. Each new task is auto-incremented
124
+ from the highest existing numeric ID. Merge conflicts on IDs are resolved by
125
+ the developer — Ordna does not renumber files.
126
+
127
+ ---
128
+
129
+ ## 3. Config — `.ordna/config.yaml`
130
+
131
+ The config file is **optional**. With no config file, Ordna behaves exactly
132
+ as documented above.
133
+
134
+ ```yaml
135
+ # All keys are optional; defaults shown.
136
+ tasksDir: tasks # folder Ordna scans for task files
137
+ schema: ordna # "ordna" | "backlog"
138
+ statuses: [todo, doing, done] # Kanban columns, in left-to-right order
139
+ idPrefix: T # prefix used when generating new IDs
140
+ zeroPaddedIds: 3 # digits of zero-padding (0–10)
141
+ webPort: 7420 # default port for `ordna web`
142
+ ```
143
+
144
+ | Key | Default | Notes |
145
+ |-----------------|-----------------------|----------------------------------------------------------------------|
146
+ | `tasksDir` | `tasks` | Path is relative to the project root. |
147
+ | `schema` | `ordna` | Controls *write* format; reader accepts both. |
148
+ | `statuses` | `[todo, doing, done]` | At least one entry required. Order = column order. |
149
+ | `idPrefix` | `T` | One prefix per project. |
150
+ | `zeroPaddedIds` | `3` | `0` disables padding. Range `0..10`. |
151
+ | `webPort` | `7420` | Overridable via `ordna web --port N`. |
152
+
153
+ **Rules**
154
+
155
+ - The file lives at `.ordna/config.yaml` in the project root.
156
+ - Configuration is **additive** — it expands capability (more statuses, custom
157
+ folder, Backlog compat) but never replaces the documented defaults.
158
+ - Changing `tasksDir` only changes where Ordna *looks*; existing files are not
159
+ moved for you.
160
+ - `statuses` defines the columns 1:1, in order. The first status is the
161
+ default for newly-created tasks unless `--status` is passed.
162
+
163
+ ---
164
+
165
+ ## 4. The `ordna` CLI
166
+
167
+ Binary: `ordna` (provided by `@frehilm/ordna-cli`). Run inside the project
168
+ directory.
169
+
170
+ | Command | What it does |
171
+ |------------------------------------------|--------------------------------------------------------------------|
172
+ | `ordna init` | Create `.ordna/config.yaml` and `tasks/` if missing. |
173
+ | `ordna list` / `ordna ls` | List tasks. Filter with `-s <status>`, `-a <assignee>`, `-t <tag>`.|
174
+ | `ordna show <id>` | Print a task's frontmatter + body to stdout. |
175
+ | `ordna create <title…>` | Create a task. See options below. |
176
+ | `ordna move <id> <status>` | Move a task. Rejected if `done` and any `depends_on` task isn't done. |
177
+ | `ordna assign <id> [name]` | Assign a task; omit `name` to unassign. |
178
+ | `ordna commit -m "msg"` | Stage `tasks/` and `git commit`. **Never auto-runs.** |
179
+ | `ordna web [--port N] [--host H]` | Start the local web Kanban (opens browser). |
180
+ | `ordna board` (or just `ordna`) | Open the Kanban TUI. |
181
+ | `ordna skill install [--out p] [--from u] [--force]` | Install this AGENTS.md guide into a project. |
182
+
183
+ ### `ordna create` options
184
+
185
+ ```
186
+ -a, --assignee <name> assignee
187
+ -p, --priority <high|medium|low>
188
+ -t, --tag <tag...> one or more tags
189
+ -d, --depends-on <id...> one or more dependency IDs
190
+ -s, --status <status> initial status (defaults to first configured)
191
+ ```
192
+
193
+ ### Examples
194
+
195
+ ```bash
196
+ ordna init
197
+ ordna create "Implement payment flow" -p high -t payments
198
+ ordna create "Write tests" -d T-001 # depends on T-001
199
+ ordna list -s todo
200
+ ordna move T-001 doing
201
+ ordna assign T-001 fredrik
202
+ ordna show T-001
203
+ ordna commit -m "tasks: progress on T-001"
204
+ ```
205
+
206
+ ### Exit codes
207
+
208
+ - `0` — success
209
+ - `1` — user-visible error (missing task, blocked dependency, invalid status, etc.)
210
+
211
+ ### What the CLI does **not** do
212
+
213
+ - Auto-commit. Commits are always explicit (`ordna commit` or `git commit`).
214
+ - Renumber IDs. ID conflicts after merges are resolved manually.
215
+ - Maintain hidden state. Everything visible in the UI is on disk.