@imix-js/taproot 0.2.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 (124) hide show
  1. package/README.md +88 -0
  2. package/dist/adapters/index.d.ts +20 -0
  3. package/dist/adapters/index.js +452 -0
  4. package/dist/adapters/index.js.map +1 -0
  5. package/dist/cli.d.ts +2 -0
  6. package/dist/cli.js +40 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/commands/acceptance-check.d.ts +26 -0
  9. package/dist/commands/acceptance-check.js +213 -0
  10. package/dist/commands/acceptance-check.js.map +1 -0
  11. package/dist/commands/check-orphans.d.ts +8 -0
  12. package/dist/commands/check-orphans.js +157 -0
  13. package/dist/commands/check-orphans.js.map +1 -0
  14. package/dist/commands/commithook.d.ts +15 -0
  15. package/dist/commands/commithook.js +389 -0
  16. package/dist/commands/commithook.js.map +1 -0
  17. package/dist/commands/coverage.d.ts +41 -0
  18. package/dist/commands/coverage.js +390 -0
  19. package/dist/commands/coverage.js.map +1 -0
  20. package/dist/commands/dod.d.ts +13 -0
  21. package/dist/commands/dod.js +141 -0
  22. package/dist/commands/dod.js.map +1 -0
  23. package/dist/commands/init.d.ts +14 -0
  24. package/dist/commands/init.js +378 -0
  25. package/dist/commands/init.js.map +1 -0
  26. package/dist/commands/link-commits.d.ts +12 -0
  27. package/dist/commands/link-commits.js +126 -0
  28. package/dist/commands/link-commits.js.map +1 -0
  29. package/dist/commands/overview.d.ts +6 -0
  30. package/dist/commands/overview.js +192 -0
  31. package/dist/commands/overview.js.map +1 -0
  32. package/dist/commands/plan.d.ts +23 -0
  33. package/dist/commands/plan.js +167 -0
  34. package/dist/commands/plan.js.map +1 -0
  35. package/dist/commands/sync-check.d.ts +8 -0
  36. package/dist/commands/sync-check.js +118 -0
  37. package/dist/commands/sync-check.js.map +1 -0
  38. package/dist/commands/update.d.ts +7 -0
  39. package/dist/commands/update.js +309 -0
  40. package/dist/commands/update.js.map +1 -0
  41. package/dist/commands/validate-format.d.ts +8 -0
  42. package/dist/commands/validate-format.js +93 -0
  43. package/dist/commands/validate-format.js.map +1 -0
  44. package/dist/commands/validate-structure.d.ts +8 -0
  45. package/dist/commands/validate-structure.js +29 -0
  46. package/dist/commands/validate-structure.js.map +1 -0
  47. package/dist/core/config.d.ts +6 -0
  48. package/dist/core/config.js +86 -0
  49. package/dist/core/config.js.map +1 -0
  50. package/dist/core/configuration.d.ts +7 -0
  51. package/dist/core/configuration.js +112 -0
  52. package/dist/core/configuration.js.map +1 -0
  53. package/dist/core/dod-runner.d.ts +20 -0
  54. package/dist/core/dod-runner.js +233 -0
  55. package/dist/core/dod-runner.js.map +1 -0
  56. package/dist/core/dor-runner.d.ts +18 -0
  57. package/dist/core/dor-runner.js +156 -0
  58. package/dist/core/dor-runner.js.map +1 -0
  59. package/dist/core/fs-walker.d.ts +5 -0
  60. package/dist/core/fs-walker.js +74 -0
  61. package/dist/core/fs-walker.js.map +1 -0
  62. package/dist/core/git.d.ts +24 -0
  63. package/dist/core/git.js +76 -0
  64. package/dist/core/git.js.map +1 -0
  65. package/dist/core/impl-reader.d.ts +8 -0
  66. package/dist/core/impl-reader.js +39 -0
  67. package/dist/core/impl-reader.js.map +1 -0
  68. package/dist/core/language.d.ts +39 -0
  69. package/dist/core/language.js +159 -0
  70. package/dist/core/language.js.map +1 -0
  71. package/dist/core/markdown-parser.d.ts +3 -0
  72. package/dist/core/markdown-parser.js +37 -0
  73. package/dist/core/markdown-parser.js.map +1 -0
  74. package/dist/core/reporter.d.ts +3 -0
  75. package/dist/core/reporter.js +33 -0
  76. package/dist/core/reporter.js.map +1 -0
  77. package/dist/templates/index.d.ts +4 -0
  78. package/dist/templates/index.js +126 -0
  79. package/dist/templates/index.js.map +1 -0
  80. package/dist/validators/format-rules.d.ts +10 -0
  81. package/dist/validators/format-rules.js +238 -0
  82. package/dist/validators/format-rules.js.map +1 -0
  83. package/dist/validators/structure-rules.d.ts +10 -0
  84. package/dist/validators/structure-rules.js +94 -0
  85. package/dist/validators/structure-rules.js.map +1 -0
  86. package/dist/validators/types.d.ts +68 -0
  87. package/dist/validators/types.js +2 -0
  88. package/dist/validators/types.js.map +1 -0
  89. package/docs/agents.md +88 -0
  90. package/docs/architecture.md +53 -0
  91. package/docs/cli.md +226 -0
  92. package/docs/concepts.md +268 -0
  93. package/docs/configuration.md +255 -0
  94. package/docs/demo.svg +111 -0
  95. package/docs/patterns.md +118 -0
  96. package/docs/security.md +95 -0
  97. package/docs/workflows.md +151 -0
  98. package/languages/de.json +20 -0
  99. package/languages/en.json +20 -0
  100. package/languages/es.json +20 -0
  101. package/languages/fr.json +20 -0
  102. package/languages/ja.json +20 -0
  103. package/languages/pt.json +20 -0
  104. package/package.json +54 -0
  105. package/skills/analyse-change.md +101 -0
  106. package/skills/behaviour.md +179 -0
  107. package/skills/bug.md +70 -0
  108. package/skills/commit.md +99 -0
  109. package/skills/decompose.md +101 -0
  110. package/skills/discover.md +392 -0
  111. package/skills/grill-me.md +65 -0
  112. package/skills/guide.md +118 -0
  113. package/skills/implement.md +149 -0
  114. package/skills/ineed.md +147 -0
  115. package/skills/intent.md +104 -0
  116. package/skills/plan.md +63 -0
  117. package/skills/promote.md +69 -0
  118. package/skills/refine.md +78 -0
  119. package/skills/research.md +122 -0
  120. package/skills/review-all.md +92 -0
  121. package/skills/review.md +80 -0
  122. package/skills/status.md +103 -0
  123. package/skills/sweep.md +89 -0
  124. package/skills/trace.md +151 -0
