planflow-ai 1.3.5 → 1.4.3

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 (123) hide show
  1. package/.claude/commands/brainstorm.md +6 -14
  2. package/.claude/commands/create-contract.md +6 -38
  3. package/.claude/commands/create-plan.md +18 -38
  4. package/.claude/commands/discovery-plan.md +19 -49
  5. package/.claude/commands/execute-plan.md +116 -77
  6. package/.claude/commands/flow.md +27 -2
  7. package/.claude/commands/heartbeat.md +12 -14
  8. package/.claude/commands/learn.md +20 -80
  9. package/.claude/commands/note.md +6 -23
  10. package/.claude/commands/resume-work.md +261 -0
  11. package/.claude/commands/review-code.md +19 -51
  12. package/.claude/commands/review-pr.md +21 -57
  13. package/.claude/commands/setup.md +8 -56
  14. package/.claude/commands/write-tests.md +7 -41
  15. package/.claude/resources/core/atomic-commits.md +380 -0
  16. package/.claude/resources/core/autopilot-mode.md +3 -2
  17. package/.claude/resources/core/compaction-guide.md +15 -1
  18. package/.claude/resources/core/heartbeat.md +129 -1
  19. package/.claude/resources/core/per-task-verification.md +362 -0
  20. package/.claude/resources/core/phase-isolation.md +237 -4
  21. package/.claude/resources/core/session-scratchpad.md +1 -0
  22. package/.claude/resources/core/shared-context.md +110 -0
  23. package/.claude/resources/core/wave-execution.md +407 -0
  24. package/.claude/resources/patterns/plans-patterns.md +56 -0
  25. package/.claude/resources/patterns/plans-templates.md +152 -0
  26. package/.claude/resources/skills/create-plan-skill.md +71 -5
  27. package/.claude/resources/skills/execute-plan-skill.md +420 -14
  28. package/.claude/resources/skills/resume-work-skill.md +159 -0
  29. package/README.md +154 -96
  30. package/dist/cli/commands/brain.d.ts +20 -0
  31. package/dist/cli/commands/brain.d.ts.map +1 -0
  32. package/dist/cli/commands/brain.js +127 -0
  33. package/dist/cli/commands/brain.js.map +1 -0
  34. package/dist/cli/commands/init.d.ts.map +1 -1
  35. package/dist/cli/commands/init.js +10 -1
  36. package/dist/cli/commands/init.js.map +1 -1
  37. package/dist/cli/commands/state-query.d.ts +13 -0
  38. package/dist/cli/commands/state-query.d.ts.map +1 -0
  39. package/dist/cli/commands/state-query.js +32 -0
  40. package/dist/cli/commands/state-query.js.map +1 -0
  41. package/dist/cli/commands/state.d.ts +12 -0
  42. package/dist/cli/commands/state.d.ts.map +1 -0
  43. package/dist/cli/commands/state.js +47 -0
  44. package/dist/cli/commands/state.js.map +1 -0
  45. package/dist/cli/daemon/desktop-notifier.d.ts +16 -0
  46. package/dist/cli/daemon/desktop-notifier.d.ts.map +1 -0
  47. package/dist/cli/daemon/desktop-notifier.js +53 -0
  48. package/dist/cli/daemon/desktop-notifier.js.map +1 -0
  49. package/dist/cli/daemon/event-writer.d.ts +22 -0
  50. package/dist/cli/daemon/event-writer.d.ts.map +1 -0
  51. package/dist/cli/daemon/event-writer.js +76 -0
  52. package/dist/cli/daemon/event-writer.js.map +1 -0
  53. package/dist/cli/daemon/heartbeat-daemon.js +81 -1
  54. package/dist/cli/daemon/heartbeat-daemon.js.map +1 -1
  55. package/dist/cli/daemon/log-writer.d.ts +17 -0
  56. package/dist/cli/daemon/log-writer.d.ts.map +1 -0
  57. package/dist/cli/daemon/log-writer.js +62 -0
  58. package/dist/cli/daemon/log-writer.js.map +1 -0
  59. package/dist/cli/daemon/notification-router.d.ts +17 -0
  60. package/dist/cli/daemon/notification-router.d.ts.map +1 -0
  61. package/dist/cli/daemon/notification-router.js +35 -0
  62. package/dist/cli/daemon/notification-router.js.map +1 -0
  63. package/dist/cli/daemon/prompt-manager.d.ts +27 -0
  64. package/dist/cli/daemon/prompt-manager.d.ts.map +1 -0
  65. package/dist/cli/daemon/prompt-manager.js +107 -0
  66. package/dist/cli/daemon/prompt-manager.js.map +1 -0
  67. package/dist/cli/daemon/shared-context.d.ts +38 -0
  68. package/dist/cli/daemon/shared-context.d.ts.map +1 -0
  69. package/dist/cli/daemon/shared-context.js +129 -0
  70. package/dist/cli/daemon/shared-context.js.map +1 -0
  71. package/dist/cli/handlers/claude.d.ts.map +1 -1
  72. package/dist/cli/handlers/claude.js +18 -0
  73. package/dist/cli/handlers/claude.js.map +1 -1
  74. package/dist/cli/handlers/shared.js +1 -1
  75. package/dist/cli/handlers/shared.js.map +1 -1
  76. package/dist/cli/index.js +30 -0
  77. package/dist/cli/index.js.map +1 -1
  78. package/dist/cli/state/brain-query.d.ts +48 -0
  79. package/dist/cli/state/brain-query.d.ts.map +1 -0
  80. package/dist/cli/state/brain-query.js +113 -0
  81. package/dist/cli/state/brain-query.js.map +1 -0
  82. package/dist/cli/state/flowconfig-parser.d.ts +16 -0
  83. package/dist/cli/state/flowconfig-parser.d.ts.map +1 -0
  84. package/dist/cli/state/flowconfig-parser.js +166 -0
  85. package/dist/cli/state/flowconfig-parser.js.map +1 -0
  86. package/dist/cli/state/heartbeat-state.d.ts +16 -0
  87. package/dist/cli/state/heartbeat-state.d.ts.map +1 -0
  88. package/dist/cli/state/heartbeat-state.js +97 -0
  89. package/dist/cli/state/heartbeat-state.js.map +1 -0
  90. package/dist/cli/state/model-router.d.ts +8 -0
  91. package/dist/cli/state/model-router.d.ts.map +1 -0
  92. package/dist/cli/state/model-router.js +36 -0
  93. package/dist/cli/state/model-router.js.map +1 -0
  94. package/dist/cli/state/plan-parser.d.ts +16 -0
  95. package/dist/cli/state/plan-parser.d.ts.map +1 -0
  96. package/dist/cli/state/plan-parser.js +124 -0
  97. package/dist/cli/state/plan-parser.js.map +1 -0
  98. package/dist/cli/state/session-state.d.ts +21 -0
  99. package/dist/cli/state/session-state.d.ts.map +1 -0
  100. package/dist/cli/state/session-state.js +36 -0
  101. package/dist/cli/state/session-state.js.map +1 -0
  102. package/dist/cli/state/state-md-parser.d.ts +18 -0
  103. package/dist/cli/state/state-md-parser.d.ts.map +1 -0
  104. package/dist/cli/state/state-md-parser.js +222 -0
  105. package/dist/cli/state/state-md-parser.js.map +1 -0
  106. package/dist/cli/state/types.d.ts +137 -0
  107. package/dist/cli/state/types.d.ts.map +1 -0
  108. package/dist/cli/state/types.js +8 -0
  109. package/dist/cli/state/types.js.map +1 -0
  110. package/dist/cli/state/wave-calculator.d.ts +18 -0
  111. package/dist/cli/state/wave-calculator.d.ts.map +1 -0
  112. package/dist/cli/state/wave-calculator.js +134 -0
  113. package/dist/cli/state/wave-calculator.js.map +1 -0
  114. package/dist/cli/types.d.ts +15 -0
  115. package/dist/cli/types.d.ts.map +1 -1
  116. package/package.json +7 -2
  117. package/templates/shared/CLAUDE.md.template +4 -0
  118. package/.claude/resources/core/_index.md +0 -304
  119. package/.claude/resources/languages/_index.md +0 -76
  120. package/.claude/resources/patterns/_index.md +0 -200
  121. package/.claude/resources/skills/_index.md +0 -285
  122. package/.claude/resources/tools/_index.md +0 -110
  123. package/.claude/resources/tools/reference-expansion-tool.md +0 -326
