doctrina-cli 0.16.0 → 0.17.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 +27 -72
- package/package.json +3 -3
- package/src/commands/adapter.js +3 -2
- package/src/commands/analyze.js +8 -0
- package/src/commands/change.js +28 -77
- package/src/commands/clarify.js +8 -1
- package/src/commands/close.js +65 -10
- package/src/commands/completion.js +8 -2
- package/src/commands/context.js +6 -4
- package/src/commands/decision.js +12 -0
- package/src/commands/doctor.js +1 -1
- package/src/commands/hooks.js +6 -1
- package/src/commands/index-rebuild.js +52 -2
- package/src/commands/init.js +19 -4
- package/src/commands/intake.js +55 -7
- package/src/commands/intent.js +14 -1
- package/src/commands/metrics.js +13 -5
- package/src/commands/next.js +1 -1
- package/src/commands/prime.js +4 -5
- package/src/commands/report.js +9 -20
- package/src/commands/skill.js +8 -15
- package/src/commands/spec.js +13 -7
- package/src/commands/status.js +39 -20
- package/src/commands/templates.js +4 -10
- package/src/commands/upgrade.js +31 -6
- package/src/commands/validate.js +32 -8
- package/src/commands/work.js +10 -5
- package/src/index.js +34 -6
- package/src/lib/actions.js +30 -24
- package/src/lib/args.js +14 -0
- package/src/lib/change-ops.js +3 -1
- package/src/lib/commands.js +88 -15
- package/src/lib/coverage-model.js +40 -1
- package/src/lib/doc-model.js +47 -6
- package/src/lib/docs-impact.js +74 -0
- package/src/lib/ears.js +24 -1
- package/src/lib/gates.js +53 -9
- package/src/lib/index-json.js +40 -5
- package/src/lib/intake-model.js +71 -2
- package/src/lib/lexicon.js +38 -1
- package/src/lib/metrics-model.js +30 -0
- package/src/lib/project.js +49 -1
- package/src/lib/scan.js +126 -14
- package/src/lib/snapshot.js +23 -1
- package/src/lib/spec-ops.js +24 -5
- package/src/lib/templates-model.js +35 -8
- package/src/lib/validation-model.js +116 -34
- package/src/lib/views.js +4 -1
- package/src/lib/work-model.js +25 -0
- package/templates/AGENTS.md.template +3 -4
- package/templates/adapters/claude/.claude/commands/doctrina-work.md.template +6 -3
- package/templates/adapters/cursor/.cursor/commands/doctrina-work.md.template +4 -3
- package/templates/change/proposal.md.template +15 -0
- package/templates/change/tasks.md.template +3 -8
- package/templates/contract.md.template +2 -2
- package/templates/hooks/pre-commit.sample +10 -0
- package/templates/playbooks/bootstrap.md.template +6 -2
- package/templates/playbooks/chore.md.template +9 -4
- package/templates/playbooks/work.md.template +10 -3
- package/src/commands/constitution.js +0 -68
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import process from "node:process";
|
|
4
|
-
import { readdirSync } from "node:fs";
|
|
5
|
-
import { exists, isDir, isFile, read } from "../lib/fs-ops.js";
|
|
6
|
-
import { listHeader } from "../lib/scan.js";
|
|
7
|
-
import { c } from "../lib/colors.js";
|
|
8
|
-
import { notADoctrinaProject } from "../lib/exit-codes.js";
|
|
9
|
-
import { acceptedDecisions, productSection } from "../lib/constitution-model.js";
|
|
10
|
-
import { collectSnapshot } from "../lib/snapshot.js";
|
|
11
|
-
import { renderView } from "../lib/views.js";
|
|
12
|
-
|
|
13
|
-
// Read by the project snapshot as well; see lib/constitution-model.js.
|
|
14
|
-
export { acceptedDecisions, productSection } from "../lib/constitution-model.js";
|
|
15
|
-
|
|
16
|
-
// The project's standing rules in one read — Spec Kit parity for its
|
|
17
|
-
// `constitution.md`, but ASSEMBLED, not a new home for facts. Doctrina's
|
|
18
|
-
// constitution is its accepted ADRs (the immutable decisions that govern how
|
|
19
|
-
// the codebase evolves) plus the product's declared non-goals. Both already
|
|
20
|
-
// own those facts elsewhere; this is a read-only digest that gathers them so a
|
|
21
|
-
// human or agent (especially one migrating from Spec Kit, which expects a
|
|
22
|
-
// single constitution) can see "the rules" without reading the whole tree.
|
|
23
|
-
//
|
|
24
|
-
// To change a principle, supersede its ADR; to change a non-goal, edit
|
|
25
|
-
// product.md. The command never writes — it has nothing of its own to own.
|
|
26
|
-
|
|
27
|
-
// Flags this command accepts. Declared HERE, with the command, so
|
|
28
|
-
// adding a command never requires editing the entrypoint — the gap that
|
|
29
|
-
// let six flags ship undeclared and silently swallow a positional (C3).
|
|
30
|
-
export const flags = { boolean: ["json"], string: [] };
|
|
31
|
-
|
|
32
|
-
export async function run(_positional, _flags) {
|
|
33
|
-
const projectRoot = process.cwd();
|
|
34
|
-
if (!exists(path.join(projectRoot, ".doctrina"))) {
|
|
35
|
-
throw notADoctrinaProject();
|
|
36
|
-
}
|
|
37
|
-
// Deprecated (change 0049): the standing rules are a VIEW of the shared
|
|
38
|
-
// collection, and `prime --rules` renders it. This command prints the same
|
|
39
|
-
// lines — not a similar set, the same ones — so the deprecation is a
|
|
40
|
-
// rename with a warning rather than a loss.
|
|
41
|
-
for (const line of renderView("rules", collectSnapshot(projectRoot))) console.log(line);
|
|
42
|
-
return 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function projectName(projectRoot) {
|
|
46
|
-
try {
|
|
47
|
-
return JSON.parse(read(path.join(projectRoot, ".doctrina", "index.json"))).project
|
|
48
|
-
?? path.basename(projectRoot);
|
|
49
|
-
} catch {
|
|
50
|
-
return path.basename(projectRoot);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
export const help = `
|
|
56
|
-
Usage: doctrina constitution
|
|
57
|
-
|
|
58
|
-
Print the project's standing rules in one read: the accepted ADRs (the
|
|
59
|
-
immutable decisions that govern how the codebase evolves) and the product's
|
|
60
|
-
declared non-goals. Read-only — it assembles facts the ADRs and product.md
|
|
61
|
-
already own; it never writes.
|
|
62
|
-
|
|
63
|
-
This is the Spec Kit \`constitution.md\` analogue: a single place to see the
|
|
64
|
-
non-negotiables. To change one, supersede the ADR or edit product.md.
|
|
65
|
-
|
|
66
|
-
DEPRECATED: use \`doctrina prime --rules\`, which prints exactly these lines.
|
|
67
|
-
This name keeps working and will be removed in a future minor.
|
|
68
|
-
`;
|