doctrina-cli 0.13.0 → 0.14.0
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.
- package/README.md +1 -1
- package/package.json +3 -2
- package/src/commands/adapter.js +205 -0
- package/src/commands/analyze.js +66 -19
- package/src/commands/change.js +100 -42
- package/src/commands/clarify.js +8 -1
- package/src/commands/close.js +57 -2
- package/src/commands/completion.js +6 -0
- package/src/commands/constitution.js +8 -1
- package/src/commands/context.js +359 -53
- package/src/commands/contract.js +17 -24
- package/src/commands/coverage.js +16 -4
- package/src/commands/decision.js +172 -40
- package/src/commands/doctor.js +38 -7
- package/src/commands/handoff.js +8 -1
- package/src/commands/hooks.js +6 -0
- package/src/commands/index-rebuild.js +8 -1
- package/src/commands/init.js +139 -6
- package/src/commands/intake.js +11 -2
- package/src/commands/intent.js +8 -1
- package/src/commands/metrics.js +80 -7
- package/src/commands/next.js +14 -2
- package/src/commands/prime.js +8 -1
- package/src/commands/report.js +8 -1
- package/src/commands/review.js +8 -1
- package/src/commands/search.js +8 -1
- package/src/commands/show.js +8 -1
- package/src/commands/skill.js +16 -6
- package/src/commands/spec.js +13 -6
- package/src/commands/status.js +14 -2
- package/src/commands/templates.js +193 -59
- package/src/commands/trace.js +15 -3
- package/src/commands/upgrade.js +8 -1
- package/src/commands/validate.js +58 -2
- package/src/commands/verify.js +12 -2
- package/src/commands/watch.js +8 -1
- package/src/commands/why.js +10 -24
- package/src/commands/work.js +8 -1
- package/src/index.js +60 -6
- package/src/lib/adapters.js +140 -0
- package/src/lib/adr-guard.js +1 -0
- package/src/lib/args.js +10 -0
- package/src/lib/clarity.js +1 -0
- package/src/lib/colors.js +1 -0
- package/src/lib/commands.js +239 -26
- package/src/lib/criteria.js +1 -0
- package/src/lib/dates.js +1 -0
- package/src/lib/diff.js +1 -0
- package/src/lib/doc-model.js +287 -0
- package/src/lib/docs-impact.js +167 -0
- package/src/lib/ears.js +1 -0
- package/src/lib/exit-codes.js +103 -0
- package/src/lib/flag-catalog.js +106 -0
- package/src/lib/fs-ops.js +1 -0
- package/src/lib/gates.js +123 -0
- package/src/lib/git.js +97 -0
- package/src/lib/index-json.js +14 -6
- package/src/lib/json-out.js +83 -0
- package/src/lib/prompt.js +18 -1
- package/src/lib/scan.js +81 -33
- package/src/lib/spec-ops.js +94 -9
- package/src/lib/suggest.js +1 -0
- package/src/lib/templates.js +89 -0
- package/src/lib/usage.js +89 -0
- package/src/lib/version.js +1 -0
- package/templates/AGENTS.md.template +59 -53
|
@@ -33,19 +33,42 @@ prompt and approves; do not make them run the CLI or hand-author artifacts.
|
|
|
33
33
|
<!-- doctrina:surface:begin — CLI-owned block, generated from the installed command catalog. Refreshed by `doctrina upgrade --write`; edits inside are overwritten. -->
|
|
34
34
|
## Doctrina command surface (generated — reach for these, don't hand-author)
|
|
35
35
|
|
|
36
|
-
Every
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
`doctrina
|
|
48
|
-
`doctrina
|
|
36
|
+
Every command, with the moment you reach for it. The CLI scaffolds from
|
|
37
|
+
canonical templates and keeps `index.json` in sync — prefer it over
|
|
38
|
+
hand-authoring. Flags and detail: `doctrina <command> --help`.
|
|
39
|
+
**Bootstrap**
|
|
40
|
+
- `doctrina init` — scaffold AGENTS.md and .doctrina/. *When:* starting a project that has no AGENTS.md yet.
|
|
41
|
+
- `doctrina intake` — store the intent and print the bootstrap playbook. *When:* you have a full project description and no specs yet.
|
|
42
|
+
- `doctrina adapter list|add|remove` — install/remove agent adapters (additive). *When:* adding or removing an agent's pointer files.
|
|
43
|
+
**Orient**
|
|
44
|
+
- `doctrina prime (session start)` — gates, standing rules, and open work in one read. *When:* at the START of every session.
|
|
45
|
+
- `doctrina context [<cap>] --for "<task>" --concat` — the read pack, assembled to fit a token budget. *When:* before working on any task, to load the right files.
|
|
46
|
+
- `doctrina show` — point-read a single artifact by reference. *When:* you need one requirement, criterion, or ADR, not a file.
|
|
47
|
+
- `doctrina search` — search the artifact tree, grouped by category. *When:* you do not know which artifact mentions a term.
|
|
48
|
+
- `doctrina status` — index, coverage, trace, and artifact counts. *When:* you need the health of the tree at a glance.
|
|
49
|
+
- `doctrina next` — the recommended next workflow action. *When:* you finished something and do not know what follows.
|
|
50
|
+
- `doctrina why` — provenance: intent, proof, ADRs, and history. *When:* you need to justify or trace a capability's existence.
|
|
51
|
+
- `doctrina handoff (before compaction/handover)` — a resume note: open work, task state, next command. *When:* BEFORE compaction or handing over to another session.
|
|
52
|
+
- `doctrina constitution` — accepted ADRs and product non-goals. *When:* you need the standing rules before deciding something.
|
|
53
|
+
**Change**
|
|
54
|
+
- `doctrina work "<prompt>" (--capability · --chore · --from-diff · --quiet)` — scaffold a change and print the playbook to execute. *When:* any request arrives that changes behaviour.
|
|
55
|
+
- `doctrina spec new|list|set` — create, list, and edit capability specs. *When:* a capability needs creating or its headers advancing.
|
|
56
|
+
- `doctrina change new|apply|archive|check|tick|diff|abandon` — new / apply / archive / check / tick / diff / abandon. *When:* driving a change through its lifecycle by hand.
|
|
57
|
+
- `doctrina contract new|list|check` — own and verify the integration surface. *When:* the change touches ports, env vars, or public endpoints.
|
|
58
|
+
- `doctrina decision new|accept|land|supersede|list|scope` — record, accept, land, scope, and supersede ADRs. *When:* the change decides something a later session must not relitigate.
|
|
59
|
+
- `doctrina skill new|list|sync|suggest` — capture on-demand procedural memory. *When:* a lesson is worth not relearning.
|
|
60
|
+
- `doctrina intent add|list` — append and list product intent anchors. *When:* new product intent appears after the intake.
|
|
61
|
+
**Gate**
|
|
62
|
+
- `doctrina analyze` — structural pre-flight on a change folder. *When:* before applying a change.
|
|
63
|
+
- `doctrina clarify --all (--lang pt|en)` — smell-test Markdown for ambiguity. *When:* before applying, or before opening a PR.
|
|
64
|
+
- `doctrina validate (--fix)` — schema, structure, EARS, and index drift. *When:* after any artifact edit, and before considering work done.
|
|
65
|
+
- `doctrina coverage --strict` — acceptance criteria against cited evidence. *When:* before claiming a capability is proven.
|
|
66
|
+
- `doctrina trace --strict` — intent provenance across the tree. *When:* checking that product intent still maps to capabilities.
|
|
67
|
+
- `doctrina review` — conformance of your changes vs specs/ADRs/contracts. *When:* before handing work back, to self-review it.
|
|
68
|
+
- `doctrina verify` — the project's declared typecheck/test/build checks. *When:* the real build gate must run.
|
|
69
|
+
- `doctrina close <id...>` — the whole closing sequence in one attested pass. *When:* a change is implemented and ready to finish.
|
|
70
|
+
- `doctrina doctor` — aggregate diagnostic with per-finding remedies. *When:* something looks wrong and you do not know which gate to ask.
|
|
71
|
+
**Maintain** (triggers: `doctrina <command> --help`) — `doctrina templates list|check|update` · `doctrina hooks install` · `doctrina index rebuild` · `doctrina watch` · `doctrina metrics` · `doctrina report` · `doctrina completion` · `doctrina upgrade --write`
|
|
49
72
|
<!-- doctrina:surface:end -->
|
|
50
73
|
|
|
51
74
|
## Stack and tooling
|
|
@@ -78,55 +101,38 @@ Session bookends: `doctrina prime` to orient at session start;
|
|
|
78
101
|
- Archived changes in `.doctrina/changes/archive/` are out of the default
|
|
79
102
|
read path; consult only when explicitly debugging history.
|
|
80
103
|
|
|
81
|
-
## Artifact invariants (
|
|
82
|
-
|
|
83
|
-
Scaffold
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- **
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
- **Change folder** at `.doctrina/changes/<id>/` must contain a file named
|
|
97
|
-
exactly `proposal.md` (not `change.md`, not `README.md`). `tasks.md` and
|
|
98
|
-
`design.md` are optional siblings.
|
|
99
|
-
- **Spec** lives at `.doctrina/specs/<capability>/spec.md` and its
|
|
100
|
-
`**Version:**` header must equal the `version` recorded for it in
|
|
101
|
-
`.doctrina/index.json`.
|
|
102
|
-
- **Every artifact on disk** must be registered in `.doctrina/index.json`,
|
|
103
|
-
and every path in `index.json` must exist on disk. Update the index in
|
|
104
|
-
the same change that adds or moves a file.
|
|
105
|
-
|
|
106
|
-
Always finish by running `doctrina validate` and resolving every `error:`
|
|
107
|
-
before considering work done.
|
|
104
|
+
## Artifact invariants (`doctrina validate` enforces these)
|
|
105
|
+
|
|
106
|
+
Scaffold with the CLI; do not hand-author from memory. If you must:
|
|
107
|
+
|
|
108
|
+
- **Headers:** ADRs / proposals / intake use list items
|
|
109
|
+
(`- **Status:** accepted`); specs use bare bold (`**Status:** active`).
|
|
110
|
+
- **ADR filename:** `NNNN-slug.md`, four digits. Other shapes are invisible
|
|
111
|
+
to `decision accept`, the index, and the orphan check.
|
|
112
|
+
- **Change folder:** `.doctrina/changes/<id>/proposal.md`, that exact name.
|
|
113
|
+
- **Spec:** `.doctrina/specs/<cap>/spec.md`; its `**Version:**` must equal
|
|
114
|
+
the version recorded in `index.json`.
|
|
115
|
+
- **Every artifact** is registered in `index.json`, and every indexed path
|
|
116
|
+
exists. Update the index in the same change.
|
|
117
|
+
|
|
118
|
+
Finish by running `doctrina validate` and resolving every `error:`.
|
|
108
119
|
|
|
109
120
|
## How to read context efficiently
|
|
110
121
|
|
|
111
122
|
`doctrina context [<capability>] --concat` assembles the read pack in one
|
|
112
|
-
call
|
|
113
|
-
|
|
114
|
-
`Status: accepted`. Run it for ANY task, not only `doctrina work`; it skips
|
|
115
|
-
`changes/archive/` (history — read only when debugging it).
|
|
123
|
+
call: this `AGENTS.md` → `product.md` → the capability spec → open changes →
|
|
124
|
+
accepted ADRs. Run it for ANY task. It skips `changes/archive/` (history).
|
|
116
125
|
|
|
117
|
-
|
|
118
|
-
|
|
126
|
+
Skills are on demand: read the `description:` / `when:` frontmatter in
|
|
127
|
+
`.doctrina/skills/`; load a body only when its trigger fires.
|
|
119
128
|
|
|
120
|
-
Keep this file under 150 lines. Density beats prose.
|
|
129
|
+
Keep this file under 150 lines. Density beats prose.
|
|
121
130
|
|
|
122
131
|
## Definition of done
|
|
123
132
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
- The change folder has been moved to `.doctrina/changes/archive/`.
|
|
128
|
-
- Any architectural decisions are recorded as ADRs with `Status: accepted`.
|
|
129
|
-
- `.doctrina/index.json` has been updated.
|
|
133
|
+
`doctrina close <id>` is the definition: tasks checked, deltas merged into
|
|
134
|
+
specs, gates green, ADRs recorded and accepted, change archived, index
|
|
135
|
+
updated. If close refuses, the change is not done.
|
|
130
136
|
|
|
131
137
|
## What never goes in this file
|
|
132
138
|
|