openplanr 0.9.0 → 1.0.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 (222) hide show
  1. package/README.md +142 -58
  2. package/dist/agents/index.d.ts +1 -5
  3. package/dist/agents/index.d.ts.map +1 -1
  4. package/dist/agents/index.js +1 -4
  5. package/dist/agents/index.js.map +1 -1
  6. package/dist/agents/task-parser.d.ts +4 -1
  7. package/dist/agents/task-parser.d.ts.map +1 -1
  8. package/dist/agents/task-parser.js +6 -3
  9. package/dist/agents/task-parser.js.map +1 -1
  10. package/dist/agents/utils.d.ts +0 -4
  11. package/dist/agents/utils.d.ts.map +1 -1
  12. package/dist/agents/utils.js +3 -24
  13. package/dist/agents/utils.js.map +1 -1
  14. package/dist/ai/codebase/context-builder.d.ts +22 -3
  15. package/dist/ai/codebase/context-builder.d.ts.map +1 -1
  16. package/dist/ai/codebase/context-builder.js +202 -14
  17. package/dist/ai/codebase/context-builder.js.map +1 -1
  18. package/dist/ai/codebase/file-reader.d.ts.map +1 -1
  19. package/dist/ai/codebase/file-reader.js +7 -3
  20. package/dist/ai/codebase/file-reader.js.map +1 -1
  21. package/dist/ai/codebase/index.d.ts +3 -1
  22. package/dist/ai/codebase/index.d.ts.map +1 -1
  23. package/dist/ai/codebase/index.js +3 -1
  24. package/dist/ai/codebase/index.js.map +1 -1
  25. package/dist/ai/codebase/pattern-rules.d.ts +28 -0
  26. package/dist/ai/codebase/pattern-rules.d.ts.map +1 -0
  27. package/dist/ai/codebase/pattern-rules.js +186 -0
  28. package/dist/ai/codebase/pattern-rules.js.map +1 -0
  29. package/dist/ai/codebase/rules-reader.d.ts +14 -0
  30. package/dist/ai/codebase/rules-reader.d.ts.map +1 -0
  31. package/dist/ai/codebase/rules-reader.js +25 -0
  32. package/dist/ai/codebase/rules-reader.js.map +1 -0
  33. package/dist/ai/codebase/stack-detector.d.ts.map +1 -1
  34. package/dist/ai/codebase/stack-detector.js +4 -1
  35. package/dist/ai/codebase/stack-detector.js.map +1 -1
  36. package/dist/ai/codebase/tree-generator.d.ts.map +1 -1
  37. package/dist/ai/codebase/tree-generator.js +5 -2
  38. package/dist/ai/codebase/tree-generator.js.map +1 -1
  39. package/dist/ai/errors.js +1 -1
  40. package/dist/ai/errors.js.map +1 -1
  41. package/dist/ai/prompts/prompt-builder.d.ts +12 -0
  42. package/dist/ai/prompts/prompt-builder.d.ts.map +1 -1
  43. package/dist/ai/prompts/prompt-builder.js +38 -3
  44. package/dist/ai/prompts/prompt-builder.js.map +1 -1
  45. package/dist/ai/prompts/system-prompts.d.ts +4 -2
  46. package/dist/ai/prompts/system-prompts.d.ts.map +1 -1
  47. package/dist/ai/prompts/system-prompts.js +72 -12
  48. package/dist/ai/prompts/system-prompts.js.map +1 -1
  49. package/dist/ai/schemas/ai-response-schemas.d.ts +48 -2
  50. package/dist/ai/schemas/ai-response-schemas.d.ts.map +1 -1
  51. package/dist/ai/schemas/ai-response-schemas.js +19 -0
  52. package/dist/ai/schemas/ai-response-schemas.js.map +1 -1
  53. package/dist/ai/types.d.ts +3 -1
  54. package/dist/ai/types.d.ts.map +1 -1
  55. package/dist/ai/types.js +2 -0
  56. package/dist/ai/types.js.map +1 -1
  57. package/dist/ai/validation/dependency-chains.d.ts +21 -0
  58. package/dist/ai/validation/dependency-chains.d.ts.map +1 -0
  59. package/dist/ai/validation/dependency-chains.js +114 -0
  60. package/dist/ai/validation/dependency-chains.js.map +1 -0
  61. package/dist/ai/validation/index.d.ts +3 -0
  62. package/dist/ai/validation/index.d.ts.map +1 -0
  63. package/dist/ai/validation/index.js +3 -0
  64. package/dist/ai/validation/index.js.map +1 -0
  65. package/dist/ai/validation/task-validator.d.ts +37 -0
  66. package/dist/ai/validation/task-validator.d.ts.map +1 -0
  67. package/dist/ai/validation/task-validator.js +89 -0
  68. package/dist/ai/validation/task-validator.js.map +1 -0
  69. package/dist/cli/commands/backlog.d.ts +10 -0
  70. package/dist/cli/commands/backlog.d.ts.map +1 -0
  71. package/dist/cli/commands/backlog.js +292 -0
  72. package/dist/cli/commands/backlog.js.map +1 -0
  73. package/dist/cli/commands/checklist.js +4 -4
  74. package/dist/cli/commands/checklist.js.map +1 -1
  75. package/dist/cli/commands/config.js +13 -13
  76. package/dist/cli/commands/config.js.map +1 -1
  77. package/dist/cli/commands/epic.d.ts.map +1 -1
  78. package/dist/cli/commands/epic.js +29 -23
  79. package/dist/cli/commands/epic.js.map +1 -1
  80. package/dist/cli/commands/estimate.d.ts.map +1 -1
  81. package/dist/cli/commands/estimate.js +40 -39
  82. package/dist/cli/commands/estimate.js.map +1 -1
  83. package/dist/cli/commands/export.js +6 -4
  84. package/dist/cli/commands/export.js.map +1 -1
  85. package/dist/cli/commands/feature.js +9 -9
  86. package/dist/cli/commands/feature.js.map +1 -1
  87. package/dist/cli/commands/github.d.ts.map +1 -1
  88. package/dist/cli/commands/github.js +30 -27
  89. package/dist/cli/commands/github.js.map +1 -1
  90. package/dist/cli/commands/plan.d.ts.map +1 -1
  91. package/dist/cli/commands/plan.js +27 -42
  92. package/dist/cli/commands/plan.js.map +1 -1
  93. package/dist/cli/commands/quick.d.ts.map +1 -1
  94. package/dist/cli/commands/quick.js +37 -107
  95. package/dist/cli/commands/quick.js.map +1 -1
  96. package/dist/cli/commands/refine.js +21 -21
  97. package/dist/cli/commands/refine.js.map +1 -1
  98. package/dist/cli/commands/search.d.ts.map +1 -1
  99. package/dist/cli/commands/search.js +18 -7
  100. package/dist/cli/commands/search.js.map +1 -1
  101. package/dist/cli/commands/sprint.d.ts +9 -0
  102. package/dist/cli/commands/sprint.d.ts.map +1 -0
  103. package/dist/cli/commands/sprint.js +519 -0
  104. package/dist/cli/commands/sprint.js.map +1 -0
  105. package/dist/cli/commands/status.d.ts.map +1 -1
  106. package/dist/cli/commands/status.js +77 -32
  107. package/dist/cli/commands/status.js.map +1 -1
  108. package/dist/cli/commands/story.js +15 -15
  109. package/dist/cli/commands/story.js.map +1 -1
  110. package/dist/cli/commands/sync.js +11 -7
  111. package/dist/cli/commands/sync.js.map +1 -1
  112. package/dist/cli/commands/task.d.ts +0 -2
  113. package/dist/cli/commands/task.d.ts.map +1 -1
  114. package/dist/cli/commands/task.js +14 -169
  115. package/dist/cli/commands/task.js.map +1 -1
  116. package/dist/cli/commands/template.d.ts +10 -0
  117. package/dist/cli/commands/template.d.ts.map +1 -0
  118. package/dist/cli/commands/template.js +269 -0
  119. package/dist/cli/commands/template.js.map +1 -0
  120. package/dist/cli/helpers/task-creation.d.ts +89 -0
  121. package/dist/cli/helpers/task-creation.d.ts.map +1 -0
  122. package/dist/cli/helpers/task-creation.js +140 -0
  123. package/dist/cli/helpers/task-creation.js.map +1 -0
  124. package/dist/cli/index.js +25 -2
  125. package/dist/cli/index.js.map +1 -1
  126. package/dist/models/schema.d.ts +2 -0
  127. package/dist/models/schema.d.ts.map +1 -1
  128. package/dist/models/schema.js +2 -0
  129. package/dist/models/schema.js.map +1 -1
  130. package/dist/models/types.d.ts +32 -1
  131. package/dist/models/types.d.ts.map +1 -1
  132. package/dist/services/artifact-gathering.d.ts +2 -0
  133. package/dist/services/artifact-gathering.d.ts.map +1 -1
  134. package/dist/services/artifact-gathering.js +26 -7
  135. package/dist/services/artifact-gathering.js.map +1 -1
  136. package/dist/services/artifact-service.d.ts +5 -5
  137. package/dist/services/artifact-service.d.ts.map +1 -1
  138. package/dist/services/artifact-service.js +4 -0
  139. package/dist/services/artifact-service.js.map +1 -1
  140. package/dist/services/config-service.d.ts.map +1 -1
  141. package/dist/services/config-service.js +2 -0
  142. package/dist/services/config-service.js.map +1 -1
  143. package/dist/services/credential-backends.d.ts.map +1 -1
  144. package/dist/services/credential-backends.js +15 -7
  145. package/dist/services/credential-backends.js.map +1 -1
  146. package/dist/services/credentials-service.d.ts.map +1 -1
  147. package/dist/services/credentials-service.js +6 -3
  148. package/dist/services/credentials-service.js.map +1 -1
  149. package/dist/services/github-service.d.ts +2 -2
  150. package/dist/services/github-service.d.ts.map +1 -1
  151. package/dist/services/github-service.js +9 -4
  152. package/dist/services/github-service.js.map +1 -1
  153. package/dist/services/template-service.d.ts +2 -1
  154. package/dist/services/template-service.d.ts.map +1 -1
  155. package/dist/services/template-service.js +2 -1
  156. package/dist/services/template-service.js.map +1 -1
  157. package/dist/templates/backlog/backlog-item.md.hbs +40 -0
  158. package/dist/templates/checklists/agile-checklist.md.hbs +1 -1
  159. package/dist/templates/quick/quick-task.md.hbs +1 -1
  160. package/dist/templates/rules/claude/CLAUDE.md.hbs +78 -35
  161. package/dist/templates/rules/codex/AGENTS.md.hbs +73 -17
  162. package/dist/templates/rules/cursor/2101-implement-task-list.mdc.hbs +66 -14
  163. package/dist/templates/sprints/sprint.md.hbs +42 -0
  164. package/dist/templates/task-templates/api-integration.json +45 -0
  165. package/dist/templates/task-templates/auth-flow.json +48 -0
  166. package/dist/templates/task-templates/database-migration.json +44 -0
  167. package/dist/templates/task-templates/react-component.json +45 -0
  168. package/dist/templates/task-templates/rest-endpoint.json +53 -0
  169. package/dist/templates/tasks/task-list.md.hbs +1 -1
  170. package/dist/utils/constants.d.ts +4 -0
  171. package/dist/utils/constants.d.ts.map +1 -1
  172. package/dist/utils/constants.js +4 -0
  173. package/dist/utils/constants.js.map +1 -1
  174. package/dist/utils/logger.d.ts +31 -1
  175. package/dist/utils/logger.d.ts.map +1 -1
  176. package/dist/utils/logger.js +92 -9
  177. package/dist/utils/logger.js.map +1 -1
  178. package/dist/utils/markdown.d.ts +3 -2
  179. package/dist/utils/markdown.d.ts.map +1 -1
  180. package/dist/utils/markdown.js +3 -1
  181. package/dist/utils/markdown.js.map +1 -1
  182. package/dist/utils/slugify.d.ts +8 -1
  183. package/dist/utils/slugify.d.ts.map +1 -1
  184. package/dist/utils/slugify.js +18 -2
  185. package/dist/utils/slugify.js.map +1 -1
  186. package/package.json +14 -3
  187. package/dist/agents/agent-factory.d.ts +0 -7
  188. package/dist/agents/agent-factory.d.ts.map +0 -1
  189. package/dist/agents/agent-factory.js +0 -22
  190. package/dist/agents/agent-factory.js.map +0 -1
  191. package/dist/agents/claude-agent.d.ts +0 -18
  192. package/dist/agents/claude-agent.d.ts.map +0 -1
  193. package/dist/agents/claude-agent.js +0 -183
  194. package/dist/agents/claude-agent.js.map +0 -1
  195. package/dist/agents/codex-agent.d.ts +0 -17
  196. package/dist/agents/codex-agent.d.ts.map +0 -1
  197. package/dist/agents/codex-agent.js +0 -124
  198. package/dist/agents/codex-agent.js.map +0 -1
  199. package/dist/agents/cursor-agent.d.ts +0 -14
  200. package/dist/agents/cursor-agent.d.ts.map +0 -1
  201. package/dist/agents/cursor-agent.js +0 -49
  202. package/dist/agents/cursor-agent.js.map +0 -1
  203. package/dist/agents/implementation-bridge.d.ts +0 -30
  204. package/dist/agents/implementation-bridge.d.ts.map +0 -1
  205. package/dist/agents/implementation-bridge.js +0 -256
  206. package/dist/agents/implementation-bridge.js.map +0 -1
  207. package/dist/agents/progress.d.ts +0 -62
  208. package/dist/agents/progress.d.ts.map +0 -1
  209. package/dist/agents/progress.js +0 -155
  210. package/dist/agents/progress.js.map +0 -1
  211. package/dist/agents/prompt-composer.d.ts +0 -30
  212. package/dist/agents/prompt-composer.d.ts.map +0 -1
  213. package/dist/agents/prompt-composer.js +0 -81
  214. package/dist/agents/prompt-composer.js.map +0 -1
  215. package/dist/agents/types.d.ts +0 -25
  216. package/dist/agents/types.d.ts.map +0 -1
  217. package/dist/agents/types.js +0 -8
  218. package/dist/agents/types.js.map +0 -1
  219. package/dist/utils/error-context.d.ts +0 -23
  220. package/dist/utils/error-context.d.ts.map +0 -1
  221. package/dist/utils/error-context.js +0 -94
  222. package/dist/utils/error-context.js.map +0 -1
