ai-devkit 0.12.0 → 0.14.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 (101) hide show
  1. package/README.md +50 -199
  2. package/dist/cli.js +8 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/init.d.ts +1 -0
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +111 -12
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/lint.d.ts +4 -0
  9. package/dist/commands/lint.d.ts.map +1 -0
  10. package/dist/commands/lint.js +53 -0
  11. package/dist/commands/lint.js.map +1 -0
  12. package/dist/commands/memory.d.ts.map +1 -1
  13. package/dist/commands/memory.js +19 -0
  14. package/dist/commands/memory.js.map +1 -1
  15. package/dist/lib/InitTemplate.d.ts +13 -0
  16. package/dist/lib/InitTemplate.d.ts.map +1 -0
  17. package/dist/lib/InitTemplate.js +169 -0
  18. package/dist/lib/InitTemplate.js.map +1 -0
  19. package/dist/lib/SkillManager.d.ts.map +1 -1
  20. package/dist/lib/SkillManager.js +9 -0
  21. package/dist/lib/SkillManager.js.map +1 -1
  22. package/dist/services/lint/constants.d.ts +14 -0
  23. package/dist/services/lint/constants.d.ts.map +1 -0
  24. package/dist/services/lint/constants.js +17 -0
  25. package/dist/services/lint/constants.js.map +1 -0
  26. package/dist/services/lint/lint.service.d.ts +6 -0
  27. package/dist/services/lint/lint.service.d.ts.map +1 -0
  28. package/dist/services/lint/lint.service.js +100 -0
  29. package/dist/services/lint/lint.service.js.map +1 -0
  30. package/dist/services/lint/rules/base-docs.rule.d.ts +3 -0
  31. package/dist/services/lint/rules/base-docs.rule.d.ts.map +1 -0
  32. package/dist/services/lint/rules/base-docs.rule.js +17 -0
  33. package/dist/services/lint/rules/base-docs.rule.js.map +1 -0
  34. package/dist/services/lint/rules/check-factories.d.ts +5 -0
  35. package/dist/services/lint/rules/check-factories.d.ts.map +1 -0
  36. package/dist/services/lint/rules/check-factories.js +36 -0
  37. package/dist/services/lint/rules/check-factories.js.map +1 -0
  38. package/dist/services/lint/rules/feature-docs.rule.d.ts +3 -0
  39. package/dist/services/lint/rules/feature-docs.rule.d.ts.map +1 -0
  40. package/dist/services/lint/rules/feature-docs.rule.js +16 -0
  41. package/dist/services/lint/rules/feature-docs.rule.js.map +1 -0
  42. package/dist/services/lint/rules/feature-name.rule.d.ts +7 -0
  43. package/dist/services/lint/rules/feature-name.rule.d.ts.map +1 -0
  44. package/dist/services/lint/rules/feature-name.rule.js +26 -0
  45. package/dist/services/lint/rules/feature-name.rule.js.map +1 -0
  46. package/dist/services/lint/rules/git-worktree.rule.d.ts +3 -0
  47. package/dist/services/lint/rules/git-worktree.rule.d.ts.map +1 -0
  48. package/dist/services/lint/rules/git-worktree.rule.js +26 -0
  49. package/dist/services/lint/rules/git-worktree.rule.js.map +1 -0
  50. package/dist/services/lint/rules/phase-docs.rule.d.ts +13 -0
  51. package/dist/services/lint/rules/phase-docs.rule.d.ts.map +1 -0
  52. package/dist/services/lint/rules/phase-docs.rule.js +54 -0
  53. package/dist/services/lint/rules/phase-docs.rule.js.map +1 -0
  54. package/dist/services/lint/types.d.ts +39 -0
  55. package/dist/services/lint/types.d.ts.map +1 -0
  56. package/dist/services/lint/types.js +3 -0
  57. package/dist/services/lint/types.js.map +1 -0
  58. package/dist/templates/commands/capture-knowledge.md +7 -45
  59. package/dist/templates/commands/check-implementation.md +4 -19
  60. package/dist/templates/commands/code-review.md +7 -81
  61. package/dist/templates/commands/debug.md +7 -45
  62. package/dist/templates/commands/execute-plan.md +6 -70
  63. package/dist/templates/commands/new-requirement.md +15 -128
  64. package/dist/templates/commands/remember.md +4 -21
  65. package/dist/templates/commands/review-design.md +1 -2
  66. package/dist/templates/commands/review-requirements.md +2 -3
  67. package/dist/templates/commands/simplify-implementation.md +6 -144
  68. package/dist/templates/commands/update-planning.md +6 -61
  69. package/dist/templates/commands/writing-test.md +6 -42
  70. package/dist/templates/env/base.md +2 -2
  71. package/dist/templates/templates/commands/capture-knowledge.md +7 -45
  72. package/dist/templates/templates/commands/check-implementation.md +4 -19
  73. package/dist/templates/templates/commands/code-review.md +7 -81
  74. package/dist/templates/templates/commands/debug.md +7 -45
  75. package/dist/templates/templates/commands/execute-plan.md +6 -70
  76. package/dist/templates/templates/commands/new-requirement.md +15 -128
  77. package/dist/templates/templates/commands/remember.md +4 -21
  78. package/dist/templates/templates/commands/review-design.md +1 -2
  79. package/dist/templates/templates/commands/review-requirements.md +2 -3
  80. package/dist/templates/templates/commands/simplify-implementation.md +6 -144
  81. package/dist/templates/templates/commands/update-planning.md +6 -61
  82. package/dist/templates/templates/commands/writing-test.md +6 -42
  83. package/dist/templates/templates/env/base.md +2 -2
  84. package/dist/util/git.d.ts +8 -0
  85. package/dist/util/git.d.ts.map +1 -1
  86. package/dist/util/git.js +69 -0
  87. package/dist/util/git.js.map +1 -1
  88. package/package.json +2 -2
  89. package/templates/commands/capture-knowledge.md +7 -45
  90. package/templates/commands/check-implementation.md +4 -19
  91. package/templates/commands/code-review.md +7 -81
  92. package/templates/commands/debug.md +7 -45
  93. package/templates/commands/execute-plan.md +6 -70
  94. package/templates/commands/new-requirement.md +15 -128
  95. package/templates/commands/remember.md +4 -21
  96. package/templates/commands/review-design.md +1 -2
  97. package/templates/commands/review-requirements.md +2 -3
  98. package/templates/commands/simplify-implementation.md +6 -144
  99. package/templates/commands/update-planning.md +6 -61
  100. package/templates/commands/writing-test.md +6 -42
  101. package/templates/env/base.md +2 -2
