claude-flow-novice 2.12.0 → 2.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/.claude/commands/README.md +177 -129
- package/claude-assets/commands/cfn/README.md +177 -129
- package/claude-assets/commands/cfn/cfn-loop-cli.md +268 -0
- package/claude-assets/commands/cfn/cfn-loop-document.md +20 -1
- package/claude-assets/commands/cfn/cfn-loop-frontend.md +17 -2
- package/claude-assets/commands/cfn/cfn-loop-task.md +442 -0
- package/claude-assets/commands/cfn/context-curate.md +27 -38
- package/claude-assets/commands/cfn/context-inject.md +14 -25
- package/claude-assets/commands/cfn/context-query.md +40 -45
- package/claude-assets/commands/cfn/context-reflect.md +40 -38
- package/claude-assets/commands/cfn/context-stats.md +13 -38
- package/claude-assets/commands/cfn/launch-web-dashboard.md +0 -295
- package/claude-assets/commands/cfn/list-agents-rebuild.md +18 -18
- package/claude-assets/commands/cfn/write-plan.md +246 -75
- package/dist/cli/config-manager.js +109 -91
- package/package.json +1 -1
- package/claude-assets/commands/cfn/auto-compact.md +0 -80
- package/claude-assets/commands/cfn/cfn-loop-epic.md +0 -478
- package/claude-assets/commands/cfn/cfn-loop-single.md +0 -256
- package/claude-assets/commands/cfn/cfn-loop-sprints.md +0 -396
- package/claude-assets/commands/cfn/cfn-loop.md +0 -518
- package/claude-assets/commands/cfn/claude-md.md +0 -64
- package/claude-assets/commands/cfn/claude-soul.md +0 -22
- package/claude-assets/commands/cfn/cost-savings-off.md +0 -35
- package/claude-assets/commands/cfn/cost-savings-on.md +0 -35
- package/claude-assets/commands/cfn/cost-savings-status.md +0 -34
- package/claude-assets/commands/cfn/custom-routing-activate.md +0 -55
- package/claude-assets/commands/cfn/custom-routing-deactivate.md +0 -46
- package/claude-assets/commands/cfn/dependency-recommendations.md +0 -171
- package/claude-assets/commands/cfn/fullstack.md +0 -179
- package/claude-assets/commands/cfn/github.md +0 -221
- package/claude-assets/commands/cfn/hooks.md +0 -38
- package/claude-assets/commands/cfn/metrics-summary.md +0 -58
- package/claude-assets/commands/cfn/neural.md +0 -39
- package/claude-assets/commands/cfn/parse-epic.md +0 -357
- package/claude-assets/commands/cfn/performance.md +0 -41
- package/claude-assets/commands/cfn/sparc.md +0 -46
- package/claude-assets/commands/cfn/suggest-improvements.md +0 -95
- package/claude-assets/commands/cfn/suggest-templates.md +0 -147
- package/claude-assets/commands/cfn/swarm.md +0 -24
|
@@ -1,104 +1,275 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: "CFN Loop pre-planning: Generate structured implementation plans with TDD approach"
|
|
3
|
+
argument-hint: "<task description> [--mode=mvp|standard|enterprise]"
|
|
4
|
+
allowed-tools: ["Task", "TodoWrite", "Read", "Write", "Bash"]
|
|
5
|
+
---
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
The `write-plan` command helps create structured, test-driven implementation plans for claude-flow-novice projects, leveraging our CFN Loop workflow and adaptive context strategies.
|
|
7
|
+
# Write Plan - CFN Loop Pre-Planning
|
|
5
8
|
|
|
6
|
-
|
|
9
|
+
Generate structured implementation plan BEFORE executing CFN Loop. Outputs plan document for review.
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
- Always start with failure scenarios (Red phase)
|
|
10
|
-
- Implement minimal code to pass tests (Green phase)
|
|
11
|
-
- Refactor for quality and maintainability (Refactor phase)
|
|
11
|
+
🎯 **Use this BEFORE /cfn-loop-cli or /cfn-loop-task**
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
Utilize the CFN Loop workflow for complex implementations:
|
|
15
|
-
- **Loop 3 (Implementation)**: Create detailed implementation plan
|
|
16
|
-
- **Loop 2 (Validation)**: Comprehensive test and review
|
|
17
|
-
- **Product Owner Decision**: Strategic go/no-go checkpoint
|
|
13
|
+
**Task**: $ARGUMENTS
|
|
18
14
|
|
|
19
|
-
##
|
|
15
|
+
## What This Does
|
|
20
16
|
|
|
17
|
+
**Pre-planning phase for CFN Loop:**
|
|
18
|
+
1. Analyzes task complexity
|
|
19
|
+
2. Selects appropriate agents
|
|
20
|
+
3. Defines test cases and success criteria
|
|
21
|
+
4. Creates implementation roadmap
|
|
22
|
+
5. Outputs plan document for approval
|
|
23
|
+
|
|
24
|
+
**Then run:**
|
|
25
|
+
```bash
|
|
26
|
+
# After reviewing plan
|
|
27
|
+
/cfn-loop-cli "Implement JWT authentication" --mode=standard
|
|
28
|
+
# OR
|
|
29
|
+
/cfn-loop-task "Implement JWT authentication" --mode=standard
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Command Options
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Standard planning
|
|
36
|
+
/write-plan "Implement JWT authentication"
|
|
37
|
+
|
|
38
|
+
# MVP planning (faster, simpler)
|
|
39
|
+
/write-plan "Build prototype feature" --mode=mvp
|
|
40
|
+
|
|
41
|
+
# Enterprise planning (comprehensive)
|
|
42
|
+
/write-plan "Production security system" --mode=enterprise
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Options:**
|
|
46
|
+
- `--mode=<mvp|standard|enterprise>`: Planning depth (default: standard)
|
|
47
|
+
|
|
48
|
+
## Execution Pattern
|
|
49
|
+
|
|
50
|
+
### Step 1: Analyze Task
|
|
51
|
+
|
|
52
|
+
```javascript
|
|
53
|
+
Task("planner", `
|
|
54
|
+
ANALYZE TASK FOR CFN LOOP PLANNING
|
|
55
|
+
|
|
56
|
+
Task: $ARGUMENTS
|
|
57
|
+
Mode: ${mode}
|
|
58
|
+
|
|
59
|
+
ANALYSIS REQUIRED:
|
|
60
|
+
1. Complexity Assessment:
|
|
61
|
+
- Estimated files: 1-2 (simple) | 3-5 (standard) | >5 (complex)
|
|
62
|
+
- Estimated LOC: <200 (simple) | 200-500 (standard) | >500 (complex)
|
|
63
|
+
- Keywords: security, performance, frontend, mobile, etc.
|
|
64
|
+
|
|
65
|
+
2. Agent Selection:
|
|
66
|
+
- Loop 3 (Implementation): Based on task type
|
|
67
|
+
* Backend: backend-dev, researcher, devops
|
|
68
|
+
* Full-stack: backend-dev, react-frontend-engineer, devops
|
|
69
|
+
* Mobile: mobile-dev, backend-dev
|
|
70
|
+
* Security: security-specialist, backend-dev
|
|
71
|
+
- Loop 2 (Validation): Scale by complexity
|
|
72
|
+
* Simple: reviewer, tester
|
|
73
|
+
* Standard: +architect, +security-specialist
|
|
74
|
+
* Complex: +code-analyzer, +performance-benchmarker
|
|
75
|
+
|
|
76
|
+
3. Test Cases (TDD Approach):
|
|
77
|
+
- Red Phase: Failure scenarios
|
|
78
|
+
- Green Phase: Minimal passing implementation
|
|
79
|
+
- Refactor Phase: Quality improvements
|
|
80
|
+
|
|
81
|
+
4. Success Criteria:
|
|
82
|
+
- Test coverage target (≥80%)
|
|
83
|
+
- Performance benchmarks (if applicable)
|
|
84
|
+
- Security requirements (if applicable)
|
|
85
|
+
- Deliverables list
|
|
86
|
+
|
|
87
|
+
OUTPUT: planning/PLAN_${sanitize($ARGUMENTS)}.md
|
|
88
|
+
`)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Step 2: Generate Plan Document
|
|
92
|
+
|
|
93
|
+
**Plan Structure:**
|
|
21
94
|
```markdown
|
|
22
|
-
# [
|
|
95
|
+
# Implementation Plan: [Task Name]
|
|
23
96
|
|
|
24
|
-
##
|
|
25
|
-
-
|
|
26
|
-
-
|
|
97
|
+
## Task Analysis
|
|
98
|
+
- **Complexity**: Simple | Standard | Complex
|
|
99
|
+
- **Estimated Files**: N
|
|
100
|
+
- **Estimated LOC**: N
|
|
101
|
+
- **Mode**: ${mode}
|
|
27
102
|
|
|
28
|
-
##
|
|
29
|
-
- Epic Context
|
|
30
|
-
- Sprint Context
|
|
31
|
-
- Specific Deliverables
|
|
103
|
+
## Agent Configuration
|
|
32
104
|
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
105
|
+
### Loop 3 (Implementation)
|
|
106
|
+
- agent-1 (role)
|
|
107
|
+
- agent-2 (role)
|
|
108
|
+
- agent-3 (role)
|
|
37
109
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
110
|
+
### Loop 2 (Validation)
|
|
111
|
+
- reviewer (code review)
|
|
112
|
+
- tester (quality assurance)
|
|
113
|
+
[+ architect, security-specialist for standard/enterprise]
|
|
42
114
|
|
|
43
|
-
###
|
|
44
|
-
-
|
|
45
|
-
- Edge cases
|
|
46
|
-
- Performance expectations
|
|
115
|
+
### Product Owner
|
|
116
|
+
- product-owner (PROCEED/ITERATE/ABORT decision)
|
|
47
117
|
|
|
48
|
-
##
|
|
49
|
-
|
|
118
|
+
## Test-Driven Development Plan
|
|
119
|
+
|
|
120
|
+
### Phase 1: Red (Failure Scenarios)
|
|
121
|
+
**Deliverables:**
|
|
122
|
+
- [ ] Test script: tests/test-[feature].sh
|
|
123
|
+
- [ ] Failure test cases defined
|
|
124
|
+
|
|
125
|
+
**Test Cases:**
|
|
126
|
+
1. [Test case 1 - expected failure]
|
|
127
|
+
2. [Test case 2 - edge case]
|
|
128
|
+
3. [Test case 3 - performance requirement]
|
|
129
|
+
|
|
130
|
+
### Phase 2: Green (Minimal Implementation)
|
|
131
|
+
**Deliverables:**
|
|
50
132
|
- [ ] Minimal working implementation
|
|
51
|
-
- [ ]
|
|
133
|
+
- [ ] All test cases passing
|
|
52
134
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
135
|
+
**Implementation Steps:**
|
|
136
|
+
1. [Core functionality]
|
|
137
|
+
2. [Basic validation]
|
|
138
|
+
3. [Minimal error handling]
|
|
139
|
+
|
|
140
|
+
### Phase 3: Refactor (Quality Improvement)
|
|
141
|
+
**Deliverables:**
|
|
142
|
+
- [ ] Code quality improvements
|
|
143
|
+
- [ ] Enhanced test coverage (≥80%)
|
|
144
|
+
- [ ] Documentation
|
|
58
145
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
146
|
+
**Refactoring Goals:**
|
|
147
|
+
1. [Code organization]
|
|
148
|
+
2. [Performance optimization]
|
|
149
|
+
3. [Security hardening]
|
|
63
150
|
|
|
64
151
|
## Success Criteria
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
-
|
|
152
|
+
|
|
153
|
+
### Quality Gates
|
|
154
|
+
- Loop 3 Gate: ≥${mode === 'enterprise' ? 0.85 : mode === 'standard' ? 0.75 : 0.70}
|
|
155
|
+
- Loop 2 Consensus: ≥${mode === 'enterprise' ? 0.95 : mode === 'standard' ? 0.90 : 0.80}
|
|
156
|
+
|
|
157
|
+
### Deliverables
|
|
158
|
+
- [ ] All test cases passing
|
|
159
|
+
- [ ] Test coverage ≥80%
|
|
160
|
+
- [ ] Code complexity <15 per function
|
|
161
|
+
- [ ] Security review complete
|
|
162
|
+
- [ ] Documentation updated
|
|
163
|
+
|
|
164
|
+
### Performance Benchmarks (if applicable)
|
|
165
|
+
- [Benchmark 1]
|
|
166
|
+
- [Benchmark 2]
|
|
68
167
|
|
|
69
168
|
## Potential Blockers
|
|
70
|
-
|
|
71
|
-
|
|
169
|
+
|
|
170
|
+
**Technical:**
|
|
171
|
+
- [Potential blocker 1]
|
|
172
|
+
- [Mitigation strategy]
|
|
173
|
+
|
|
174
|
+
**Dependencies:**
|
|
175
|
+
- [External dependency 1]
|
|
176
|
+
- [Fallback plan]
|
|
72
177
|
|
|
73
178
|
## Iteration Strategy
|
|
74
|
-
-
|
|
75
|
-
- Confidence threshold:
|
|
76
|
-
- Adaptive agent spawning
|
|
179
|
+
- Max iterations: ${mode === 'enterprise' ? 15 : mode === 'standard' ? 10 : 5}
|
|
180
|
+
- Confidence threshold: ${mode === 'enterprise' ? 0.95 : mode === 'standard' ? 0.90 : 0.80}
|
|
181
|
+
- Adaptive agent spawning: YES
|
|
182
|
+
|
|
183
|
+
## Next Steps
|
|
184
|
+
|
|
185
|
+
1. Review this plan
|
|
186
|
+
2. Execute CFN Loop:
|
|
187
|
+
\`\`\`bash
|
|
188
|
+
/cfn-loop-cli "$ARGUMENTS" --mode=${mode}
|
|
189
|
+
# OR for debugging:
|
|
190
|
+
/cfn-loop-task "$ARGUMENTS" --mode=${mode}
|
|
191
|
+
\`\`\`
|
|
77
192
|
```
|
|
78
193
|
|
|
79
|
-
|
|
194
|
+
### Step 3: Output Plan
|
|
195
|
+
|
|
196
|
+
```javascript
|
|
197
|
+
const planPath = `planning/PLAN_${sanitize($ARGUMENTS)}.md`;
|
|
198
|
+
Write(planPath, planContent);
|
|
199
|
+
|
|
200
|
+
console.log(`✅ Implementation plan generated: ${planPath}`);
|
|
201
|
+
console.log('');
|
|
202
|
+
console.log('📋 Plan Summary:');
|
|
203
|
+
console.log(`- Complexity: ${complexity}`);
|
|
204
|
+
console.log(`- Loop 3 Agents: ${loop3Agents.length}`);
|
|
205
|
+
console.log(`- Loop 2 Validators: ${loop2Agents.length}`);
|
|
206
|
+
console.log(`- Test Cases: ${testCases.length}`);
|
|
207
|
+
console.log(`- Success Criteria: ${successCriteria.length}`);
|
|
208
|
+
console.log('');
|
|
209
|
+
console.log('Next: Review plan, then execute CFN Loop');
|
|
210
|
+
console.log(`/cfn-loop-cli "$ARGUMENTS" --mode=${mode}`);
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Integration with CFN Loop
|
|
214
|
+
|
|
215
|
+
**Workflow:**
|
|
216
|
+
```
|
|
217
|
+
1. /write-plan "Task description" --mode=standard
|
|
218
|
+
↓ Generates planning/PLAN_task.md
|
|
219
|
+
|
|
220
|
+
2. Human reviews plan (optional)
|
|
221
|
+
↓ Approve or request changes
|
|
222
|
+
|
|
223
|
+
3. /cfn-loop-cli "Task description" --mode=standard
|
|
224
|
+
↓ Executes implementation following plan
|
|
225
|
+
|
|
226
|
+
4. CFN Loop autonomously implements following TDD phases
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Mode Comparison
|
|
230
|
+
|
|
231
|
+
| Mode | Complexity | Agents | Test Coverage | Use Case |
|
|
232
|
+
|------|------------|--------|---------------|----------|
|
|
233
|
+
| MVP | Low | 3-4 total | ≥70% | Prototypes, proof-of-concept |
|
|
234
|
+
| Standard | Medium | 5-7 total | ≥80% | Production features |
|
|
235
|
+
| Enterprise | High | 8-10 total | ≥90% | Critical systems, compliance |
|
|
236
|
+
|
|
237
|
+
## Example Output
|
|
80
238
|
|
|
81
|
-
### Spawning Plan Creation
|
|
82
|
-
```bash
|
|
83
|
-
/write-plan "Implement JWT Authentication" \
|
|
84
|
-
--epic-context '{"goal":"Secure API access"}' \
|
|
85
|
-
--sprint-context '{"sprint":"Authentication MVP"}' \
|
|
86
|
-
--agents "backend-dev,security-specialist"
|
|
87
239
|
```
|
|
240
|
+
Analyzing task...
|
|
88
241
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
242
|
+
✅ Implementation plan generated: planning/PLAN_jwt_authentication.md
|
|
243
|
+
|
|
244
|
+
📋 Plan Summary:
|
|
245
|
+
- Complexity: Standard
|
|
246
|
+
- Loop 3 Agents: 3 (backend-dev, researcher, devops)
|
|
247
|
+
- Loop 2 Validators: 4 (reviewer, tester, architect, security-specialist)
|
|
248
|
+
- Test Cases: 8
|
|
249
|
+
- Success Criteria: 6
|
|
250
|
+
|
|
251
|
+
Next: Review plan, then execute CFN Loop
|
|
252
|
+
/cfn-loop-cli "Implement JWT authentication" --mode=standard
|
|
253
|
+
```
|
|
94
254
|
|
|
95
255
|
## Best Practices
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
-
|
|
256
|
+
|
|
257
|
+
**When to Use:**
|
|
258
|
+
- ✅ Complex tasks (>3 steps)
|
|
259
|
+
- ✅ Security-critical features
|
|
260
|
+
- ✅ Team collaboration (plan review needed)
|
|
261
|
+
- ✅ Learning CFN Loop workflow
|
|
262
|
+
|
|
263
|
+
**When to Skip:**
|
|
264
|
+
- Simple bug fixes (go straight to /cfn-loop-cli)
|
|
265
|
+
- Urgent hotfixes (no time for planning)
|
|
266
|
+
- Well-understood patterns (agent knows what to do)
|
|
267
|
+
|
|
268
|
+
## Related Commands
|
|
269
|
+
|
|
270
|
+
- **Execute Plan**: `/cfn-loop-cli` (production) or `/cfn-loop-task` (debugging)
|
|
271
|
+
- **Document Results**: `/cfn-loop-document` (after completion)
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
**Version:** 2.0.0 (2025-10-31) - Integrated with CFN Loop v3 architecture
|
|
@@ -1,100 +1,118 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
configPath;
|
|
8
|
-
schemaPath;
|
|
9
|
-
ajv;
|
|
10
|
-
constructor(){
|
|
11
|
-
this.configPath = path.join(process.env.HOME || "", ".claude-flow-config.json");
|
|
12
|
-
this.schemaPath = path.join(__dirname, "../../.claude/skills/config-management/config.json");
|
|
13
|
-
this.ajv = new Ajv();
|
|
14
|
-
}
|
|
15
|
-
static getInstance() {
|
|
16
|
-
if (!ConfigManager._instance) {
|
|
17
|
-
ConfigManager._instance = new ConfigManager();
|
|
18
|
-
}
|
|
19
|
-
return ConfigManager._instance;
|
|
20
|
-
}
|
|
21
|
-
async readConfig() {
|
|
22
|
-
try {
|
|
23
|
-
const configContent = await fs.readFile(this.configPath, "utf-8");
|
|
24
|
-
return JSON.parse(configContent);
|
|
25
|
-
} catch (error) {
|
|
26
|
-
// If config doesn't exist, create from schema
|
|
27
|
-
return this.resetToDefaults();
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
async writeConfig(config) {
|
|
31
|
-
const schemaContent = await fs.readFile(this.schemaPath, "utf-8");
|
|
32
|
-
const schema = JSON.parse(schemaContent);
|
|
33
|
-
const validate = this.ajv.compile(schema);
|
|
34
|
-
if (!validate(config)) {
|
|
35
|
-
throw new Error("Invalid configuration: " + this.ajv.errorsText(validate.errors));
|
|
36
|
-
}
|
|
37
|
-
await fs.writeFile(this.configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) {
|
|
4
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
5
|
+
resolve(value);
|
|
6
|
+
});
|
|
38
7
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
8
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
9
|
+
function fulfilled(value) {
|
|
10
|
+
try {
|
|
11
|
+
step(generator.next(value));
|
|
12
|
+
} catch (e) {
|
|
13
|
+
reject(e);
|
|
14
|
+
}
|
|
46
15
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return JSON.parse(customConfigContent);
|
|
54
|
-
} catch (error) {
|
|
55
|
-
// If custom config doesn't exist or can't be read, return empty object
|
|
56
|
-
return {};
|
|
16
|
+
function rejected(value) {
|
|
17
|
+
try {
|
|
18
|
+
step(generator["throw"](value));
|
|
19
|
+
} catch (e) {
|
|
20
|
+
reject(e);
|
|
21
|
+
}
|
|
57
22
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const config = await this.readConfig();
|
|
61
|
-
// Type assertion to handle full object
|
|
62
|
-
if (typeof value === "object" && value !== null) {
|
|
63
|
-
config[key] = value;
|
|
64
|
-
} else {
|
|
65
|
-
throw new Error("Invalid configuration value");
|
|
23
|
+
function step(result) {
|
|
24
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
66
25
|
}
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
26
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var __generator = this && this.__generator || function(thisArg, body) {
|
|
30
|
+
var _ = {
|
|
31
|
+
label: 0,
|
|
32
|
+
sent: function() {
|
|
33
|
+
if (t[0] & 1) throw t[1];
|
|
34
|
+
return t[1];
|
|
35
|
+
},
|
|
36
|
+
trys: [],
|
|
37
|
+
ops: []
|
|
38
|
+
}, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
39
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
40
|
+
return this;
|
|
41
|
+
}), g;
|
|
42
|
+
function verb(n) {
|
|
43
|
+
return function(v) {
|
|
44
|
+
return step([
|
|
45
|
+
n,
|
|
46
|
+
v
|
|
47
|
+
]);
|
|
90
48
|
};
|
|
91
|
-
await this.writeConfig(defaultConfig);
|
|
92
|
-
return defaultConfig;
|
|
93
49
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
50
|
+
function step(op) {
|
|
51
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
52
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
53
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
54
|
+
if (y = 0, t) op = [
|
|
55
|
+
op[0] & 2,
|
|
56
|
+
t.value
|
|
57
|
+
];
|
|
58
|
+
switch(op[0]){
|
|
59
|
+
case 0:
|
|
60
|
+
case 1:
|
|
61
|
+
t = op;
|
|
62
|
+
break;
|
|
63
|
+
case 4:
|
|
64
|
+
_.label++;
|
|
65
|
+
return {
|
|
66
|
+
value: op[1],
|
|
67
|
+
done: false
|
|
68
|
+
};
|
|
69
|
+
case 5:
|
|
70
|
+
_.label++;
|
|
71
|
+
y = op[1];
|
|
72
|
+
op = [
|
|
73
|
+
0
|
|
74
|
+
];
|
|
75
|
+
continue;
|
|
76
|
+
case 7:
|
|
77
|
+
op = _.ops.pop();
|
|
78
|
+
_.trys.pop();
|
|
79
|
+
continue;
|
|
80
|
+
default:
|
|
81
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
82
|
+
_ = 0;
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
86
|
+
_.label = op[1];
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
90
|
+
_.label = t[1];
|
|
91
|
+
t = op;
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
if (t && _.label < t[2]) {
|
|
95
|
+
_.label = t[2];
|
|
96
|
+
_.ops.push(op);
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (t[2]) _.ops.pop();
|
|
100
|
+
_.trys.pop();
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
op = body.call(thisArg, _);
|
|
104
|
+
} catch (e) {
|
|
105
|
+
op = [
|
|
106
|
+
6,
|
|
107
|
+
e
|
|
108
|
+
];
|
|
109
|
+
y = 0;
|
|
110
|
+
} finally{
|
|
111
|
+
f = t = 0;
|
|
112
|
+
}
|
|
113
|
+
if (op[0] & 5) throw op[1];
|
|
114
|
+
return {
|
|
115
|
+
value: op[0] ? op[1] : void 0,
|
|
98
116
|
done: true
|
|
99
117
|
};
|
|
100
118
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow-novice",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"description": "AI agent orchestration framework with namespace-isolated skills, agents, and CFN Loop validation. Safe installation with ~0.01% collision risk.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "Compact conversation history to reduce token usage and maintain context efficiency"
|
|
3
|
-
argument-hint: "[--focus=<topic>] [--threshold=<percentage>]"
|
|
4
|
-
allowed-tools: ["Read", "Write", "Bash", "TodoWrite"]
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Auto-Compact - Programmatic Context Compression
|
|
8
|
-
|
|
9
|
-
Summarize and compress conversation history while preserving key facts, decisions, and context.
|
|
10
|
-
|
|
11
|
-
**Task**: $ARGUMENTS
|
|
12
|
-
|
|
13
|
-
## Command Options
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
/auto-compact
|
|
17
|
-
/auto-compact --focus="security decisions and API changes"
|
|
18
|
-
/auto-compact --threshold=70
|
|
19
|
-
/auto-compact --focus="CFN Loop implementation" --threshold=75
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
**Options:**
|
|
23
|
-
- `--focus=<topic>`: Focus summarization on specific topics (optional)
|
|
24
|
-
- `--threshold=<percentage>`: Token usage threshold to trigger compact (default: 70)
|
|
25
|
-
|
|
26
|
-
## Current Session Analysis
|
|
27
|
-
|
|
28
|
-
**Token Usage**: Check current context usage and determine if compaction is needed.
|
|
29
|
-
|
|
30
|
-
## Compaction Strategy
|
|
31
|
-
|
|
32
|
-
### What to Preserve
|
|
33
|
-
- Key architectural decisions
|
|
34
|
-
- Active task progress and todos
|
|
35
|
-
- Critical bug fixes and security changes
|
|
36
|
-
- Recent consensus validations
|
|
37
|
-
- Current phase/sprint context
|
|
38
|
-
|
|
39
|
-
### What to Compress
|
|
40
|
-
- Verbose implementation details
|
|
41
|
-
- Exploratory discussions
|
|
42
|
-
- Resolved issues and completed tasks
|
|
43
|
-
- Historical context from earlier phases
|
|
44
|
-
- Redundant explanations
|
|
45
|
-
|
|
46
|
-
## Execution Steps
|
|
47
|
-
|
|
48
|
-
1. **Analyze Current Context**: Review token usage and conversation flow
|
|
49
|
-
2. **Extract Key Facts**: Identify critical decisions, active work, and essential context
|
|
50
|
-
3. **Generate Summary**: Create concise summary preserving:
|
|
51
|
-
- Active tasks and blockers
|
|
52
|
-
- Recent decisions (last 10-20% of conversation)
|
|
53
|
-
- Phase/sprint progress
|
|
54
|
-
- Technical debt items
|
|
55
|
-
- Next steps
|
|
56
|
-
4. **Recommend Action**: Suggest when user should run `/compact` with optimal focus
|
|
57
|
-
|
|
58
|
-
## Output Format
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
📊 **Context Analysis**
|
|
62
|
-
- Current tokens: X/200k (Y%)
|
|
63
|
-
- Recommendation: [COMPACT NOW | DEFER | MONITOR]
|
|
64
|
-
|
|
65
|
-
🎯 **Suggested Compact Focus**
|
|
66
|
-
[Generated focus string based on conversation]
|
|
67
|
-
|
|
68
|
-
💡 **Summary Preview**
|
|
69
|
-
[Key facts to preserve in compact]
|
|
70
|
-
|
|
71
|
-
✅ **Action Required**
|
|
72
|
-
Run: /compact focus: "[generated focus]"
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Notes
|
|
76
|
-
|
|
77
|
-
- This command **analyzes** and **recommends** compaction
|
|
78
|
-
- User must manually run `/compact` (built-in command)
|
|
79
|
-
- Threshold default: 70% (140k/200k tokens)
|
|
80
|
-
- Auto-triggered at 95% by Claude Code built-in
|