@@ -0,0 +1,65 @@
1
+ # Skill: grill-me
2
+
3
+ ## Description
4
+
5
+ Interview the user relentlessly about a plan or design, resolving each decision branch with a recommendation until shared understanding is reached.
6
+
7
+ Based on Matt Pocock's `grill-me` skill (MIT licensed, https://github.com/mattpocock/skills/blob/main/grill-me/SKILL.md).
8
+
9
+ ## Inputs
10
+
11
+ - `plan` (required): The plan, design decision, or concept to explore. Can be a few words or a paragraph — the skill will sharpen it.
12
+
13
+ ## Steps
14
+
15
+ 1. Identify the key decision branches in the plan — the points where different choices lead to meaningfully different outcomes. These become the agenda for the session. If the plan relates to an existing taproot artefact, read the relevant `usecase.md` or `intent.md` now (and `taproot/OVERVIEW.md` if you need the broader hierarchy context).
16
+
17
+ 3. For each unresolved branch, in dependency order:
18
+
19
+ a. **Ask the question** — one question at a time, never more
20
+ b. **Immediately provide your recommended answer** — the developer should react to your recommendation, not start from scratch. Say: "My recommendation: [answer]. What do you think?"
21
+ c. If the question can be answered by exploring the codebase or hierarchy, do that instead of asking. Present what you found: "I checked `<path>` — it already handles X, so this resolves to Y."
22
+ d. When the developer responds: accept, refine, or push back on their answer. If their answer is vague or incomplete, probe once more before marking the branch resolved.
23
+ e. Mark the branch resolved and move to the next.
24
+
25
+ 4. Continue until all identified branches are resolved or explicitly deferred (developer says "skip this for now" — mark it deferred with their reason).
26
+
27
+ 5. If the plan is too vague to extract decision branches, ask one grounding question first: "What specifically are you trying to decide? What outcome are you aiming for?" Then proceed from step 2.
28
+
29
+ 6. Present a decision synthesis:
30
+
31
+ ```
32
+ ## Decisions resolved
33
+ - [branch]: [chosen path] — [reason]
34
+
35
+ ## Deferred
36
+ - [branch]: deferred — [reason / what would trigger revisiting]
37
+
38
+ ## Constraints surfaced
39
+ - [constraint or risk that emerged]
40
+ ```
41
+
42
+ Then present next steps:
43
+
44
+ > 💡 If this session is getting long, consider running `/compact` or starting a fresh context before the next task.
45
+
46
+ **What's next?**
47
+ [A] `/tr-ineed "<clarified requirement>"` — route the sharpened requirement into the hierarchy
48
+ [B] `/tr-behaviour <path>/` — write the spec now that the design is clear
49
+
50
+ ## Output
51
+
52
+ A structured decision synthesis with every branch resolved or explicitly deferred, and a recommended next action. When called from another skill (embedded mode), the synthesis is passed back to the calling skill as structured input rather than presented as a standalone report.
53
+
54
+ ## CLI Dependencies
55
+
56
+ None — pure agent skill.
57
+
58
+ ## Notes
59
+
60
+ - **"Relentless"** means the agent does not drop a branch because the developer gives a short answer. Push until the branch is genuinely resolved or explicitly deferred with a stated reason.
61
+ - **Always recommend first.** The session is a dialogue about recommendations, not a blank-slate interview. Developers can agree, refine, or reject — but they should never have to start from scratch.
62
+ - **One question at a time.** Batching questions lets the developer give vague omnibus answers. One question forces a specific answer on each branch.
63
+ - **Explore the codebase proactively.** Many questions about existing behaviour, architecture, or conventions can be answered by reading files — do this instead of asking.
64
+ - **Distinction from `/taproot:review`** (formerly `tr-grill`): `tr-review` stress-tests a finished taproot artefact from an adversarial reviewer's perspective. `tr-grill-me` interviews the developer *before* the artefact is written, to sharpen the thinking that goes into it.
65
+ - **Called by other skills:** `/taproot:ineed` delegates to `grill-me` on the "Go deeper [A]" path. When called in embedded mode, output the synthesis summary to the calling skill context rather than presenting it to the user.
@@ -0,0 +1,118 @@
1
+ # Skill: guide
2
+
3
+ ## Description
4
+
5
+ Present a tailored onboarding guide for the Taproot workflow. Explains what Taproot is, the three-layer hierarchy, available slash commands, CLI tools, and where to start. Read-only — no files are created or modified.
6
+
7
+ ## Inputs
8
+
9
+ None required. The skill reads current project state to tailor the guide.
10
+
11
+ ## Steps
12
+
13
+ 1. Check whether `taproot/` exists in the project root. If it does, check whether any intent directories exist (subdirectories containing an `intent.md` file). Note whether `taproot/OVERVIEW.md` exists.
14
+
15
+ 2. Present the following guide, tailored to current state:
16
+
17
+ ---
18
+
19
+ **Taproot** is a requirements traceability system that links business intent to code through a three-layer hierarchy.
20
+
21
+ ### The Three-Layer Hierarchy
22
+
23
+ ```
24
+ taproot/
25
+ └── <intent>/ # Why — business goal, stakeholders, success criteria
26
+ └── <behaviour>/ # What — use cases, acceptance criteria
27
+ └── <impl>/ # How — code, tests, traceability records
28
+ ```
29
+
30
+ Every folder is identified by its marker file: `intent.md`, `usecase.md`, or `impl.md`.
31
+
32
+ ### Typical Workflow
33
+
34
+ ```
35
+ ineed → intent → behaviour → implement → trace → status
36
+ ```
37
+
38
+ 1. **ineed** — route a requirement to the right place; runs structured discovery for vague ideas
39
+ 2. **intent** — define a business goal with stakeholders and success criteria
40
+ 3. **behaviour** — specify use cases under an intent (or decompose an intent first)
41
+ 4. **implement** — write code, tests, and an `impl.md` traceability record
42
+ 5. **trace** — link recent commits back to existing taproot documents
43
+ 6. **status** — health dashboard: coverage, orphans, stale specs
44
+
45
+ ### Slash Commands (AI-driven content creation)
46
+
47
+ | Command | Purpose |
48
+ |---|---|
49
+ | `/tr-ineed` | Route a requirement; runs structured discovery for vague ideas |
50
+ | `/tr-bug` | Diagnose a defect through 5-Why root cause analysis and delegate to the right fix skill |
51
+ | `/tr-intent` | Create or refine a business intent document |
52
+ | `/tr-behaviour` | Define use cases under an intent or another behaviour |
53
+ | `/tr-decompose` | Break an intent into multiple behaviours |
54
+ | `/tr-implement` | Implement a behaviour with code, tests, and `impl.md` |
55
+ | `/tr-trace` | Navigate the hierarchy in any direction — file to intent (bottom-up), intent to code (top-down), lateral across siblings |
56
+ | `/tr-status` | Generate a health dashboard for the hierarchy |
57
+ | `/tr-review` | Stress-test a spec with adversarial questions |
58
+ | `/tr-review-all` | Run review across an entire subtree |
59
+ | `/tr-grill-me` | Interview the user relentlessly to sharpen a plan or design |
60
+ | `/tr-research` | Research a domain or technical subject before speccing — local resources, web search, expert grilling |
61
+ | `/tr-sweep` | Apply a uniform task to a filtered set of hierarchy files — enumerate, confirm, then call `taproot apply` |
62
+ | `/tr-commit` | Execute the full commit procedure: classify type, run proactive gates, resolve DoD/DoR conditions, stage, and commit |
63
+ | `/tr-refine` | Update a behaviour spec based on implementation learnings |
64
+ | `/tr-promote` | Move discoveries from implementation back upstream |
65
+ | `/tr-guide` | Show this guide |
66
+
67
+ ### CLI Commands (validation and reporting)
68
+
69
+ | Command | Purpose |
70
+ |---|---|
71
+ | `taproot validate-structure` | Check folder and file naming conventions |
72
+ | `taproot validate-format` | Check document frontmatter, required fields, and cross-link sections |
73
+ | `taproot check-orphans` | Find folders missing their marker files |
74
+ | `taproot coverage` | Show implementation coverage across the hierarchy |
75
+ | `taproot sync-check` | Detect specs that may be stale relative to code |
76
+ | `taproot overview` | Regenerate `taproot/OVERVIEW.md` summary |
77
+ | `taproot dod [impl-path]` | Run Definition of Done checks; mark impl complete if all pass |
78
+ | `taproot commithook` | Pre-commit gate: classifies staged files and runs DoR or DoD as appropriate |
79
+ | `taproot update` | Refresh agent adapters, skills, and cross-link sections across the hierarchy |
80
+ | `taproot init` | Initialize Taproot in a project |
81
+
82
+ ### Rule of Thumb
83
+
84
+ > **Slash commands for content, CLI for validation.**
85
+ >
86
+ > Use `/tr-*` commands when you want the AI to create or update documents.
87
+ > Use `taproot` CLI commands to validate, report, and check structural integrity.
88
+
89
+ ---
90
+
91
+ 3. After presenting the guide, add a context-aware note:
92
+
93
+ - **If `taproot/OVERVIEW.md` exists**: "Your project has an overview at `taproot/OVERVIEW.md` — read it for a summary of current intents and their status."
94
+ - **If intents exist but no OVERVIEW.md**: "Your project has existing intents. Run `taproot overview` to generate a summary, or use `/tr-status` for a full health report."
95
+ - **If no intents exist yet** (empty or missing `taproot/`): "This looks like a new project. A good starting point: describe your problem to `/tr-ineed`, or jump straight to `/tr-intent` if you already know what you want to build."
96
+
97
+ 4. Close with context-aware guidance:
98
+
99
+ Nothing obvious next — whenever you're ready:
100
+
101
+ > 💡 If this session is getting long, consider running `/compact` or starting a fresh context before the next task.
102
+
103
+ **What's next?**
104
+ [A] `/tr-ineed` — capture your first (or next) requirement
105
+ [B] `/tr-status` — see the current project health at a glance
106
+
107
+ ## Output
108
+
109
+ A formatted guide presented in the conversation. No files are created or modified.
110
+
111
+ ## CLI Dependencies
112
+
113
+ None.
114
+
115
+ ## Notes
116
+
117
+ - This skill is read-only. It reports, it does not modify.
118
+ - The guide is intentionally self-contained — it can be understood without prior Taproot knowledge.
@@ -0,0 +1,149 @@
1
+ # Skill: implement
2
+
3
+ ## Description
4
+
5
+ Implement a behaviour spec: write the code, write the tests, create the `impl.md` traceability record, and commit with the conventional tag format. The spec is the contract — code must satisfy it, not redefine it.
6
+
7
+ ## Inputs
8
+
9
+ - `path` (required): Path to the behaviour folder containing `usecase.md` to implement.
10
+ - `name` (optional): Slug for the implementation folder (e.g., `rest-api`, `background-job`). If omitted, derive from the implementation approach chosen.
11
+
12
+ ## Steps
13
+
14
+ 1. Read `<path>/usecase.md` thoroughly. Understand:
15
+ - The Actor and what they initiate
16
+ - Every step in the Main Flow
17
+ - Every Alternate Flow and its trigger condition
18
+ - Every Error Condition and its expected system response
19
+ - All Postconditions — these are the acceptance test targets
20
+
21
+ 2. Read any existing implementation folders under `<path>/`. Understand what is already built to avoid duplication and to understand the existing architecture.
22
+
23
+ 3. Walk up the hierarchy: read the parent `intent.md` to understand the broader goal. This context should inform design decisions (e.g., if the intent has a constraint about performance, that should influence implementation choices).
24
+
25
+ 4. **Pattern check + plan mode.** Before proposing the plan: if `.taproot/docs/patterns.md` exists, scan the behaviour description and any design notes for semantic matches. Match signals:
26
+ - "applies to all implementations / cross-cutting concern" → `check-if-affected-by`
27
+ - "enforce a rule on all future work" → `check-if-affected-by`
28
+ - "keep a file in sync / update X on every change" → `check-if-affected: X`
29
+
30
+ If a match is found, surface it before the plan:
31
+ > "Before the plan — this looks like it could use the **`<pattern-name>`** pattern rather than a custom implementation. See `.taproot/docs/patterns.md`."
32
+ > **[A] Use the pattern** — apply it via `.taproot/settings.yaml` instead of writing source code
33
+ > **[B] Continue with implementation** — the custom implementation is intentional
34
+
35
+ Then **propose the implementation plan:**
36
+ - Which files to create or modify (with brief rationale for each)
37
+ - Which tests to write, mapped to specific UseCase steps and postconditions
38
+ - Any design decisions that need to be made (with options and recommendation)
39
+ - The implementation folder slug and path
40
+
41
+ Present the plan. Do not proceed to writing code until the user approves.
42
+
43
+ 5. Create the implementation folder `<path>/<impl-slug>/` and write `impl.md`:
44
+ - **Behaviour**: relative path to `../usecase.md`
45
+ - **Design Decisions**: record every non-obvious choice made during implementation, with the reason
46
+ - **Source Files**: list every file created or significantly modified, with a one-line description of its role
47
+ - **Commits**: leave placeholder — will be filled by `taproot link-commits` after commit
48
+ - **Tests**: list every test file, with a brief description of what scenarios it covers
49
+ - **Status**: `in-progress`
50
+
51
+ 5a. Update the parent `usecase.md`'s `## Implementations <!-- taproot-managed -->` section:
52
+ - Read `<path>/usecase.md`.
53
+ - If the `## Implementations` section does not exist, insert it immediately before `## Status` (or append at end of file if `## Status` is absent), with the heading `## Implementations <!-- taproot-managed -->`.
54
+ - Derive the link title from the first `# Heading` line of the new `impl.md`; strip any type prefix (e.g. `# Implementation: Foo` → `Foo`). Fall back to the folder slug if no heading is found.
55
+ - Append `- [<Title>](./<impl-slug>/impl.md)` to the section if the link is not already present.
56
+ - If the behaviour `**State:**` is `specified`, advance it to `implemented` and update `**Last reviewed:**` to today.
57
+ - Write the updated `usecase.md`. Stage it together with `impl.md` for the declaration commit.
58
+
59
+ 6. **Declaration commit** — commit `impl.md` and any `usecase.md` link-section update together (no source files):
60
+
61
+ Before committing:
62
+ - Read `.taproot/settings.yaml` and note the `definitionOfReady` conditions — these are the checks the hook will run. If the file has no `definitionOfReady` section, only baseline DoR checks run.
63
+ - There is no standalone `taproot dor` command — DoR runs automatically via the pre-commit hook when impl.md is staged without source files (this is a **declaration commit**). Resolve any agent-driven DoR conditions (e.g. `check-if-affected-by`) in impl.md under `## DoR Resolutions` before staging.
64
+
65
+ ```
66
+ taproot(<intent-slug>/<behaviour-slug>/<impl-slug>): declare implementation
67
+ ```
68
+ If DoR fails, fix the spec or add the missing DoR resolution before proceeding — do not bypass the hook.
69
+
70
+ 7. After the declaration commit, implement:
71
+ a. Write the source code files
72
+ b. Write the tests — each test should be traceable to a specific UseCase step, postcondition, error condition, or alternate flow trigger. Name tests descriptively.
73
+ c. Verify the tests pass
74
+
75
+ 8. Run `taproot dod <impl-path>` to evaluate the Definition of Done. For agent-driven conditions (`check-if-affected`, `document-current`): reason about each, apply any needed changes, then record your resolution with `taproot dod <impl-path> --resolve "<condition>" --note "<reasoning>"`. Re-run until all conditions pass. `taproot dod` marks `impl.md` state `complete` when all pass.
76
+
77
+ 9. **Implementation commit** — commit source files and `impl.md` together:
78
+
79
+ Before staging:
80
+ - This is an **implementation commit** — the hook detects source files tracked by impl.md and requires impl.md to be staged alongside them with a **real diff**. The `--resolve` records written by `taproot dod` in step 8 are that diff. If impl.md shows no diff, re-run `taproot dod` to confirm all conditions are resolved and that status was updated.
81
+ - Stage impl.md with source files in the same commit — the hook rejects implementation commits missing their traceability record.
82
+
83
+ ```
84
+ taproot(<intent-slug>/<behaviour-slug>/<impl-slug>): <what this commit does>
85
+ ```
86
+ The pre-commit hook checks that `impl.md` changed only in the `## Status` and `## DoD Resolutions` sections and re-runs DoD in dry-run mode.
87
+
88
+ 10. Run `taproot link-commits --path <taproot-root>` to update the `impl.md` Commits section with the new hashes.
89
+
90
+ 11. Run `taproot validate-structure --path <taproot-root>`.
91
+
92
+ 12. Run `taproot coverage --path <taproot-root>` to show updated progress.
93
+
94
+ 13. Present next steps:
95
+
96
+ > 💡 If this session is getting long, consider running `/compact` or starting a fresh context before the next task.
97
+
98
+ **What's next?**
99
+ [A] `/tr-plan` — surface the next implementable behaviour
100
+ [B] `/tr-status` — see full project health after this implementation
101
+
102
+ ## Output
103
+
104
+ - Working source code satisfying the UseCase
105
+ - Tests covering all main flow steps, alternate flows, postconditions, and error conditions
106
+ - A `impl.md` in `<path>/<impl-slug>/impl.md` with all sections filled
107
+ - Two commits: a declaration commit (impl.md alone) and an implementation commit (source + impl.md)
108
+
109
+ ## CLI Dependencies
110
+
111
+ - `taproot link-commits`
112
+ - `taproot dod`
113
+ - `taproot validate-structure`
114
+ - `taproot coverage`
115
+
116
+ ## Document Format Reference
117
+
118
+ ```markdown
119
+ # Implementation: <Title>
120
+
121
+ ## Behaviour
122
+ ../usecase.md
123
+
124
+ ## Design Decisions
125
+ - <Decision: what was chosen and why — reference UseCase requirements>
126
+
127
+ ## Source Files
128
+ - `<path/to/file.ts>` — <what this file does for this implementation>
129
+
130
+ ## Commits
131
+ - `<hash>` — <one-line summary>
132
+
133
+ ## Tests
134
+ - `<path/to/test.test.ts>` — <which UseCase steps/conditions this covers>
135
+
136
+ ## Status
137
+ - **State:** planned | in-progress | complete | needs-rework
138
+ - **Created:** <YYYY-MM-DD>
139
+ - **Last verified:** <YYYY-MM-DD>
140
+
141
+ ## Notes
142
+ <Technical debt, known limitations, future improvements>
143
+ ```
144
+
145
+ ## Notes
146
+
147
+ - If the UseCase has error conditions or alternate flows that are difficult to implement in the current sprint, create the `impl.md` with Status `in-progress` and add a Notes entry listing what is deferred and why.
148
+ - If you discover during implementation that the spec is incomplete or incorrect, **stop and use `/taproot:refine`** to update the spec before continuing. Do not silently diverge from the spec.
149
+ - The commit message tag path should match the impl folder's path relative to the `taproot/` root.
@@ -0,0 +1,147 @@
1
+ # Skill: ineed
2
+
3
+ ## Description
4
+
5
+ Route a natural language requirement to the right place in the taproot hierarchy — clarifying vague requirements through structured discovery before placing and delegating them.
6
+
7
+ ## Inputs
8
+
9
+ - `requirement` (required): Natural language description of what the system needs to do. Can be vague — the skill will sharpen it through discovery.
10
+
11
+ ## Steps
12
+
13
+ 0. **Pattern check** — If `.taproot/docs/patterns.md` exists, scan the stated requirement for semantic matches against the patterns listed there. Match signals:
14
+ - "apply to all / every implementation / every skill / everywhere" → `check-if-affected-by`
15
+ - "guide agents / architecture rules / agents should follow / enforce a rule" → `check-if-affected-by`
16
+ - "enforce documentation / docs must stay current / keep docs accurate" → `document-current`
17
+ - "every new feature must update X / keep X in sync / always update X" → `check-if-affected: X`
18
+ - "research before building / check if a library exists / look up how to implement" → research-first (`/tr-research`)
19
+
20
+ If a match is found, **interrupt before proceeding**:
21
+ > "Before I route this — that sounds like the **`<pattern-name>`** pattern. <one-line description>. See `.taproot/docs/patterns.md` for how to use it."
22
+ > **[A] Use this pattern now** — I'll guide you through applying it
23
+ > **[B] Continue as a new requirement** — route and spec it normally
24
+
25
+ - **[A]**: read the relevant section of `.taproot/docs/patterns.md` and guide the user through applying the pattern directly. Do not create a new hierarchy entry.
26
+ - **[B]** or no match: proceed to step 1.
27
+
28
+ If multiple patterns match, list all before asking. If `.taproot/docs/patterns.md` is absent, skip silently.
29
+
30
+ 1. **Classify the requirement** — Load `taproot/OVERVIEW.md` if it exists; if not, walk `taproot/` and read each `intent.md`. Use this hierarchy map to decide which path to take:
31
+
32
+ - **Bug path** (hand off immediately): Input contains bug-shaped language — "it's broken", "wrong output", "this crashes", "not working", "regression", "it used to work", "unexpected behaviour", or explicit "bug" / "defect" terminology. State: *"That sounds like a bug report rather than a new requirement. I'll hand this off to `/tr-bug` to run root cause analysis."* Call `/tr-bug` with `handoff: true` and the original symptom. Stop — do not route to the hierarchy.
33
+ - **Quick path** (proceed to Step 4): Clear actor, clear goal, unambiguous outcome. The requirement can be matched against the hierarchy without exploration.
34
+ - **Discovery path** (proceed to Step 2): Vague, new domain, significant new capability, or unclear what success looks like. The requirement needs to be understood before it can be placed.
35
+
36
+ When in doubt, take the discovery path. A well-understood requirement produces a better behaviour spec.
37
+
38
+ 2. **Structured discovery** (discovery path only) — You are a facilitator, not a content generator. Ask one question at a time, build on answers, and don't move to the next phase until you understand the current one.
39
+
40
+ Open: *"Before I place this, let me make sure I understand it properly. A few questions."*
41
+
42
+ **Phase 1 — Problem space**
43
+
44
+ Ask, building on each answer:
45
+ - "What triggered this need right now — is there a specific incident, user complaint, or gap that surfaced it?"
46
+ - "Who is blocked or frustrated without this? What do they do instead today?"
47
+ - "What happens if this is never built — what's the real cost of not having it?"
48
+
49
+ **Phase 2 — Actor and persona**
50
+
51
+ Ground the requirement in a specific person:
52
+ - "Walk me through a specific person who would use this. What's their role, and what are they trying to accomplish?"
53
+ - "Is there more than one type of user involved, with meaningfully different needs?"
54
+
55
+ **Phase 3 — Success criteria**
56
+
57
+ Elicit concrete, observable outcomes — not "what does done look like" but specific scenarios:
58
+ - "Give me 2–3 scenarios where this requirement is fully satisfied. Walk me through what happens in each."
59
+ - "How would you demonstrate this is solved — what would you show in a demo or test?"
60
+ - "What's the earliest, smallest version that would deliver real value?"
61
+
62
+ Push back on vague answers: *"users are happy"* → *"users can complete [action] without [current friction]"*
63
+
64
+ **Phase 4 — Scope boundary**
65
+
66
+ Establish what's explicitly deferred:
67
+ - "What's out of scope for now — what would you push to a later version?"
68
+ - "Are there edge cases you'd consciously defer?"
69
+
70
+ 4. **Synthesise and confirm** (discovery path only) — Produce a structured summary and confirm it before routing:
71
+
72
+ > "Here's what I understood:
73
+ > **Actor:** [specific user persona]
74
+ > **Need:** [concrete capability]
75
+ > **So that:** [observable outcome]
76
+ > **Success looks like:** [scenario 1], [scenario 2], [scenario 3]
77
+ > **Out of scope:** [deferred items]
78
+ >
79
+ > Does that capture it?
80
+ > **[A]** Go deeper **[C]** Continue to placement"
81
+
82
+ **If [A] — Advanced elicitation:** Apply one or more of the following, then return to synthesis:
83
+ - *Stress-test assumptions*: "What would have to be true for this requirement to be wrong or unnecessary?"
84
+ - *Edge cases*: "What happens when [user has no data / is offline / does it twice / does it wrong]?"
85
+ - *MVP challenge*: "What's the absolute minimum version that proves this works? What could you cut?"
86
+ - *Alternative approaches*: "Is there a simpler way to solve the underlying problem?"
87
+ - *Pre-mortem*: "Imagine this was built and nobody used it. What would be the most likely reason?"
88
+
89
+ **If [C]:** Proceed to Step 4 with the synthesised requirement as context. This summary will carry forward into `/tr-behaviour` as richer input than a raw one-liner.
90
+
91
+ 4. **Search for near-duplicates** — Scan existing `usecase.md` files under `taproot/`. If a behaviour closely matches the stated (or synthesised) requirement, surface it:
92
+
93
+ > "There's already a behaviour `<path>` that covers `<summary>`. Is your requirement the same, a refinement, or a distinct addition?"
94
+
95
+ - **Same** → link to existing document and present: **Next:** `/tr-refine <path>` — refine the existing behaviour if the wording needs updating
96
+ - **Refinement** → call `/taproot:refine <path>` and stop
97
+ - **Distinct** → continue with placement as a new sibling
98
+
99
+ 5. **Find the best-fit parent** — Match the requirement's domain and goal against existing intents. Consider:
100
+ - Which intent's goal would be incomplete without this requirement?
101
+ - Which stakeholders are affected — do they match an existing intent's stakeholders?
102
+ - Is this a new top-level business goal (needs a new intent) or a behaviour under an existing one?
103
+
104
+ 6. **Resolve ambiguity** — If two or more intents could plausibly own this requirement, ask grill-style questions to resolve:
105
+ - "Who is the primary stakeholder — an end user, an operator, or a developer?"
106
+ - "If this was removed, which intent's success criteria would be most affected?"
107
+ - "Is this really one requirement or two that happen to arrive together?"
108
+
109
+ Re-propose placement after each answer.
110
+
111
+ 7. **Propose placement with reasoning** — State your proposed location clearly:
112
+
113
+ > "This sounds like it belongs under **`<intent-slug>`** (*`<intent goal>`*) as a new behaviour. Does that feel right?"
114
+
115
+ If no suitable parent exists:
116
+
117
+ > "This doesn't clearly fit any existing intent — it may need a new one. I'd name it `<proposed-slug>` — *`<proposed goal>`*. Agree?"
118
+
119
+ If the developer disagrees: "Which intent feels like the right home? Or should this be a new intent entirely?" Re-propose based on their answer.
120
+
121
+ 8. **Confirm and delegate** — Once the developer confirms placement, call the appropriate skill — carrying the synthesised summary (if discovery was run) as context for the behaviour definition:
122
+
123
+ - **New top-level intent needed**: call `/taproot:intent` with the proposed slug and description, then call `/taproot:behaviour` under the new intent
124
+ - **New behaviour under existing intent**: call `/taproot:behaviour <taproot/<intent-slug>/> "<synthesised requirement>"`
125
+ - **New sub-behaviour under existing behaviour**: call `/taproot:behaviour <taproot/<intent-slug>/<behaviour-slug>/> "<synthesised requirement>"`
126
+
127
+ > 💡 If this session is getting long, consider running `/compact` or starting a fresh context before the next task.
128
+
129
+ **What's next?**
130
+ Delegated to the appropriate skill above.
131
+
132
+ ## Output
133
+
134
+ Delegates to `/taproot:intent` and/or `/taproot:behaviour`. No files are written directly by this skill. For discovery-path requirements, the synthesis summary produced in Step 3 becomes the input context for the delegated skill.
135
+
136
+ ## CLI Dependencies
137
+
138
+ None — this skill delegates all writing to other skills.
139
+
140
+ ## Notes
141
+
142
+ - **Fast path vs discovery path**: The fast path is for requirements that are already clear. When in doubt, take the discovery path — a few extra minutes of elicitation produces a behaviour spec with less need for immediate refinement.
143
+ - **Facilitator mindset**: You are not generating content, you are helping the developer articulate what they already know. Every question should help them think, not just answer.
144
+ - **Discovery produces richer specs**: The synthesis summary from Step 4 carries forward into `/taproot:behaviour`, giving it a structured actor, goal, success criteria, and scope boundary to work from — not just a raw one-liner.
145
+ - **Advanced elicitation** techniques (pre-mortem, MVP challenge, edge cases, alternative approaches) are available via `/taproot:grill-me` — reuse that framing rather than inventing new questions.
146
+ - **Conversational detection**: Detecting a requirement from casual speech without explicit `/tr-ineed` invocation is a Claude Code behaviour — the agent watches for phrases like "we also need...", "the system should...", "I want users to be able to..." and asks "Should I add that to the taproot hierarchy?" before proceeding.
147
+ - `/tr-ineed` is the Claude Code adapter command name for this skill.
@@ -0,0 +1,104 @@
1
+ # Skill: intent
2
+
3
+ ## Description
4
+
5
+ Create a new business intent or refine an existing one. An intent captures the "why" and "for whom" — the goal, the stakeholders who care about it, and how you'll know it's been achieved.
6
+
7
+ ## Inputs
8
+
9
+ - `description` (required unless `path` is given): Natural language description of the goal. Can be vague — the skill will clarify.
10
+ - `path` (optional): Path to an existing `intent.md` to refine rather than create new.
11
+
12
+ ## Steps
13
+
14
+ ### Creating a new intent
15
+
16
+ 1. If the description is vague (under two sentences, or contains words like "improve", "better", "more" without specifics), ask up to three clarifying questions before drafting:
17
+ - "Who benefits from this, and what specifically changes for them?"
18
+ - "How would you know in 6 months that this was a success?"
19
+ - "What is the biggest risk or constraint on achieving this?"
20
+
21
+ 2. Search existing intents under `taproot/` for overlap. Read each `intent.md` found. If a closely related intent exists, show it to the user and ask: "This looks related to existing intent at `<path>`. Should I refine that one, or create a separate intent for a genuinely different goal?"
22
+
23
+ 3. Draft the `intent.md` content:
24
+ - Title: noun phrase capturing the desired outcome (e.g., "Password Reset Without Support", not "Password Reset Feature")
25
+ - Stakeholders: at minimum the direct user/actor and the business/product owner; consider: ops, security, compliance, support, third-party integrators
26
+ - Goal: 1–3 sentences, outcome-focused (what changes in the world), not solution-focused (not "we will build X")
27
+ - Success Criteria: 2–5 items, each measurable (can be checked off), each from a stakeholder's perspective
28
+ - Constraints: real constraints only (regulatory, contractual, architectural); avoid listing preferences as constraints
29
+ - Status: `draft`
30
+ - Dates: today's date for both Created and Last reviewed
31
+
32
+ 4. Determine the folder slug: kebab-case, 2–4 words describing the intent (e.g., `password-reset`, `user-onboarding`, `payment-failure-recovery`).
33
+
34
+ 5. Check if `taproot/<slug>/` already exists. If so, append a distinguishing suffix.
35
+
36
+ 6. Create the directory `taproot/<slug>/` and write `intent.md`.
37
+
38
+ 7. Run `taproot validate-format --path taproot/<slug>/`.
39
+
40
+ 8. If validation passes, present next steps:
41
+
42
+ > 💡 If this session is getting long, consider running `/compact` or starting a fresh context before the next task.
43
+
44
+ **What's next?**
45
+ [A] `/tr-behaviour taproot/<slug>/` — define the first behaviour under this intent
46
+ [B] `/tr-decompose taproot/<slug>/` — decompose the intent into a full behaviour set
47
+ [C] `/tr-review taproot/<slug>/intent.md` — stress-test the spec before building
48
+
49
+ ### Refining an existing intent
50
+
51
+ 1. Read the existing `intent.md` at `path`.
52
+
53
+ 2. Ask what changed: "What needs to be updated — the goal, the stakeholders, the success criteria, or the status?"
54
+
55
+ 3. Apply changes, preserving all sections. Update "Last reviewed" to today's date.
56
+ **Preserve the `## Behaviours <!-- taproot-managed -->` section exactly** — read and re-insert it unchanged before `## Status` after applying other edits. Never discard it during a rewrite.
57
+
58
+ 4. If the status is changing to `achieved`, verify at least one success criterion is checked off.
59
+
60
+ 5. Run `taproot validate-format --path <parent-of-path>`.
61
+
62
+ 6. Report what changed.
63
+
64
+ > 💡 If this session is getting long, consider running `/compact` or starting a fresh context before the next task.
65
+
66
+ **What's next?**
67
+ [A] `/tr-behaviour <path>/` — add or refine a behaviour under this intent
68
+ [B] `/tr-review <path>/intent.md` — stress-test the updated intent
69
+ [C] `/tr-status` — see overall project health
70
+
71
+ ## Output
72
+
73
+ A new `intent.md` in `taproot/<slug>/intent.md` (create mode), or an updated `intent.md` in place (refine mode).
74
+
75
+ ## CLI Dependencies
76
+
77
+ - `taproot validate-format`
78
+
79
+ ## Document Format Reference
80
+
81
+ ```markdown
82
+ # Intent: <Title>
83
+
84
+ ## Stakeholders
85
+ - <Role>: <Name or team> — <their interest in this intent>
86
+
87
+ ## Goal
88
+ <1-3 sentences describing the desired outcome from the stakeholder's perspective>
89
+
90
+ ## Success Criteria
91
+ - [ ] <Measurable criterion 1>
92
+ - [ ] <Measurable criterion 2>
93
+
94
+ ## Constraints
95
+ - <Constraint 1 (regulatory, technical, timeline, etc.)>
96
+
97
+ ## Status
98
+ - **State:** draft | active | achieved | deprecated
99
+ - **Created:** <YYYY-MM-DD>
100
+ - **Last reviewed:** <YYYY-MM-DD>
101
+
102
+ ## Notes
103
+ <Free-form context, links to external docs, meeting notes, etc.>
104
+ ```
package/skills/plan.md ADDED
@@ -0,0 +1,63 @@
1
+ # Skill: plan
2
+
3
+ ## Description
4
+
5
+ Surface the next independently-implementable work item from the requirement hierarchy. Runs `taproot plan` to scan and classify candidates as AFK (agent can proceed autonomously) or HITL (human input required), presents the recommended next slice, and delegates to `/tr-implement` once the developer confirms.
6
+
7
+ ## Inputs
8
+
9
+ - `path` (optional): Behaviour path to implement directly — skips discovery and goes straight to `/tr-implement`.
10
+
11
+ ## Steps
12
+
13
+ 1. **If a path was provided**: skip to Step 5 and invoke `/tr-implement <path>` directly.
14
+
15
+ 2. Run `taproot plan` and read the output. It lists:
16
+ - **AFK** candidates: behaviours with `specified` state, ready to implement autonomously
17
+ - **HITL** candidates: behaviours with `proposed` state, needing human review first
18
+ - **In-progress** implementations: partially-implemented behaviours that can be resumed
19
+
20
+ 3. If no candidates are found (all behaviours fully implemented), report: "Everything is implemented."
21
+
22
+ Nothing obvious next — whenever you're ready:
23
+
24
+ > 💡 If this session is getting long, consider running `/compact` or starting a fresh context before the next task.
25
+
26
+ **What's next?**
27
+ [A] `/tr-review-all` — semantic review of the full hierarchy
28
+ [B] `/tr-ineed` — capture a new requirement
29
+
30
+ Then stop.
31
+
32
+ 4. Recommend the top AFK candidate (first in the sorted output). Present it as:
33
+ > "Next recommended slice: **`<behaviour-path>`** (`<intent goal>`)"
34
+ > "Classification: AFK — spec is complete, no design decisions required."
35
+ > "To implement: `/tr-implement taproot/<behaviour-path>/`"
36
+ >
37
+ > **[Y]** Implement this **[L]** Show full list **[S]** Skip to a different behaviour
38
+
39
+ - **[Y]**: proceed to Step 5
40
+ - **[L]**: display the full `taproot plan` output, then ask the developer to pick a behaviour path, then proceed to Step 5
41
+ - **[S]**: ask "Which behaviour path would you like to implement?" then proceed to Step 5
42
+
43
+ 5. If the top candidate is HITL (no AFK candidates exist), flag it:
44
+ > "The next unimplemented behaviour is HITL — the spec needs clarification before an agent can proceed autonomously."
45
+ > "Behaviour: `<path>`"
46
+
47
+ **Next:** `/tr-refine taproot/<path>/` — sharpen the spec, then return here
48
+
49
+ 6. Invoke `/tr-implement taproot/<behaviour-path>/` with the confirmed path.
50
+
51
+ ## Output
52
+
53
+ Delegates to `/tr-implement`. No files are written directly by this skill.
54
+
55
+ ## CLI Dependencies
56
+
57
+ - `taproot plan`
58
+
59
+ ## Notes
60
+
61
+ - AFK/HITL classification is determined by the `taproot plan` command using the behaviour's `usecase.md` state as a proxy: `specified` → AFK, `proposed` → HITL.
62
+ - This skill is the conversational wrapper around `taproot plan` — it adds selection, confirmation, and delegation logic that the CLI command cannot provide.
63
+ - `/tr-plan` is the Claude Code adapter command name for this skill.