@@ -1,65 +1,10 @@
1
1
  ---
2
- description: Assist in updating planning documentation to reflect current implementation progress for a feature.
2
+ description: Update planning docs to reflect implementation progress.
3
3
  ---
4
4
 
5
- # Planning Update Assistant
6
-
7
- Please help me reconcile the current implementation progress with our planning documentation.
8
-
9
- ## Step 1: Gather Context
10
- Ask me for:
11
- - Feature/branch name and brief status
12
- - Tasks completed since last update
13
- - Any new tasks discovered
14
- - Current blockers or risks
15
- - Relevant planning docs (e.g., `docs/ai/planning/feature-{name}.md`)
16
-
17
- ## Step 2: Review Planning Doc
18
- If a planning doc exists:
19
- - Summarize existing milestones and task breakdowns
20
- - Note expected sequencing and dependencies
21
- - Identify outstanding tasks in the plan
22
-
23
- ## Step 3: Reconcile Progress
24
- For each planned task:
25
- - Mark status (done / in progress / blocked / not started)
26
- - Note actual work completed vs. planned scope
27
- - Record blockers or changes in approach
28
- - Identify tasks that were skipped or added
29
-
30
- ## Step 4: Update Task List
31
- Help me produce an updated checklist such as:
32
- ```
33
- ### Current Status: [Feature Name]
34
-
35
- #### Done
36
- - [x] Task A - short note on completion or link to commit/pr
37
- - [x] Task B
38
-
39
- #### In Progress
40
- - [ ] Task C - waiting on [dependency]
41
-
42
- #### Blocked
43
- - [ ] Task D - blocked by [issue/owner]
44
-
45
- #### Newly Discovered Work
46
- - [ ] Task E - reason discovered
47
- - [ ] Task F - due by [date]
48
- ```
49
-
50
- ## Step 5: Next Steps & Priorities
51
- - Suggest the next 2-3 actionable tasks
52
- - Highlight risky areas needing attention
53
- - Recommend coordination (design changes, stakeholder sync, etc.)
54
- - List documentation updates needed
55
-
56
- ## Step 6: Summary for Planning Doc
57
- Prepare a summary paragraph to copy into the planning doc, covering:
58
- - Current state and progress
59
- - Major risks/blockers
60
- - Upcoming focus items
61
- - Any changes to scope or timeline
62
-
63
- ---
64
- Let me know when you're ready to begin the planning update.
5
+ Help me reconcile current implementation progress with the planning documentation.
65
6
 
7
+ 1. **Gather Context** — If not already provided, ask for: feature/branch name and brief status, tasks completed since last update, new tasks discovered, current blockers or risks, and planning doc path (default `docs/ai/planning/feature-{name}.md`).
8
+ 2. **Review & Reconcile** — Summarize existing milestones, task breakdowns, and dependencies from the planning doc. For each planned task: mark status (done / in progress / blocked / not started), note scope changes, record blockers, identify skipped or added tasks.
9
+ 3. **Produce Updated Task List** — Generate an updated checklist grouped by: Done, In Progress, Blocked, Newly Discovered Work — with short notes per task.
10
+ 4. **Next Steps & Summary** — Suggest the next 2-3 actionable tasks and highlight risky areas. Prepare a summary paragraph for the planning doc covering: current state, major risks/blockers, upcoming focus, and any scope/timeline changes.
@@ -4,45 +4,9 @@ description: Add tests for a new feature.
4
4
 