@@ -1,304 +0,0 @@
1
-
2
- # Core Rules Index
3
-
4
- ## Overview
5
-
6
- Core rules define the foundational coding standards that apply across the entire project. These include best practices to follow (allowed patterns), anti-patterns to avoid (forbidden patterns), and complexity scoring for implementation planning.
7
-
8
- **Total Files**: 22 files, ~3580 lines
9
- **Reference Codes**: COR-AP-1 through COR-DSA-3
10
-
11
- ---
12
-
13
- ## Reference Codes
14
-
15
- ### Allowed Patterns (`allowed-patterns.md`)
16
-
17
- | Code | Description | Source | Lines |
18
- |------|-------------|--------|-------|
19
- | COR-AP-1 | Example patterns (Naming, SRP, Errors, Types, Organization) | allowed-patterns.md | 45-152 |
20
- | COR-AP-2 | Template for adding new patterns | allowed-patterns.md | 167-186 |
21
-
22
- ### Forbidden Patterns (`forbidden-patterns.md`)
23
-
24
- | Code | Description | Source | Lines |
25
- |------|-------------|--------|-------|
26
- | COR-FP-1 | Example anti-patterns (Magic Numbers, Silent Errors, Ternaries, Mutation, Async) | forbidden-patterns.md | 41-230 |
27
- | COR-FP-2 | Template for adding new anti-patterns | forbidden-patterns.md | 245-264 |
28
-
29
- ### Complexity Scoring (`complexity-scoring.md`)
30
-
31
- | Code | Description | Source | Lines |
32
- |------|-------------|--------|-------|
33
- | COR-CS-1 | Complexity scale table (0-10 levels) | complexity-scoring.md | 12-21 |
34
- | COR-CS-2 | Scoring criteria modifiers (+/- points) | complexity-scoring.md | 23-51 |
35
- | COR-CS-3 | Execution strategy and aggregation rules | complexity-scoring.md | 53-70 |
36
- | COR-CS-4 | Common complexity patterns table | complexity-scoring.md | 168-185 |
37
- | COR-CS-5 | Real-world scoring examples | complexity-scoring.md | 187-236 |
38
-
39
- ### Autopilot Mode (`autopilot-mode.md`)
40
-
41
- | Code | Description | Source | Lines |
42
- |------|-------------|--------|-------|
43
- | COR-AM-1 | Input classification (slash commands, questions, trivial, feature requests) | autopilot-mode.md | 18-50 |
44
- | COR-AM-2 | Flow execution steps (contracts, discovery, plan, execute, review, archive) | autopilot-mode.md | 52-110 |
45
- | COR-AM-3 | Mandatory checkpoints and overriding rules | autopilot-mode.md | 140-178 |
46
-
47
- ### Project Ledger (`project-ledger.md`)
48
-
49
- | Code | Description | Source | Lines |
50
- |------|-------------|--------|-------|
51
- | COR-LDG-1 | Ledger behavior, entry format, and sections | project-ledger.md | 10-110 |
52
- | COR-LDG-2 | Maintenance rules and plan-flow integration | project-ledger.md | 112-155 |
53
-
54
- ### Brain Capture (`brain-capture.md`)
55
-
56
- | Code | Description | Source | Lines |
57
- |------|-------------|--------|-------|
58
- | COR-BR-1 | Session start behavior and brain-capture processing rules | brain-capture.md | 10-50 |
59
- | COR-BR-2 | File templates (feature, error, decision, session) and naming conventions | brain-capture.md | 52-170 |
60
- | COR-BR-3 | Index management (caps, rotation) and global brain sync | brain-capture.md | 172-240 |
61
-
62
- ### Project Memory (`project-memory.md`)
63
-
64
- | Code | Description | Source | Lines |
65
- |------|-------------|--------|-------|
66
- | COR-MEM-1 | Memory session start behavior and entry format | project-memory.md | 10-50 |
67
- | COR-MEM-2 | Field descriptions and maintenance rules | project-memory.md | 52-75 |
68
-
69
- ### Project Tasklist (`project-tasklist.md`)
70
-
71
- | Code | Description | Source | Lines |
72
- |------|-------------|--------|-------|
73
- | COR-TL-1 | Tasklist session start behavior and task format | project-tasklist.md | 10-45 |
74
- | COR-TL-2 | Brain integration and maintenance rules | project-tasklist.md | 47-65 |
75
-
76
- ### Heartbeat (`heartbeat.md`)
77
-
78
- | Code | Description | Source | Lines |
79
- |------|-------------|--------|-------|
80
- | COR-HB-1 | Heartbeat file format and schedule syntax | heartbeat.md | 10-55 |
81
- | COR-HB-2 | Daemon architecture, CLI commands, and rules | heartbeat.md | 57-110 |
82
-
83
- ### Resource Capture (`resource-capture.md`)
84
-
85
- | Code | Description | Source | Lines |
86
- |------|-------------|--------|-------|
87
- | COR-RC-1 | Capture behavior, criteria, and what NOT to capture | resource-capture.md | 10-60 |
88
- | COR-RC-2 | File format, naming conventions, and rules | resource-capture.md | 62-110 |
89
-
90
- ### Learn Recommendations (`learn-recommendations.md`)
91
-
92
- | Code | Description | Source | Lines |
93
- |------|-------------|--------|-------|
94
- | COR-LR-1 | Trigger conditions and detection logic | learn-recommendations.md | 10-62 |
95
- | COR-LR-2 | Recommendation format, rules, and integration points | learn-recommendations.md | 64-170 |
96
-
97
- ### Pattern Capture (`pattern-capture.md`)
98
-
99
- | Code | Description | Source | Lines |
100
- |------|-------------|--------|-------|
101
- | COR-PC-1 | Capture behavior, triggers, and buffer format | pattern-capture.md | 10-80 |
102
- | COR-PC-2 | End-of-skill review protocol and user approval flow | pattern-capture.md | 82-140 |
103
- | COR-PC-3 | Auto-captured entry format and conflict detection | pattern-capture.md | 142-210 |
104
-
105
- ### Model Routing (`model-routing.md`)
106
-
107
- | Code | Description | Source | Lines |
108
- |------|-------------|--------|-------|
109
- | COR-MR-1 | Model tiers, platform mappings, and routing rules | model-routing.md | 10-60 |
110
- | COR-MR-2 | Aggregation behavior and plan mode exception | model-routing.md | 62-85 |
111
- | COR-MR-3 | Cost impact estimates and execution summary format | model-routing.md | 87-115 |
112
-
113
- ### Design Awareness (`design-awareness.md`)
114
-
115
- | Code | Description | Source | Lines |
116
- |------|-------------|--------|-------|
117
- | COR-DA-1 | Design Context template and personalities | design-awareness.md | 14-180 |
118
- | COR-DA-2 | Token extraction and UI detection rules | design-awareness.md | 182-260 |
119
- | COR-DA-3 | Discovery question flow and execution injection | design-awareness.md | 262-350 |
120
-
121
- ### Review Verification (`review-verification.md`)
122
-
123
- | Code | Description | Source | Lines |
124
- |------|-------------|--------|-------|
125
- | COR-RV-1 | Verification logic, questions, and classification criteria | review-verification.md | 1-120 |
126
- | COR-RV-2 | Output format and insertion points | review-verification.md | 122-200 |
127
-
128
- ### Review Multi-Agent (`review-multi-agent.md`)
129
-
130
- | Code | Description | Source | Lines |
131
- |------|-------------|--------|-------|
132
- | COR-MA-1 | Subagent definitions (security, logic, performance, patterns) with prompts and models | review-multi-agent.md | 30-130 |
133
- | COR-MA-2 | Coordinator behavior (spawn, collect, deduplicate, verify, rank, output) | review-multi-agent.md | 132-195 |
134
- | COR-MA-3 | Subagent input rules and diff splitting for very large changesets | review-multi-agent.md | 100-130 |
135
- | COR-MA-4 | Insertion points for review-code and review-pr skills | review-multi-agent.md | 197-220 |
136
-
137
- ### Review Severity Re-Ranking (`review-severity-ranking.md`)
138
-
139
- | Code | Description | Source | Lines |
140
- |------|-------------|--------|-------|
141
- | COR-SR-1 | Ranking algorithm (severity → confidence → complexity) | review-severity-ranking.md | 14-26 |
142
- | COR-SR-2 | Grouping related findings (patterns, rules, format) | review-severity-ranking.md | 28-88 |
143
- | COR-SR-3 | Executive summary trigger and risk level derivation | review-severity-ranking.md | 90-120 |
144
- | COR-SR-4 | Output structure and insertion points | review-severity-ranking.md | 122-150 |
145
-
146
- ### Compaction Guide (`compaction-guide.md`)
147
-
148
- | Code | Description | Source | Lines |
149
- |------|-------------|--------|-------|
150
- | COR-CG-1 | Purpose, core principle, and when to compact | compaction-guide.md | 3-20 |
151
- | COR-CG-2 | Preserve rules — what to keep during compaction | compaction-guide.md | 22-38 |
152
- | COR-CG-3 | Discard rules — what to drop during compaction | compaction-guide.md | 40-55 |
153
- | COR-CG-4 | Compact summary template and skill-specific examples | compaction-guide.md | 57-110 |
154
-
155
- ### Session Scratchpad (`session-scratchpad.md`)
156
-
157
- | Code | Description | Source | Lines |
158
- |------|-------------|--------|-------|
159
- | COR-SS-1 | Purpose, session start behavior, and write triggers | session-scratchpad.md | 3-45 |
160
- | COR-SS-2 | File format and 50-line limit | session-scratchpad.md | 47-68 |
161
- | COR-SS-3 | Promotion rules, targets, and compaction integration | session-scratchpad.md | 70-95 |
162
-
163
- ### Phase Isolation (`phase-isolation.md`)
164
-
165
- | Code | Description | Source | Lines |
166
- |------|-------------|--------|-------|
167
- | COR-PI-1 | Purpose, architecture overview, and coordinator flow | phase-isolation.md | 3-40 |
168
- | COR-PI-2 | Context template — what to include in sub-agent prompt | phase-isolation.md | 42-85 |
169
- | COR-PI-3 | Return format schema (JSON), field descriptions, failure example | phase-isolation.md | 87-140 |
170
- | COR-PI-4 | Coordinator processing (success/failure/partial), config, and rules | phase-isolation.md | 142-180 |
171
-
172
- ### Discovery Sub-Agents (`discovery-sub-agents.md`)
173
-
174
- | Code | Description | Source | Lines |
175
- |------|-------------|--------|-------|
176
- | COR-DSA-1 | Agent definitions with prompt templates (Similar Features, API/Data, Schema/Types) | discovery-sub-agents.md | 30-130 |
177
- | COR-DSA-2 | Return format schema and Codebase Analysis section template | discovery-sub-agents.md | 132-190 |
178
- | COR-DSA-3 | Coordinator behavior (spawn, collect, merge, error handling) | discovery-sub-agents.md | 192-240 |
179
-
180
- ### Review Adaptive Depth (`review-adaptive-depth.md`)
181
-
182
- | Code | Description | Source | Lines |
183
- |------|-------------|--------|-------|
184
- | COR-AD-1 | Size detection, line counting rules, and tier definitions | review-adaptive-depth.md | 14-47 |
185
- | COR-AD-2 | Lightweight review mode (< 50 lines) — checks, skips, output | review-adaptive-depth.md | 51-101 |
186
- | COR-AD-3 | Deep review mode (500+ lines) — categorization, passes, executive summary | review-adaptive-depth.md | 103-187 |
187
- | COR-AD-4 | Insertion points for review-code and review-pr skills | review-adaptive-depth.md | 189-205 |
188
-
189
- ---
190
-
191
- ## When to Expand
192
-
193
- | Code | Expand When |
194
- |------|-------------|
195
- | COR-AP-1 | Need to see example good patterns for code generation |
196
- | COR-AP-2 | Adding a new allowed pattern to the project |
197
- | COR-FP-1 | Need to see anti-patterns to avoid |
198
- | COR-FP-2 | Adding a new forbidden pattern to the project |
199
- | COR-CS-1 | Need complexity level definitions |
200
- | COR-CS-2 | Calculating complexity score for a phase |
201
- | COR-CS-3 | Determining execution strategy for plan phases |
202
- | COR-CS-4 | Quick lookup of typical complexity scores |
203
- | COR-CS-5 | Need detailed scoring examples |
204
- | COR-LDG-1 | Need ledger behavior and entry guidelines |
205
- | COR-LDG-2 | Need ledger maintenance and integration rules |
206
- | COR-AM-1 | Need to understand input classification for autopilot |
207
- | COR-AM-2 | Need autopilot flow execution steps |
208
- | COR-AM-3 | Need mandatory checkpoint and override rules |
209
- | COR-BR-1 | Need brain session start behavior and processing rules |
210
- | COR-BR-2 | Need brain file templates and naming conventions |
211
- | COR-BR-3 | Need index management caps and global sync rules |
212
- | COR-MEM-1 | Need memory session start behavior and entry format |
213
- | COR-MEM-2 | Need memory field descriptions and maintenance rules |
214
- | COR-TL-1 | Need tasklist session start behavior and task format |
215
- | COR-TL-2 | Need tasklist brain integration and maintenance rules |
216
- | COR-HB-1 | Need heartbeat file format and schedule syntax |
217
- | COR-HB-2 | Need daemon architecture and CLI commands |
218
- | COR-RC-1 | Need resource capture behavior and criteria |
219
- | COR-RC-2 | Need resource file format and naming conventions |
220
- | COR-LR-1 | Need learn recommendation trigger conditions |
221
- | COR-LR-2 | Need learn recommendation format and integration rules |
222
- | COR-PC-1 | Need pattern capture behavior and buffer format |
223
- | COR-PC-2 | Need end-of-skill review protocol |
224
- | COR-PC-3 | Need auto-captured entry format and conflict detection |
225
- | COR-MR-1 | Need model tier definitions and platform mappings |
226
- | COR-MR-2 | Need aggregation behavior for model routing |
227
- | COR-MR-3 | Need cost impact estimates or execution summary format |
228
- | COR-DA-1 | Need design context template or personality options |
229
- | COR-DA-2 | Need token extraction or UI detection heuristics |
230
- | COR-DA-3 | Need design question flow or execution injection rules |
231
- | COR-RV-1 | Need verification questions or classification criteria |
232
- | COR-RV-2 | Need verification output format or skill insertion points |
233
- | COR-MA-1 | Need subagent definitions or prompt templates for deep review |
234
- | COR-MA-2 | Need coordinator dedup/merge behavior |
235
- | COR-MA-3 | Need subagent input rules or diff splitting strategy |
236
- | COR-MA-4 | Need multi-agent insertion points for review skills |
237
- | COR-SR-1 | Need ranking algorithm for review findings |
238
- | COR-SR-2 | Need grouping rules for related findings |
239
- | COR-SR-3 | Need executive summary trigger conditions |
240
- | COR-SR-4 | Need severity re-ranking output structure or insertion points |
241
- | COR-CG-1 | Need to understand when and why to compact |
242
- | COR-CG-2 | Need preserve rules for crafting compact summaries |
243
- | COR-CG-3 | Need discard rules for dropping low-signal tokens |
244
- | COR-CG-4 | Need compact summary template or skill-specific examples |
245
- | COR-AD-1 | Need size detection thresholds or line counting rules |
246
- | COR-AD-2 | Need lightweight review mode behavior |
247
- | COR-AD-3 | Need deep review mode behavior (categorization, passes, executive summary) |
248
- | COR-AD-4 | Need insertion points for adaptive depth in review skills |
249
- | COR-SS-1 | Need scratchpad purpose, session start behavior, or write triggers |
250
- | COR-SS-2 | Need scratchpad file format or size limit |
251
- | COR-SS-3 | Need scratchpad promotion rules or compaction integration |
252
- | COR-PI-1 | Need phase isolation architecture or coordinator flow |
253
- | COR-PI-2 | Need sub-agent context template (what to include in prompt) |
254
- | COR-PI-3 | Need return format schema or field descriptions |
255
- | COR-PI-4 | Need coordinator processing rules or config settings |
256
- | COR-DSA-1 | Need discovery sub-agent definitions or prompt templates |
257
- | COR-DSA-2 | Need return format schema or Codebase Analysis section template |
258
- | COR-DSA-3 | Need coordinator spawn/collect/merge behavior or error handling |
259
-
260
- ---
261
-
262
- ## Quick Reference
263
-
264
- ### Allowed Patterns Summary
265
- - **Descriptive Naming**: Clear, self-documenting names
266
- - **Single Responsibility**: One function = one purpose
267
- - **Error Handling**: Explicit errors with logging
268
- - **Type Safety**: Leverage TypeScript types
269
- - **Code Organization**: Consistent folder structure
270
-
271
- ### Forbidden Patterns Summary
272
- - **No Magic Numbers**: Use named constants
273
- - **No Silent Errors**: Always log and handle
274
- - **No Nested Ternaries**: Use if/else or switch
275
- - **No Parameter Mutation**: Return new objects/arrays
276
- - **No Mixed Async**: Use async/await consistently
277
-
278
- ### Complexity Levels
279
- - **0-2 Trivial**: Simple, mechanical changes
280
- - **3-4 Low**: Straightforward implementation
281
- - **5-6 Medium**: Moderate complexity, some decisions
282
- - **7-8 High**: Complex, multiple concerns
283
- - **9-10 Very High**: Requires careful attention
284
-
285
- ---
286
-
287
- ## Notes
288
-
289
- - `allowed-patterns.md` and `forbidden-patterns.md` have `alwaysApply: true` - they are loaded automatically
290
- - `project-ledger.md` has `alwaysApply: true` - maintains persistent project memory
291
- - `complexity-scoring.md` is loaded on-demand when needed for planning
292
- - `autopilot-mode.md` has `alwaysApply: true` - detects and orchestrates autopilot flow mode
293
- - `brain-capture.md` is loaded on-demand - processes brain-capture blocks and manages brain index
294
- - `resource-capture.md` is loaded on-demand - watches for valuable reference materials during skill execution
295
- - `learn-recommendations.md` is loaded on-demand - detects learning opportunities and recommends `/learn`
296
- - `pattern-capture.md` is loaded on-demand - silently captures patterns during skill execution and presents for approval
297
- - `model-routing.md` is loaded on-demand - automatic model selection per phase based on complexity scores during `/execute-plan`
298
- - `project-tasklist.md` is loaded on-demand - session start tasklist behavior
299
- - `compaction-guide.md` is loaded on-demand - preserve/discard rules and summary template for `/compact`
300
- - `session-scratchpad.md` is loaded on-demand - ephemeral per-session notes with promotion to permanent storage
301
- - `phase-isolation.md` is loaded on-demand - isolated sub-agent execution per phase during `/execute-plan`
302
- - `project-memory.md` is loaded on-demand - artifact tracking and 7-day session loading
303
- - `heartbeat.md` is loaded on-demand - scheduled task daemon configuration
304
- - `discovery-sub-agents.md` is loaded on-demand - parallel codebase exploration sub-agents during `/discovery-plan`
@@ -1,76 +0,0 @@
1
-
2
- # Languages Index
3
-
4
- ## Overview
5
-
6
- Language-specific patterns and best practices. These rules apply when working with TypeScript/JavaScript or Python files respectively.
7
-
8
- **Total Files**: 2 files, ~316 lines
9
- **Reference Codes**: LNG-TS-1 through LNG-PY-5
10
-
11
- ---
12
-
13
- ## Reference Codes
14
-
15
- ### TypeScript Patterns (`typescript-patterns.md`)
16
-
17
- | Code | Description | Source | Lines |
18
- |------|-------------|--------|-------|
19
- | LNG-TS-1 | Type definitions (interfaces, unions, generics) | typescript-patterns.md | 9-50 |
20
- | LNG-TS-2 | Error handling and custom error types | typescript-patterns.md | 51-65 |
21
- | LNG-TS-3 | Type safety (utility types, avoid any, null safety) | typescript-patterns.md | 66-86 |
22
- | LNG-TS-4 | Advanced patterns (const assertions, type guards, immutability, satisfies) | typescript-patterns.md | 87-129 |
23
-
24
- ### Python Patterns (`python-patterns.md`)
25
-
26
- | Code | Description | Source | Lines |
27
- |------|-------------|--------|-------|
28
- | LNG-PY-1 | Style and typing (PEP 8, type hints, dataclasses) | python-patterns.md | 9-52 |
29
- | LNG-PY-2 | Code organization (modular functions, enums, context managers) | python-patterns.md | 53-97 |
30
- | LNG-PY-3 | Error handling and custom exceptions | python-patterns.md | 98-110 |
31
- | LNG-PY-4 | Async and I/O patterns | python-patterns.md | 111-125 |
32
- | LNG-PY-5 | Best practices (DI, logging, Pydantic, Pathlib) | python-patterns.md | 126-189 |
33
-
34
- ---
35
-
36
- ## When to Expand
37
-
38
- | Code | Expand When |
39
- |------|-------------|
40
- | LNG-TS-1 | Defining TypeScript interfaces or unions |
41
- | LNG-TS-2 | Implementing custom error classes in TS |
42
- | LNG-TS-3 | Need examples of utility types or null safety |
43
- | LNG-TS-4 | Using advanced TS features like satisfies or type guards |
44
- | LNG-PY-1 | Setting up Python project structure or typing |
45
- | LNG-PY-2 | Organizing Python modules and using enums |
46
- | LNG-PY-3 | Creating custom Python exceptions |
47
- | LNG-PY-4 | Implementing async/await in Python |
48
- | LNG-PY-5 | Using Pydantic, logging, or dependency injection |
49
-
50
- ---
51
-
52
- ## Quick Reference
53
-
54
- ### TypeScript Key Points
55
- - **Strict mode**: Always enable `strict: true`
56
- - **Interfaces**: Prefer for object shapes
57
- - **Discriminated unions**: Model exclusive states
58
- - **Generics**: Reusable, type-safe components
59
- - **Avoid any**: Use `unknown` with type guards
60
- - **Immutability**: Use `readonly` and `ReadonlyArray`
61
-
62
- ### Python Key Points
63
- - **PEP 8**: Follow naming conventions
64
- - **Type hints**: Add annotations for clarity
65
- - **Dataclasses**: Use for structured data
66
- - **Enums**: Replace magic strings/numbers
67
- - **Context managers**: Resource management
68
- - **Logging**: Use logger, not print
69
-
70
- ---
71
-
72
- ## Notes
73
-
74
- - Both files have `alwaysApply: false` - loaded based on file glob patterns
75
- - TypeScript patterns apply to `**/*.ts` and `**/*.tsx` files
76
- - Python patterns apply to `**/*.py` files
@@ -1,200 +0,0 @@
1
-
2
- # Patterns Index
3
-
4
- ## Overview
5
-
6
- Pattern files provide templates, examples, and guidelines for specific workflows. This is the largest category covering discovery, planning, testing, code review, and contracts.
7
-
8
- **Total Files**: 11 files, ~3,420 lines
9
- **Reference Codes**: PTN-BR-1 through PTN-PR-6
10
-
11
- ---
12
-
13
- ## Reference Codes
14
-
15
- ### Brain Patterns (`brain-patterns.md`)
16
-
17
- | Code | Description | Source | Lines |
18
- |------|-------------|--------|-------|
19
- | PTN-BR-1 | Brain directory structure and file naming conventions | brain-patterns.md | 5-45 |
20
- | PTN-BR-2 | Wiki-link patterns and brain-capture block per skill | brain-patterns.md | 47-160 |
21
- | PTN-BR-3 | Feature status lifecycle and index update rules | brain-patterns.md | 162-210 |
22
- | PTN-BR-4 | Learning subdirectory for teaching curricula | brain-patterns.md | 12-14 |
23
-
24
- ### Brainstorm Templates (`brainstorm-templates.md`)
25
-
26
- | Code | Description | Source | Lines |
27
- |------|-------------|--------|-------|
28
- | PTN-BST-1 | Brainstorm document template with "For Discovery" bridge | brainstorm-templates.md | 5-75 |
29
- | PTN-BST-2 | Status definitions and file naming conventions | brainstorm-templates.md | 77-105 |
30
-
31
- ### Contract Patterns (`contract-patterns.md`)
32
-
33
- | Code | Description | Source | Lines |
34
- |------|-------------|--------|-------|
35
- | PTN-CON-1 | Contract document structure and required sections | contract-patterns.md | 24-44 |
36
- | PTN-CON-2 | Allowed patterns (TypeScript interfaces, status codes, auth examples) | contract-patterns.md | 47-171 |
37
- | PTN-CON-3 | Forbidden patterns (no hardcoded secrets, generic types) | contract-patterns.md | 173-250 |
38
- | PTN-CON-4 | FE integration guidelines (state management, caching) | contract-patterns.md | 252-283 |
39
-
40
- ### Discovery Patterns (`discovery-patterns.md`)
41
-
42
- | Code | Description | Source | Lines |
43
- |------|-------------|--------|-------|
44
- | PTN-DIS-1 | What is discovery + folder structure | discovery-patterns.md | 14-47 |
45
- | PTN-DIS-2 | Naming conventions + question status tracking | discovery-patterns.md | 49-88 |
46
- | PTN-DIS-3 | Requirements categories (FR, NFR, Constraints) | discovery-patterns.md | 90-109 |
47
- | PTN-DIS-4 | Allowed discovery patterns | discovery-patterns.md | 112-213 |
48
- | PTN-DIS-5 | Forbidden discovery patterns | discovery-patterns.md | 215-298 |
49
-
50
- ### Discovery Templates (`discovery-templates.md`)
51
-
52
- | Code | Description | Source | Lines |
53
- |------|-------------|--------|-------|
54
- | PTN-DIST-1 | Discovery document template | discovery-templates.md | 12-94 |
55
- | PTN-DIST-2 | Spike template | discovery-templates.md | 96-162 |
56
- | PTN-DIST-3 | Question format examples (functional, technical, UI/UX) | discovery-templates.md | 164-215 |
57
- | PTN-DIST-4 | Referenced documents analysis example | discovery-templates.md | 217-242 |
58
- | PTN-DIST-5 | Requirements gathering example | discovery-templates.md | 244-279 |
59
- | PTN-DIST-6 | Risks and proposed approach examples | discovery-templates.md | 281-330 |
60
-
61
- ### Jest Patterns (`jest-patterns.md`)
62
-
63
- | Code | Description | Source | Lines |
64
- |------|-------------|--------|-------|
65
- | PTN-JEST-1 | File naming conventions and test location | jest-patterns.md | 12-56 |
66
- | PTN-JEST-2 | Test structure (AAA pattern, describe/it blocks) | jest-patterns.md | 58-91 |
67
- | PTN-JEST-3 | Server and client test setup | jest-patterns.md | 93-160 |
68
- | PTN-JEST-4 | Mock factories and mocking dependencies | jest-patterns.md | 162-301 |
69
- | PTN-JEST-5 | Testing async code, errors, hooks, browser APIs | jest-patterns.md | 303-412 |
70
- | PTN-JEST-6 | Forbidden testing patterns | jest-patterns.md | 414-481 |
71
-
72
- ### Plans Patterns (`plans-patterns.md`)
73
-
74
- | Code | Description | Source | Lines |
75
- |------|-------------|--------|-------|
76
- | PTN-PLN-1 | Workflow folder structure | plans-patterns.md | 14-31 |
77
- | PTN-PLN-2 | Allowed planning patterns (12 patterns) | plans-patterns.md | 39-142 |
78
- | PTN-PLN-3 | Forbidden planning patterns (13 patterns) | plans-patterns.md | 144-223 |
79
-
80
- ### Plans Templates (`plans-templates.md`)
81
-
82
- | Code | Description | Source | Lines |
83
- |------|-------------|--------|-------|
84
- | PTN-PLNT-1 | Plan document template | plans-templates.md | 12-95 |
85
- | PTN-PLNT-2 | Phase templates (types, backend, store, UI, integration, tests) | plans-templates.md | 98-188 |
86
- | PTN-PLNT-3 | Key changes and complexity summary examples | plans-templates.md | 190-238 |
87
-
88
- ### Pytest Patterns (`pytest-patterns.md`)
89
-
90
- | Code | Description | Source | Lines |
91
- |------|-------------|--------|-------|
92
- | PTN-PYTEST-1 | File naming and test structure | pytest-patterns.md | 12-77 |
93
- | PTN-PYTEST-2 | Fixtures and factory fixtures | pytest-patterns.md | 79-173 |
94
- | PTN-PYTEST-3 | Mocking (basic, class instances, async) | pytest-patterns.md | 175-241 |
95
- | PTN-PYTEST-4 | Parametrized tests | pytest-patterns.md | 243-276 |
96
- | PTN-PYTEST-5 | Testing exceptions and context managers | pytest-patterns.md | 278-347 |
97
- | PTN-PYTEST-6 | Async testing and forbidden patterns | pytest-patterns.md | 349-457 |
98
-
99
- ### Review Code Templates (`review-code-templates.md`)
100
-
101
- | Code | Description | Source | Lines |
102
- |------|-------------|--------|-------|
103
- | PTN-REV-1 | Code review output format template | review-code-templates.md | 12-192 |
104
- | PTN-REV-2 | Pattern conflict example | review-code-templates.md | 196-232 |
105
- | PTN-REV-3 | Rule update recommendation example | review-code-templates.md | 234-284 |
106
- | PTN-REV-4 | Finding example | review-code-templates.md | 286-316 |
107
-
108
- ### PR Review Patterns (`review-pr-patterns.md`)
109
-
110
- | Code | Description | Source | Lines |
111
- |------|-------------|--------|-------|
112
- | PTN-PR-1 | General PR review checklist | review-pr-patterns.md | 32-74 |
113
- | PTN-PR-2 | TypeScript PR review patterns | review-pr-patterns.md | 76-116 |
114
- | PTN-PR-3 | Python PR review patterns | review-pr-patterns.md | 118-163 |
115
- | PTN-PR-4 | Forbidden patterns to catch in reviews | review-pr-patterns.md | 165-253 |
116
- | PTN-PR-5 | Allowed patterns to encourage | review-pr-patterns.md | 255-310 |
117
- | PTN-PR-6 | Review comment templates and approval criteria | review-pr-patterns.md | 312-371 |
118
-
119
- ---
120
-
121
- ## When to Expand
122
-
123
- ### Discovery Workflow
124
-
125
- | Code | Expand When |
126
- |------|-------------|
127
- | PTN-DIS-1 | Starting discovery, need folder structure |
128
- | PTN-DIS-3 | Categorizing requirements (FR, NFR, C) |
129
- | PTN-DIST-1 | Creating a discovery document |
130
- | PTN-DIST-5 | Need requirements gathering example |
131
-
132
- ### Planning Workflow
133
-
134
- | Code | Expand When |
135
- |------|-------------|
136
- | PTN-PLN-1 | Need folder structure reference |
137
- | PTN-PLN-2 | Need allowed planning patterns |
138
- | PTN-PLNT-1 | Creating a new plan document |
139
- | PTN-PLNT-2 | Need phase templates |
140
-
141
- ### Testing (Jest)
142
-
143
- | Code | Expand When |
144
- |------|-------------|
145
- | PTN-JEST-1 | Setting up test file naming |
146
- | PTN-JEST-2 | Need test structure example |
147
- | PTN-JEST-3 | Setting up server/client tests |
148
- | PTN-JEST-4 | Need mock factory examples |
149
-
150
- ### Testing (Pytest)
151
-
152
- | Code | Expand When |
153
- |------|-------------|
154
- | PTN-PYTEST-1 | Setting up pytest file structure |
155
- | PTN-PYTEST-2 | Need fixture examples |
156
- | PTN-PYTEST-3 | Need mocking examples |
157
- | PTN-PYTEST-4 | Need parametrized test examples |
158
-
159
- ### Code Review
160
-
161
- | Code | Expand When |
162
- |------|-------------|
163
- | PTN-REV-1 | Creating code review output |
164
- | PTN-PR-1 | Need general PR checklist |
165
- | PTN-PR-2 | Reviewing TypeScript code |
166
- | PTN-PR-3 | Reviewing Python code |
167
-
168
- ### Contracts
169
-
170
- | Code | Expand When |
171
- |------|-------------|
172
- | PTN-CON-1 | Creating a new contract document |
173
- | PTN-CON-2 | Need contract pattern examples |
174
- | PTN-CON-4 | Need FE integration guidance |
175
-
176
- ---
177
-
178
- ## Quick Reference by Category
179
-
180
- ### Discovery
181
- - **PTN-DIS-***: Discovery patterns and rules
182
- - **PTN-DIST-***: Discovery templates and examples
183
-
184
- ### Planning
185
- - **PTN-PLN-***: Planning patterns and rules
186
- - **PTN-PLNT-***: Plan templates
187
-
188
- ### Testing
189
- - **PTN-JEST-***: Jest testing patterns (JS/TS)
190
- - **PTN-PYTEST-***: Pytest testing patterns (Python)
191
-
192
- ### Reviews
193
- - **PTN-REV-***: Code review templates
194
- - **PTN-PR-***: PR review patterns
195
-
196
- ### Brainstorm
197
- - **PTN-BST-***: Brainstorm output templates
198
-
199
- ### Contracts
200
- - **PTN-CON-***: Integration contract patterns