@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,69 @@
1
+ # Skill: promote
2
+
3
+ ## Description
4
+
5
+ Escalate a significant finding from implementation or behaviour level up to the intent. Use when implementation reveals that a higher-level assumption is wrong — not a detail-level bug, but a structural mismatch between what was intended and what is actually achievable or desirable.
6
+
7
+ ## Inputs
8
+
9
+ - `path` (required): Path to the `impl.md` or `usecase.md` where the finding originated.
10
+ - `finding` (required): Description of the discovery that affects the parent intent.
11
+
12
+ ## Steps
13
+
14
+ 1. Read the artifact at `path`. Identify its type.
15
+
16
+ 2. Walk up the hierarchy to find the parent `intent.md`. If `path` is an `impl.md`, walk up through the behaviour to the intent.
17
+
18
+ 3. Read the `intent.md`. Identify which success criteria, goal statement, or constraints are affected by the finding.
19
+
20
+ 4. Classify the finding's severity:
21
+ - **Intent goal is unachievable as stated**: the goal cannot be reached given discovered constraints (technical, regulatory, dependency)
22
+ - **Success criterion is unmeasurable or wrong**: a criterion turns out to be impossible to verify, or measures the wrong thing
23
+ - **New constraint discovered**: a real-world constraint exists that the intent didn't account for (compliance requirement, third-party limitation, performance ceiling)
24
+ - **Scope is wider than understood**: achieving the intent requires significantly more work than originally estimated
25
+ - **Dependency discovered**: this intent cannot be achieved without another intent or external project being completed first
26
+
27
+ 5. Draft the update to `intent.md`:
28
+ - Add a **Review Note** to the Notes section (do not modify the Goal or Success Criteria directly without user confirmation):
29
+ ```
30
+ **Review Note (<date>):** <summary of finding and its impact>
31
+ Source: <path-to-origin-artifact>
32
+ ```
33
+ - Update Status **State** to `active` if it was `draft` (the finding makes it concrete)
34
+ - Update "Last reviewed" to today
35
+
36
+ 6. Show the proposed changes. Ask: "Do you want me to also update the Goal/Success Criteria directly, or just add the review note for now?"
37
+
38
+ 7. If the user wants to update Goal or Success Criteria, make those changes collaboratively, respecting the original intent while incorporating the finding.
39
+
40
+ 8. List all behaviours under the affected intent. For each, assess whether the finding might require the behaviour to be re-evaluated:
41
+ - "Behaviours that may need review given this finding:"
42
+ - List each with a one-line explanation of why it might be affected
43
+
44
+ 9. Write the updated `intent.md`.
45
+
46
+ 10. Run `taproot validate-format --path <intent-folder>`.
47
+
48
+ 11. Report: "Intent updated. <N> behaviours flagged for potential re-evaluation."
49
+
50
+ > 💡 If this session is getting long, consider running `/compact` or starting a fresh context before the next task.
51
+
52
+ **What's next?**
53
+ [A] `/tr-refine taproot/<intent-slug>/<behaviour-slug>/` — refine the most-affected behaviour
54
+ [B] `/tr-review taproot/<intent-slug>/intent.md` — stress-test the updated intent
55
+
56
+ ## Output
57
+
58
+ An updated `intent.md` with a Review Note and updated status. A list of behaviours that may need re-evaluation.
59
+
60
+ Importantly, this skill does **not** auto-modify other behaviours — it creates a review task. The user decides what to act on.
61
+
62
+ ## CLI Dependencies
63
+
64
+ - `taproot validate-format`
65
+
66
+ ## Notes
67
+
68
+ - Use this skill when the finding changes the answer to "is this intent achievable?" or "are we building the right thing?" — not for normal implementation learnings (use `/taproot:refine` for those).
69
+ - If multiple findings accumulate in the Notes section without being resolved, that is a signal to run a full `/taproot:review` or `/taproot:review-all` on the intent.
@@ -0,0 +1,78 @@
1
+ # Skill: refine
2
+
3
+ ## Description
4
+
5
+ Update a behaviour spec (`usecase.md`) based on what was learned during or after implementation. Implementations frequently reveal that specs were incomplete, ambiguous, or wrong — this skill brings the spec back into alignment with reality (or reality into alignment with the spec).
6
+
7
+ ## Inputs
8
+
9
+ - `path` (required): Path to the behaviour folder containing the `usecase.md` to refine.
10
+ - `finding` (required): Description of what changed or was discovered. Can be free-form.
11
+
12
+ ## Steps
13
+
14
+ 0. **Pattern check** — If `.taproot/docs/patterns.md` exists, scan the `finding` input for semantic matches. Match signals:
15
+ - "applies to all / every implementation should" → `check-if-affected-by`
16
+ - "enforce a rule / architectural constraint" → `check-if-affected-by`
17
+ - "docs should stay current / keep X updated" → `document-current` or `check-if-affected: X`
18
+
19
+ If a match is found, **interrupt before reading the spec**:
20
+ > "Before I refine this — that finding sounds like the **`<pattern-name>`** pattern. <one-line description>. See `.taproot/docs/patterns.md`."
21
+ > **[A] Apply the pattern** — configure it in `.taproot/settings.yaml` instead of editing the spec
22
+ > **[B] Continue refining** — the spec change is the right approach
23
+
24
+ - **[A]**: guide through applying the pattern. Do not modify `usecase.md`.
25
+ - **[B]** or no match: proceed to step 1.
26
+
27
+ 1. Read `<path>/usecase.md`. Read all `impl.md` files under `<path>/` to understand the current implementation state.
28
+
29
+ 2. Classify the finding into one or more categories:
30
+ - **Missing flow**: a scenario that happens in reality but isn't in the spec (add alternate flow or error condition)
31
+ - **Incorrect flow**: a step in the spec that doesn't match how the system actually behaves (correct it)
32
+ - **Missing postcondition**: something that is now true after the behaviour that wasn't listed
33
+ - **New constraint**: a limit discovered during implementation (rate limit, quota, timeout) that should be in the spec
34
+ - **Scope change**: the behaviour is actually larger or smaller than originally specified
35
+ - **Actor change**: the actor is different from what was specified, or multiple actors are involved
36
+ - **State machine issue**: the preconditions or postconditions interact with other behaviours in ways not reflected
37
+
38
+ 3. Draft the changes to `usecase.md`. Show the diff to the user: "Here's what I'm changing: [before/after for each section]." Ask for confirmation before writing.
39
+
40
+ 4. Update the `usecase.md`:
41
+ - For missing flows: add to Alternate Flows or Error Conditions
42
+ - For incorrect flows: correct the Main Flow steps or affected sections
43
+ - For new constraints: add to Preconditions or Error Conditions
44
+ - Update "Last reviewed" to today
45
+ - If the finding is significant enough to change the state, update Status
46
+ - **Preserve the `## Implementations <!-- taproot-managed -->` section exactly** — read and re-insert it unchanged before `## Status` after applying other edits. Never discard it during a rewrite.
47
+ - **Preserve `## Acceptance Criteria` IDs** — you may update the Given/When/Then wording, but never change an existing AC-N ID. If a new flow is added, assign the next available ID (highest existing + 1). If a criterion is retired, mark it `~~AC-N: deprecated~~` rather than removing it.
48
+
49
+ 5. Run `taproot sync-check --path <taproot-root>`. If any `impl.md` files under this behaviour are flagged as `SPEC_UPDATED`, list them explicitly: "These implementations may need to be reviewed against the updated spec: [list]."
50
+
51
+ 6. Check if the change cascades upward: does the finding imply that the parent intent's goal, success criteria, or constraints are wrong or incomplete? If yes: "This finding may affect the parent intent at `<intent-path>`. Consider running `/taproot:promote` to update the intent and flag any other behaviours that may be affected."
52
+
53
+ 7. Run `taproot validate-format --path <path>`.
54
+
55
+ 8. Report what changed.
56
+
57
+ 9. Present next steps:
58
+
59
+ > 💡 If this session is getting long, consider running `/compact` or starting a fresh context before the next task.
60
+
61
+ **What's next?**
62
+ [A] Commit the spec change — `git add <path>/usecase.md && git commit`
63
+ [B] `/tr-implement <path>/` — spec changed significantly; reimplementation needed
64
+
65
+ ## Output
66
+
67
+ An updated `usecase.md` reflecting the new understanding. A list of any downstream effects (impl.md files that may need review, intent-level implications).
68
+
69
+ ## CLI Dependencies
70
+
71
+ - `taproot sync-check`
72
+ - `taproot validate-format`
73
+
74
+ ## Notes
75
+
76
+ - If the finding is so significant that the behaviour needs to be split into two, suggest that explicitly and offer to run `/taproot:behaviour` to create the new one, then `/taproot:decompose` to restructure.
77
+ - Never silently remove steps or error conditions that may still be relevant. When in doubt, ask the user whether the old spec was wrong or whether the implementation is wrong.
78
+ - If the implementation diverged from the spec and both are acceptable, clarify with the user which is the "true" state and update accordingly.
@@ -0,0 +1,122 @@
1
+ # Skill: research
2
+
3
+ ## Description
4
+
5
+ Research any domain or technical subject before writing a behaviour spec — by scanning local resources, searching the web, and drawing on expert knowledge.
6
+
7
+ ## Inputs
8
+
9
+ - `topic` (required): The domain, technology, or subject to research. Can be a phrase or a few words — the skill will sharpen it if ambiguous.
10
+ - `context` (optional): Additional context from the calling skill (e.g. the raw requirement from `/tr-ineed`) that informs search queries and expert questions.
11
+
12
+ ## Steps
13
+
14
+ 1. **Announce the topic** and confirm scope: `"Researching: <topic>."` If the topic is a single word or lacks domain context (e.g. `"sort"`, `"auth"`), ask one clarifying question before proceeding: `"What domain or language context should I scope this to?"` Incorporate the answer into all subsequent steps.
15
+
16
+ 2. **Scan local resources** in this order:
17
+ - `research/` folder — any `.md` or `.pdf` files
18
+ - `docs/` and project root — any `.pdf` files
19
+ - Files linked from `taproot/OVERVIEW.md`
20
+
21
+ Use the topic as a **semantic** query against file content — do not rely on filename matching alone. A file named `thermal-design.pdf` may be relevant to `"heat dissipation"`. For each relevant file found, note the path and a one-line summary of what it contributes.
22
+
23
+ 3. **Check for prior research:** if `research/<topic-slug>.md` already exists, present it:
24
+ > "Found existing research at `research/<topic-slug>.md` (last updated: `<date>`). [U]se it / [R]efresh it / [S]tart fresh?"
25
+ - **[U]** — load the existing document as the synthesis; skip to step 7
26
+ - **[R]** — run the full flow (steps 4–6); merge new findings with the existing document, updating citations and conclusions; preserve prior expert insights unless explicitly superseded
27
+ - **[S]** — discard the existing document; run the full flow
28
+
29
+ 4. **Multi-query web search** — issue several targeted queries rather than one literal search:
30
+ - `"<topic> existing library OR package"`
31
+ - `"<topic> algorithm OR implementation paper"`
32
+ - `"<topic> production implementation OR best practice"`
33
+ - Add domain-specific variants based on context (e.g. `"<topic> RFC"` for protocol topics, `"<topic> npm"` for JavaScript)
34
+
35
+ For each result that looks substantive, read it and extract: name/title, URL or reference, what it solves, and any known limitations or trade-offs.
36
+
37
+ If web search is unavailable, note: `"Web search unavailable — continuing with local sources and expert knowledge only."` and proceed to step 5.
38
+
39
+ If no local resources were found in step 2, note this and continue — the web search is still valuable.
40
+
41
+ 5. **Present a preliminary synthesis:**
42
+ ```
43
+ ## Preliminary findings: <topic>
44
+
45
+ ### Local resources
46
+ - <file path> — <one-line summary>
47
+ (or: none found)
48
+
49
+ ### Web findings
50
+ - <name/title> (<URL or reference>) — <what it solves / key trade-offs>
51
+ (or: none found / web unavailable)
52
+
53
+ ### Key take-aways so far
54
+ - <insight 1>
55
+ - <insight 2>
56
+ ```
57
+
58
+ 6. **Expert check** — ask: `"Are you an expert on this subject?"`
59
+ - **Yes** → delegate to `/tr-grill-me` seeded with the preliminary synthesis as grilling material. The grill session should ask questions that reference specific findings — library names, paper conclusions, known trade-offs — not generic questions. Terminate when the developer says `[Done]` or after ≤3 rounds where no new information is surfacing. Incorporate the expert answers into the synthesis.
60
+ - **No** → proceed with the gathered synthesis.
61
+
62
+ 7. **Present the final structured research summary:**
63
+ ```
64
+ ## Research summary: <topic>
65
+
66
+ ### Local sources
67
+ - <path> — <summary>
68
+
69
+ ### Web sources
70
+ - <name> (<URL>) — <summary>
71
+
72
+ ### Expert insights
73
+ - <insight from grilling> (or: none)
74
+
75
+ ### Key conclusions
76
+ - <conclusion 1>
77
+ - <conclusion 2>
78
+
79
+ ### Open questions
80
+ - <question that research did not resolve>
81
+
82
+ ### References
83
+ - <full citation: title, URL or path, accessed/published date>
84
+ ```
85
+
86
+ 8. **Propose slug and output choice.** Derive a kebab-case slug from the topic:
87
+ > `"I'll save this as research/<topic-slug>.md — is that right?"`
88
+
89
+ Developer confirms or corrects the slug. Then ask:
90
+ > **`[S] Save to research/<topic-slug>.md with citations`**
91
+ > **`[F] Feed directly into a spec`**
92
+ > **`[Q] Discard and stop`**
93
+
94
+ - **[S]** — create `research/` directory if absent; write `research/<topic-slug>.md` using the final summary structure from step 7; present:
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-behaviour taproot/<intent>/` — write a spec informed by this research
100
+ [B] `/tr-ineed "<topic>"` — route it as a requirement with research context attached
101
+ - **[F]** — pass the final summary as input context to `/tr-behaviour`; no file written
102
+ - **[Q]** — discard the synthesis; exit without writing any file or chaining to another skill
103
+
104
+ ## Output
105
+
106
+ One of:
107
+ - A saved `research/<topic-slug>.md` document with full citations and structured findings
108
+ - The research synthesis passed as input context to a downstream skill (`/tr-behaviour` or `/tr-ineed`)
109
+ - Nothing (if the developer chose `[Q]`)
110
+
111
+ ## CLI Dependencies
112
+
113
+ None — pure agent skill. Uses agent tools: file reading (local scan), web search (step 4).
114
+
115
+ ## Notes
116
+
117
+ - **Auto-trigger mode:** when called from `/tr-ineed`, step 8 is skipped — the synthesis is always fed forward to the calling skill without prompting. The `context` input carries the original requirement to sharpen search queries.
118
+ - **Graceful degradation:** if both local resources and web search produce nothing, and no expert is available, announce: `"No research sources available."` Ask whether to proceed with the spec based on the stated requirement alone, or abort. Never silently produce an empty synthesis.
119
+ - **Slug derivation:** kebab-case the topic words, drop stop words, keep max 4 words. `"satellite tracking algorithm"` → `satellite-tracking-algorithm`. Confirm with the developer before writing.
120
+ - **Refresh merges, not overwrites:** when `[R]efresh` is chosen, append new citations to the References section, update Key conclusions, and add a `Last refreshed:` date — do not discard prior expert insights.
121
+ - **Expert grilling is domain-aware:** the grill session is seeded with what was actually found, not generic questions. If the synthesis found `satellite.js`, ask about its limitations, alternatives, and when it breaks — not `"what do you know about satellite tracking?"`
122
+ - `/tr-research` is the Claude Code adapter command name for this skill.
@@ -0,0 +1,92 @@
1
+ # Skill: review-all
2
+
3
+ ## Description
4
+
5
+ Run a comprehensive review of an entire subtree — an intent and all its descendants, or the entire `taproot/` root. Applies the per-artifact review logic from `/taproot:review` to each node, then adds cross-cutting analysis that can only be done by comparing artifacts against each other. Produces a consolidated report.
6
+
7
+ ## Inputs
8
+
9
+ - `path` (optional): Path to an intent folder or the `taproot/` root. Defaults to `taproot/`.
10
+
11
+ ## Steps
12
+
13
+ 1. Run `taproot validate-structure --path <path>` and `taproot validate-format --path <path>`. Include any validation errors in the report as **Structural Issues** (resolve these before addressing semantic issues — a structurally invalid hierarchy produces unreliable analysis).
14
+
15
+ 2. Run `taproot check-orphans --path <path> --include-unimplemented`. Include results in the report as **Orphan & Coverage Issues**.
16
+
17
+ 3. Run `taproot sync-check --path <path>`. Include results in the report as **Staleness Warnings**.
18
+
19
+ 4. Walk the subtree top-down. For each artifact found:
20
+ - Read the file
21
+ - Apply the review logic from `/taproot:review` (Steps 3 of that skill)
22
+ - Record findings tagged with the artifact path
23
+
24
+ 5. After reviewing all individual artifacts, perform **cross-cutting analysis**:
25
+
26
+ **Intent ↔ Behaviours:**
27
+ - For each intent, check every success criterion against the list of behaviours. Is there at least one behaviour that, if implemented, would contribute to satisfying each criterion? Flag criteria with no corresponding behaviour as **Coverage Gaps**.
28
+ - Are there behaviours that don't obviously serve any success criterion? Flag as **Potentially Gold-Plated**.
29
+ - Do sibling behaviours have contradictory postconditions? (e.g., behaviour A sets a flag, behaviour B assumes that flag is unset)
30
+
31
+ **Behaviours ↔ Implementations:**
32
+ - For each behaviour, check whether its main flow steps are traceable to at least one implementation. Steps with no implementation are **Unimplemented Flows**.
33
+ - Do implementations reference source files that have been modified more recently than the spec was last reviewed? (Cross-reference with `taproot sync-check` output.)
34
+
35
+ **Across the hierarchy:**
36
+ - Are there behaviours that are nearly identical across different intents? Possible duplication.
37
+ - Are there intents at similar levels of completion, where one could be sequenced to unblock the other?
38
+
39
+ 6. Assemble the consolidated report:
40
+
41
+ ```
42
+ # Taproot Review: <path>
43
+
44
+ ## Structural Issues
45
+ <from validate-structure and validate-format>
46
+
47
+ ## Orphan & Coverage Issues
48
+ <from check-orphans>
49
+
50
+ ## Staleness Warnings
51
+ <from sync-check>
52
+
53
+ ## Cross-Cutting Issues
54
+ ### Coverage Gaps
55
+ ### Contradictions
56
+ ### Duplication
57
+
58
+ ## Per-Artifact Findings
59
+
60
+ ### <artifact-path>
61
+ **Blockers**: ...
62
+ **Concerns**: ...
63
+ **Suggestions**: ...
64
+
65
+ ```
66
+
67
+ 7. Close with a prioritized action list: "Recommended next steps: (1) resolve structural issues, (2) address blockers in [artifact], (3) fill coverage gaps for [criterion]."
68
+
69
+ 8. Present next steps:
70
+
71
+ > 💡 If this session is getting long, consider running `/compact` or starting a fresh context before the next task.
72
+
73
+ **What's next?**
74
+ [A] `/tr-refine <highest-priority-path>` — fix the top-priority finding
75
+ [B] `/tr-plan` — surface the next implementable behaviour
76
+ [C] `/tr-ineed` — add a requirement surfaced by the review
77
+
78
+ ## Output
79
+
80
+ A consolidated review report covering the entire subtree, with structural issues, cross-cutting analysis, and per-artifact findings.
81
+
82
+ ## CLI Dependencies
83
+
84
+ - `taproot validate-structure`
85
+ - `taproot validate-format`
86
+ - `taproot check-orphans`
87
+ - `taproot sync-check`
88
+
89
+ ## Notes
90
+
91
+ - For large hierarchies (>20 artifacts), batch the per-artifact review by intent to avoid overwhelming the user. Present one intent at a time and ask if they want to continue.
92
+ - If the user wants to act on findings immediately, each finding can link to the skill that fixes it: `/taproot:refine` for behaviour and impl issues, `/taproot:intent` for intent issues, `/taproot:implement` for unimplemented flows.
@@ -0,0 +1,80 @@
1
+ # Skill: review
2
+
3
+ ## Description
4
+
5
+ Stress-test a single Taproot artifact — an `intent.md`, `usecase.md`, or `impl.md` — by challenging it from multiple angles. Produces a structured critique with prioritized findings. Does **not** auto-modify the artifact; the user decides what to act on.
6
+
7
+ ## Inputs
8
+
9
+ - `path` (required): Path to a Taproot artifact (`intent.md`, `usecase.md`, or `impl.md`).
10
+
11
+ ## Steps
12
+
13
+ 1. Read the artifact at `path`. Identify its type by filename.
14
+
15
+ 2. If the artifact has a parent (e.g., a `usecase.md` has a parent `intent.md`), read the parent to understand context. If siblings exist (other behaviours under the same intent), read those too — cross-checking is part of a thorough review.
16
+
17
+ 3. Apply the challenge set appropriate to the artifact type:
18
+
19
+ **For `intent.md`:**
20
+ - Is the goal measurable? Can you unambiguously declare it achieved?
21
+ - Are the success criteria specific enough, or can you hit them without delivering real value?
22
+ - Who is missing from the stakeholder list? (security team? operations? legal? downstream systems? support?)
23
+ - What happens if this is never built? Is the status quo actually acceptable, or is the cost of inaction undersold?
24
+ - Is this one intent or multiple intents in a trenchcoat? (Signs: "and" in the goal, >4 success criteria, multiple unrelated stakeholder groups)
25
+ - What is the smallest version of this that would deliver value? Is the current scope justified?
26
+ - Do any success criteria contradict each other, or compete for the same finite resource (time, budget, attention)?
27
+ - Are the constraints real constraints (regulatory, physical, contractual) or assumed constraints that should be challenged?
28
+
29
+ **For `usecase.md`:**
30
+ - Does every step in the main flow have a clear actor and a clear outcome?
31
+ - What happens when step N fails? Map every failure mode — missing network, invalid state, concurrent users, timeout.
32
+ - What are the performance expectations? Is 100ms acceptable? 10 seconds? Does it matter? (Unstated = undefined = will cause conflict later.)
33
+ - How does this behave under load? Concurrent executions? Race conditions on shared state?
34
+ - What data does this touch, and what happens if that data is malformed, missing, or stale?
35
+ - Is this one UseCase or two? (Signs: "or" in the main flow, alternate flow that rewrites most of the main flow, two distinct actors)
36
+ - What happens at the boundaries — first use ever, N+1th use, quota exhaustion, rollback after failure?
37
+ - Are the postconditions complete? Does something need to be notified? Logged? Cleaned up?
38
+ - Do the error conditions cover all failure modes discovered above, with specific system responses?
39
+
40
+ **For `impl.md`:**
41
+ - Is each design decision justified by the usecase requirements, or is it "we always do it this way"?
42
+ - What are the failure modes of the chosen approach? Under what conditions does it break?
43
+ - Are the tests verifying observable behaviour from the actor's perspective, or are they testing implementation details?
44
+ - What is NOT covered by the listed tests that should be? (Error paths, concurrent access, edge inputs, integration with external systems)
45
+ - Will this implementation survive the next likely change to the behaviour spec? (e.g., if a new actor is added, or a new postcondition)
46
+ - Are the source files listed complete? Could the behaviour actually be satisfied by these files, or are there missing dependencies?
47
+ - Do the commits listed account for all the code in the source files? Are there uncommitted changes?
48
+
49
+ 4. Categorize every finding:
50
+ - **Blocker** — must be resolved before proceeding (spec is incomplete or contradictory in a way that will cause implementation failures)
51
+ - **Concern** — should be addressed soon (spec has a gap or assumption that will likely cause problems)
52
+ - **Suggestion** — worth considering (improvement that reduces risk or improves clarity, but not urgent)
53
+
54
+ 5. Present findings in priority order (blockers first), using concrete examples from the artifact text. For each finding, quote the specific line or section being challenged.
55
+
56
+ 6. Present next steps:
57
+
58
+ > 💡 If this session is getting long, consider running `/compact` or starting a fresh context before the next task.
59
+
60
+ **What's next?**
61
+ [A] `/tr-refine <path>` — apply the findings to the spec
62
+ [B] `/tr-implement <path>/` — spec is clean; proceed to implementation
63
+
64
+ ## Output
65
+
66
+ A structured critique report with findings grouped as **Blockers**, **Concerns**, and **Suggestions**. Each finding quotes the relevant artifact text and explains the risk.
67
+
68
+ The artifact is NOT modified.
69
+
70
+ ## CLI Dependencies
71
+
72
+ None during review. The user then decides whether to run:
73
+ - `taproot validate-format` (to check current state)
74
+ - `/taproot:refine` (to apply suggested changes)
75
+ - `/taproot:intent` (to revise the intent)
76
+
77
+ ## Notes
78
+
79
+ - Do not soften the critique. The purpose is to find real problems before implementation, not to validate the work. A review that finds nothing is not a success — it means you weren't looking hard enough.
80
+ - If the artifact is clearly a placeholder or stub (lots of `<placeholder>` text), flag this explicitly rather than reviewing the placeholders themselves.
@@ -0,0 +1,103 @@
1
+ # Skill: status
2
+
3
+ ## Description
4
+
5
+ Generate a health dashboard for the requirement hierarchy. Combines `taproot coverage`, `taproot check-orphans`, and `taproot sync-check` into a synthesized narrative summary with actionable next steps.
6
+
7
+ ## Inputs
8
+
9
+ - `path` (optional): Path to scope the report to a subtree. Defaults to `taproot/`.
10
+
11
+ ## Steps
12
+
13
+ 1. Run `taproot coverage --path <path> --format json` and parse the output. Key fields: `totals.behaviours`, `totals.implementations`, `totals.completeImpls`, `totals.testedImpls`, `totals.deferredBehaviours`, `totals.deferredImpls`. Use `deferredBehaviours` and `deferredImpls` to populate the **Parked** section; omit the section entirely if both are zero.
14
+
15
+ 2. Run `taproot check-orphans --path <path> --include-unimplemented` and collect violations.
16
+
17
+ 3. Run `taproot sync-check --path <path>` and collect warnings.
18
+
19
+ 4. Run `taproot validate-structure --path <path>` and `taproot validate-format --path <path>`. Any errors here are top-priority — flag them before the narrative.
20
+
21
+ 5. Synthesize into a structured report:
22
+
23
+ ```
24
+ # Taproot Status Report
25
+ Generated: <date>
26
+
27
+ ## Validation
28
+ ✓ Structure valid | ✗ 2 format errors (fix these first)
29
+
30
+ ## Coverage
31
+ <N> intents · <N> behaviours · <N> implementations
32
+ █████████░░░ <N>/<N> implementations complete
33
+ █████████░░░ <N>/<N> implementations with tests
34
+
35
+ ## What's Working
36
+ - Intent "<name>": all <N> behaviours implemented and tested ✓
37
+ - Behaviour "<name>": <N>/<N> implementations complete ✓
38
+
39
+ ## What Needs Attention
40
+ - <N> behaviours specified but not implemented:
41
+ · taproot/<intent>/<behaviour>/ [proposed since <date>]
42
+ - <N> implementations missing tests:
43
+ · taproot/<path>/impl.md ⚠
44
+ - <N> potentially stale specs (code changed after spec):
45
+ · taproot/<path>/impl.md — source file modified <N> days ago
46
+
47
+ ## Parked
48
+ - <N> behaviours deferred: (omit section entirely if 0)
49
+ · taproot/<intent>/<behaviour>/ — <reason if provided>
50
+ - <N> implementations deferred:
51
+ · taproot/<path>/impl.md — <reason if provided>
52
+
53
+ ## Structural Issues
54
+ - <from check-orphans>
55
+
56
+ ## Suggested Next Actions
57
+ 1. Fix format errors: `taproot validate-format --fix`
58
+ 2. Implement next behaviour: `/taproot:implement taproot/<path>/`
59
+ 3. Add tests to: `/taproot:refine taproot/<path>/`
60
+ 4. Review stale spec: `/taproot:refine taproot/<path>/`
61
+ ```
62
+
63
+ 6. Prioritize suggestions by severity:
64
+ - Validation errors first (broken structure/format)
65
+ - Orphaned or broken references second
66
+ - Unimplemented behaviours third (sorted by how long they've been in `proposed` state)
67
+ - Missing tests fourth
68
+ - Stale specs fifth
69
+
70
+ 7. If no issues are found: "Everything looks healthy. <N> intents, <N> behaviours, <N> implementations — all valid, complete, and tested."
71
+
72
+ Present next steps based on what was found:
73
+
74
+ - **If specific priority items were found** (unimplemented behaviours, missing tests, validation errors): surface the top 1–2 as direct lettered options with the exact command and path pre-filled. Add one generic fallback option last. Example:
75
+
76
+ **What's next?**
77
+ [A] `/tr-implement taproot/<intent>/<behaviour>/` — implement unimplemented behaviour
78
+ [B] `/tr-refine taproot/<intent>/<behaviour>/` — add missing tests
79
+ [C] `/tr-plan` — pick a different next item
80
+
81
+ - **If no specific items were found** (healthy project): show the generic fallback menu:
82
+
83
+ **What's next?**
84
+ [A] `/tr-plan` — pick the next behaviour to implement
85
+ [B] `/tr-ineed` — capture a new requirement
86
+ [C] `/tr-review-all` — deeper semantic review of specs
87
+
88
+ ## Output
89
+
90
+ A narrative health summary with metrics, issue categorization, and prioritized action list.
91
+
92
+ ## CLI Dependencies
93
+
94
+ - `taproot coverage`
95
+ - `taproot check-orphans`
96
+ - `taproot sync-check`
97
+ - `taproot validate-structure`
98
+ - `taproot validate-format`
99
+
100
+ ## Notes
101
+
102
+ - This skill is read-only. It reports, it does not modify.
103
+ - For deep semantic issues (unclear specs, over-scoped intents), this skill will not catch them — suggest `/taproot:review-all` for that.
@@ -0,0 +1,89 @@
1
+ # Skill: sweep
2
+
3
+ ## Description
4
+
5
+ Apply a uniform task to a filtered set of hierarchy files — enumerate matching items, confirm with the developer, then process each file in-session with live progress marking.
6
+
7
+ ## Inputs
8
+
9
+ - `task` (required): Natural language description of the task to apply to each item (e.g. "add a Notes section to every usecase").
10
+ - `scope` (optional): Subtree to limit enumeration to (defaults to `taproot/`).
11
+ - `type` (optional): File type filter — `usecase`, `intent`, or `impl` (defaults to all three).
12
+
13
+ ## Steps
14
+
15
+ 1. Read the task description and determine the target file type(s):
16
+ - If the developer mentions "all usecases" / "every usecase" → filter to `usecase.md` files
17
+ - If the developer mentions "all intents" / "every intent" → filter to `intent.md` files
18
+ - If the developer mentions "all impls" / "every implementation" → filter to `impl.md` files
19
+ - If ambiguous, ask: "Should I apply this to usecases, intents, implementations, or all three?"
20
+
21
+ Also check if the task requires **cross-item context** (e.g. "renumber all AC IDs globally" — needs awareness of IDs across files). If yes, warn:
22
+ > "This task needs cross-item context — consider `/tr-review-all` instead."
23
+ > And stop.
24
+
25
+ 2. Enumerate matching files under the scope path (default: `taproot/`). Walk the hierarchy and collect all files matching the target type(s). Exclude any files that are clearly not candidates (e.g. OVERVIEW.md, impl.md files in `proposed` state for an intent-only sweep).
26
+
27
+ If no files are found:
28
+ > "No `<type>` items found under `<scope>`."
29
+ > Stop.
30
+
31
+ 3. Present the list and ask for confirmation:
32
+ > "Found **N** `<type>` files under `<scope>`:"
33
+ > ```
34
+ > taproot/intent-a/behaviour-b/usecase.md
35
+ > taproot/intent-a/behaviour-c/usecase.md
36
+ > ...
37
+ > ```
38
+ > "Apply '`<task>`' to each of these **N** files? **[Y] Yes** / **[N] No**"
39
+
40
+ If the developer says **[N]** or "no" or "cancel":
41
+ > "Cancelled."
42
+ > Stop.
43
+
44
+ 4. For each file in the confirmed list, process it in-session:
45
+ a. Read the file to understand its current content
46
+ b. Apply the task directly — edit the file in place
47
+ c. Output progress immediately after completing each file:
48
+ ```
49
+ [x] taproot/intent-a/behaviour-b/usecase.md
50
+ ```
51
+
52
+ **For tasks requiring codebase exploration** (e.g. "add ACs from existing tests", "fill in missing fields from source code"), before processing each file:
53
+ - Identify **where to look**: explicit directory paths relevant to the file (e.g. `test/integration/`, `src/commands/`)
54
+ - Find the **matching artefact**: use the usecase slug (second-to-last path segment) to locate a related test file, source file, or doc (e.g. slug `validate-format` → `test/integration/validate-format.test.ts`)
55
+ - If no match is found for a file, mark it skipped and move on:
56
+ ```
57
+ [ ] taproot/intent-a/behaviour-c/usecase.md — no matching test file found
58
+ ```
59
+
60
+ If the task description is vague, ask one clarifying question before processing the first file: "What specifically should change — is there a pattern to add, a section to fill, or a format to fix?"
61
+
62
+ 5. After all files are processed, show a summary:
63
+ > "Sweep complete — N files processed: M modified, K skipped"
64
+
65
+ > 💡 If this session is getting long, consider running `/compact` or starting a fresh context before the next task.
66
+
67
+ 6. Present next steps:
68
+
69
+ **What's next?**
70
+ [A] `/tr-sweep` again — run another sweep with a different task or scope
71
+ [B] `/tr-status` — see the full project health after these changes
72
+
73
+ ## Output
74
+
75
+ - In-session edits to each matched file
76
+ - Live `[x]` progress line per file
77
+ - Summary: N processed, M modified, K skipped
78
+
79
+ ## CLI Dependencies
80
+
81
+ None — all processing is done in-session by the agent.
82
+
83
+ ## Notes
84
+
85
+ - The developer confirmation at step 3 is non-negotiable — no files are processed before confirmation.
86
+ - Each file is processed independently — the agent reads and edits it directly in context. No temp files or subprocesses.
87
+ - For codebase-exploration tasks: use the usecase slug (second-to-last path segment) to find related artefacts. Always verify the match exists before assuming it applies.
88
+ - If the task description is vague ("improve them"), ask one clarifying question before proceeding: "What specifically should change — is there a pattern to add, a section to fill, or a format to fix?"
89
+ - `/tr-sweep` is the Claude Code adapter command name for this skill.