5
5
  Review `docs/ai/testing/feature-{name}.md` and ensure it mirrors the base template before writing tests.
6
6
 
7
- ## Step 1: Gather Context
8
- Ask me for:
9
- - Feature name and branch
10
- - Summary of what changed (link to design & requirements docs)
11
- - Target environment (backend, frontend, full-stack)
12
- - Existing automated test suites (unit, integration, E2E)
13
- - Any flaky or slow tests to avoid
14
-
15
- ## Step 2: Analyze Testing Template
16
- - Identify required sections from `docs/ai/testing/feature-{name}.md` (unit, integration, manual verification, coverage targets)
17
- - Confirm success criteria and edge cases from requirements & design docs
18
- - Note any mocks/stubs or fixtures already available
19
-
20
- ## Step 3: Unit Tests (Aim for 100% coverage)
21
- For each module/function:
22
- 1. List behavior scenarios (happy path, edge cases, error handling)
23
- 2. Generate concrete test cases with assertions and inputs
24
- 3. Reference existing utilities/mocks to accelerate implementation
25
- 4. Provide pseudocode or actual test snippets
26
- 5. Highlight potential missing branches preventing full coverage
27
-
28
- ## Step 4: Integration Tests
29
- 1. Identify critical flows that span multiple components/services
30
- 2. Define setup/teardown steps (databases, APIs, queues)
31
- 3. Outline test cases validating interaction boundaries, data contracts, and failure modes
32
- 4. Suggest instrumentation/logging to debug failures
33
-
34
- ## Step 5: Coverage Strategy
35
- - Recommend tooling commands (e.g., `npm run test -- --coverage`)
36
- - Call out files/functions that still need coverage and why
37
- - Suggest additional tests if coverage <100%
38
-
39
- ## Step 6: Manual & Exploratory Testing
40
- - Propose manual test checklist covering UX, accessibility, and error handling
41
- - Identify exploratory scenarios or chaos/failure injection tests if relevant
42
-
43
- ## Step 7: Update Documentation & TODOs
44
- - Summarize which tests were added or still missing
45
- - Update `docs/ai/testing/feature-{name}.md` sections with links to test files and results
46
- - Flag follow-up tasks for deferred tests (with owners/dates)
47
-
48
- Let me know when you have the latest code changes ready; we'll write tests together until we hit 100% coverage.
7
+ 1. **Gather Context** — If not already provided, ask for: feature name/branch, summary of changes (link to design & requirements docs), target environment, existing test suites, and any flaky/slow tests to avoid.
8
+ 2. **Analyze Testing Template** — Identify required sections from `docs/ai/testing/feature-{name}.md`. Confirm success criteria and edge cases from requirements & design docs. Note available mocks/stubs/fixtures.
9
+ 3. **Unit Tests (aim for 100% coverage)** — For each module/function: list behavior scenarios (happy path, edge cases, error handling), generate test cases with assertions using existing utilities/mocks, and highlight missing branches preventing full coverage.
10
+ 4. **Integration Tests** — Identify critical cross-component flows. Define setup/teardown steps and test cases for interaction boundaries, data contracts, and failure modes.
11
+ 5. **Coverage Strategy** Recommend coverage tooling commands. Call out files/functions still needing coverage and suggest additional tests if <100%.
12
+ 6. **Update Documentation** — Summarize tests added or still missing. Update `docs/ai/testing/feature-{name}.md` with links to test files and results. Flag deferred tests as follow-up tasks.
@@ -57,7 +57,7 @@ The AI assistant should proactively use knowledge memory throughout all interact
57
57
 
58
58
  **How to search**:
59
59
  - Use `memory.searchKnowledge` MCP tool with relevant keywords, tags, and scope
60
- - If MCP tools are unavailable, use `npx ai-devkit memory search` CLI command (see memory skill for details)
60
+ - If MCP tools are unavailable, use `npx ai-devkit@latest memory search` CLI command (see memory skill for details)
61
61
  - Example: Search for "authentication patterns" when implementing auth features
62
62
 
63
63
  ### When to Store Memory
@@ -68,7 +68,7 @@ The AI assistant should proactively use knowledge memory throughout all interact
68
68
 
69
69
  **How to store**:
70
70
  - Use `memory.storeKnowledge` MCP tool
71
- - If MCP tools are unavailable, use `npx ai-devkit memory store` CLI command (see memory skill for details)
71
+ - If MCP tools are unavailable, use `npx ai-devkit@latest memory store` CLI command (see memory skill for details)
72
72
  - Include clear title, detailed content, relevant tags, and appropriate scope
73
73
  - Make knowledge specific and actionable, not generic advice
74
74
 
@@ -1,3 +1,8 @@
1
+ export type GitExecFileSync = (file: string, args: readonly string[], options?: {
2
+ cwd?: string;
3
+ stdio?: 'ignore' | 'pipe';
4
+ encoding?: BufferEncoding;
5
+ }) => string | Buffer;
1
6
  /**
2
7
  * Checks if git is installed and available in PATH
3
8
  * @throws Error if git is not installed
@@ -31,4 +36,7 @@ export declare function pullRepository(repoPath: string): Promise<void>;
31
36
  * @throws Error if fetch fails or cannot parse output
32
37
  */
