@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,151 @@
1
+ # Skill: trace
2
+
3
+ ## Description
4
+
5
+ Navigate the requirement hierarchy in any direction: from code to intent (bottom-up), from intent to code (top-down), laterally across siblings, or scan for unlinked code. Answers "why does this code exist?" and "what's left to build?"
6
+
7
+ ## Inputs
8
+
9
+ - `target` (required unless `--unlinked`): A file path, commit hash, or Taproot folder path.
10
+ - `--unlinked` (flag): Scan the codebase for source files not referenced by any `impl.md`.
11
+ - `direction` (optional): `up` (bottom-up, default for file/commit inputs), `down` (top-down, default for intent/behaviour inputs), `lateral` (siblings and cousins).
12
+
13
+ ## Steps
14
+
15
+ ### Bottom-up (from a source file)
16
+
17
+ 1. Search all `impl.md` files under `taproot/` for the given file path in the **Source Files** section. Use exact match first, then fuzzy match if not found.
18
+
19
+ 2. If found: read that `impl.md`. Note the behaviour folder it lives in.
20
+
21
+ 3. Read the parent `usecase.md`. Note the intent folder it lives in.
22
+
23
+ 4. Read the parent `intent.md`.
24
+
25
+ 5. Display the full chain:
26
+
27
+ ```
28
+ File: src/auth/password-reset.ts
29
+ └─ impl: taproot/password-reset/request-reset/email-trigger/impl.md
30
+ State: complete | 2 commits | 1 test
31
+ └─ behaviour: taproot/password-reset/request-reset/usecase.md
32
+ Behaviour: Request Password Reset
33
+ State: implemented
34
+ └─ intent: taproot/password-reset/intent.md
35
+ Intent: Password Reset Without Support Contact
36
+ State: active
37
+ ```
38
+
39
+ 6. If not found in any `impl.md`: "No traceability record found for `<file>`. This file may be unlinked."
40
+
41
+ > 💡 If this session is getting long, consider running `/compact` or starting a fresh context before the next task.
42
+
43
+ **What's next?**
44
+ [A] `/tr-trace --unlinked` — find all unlinked files across the codebase
45
+ [B] `/tr-implement <path>/` — create a traceability record for this file
46
+
47
+ If the chain was found, present:
48
+
49
+ > 💡 If this session is getting long, consider running `/compact` or starting a fresh context before the next task.
50
+
51
+ **What's next?**
52
+ [A] `/tr-refine <behaviour-path>/` — update the spec if it has drifted from the code
53
+ [B] `/tr-implement <behaviour-path>/` — add a new implementation under this behaviour
54
+
55
+ ### Bottom-up (from a commit hash)
56
+
57
+ 1. Search all `impl.md` files under `taproot/` for the given hash (full or short) in the **Commits** section.
58
+
59
+ 2. If found: proceed as above from step 2.
60
+
61
+ 3. If not found: "Commit `<hash>` is not referenced by any `impl.md`. Run `taproot link-commits` to auto-link commits with `taproot(<path>):` tags."
62
+
63
+ ### Top-down (from an intent or behaviour folder)
64
+
65
+ 1. Read the `intent.md` or `usecase.md` at `target`.
66
+
67
+ 2. Walk the full subtree, collecting all behaviours and their implementations.
68
+
69
+ 3. Display as a structured tree with status indicators:
70
+
71
+ ```
72
+ Intent: Password Reset Without Support Contact [active]
73
+ ├─ request-reset [implemented]
74
+ │ ├─ email-trigger [complete, 2 commits, 1 test] ✓
75
+ │ └─ rate-limiter [in-progress, 0 commits, 0 tests] ⚠
76
+ ├─ verify-identity [specified]
77
+ │ └─ (no implementations)
78
+ └─ set-new-password [proposed]
79
+ └─ (no implementations)
80
+
81
+ Progress: 1/5 behaviours fully implemented and tested
82
+ ```
83
+
84
+ 4. Suggest next actions based on the tree state:
85
+
86
+ **What's next?**
87
+ [A] `/tr-implement taproot/<intent-slug>/<unimplemented-behaviour-slug>/` — implement the first unimplemented behaviour
88
+ [B] `/tr-refine taproot/<intent-slug>/<behaviour-slug>/` — update a spec that has drifted
89
+
90
+ ### Lateral (siblings and cousins)
91
+
92
+ 1. Read the artifact at `target`.
93
+
94
+ 2. Find all sibling nodes (same parent).
95
+
96
+ 3. Find cousin nodes (same grandparent, different parent) if the parent is a behaviour.
97
+
98
+ 4. Display:
99
+
100
+ ```
101
+ Behaviour: request-reset (under: password-reset)
102
+
103
+ Siblings (other behaviours under password-reset):
104
+ ├─ verify-identity [specified]
105
+ └─ set-new-password [proposed]
106
+
107
+ Related intent: Password Reset Without Support Contact [active]
108
+ Success criteria addressed by this behaviour:
109
+ ✓ "Users can request a reset link without contacting support"
110
+ ? "Reset link expires after 15 minutes" (not verified in postconditions)
111
+ ```
112
+
113
+ ### --unlinked (find orphaned code)
114
+
115
+ 1. Run `taproot check-orphans --include-unimplemented` to get the structured orphan report.
116
+
117
+ 2. Walk the source code directories (common locations: `src/`, `lib/`, `app/`). List all source files.
118
+
119
+ 3. Collect all file paths mentioned in any `impl.md` Source Files sections.
120
+
121
+ 4. Compute the difference: source files NOT in any `impl.md`.
122
+
123
+ 5. Group unlinked files by directory. For each group, suggest a likely behaviour based on the directory name and file names:
124
+
125
+ ```
126
+ Unlinked source files (not referenced by any impl.md):
127
+
128
+ src/notifications/ (4 files)
129
+ Possible behaviour: "Send notification on account event"
130
+ Suggested intent: user-onboarding or a new notifications intent
131
+ → /taproot:behaviour taproot/user-onboarding/ "send account notification emails"
132
+
133
+ src/admin/ (12 files)
134
+ Possible behaviour: "Admin dashboard" or "Manage user accounts"
135
+ Suggested intent: create new admin-panel intent
136
+ → /taproot:intent "Admin dashboard for managing user accounts"
137
+ ```
138
+
139
+ ## Output
140
+
141
+ A formatted trace showing the chain from intent → behaviour → implementation → code → tests, or an unlinked file report with suggestions.
142
+
143
+ ## CLI Dependencies
144
+
145
+ - `taproot check-orphans`
146
+ - `taproot coverage`
147
+
148
+ ## Notes
149
+
150
+ - For `--unlinked`, only scan directories that are likely to contain application code. Skip: `node_modules/`, `dist/`, `.git/`, `test/`, `__tests__/`, `*.test.*`, `*.spec.*`.
151
+ - If the hierarchy is very deep (>5 levels of sub-behaviours), collapse intermediate levels in the display and offer to expand on request.