liteagents 2.4.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 (215) hide show
  1. package/CHANGELOG.md +441 -0
  2. package/LICENSE +21 -0
  3. package/README.md +179 -0
  4. package/cli.js +230 -0
  5. package/docs/.gitkeep +1 -0
  6. package/docs/CONTRIBUTING.md +739 -0
  7. package/docs/DUAL_PUBLISH_SUMMARY.md +177 -0
  8. package/docs/ERROR_HANDLING_IMPLEMENTATION.md +327 -0
  9. package/docs/GITHUB_PACKAGES.md +181 -0
  10. package/docs/GITHUB_SETUP.md +158 -0
  11. package/docs/INSTALLATION_DEMO.md +691 -0
  12. package/docs/INSTALLATION_LOCATIONS.md +299 -0
  13. package/docs/INSTALLER_GUIDE.md +1586 -0
  14. package/docs/INTEGRATION_ISSUES_9.1.md +341 -0
  15. package/docs/KNOWLEDGE_BASE.md +727 -0
  16. package/docs/MIGRATION.md +384 -0
  17. package/docs/PACKAGE_BASELINE.md +557 -0
  18. package/docs/PACKAGE_VALIDATION_REPORT.md +427 -0
  19. package/docs/PASS_INTEGRATION.md +307 -0
  20. package/docs/PASS_QUICK_START.md +150 -0
  21. package/docs/PRIVACY.md +203 -0
  22. package/docs/PUBLISHING.md +494 -0
  23. package/docs/QUICK-START.md +318 -0
  24. package/docs/RELEASE_NOTES_1.2.0.md +323 -0
  25. package/docs/SECURITY.md +317 -0
  26. package/docs/SILENT_MODE_GUIDE.md +526 -0
  27. package/docs/SKILLS_CONVERSION.md +154 -0
  28. package/docs/TESTING.md +582 -0
  29. package/docs/TEST_COVERAGE.md +347 -0
  30. package/docs/TROUBLESHOOTING.md +788 -0
  31. package/docs/UPDATED_VARIANT_CONFIGURATION.md +274 -0
  32. package/docs/VARIANT_CONFIGURATION.md +440 -0
  33. package/installer/cli.js +761 -0
  34. package/installer/installation-engine.js +1536 -0
  35. package/installer/package-manager.js +640 -0
  36. package/installer/path-manager.js +427 -0
  37. package/installer/report-template.js +298 -0
  38. package/installer/verification-system.js +274 -0
  39. package/package.json +83 -0
  40. package/packages/ampcode/AGENT.md +58 -0
  41. package/packages/ampcode/README.md +17 -0
  42. package/packages/ampcode/agents/1-create-prd.md +175 -0
  43. package/packages/ampcode/agents/2-generate-tasks.md +190 -0
  44. package/packages/ampcode/agents/3-process-task-list.md +225 -0
  45. package/packages/ampcode/agents/code-developer.md +198 -0
  46. package/packages/ampcode/agents/context-builder.md +142 -0
  47. package/packages/ampcode/agents/feature-planner.md +199 -0
  48. package/packages/ampcode/agents/market-researcher.md +89 -0
  49. package/packages/ampcode/agents/orchestrator.md +116 -0
  50. package/packages/ampcode/agents/quality-assurance.md +115 -0
  51. package/packages/ampcode/agents/system-architect.md +135 -0
  52. package/packages/ampcode/agents/ui-designer.md +184 -0
  53. package/packages/ampcode/commands/brainstorming.md +56 -0
  54. package/packages/ampcode/commands/code-review.md +107 -0
  55. package/packages/ampcode/commands/condition-based-waiting/example.ts +158 -0
  56. package/packages/ampcode/commands/condition-based-waiting.md +122 -0
  57. package/packages/ampcode/commands/debug.md +20 -0
  58. package/packages/ampcode/commands/docs-builder/templates.md +572 -0
  59. package/packages/ampcode/commands/docs-builder.md +106 -0
  60. package/packages/ampcode/commands/explain.md +18 -0
  61. package/packages/ampcode/commands/git-commit.md +14 -0
  62. package/packages/ampcode/commands/optimize.md +20 -0
  63. package/packages/ampcode/commands/refactor.md +21 -0
  64. package/packages/ampcode/commands/review.md +18 -0
  65. package/packages/ampcode/commands/root-cause-tracing/find-polluter.sh +63 -0
  66. package/packages/ampcode/commands/root-cause-tracing.md +176 -0
  67. package/packages/ampcode/commands/security.md +21 -0
  68. package/packages/ampcode/commands/ship.md +18 -0
  69. package/packages/ampcode/commands/skill-creator/scripts/init_skill.py +303 -0
  70. package/packages/ampcode/commands/skill-creator/scripts/package_skill.py +110 -0
  71. package/packages/ampcode/commands/skill-creator/scripts/quick_validate.py +65 -0
  72. package/packages/ampcode/commands/skill-creator.md +211 -0
  73. package/packages/ampcode/commands/stash.md +45 -0
  74. package/packages/ampcode/commands/systematic-debugging.md +297 -0
  75. package/packages/ampcode/commands/test-driven-development.md +390 -0
  76. package/packages/ampcode/commands/test-generate.md +18 -0
  77. package/packages/ampcode/commands/testing-anti-patterns.md +304 -0
  78. package/packages/ampcode/commands/verification-before-completion.md +152 -0
  79. package/packages/ampcode/settings.json +13 -0
  80. package/packages/ampcode/variants.json +8 -0
  81. package/packages/claude/CLAUDE.md +58 -0
  82. package/packages/claude/README.md +23 -0
  83. package/packages/claude/agents/1-create-prd.md +175 -0
  84. package/packages/claude/agents/2-generate-tasks.md +190 -0
  85. package/packages/claude/agents/3-process-task-list.md +225 -0
  86. package/packages/claude/agents/code-developer.md +198 -0
  87. package/packages/claude/agents/context-builder.md +142 -0
  88. package/packages/claude/agents/feature-planner.md +199 -0
  89. package/packages/claude/agents/market-researcher.md +89 -0
  90. package/packages/claude/agents/orchestrator.md +117 -0
  91. package/packages/claude/agents/quality-assurance.md +115 -0
  92. package/packages/claude/agents/system-architect.md +135 -0
  93. package/packages/claude/agents/ui-designer.md +184 -0
  94. package/packages/claude/commands/debug.md +20 -0
  95. package/packages/claude/commands/explain.md +18 -0
  96. package/packages/claude/commands/git-commit.md +14 -0
  97. package/packages/claude/commands/optimize.md +20 -0
  98. package/packages/claude/commands/refactor.md +21 -0
  99. package/packages/claude/commands/review.md +18 -0
  100. package/packages/claude/commands/security.md +21 -0
  101. package/packages/claude/commands/ship.md +18 -0
  102. package/packages/claude/commands/stash.md +45 -0
  103. package/packages/claude/commands/test-generate.md +18 -0
  104. package/packages/claude/skills/brainstorming/SKILL.md +56 -0
  105. package/packages/claude/skills/code-review/SKILL.md +107 -0
  106. package/packages/claude/skills/code-review/code-reviewer.md +146 -0
  107. package/packages/claude/skills/condition-based-waiting/SKILL.md +122 -0
  108. package/packages/claude/skills/condition-based-waiting/example.ts +158 -0
  109. package/packages/claude/skills/docs-builder/SKILL.md +106 -0
  110. package/packages/claude/skills/docs-builder/references/templates.md +572 -0
  111. package/packages/claude/skills/root-cause-tracing/SKILL.md +176 -0
  112. package/packages/claude/skills/root-cause-tracing/find-polluter.sh +63 -0
  113. package/packages/claude/skills/skill-creator/LICENSE.txt +202 -0
  114. package/packages/claude/skills/skill-creator/SKILL.md +211 -0
  115. package/packages/claude/skills/skill-creator/scripts/init_skill.py +303 -0
  116. package/packages/claude/skills/skill-creator/scripts/package_skill.py +110 -0
  117. package/packages/claude/skills/skill-creator/scripts/quick_validate.py +65 -0
  118. package/packages/claude/skills/systematic-debugging/CREATION-LOG.md +119 -0
  119. package/packages/claude/skills/systematic-debugging/SKILL.md +296 -0
  120. package/packages/claude/skills/systematic-debugging/test-academic.md +14 -0
  121. package/packages/claude/skills/systematic-debugging/test-pressure-1.md +58 -0
  122. package/packages/claude/skills/systematic-debugging/test-pressure-2.md +68 -0
  123. package/packages/claude/skills/systematic-debugging/test-pressure-3.md +69 -0
  124. package/packages/claude/skills/test-driven-development/SKILL.md +392 -0
  125. package/packages/claude/skills/testing-anti-patterns/SKILL.md +304 -0
  126. package/packages/claude/skills/verification-before-completion/SKILL.md +152 -0
  127. package/packages/claude/variants.json +9 -0
  128. package/packages/droid/AGENTS.md +52 -0
  129. package/packages/droid/README.md +17 -0
  130. package/packages/droid/change_settings.json +61 -0
  131. package/packages/droid/commands/brainstorming.md +56 -0
  132. package/packages/droid/commands/code-review.md +107 -0
  133. package/packages/droid/commands/condition-based-waiting/example.ts +158 -0
  134. package/packages/droid/commands/condition-based-waiting.md +122 -0
  135. package/packages/droid/commands/debug.md +20 -0
  136. package/packages/droid/commands/docs-builder/templates.md +572 -0
  137. package/packages/droid/commands/docs-builder.md +106 -0
  138. package/packages/droid/commands/explain.md +18 -0
  139. package/packages/droid/commands/git-commit.md +14 -0
  140. package/packages/droid/commands/optimize.md +20 -0
  141. package/packages/droid/commands/refactor.md +21 -0
  142. package/packages/droid/commands/review.md +18 -0
  143. package/packages/droid/commands/root-cause-tracing/find-polluter.sh +63 -0
  144. package/packages/droid/commands/root-cause-tracing.md +176 -0
  145. package/packages/droid/commands/security.md +21 -0
  146. package/packages/droid/commands/ship.md +18 -0
  147. package/packages/droid/commands/skill-creator/scripts/init_skill.py +303 -0
  148. package/packages/droid/commands/skill-creator/scripts/package_skill.py +110 -0
  149. package/packages/droid/commands/skill-creator/scripts/quick_validate.py +65 -0
  150. package/packages/droid/commands/skill-creator.md +211 -0
  151. package/packages/droid/commands/stash.md +45 -0
  152. package/packages/droid/commands/systematic-debugging.md +297 -0
  153. package/packages/droid/commands/test-driven-development.md +390 -0
  154. package/packages/droid/commands/test-generate.md +18 -0
  155. package/packages/droid/commands/testing-anti-patterns.md +304 -0
  156. package/packages/droid/commands/verification-before-completion.md +152 -0
  157. package/packages/droid/droids/1-create-prd.md +170 -0
  158. package/packages/droid/droids/2-generate-tasks.md +190 -0
  159. package/packages/droid/droids/3-process-task-list.md +225 -0
  160. package/packages/droid/droids/code-developer.md +198 -0
  161. package/packages/droid/droids/context-builder.md +142 -0
  162. package/packages/droid/droids/feature-planner.md +199 -0
  163. package/packages/droid/droids/market-researcher.md +89 -0
  164. package/packages/droid/droids/orchestrator.md +116 -0
  165. package/packages/droid/droids/quality-assurance.md +115 -0
  166. package/packages/droid/droids/system-architect.md +135 -0
  167. package/packages/droid/droids/ui-designer.md +184 -0
  168. package/packages/droid/variants.json +8 -0
  169. package/packages/opencode/AGENTS.md +52 -0
  170. package/packages/opencode/README.md +17 -0
  171. package/packages/opencode/agent/1-create-prd.md +179 -0
  172. package/packages/opencode/agent/2-generate-tasks.md +194 -0
  173. package/packages/opencode/agent/3-process-task-list.md +229 -0
  174. package/packages/opencode/agent/code-developer.md +202 -0
  175. package/packages/opencode/agent/context-builder.md +146 -0
  176. package/packages/opencode/agent/feature-planner.md +203 -0
  177. package/packages/opencode/agent/market-researcher.md +93 -0
  178. package/packages/opencode/agent/orchestrator.md +120 -0
  179. package/packages/opencode/agent/quality-assurance.md +119 -0
  180. package/packages/opencode/agent/system-architect.md +139 -0
  181. package/packages/opencode/agent/ui-designer.md +188 -0
  182. package/packages/opencode/command/brainstorming.md +56 -0
  183. package/packages/opencode/command/code-review.md +107 -0
  184. package/packages/opencode/command/condition-based-waiting/example.ts +158 -0
  185. package/packages/opencode/command/condition-based-waiting.md +122 -0
  186. package/packages/opencode/command/debug.md +20 -0
  187. package/packages/opencode/command/docs-builder/templates.md +572 -0
  188. package/packages/opencode/command/docs-builder.md +106 -0
  189. package/packages/opencode/command/explain.md +18 -0
  190. package/packages/opencode/command/git-commit.md +14 -0
  191. package/packages/opencode/command/optimize.md +20 -0
  192. package/packages/opencode/command/refactor.md +21 -0
  193. package/packages/opencode/command/review.md +18 -0
  194. package/packages/opencode/command/root-cause-tracing/find-polluter.sh +63 -0
  195. package/packages/opencode/command/root-cause-tracing.md +176 -0
  196. package/packages/opencode/command/security.md +21 -0
  197. package/packages/opencode/command/ship.md +18 -0
  198. package/packages/opencode/command/skill-creator/scripts/init_skill.py +303 -0
  199. package/packages/opencode/command/skill-creator/scripts/package_skill.py +110 -0
  200. package/packages/opencode/command/skill-creator/scripts/quick_validate.py +65 -0
  201. package/packages/opencode/command/skill-creator.md +211 -0
  202. package/packages/opencode/command/stash.md +45 -0
  203. package/packages/opencode/command/systematic-debugging.md +297 -0
  204. package/packages/opencode/command/test-driven-development.md +390 -0
  205. package/packages/opencode/command/test-generate.md +18 -0
  206. package/packages/opencode/command/testing-anti-patterns.md +304 -0
  207. package/packages/opencode/command/verification-before-completion.md +152 -0
  208. package/packages/opencode/opencode.jsonc +201 -0
  209. package/packages/opencode/variants.json +8 -0
  210. package/packages/subagentic-manual.md +349 -0
  211. package/postinstall.js +21 -0
  212. package/tools/ampcode/manifest-template.json +14 -0
  213. package/tools/claude/manifest-template.json +14 -0
  214. package/tools/droid/manifest-template.json +14 -0
  215. package/tools/opencode/manifest-template.json +14 -0
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: condition-based-waiting
3
+ description: Use when tests have race conditions, timing dependencies, or inconsistent pass/fail behavior - replaces arbitrary timeouts with condition polling to wait for actual state changes, eliminating flaky tests from timing guesses
4
+ usage: /condition-based-waiting <condition-type> <timeout-specs>
5
+ auto_trigger: false
6
+ ---
7
+
8
+ # Condition-Based Waiting
9
+
10
+ ## Overview
11
+
12
+ Flaky tests often guess at timing with arbitrary delays. This creates race conditions where tests pass on fast machines but fail under load or in CI.
13
+
14
+ **Core principle:** Wait for the actual condition you care about, not a guess about how long it takes.
15
+
16
+ ## When to Use
17
+
18
+ ```dot
19
+ digraph when_to_use {
20
+ "Test uses setTimeout/sleep?" [shape=diamond];
21
+ "Testing timing behavior?" [shape=diamond];
22
+ "Document WHY timeout needed" [shape=box];
23
+ "Use condition-based waiting" [shape=box];
24
+
25
+ "Test uses setTimeout/sleep?" -> "Testing timing behavior?" [label="yes"];
26
+ "Testing timing behavior?" -> "Document WHY timeout needed" [label="yes"];
27
+ "Testing timing behavior?" -> "Use condition-based waiting" [label="no"];
28
+ }
29
+ ```
30
+
31
+ **Use when:**
32
+ - Tests have arbitrary delays (`setTimeout`, `sleep`, `time.sleep()`)
33
+ - Tests are flaky (pass sometimes, fail under load)
34
+ - Tests timeout when run in parallel
35
+ - Waiting for async operations to complete
36
+
37
+ **Don't use when:**
38
+ - Testing actual timing behavior (debounce, throttle intervals)
39
+ - Always document WHY if using arbitrary timeout
40
+
41
+ ## Core Pattern
42
+
43
+ ```typescript
44
+ // ❌ BEFORE: Guessing at timing
45
+ await new Promise(r => setTimeout(r, 50));
46
+ const result = getResult();
47
+ expect(result).toBeDefined();
48
+
49
+ // ✅ AFTER: Waiting for condition
50
+ await waitFor(() => getResult() !== undefined);
51
+ const result = getResult();
52
+ expect(result).toBeDefined();
53
+ ```
54
+
55
+ ## Quick Patterns
56
+
57
+ | Scenario | Pattern |
58
+ |----------|---------|
59
+ | Wait for event | `waitFor(() => events.find(e => e.type === 'DONE'))` |
60
+ | Wait for state | `waitFor(() => machine.state === 'ready')` |
61
+ | Wait for count | `waitFor(() => items.length >= 5)` |
62
+ | Wait for file | `waitFor(() => fs.existsSync(path))` |
63
+ | Complex condition | `waitFor(() => obj.ready && obj.value > 10)` |
64
+
65
+ ## Implementation
66
+
67
+ Generic polling function:
68
+ ```typescript
69
+ async function waitFor<T>(
70
+ condition: () => T | undefined | null | false,
71
+ description: string,
72
+ timeoutMs = 5000
73
+ ): Promise<T> {
74
+ const startTime = Date.now();
75
+
76
+ while (true) {
77
+ const result = condition();
78
+ if (result) return result;
79
+
80
+ if (Date.now() - startTime > timeoutMs) {
81
+ throw new Error(`Timeout waiting for ${description} after ${timeoutMs}ms`);
82
+ }
83
+
84
+ await new Promise(r => setTimeout(r, 10)); // Poll every 10ms
85
+ }
86
+ }
87
+ ```
88
+
89
+ See @example.ts for complete implementation with domain-specific helpers (`waitForEvent`, `waitForEventCount`, `waitForEventMatch`) from actual debugging session.
90
+
91
+ ## Common Mistakes
92
+
93
+ **❌ Polling too fast:** `setTimeout(check, 1)` - wastes CPU
94
+ **✅ Fix:** Poll every 10ms
95
+
96
+ **❌ No timeout:** Loop forever if condition never met
97
+ **✅ Fix:** Always include timeout with clear error
98
+
99
+ **❌ Stale data:** Cache state before loop
100
+ **✅ Fix:** Call getter inside loop for fresh data
101
+
102
+ ## When Arbitrary Timeout IS Correct
103
+
104
+ ```typescript
105
+ // Tool ticks every 100ms - need 2 ticks to verify partial output
106
+ await waitForEvent(manager, 'TOOL_STARTED'); // First: wait for condition
107
+ await new Promise(r => setTimeout(r, 200)); // Then: wait for timed behavior
108
+ // 200ms = 2 ticks at 100ms intervals - documented and justified
109
+ ```
110
+
111
+ **Requirements:**
112
+ 1. First wait for triggering condition
113
+ 2. Based on known timing (not guessing)
114
+ 3. Comment explaining WHY
115
+
116
+ ## Real-World Impact
117
+
118
+ From debugging session (2025-10-03):
119
+ - Fixed 15 flaky tests across 3 files
120
+ - Pass rate: 60% → 100%
121
+ - Execution time: 40% faster
122
+ - No more race conditions
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: debug
3
+ description: Debug issue [issue]
4
+ usage: /debug <issue-description>
5
+ argument-hint: [description of the problem]
6
+ ---
7
+ Debug: $ARGUMENTS
8
+
9
+ ## Process
10
+ 1. Clarify: What's expected vs actual behavior?
11
+ 2. Reproduce: What triggers the issue?
12
+ 3. Isolate: Which component/function is responsible?
13
+ 4. Trace: Follow the data flow
14
+ 5. Fix: Implement and verify the solution
15
+
16
+ ## Output
17
+ - Root cause
18
+ - Affected code paths
19
+ - Fix with explanation
20
+ - Prevention strategy
@@ -0,0 +1,572 @@
1
+ # Documentation Templates
2
+
3
+ Detailed templates for each file in the /docs structure.
4
+
5
+ ## 00-context/vision.md
6
+
7
+ ```markdown
8
+ # Vision
9
+
10
+ ## Problem
11
+ [What problem does this solve? Who feels the pain?]
12
+
13
+ ## Solution
14
+ [How does this product solve it?]
15
+
16
+ ## Target Users
17
+ [Who is this for? Primary/secondary personas]
18
+
19
+ ## Boundaries
20
+ ### In Scope
21
+ - [Feature/capability 1]
22
+ - [Feature/capability 2]
23
+
24
+ ### Out of Scope
25
+ - [What we explicitly won't do]
26
+ - [Adjacent problems we're ignoring]
27
+
28
+ ## Success Metrics
29
+ - [Metric 1: how measured]
30
+ - [Metric 2: how measured]
31
+ ```
32
+
33
+ ## 00-context/assumptions.md
34
+
35
+ ```markdown
36
+ # Assumptions & Risks
37
+
38
+ ## Technical Assumptions
39
+ - [Assumption 1: e.g., "Users have Python 3.8+"]
40
+ - [Assumption 2: e.g., "API response time < 200ms"]
41
+
42
+ ## Business Assumptions
43
+ - [Assumption 1: e.g., "Users prefer CLI over GUI"]
44
+ - [Assumption 2: e.g., "10K users within 6 months"]
45
+
46
+ ## Known Risks
47
+ | Risk | Impact | Mitigation |
48
+ |------|--------|------------|
49
+ | [Risk description] | High/Med/Low | [How we handle it] |
50
+
51
+ ## Open Questions
52
+ - [ ] [Question 1 that needs answering]
53
+ - [ ] [Question 2 that blocks decisions]
54
+ ```
55
+
56
+ ## 00-context/system-state.md
57
+
58
+ ```markdown
59
+ # System State
60
+
61
+ ## What's Implemented
62
+ ### Core Features
63
+ - [Feature 1] - Status: ✅ Live | 🚧 In Progress | 📋 Planned
64
+ - [Feature 2] - Status: [...]
65
+
66
+ ### Tech Stack
67
+ - Language: [e.g., Python 3.11]
68
+ - Frameworks: [e.g., FastAPI, React]
69
+ - Database: [e.g., PostgreSQL 15]
70
+ - Infrastructure: [e.g., AWS, Docker]
71
+
72
+ ## What's In Progress
73
+ - [Feature/change being worked on]
74
+ - [Expected completion: rough timeframe]
75
+
76
+ ## What's Planned
77
+ - [Next feature to build]
78
+ - [Roadmap item 2]
79
+
80
+ ## Known Issues
81
+ - [Issue 1: description, severity]
82
+ - [Issue 2: description, severity]
83
+ ```
84
+
85
+ ## 01-product/prd.md
86
+
87
+ ```markdown
88
+ # Product Requirements Document
89
+
90
+ ## Problem Statement
91
+ [Clear description of problem. 2-3 paragraphs max.]
92
+
93
+ ## User Personas
94
+ ### Primary: [Persona Name]
95
+ - **Who**: [Role/description]
96
+ - **Pain**: [Current problem]
97
+ - **Goal**: [What they want to achieve]
98
+
99
+ ### Secondary: [Persona Name]
100
+ [Same structure]
101
+
102
+ ## Features
103
+ ### Must Have (P0)
104
+ 1. **[Feature name]**
105
+ - Description: [What it does]
106
+ - User value: [Why it matters]
107
+ - Acceptance: [How we know it's done]
108
+
109
+ ### Should Have (P1)
110
+ [Same structure]
111
+
112
+ ### Nice to Have (P2)
113
+ [Same structure]
114
+
115
+ ## Non-Functional Requirements
116
+ - Performance: [e.g., "API responds < 200ms p95"]
117
+ - Security: [e.g., "OAuth2, encrypted at rest"]
118
+ - Scalability: [e.g., "Handle 10K concurrent users"]
119
+ - Reliability: [e.g., "99.9% uptime"]
120
+
121
+ ## Success Criteria
122
+ - [ ] [Measurable criterion 1]
123
+ - [ ] [Measurable criterion 2]
124
+
125
+ ## Out of Scope
126
+ - [Explicitly excluded feature 1]
127
+ - [Explicitly excluded feature 2]
128
+ ```
129
+
130
+ ## 02-features/feature-<name>/feature-spec.md
131
+
132
+ ```markdown
133
+ # Feature: [Name]
134
+
135
+ ## User Intent
136
+ **As a** [user type]
137
+ **I want to** [action]
138
+ **So that** [benefit]
139
+
140
+ ## User Stories
141
+ 1. **Story 1**: [Description]
142
+ - Acceptance: User can [specific action]
143
+ - Acceptance: System responds with [expected behavior]
144
+
145
+ ## Acceptance Criteria
146
+ - [ ] [Criterion 1: testable condition]
147
+ - [ ] [Criterion 2: testable condition]
148
+ - [ ] [Criterion 3: testable condition]
149
+
150
+ ## Edge Cases
151
+ - **Case 1**: [Scenario] → [Expected behavior]
152
+ - **Case 2**: [Scenario] → [Expected behavior]
153
+
154
+ ## UI/UX Notes
155
+ [Wireframes, mockups, or interaction descriptions]
156
+ ```
157
+
158
+ ## 02-features/feature-<name>/tech-design.md
159
+
160
+ ```markdown
161
+ # Technical Design: [Feature Name]
162
+
163
+ ## Architecture Approach
164
+ [High-level approach. Diagram if helpful.]
165
+
166
+ ## Components
167
+ ### [Component 1]
168
+ - **Responsibility**: [What it does]
169
+ - **Interface**: [API/methods]
170
+ - **Dependencies**: [What it needs]
171
+
172
+ ### [Component 2]
173
+ [Same structure]
174
+
175
+ ## Data Models
176
+ ```language
177
+ [Schema/types/interfaces]
178
+ ```
179
+
180
+ ## APIs
181
+ ### Endpoint: `METHOD /path`
182
+ - **Request**: [Schema]
183
+ - **Response**: [Schema]
184
+ - **Errors**: [Error codes]
185
+
186
+ ## Security Considerations
187
+ - [Auth/authz requirements]
188
+ - [Data validation]
189
+ - [Potential vulnerabilities addressed]
190
+
191
+ ## Performance Considerations
192
+ - [Expected load]
193
+ - [Optimization strategy]
194
+ - [Caching approach]
195
+
196
+ ## Trade-offs
197
+ - **Decision**: [What we chose]
198
+ - **Alternatives**: [What we didn't choose]
199
+ - **Rationale**: [Why]
200
+ ```
201
+
202
+ ## 02-features/feature-<name>/dev-tasks.md
203
+
204
+ ```markdown
205
+ # Development Tasks: [Feature Name]
206
+
207
+ ## Tasks
208
+ - [ ] Task 1: [Specific, executable action]
209
+ - Dependencies: [What must be done first]
210
+ - Files: [Which files to touch]
211
+ - [ ] Task 2: [...]
212
+ - [ ] Task 3: [...]
213
+
214
+ ## Implementation Notes
215
+ [Context LLM needs to execute tasks]
216
+
217
+ ## Definition of Done
218
+ - [ ] Code complete
219
+ - [ ] Tests pass
220
+ - [ ] Docs updated
221
+ - [ ] Reviewed
222
+ ```
223
+
224
+ ## 02-features/feature-<name>/test-plan.md
225
+
226
+ ```markdown
227
+ # Test Plan: [Feature Name]
228
+
229
+ ## Test Strategy
230
+ - **Unit**: [What to unit test]
231
+ - **Integration**: [What to integration test]
232
+ - **E2E**: [What to E2E test]
233
+
234
+ ## Test Cases
235
+ ### TC-1: [Test name]
236
+ - **Given**: [Precondition]
237
+ - **When**: [Action]
238
+ - **Then**: [Expected result]
239
+
240
+ ### TC-2: [Test name]
241
+ [Same structure]
242
+
243
+ ## Edge Cases
244
+ - [ ] Test: [Edge case 1]
245
+ - [ ] Test: [Edge case 2]
246
+
247
+ ## Performance Tests
248
+ - [ ] Load test: [Scenario]
249
+ - [ ] Stress test: [Scenario]
250
+
251
+ ## Security Tests
252
+ - [ ] Auth test: [Scenario]
253
+ - [ ] Input validation: [Scenario]
254
+ ```
255
+
256
+ ## 03-logs/implementation-log.md
257
+
258
+ ```markdown
259
+ # Implementation Log
260
+
261
+ Track what changed in code and why.
262
+
263
+ ## YYYY-MM-DD - [Change Title]
264
+ **What**: [Code changes made - files, functions, modules]
265
+ **Why**: [Business/technical reason for change]
266
+ **Impact**: [What changed for users/devs]
267
+ **Ref**: [PR/commit/issue reference]
268
+
269
+ ---
270
+
271
+ ## YYYY-MM-DD - [Change Title]
272
+ [Repeat structure]
273
+ ```
274
+
275
+ ## 03-logs/decisions-log.md
276
+
277
+ ```markdown
278
+ # Decisions Log
279
+
280
+ Track architectural and product decisions.
281
+
282
+ ## YYYY-MM-DD - [Decision Title]
283
+ **Context**: [Why this decision needed]
284
+ **Options Considered**:
285
+ 1. Option A: [Description, pros/cons]
286
+ 2. Option B: [Description, pros/cons]
287
+
288
+ **Decision**: [What we chose]
289
+ **Rationale**: [Why we chose it]
290
+ **Consequences**: [Implications, trade-offs]
291
+ **Ref**: [Discussion link, RFC number]
292
+
293
+ ---
294
+
295
+ ## YYYY-MM-DD - [Decision Title]
296
+ [Repeat structure]
297
+ ```
298
+
299
+ ## 03-logs/bug-log.md
300
+
301
+ ```markdown
302
+ # Bug Log
303
+
304
+ Track bugs, root causes, fixes.
305
+
306
+ ## [BUG-001] - [Bug Title]
307
+ **Reported**: YYYY-MM-DD
308
+ **Severity**: Critical | High | Medium | Low
309
+ **Symptoms**: [What users saw]
310
+ **Root Cause**: [What went wrong technically]
311
+ **Fix**: [How resolved]
312
+ **Prevention**: [How we avoid repeating]
313
+ **Ref**: [Issue/PR reference]
314
+
315
+ ---
316
+
317
+ ## [BUG-002] - [Bug Title]
318
+ [Repeat structure]
319
+ ```
320
+
321
+ ## 03-logs/validation-log.md
322
+
323
+ ```markdown
324
+ # Validation Log
325
+
326
+ Track what happened after shipping.
327
+
328
+ ## YYYY-MM-DD - [Release/Feature Name]
329
+ **Validated**: [What was tested in production]
330
+ **Results**:
331
+ - Metric 1: [Actual vs expected]
332
+ - Metric 2: [Actual vs expected]
333
+
334
+ **Issues Found**: [Problems discovered post-ship]
335
+ **User Feedback**: [What users said]
336
+ **Next Steps**: [Follow-up actions]
337
+
338
+ ---
339
+
340
+ ## YYYY-MM-DD - [Release/Feature Name]
341
+ [Repeat structure]
342
+ ```
343
+
344
+ ## 03-logs/insights.md
345
+
346
+ ```markdown
347
+ # Insights
348
+
349
+ Learnings and future improvements.
350
+
351
+ ## What Worked Well
352
+ - [Success 1: what and why]
353
+ - [Success 2: what and why]
354
+
355
+ ## What Didn't Work
356
+ - [Issue 1: what went wrong, how to improve]
357
+ - [Issue 2: what went wrong, how to improve]
358
+
359
+ ## Process Improvements
360
+ - [ ] [Change we should make to workflow]
361
+ - [ ] [Tool/practice to adopt]
362
+
363
+ ## Technical Debt
364
+ - [ ] [Debt item 1: what, impact, effort to fix]
365
+ - [ ] [Debt item 2: what, impact, effort to fix]
366
+
367
+ ## Future Optimizations
368
+ - [Optimization opportunity 1]
369
+ - [Optimization opportunity 2]
370
+ ```
371
+
372
+ ## 04-process/dev-workflow.md
373
+
374
+ ```markdown
375
+ # Development Workflow
376
+
377
+ ## Daily Dev Loop
378
+
379
+ ### 1. Pick Task
380
+ - Check `02-features/*/dev-tasks.md` or backlog
381
+ - Verify acceptance criteria clear
382
+
383
+ ### 2. Implement
384
+ - Write test first (if TDD)
385
+ - Implement feature
386
+ - Run tests locally
387
+ - Update docs
388
+
389
+ ### 3. Review
390
+ - Self-review checklist:
391
+ - [ ] Tests pass
392
+ - [ ] Docs updated
393
+ - [ ] No console.logs/debugs
394
+ - [ ] Security reviewed
395
+ - Create PR
396
+
397
+ ### 4. Ship
398
+ - Merge after approval
399
+ - Update `03-logs/implementation-log.md`
400
+ - Monitor production
401
+
402
+ ## Branch Strategy
403
+ - `main`: production-ready code
404
+ - `feature/*`: new features
405
+ - `fix/*`: bug fixes
406
+
407
+ ## Working with LLMs
408
+ - Provide context: link to relevant docs
409
+ - Reference acceptance criteria from feature specs
410
+ - Ask to update logs after changes
411
+ - Request test generation
412
+
413
+ ## Code Review Checklist
414
+ - [ ] Matches acceptance criteria
415
+ - [ ] Tests cover edge cases
416
+ - [ ] Docs updated
417
+ - [ ] No security issues
418
+ - [ ] Performance acceptable
419
+ ```
420
+
421
+ ## 04-process/definition-of-done.md
422
+
423
+ ```markdown
424
+ # Definition of Done
425
+
426
+ ## Code Complete
427
+ - [ ] Implements all acceptance criteria
428
+ - [ ] Passes all tests (unit, integration, e2e)
429
+ - [ ] No linter errors
430
+ - [ ] Code reviewed and approved
431
+ - [ ] Security reviewed (if touching auth/data)
432
+
433
+ ## Documentation Complete
434
+ - [ ] Feature spec updated (if behavior changed)
435
+ - [ ] API docs updated (if APIs changed)
436
+ - [ ] README updated (if setup changed)
437
+ - [ ] Logs updated (implementation-log, decisions-log)
438
+
439
+ ## Testing Complete
440
+ - [ ] Unit tests written and passing
441
+ - [ ] Integration tests written and passing
442
+ - [ ] Manual testing completed
443
+ - [ ] Edge cases tested
444
+ - [ ] Performance acceptable
445
+
446
+ ## Release Ready
447
+ - [ ] Deployed to staging
448
+ - [ ] Smoke tests pass
449
+ - [ ] Rollback plan documented
450
+ - [ ] Monitoring in place
451
+ ```
452
+
453
+ ## 04-process/llm-prompts.md
454
+
455
+ ```markdown
456
+ # Canonical LLM Prompts
457
+
458
+ Standard prompts for documentation tasks.
459
+
460
+ ## Create Feature Spec
461
+ \`\`\`
462
+ As backlog-manager, create a feature spec for [feature name] in 02-features/feature-[name]/.
463
+
464
+ Requirements:
465
+ [Paste requirements]
466
+
467
+ Include:
468
+ - User stories with acceptance criteria
469
+ - Edge cases
470
+ - UI/UX considerations
471
+ \`\`\`
472
+
473
+ ## Create Technical Design
474
+ \`\`\`
475
+ As architect, create technical design for [feature name] in 02-features/feature-[name]/.
476
+
477
+ Feature spec: 02-features/feature-[name]/feature-spec.md
478
+
479
+ Include:
480
+ - Architecture approach
481
+ - Components and data models
482
+ - APIs
483
+ - Security and performance considerations
484
+ - Trade-offs
485
+ \`\`\`
486
+
487
+ ## Generate Dev Tasks
488
+ \`\`\`
489
+ As 2-generate-tasks, break down the feature into executable dev tasks.
490
+
491
+ Feature spec: 02-features/feature-[name]/feature-spec.md
492
+ Tech design: 02-features/feature-[name]/tech-design.md
493
+
494
+ Create: 02-features/feature-[name]/dev-tasks.md
495
+ \`\`\`
496
+
497
+ ## Update Implementation Log
498
+ \`\`\`
499
+ Update 03-logs/implementation-log.md with today's changes.
500
+
501
+ Changes made:
502
+ [Describe changes]
503
+
504
+ Why:
505
+ [Reason]
506
+
507
+ Impact:
508
+ [User/developer impact]
509
+ \`\`\`
510
+
511
+ ## Update Decisions Log
512
+ \`\`\`
513
+ Update 03-logs/decisions-log.md with architectural decision.
514
+
515
+ Decision: [What we decided]
516
+ Context: [Why decision needed]
517
+ Options: [Alternatives considered]
518
+ Rationale: [Why we chose this]
519
+ \`\`\`
520
+ ```
521
+
522
+ ## docs/README.md
523
+
524
+ ```markdown
525
+ # Documentation Guide
526
+
527
+ ## Structure
528
+
529
+ Our docs follow a 5-tier hierarchy:
530
+
531
+ - **00-context/**: WHY this exists, WHAT's currently built
532
+ - **01-product/**: WHAT we must build (requirements)
533
+ - **02-features/**: HOW features are designed and built
534
+ - **03-logs/**: MEMORY of changes, decisions, bugs over time
535
+ - **04-process/**: HOW to work (workflows, standards)
536
+
537
+ ## Quick Navigation
538
+
539
+ **Start here**: `00-context/vision.md` - understand product purpose
540
+ **Requirements**: `01-product/prd.md` - single source of truth
541
+ **Feature work**: `02-features/feature-*/` - specs, designs, tasks
542
+ **History**: `03-logs/` - what changed and why
543
+ **Workflows**: `04-process/` - how we work daily
544
+
545
+ ## For Developers
546
+
547
+ 1. **Starting new feature**:
548
+ - Read: `01-product/prd.md` for requirements
549
+ - Check: `02-features/` for existing feature patterns
550
+ - Create: `02-features/feature-<name>/` with 4 files
551
+
552
+ 2. **Daily work**:
553
+ - Follow: `04-process/dev-workflow.md`
554
+ - Check: `04-process/definition-of-done.md` before PR
555
+
556
+ 3. **After changes**:
557
+ - Update: `03-logs/implementation-log.md`
558
+ - Update: `03-logs/decisions-log.md` if architectural
559
+
560
+ ## For LLMs
561
+
562
+ Standard prompts: `04-process/llm-prompts.md`
563
+ Context loading: Start with `00-context/`, then drill into specific features
564
+
565
+ ## Legacy Docs
566
+
567
+ [If existing docs/ subdirs exist, map them here]
568
+ - Old `commands/` → See `02-features/cli/`
569
+ - Old `development/` → See `04-process/dev-workflow.md`
570
+ - Old `guides/` → Distributed across `02-features/`
571
+ - Old `reference/` → See `00-context/` and `01-product/`
572
+ ```