discipline-md 0.1.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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +80 -0
  3. package/bin/discipline.js +587 -0
  4. package/package.json +40 -0
  5. package/templates/.claude/settings.json +58 -0
  6. package/templates/AGENTS.md +463 -0
  7. package/templates/AGENT_TRACKER.md +138 -0
  8. package/templates/API_REFERENCE.md +131 -0
  9. package/templates/ARCHITECTURE.md +89 -0
  10. package/templates/ASSETS.md +90 -0
  11. package/templates/AUTONOMOUS_QUEUE.md +119 -0
  12. package/templates/BUILD_PLAN.md +89 -0
  13. package/templates/CHANGELOG.md +90 -0
  14. package/templates/CLAUDE.md +89 -0
  15. package/templates/CREDITS.md +109 -0
  16. package/templates/DATA_MODEL.md +88 -0
  17. package/templates/DECISIONS.md +120 -0
  18. package/templates/DEPLOYMENT.md +342 -0
  19. package/templates/HANDOFF.md +289 -0
  20. package/templates/IMPROVEMENT_LOOP.md +103 -0
  21. package/templates/INVESTIGATION.md +154 -0
  22. package/templates/LICENSE +68 -0
  23. package/templates/NOTICE +55 -0
  24. package/templates/OPEN_DECISIONS.md +61 -0
  25. package/templates/PLAYBOOK_FEEDBACK.md +87 -0
  26. package/templates/PROJECT_CONTEXT.md +91 -0
  27. package/templates/README.md +60 -0
  28. package/templates/ROADMAP.md +96 -0
  29. package/templates/SECURITY_AUDIT.md +235 -0
  30. package/templates/SETUP.md +162 -0
  31. package/templates/SPEC.md +105 -0
  32. package/templates/SPEC_WORKFLOW.md +173 -0
  33. package/templates/TODO.md +118 -0
  34. package/templates/USAGE.md +153 -0
  35. package/templates/VERIFICATION_GATE.md +68 -0
  36. package/templates/agents/CROSS_REPO_SYNC.md +124 -0
  37. package/templates/agents/DEBUGGER.md +112 -0
  38. package/templates/agents/PLANNER.md +111 -0
  39. package/templates/agents/README.md +64 -0
  40. package/templates/agents/RECON.md +99 -0
  41. package/templates/agents/SECURITY_REVIEWER.md +123 -0
  42. package/templates/agents/SPEC_ARCHITECT.md +133 -0
  43. package/templates/agents/STAKEHOLDER.md +197 -0
  44. package/templates/agents/_TEMPLATE.md +116 -0
  45. package/templates/agents/optional/ARCHITECT.md +109 -0
  46. package/templates/agents/optional/BACKEND_IMPACT.md +108 -0
  47. package/templates/agents/optional/DOC_AUDIT.md +108 -0
  48. package/templates/agents/optional/FRONTEND_IMPACT.md +109 -0
  49. package/templates/agents/optional/QUEUE_CURATOR.md +114 -0
  50. package/templates/agents/optional/TEST_STRATEGIST.md +107 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 John Hardy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # Discipline