33
38
  export declare function fetchGitHead(gitUrl: string): Promise<string>;
39
+ export declare function isInsideGitWorkTreeSync(cwd: string, execFileSyncFn?: GitExecFileSync): boolean;
40
+ export declare function localBranchExistsSync(cwd: string, branchName: string, execFileSyncFn?: GitExecFileSync): boolean;
41
+ export declare function getWorktreePathsForBranchSync(cwd: string, branchName: string, execFileSyncFn?: GitExecFileSync): string[];
34
42
  //# sourceMappingURL=git.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/util/git.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQxD;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoB1G;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGvE;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUpE;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAalE"}
1
+ {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/util/git.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,cAAc,CAAA;CAAE,KAC7E,MAAM,GAAG,MAAM,CAAC;AAQrB;;;GAGG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQxD;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoB1G;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGvE;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUpE;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAalE;AAMD,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,GAAE,eAAqC,GAAG,OAAO,CAYnH;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,cAAc,GAAE,eAAqC,GACpD,OAAO,CAUT;AAED,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,cAAc,GAAE,eAAqC,GACpD,MAAM,EAAE,CA0CV"}
package/dist/util/git.js CHANGED
@@ -38,11 +38,15 @@ exports.cloneRepository = cloneRepository;
38
38
  exports.isGitRepository = isGitRepository;
39
39
  exports.pullRepository = pullRepository;
40
40
  exports.fetchGitHead = fetchGitHead;
41
+ exports.isInsideGitWorkTreeSync = isInsideGitWorkTreeSync;
42
+ exports.localBranchExistsSync = localBranchExistsSync;
43
+ exports.getWorktreePathsForBranchSync = getWorktreePathsForBranchSync;
41
44
  const child_process_1 = require("child_process");
42
45
  const util_1 = require("util");
43
46
  const fs = __importStar(require("fs-extra"));
44
47
  const path = __importStar(require("path"));
45
48
  const execAsync = (0, util_1.promisify)(child_process_1.exec);
49
+ const defaultExecFileSync = (file, args, options) => (0, child_process_1.execFileSync)(file, args, options);
46
50
  /**
47
51
  * Checks if git is installed and available in PATH
48
52
  * @throws Error if git is not installed
@@ -127,4 +131,69 @@ async function fetchGitHead(gitUrl) {
127
131
  throw new Error(`Failed to fetch git HEAD: ${error.message}`);
128
132
  }
129
133
  }
134
+ function normalizeExecResult(result) {
135
+ return Buffer.isBuffer(result) ? result.toString('utf8').trim() : result.trim();
136
+ }
137
+ function isInsideGitWorkTreeSync(cwd, execFileSyncFn = defaultExecFileSync) {
138
+ try {
139
+ const result = execFileSyncFn('git', ['rev-parse', '--is-inside-work-tree'], {
140
+ cwd,
141
+ stdio: 'pipe',
142
+ encoding: 'utf8'
143
+ });
144
+ return normalizeExecResult(result) === 'true';
145
+ }
146
+ catch {
147
+ return false;
148
+ }
149
+ }
150
+ function localBranchExistsSync(cwd, branchName, execFileSyncFn = defaultExecFileSync) {
151
+ try {
152
+ execFileSyncFn('git', ['show-ref', '--verify', '--quiet', `refs/heads/${branchName}`], {
153
+ cwd,
154
+ stdio: 'ignore'
155
+ });
156
+ return true;
157
+ }
158
+ catch {
159
+ return false;
160
+ }
161
+ }
162
+ function getWorktreePathsForBranchSync(cwd, branchName, execFileSyncFn = defaultExecFileSync) {
163
+ try {
164
+ const raw = execFileSyncFn('git', ['worktree', 'list', '--porcelain'], {
165
+ cwd,
166
+ stdio: 'pipe',
167
+ encoding: 'utf8'
168
+ });
169
+ const output = normalizeExecResult(raw);
170
+ const lines = output.split('\n');
171
+ const matches = [];
172
+ let currentPath = '';
173
+ let currentBranch = '';
174
+ for (const line of lines) {
175
+ if (!line.trim()) {
176
+ if (currentBranch === `refs/heads/${branchName}` && currentPath) {
177
+ matches.push(currentPath);
178
+ }
179
+ currentPath = '';
180
+ currentBranch = '';
181
+ continue;
182
+ }
183
+ if (line.startsWith('worktree ')) {
184
+ currentPath = line.slice('worktree '.length).trim();
185
+ }
186
+ if (line.startsWith('branch ')) {
187
+ currentBranch = line.slice('branch '.length).trim();
188
+ }
189
+ }
190
+ if (currentBranch === `refs/heads/${branchName}` && currentPath) {
191
+ matches.push(currentPath);
192
+ }
193
+ return matches;
194
+ }
195
+ catch {
196
+ return [];
197
+ }
198
+ }
130
199
  //# sourceMappingURL=git.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/util/git.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,gDAQC;AAUD,0CAoBC;AAOD,0CAGC;AAOD,wCAUC;AAQD,oCAaC;AAjGD,iDAAqC;AACrC,+BAAiC;AACjC,6CAA+B;AAC/B,2CAA6B;AAE7B,MAAM,SAAS,GAAG,IAAA,gBAAS,EAAC,oBAAI,CAAC,CAAC;AAElC;;;GAGG;AACI,KAAK,UAAU,kBAAkB;IACtC,IAAI,CAAC;QACH,MAAM,SAAS,CAAC,eAAe,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,eAAe,CAAC,SAAiB,EAAE,QAAgB,EAAE,MAAc;IACvF,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAEhD,IAAI,MAAM,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,OAAO,SAAS,IAAI,QAAQ,4BAA4B,CAAC,CAAC;QACtE,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,eAAe,QAAQ,8BAA8B,CAAC,CAAC;IACnE,MA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C;QAED,IAAI,aAAa,KAAK,cAAc,UAAU,EAAE,IAAI,WAAW,EAAE,CAAC;YAChE,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC5B,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-devkit",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "A CLI toolkit for AI-assisted software development with phase templates and environment setup",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -27,7 +27,7 @@
27
27
  "author": "",
28
28
  "license": "MIT",
29
29
  "dependencies": {
30
- "@ai-devkit/memory": "0.4.0",
30
+ "@ai-devkit/memory": "0.6.0",
31
31
  "chalk": "^4.1.2",
32
32
  "commander": "^11.1.0",
33
33
  "fs-extra": "^11.2.0",
@@ -1,50 +1,12 @@
1
1
  ---
2
- description: Capture structured knowledge about a code entry point and save it to the knowledge docs.
2
+ description: Document a code entry point in knowledge docs.
3
3
  ---
4
4
 
5
- # Knowledge Capture Assistant
6
-
7
5
  Guide me through creating a structured understanding of a code entry point and saving it to the knowledge docs.
8
6
 
9
- ## Step 1: Gather Context
10
- - Entry point (file, folder, function, API)
11
- - Why this entry point matters (feature, bug, investigation)
12
- - Relevant requirements/design docs (if any)
13
- - Desired depth or focus areas (logic, dependencies, data flow)
14
-
15
- ## Step 2: Validate Entry Point
16
- - Determine entry point type and confirm it exists
17
- - Surface ambiguity (multiple matches) and ask for clarification
18
- - If not found, suggest likely alternatives or spelling fixes
19
-
20
- ## Step 3: Collect Source Context
21
- - Read the primary file/module and summarize purpose, exports, key patterns
22
- - For folders: list structure, highlight key modules
23
- - For functions/APIs: capture signature, parameters, return values, error handling
24
- - Extract essential snippets (avoid large dumps)
25
-
26
- ## Step 4: Analyze Dependencies
27
- - Build a dependency view up to depth 3
28
- - Track visited nodes to avoid loops
29
- - Categorize dependencies (imports, function calls, services, external packages)
30
- - Note important external systems or generated code that should be excluded
31
-
32
- ## Step 5: Synthesize Explanation
33
- - Draft an overview (purpose, language, high-level behavior)
34
- - Detail core logic, key components, execution flow, patterns
35
- - Highlight error handling, performance, security considerations
36
- - Identify potential improvements or risks discovered during analysis
37
-
38
- ## Step 6: Create Documentation
39
- - Normalize entry point name to kebab-case (`calculateTotalPrice` → `calculate-total-price`)
40
- - Create `docs/ai/implementation/knowledge-{name}.md` using the headings implied in Step 5 (Overview, Implementation Details, Dependencies, Visual Diagrams, Additional Insights, Metadata, Next Steps)
41
- - Populate sections with findings, diagrams, and metadata (analysis date, depth, files touched)
42
- - Include mermaid diagrams when they clarify flows or relationships
43
-
44
- ## Step 7: Review & Next Actions
45
- - Summarize key insights and open questions for follow-up
46
- - Suggest related areas for deeper dives or refactors
47
- - Confirm the knowledge file path and remind to commit it
48
- - Encourage running `/capture-knowledge` again for related entry points if needed
49
-
50
- Let me know the entry point and goals when you’re ready to begin the knowledge capture.
7
+ 1. **Gather & Validate Entry Point** — If not already provided, ask for: entry point (file, folder, function, API), why it matters (feature, bug, investigation), and desired depth or focus areas. Confirm the entry point exists; if ambiguous or not found, clarify or suggest alternatives.
8
+ 2. **Collect Source Context** — Read the primary file/module and summarize purpose, exports, key patterns. For folders: list structure, highlight key modules. For functions/APIs: capture signature, parameters, return values, error handling. Extract essential snippets (avoid large dumps).
9
+ 3. **Analyze Dependencies** Build a dependency view up to depth 3, tracking visited nodes to avoid loops. Categorize: imports, function calls, services, external packages. Note external systems or generated code to exclude.
10
+ 4. **Synthesize Explanation** Draft overview (purpose, language, high-level behavior). Detail core logic, execution flow, key patterns. Highlight error handling, performance, security considerations. Identify potential improvements or risks.
11
+ 5. **Create Documentation** — Normalize name to kebab-case (`calculateTotalPrice` `calculate-total-price`). Create `docs/ai/implementation/knowledge-{name}.md` with sections: Overview, Implementation Details, Dependencies, Visual Diagrams, Additional Insights, Metadata, Next Steps. Include mermaid diagrams when they clarify flows or relationships. Add metadata (analysis date, depth, files touched).
12
+ 6. **Review & Next Actions** — Summarize key insights and open questions. Suggest related areas for deeper dives. Confirm file path and remind to commit.
@@ -2,24 +2,9 @@
2
2
  description: Compare implementation with design and requirements docs to ensure alignment.
3
3
  ---
4
4
 
5
- Compare the current implementation with the design in docs/ai/design/ and requirements in docs/ai/requirements/. Please follow this structured review:
6
-
7
- 1. Ask me for:
8
- - Feature/branch description
9
- - List of modified files
10
- - Relevant design doc(s) (feature-specific and/or project-level)
11
- - Any known constraints or assumptions
12
-
13
- 2. For each design doc:
14
- - Summarize key architectural decisions and constraints
15
- - Highlight components, interfaces, and data flows that must be respected
16
-
17
- 3. File-by-file comparison:
18
- - Confirm implementation matches design intent
19
- - Note deviations or missing pieces
20
- - Flag logic gaps, edge cases, or security issues
21
- - Suggest simplifications or refactors
22
- - Identify missing tests or documentation updates
5
+ Compare the current implementation with the design in docs/ai/design/ and requirements in docs/ai/requirements/.
23
6
 
7
+ 1. If not already provided, ask for: feature/branch description, list of modified files, relevant design doc(s), and any known constraints or assumptions.
8
+ 2. For each design doc: summarize key architectural decisions and constraints, highlight components, interfaces, and data flows that must be respected.
9
+ 3. File-by-file comparison: confirm implementation matches design intent, note deviations or missing pieces, flag logic gaps, edge cases, or security issues, suggest simplifications or refactors, and identify missing tests or documentation updates.
24
10
  4. Summarize findings with recommended next steps.
25
-
@@ -1,85 +1,11 @@
1
1
  ---
2
- description: Perform a local code review before pushing changes, ensuring alignment with design docs and best practices.
2
+ description: Pre-push code review against design docs.
3
3
  ---
4
4
 
5
- # Local Code Review Assistant
5
+ Perform a local code review **before** pushing changes.
6
6
 
7
- You are helping me perform a local code review **before** I push changes. Please follow this structured workflow.
8
-
9
- ## Step 1: Gather Context
10
- Ask me for:
11
- - Brief feature/branch description
12
- - List of modified files (with optional summaries)
13
- - Relevant design doc(s) (e.g., `docs/ai/design/feature-{name}.md` or project-level design)
14
- - Any known constraints or risky areas
15
- - Any open bugs or TODOs linked to this work
16
- - Which tests have already been run
17
-
18
- If possible, request the latest diff:
19
- ```bash
20
- git status -sb
21
- git diff --stat
22
- ```
23
-
24
- ## Step 2: Understand Design Alignment
25
- For each provided design doc:
26
- - Summarize the architectural intent
27
- - Note critical requirements, patterns, or constraints the design mandates
28
-
29
- ## Step 3: File-by-File Review
30
- For every modified file:
31
- 1. Highlight deviations from the referenced design or requirements
32
- 2. Spot potential logic or flow issues and edge cases
33
- 3. Identify redundant or duplicate code
34
- 4. Suggest simplifications or refactors (prefer clarity over cleverness)
35
- 5. Flag security concerns (input validation, secrets, auth, data handling)
36
- 6. Check for performance pitfalls or scalability risks
37
- 7. Ensure error handling, logging, and observability are appropriate
38
- 8. Note any missing comments or docs
39
- 9. Flag missing or outdated tests related to this file
40
-
41
- ## Step 4: Cross-Cutting Concerns
42
- - Verify naming consistency and adherence to project conventions
43
- - Confirm documentation/comments are updated where the behavior changed
44
- - Identify missing tests (unit, integration, E2E) needed to cover the changes
45
- - Ensure configuration/migration updates are captured if applicable
46
-
47
- ## Step 5: Summarize Findings
48
- Provide results in this structure:
49
- ```
50
- ### Summary
51
- - Blocking issues: [count]
52
- - Important follow-ups: [count]
53
- - Nice-to-have improvements: [count]
54
-
55
- ### Detailed Notes
56
- 1. **[File or Component]**
57
- - Issue/Observation: ...
58
- - Impact: (e.g., blocking / important / nice-to-have)
59
- - Recommendation: ...
60
- - Design reference: [...]
61
-
62
- 2. ... (repeat per finding)
63
-
64
- ### Recommended Next Steps
65
- - [ ] Address blocking issues
66
- - [ ] Update design/implementation docs if needed
67
- - [ ] Add/adjust tests:
68
- - Unit:
69
- - Integration:
70
- - E2E:
71
- - [ ] Rerun local test suite
72
- - [ ] Re-run code review command after fixes
73
- ```
74
-
75
- ## Step 6: Final Checklist
76
- Confirm whether each item is complete (yes/no/needs follow-up):
77
- - Implementation matches design & requirements
78
- - No obvious logic or edge-case gaps remain
79
- - Redundant code removed or justified
80
- - Security considerations addressed
81
- - Tests cover new/changed behavior
82
- - Documentation/design notes updated
83
-
84
- ---
85
- Let me know when you're ready to begin the review.
7
+ 1. **Gather Context** If not already provided, ask for: feature/branch description, list of modified files, relevant design doc(s) (e.g., `docs/ai/design/feature-{name}.md`), known constraints or risky areas, and which tests have been run. Also review the latest diff via `git status` and `git diff --stat`.
8
+ 2. **Understand Design Alignment** — For each design doc, summarize architectural intent and critical constraints.
9
+ 3. **File-by-File Review** — For every modified file: check alignment with design/requirements and flag deviations, spot logic issues/edge cases/redundant code, flag security concerns (input validation, secrets, auth, data handling), check error handling/performance/observability, and identify missing or outdated tests.
10
+ 4. **Cross-Cutting Concerns** — Verify naming consistency and project conventions. Confirm docs/comments updated where behavior changed. Identify missing tests (unit, integration, E2E). Check for needed configuration/migration updates.
11
+ 5. **Summarize Findings** — Categorize each finding as **blocking**, **important**, or **nice-to-have** with: file, issue, impact, recommendation, and design reference.
@@ -1,49 +1,11 @@
1
1
  ---
2
- description: Guide me through debugging a code issue by clarifying expectations, identifying gaps, and agreeing on a fix plan before changing code.
2
+ description: Debug an issue with structured root-cause analysis before changing code.
3
3
  ---
4
4
 
5
- # Local Debugging Assistant
6
-
7
- Help me debug an issue by clarifying expectations, identifying gaps, and agreeing on a fix plan before changing code.
8
-
9
- ## Step 1: Gather Context
10
- Ask me for:
11
- - Brief issue description (what is happening?)
12
- - Expected behavior or acceptance criteria (what should happen?)
13
- - Current behavior and any error messages/logs
14
- - Recent related changes or deployments
15
- - Scope of impact (users, services, environments)
16
-
17
- ## Step 2: Clarify Reality vs Expectation
18
- - Restate the observed behavior vs the expected outcome
19
- - Confirm relevant requirements, tickets, or docs that define the expectation
20
- - Identify acceptance criteria for the fix (how we know it is resolved)
21
-
22
- ## Step 3: Reproduce & Isolate
23
- - Determine reproducibility (always, intermittent, environment-specific)
24
- - Capture reproduction steps or commands
25
- - Note any available tests that expose the failure
26
- - List suspected components, services, or modules
27
-
28
- ## Step 4: Analyze Potential Causes
29
- - Brainstorm plausible root causes (data, config, code regressions, external dependencies)
30
- - Gather supporting evidence (logs, metrics, traces, screenshots)
31
- - Highlight gaps or unknowns that need investigation
32
-
33
- ## Step 5: Surface Options
34
- - Present possible resolution paths (quick fix, deeper refactor, rollback, feature flag, etc.)
35
- - For each option, list pros/cons, risks, and verification steps
36
- - Consider required approvals or coordination
37
-
38
- ## Step 6: Confirm Path Forward
39
- - Ask which option we should pursue
40
- - Summarize chosen approach, required pre-work, and success criteria
41
- - Plan validation steps (tests, monitoring, user sign-off)
42
-
43
- ## Step 7: Next Actions & Tracking
44
- - Document tasks, owners, and timelines for the selected option
45
- - Note follow-up actions after deployment (monitoring, comms, postmortem if needed)
46
- - Encourage updating relevant docs/tests once resolved
47
-
48
- Let me know when you're ready to walk through the debugging flow.
5
+ Help me debug an issue. Clarify expectations, identify gaps, and agree on a fix plan before changing code.
49
6
 
7
+ 1. **Gather Context** — If not already provided, ask for: issue description (what is happening vs what should happen), error messages/logs/screenshots, recent related changes or deployments, and scope of impact.
8
+ 2. **Clarify Reality vs Expectation** — Restate observed vs expected behavior. Confirm relevant requirements or docs that define the expectation. Define acceptance criteria for the fix.
9
+ 3. **Reproduce & Isolate** — Determine reproducibility (always, intermittent, environment-specific). Capture reproduction steps. List suspected components or modules.
10
+ 4. **Analyze Potential Causes** — Brainstorm root causes (data, config, code regressions, external dependencies). Gather supporting evidence (logs, metrics, traces). Highlight unknowns needing investigation.
11
+ 5. **Resolve** — Present resolution options (quick fix, refactor, rollback, etc.) with pros/cons and risks. Ask which option to pursue. Summarize chosen approach, pre-work, success criteria, and validation steps.
@@ -1,75 +1,11 @@
1
1
  ---
2
- description: Execute a feature plan interactively, guiding me through each task while referencing relevant docs and updating status.
2
+ description: Execute a feature plan task by task.
3
3
  ---
4
4
 
5
- # Feature Plan Execution Assistant
6
-
7
5
  Help me work through a feature plan one task at a time.
8
6
 
9
- ## Step 1: Gather Context
10
- Ask me for:
11
- - Feature name (kebab-case, e.g., `user-authentication`)
12
- - Brief feature/branch description
13
- - Relevant planning doc path (default `docs/ai/planning/feature-{name}.md`)
14
- - Any supporting design/implementation docs (design, requirements, implementation)
15
- - Current branch and latest diff summary (`git status -sb`, `git diff --stat`)
16
-
17
- ## Step 2: Load the Plan
18
- - Request the planning doc contents or offer commands like:
19
- ```bash
20
- cat docs/ai/planning/feature-<name>.md
21
- ```
22
- - Parse sections that represent task lists (look for headings + checkboxes `[ ]`, `[x]`).
23
- - Build an ordered queue of tasks grouped by section (e.g., Foundation, Core Features, Testing).
24
-
25
- ## Step 3: Present Task Queue
26
- Show an overview:
27
- ```
28
- ### Task Queue: <Feature Name>
29
- 1. [status] Section • Task title
30
- 2. ...
31
- ```
32
- Status legend: `todo`, `in-progress`, `done`, `blocked` (based on checkbox/notes if present).
33
-
34
- ## Step 4: Interactive Task Execution
35
- For each task in order:
36
- 1. Display the section/context, full bullet text, and any existing notes.
37
- 2. Suggest relevant docs to reference (requirements/design/implementation).
38
- 3. Ask: "Plan for this task?" Offer to outline sub-steps using the design doc.
39
- 4. Prompt to mark status (`done`, `in-progress`, `blocked`, `skipped`) and capture short notes/next steps.
40
- 5. Encourage code/document edits inside Cursor; offer commands/snippets when useful.
41
- 6. If blocked, record blocker info and move task to the end or into a "Blocked" list.
42
-
43
- ## Step 5: Update Planning Doc
44
- After each status change, generate a Markdown snippet the user can paste back into the planning doc, e.g.:
45
- ```
46
- - [x] Task: Implement auth service (Notes: finished POST /auth/login, tests added)
47
- ```
48
- Remind the user to keep the source doc updated.
49
-
50
- ## Step 6: Check for Newly Discovered Work
51
- After each section, ask if new tasks were discovered. If yes, capture them in a "New Work" list with status `todo` and include in the summary.
52
-
53
- ## Step 7: Session Summary
54
- Produce a summary table:
55
- ```
56
- ### Execution Summary
57
- - Completed: (list)
58
- - In Progress: (list + owners/next steps)
59
- - Blocked: (list + blockers)
60
- - Skipped / Deferred: (list + rationale)
61
- - New Tasks: (list)
62
- ```
63
-
64
- ## Step 8: Next Actions
65
- Remind the user to:
66
- - Update `docs/ai/planning/feature-{name}.md` with the new statuses
67
- - Sync related docs (requirements/design/implementation/testing) if decisions changed
68
- - Run `/check-implementation` to validate changes against design docs
69
- - Run `/writing-test` to produce unit/integration tests targeting 100% coverage
70
- - Run `/update-planning` to reconcile the planning doc with the latest status
71
- - Run `/code-review` when ready for final review
72
- - Run test suites relevant to completed tasks
73
-
74
- ---
75
- Let me know when you're ready to start executing the plan. Provide the feature name and planning doc first.
7
+ 1. **Gather Context** — If not already provided, ask for: feature name (kebab-case, e.g., `user-authentication`), brief feature/branch description, planning doc path (default `docs/ai/planning/feature-{name}.md`), and any supporting docs (design, requirements, implementation).
8
+ 2. **Load & Present Plan** — Read the planning doc and parse task lists (headings + checkboxes). Present an ordered task queue grouped by section, with status: `todo`, `in-progress`, `done`, `blocked`.
9
+ 3. **Interactive Task Execution** — For each task in order: display context and full bullet text, reference relevant design/requirements docs, offer to outline sub-steps before starting, prompt for status update (`done`, `in-progress`, `blocked`, `skipped`) with short notes after work, and if blocked record blocker and move to a "Blocked" list.
10
+ 4. **Update Planning Doc** — After each status change, generate a markdown snippet to paste back into the planning doc. After each section, ask if new tasks were discovered.
11
+ 5. **Session Summary** Produce a summary: Completed, In Progress (with next steps), Blocked (with blockers), Skipped/Deferred, and New Tasks. Remind to update `docs/ai/planning/feature-{name}.md` and sync related docs if decisions changed.