@@ -1,52 +1,95 @@
1
- # {{projectName}} — Agile Planning Guide
1
+ # {{projectName}} — Agile Planning & Implementation Guide
2
2
 
3
3
  > Generated by OpenPlanr on {{date}}
4
4
 
5
- ## Project Structure
6
-
7
5
  This project uses OpenPlanr for agile planning. All artifacts are in `{{agilePath}}/`.
8
6
 
9
- ### Artifact Locations
10
- - **Epics:** `{{agilePath}}/epics/`
11
- - **Features:** `{{agilePath}}/features/`
12
- - **User Stories:** `{{agilePath}}/stories/`
13
- - **Tasks:** `{{agilePath}}/tasks/`
14
- - **ADRs:** `{{agilePath}}/adrs/`
15
- - **Checklist:** `{{agilePath}}/checklists/AGILE-DEVELOPMENT-GUIDE.md`
7
+ ## Context-Gathering Protocol
8
+
9
+ Before implementing ANY task or subtask, you MUST gather full planning context by reading the artifact hierarchy. Follow this exact sequence:
10
+
11
+ ### Step 1: Read the Task List
12
+ - Open the task file from `{{agilePath}}/tasks/` (e.g., `TASK-001-*.md`) or quick task from `{{agilePath}}/quick/`
13
+ - Parse the frontmatter to find `storyId` or `featureId`
14
+ - Identify the target subtask (first unchecked `- [ ]` item)
15
+ - Read ALL subtasks to understand the full scope and dependencies
16
+
17
+ ### Step 2: Read the Parent Chain (MANDATORY)
18
+ Follow the artifact hierarchy upward — each level adds critical context:
19
+
20
+ 1. **User Story** → `{{agilePath}}/stories/US-XXX-*.md`
21
+ - Read the full story (role, goal, benefit, acceptance criteria)
22
+ - Find and read the matching Gherkin file: `{{agilePath}}/stories/US-XXX-gherkin.feature`
23
+ - Extract the parent `featureId` from frontmatter
24
+
25
+ 2. **Feature** → `{{agilePath}}/features/FEAT-XXX-*.md`
26
+ - Read the full feature (overview, functional requirements, technical considerations)
27
+ - Extract the parent `epicId` from frontmatter
28
+
29
+ 3. **Epic** → `{{agilePath}}/epics/EPIC-XXX-*.md`
30
+ - Read the epic summary (business value, problem statement, success criteria)
31
+ - This provides the WHY behind the work
32
+
33
+ ### Step 3: Read Architecture Context
34
+ - Read ALL ADRs in `{{agilePath}}/adrs/` — these are binding technical decisions
35
+ - Check `{{agilePath}}/checklists/AGILE-DEVELOPMENT-GUIDE.md` for current progress
36
+
37
+ ### Step 4: Scan the Codebase
38
+ Before writing code, understand what exists:
16
39
 
