@relipa/ai-flow-kit 0.0.6 → 0.0.7-beta.1
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 +41 -16
- package/bin/aiflow.js +65 -2
- package/custom/mcp-presets/gitnexus.json +8 -0
- package/custom/skills/generate-spec/SKILL.md +7 -0
- package/custom/skills/impact-analysis/SKILL.md +10 -0
- package/custom/skills/investigate-bug/SKILL.md +17 -0
- package/custom/skills/read-study-requirement/SKILL.md +11 -0
- package/custom/skills/review-plan/SKILL.md +15 -0
- package/custom/templates/php-plain.md +261 -0
- package/docs/common/AIFLOW.md +17 -6
- package/docs/common/CHANGELOG.md +63 -5
- package/docs/common/QUICK_START.md +33 -13
- package/docs/common/cli-reference.md +23 -0
- package/package.json +2 -7
- package/scripts/checkpoint.js +46 -0
- package/scripts/doctor.js +111 -8
- package/scripts/gitnexus-worker.js +94 -0
- package/scripts/guide.js +42 -51
- package/scripts/hooks/session-start.js +35 -5
- package/scripts/hooks/session-stop.js +55 -0
- package/scripts/init.js +299 -19
- package/scripts/prompt.js +2 -2
- package/scripts/remove.js +54 -0
- package/scripts/task.js +101 -0
- package/scripts/update.js +14 -4
- package/scripts/use.js +78 -6
- package/upstream/.claude-plugin/marketplace.json +4 -4
- package/upstream/.claude-plugin/plugin.json +2 -4
- package/upstream/.cursor-plugin/plugin.json +2 -4
- package/upstream/docs/plans/2025-11-22-opencode-support-design.md +1 -1
- package/upstream/docs/plans/2025-11-28-skills-improvements-from-user-feedback.md +2 -2
- package/upstream/docs/testing.md +2 -2
- package/upstream/skills/subagent-driven-development/SKILL.md +5 -6
- package/upstream/skills/subagent-driven-development/implementer-prompt.md +2 -3
- package/upstream/skills/systematic-debugging/CREATION-LOG.md +1 -1
- package/upstream/skills/systematic-debugging/root-cause-tracing.md +1 -1
- package/upstream/skills/tdd-lean/SKILL.md +127 -0
- package/upstream/skills/using-git-worktrees/SKILL.md +4 -5
- package/upstream/skills/writing-plans/SKILL.md +3 -9
- package/upstream/tests/brainstorm-server/package-lock.json +36 -0
package/scripts/use.js
CHANGED
|
@@ -20,6 +20,9 @@ module.exports = async function use(target, options = {}) {
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
// ── GitNexus index notification (all AI tools see this) ──────
|
|
24
|
+
await checkGitNexusIndexStatus();
|
|
25
|
+
|
|
23
26
|
// ── Manual entry ──
|
|
24
27
|
if (options.manual) {
|
|
25
28
|
return await manualContext();
|
|
@@ -456,7 +459,8 @@ async function manualContext(prefillId = '') {
|
|
|
456
459
|
{ name: '✨ Feature', value: 'feature' },
|
|
457
460
|
{ name: '🔍 Investigation', value: 'investigation' },
|
|
458
461
|
{ name: '♻️ Refactor', value: 'refactor' },
|
|
459
|
-
{ name: '📊 Impact Analysis', value: 'impact-analysis' }
|
|
462
|
+
{ name: '📊 Impact Analysis', value: 'impact-analysis' },
|
|
463
|
+
{ name: '📖 Documentation', value: 'documentation' }
|
|
460
464
|
],
|
|
461
465
|
default: existing.taskType || undefined
|
|
462
466
|
});
|
|
@@ -501,10 +505,25 @@ async function loadFromFile(filePath, options = {}) {
|
|
|
501
505
|
context = JSON.parse(raw);
|
|
502
506
|
} catch (_) {
|
|
503
507
|
console.log(chalk.gray(' File is not JSON — auto-detecting task info from content...'));
|
|
504
|
-
context = buildContextFromPlainText(raw);
|
|
508
|
+
context = buildContextFromPlainText(raw, filePath);
|
|
505
509
|
}
|
|
506
510
|
|
|
507
511
|
context.mode = options.full ? 'full' : 'fast';
|
|
512
|
+
|
|
513
|
+
// Prompt for task type
|
|
514
|
+
context.taskType = await select({
|
|
515
|
+
message: 'Task type:',
|
|
516
|
+
choices: [
|
|
517
|
+
{ name: '🐛 Bug Fix', value: 'bug-fix' },
|
|
518
|
+
{ name: '✨ Feature', value: 'feature' },
|
|
519
|
+
{ name: '🔍 Investigation', value: 'investigation' },
|
|
520
|
+
{ name: '♻️ Refactor', value: 'refactor' },
|
|
521
|
+
{ name: '📊 Impact Analysis', value: 'impact-analysis' },
|
|
522
|
+
{ name: '📖 Documentation', value: 'documentation' }
|
|
523
|
+
],
|
|
524
|
+
default: context.taskType || 'feature'
|
|
525
|
+
});
|
|
526
|
+
|
|
508
527
|
await saveContext(context, options.save);
|
|
509
528
|
printContextSummary(context);
|
|
510
529
|
await suggestNextStep();
|
|
@@ -514,14 +533,29 @@ async function loadFromFile(filePath, options = {}) {
|
|
|
514
533
|
* Build a minimal context object from arbitrary plain-text file content.
|
|
515
534
|
* Tries to detect ticket ID (e.g. PROJ-33, APP-123) and a title from the first non-blank line.
|
|
516
535
|
*/
|
|
517
|
-
function buildContextFromPlainText(text) {
|
|
536
|
+
function buildContextFromPlainText(text, filePath = '') {
|
|
518
537
|
// Detect ticket ID: first PROJ-123 style token anywhere in the text
|
|
519
538
|
const idMatch = text.match(/\b([A-Z][A-Z0-9_]+-\d+)\b/);
|
|
520
|
-
const taskId = idMatch ? idMatch[1] : `TASK-${Date.now()}`;
|
|
521
539
|
|
|
522
|
-
|
|
540
|
+
let taskId;
|
|
541
|
+
if (idMatch) {
|
|
542
|
+
taskId = idMatch[1];
|
|
543
|
+
} else {
|
|
544
|
+
const fileNameOnly = filePath ? path.basename(filePath, path.extname(filePath)) : '';
|
|
545
|
+
const cleanWords = fileNameOnly.replace(/[^a-zA-Z0-9]/g, ' ')
|
|
546
|
+
.split(/\s+/)
|
|
547
|
+
.filter(Boolean)
|
|
548
|
+
.slice(0, 5)
|
|
549
|
+
.join('-')
|
|
550
|
+
.toUpperCase();
|
|
551
|
+
const prefix = cleanWords ? `TASK-${cleanWords}-` : 'TASK-';
|
|
552
|
+
taskId = `${prefix}${Date.now()}`;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// Title: use full filename if available, otherwise first non-blank line
|
|
556
|
+
const fullFileName = filePath ? path.basename(filePath) : '';
|
|
523
557
|
const lines = text.split(/\r?\n/).map(l => l.trim()).filter(Boolean);
|
|
524
|
-
const titleLine = lines.find(l => l.length > 3) || taskId;
|
|
558
|
+
const titleLine = fullFileName || lines.find(l => l.length > 3) || taskId;
|
|
525
559
|
const title = titleLine.substring(0, 120);
|
|
526
560
|
|
|
527
561
|
// Task type detection from text
|
|
@@ -692,6 +726,44 @@ function printContextSummary(context) {
|
|
|
692
726
|
console.log();
|
|
693
727
|
}
|
|
694
728
|
|
|
729
|
+
// ── GitNexus index status notification ───────────────────────────
|
|
730
|
+
// Called at the top of use() so ALL AI tools (Claude/Gemini/Cursor/Copilot)
|
|
731
|
+
// see the notification when developer runs `aiflow use TICKET`.
|
|
732
|
+
const GITNEXUS_STALE_MS = 3 * 60 * 60 * 1000; // 3 hours — if still "running" after this, process died
|
|
733
|
+
|
|
734
|
+
async function checkGitNexusIndexStatus() {
|
|
735
|
+
const statusPath = path.join(AIFLOW_DIR, 'gitnexus-status.json');
|
|
736
|
+
try {
|
|
737
|
+
if (!(await fs.pathExists(statusPath))) return;
|
|
738
|
+
const gn = await fs.readJson(statusPath);
|
|
739
|
+
if (gn.notified) return;
|
|
740
|
+
|
|
741
|
+
// Detect stale "running" — process was killed without updating status
|
|
742
|
+
if (gn.status === 'running' && gn.startedAt) {
|
|
743
|
+
const age = Date.now() - new Date(gn.startedAt).getTime();
|
|
744
|
+
if (age > GITNEXUS_STALE_MS) {
|
|
745
|
+
gn.status = 'error';
|
|
746
|
+
gn.error = 'timed out — process may have been killed or ran out of memory';
|
|
747
|
+
gn.notified = false;
|
|
748
|
+
await fs.writeJson(statusPath, gn, { spaces: 2 });
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
if (gn.status === 'done') {
|
|
753
|
+
console.log(chalk.green('✓ GitNexus indexing complete — code intelligence tools are ready.'));
|
|
754
|
+
gn.notified = true;
|
|
755
|
+
await fs.writeJson(statusPath, gn, { spaces: 2 });
|
|
756
|
+
} else if (gn.status === 'error') {
|
|
757
|
+
const detail = gn.error ? ` (${gn.error})` : gn.exitCode ? ` (exit ${gn.exitCode})` : '';
|
|
758
|
+
console.log(chalk.red(`✗ GitNexus indexing failed${detail}.`));
|
|
759
|
+
// console.log(chalk.gray(' Retry: aiflow init --with-gitnexus'));
|
|
760
|
+
gn.notified = true;
|
|
761
|
+
await fs.writeJson(statusPath, gn, { spaces: 2 });
|
|
762
|
+
}
|
|
763
|
+
// status === 'running' and not yet stale: still in progress, stay silent
|
|
764
|
+
} catch (_) {}
|
|
765
|
+
}
|
|
766
|
+
|
|
695
767
|
async function suggestNextStep() {
|
|
696
768
|
let aiTools = ['claude']; // Default
|
|
697
769
|
try {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"name": "superpowers-dev",
|
|
3
3
|
"description": "Development marketplace for Superpowers core skills library",
|
|
4
4
|
"owner": {
|
|
5
|
-
"name": "
|
|
6
|
-
"email": "
|
|
5
|
+
"name": "Example Team",
|
|
6
|
+
"email": "dev@example.com"
|
|
7
7
|
},
|
|
8
8
|
"plugins": [
|
|
9
9
|
{
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"version": "5.0.7",
|
|
13
13
|
"source": "./",
|
|
14
14
|
"author": {
|
|
15
|
-
"name": "
|
|
16
|
-
"email": "
|
|
15
|
+
"name": "Example Developer",
|
|
16
|
+
"email": "dev@example.com"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
]
|
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
"description": "Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques",
|
|
4
4
|
"version": "5.0.7",
|
|
5
5
|
"author": {
|
|
6
|
-
"name": "
|
|
7
|
-
"email": "
|
|
6
|
+
"name": "Example Developer",
|
|
7
|
+
"email": "dev@example.com"
|
|
8
8
|
},
|
|
9
|
-
"homepage": "https://github.com/obra/superpowers",
|
|
10
|
-
"repository": "https://github.com/obra/superpowers",
|
|
11
9
|
"license": "MIT",
|
|
12
10
|
"keywords": [
|
|
13
11
|
"skills",
|
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
"description": "Core skills library: TDD, debugging, collaboration patterns, and proven techniques",
|
|
5
5
|
"version": "5.0.7",
|
|
6
6
|
"author": {
|
|
7
|
-
"name": "
|
|
8
|
-
"email": "
|
|
7
|
+
"name": "Example Developer",
|
|
8
|
+
"email": "dev@example.com"
|
|
9
9
|
},
|
|
10
|
-
"homepage": "https://github.com/obra/superpowers",
|
|
11
|
-
"repository": "https://github.com/obra/superpowers",
|
|
12
10
|
"license": "MIT",
|
|
13
11
|
"keywords": [
|
|
14
12
|
"skills",
|
|
@@ -640,7 +640,7 @@ How do we know these improvements work?
|
|
|
640
640
|
|
|
641
641
|
1. **Configuration verification:**
|
|
642
642
|
- Zero instances of "test passed but wrong config was used"
|
|
643
|
-
-
|
|
643
|
+
- developer doesn't say "that's not actually testing what you think"
|
|
644
644
|
|
|
645
645
|
2. **Process hygiene:**
|
|
646
646
|
- Zero instances of "test hit wrong server"
|
|
@@ -699,7 +699,7 @@ How do we know these improvements work?
|
|
|
699
699
|
- testing-anti-patterns: Mock-interface drift
|
|
700
700
|
- requesting-code-review: Explicit file reading
|
|
701
701
|
|
|
702
|
-
**Test Phase 2 with
|
|
702
|
+
**Test Phase 2 with developer before finalizing:**
|
|
703
703
|
- Get feedback on self-reflection impact
|
|
704
704
|
- Validate process hygiene approach
|
|
705
705
|
- Confirm skills reading requirement is worth overhead
|
package/upstream/docs/testing.md
CHANGED
|
@@ -149,8 +149,8 @@ python3 tests/claude-code/analyze-token-usage.py ~/.claude/projects/<project-dir
|
|
|
149
149
|
Session transcripts are stored in `~/.claude/projects/` with the working directory path encoded:
|
|
150
150
|
|
|
151
151
|
```bash
|
|
152
|
-
# Example for /Users/
|
|
153
|
-
SESSION_DIR="$HOME/.claude/projects/-Users-
|
|
152
|
+
# Example for /Users/example-user/Documents/GitHub/superpowers/superpowers
|
|
153
|
+
SESSION_DIR="$HOME/.claude/projects/-Users-example-user-Documents-GitHub-superpowers-superpowers"
|
|
154
154
|
|
|
155
155
|
# Find recent sessions
|
|
156
156
|
ls -lt "$SESSION_DIR"/*.jsonl | head -5
|
|
@@ -48,7 +48,7 @@ digraph process {
|
|
|
48
48
|
"Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];
|
|
49
49
|
"Implementer subagent asks questions?" [shape=diamond];
|
|
50
50
|
"Answer questions, provide context" [shape=box];
|
|
51
|
-
"Implementer subagent implements, tests,
|
|
51
|
+
"Implementer subagent implements, tests, self-reviews" [shape=box];
|
|
52
52
|
"Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [shape=box];
|
|
53
53
|
"Spec reviewer subagent confirms code matches spec?" [shape=diamond];
|
|
54
54
|
"Implementer subagent fixes spec gaps" [shape=box];
|
|
@@ -63,12 +63,11 @@ digraph process {
|
|
|
63
63
|
"Dispatch final code reviewer subagent for entire implementation" [shape=box];
|
|
64
64
|
"Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
|
|
65
65
|
|
|
66
|
-
"Read plan, extract all tasks with full text, note context, create TodoWrite" -> "Dispatch implementer subagent (./implementer-prompt.md)";
|
|
67
66
|
"Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?";
|
|
68
67
|
"Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
|
|
69
68
|
"Answer questions, provide context" -> "Dispatch implementer subagent (./implementer-prompt.md)";
|
|
70
|
-
"Implementer subagent asks questions?" -> "Implementer subagent implements, tests,
|
|
71
|
-
"Implementer subagent implements, tests,
|
|
69
|
+
"Implementer subagent asks questions?" -> "Implementer subagent implements, tests, self-reviews" [label="no"];
|
|
70
|
+
"Implementer subagent implements, tests, self-reviews" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)";
|
|
72
71
|
"Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" -> "Spec reviewer subagent confirms code matches spec?";
|
|
73
72
|
"Spec reviewer subagent confirms code matches spec?" -> "Implementer subagent fixes spec gaps" [label="no"];
|
|
74
73
|
"Implementer subagent fixes spec gaps" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [label="re-review"];
|
|
@@ -146,7 +145,7 @@ Implementer: "Got it. Implementing now..."
|
|
|
146
145
|
- Implemented install-hook command
|
|
147
146
|
- Added tests, 5/5 passing
|
|
148
147
|
- Self-review: Found I missed --force flag, added it
|
|
149
|
-
-
|
|
148
|
+
- Reported DONE
|
|
150
149
|
|
|
151
150
|
[Dispatch spec compliance reviewer]
|
|
152
151
|
Spec reviewer: ✅ Spec compliant - all requirements met, nothing extra
|
|
@@ -166,7 +165,7 @@ Implementer:
|
|
|
166
165
|
- Added verify/repair modes
|
|
167
166
|
- 8/8 tests passing
|
|
168
167
|
- Self-review: All good
|
|
169
|
-
-
|
|
168
|
+
- Reported DONE
|
|
170
169
|
|
|
171
170
|
[Dispatch spec compliance reviewer]
|
|
172
171
|
Spec reviewer: ❌ Issues:
|
|
@@ -32,9 +32,8 @@ Task tool (general-purpose):
|
|
|
32
32
|
1. Implement exactly what the task specifies
|
|
33
33
|
2. Write tests (following TDD if task says to)
|
|
34
34
|
3. Verify implementation works
|
|
35
|
-
4.
|
|
36
|
-
5.
|
|
37
|
-
6. Report back
|
|
35
|
+
4. Self-review (see below)
|
|
36
|
+
5. Report back
|
|
38
37
|
|
|
39
38
|
Work from: [directory]
|
|
40
39
|
|
|
@@ -4,7 +4,7 @@ Reference example of extracting, structuring, and bulletproofing a critical skil
|
|
|
4
4
|
|
|
5
5
|
## Source Material
|
|
6
6
|
|
|
7
|
-
Extracted debugging framework from `/Users/
|
|
7
|
+
Extracted debugging framework from `/Users/example-user/.claude/CLAUDE.md`:
|
|
8
8
|
- 4-phase systematic process (Investigation → Pattern Analysis → Hypothesis → Implementation)
|
|
9
9
|
- Core mandate: ALWAYS find root cause, NEVER fix symptoms
|
|
10
10
|
- Rules designed to resist time pressure and rationalization
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd-lean
|
|
3
|
+
description: Use for Gate 3 fast mode — Batch Red-Green-Refactor. Write all tests first, run once, implement all code, run once. Framework-agnostic.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TDD Lean — Gate 3 Fast Mode
|
|
7
|
+
|
|
8
|
+
## When to Use
|
|
9
|
+
|
|
10
|
+
**Fast mode only.** This skill replaces `superpowers:test-driven-development` in fast mode.
|
|
11
|
+
Full mode continues to use `superpowers:test-driven-development` unchanged.
|
|
12
|
+
|
|
13
|
+
## The Batch Red-Green-Refactor Pattern
|
|
14
|
+
|
|
15
|
+
Instead of per-test Red-Green-Refactor, batch all tests first, then implement all production code.
|
|
16
|
+
|
|
17
|
+
### Phase 1 — RED BATCH
|
|
18
|
+
|
|
19
|
+
Write ALL test methods for the feature in test file(s).
|
|
20
|
+
Run test runner ONCE → confirm all FAIL.
|
|
21
|
+
|
|
22
|
+
If any test PASSes immediately → that test is wrong. Fix it before proceeding.
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
✅ Accept: Tests: 0 passed, 8 failed (1.2s)
|
|
26
|
+
❌ Stop if: any test passes immediately (test is testing wrong behavior)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Phase 2 — GREEN BATCH
|
|
30
|
+
|
|
31
|
+
Implement ALL production code.
|
|
32
|
+
Run test runner ONCE → confirm all PASS.
|
|
33
|
+
|
|
34
|
+
If tests FAIL:
|
|
35
|
+
- Fix inline. DO NOT spawn a subagent.
|
|
36
|
+
- Maximum 2 retry runs.
|
|
37
|
+
- If still failing after 2 retries: stop and report exact error to developer.
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
✅ Accept: Tests: 8 passed (2.1s)
|
|
41
|
+
❌ Stop if: tests still fail after 2 retries → report to developer
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Phase 3 — REFACTOR
|
|
45
|
+
|
|
46
|
+
Clean up duplication or naming if needed.
|
|
47
|
+
Run ONCE to confirm still PASS.
|
|
48
|
+
Do NOT add behavior. Do NOT fix unrelated tests.
|
|
49
|
+
|
|
50
|
+
## Test Output Discipline — CRITICAL
|
|
51
|
+
|
|
52
|
+
After EVERY test run, keep ONLY the summary line in context. Discard everything else.
|
|
53
|
+
|
|
54
|
+
**Keep:**
|
|
55
|
+
```
|
|
56
|
+
✅ Tests: 12 passed (3.2s)
|
|
57
|
+
❌ Tests: 10 passed, 2 failed — UserService:45 expected "X" got "Y"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Discard immediately:**
|
|
61
|
+
- Full stack traces
|
|
62
|
+
- Framework startup logs (Spring Boot "Started in 3.2s", Jest runner header, etc.)
|
|
63
|
+
- Warning and deprecation messages
|
|
64
|
+
- Individual test output blocks
|
|
65
|
+
|
|
66
|
+
**Why this matters:** A single Spring Boot test run produces ~300 lines (~860 tokens). Running 16–24 times per feature = 13,000–20,000 tokens from test output alone. Batch approach = 2–3 runs total.
|
|
67
|
+
|
|
68
|
+
## Checkpoint Calls
|
|
69
|
+
|
|
70
|
+
At each phase milestone, call the checkpoint command with your token estimate:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
aiflow checkpoint --gate 3 --step "tests-written" --tokens [estimate]
|
|
74
|
+
aiflow checkpoint --gate 3 --step "code-done" --tokens [estimate]
|
|
75
|
+
aiflow checkpoint --gate 3 --step "tests-pass" --tokens [estimate]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Token estimate:** Count approximate characters you have generated in this gate so far ÷ 3.5
|
|
79
|
+
|
|
80
|
+
## Summary.md Update
|
|
81
|
+
|
|
82
|
+
After Phase 2 (GREEN BATCH), append task results to `plan/[ticket-id]/summary.md`:
|
|
83
|
+
|
|
84
|
+
```markdown
|
|
85
|
+
### Gate 3 — Code
|
|
86
|
+
- ✅ [Task name] + tests
|
|
87
|
+
- ✅ [Task name] + tests
|
|
88
|
+
- ❌ [Task name] (error → fixed inline)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Also append token data:
|
|
92
|
+
```markdown
|
|
93
|
+
## Token Usage
|
|
94
|
+
| Gate | Tokens (est.) | Time |
|
|
95
|
+
|------|---------------|------|
|
|
96
|
+
| G3 | ~[value] | [Xm] |
|
|
97
|
+
```
|
|
98
|
+
(Update existing row if Gate 3 row already exists; add if not.)
|
|
99
|
+
|
|
100
|
+
## Gate Transition Reminder
|
|
101
|
+
|
|
102
|
+
After all tests pass and Gate 3 is complete, display:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
106
|
+
✅ GATE 3: CODE GENERATION COMPLETE
|
|
107
|
+
|
|
108
|
+
All tests pass. Ready for Gate 4 (AI Self-Review).
|
|
109
|
+
|
|
110
|
+
💡 Token tip: Continue in this session OR start fresh for Gate 4:
|
|
111
|
+
1. Run: aiflow task next --ticket [ticket-id]
|
|
112
|
+
2. Open a new terminal / chat session
|
|
113
|
+
3. Run: aiflow task resume [ticket-id]
|
|
114
|
+
Gate 4 will begin with a clean context window.
|
|
115
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Mandatory Rules
|
|
119
|
+
|
|
120
|
+
- ❌ DO NOT run test suite after each individual test method
|
|
121
|
+
- ❌ DO NOT use `superpowers:test-driven-development` in fast mode
|
|
122
|
+
- ❌ DO NOT spawn subagents to fix failing tests
|
|
123
|
+
- ❌ DO NOT keep full test output in context
|
|
124
|
+
- ✅ MUST run test suite exactly: once after RED BATCH, once after GREEN BATCH
|
|
125
|
+
- ✅ MUST discard test output and keep only summary line
|
|
126
|
+
- ✅ MUST call `aiflow checkpoint` at each milestone
|
|
127
|
+
- ✅ MUST update summary.md with task results (✅/❌) and token data
|
|
@@ -61,10 +61,9 @@ git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/d
|
|
|
61
61
|
|
|
62
62
|
**If NOT ignored:**
|
|
63
63
|
|
|
64
|
-
Per
|
|
64
|
+
Per developer's rule "Fix broken things immediately":
|
|
65
65
|
1. Add appropriate line to .gitignore
|
|
66
|
-
2.
|
|
67
|
-
3. Proceed with worktree creation
|
|
66
|
+
2. Proceed with worktree creation
|
|
68
67
|
|
|
69
68
|
**Why critical:** Prevents accidentally committing worktree contents to repository.
|
|
70
69
|
|
|
@@ -149,7 +148,7 @@ Ready to implement <feature-name>
|
|
|
149
148
|
| `worktrees/` exists | Use it (verify ignored) |
|
|
150
149
|
| Both exist | Use `.worktrees/` |
|
|
151
150
|
| Neither exists | Check CLAUDE.md → Ask user |
|
|
152
|
-
| Directory not ignored | Add to .gitignore
|
|
151
|
+
| Directory not ignored | Add to .gitignore |
|
|
153
152
|
| Tests fail during baseline | Report failures + ask |
|
|
154
153
|
| No package.json/Cargo.toml | Skip dependency install |
|
|
155
154
|
|
|
@@ -186,7 +185,7 @@ You: I'm using the using-git-worktrees skill to set up an isolated workspace.
|
|
|
186
185
|
[Run npm install]
|
|
187
186
|
[Run npm test - 47 passing]
|
|
188
187
|
|
|
189
|
-
Worktree ready at /Users/
|
|
188
|
+
Worktree ready at /Users/example-user/myproject/.worktrees/auth
|
|
190
189
|
Tests passing (47 tests, 0 failures)
|
|
191
190
|
Ready to implement auth feature
|
|
192
191
|
```
|
|
@@ -7,7 +7,7 @@ description: Use when you have a spec or requirements for a multi-step task, bef
|
|
|
7
7
|
|
|
8
8
|
## Overview
|
|
9
9
|
|
|
10
|
-
Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD.
|
|
10
|
+
Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD.
|
|
11
11
|
|
|
12
12
|
Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
|
|
13
13
|
|
|
@@ -40,7 +40,6 @@ This structure informs the task decomposition. Each task should produce self-con
|
|
|
40
40
|
- "Run it to make sure it fails" - step
|
|
41
41
|
- "Implement the minimal code to make the test pass" - step
|
|
42
42
|
- "Run the tests and make sure they pass" - step
|
|
43
|
-
- "Commit" - step
|
|
44
43
|
|
|
45
44
|
## Plan Document Header
|
|
46
45
|
|
|
@@ -95,12 +94,7 @@ def function(input):
|
|
|
95
94
|
Run: `pytest tests/path/test.py::test_name -v`
|
|
96
95
|
Expected: PASS
|
|
97
96
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
git add tests/path/test.py src/path/file.py
|
|
102
|
-
git commit -m "feat: add specific feature"
|
|
103
|
-
```
|
|
97
|
+
Expected: PASS
|
|
104
98
|
````
|
|
105
99
|
|
|
106
100
|
## No Placeholders
|
|
@@ -117,7 +111,7 @@ Every step must contain the actual content an engineer needs. These are **plan f
|
|
|
117
111
|
- Exact file paths always
|
|
118
112
|
- Complete code in every step — if a step changes code, show the code
|
|
119
113
|
- Exact commands with expected output
|
|
120
|
-
- DRY, YAGNI, TDD
|
|
114
|
+
- DRY, YAGNI, TDD
|
|
121
115
|
|
|
122
116
|
## Self-Review
|
|
123
117
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "brainstorm-server-tests",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"lockfileVersion": 3,
|
|
5
|
+
"requires": true,
|
|
6
|
+
"packages": {
|
|
7
|
+
"": {
|
|
8
|
+
"name": "brainstorm-server-tests",
|
|
9
|
+
"version": "1.0.0",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"ws": "^8.19.0"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"node_modules/ws": {
|
|
15
|
+
"version": "8.19.0",
|
|
16
|
+
"resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz",
|
|
17
|
+
"integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=10.0.0"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"bufferutil": "^4.0.1",
|
|
24
|
+
"utf-8-validate": ">=5.0.2"
|
|
25
|
+
},
|
|
26
|
+
"peerDependenciesMeta": {
|
|
27
|
+
"bufferutil": {
|
|
28
|
+
"optional": true
|
|
29
|
+
},
|
|
30
|
+
"utf-8-validate": {
|
|
31
|
+
"optional": true
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|