2
+
3
+ A small set of docs, conventions, and a tiny CLI for keeping AI coding agents on the rails over the long haul — past the first session and into session 100, when the usual single-file `AGENTS.md` has quietly gone stale.
4
+
5
+ **Honest framing:** this is what works for me. It's heavier on tokens than a minimal `AGENTS.md` — there are more docs, and the agent reads the ones it needs — but on longer-running projects it's given me noticeably better results: fewer stale docs, less agent drift, less cleanup after the fact. It's opinionated on purpose. Your mileage will vary.
6
+
7
+ I've used it most with **Claude Code**, but it's deliberately **agent- and model-agnostic** — it's just plain Markdown plus a small zero-dependency CLI, so it should work with Cursor, Codex, Aider, OpenCode, local models, or whatever you run. How well it works depends on the model you point at it; stronger models follow the conventions more reliably.
8
+
9
+ You can drop it into a new project or layer it onto an existing one.
10
+
11
+ ## How it's different
12
+
13
+ Most starter kits optimize session 1: one short `AGENTS.md`, terse rules, minimal startup tokens. That's great for a week. This optimizes for the project that's still going months later.
14
+
15
+ | Common approach | Discipline |
16
+ |---|---|
17
+ | One `AGENTS.md`, kept tiny | Hot/cold path docs — the agent loads only what the task needs |
18
+ | `[x] DONE` piling up in TODO | TODO entries are DELETED on ship — it's a queue, not a log |
19
+ | CHANGELOG + FEATURES + RELEASES drifting apart | One canonical CHANGELOG |
20
+ | "Just let the agent run" | Two-gate autonomy: a tag scheme + a curated queue before anything runs unattended |
21
+ | Build straight from a one-line ask | An optional spec-first flow: plain-English spec → technical plan → checks, before code |
22
+
23
+ ## Core ideas
24
+
25
+ 1. **Hot/cold path docs.** Some docs are read every session; others only when the agent works in that area. The split keeps the always-loaded context small as the project grows.
26
+ 2. **The cleanup gate is a hard rule.** Shipped TODO entries get deleted; every CHANGELOG entry has a date. It runs at session end, not "when convenient."
27
+ 3. **Two-gate autonomy.** A `[autonomy: …]` tag says what kind of work something is; a curated queue says which specific items are pre-approved. Being "safe" isn't enough on its own — it also has to be queued.
28
+ 4. **Improvement with guardrails.** Workflow-change proposals have to point at concrete friction they remove. Aspirational guidance that doesn't earn its place is worse than no guidance.
29
+ 5. **Expensive models only where they earn it.** The host runs on a workhorse model and spawns a stronger one for the genuinely hard subtask, rather than paying top-tier rates for the whole session.
30
+ 6. **Provider-agnostic tiers.** Frontier / Workhorse / Recon as the canonical tiers, so the playbook doesn't churn every time a vendor renames a model.
31
+ 7. **A spec-first flow.** A one-line request isn't a buildable contract. The optional Spec & Design flow turns it into a plain-English spec, then a technical plan with checks, before any code — so an agent builds the right thing instead of confidently building the wrong one. See [`templates/SPEC_WORKFLOW.md`](templates/SPEC_WORKFLOW.md).
32
+
33
+ ## Quick start
34
+
35
+ ```bash
36
+ # Drop the templates into your project's docs/ folder
37
+ npx discipline-md init
38
+ ```
39
+
40
+ That scaffolds a `docs/` folder with the core templates plus a repo-root `LICENSE` and `NOTICE`. Fill in the placeholders, point your agent at `docs/AGENTS.md`, and it has a working playbook from the first session.
41
+
42
+ For wiring it to a specific harness (Claude Code's `CLAUDE.md`, Cursor rules, or `AGENTS.md`-native tools), see [`docs/HARNESS_INTEGRATION.md`](docs/HARNESS_INTEGRATION.md).
43
+
44
+ ## What ships
45
+
46
+ `npx discipline-md init` installs a **small core set** — the docs and agent roles a project actually needs from day one. The idea is to ship the minimum that's genuinely useful and add more only when a real need shows up, rather than a giant pile of stubs. Everything else is opt-in:
47
+
48
+ ```bash
49
+ npx discipline-md add <template> # e.g. ARCHITECTURE, DATA_MODEL, DEPLOYMENT
50
+ npx discipline-md add-role <ROLE> # extra agent roles, when a project needs them
51
+ npx discipline-md list # see what's available
52
+ ```
53
+
54
+ ## Lint
55
+
56
+ A gate a weak model can forget isn't really a gate, so there's a small linter for the mechanical ones:
57
+
58
+ ```bash
59
+ npx discipline-md lint # lint ./docs/
60
+ npx discipline-md lint --target <path> # lint another repo
61
+ npx discipline-md lint --strict # warnings also fail the run
62
+ ```
63
+
64
+ It checks things like `[x]` residue in TODO, tag values outside the documented set, queue entries with no backing task, oversized always-loaded docs, unfilled placeholders, stale handoffs, and the spec-flow conventions. Exit 1 on any error (or any warning under `--strict`); rules skip quietly when their file doesn't exist. Wire it into CI or your end-of-session checklist.
65
+
66
+ ## Status
67
+
68
+ Early and evolving. It's used and maintained on real projects — that dogfooding is the validation. The templates and the CLI are the stable core.
69
+
70
+ ## License
71
+
72
+ MIT. See [LICENSE](LICENSE).
73
+
74
+ ## Contributing
75
+
76
+ Issues and PRs are welcome — especially friction you've hit on existing `AGENTS.md` / starter-kit setups, since that's what this is meant to fix.
77
+
78
+ - Every change lands via pull request and is reviewed by the maintainer, who is the final approver. (A local pre-push hook blocks direct pushes to the default branch.)
79
+ - One concern per PR.
80
+ - This competes on *discipline*, not template count — proposals that add breadth for its own sake will be declined; ones that close a real, demonstrated gap are exactly right.