17
- ## Agile Workflow
40
+ 1. **Identify the tech stack** — Read `package.json`, `tsconfig.json`, or equivalent
41
+ 2. **Scan the source tree** — List directories under `src/` (or project root)
42
+ 3. **Read architecture files** — Look for these high-priority files:
43
+ - Type definitions: `src/models/types.ts`, `src/types/index.ts`, or `src/types.ts`
44
+ - Core services: `src/services/` — understand CRUD patterns
45
+ - Entry point: `src/index.ts`, `src/main.ts`, or `src/app.ts` — understand registration patterns
46
+ - Config: `src/config.ts` or `src/services/config-service.ts`
47
+ 4. **Find related files** — Search for files matching keywords from the task description
48
+ 5. **Check project rules** — Read `.planr/rules.md` if it exists (MANDATORY rules)
18
49
 
19
- Follow the 5-phase agile development workflow:
50
+ ## Implementation Rules
20
51
 
21
- ### Phase 1: Requirements Analysis
22
- 1. Read existing epics in `{{agilePath}}/epics/`
23
- 2. Break epics into features in `{{agilePath}}/features/`
24
- 3. Create user stories with Gherkin acceptance criteria in `{{agilePath}}/stories/`
52
+ 1. **ONE subtask at a time** — implement only the target subtask
53
+ 2. **Wait for user approval** before moving to the next subtask
54
+ 3. **Follow existing patterns** match the code style, naming conventions, and architecture from Step 4
55
+ 4. **Map to acceptance criteria** — every implementation must satisfy the Gherkin scenarios from Step 2
56
+ 5. **Update the task file** — check the box `- [x]` for completed subtasks
57
+ 6. **Don't modify unrelated code** — stay focused on the target subtask
25
58
 
