ai-devkit 0.12.0 → 0.13.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.
- package/README.md +49 -198
- package/dist/cli.js +8 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +111 -12
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/lint.d.ts +4 -0
- package/dist/commands/lint.d.ts.map +1 -0
- package/dist/commands/lint.js +53 -0
- package/dist/commands/lint.js.map +1 -0
- package/dist/commands/memory.d.ts.map +1 -1
- package/dist/commands/memory.js +19 -0
- package/dist/commands/memory.js.map +1 -1
- package/dist/lib/InitTemplate.d.ts +13 -0
- package/dist/lib/InitTemplate.d.ts.map +1 -0
- package/dist/lib/InitTemplate.js +169 -0
- package/dist/lib/InitTemplate.js.map +1 -0
- package/dist/lib/SkillManager.d.ts.map +1 -1
- package/dist/lib/SkillManager.js +9 -0
- package/dist/lib/SkillManager.js.map +1 -1
- package/dist/services/lint/constants.d.ts +14 -0
- package/dist/services/lint/constants.d.ts.map +1 -0
- package/dist/services/lint/constants.js +17 -0
- package/dist/services/lint/constants.js.map +1 -0
- package/dist/services/lint/lint.service.d.ts +6 -0
- package/dist/services/lint/lint.service.d.ts.map +1 -0
- package/dist/services/lint/lint.service.js +100 -0
- package/dist/services/lint/lint.service.js.map +1 -0
- package/dist/services/lint/rules/base-docs.rule.d.ts +3 -0
- package/dist/services/lint/rules/base-docs.rule.d.ts.map +1 -0
- package/dist/services/lint/rules/base-docs.rule.js +17 -0
- package/dist/services/lint/rules/base-docs.rule.js.map +1 -0
- package/dist/services/lint/rules/check-factories.d.ts +5 -0
- package/dist/services/lint/rules/check-factories.d.ts.map +1 -0
- package/dist/services/lint/rules/check-factories.js +36 -0
- package/dist/services/lint/rules/check-factories.js.map +1 -0
- package/dist/services/lint/rules/feature-docs.rule.d.ts +3 -0
- package/dist/services/lint/rules/feature-docs.rule.d.ts.map +1 -0
- package/dist/services/lint/rules/feature-docs.rule.js +16 -0
- package/dist/services/lint/rules/feature-docs.rule.js.map +1 -0
- package/dist/services/lint/rules/feature-name.rule.d.ts +7 -0
- package/dist/services/lint/rules/feature-name.rule.d.ts.map +1 -0
- package/dist/services/lint/rules/feature-name.rule.js +26 -0
- package/dist/services/lint/rules/feature-name.rule.js.map +1 -0
- package/dist/services/lint/rules/git-worktree.rule.d.ts +3 -0
- package/dist/services/lint/rules/git-worktree.rule.d.ts.map +1 -0
- package/dist/services/lint/rules/git-worktree.rule.js +26 -0
- package/dist/services/lint/rules/git-worktree.rule.js.map +1 -0
- package/dist/services/lint/rules/phase-docs.rule.d.ts +13 -0
- package/dist/services/lint/rules/phase-docs.rule.d.ts.map +1 -0
- package/dist/services/lint/rules/phase-docs.rule.js +54 -0
- package/dist/services/lint/rules/phase-docs.rule.js.map +1 -0
- package/dist/services/lint/types.d.ts +39 -0
- package/dist/services/lint/types.d.ts.map +1 -0
- package/dist/services/lint/types.js +3 -0
- package/dist/services/lint/types.js.map +1 -0
- package/dist/templates/commands/capture-knowledge.md +7 -45
- package/dist/templates/commands/check-implementation.md +4 -19
- package/dist/templates/commands/code-review.md +7 -81
- package/dist/templates/commands/debug.md +7 -45
- package/dist/templates/commands/execute-plan.md +6 -70
- package/dist/templates/commands/new-requirement.md +15 -128
- package/dist/templates/commands/remember.md +4 -21
- package/dist/templates/commands/review-design.md +1 -2
- package/dist/templates/commands/review-requirements.md +2 -3
- package/dist/templates/commands/simplify-implementation.md +6 -144
- package/dist/templates/commands/update-planning.md +6 -61
- package/dist/templates/commands/writing-test.md +6 -42
- package/dist/templates/templates/commands/capture-knowledge.md +7 -45
- package/dist/templates/templates/commands/check-implementation.md +4 -19
- package/dist/templates/templates/commands/code-review.md +7 -81
- package/dist/templates/templates/commands/debug.md +7 -45
- package/dist/templates/templates/commands/execute-plan.md +6 -70
- package/dist/templates/templates/commands/new-requirement.md +15 -128
- package/dist/templates/templates/commands/remember.md +4 -21
- package/dist/templates/templates/commands/review-design.md +1 -2
- package/dist/templates/templates/commands/review-requirements.md +2 -3
- package/dist/templates/templates/commands/simplify-implementation.md +6 -144
- package/dist/templates/templates/commands/update-planning.md +6 -61
- package/dist/templates/templates/commands/writing-test.md +6 -42
- package/dist/util/git.d.ts +8 -0
- package/dist/util/git.d.ts.map +1 -1
- package/dist/util/git.js +69 -0
- package/dist/util/git.js.map +1 -1
- package/package.json +2 -2
- package/templates/commands/capture-knowledge.md +7 -45
- package/templates/commands/check-implementation.md +4 -19
- package/templates/commands/code-review.md +7 -81
- package/templates/commands/debug.md +7 -45
- package/templates/commands/execute-plan.md +6 -70
- package/templates/commands/new-requirement.md +15 -128
- package/templates/commands/remember.md +4 -21
- package/templates/commands/review-design.md +1 -2
- package/templates/commands/review-requirements.md +2 -3
- package/templates/commands/simplify-implementation.md +6 -144
- package/templates/commands/update-planning.md +6 -61
- package/templates/commands/writing-test.md +6 -42
|
@@ -1,85 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Pre-push code review against design docs.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Perform a local code review **before** pushing changes.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
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:
|
|
2
|
+
description: Debug an issue with structured root-cause analysis before changing code.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
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
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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.
|
|
@@ -1,131 +1,18 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Scaffold feature documentation from requirements through planning.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- Start from `docs/ai/implementation/README.md` → save as `docs/ai/implementation/feature-{name}.md`
|
|
20
|
-
- Start from `docs/ai/testing/README.md` → save as `docs/ai/testing/feature-{name}.md`
|
|
21
|
-
|
|
22
|
-
Ensure the YAML frontmatter and section headings remain identical to the templates before filling in feature-specific content.
|
|
23
|
-
|
|
24
|
-
## Step 3: Requirements Phase
|
|
25
|
-
Help me fill out `docs/ai/requirements/feature-{name}.md`:
|
|
26
|
-
- Clarify the problem statement
|
|
27
|
-
- Define goals and non-goals
|
|
28
|
-
- Write detailed user stories
|
|
29
|
-
- Establish success criteria
|
|
30
|
-
- Identify constraints and assumptions
|
|
31
|
-
- List open questions
|
|
32
|
-
|
|
33
|
-
## Step 4: Design Phase
|
|
34
|
-
Guide me through `docs/ai/design/feature-{name}.md`:
|
|
35
|
-
- Propose system architecture changes needed
|
|
36
|
-
- Define data models/schema changes
|
|
37
|
-
- Design API endpoints or interfaces
|
|
38
|
-
- Identify components to create/modify
|
|
39
|
-
- Document key design decisions
|
|
40
|
-
- Note security and performance considerations
|
|
41
|
-
|
|
42
|
-
## Step 5: Planning Phase
|
|
43
|
-
Help me break down work in `docs/ai/planning/feature-{name}.md`:
|
|
44
|
-
- Create task breakdown with subtasks
|
|
45
|
-
- Identify dependencies (on other features, APIs, etc.)
|
|
46
|
-
- Estimate effort for each task
|
|
47
|
-
- Suggest implementation order
|
|
48
|
-
- Identify risks and mitigation strategies
|
|
49
|
-
|
|
50
|
-
## Step 6: Documentation Review (Chained Commands)
|
|
51
|
-
Once the docs above are drafted, run the following commands to tighten them up:
|
|
52
|
-
- `/review-requirements` to validate the requirements doc for completeness and clarity
|
|
53
|
-
- `/review-design` to ensure the design doc aligns with requirements and highlights key decisions
|
|
54
|
-
|
|
55
|
-
(If you are using Claude Code, reference the `review-requirements` and `review-design` commands instead.)
|
|
56
|
-
|
|
57
|
-
## Step 7: Implementation Phase (Deferred)
|
|
58
|
-
This command focuses on documentation only. Actual implementation happens later via `/execute-plan`.
|
|
59
|
-
For each task in the plan:
|
|
60
|
-
1. Review the task requirements and design
|
|
61
|
-
2. Ask me to confirm I'm starting this task
|
|
62
|
-
3. Guide implementation with reference to design docs
|
|
63
|
-
4. Suggest code structure and patterns
|
|
64
|
-
5. Help with error handling and edge cases
|
|
65
|
-
6. Update `docs/ai/implementation/feature-{name}.md` with notes
|
|
66
|
-
|
|
67
|
-
## Step 8: Testing Phase
|
|
68
|
-
Guide testing in `docs/ai/testing/feature-{name}.md`:
|
|
69
|
-
- Draft unit test cases with `/writing-test`
|
|
70
|
-
- Draft integration test scenarios with `/writing-test`
|
|
71
|
-
- Recommend manual testing steps
|
|
72
|
-
- Help write test code
|
|
73
|
-
- Verify all success criteria are testable
|
|
74
|
-
|
|
75
|
-
## Step 9: Local Testing & Verification
|
|
76
|
-
Guide me through:
|
|
77
|
-
1. Running all tests locally
|
|
78
|
-
2. Manual testing checklist
|
|
79
|
-
3. Reviewing against requirements
|
|
80
|
-
4. Checking design compliance
|
|
81
|
-
5. Preparing for code review (diff summary, list of files, design references)
|
|
82
|
-
|
|
83
|
-
## Step 10: Local Code Review (Optional but recommended)
|
|
84
|
-
Before pushing, ask me to run `/code-review` with the modified file list and relevant docs.
|
|
85
|
-
|
|
86
|
-
## Step 11: Implementation Execution Reminder
|
|
87
|
-
When ready to implement, run `/execute-plan` to work through the planning doc tasks interactively. That command will orchestrate implementation, testing, and follow-up documentation.
|
|
88
|
-
|
|
89
|
-
## Step 12: Create Merge/Pull Request
|
|
90
|
-
Provide the MR/PR description:
|
|
91
|
-
```markdown
|
|
92
|
-
## Feature: [Feature Name]
|
|
93
|
-
|
|
94
|
-
### Summary
|
|
95
|
-
[Brief description of what this feature does]
|
|
96
|
-
|
|
97
|
-
### Requirements
|
|
98
|
-
- Documented in: `docs/ai/requirements/feature-{name}.md`
|
|
99
|
-
- Related to: [issue/ticket number if applicable]
|
|
100
|
-
|
|
101
|
-
### Changes
|
|
102
|
-
- [List key changes]
|
|
103
|
-
- [List new files/components]
|
|
104
|
-
- [List modified files]
|
|
105
|
-
|
|
106
|
-
### Design
|
|
107
|
-
- Architecture: [Link to design doc section]
|
|
108
|
-
- Key decisions: [Brief summary]
|
|
109
|
-
|
|
110
|
-
### Testing
|
|
111
|
-
- Unit tests: [coverage/status]
|
|
112
|
-
- Integration tests: [status]
|
|
113
|
-
- Manual testing: Completed
|
|
114
|
-
- Test documentation: `docs/ai/testing/feature-{name}.md`
|
|
115
|
-
|
|
116
|
-
### Checklist
|
|
117
|
-
- [ ] Code follows project standards
|
|
118
|
-
- [ ] All tests pass
|
|
119
|
-
- [ ] Documentation updated
|
|
120
|
-
- [ ] No breaking changes (or documented if any)
|
|
121
|
-
- [ ] Ready for review
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
Then provide the appropriate command:
|
|
125
|
-
- **GitHub**: `gh pr create --title "feat: [feature-name]" --body-file pr-description.md`
|
|
126
|
-
- **GitLab**: `glab mr create --title "feat: [feature-name]" --description "$(cat mr-description.md)"`
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
**Let's start! Tell me about the feature you want to build.**
|
|
131
|
-
|
|
5
|
+
Guide me through adding a new feature, from requirements documentation to implementation readiness.
|
|
6
|
+
|
|
7
|
+
1. **Capture Requirement** — If not already provided, ask for: feature name (kebab-case, e.g., `user-authentication`), what problem it solves and who will use it, and key user stories.
|
|
8
|
+
2. **Create Feature Documentation Structure** — Copy each template's content (preserving YAML frontmatter and section headings) into feature-specific files:
|
|
9
|
+
- `docs/ai/requirements/README.md` → `docs/ai/requirements/feature-{name}.md`
|
|
10
|
+
- `docs/ai/design/README.md` → `docs/ai/design/feature-{name}.md`
|
|
11
|
+
- `docs/ai/planning/README.md` → `docs/ai/planning/feature-{name}.md`
|
|
12
|
+
- `docs/ai/implementation/README.md` → `docs/ai/implementation/feature-{name}.md`
|
|
13
|
+
- `docs/ai/testing/README.md` → `docs/ai/testing/feature-{name}.md`
|
|
14
|
+
3. **Requirements Phase** — Fill out `docs/ai/requirements/feature-{name}.md`: problem statement, goals/non-goals, user stories, success criteria, constraints, open questions.
|
|
15
|
+
4. **Design Phase** — Fill out `docs/ai/design/feature-{name}.md`: architecture changes, data models, API/interfaces, components, design decisions, security and performance considerations.
|
|
16
|
+
5. **Planning Phase** — Fill out `docs/ai/planning/feature-{name}.md`: task breakdown with subtasks, dependencies, effort estimates, implementation order, risks.
|
|
17
|
+
6. **Documentation Review** — Run `/review-requirements` and `/review-design` to validate the drafted docs.
|
|
18
|
+
7. **Next Steps** — This command focuses on documentation. When ready to implement, use `/execute-plan`. Generate a PR description covering: summary, requirements doc link, key changes, test status, and a readiness checklist.
|
|
@@ -2,26 +2,9 @@
|
|
|
2
2
|
description: Store reusable guidance in the knowledge memory service.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# Remember Knowledge
|
|
6
|
-
|
|
7
5
|
When I say "remember this" or want to save a reusable rule, help me store it in the knowledge memory service.
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- Optional tags (keywords like "api", "testing")
|
|
14
|
-
- Optional scope (`global`, `project:<name>`, `repo:<name>`)
|
|
15
|
-
|
|
16
|
-
If I'm vague, ask follow-ups to make it specific and actionable.
|
|
17
|
-
|
|
18
|
-
## Step 2: Validate Quality
|
|
19
|
-
- Ensure it is specific and reusable (not generic advice).
|
|
20
|
-
- Avoid storing secrets or sensitive data.
|
|
21
|
-
|
|
22
|
-
## Step 3: Store
|
|
23
|
-
Call `memory.storeKnowledge` with title, content, tags, scope.
|
|
24
|
-
If MCP tools are unavailable, use `npx ai-devkit memory store` instead.
|
|
25
|
-
|
|
26
|
-
## Step 4: Confirm
|
|
27
|
-
Summarize what was saved and offer to store more knowledge if needed.
|
|
7
|
+
1. **Capture Knowledge** — If not already provided, ask for: a short explicit title (5-12 words), detailed content (markdown, examples encouraged), optional tags (keywords like "api", "testing"), and optional scope (`global`, `project:<name>`, `repo:<name>`). If vague, ask follow-ups to make it specific and actionable.
|
|
8
|
+
2. **Validate Quality** — Ensure it is specific and reusable (not generic advice). Avoid storing secrets or sensitive data.
|
|
9
|
+
3. **Store** — Call `memory.storeKnowledge` with title, content, tags, scope. If MCP tools are unavailable, use `npx ai-devkit memory store` instead.
|
|
10
|
+
4. **Confirm** — Summarize what was saved and offer to store more knowledge if needed.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Review
|
|
2
|
+
description: Review feature design for completeness.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
Review the design documentation in docs/ai/design/feature-{name}.md (and the project-level README if relevant). Summarize:
|
|
@@ -13,4 +13,3 @@ Review the design documentation in docs/ai/design/feature-{name}.md (and the pro
|
|
|
13
13
|
- Non-functional requirements that must be preserved
|
|
14
14
|
|
|
15
15
|
Highlight any inconsistencies, missing sections, or diagrams that need updates.
|
|
16
|
-
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Review
|
|
2
|
+
description: Review feature requirements for completeness.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Review `docs/ai/requirements/feature-{name}.md` and the project-level template `docs/ai/requirements/README.md` to ensure structure and content alignment. Summarize:
|
|
6
6
|
|
|
7
7
|
- Core problem statement and affected users
|
|
8
8
|
- Goals, non-goals, and success criteria
|
|
@@ -11,4 +11,3 @@ Please review `docs/ai/requirements/feature-{name}.md` and the project-level tem
|
|
|
11
11
|
- Any missing sections or deviations from the template
|
|
12
12
|
|
|
13
13
|
Identify gaps or contradictions and suggest clarifications.
|
|
14
|
-
|
|
@@ -1,148 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Simplify existing code to reduce complexity.
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Help me simplify an existing implementation while maintaining or improving its functionality.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- Target file(s) or component(s) to simplify
|
|
12
|
-
- Current pain points (hard to understand, maintain, or extend?)
|
|
13
|
-
- Performance or scalability concerns
|
|
14
|
-
- Any constraints (backward compatibility, API stability, deadlines)
|
|
15
|
-
- Relevant design docs or requirements
|
|
16
|
-
|
|
17
|
-
If available, request the current implementation:
|
|
18
|
-
```bash
|
|
19
|
-
# For a specific file
|
|
20
|
-
cat <file_path>
|
|
21
|
-
|
|
22
|
-
# For recent changes
|
|
23
|
-
git diff HEAD~5 --stat
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Step 2: Analyze Current Complexity
|
|
27
|
-
For each target file or component:
|
|
28
|
-
1. **Identify complexity sources:**
|
|
29
|
-
- Deep nesting or long functions
|
|
30
|
-
- Duplicate or redundant code
|
|
31
|
-
- Unclear abstractions or leaky interfaces
|
|
32
|
-
- Tightly coupled components
|
|
33
|
-
- Over-engineering or premature optimization
|
|
34
|
-
- Magic numbers, hardcoded values, or scattered configuration
|
|
35
|
-
|
|
36
|
-
2. **Measure impact:**
|
|
37
|
-
- Lines of code that could be reduced
|
|
38
|
-
- Number of dependencies that could be removed
|
|
39
|
-
- Cognitive load for future maintainers
|
|
40
|
-
|
|
41
|
-
3. **Assess scalability blockers:**
|
|
42
|
-
- Single points of failure
|
|
43
|
-
- Synchronous operations that should be async
|
|
44
|
-
- Missing caching or memoization opportunities
|
|
45
|
-
- Inefficient data structures or algorithms
|
|
46
|
-
|
|
47
|
-
## Step 3: Apply Readability Principles
|
|
48
|
-
|
|
49
|
-
**Core Philosophy: Good code reads like a good book — naturally, from left to right, top to bottom.**
|
|
50
|
-
|
|
51
|
-
When simplifying, prioritize readability over brevity. The goal is not to write the shortest code, but to write code that communicates intent clearly.
|
|
52
|
-
|
|
53
|
-
### ✅ DO: Embrace Readability
|
|
54
|
-
- **Linear flow:** Code should tell a story. A reader should understand the logic by reading top-to-bottom without jumping around.
|
|
55
|
-
- **Explicit over implicit:** Favor clear, explicit code over clever shortcuts that require mental decoding.
|
|
56
|
-
- **Meaningful names:** Variables, functions, and classes should describe their purpose without needing comments.
|
|
57
|
-
- **Consistent patterns:** Use the same patterns throughout the codebase so readers build familiarity.
|
|
58
|
-
- **Appropriate abstraction level:** Each function should operate at one level of abstraction.
|
|
59
|
-
- **White space and grouping:** Use blank lines to separate logical blocks, like paragraphs in prose.
|
|
60
|
-
|
|
61
|
-
### ❌ AVOID: Over-Optimization for Brevity
|
|
62
|
-
Reducing line count is NOT the goal. These patterns often harm readability:
|
|
63
|
-
|
|
64
|
-
| Anti-Pattern | Problem | Better Alternative |
|
|
65
|
-
|--------------|---------|--------------------|
|
|
66
|
-
| **Nested ternaries** | `a ? b ? c : d : e` is cryptic | Use explicit if/else blocks |
|
|
67
|
-
| **Chained one-liners** | `x.map().filter().reduce().flat()` is hard to debug | Break into named intermediate steps |
|
|
68
|
-
| **Clever bitwise tricks** | `n & 1` instead of `n % 2 === 1` obscures intent | Use readable arithmetic unless performance-critical |
|
|
69
|
-
| **Overly short variable names** | `const x = getData(); const y = x.filter(z => z.a);` | Use descriptive names like `users`, `activeUsers` |
|
|
70
|
-
| **Implicit returns everywhere** | Arrow functions without braces hide complexity | Add braces and explicit returns for complex logic |
|
|
71
|
-
| **Magic one-liners** | Regex or reduce expressions that "do everything" | Split into documented steps |
|
|
72
|
-
| **Premature DRY** | Forcing abstraction to avoid 2-3 lines of duplication | Some duplication is clearer than wrong abstraction |
|
|
73
|
-
|
|
74
|
-
### 📖 The "Reading Test"
|
|
75
|
-
For each simplification, ask:
|
|
76
|
-
1. Can a new team member understand this in under 30 seconds?
|
|
77
|
-
2. Does the code flow naturally without needing to jump to other files?
|
|
78
|
-
3. Are there any "wait, what does this do?" moments?
|
|
79
|
-
4. Would this code still be clear 6 months from now?
|
|
80
|
-
|
|
81
|
-
If the answer is "no" to any of these, the code needs more clarity, not more optimization.
|
|
82
|
-
|
|
83
|
-
## Step 4: Propose Simplifications
|
|
84
|
-
For each identified issue, suggest concrete improvements:
|
|
85
|
-
|
|
86
|
-
| Category | Pattern |
|
|
87
|
-
|----------|---------|
|
|
88
|
-
| **Extract** | Long functions → smaller, focused functions |
|
|
89
|
-
| **Consolidate** | Duplicate code → shared utilities or base classes |
|
|
90
|
-
| **Flatten** | Deep nesting → early returns, guard clauses |
|
|
91
|
-
| **Decouple** | Tight coupling → dependency injection, interfaces |
|
|
92
|
-
| **Remove** | Dead code, unused features, excessive abstractions |
|
|
93
|
-
| **Replace** | Complex logic → built-in language/library features |
|
|
94
|
-
| **Defer** | Premature optimization → measure-first approach |
|
|
95
|
-
|
|
96
|
-
## Step 5: Prioritize Changes
|
|
97
|
-
Rank suggestions by:
|
|
98
|
-
1. **High impact, low risk** — Do first
|
|
99
|
-
2. **High impact, higher risk** — Plan carefully
|
|
100
|
-
3. **Low impact, low risk** — Quick wins if time permits
|
|
101
|
-
4. **Low impact, high risk** — Skip or defer
|
|
102
|
-
|
|
103
|
-
For each change, specify:
|
|
104
|
-
- Before/after code snippets
|
|
105
|
-
- Risk level (breaking change? needs migration?)
|
|
106
|
-
- Testing requirements
|
|
107
|
-
- Estimated effort
|
|
108
|
-
|
|
109
|
-
## Step 6: Create Simplification Plan
|
|
110
|
-
Provide a structured action plan:
|
|
111
|
-
|
|
112
|
-
```
|
|
113
|
-
### Simplification Summary
|
|
114
|
-
- Total suggestions: [count]
|
|
115
|
-
- Estimated LOC reduction: [estimate]
|
|
116
|
-
- Complexity score before/after: [if measurable]
|
|
117
|
-
|
|
118
|
-
### Prioritized Actions
|
|
119
|
-
1. **[Component/Function Name]**
|
|
120
|
-
- Issue: ...
|
|
121
|
-
- Solution: ...
|
|
122
|
-
- Risk: Low/Medium/High
|
|
123
|
-
- Effort: S/M/L
|
|
124
|
-
|
|
125
|
-
2. ... (repeat)
|
|
126
|
-
|
|
127
|
-
### Recommended Order
|
|
128
|
-
1. [ ] [First change - safest, unlocks others]
|
|
129
|
-
2. [ ] [Second change]
|
|
130
|
-
3. [ ] ...
|
|
131
|
-
|
|
132
|
-
### Post-Simplification Checklist
|
|
133
|
-
- [ ] Run existing tests to verify no regressions
|
|
134
|
-
- [ ] Add tests for any new helper functions
|
|
135
|
-
- [ ] Update documentation if interfaces changed
|
|
136
|
-
- [ ] Review with team before merging larger refactors
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
## Step 7: Scalability Recommendations
|
|
140
|
-
Beyond immediate simplification, suggest patterns for future scalability:
|
|
141
|
-
- Modular architecture improvements
|
|
142
|
-
- Caching strategies
|
|
143
|
-
- Async/parallel processing opportunities
|
|
144
|
-
- Configuration externalization
|
|
145
|
-
- Feature flags for gradual rollouts
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
Let me know when you're ready to simplify your implementation.
|
|
7
|
+
1. **Gather Context** — If not already provided, ask for: target file(s) or component(s) to simplify, current pain points (hard to understand, maintain, or extend?), performance or scalability concerns, constraints (backward compatibility, API stability, deadlines), and relevant design docs or requirements.
|
|
8
|
+
2. **Analyze Current Complexity** — For each target: identify complexity sources (deep nesting, duplication, unclear abstractions, tight coupling, over-engineering, magic values), assess cognitive load for future maintainers, and identify scalability blockers (single points of failure, sync-where-async-needed, missing caching, inefficient algorithms).
|
|
9
|
+
3. **Propose Simplifications** — Prioritize readability over brevity — apply the 30-second test: can a new team member understand each change quickly? For each issue, suggest concrete improvements (extract, consolidate, flatten, decouple, remove dead code, replace with built-ins). Provide before/after snippets.
|
|
10
|
+
4. **Prioritize & Plan** — Rank by impact vs risk: (1) high impact, low risk — do first, (2) high impact, higher risk — plan carefully, (3) low impact, low risk — quick wins if time permits, (4) low impact, high risk — skip or defer. For each change specify risk level, testing requirements, and effort. Produce a prioritized action plan with recommended execution order.
|