26
- ### Phase 2: Technical Design
27
- - Create UML sequence diagrams and C4 architecture diagrams
28
- - Store in `{{agilePath}}/diagrams/`
59
+ ## Agile Workflow Phases
29
60
 
30
- ### Phase 3: Architecture Decision Records
31
- - Document decisions in `{{agilePath}}/adrs/`
32
- - Cover: functional requirements, testing strategy, non-functional requirements
61
+ 1. **Requirements Analysis** Create epics, features, and user stories
62
+ 2. **Technical Design** UML sequence diagrams and C4 architecture diagrams
63
+ 3. **Architecture Decisions** — ADRs for functional requirements, testing, and NFRs
64
+ 4. **Solution Planning** — Task lists and implementation management
65
+ 5. **Solution Review** — Review against acceptance criteria and refactor
33
66
 
34
- ### Phase 4: Solution Planning
35
- 1. Generate task lists from stories in `{{agilePath}}/tasks/`
36
- 2. Implement one subtask at a time
37
- 3. Wait for user approval between subtasks
38
- 4. Update task checkboxes on completion
67
+ ## Artifact Locations
68
+ - Task lists: `{{agilePath}}/tasks/`
69
+ - User stories: `{{agilePath}}/stories/`
70
+ - Gherkin acceptance criteria: `{{agilePath}}/stories/*-gherkin.feature`
71
+ - Features: `{{agilePath}}/features/`
72
+ - Epics: `{{agilePath}}/epics/`
73
+ - Quick tasks: `{{agilePath}}/quick/`
74
+ - Backlog items: `{{agilePath}}/backlog/`
75
+ - ADRs: `{{agilePath}}/adrs/`
76
+ - Sprints: `{{agilePath}}/sprints/`
77
+ - Checklist: `{{agilePath}}/checklists/AGILE-DEVELOPMENT-GUIDE.md`
39
78
 
40
- ### Phase 5: Solution Review
41
- - Review implementation against acceptance criteria
42
- - Refactor as needed
79
+ ## Frontmatter Cross-References
80
+ Artifacts link to their parents via frontmatter fields:
81
+ - Tasks `storyId: "US-XXX"` or `featureId: "FEAT-XXX"`
82
+ - Stories → `featureId: "FEAT-XXX"`
83
+ - Features → `epicId: "EPIC-XXX"`
43
84
 
44
- ## Rules
85
+ Always follow these links to build the full context chain.
45
86
 
46
- - Always check the checklist at `{{agilePath}}/checklists/AGILE-DEVELOPMENT-GUIDE.md` for current progress
47
- - When creating artifacts, follow the existing naming convention: `PREFIX-NNN-slug.md`
48
- - Cross-reference parent/child artifacts with relative links
49
- - One subtask at a time during implementation
87
+ ## Naming Convention
88
+ All artifacts follow `PREFIX-NNN-slug.md` format:
89
+ - EPIC-001, EPIC-002, ...
90
+ - FEAT-001, FEAT-002, ...
91
+ - US-001, US-002, ...
92
+ - TASK-001, TASK-002, ...
50
93
  {{#if existingEpics}}
51
94
 
52
95
  ## Current Epics
@@ -2,25 +2,81 @@
2
2
 
3
3
  > Generated by OpenPlanr on {{date}}
4
4
 
5
- ## Agile Planning
6
-
7
5
  This project follows a structured agile workflow. All planning artifacts are in `{{agilePath}}/`.
8
6
 
9
- ### Artifact Structure
10
- - Epics: `{{agilePath}}/epics/` — High-level business initiatives
11
- - Features: `{{agilePath}}/features/` Capabilities derived from epics
12
- - User Stories: `{{agilePath}}/stories/` — User-facing requirements with Gherkin acceptance criteria
13
- - Tasks: `{{agilePath}}/tasks/` Implementation task lists with checkboxes
14
- - ADRs: `{{agilePath}}/adrs/` Architecture Decision Records
15
-
16
- ### Workflow
17
- 1. Check the development checklist: `{{agilePath}}/checklists/AGILE-DEVELOPMENT-GUIDE.md`
18
- 2. Identify the current phase and next incomplete activity
19
- 3. When implementing tasks, work on ONE subtask at a time
20
- 4. Update task checkboxes after completing each subtask
21
- 5. Cross-reference artifacts using relative links
22
-
23
- ### Naming Convention
7
+ ## Context-Gathering Protocol
8
+
9
+ Before implementing ANY task or subtask, you MUST gather full planning context by reading the artifact hierarchy. Follow this exact sequence:
10
+
11
+ ### Step 1: Read the Task List
12
+ - Open the task file from `{{agilePath}}/tasks/` (e.g., `TASK-001-*.md`) or quick task from `{{agilePath}}/quick/`
13
+ - Parse the frontmatter to find `storyId` or `featureId`
14
+ - Identify the target subtask (first unchecked `- [ ]` item)
15
+ - Read ALL subtasks to understand the full scope and dependencies
16
+
17
+ ### Step 2: Read the Parent Chain (MANDATORY)
18
+ Follow the artifact hierarchy upward each level adds critical context:
19
+
20
+ 1. **User Story** → `{{agilePath}}/stories/US-XXX-*.md`
21
+ - Read the full story (role, goal, benefit, acceptance criteria)
22
+ - Find and read the matching Gherkin file: `{{agilePath}}/stories/US-XXX-gherkin.feature`
23
+ - Extract the parent `featureId` from frontmatter
24
+
25
+ 2. **Feature** → `{{agilePath}}/features/FEAT-XXX-*.md`
26
+ - Read the full feature (overview, functional requirements, technical considerations)
27
+ - Extract the parent `epicId` from frontmatter
28
+
29
+ 3. **Epic** → `{{agilePath}}/epics/EPIC-XXX-*.md`
30
+ - Read the epic summary (business value, problem statement, success criteria)
31
+ - This provides the WHY behind the work
32
+
33
+ ### Step 3: Read Architecture Context
34
+ - Read ALL ADRs in `{{agilePath}}/adrs/` — these are binding technical decisions
35
+ - Check `{{agilePath}}/checklists/AGILE-DEVELOPMENT-GUIDE.md` for current progress
36
+
37
+ ### Step 4: Scan the Codebase
38
+ Before writing code, understand what exists:
39
+
40
+ 1. **Identify the tech stack** — Read `package.json`, `tsconfig.json`, or equivalent
41
+ 2. **Scan the source tree** — List directories under `src/` (or project root)
42
+ 3. **Read architecture files** — Look for these high-priority files:
43
+ - Type definitions: `src/models/types.ts`, `src/types/index.ts`, or `src/types.ts`
44
+ - Core services: `src/services/` — understand CRUD patterns
45
+ - Entry point: `src/index.ts`, `src/main.ts`, or `src/app.ts` — understand registration patterns
46
+ - Config: `src/config.ts` or `src/services/config-service.ts`
47
+ 4. **Find related files** — Search for files matching keywords from the task description
48
+ 5. **Check project rules** — Read `.planr/rules.md` if it exists (MANDATORY rules)
49
+
50
+ ## Implementation Rules
51
+
52
+ 1. **ONE subtask at a time** — implement only the target subtask
53
+ 2. **Wait for user approval** before moving to the next subtask
54
+ 3. **Follow existing patterns** — match the code style, naming conventions, and architecture from Step 4
55
+ 4. **Map to acceptance criteria** — every implementation must satisfy the Gherkin scenarios from Step 2
56
+ 5. **Update the task file** — check the box `- [x]` for completed subtasks
57
+ 6. **Don't modify unrelated code** — stay focused on the target subtask
58
+
59
+ ## Artifact Locations
60
+ - Task lists: `{{agilePath}}/tasks/`
61
+ - User stories: `{{agilePath}}/stories/`
62
+ - Gherkin acceptance criteria: `{{agilePath}}/stories/*-gherkin.feature`
63
+ - Features: `{{agilePath}}/features/`
64
+ - Epics: `{{agilePath}}/epics/`
65
+ - Quick tasks: `{{agilePath}}/quick/`
66
+ - Backlog items: `{{agilePath}}/backlog/`
67
+ - ADRs: `{{agilePath}}/adrs/`
68
+ - Sprints: `{{agilePath}}/sprints/`
69
+ - Checklist: `{{agilePath}}/checklists/AGILE-DEVELOPMENT-GUIDE.md`
70
+
71
+ ## Frontmatter Cross-References
72
+ Artifacts link to their parents via frontmatter fields:
73
+ - Tasks → `storyId: "US-XXX"` or `featureId: "FEAT-XXX"`
74
+ - Stories → `featureId: "FEAT-XXX"`
75
+ - Features → `epicId: "EPIC-XXX"`
76
+
77
+ Always follow these links to build the full context chain.
78
+
79
+ ## Naming Convention
24
80
  All artifacts follow `PREFIX-NNN-slug.md` format:
25
81
  - EPIC-001, EPIC-002, ...
26
82
  - FEAT-001, FEAT-002, ...
@@ -1,28 +1,80 @@
1
1
  ---
2
- description: "Implement Task List — manage task-by-task implementation for {{projectName}}"
2
+ description: "Implement Task List — context-aware task implementation guide for {{projectName}}"
3
3
  globs: ""
4
4
  alwaysApply: false
5
5
  ---
6
6
 
7
7
  # Implement Task List
8
8
 
9
- You are an implementation assistant. Guide one-task-at-a-time implementation.
9
+ You are an implementation assistant for **{{projectName}}**. Before writing any code, you MUST gather full planning context by reading the artifact hierarchy.
10
10
 
11
- ## Rules
11
+ ## Context-Gathering Protocol
12
12
 
13
- 1. Only work on ONE subtask at a time
14
- 2. Wait for user approval before moving to the next subtask
15
- 3. After completing a subtask, update the task list by checking the box
16
- 4. Reference acceptance criteria from the linked user story's Gherkin file
13
+ Before implementing ANY subtask, follow this exact sequence:
17
14
 
18
- ## Process
15
+ ### Step 1: Read the Task List
16
+ - Open the task file from `{{agilePath}}/tasks/` (e.g., `TASK-001-*.md`)
17
+ - Parse the frontmatter to find `storyId` or `featureId`
18
+ - Identify the target subtask (first unchecked `- [ ]` item)
19
+ - Read ALL subtasks to understand the full scope and dependencies
19
20
 
20
- 1. Read the task list from `{{agilePath}}/tasks/`
21
- 2. Find the first unchecked subtask
22
- 3. Implement it
23
- 4. Mark it complete in the task file
24
- 5. Ask the user to review before proceeding
21
+ ### Step 2: Read the Parent Chain (MANDATORY)
22
+ Follow the artifact hierarchy upward — each level adds critical context:
25
23
 
26
- ## Task Locations
24
+ 1. **User Story** → `{{agilePath}}/stories/US-XXX-*.md`
25
+ - Read the full story (role, goal, benefit, acceptance criteria)
26
+ - Find and read the matching Gherkin file: `{{agilePath}}/stories/US-XXX-gherkin.feature`
27
+ - Extract the parent `featureId` from frontmatter
28
+
29
+ 2. **Feature** → `{{agilePath}}/features/FEAT-XXX-*.md`
30
+ - Read the full feature (overview, functional requirements, technical considerations)
31
+ - Extract the parent `epicId` from frontmatter
32
+
33
+ 3. **Epic** → `{{agilePath}}/epics/EPIC-XXX-*.md`
34
+ - Read the epic summary (business value, problem statement, success criteria)
35
+ - This provides the WHY behind the work
36
+
37
+ ### Step 3: Read Architecture Context
38
+ - Read ALL ADRs in `{{agilePath}}/adrs/` — these are binding technical decisions
39
+ - Check `{{agilePath}}/checklists/AGILE-DEVELOPMENT-GUIDE.md` for current progress
40
+
41
+ ### Step 4: Scan the Codebase
42
+ Before writing code, understand what exists:
43
+
44
+ 1. **Identify the tech stack** — Read `package.json`, `tsconfig.json`, or equivalent
45
+ 2. **Scan the source tree** — List directories under `src/` (or project root)
46
+ 3. **Read architecture files** — Look for these high-priority files:
47
+ - Type definitions: `src/models/types.ts`, `src/types/index.ts`, or `src/types.ts`
48
+ - Core services: `src/services/` — understand CRUD patterns
49
+ - Entry point: `src/index.ts`, `src/main.ts`, or `src/app.ts` — understand registration patterns
50
+ - Config: `src/config.ts` or `src/services/config-service.ts`
51
+ 4. **Find related files** — Search for files matching keywords from the task description
52
+ 5. **Check project rules** — Read `.planr/rules.md` if it exists (MANDATORY rules)
53
+
54
+ ## Implementation Rules
55
+
56
+ 1. **ONE subtask at a time** — implement only the target subtask
57
+ 2. **Wait for user approval** before moving to the next subtask
58
+ 3. **Follow existing patterns** — match the code style, naming conventions, and architecture from Step 4
59
+ 4. **Map to acceptance criteria** — every implementation must satisfy the Gherkin scenarios from Step 2
60
+ 5. **Update the task file** — check the box `- [x]` for completed subtasks
61
+ 6. **Don't modify unrelated code** — stay focused on the target subtask
62
+
63
+ ## Artifact Locations
27
64
  - Task lists: `{{agilePath}}/tasks/`
28
65
  - User stories: `{{agilePath}}/stories/`
66
+ - Gherkin acceptance criteria: `{{agilePath}}/stories/*-gherkin.feature`
67
+ - Features: `{{agilePath}}/features/`
68
+ - Epics: `{{agilePath}}/epics/`
69
+ - Quick tasks: `{{agilePath}}/quick/`
70
+ - Backlog items: `{{agilePath}}/backlog/`
71
+ - ADRs: `{{agilePath}}/adrs/`
72
+ - Sprints: `{{agilePath}}/sprints/`
73
+
74
+ ## Frontmatter Cross-References
75
+ Artifacts link to their parents via frontmatter fields:
76
+ - Tasks → `storyId: "US-XXX"` or `featureId: "FEAT-XXX"`
77
+ - Stories → `featureId: "FEAT-XXX"`
78
+ - Features → `epicId: "EPIC-XXX"`
79
+
80
+ Always follow these links to build the full context chain.
@@ -0,0 +1,42 @@
1
+ ---
2
+ id: "{{id}}"
3
+ name: "{{name}}"
4
+ startDate: "{{startDate}}"
5
+ endDate: "{{endDate}}"
6
+ duration: "{{duration}}"
7
+ status: "{{status}}"
8
+ created: "{{date}}"
9
+ updated: "{{date}}"
10
+ taskIds: [{{#each taskIds}}"{{this}}"{{#unless @last}}, {{/unless}}{{/each}}]
11
+ ---
12
+
13
+ # {{id}}: {{name}}
14
+
15
+ ## Sprint Details
16
+ - **Duration:** {{duration}}
17
+ - **Start:** {{startDate}}
18
+ - **End:** {{endDate}}
19
+ - **Status:** {{uppercase status}}
20
+
21
+ {{#if goals}}
22
+ ## Goals
23
+ {{#each goals}}
24
+ - {{this}}
25
+ {{/each}}
26
+ {{/if}}
27
+
28
+ ## Tasks
29
+ {{#if taskIds}}
30
+ {{#each taskIds}}
31
+ - [ ] {{this}}
32
+ {{/each}}
33
+ {{else}}
34
+ _No tasks assigned yet. Run `planr sprint add <taskId>` to assign tasks._
35
+ {{/if}}
36
+
37
+ ## Retrospective
38
+ _Complete this section when closing the sprint with `planr sprint close`._
39
+
40
+ ---
41
+ _View progress: `planr sprint status`_
42
+ _Close sprint: `planr sprint close`_
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "api-integration",
3
+ "description": "External API client with retry logic, error handling, and tests",
4
+ "variables": ["serviceName", "baseUrl"],
5
+ "tasks": [
6
+ {
7
+ "id": "1.0",
8
+ "title": "API client setup",
9
+ "subtasks": [
10
+ { "id": "1.1", "title": "Create {{serviceName}} API client module" },
11
+ { "id": "1.2", "title": "Configure base URL, headers, and authentication" },
12
+ { "id": "1.3", "title": "Add environment variables for {{serviceName}} credentials" }
13
+ ]
14
+ },
15
+ {
16
+ "id": "2.0",
17
+ "title": "Implement API methods",
18
+ "subtasks": [
19
+ { "id": "2.1", "title": "Implement core API methods for {{serviceName}}" },
20
+ { "id": "2.2", "title": "Add request/response type definitions" },
21
+ { "id": "2.3", "title": "Add response parsing and data transformation" }
22
+ ]
23
+ },
24
+ {
25
+ "id": "3.0",
26
+ "title": "Reliability and error handling",
27
+ "subtasks": [
28
+ { "id": "3.1", "title": "Add retry logic with exponential backoff" },
29
+ { "id": "3.2", "title": "Add timeout configuration" },
30
+ { "id": "3.3", "title": "Add error classification (retryable vs fatal)" },
31
+ { "id": "3.4", "title": "Add rate limiting / throttling support" }
32
+ ]
33
+ },
34
+ {
35
+ "id": "4.0",
36
+ "title": "Testing",
37
+ "subtasks": [
38
+ { "id": "4.1", "title": "Unit tests with mocked HTTP responses" },
39
+ { "id": "4.2", "title": "Test retry logic and error scenarios" },
40
+ { "id": "4.3", "title": "Test timeout and rate limit handling" },
41
+ { "id": "4.4", "title": "Integration test with {{serviceName}} sandbox (if available)" }
42
+ ]
43
+ }
44
+ ]
45
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "auth-flow",
3
+ "description": "Authentication flow with login, signup, and password reset",
4
+ "variables": ["authProvider"],
5
+ "tasks": [
6
+ {
7
+ "id": "1.0",
8
+ "title": "Authentication infrastructure",
9
+ "subtasks": [
10
+ { "id": "1.1", "title": "Set up {{authProvider}} authentication provider" },
11
+ { "id": "1.2", "title": "Configure session/token management (JWT or session)" },
12
+ { "id": "1.3", "title": "Add auth middleware for protected routes" }
13
+ ]
14
+ },
15
+ {
16
+ "id": "2.0",
17
+ "title": "Implement auth endpoints",
18
+ "subtasks": [
19
+ { "id": "2.1", "title": "POST /auth/signup — user registration" },
20
+ { "id": "2.2", "title": "POST /auth/login — user login" },
21
+ { "id": "2.3", "title": "POST /auth/logout — session termination" },
22
+ { "id": "2.4", "title": "POST /auth/forgot-password — password reset request" },
23
+ { "id": "2.5", "title": "POST /auth/reset-password — password reset confirmation" }
24
+ ]
25
+ },
26
+ {
27
+ "id": "3.0",
28
+ "title": "Security hardening",
29
+ "subtasks": [
30
+ { "id": "3.1", "title": "Add input validation and sanitization" },
31
+ { "id": "3.2", "title": "Implement rate limiting on auth endpoints" },
32
+ { "id": "3.3", "title": "Add password strength requirements" },
33
+ { "id": "3.4", "title": "Secure token storage and rotation" }
34
+ ]
35
+ },
36
+ {
37
+ "id": "4.0",
38
+ "title": "Testing",
39
+ "subtasks": [
40
+ { "id": "4.1", "title": "Test signup flow (valid input, duplicate email, weak password)" },
41
+ { "id": "4.2", "title": "Test login flow (valid credentials, invalid, locked account)" },
42
+ { "id": "4.3", "title": "Test password reset flow end-to-end" },
43
+ { "id": "4.4", "title": "Test auth middleware (valid token, expired, missing)" },
44
+ { "id": "4.5", "title": "Test rate limiting on auth endpoints" }
45
+ ]
46
+ }
47
+ ]
48
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "database-migration",
3
+ "description": "Schema change with migration, rollback, and seed data",
4
+ "variables": ["tableName", "changeDescription"],
5
+ "tasks": [
6
+ {
7
+ "id": "1.0",
8
+ "title": "Plan schema change",
9
+ "subtasks": [
10
+ { "id": "1.1", "title": "Document {{changeDescription}} for {{tableName}} table" },
11
+ { "id": "1.2", "title": "Review impact on existing queries and indexes" },
12
+ { "id": "1.3", "title": "Check for foreign key constraints and cascading effects" }
13
+ ]
14
+ },
15
+ {
16
+ "id": "2.0",
17
+ "title": "Create migration",
18
+ "subtasks": [
19
+ { "id": "2.1", "title": "Write up migration for {{tableName}}" },
20
+ { "id": "2.2", "title": "Write down migration (rollback)" },
21
+ { "id": "2.3", "title": "Test migration on local database" }
22
+ ]
23
+ },
24
+ {
25
+ "id": "3.0",
26
+ "title": "Update application code",
27
+ "subtasks": [
28
+ { "id": "3.1", "title": "Update ORM models/types for {{tableName}}" },
29
+ { "id": "3.2", "title": "Update queries and repository layer" },
30
+ { "id": "3.3", "title": "Update API serialization if schema changed" }
31
+ ]
32
+ },
33
+ {
34
+ "id": "4.0",
35
+ "title": "Testing and validation",
36
+ "subtasks": [
37
+ { "id": "4.1", "title": "Update seed data for {{tableName}}" },
38
+ { "id": "4.2", "title": "Run existing tests and fix breakages" },
39
+ { "id": "4.3", "title": "Test rollback migration works correctly" },
40
+ { "id": "4.4", "title": "Verify data integrity after migration" }
41
+ ]
42
+ }
43
+ ]
44
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "react-component",
3
+ "description": "React component with stories, tests, and types",
4
+ "variables": ["componentName"],
5
+ "tasks": [
6
+ {
7
+ "id": "1.0",
8
+ "title": "Component setup",
9
+ "subtasks": [
10
+ { "id": "1.1", "title": "Create {{componentName}} component file with props interface" },
11
+ { "id": "1.2", "title": "Add component styles (CSS modules or styled-components)" },
12
+ { "id": "1.3", "title": "Export from component index barrel" }
13
+ ]
14
+ },
15
+ {
16
+ "id": "2.0",
17
+ "title": "Implement component logic",
18
+ "subtasks": [
19
+ { "id": "2.1", "title": "Implement {{componentName}} render logic and state" },
20
+ { "id": "2.2", "title": "Add event handlers and callbacks" },
21
+ { "id": "2.3", "title": "Handle loading, error, and empty states" },
22
+ { "id": "2.4", "title": "Add accessibility attributes (aria-labels, roles, keyboard nav)" }
23
+ ]
24
+ },
25
+ {
26
+ "id": "3.0",
27
+ "title": "Storybook stories",
28
+ "subtasks": [
29
+ { "id": "3.1", "title": "Create default story for {{componentName}}" },
30
+ { "id": "3.2", "title": "Add variant stories (sizes, states, themes)" },
31
+ { "id": "3.3", "title": "Add interactive story with controls" }
32
+ ]
33
+ },
34
+ {
35
+ "id": "4.0",
36
+ "title": "Tests",
37
+ "subtasks": [
38
+ { "id": "4.1", "title": "Unit tests for {{componentName}} rendering" },
39
+ { "id": "4.2", "title": "Test user interactions and event handlers" },
40
+ { "id": "4.3", "title": "Test edge cases and error states" },
41
+ { "id": "4.4", "title": "Snapshot or visual regression test" }
42
+ ]
43
+ }
44
+ ]
45
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "rest-endpoint",
3
+ "description": "CRUD REST endpoint with validation, auth, tests, and docs",
4
+ "variables": ["entityName", "basePath"],
5
+ "tasks": [
6
+ {
7
+ "id": "1.0",
8
+ "title": "Define data model and types",
9
+ "subtasks": [
10
+ { "id": "1.1", "title": "Create {{entityName}} interface/type definition" },
11
+ { "id": "1.2", "title": "Add Zod validation schema for {{entityName}}" },
12
+ { "id": "1.3", "title": "Define request/response DTOs" }
13
+ ]
14
+ },
15
+ {
16
+ "id": "2.0",
17
+ "title": "Implement API routes",
18
+ "subtasks": [
19
+ { "id": "2.1", "title": "Create GET {{basePath}} — list all {{entityName}}s" },
20
+ { "id": "2.2", "title": "Create GET {{basePath}}/:id — get single {{entityName}}" },
21
+ { "id": "2.3", "title": "Create POST {{basePath}} — create {{entityName}}" },
22
+ { "id": "2.4", "title": "Create PUT {{basePath}}/:id — update {{entityName}}" },
23
+ { "id": "2.5", "title": "Create DELETE {{basePath}}/:id — delete {{entityName}}" }
24
+ ]
25
+ },
26
+ {
27
+ "id": "3.0",
28
+ "title": "Add middleware and validation",
29
+ "subtasks": [
30
+ { "id": "3.1", "title": "Add request body validation middleware" },
31
+ { "id": "3.2", "title": "Add authentication/authorization checks" },
32
+ { "id": "3.3", "title": "Add error handling and proper HTTP status codes" }
33
+ ]
34
+ },
35
+ {
36
+ "id": "4.0",
37
+ "title": "Write tests",
38
+ "subtasks": [
39
+ { "id": "4.1", "title": "Unit tests for {{entityName}} validation logic" },
40
+ { "id": "4.2", "title": "Integration tests for all CRUD endpoints" },
41
+ { "id": "4.3", "title": "Test error cases (404, 400, 401, 403)" }
42
+ ]
43
+ },
44
+ {
45
+ "id": "5.0",
46
+ "title": "Documentation",
47
+ "subtasks": [
48
+ { "id": "5.1", "title": "Add API documentation for {{basePath}} endpoints" },
49
+ { "id": "5.2", "title": "Update README with new endpoint details" }
50
+ ]
51
+ }
52
+ ]
53
+ }
@@ -44,4 +44,4 @@ status: "pending"
44
44
  {{/if}}
45
45
 
46
46
  ## Notes
47
- _Mark tasks complete by checking the boxes above, or run `planr task implement {{id}}`._
47
+ _Mark tasks complete by checking the boxes above. Use your coding agent (Claude Code, Cursor, Codex) with the generated rules for context-aware implementation._
@@ -7,6 +7,8 @@ export declare const ARTIFACT_DIRS: {
7
7
  readonly stories: "stories";
8
8
  readonly tasks: "tasks";
9
9
  readonly quick: "quick";
10
+ readonly backlog: "backlog";
11
+ readonly sprints: "sprints";
10
12
  readonly adrs: "adrs";
11
13
  readonly checklists: "checklists";
12
14
  };
@@ -16,6 +18,8 @@ export declare const ID_PREFIXES: {
16
18
  readonly story: "US";
17
19
  readonly task: "TASK";
18
20
  readonly quick: "QT";
21
+ readonly backlog: "BL";
22
+ readonly sprint: "SPRINT";
19
23
  readonly adr: "ADR";
20
24
  };
21
25
  export declare function getTemplatesDir(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,sBAAsB,CAAC;AAEnD,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAC9C,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AAExD,eAAO,MAAM,aAAa;;;;;;;;CAQhB,CAAC;AAEX,eAAO,MAAM,WAAW;;;;;;;CAOd,CAAC;AAEX,wBAAgB,eAAe,IAAI,MAAM,CAExC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,sBAAsB,CAAC;AAEnD,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAC9C,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AAExD,eAAO,MAAM,aAAa;;;;;;;;;;CAUhB,CAAC;AAEX,eAAO,MAAM,WAAW;;;;;;;;;CASd,CAAC;AAEX,wBAAgB,eAAe,IAAI,MAAM,CAExC"}