claude-flow-novice 2.14.30 → 2.14.32
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/cfn-data/cfn-loop.db +0 -0
- package/.claude/commands/CFN_LOOP_TASK_MODE.md +1 -1
- package/.claude/skills/cfn-agent-discovery/agents-registry.json +10 -9
- package/.claude/skills/cfn-docker-agent-spawning/SKILL.md +394 -0
- package/.claude/skills/cfn-docker-agent-spawning/spawn-agent.sh +521 -0
- package/.claude/skills/cfn-docker-loop-orchestration/SKILL.md +449 -0
- package/.claude/skills/cfn-docker-loop-orchestration/orchestrate.sh +787 -0
- package/.claude/skills/cfn-docker-redis-coordination/SKILL.md +435 -0
- package/.claude/skills/cfn-docker-redis-coordination/coordinate.sh +635 -0
- package/.claude/skills/cfn-docker-skill-mcp-selection/SKILL.md +289 -0
- package/.claude/skills/cfn-docker-skill-mcp-selection/skill-mcp-selector.js +472 -0
- package/.claude/skills/cfn-loop-validation/config.json +2 -2
- package/README.md +95 -0
- package/claude-assets/agents/README-AGENT_LIFECYCLE.md +10 -37
- package/claude-assets/agents/README-VALIDATION.md +8 -0
- package/claude-assets/agents/cfn-dev-team/CLAUDE.md +10 -9
- package/claude-assets/agents/cfn-dev-team/README.md +8 -0
- package/claude-assets/agents/cfn-dev-team/architecture/base-template-generator.md +2 -9
- package/claude-assets/agents/cfn-dev-team/coordinators/README.md +9 -1
- package/claude-assets/agents/cfn-dev-team/dev-ops/devops-engineer.md +7 -12
- package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +10 -5
- package/claude-assets/agents/cfn-dev-team/dev-ops/github-commit-agent.md +11 -10
- package/claude-assets/agents/cfn-dev-team/dev-ops/monitoring-specialist.md +10 -5
- package/claude-assets/agents/cfn-dev-team/developers/README.md +9 -1
- package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +2 -5
- package/claude-assets/agents/cfn-dev-team/developers/backend-developer.md +11 -6
- package/claude-assets/agents/cfn-dev-team/developers/database/database-architect.md +2 -5
- package/claude-assets/agents/cfn-dev-team/developers/frontend/mobile-dev.md +2 -19
- package/claude-assets/agents/cfn-dev-team/developers/frontend/react-frontend-engineer.md +11 -6
- package/claude-assets/agents/cfn-dev-team/developers/frontend/ui-designer.md +9 -23
- package/claude-assets/agents/cfn-dev-team/developers/graphql-specialist.md +10 -5
- package/claude-assets/agents/cfn-dev-team/developers/rust-developer.md +2 -9
- package/claude-assets/agents/cfn-dev-team/documentation/README-VALIDATION.md +8 -0
- package/claude-assets/agents/cfn-dev-team/documentation/agent-type-guidelines.md +10 -0
- package/claude-assets/agents/cfn-dev-team/documentation/pseudocode.md +2 -9
- package/claude-assets/agents/cfn-dev-team/product-owners/accessibility-advocate-persona.md +11 -6
- package/claude-assets/agents/cfn-dev-team/product-owners/cto-agent.md +0 -5
- package/claude-assets/agents/cfn-dev-team/product-owners/power-user-persona.md +0 -3
- package/claude-assets/agents/cfn-dev-team/product-owners/product-owner.md +2 -8
- package/claude-assets/agents/cfn-dev-team/reviewers/README.md +9 -1
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/quality-metrics.md +10 -0
- package/claude-assets/agents/cfn-dev-team/test-agent.md +10 -0
- package/claude-assets/agents/cfn-dev-team/testers/README.md +9 -1
- package/claude-assets/agents/cfn-dev-team/utility/analyst.md +0 -7
- package/claude-assets/agents/cfn-dev-team/utility/code-booster.md +1 -38
- package/claude-assets/agents/cfn-dev-team/utility/memory-leak-specialist.md +10 -5
- package/claude-assets/agents/cfn-dev-team/utility/researcher.md +8 -34
- package/claude-assets/agents/cfn-dev-team/utility/z-ai-specialist.md +10 -5
- package/claude-assets/agents/csuite/cto-agent.md +10 -0
- package/claude-assets/agents/custom/cfn-system-expert.md +128 -1
- package/claude-assets/agents/docker-coordinators/cfn-docker-v3-coordinator.md +5 -1
- package/claude-assets/agents/docker-team/csuite/c-suite-template.md +5 -1
- package/claude-assets/agents/docker-team/infrastructure/team-coordinator-template.md +5 -1
- package/claude-assets/agents/marketing_hybrid/cost_tracker.md +10 -0
- package/claude-assets/agents/marketing_hybrid/docker_deployer.md +10 -0
- package/claude-assets/agents/marketing_hybrid/zai_worker_spawner.md +10 -0
- package/claude-assets/agents/project-only-agents/npm-package-specialist.md +9 -26
- package/claude-assets/commands/CFN_LOOP_TASK_MODE.md +1 -1
- package/claude-assets/hooks/cfn-post-execution/memory-cleanup.sh +20 -0
- package/claude-assets/hooks/cfn-pre-execution/memory-check.sh +20 -0
- package/claude-assets/skills/agent-lifecycle/SKILL.md +60 -0
- package/claude-assets/skills/agent-lifecycle/execute-lifecycle-hook.sh +573 -0
- package/claude-assets/skills/agent-lifecycle/simple-audit.sh +31 -0
- package/claude-assets/skills/cfn-agent-discovery/agents-registry.json +10 -9
- package/claude-assets/skills/cfn-docker-agent-spawning/spawn-agent.sh +70 -10
- package/claude-assets/skills/cfn-loop-validation/config.json +2 -2
- package/claude-assets/skills/cfn-memory-management/SKILL.md +271 -0
- package/claude-assets/skills/cfn-memory-management/check-memory.sh +160 -0
- package/claude-assets/skills/cfn-memory-management/cleanup-memory.sh +197 -0
- package/claude-assets/skills/cfn-task-config-init/initialize-config.sh +2 -2
- package/dist/agents/agent-loader.js +165 -146
- package/dist/agents/agent-loader.js.map +1 -1
- package/dist/cli/agent-command.js +44 -2
- package/dist/cli/agent-command.js.map +1 -1
- package/dist/cli/config-manager.js +91 -109
- package/dist/cli/config-manager.js.map +1 -1
- package/dist/cli/index.js +29 -2
- package/dist/cli/index.js.map +1 -1
- package/package.json +10 -2
- package/readme/README.md +71 -14
- package/scripts/memory-leak-prevention.sh +306 -0
|
@@ -14,15 +14,6 @@ validation_hooks:
|
|
|
14
14
|
- agent-template-validator
|
|
15
15
|
- cfn-loop-memory-validator
|
|
16
16
|
- test-coverage-validator
|
|
17
|
-
lifecycle:
|
|
18
|
-
pre_task: |
|
|
19
|
-
sqlite-cli exec "INSERT INTO agents (id, type, status, spawned_at)
|
|
20
|
-
VALUES ('${AGENT_ID}', 'code-booster', 'active', CURRENT_TIMESTAMP)"
|
|
21
|
-
post_task: |
|
|
22
|
-
sqlite-cli exec "UPDATE agents
|
|
23
|
-
SET status = 'completed', confidence = ${CONFIDENCE_SCORE},
|
|
24
|
-
completed_at = CURRENT_TIMESTAMP
|
|
25
|
-
WHERE id = '${AGENT_ID}'"
|
|
26
17
|
---
|
|
27
18
|
|
|
28
19
|
# Code Booster Agent
|
|
@@ -48,35 +39,6 @@ Specialized performance optimization expert leveraging WASM acceleration and adv
|
|
|
48
39
|
- Manage compute offloading
|
|
49
40
|
- Create efficient resource pools
|
|
50
41
|
|
|
51
|
-
## SQLite Integration Pattern
|
|
52
|
-
|
|
53
|
-
```typescript
|
|
54
|
-
// Performance metrics storage
|
|
55
|
-
await sqlite.memoryAdapter.set(
|
|
56
|
-
`code-booster/${agentId}/optimization/${taskId}`,
|
|
57
|
-
{
|
|
58
|
-
confidence: 0.90,
|
|
59
|
-
speedup: 3.5, // 3.5x performance improvement
|
|
60
|
-
memoryReduction: 0.4, // 40% memory reduction
|
|
61
|
-
files: ['optimized-module.rs', 'wasm-acceleration.js']
|
|
62
|
-
},
|
|
63
|
-
{ aclLevel: 1, ttl: 2592000 }
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
// CFN Loop performance tracking
|
|
67
|
-
await sqlite.memoryAdapter.set(
|
|
68
|
-
`cfn/phase-${phaseId}/loop3/agent-${agentId}`,
|
|
69
|
-
{
|
|
70
|
-
confidence: 0.90,
|
|
71
|
-
metrics: {
|
|
72
|
-
speedup: 3.5,
|
|
73
|
-
memoryReduction: 0.4
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
{ aclLevel: 1, ttl: 2592000 }
|
|
77
|
-
);
|
|
78
|
-
```
|
|
79
|
-
|
|
80
42
|
## Success Metrics
|
|
81
43
|
- ✅ 2-10x performance improvement
|
|
82
44
|
- ✅ 20-50% memory reduction
|
|
@@ -95,6 +57,7 @@ npx claude-flow@alpha hooks post-edit [FILE_PATH] \
|
|
|
95
57
|
--memory-key "code-booster/${AGENT_ID}/optimization" \
|
|
96
58
|
--structured
|
|
97
59
|
```
|
|
60
|
+
|
|
98
61
|
## Completion Protocol
|
|
99
62
|
|
|
100
63
|
Complete your work and provide a structured response with:
|
|
@@ -16,11 +16,6 @@ acl_level: 1
|
|
|
16
16
|
validation_hooks:
|
|
17
17
|
- agent-template-validator
|
|
18
18
|
- test-coverage-validator
|
|
19
|
-
lifecycle:
|
|
20
|
-
pre_task: |
|
|
21
|
-
sqlite-cli exec "INSERT INTO agents (id, type, status, spawned_at) VALUES ('${AGENT_ID}', 'memory-leak-specialist', 'active', CURRENT_TIMESTAMP)"
|
|
22
|
-
post_task: |
|
|
23
|
-
sqlite-cli exec "UPDATE agents SET status = 'completed', confidence = ${CONFIDENCE_SCORE}, completed_at = CURRENT_TIMESTAMP WHERE id = '${AGENT_ID}'"
|
|
24
19
|
---
|
|
25
20
|
|
|
26
21
|
# Memory Leak Specialist Agent
|
|
@@ -746,6 +741,16 @@ Before reporting high confidence:
|
|
|
746
741
|
- Heap utilization optimized (<80% of max)
|
|
747
742
|
- Confidence score ≥ 0.90
|
|
748
743
|
|
|
744
|
+
## Completion Protocol
|
|
745
|
+
|
|
746
|
+
Complete your work and provide a structured response with:
|
|
747
|
+
- Confidence score (0.0-1.0) based on work quality
|
|
748
|
+
- Summary of analysis/review completed
|
|
749
|
+
- List of findings or deliverables
|
|
750
|
+
- Any recommendations made
|
|
751
|
+
|
|
752
|
+
**Note:** Coordination instructions are provided when spawned via CLI.
|
|
753
|
+
|
|
749
754
|
## Skill References
|
|
750
755
|
→ **Node.js Profiling**: `.claude/skills/nodejs-memory-profiling/SKILL.md`
|
|
751
756
|
→ **Python Profiling**: `.claude/skills/python-memory-analysis/SKILL.md`
|
|
@@ -8,11 +8,6 @@ type: specialist
|
|
|
8
8
|
acl_level: 1
|
|
9
9
|
validation_hooks:
|
|
10
10
|
- agent-template-validator
|
|
11
|
-
lifecycle:
|
|
12
|
-
pre_task: |
|
|
13
|
-
sqlite-cli exec "INSERT INTO agents (id, type, status, spawned_at) VALUES ('${AGENT_ID}', 'researcher', 'active', CURRENT_TIMESTAMP)"
|
|
14
|
-
post_task: |
|
|
15
|
-
sqlite-cli exec "UPDATE agents SET status = 'completed', confidence = ${CONFIDENCE_SCORE}, completed_at = CURRENT_TIMESTAMP WHERE id = '${AGENT_ID}'"
|
|
16
11
|
---
|
|
17
12
|
|
|
18
13
|
# Researcher Agent
|
|
@@ -101,36 +96,15 @@ confidence = (
|
|
|
101
96
|
}
|
|
102
97
|
```
|
|
103
98
|
|
|
104
|
-
##
|
|
105
|
-
|
|
106
|
-
### Research State Tracking
|
|
107
|
-
```javascript
|
|
108
|
-
// Store research confidence and findings
|
|
109
|
-
await sqlite.memoryAdapter.set(
|
|
110
|
-
`researcher/${agentId}/confidence/${taskId}`,
|
|
111
|
-
{
|
|
112
|
-
confidence: 0.85,
|
|
113
|
-
sources: 12,
|
|
114
|
-
noveltyScore: 0.75
|
|
115
|
-
},
|
|
116
|
-
{ aclLevel: 1, ttl: 2592000 } // 30 days retention
|
|
117
|
-
);
|
|
118
|
-
```
|
|
99
|
+
## Completion Protocol
|
|
119
100
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
sqlite.memoryAdapter.set(key, researchFindings, { aclLevel: 1 })
|
|
128
|
-
);
|
|
129
|
-
} else {
|
|
130
|
-
console.error('Research persistence failed:', error);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
```
|
|
101
|
+
Complete your work and provide a structured response with:
|
|
102
|
+
- Confidence score (0.0-1.0) based on work quality
|
|
103
|
+
- Summary of analysis/review completed
|
|
104
|
+
- List of findings or deliverables
|
|
105
|
+
- Any recommendations made
|
|
106
|
+
|
|
107
|
+
**Note:** Coordination instructions are provided when spawned via CLI.
|
|
134
108
|
|
|
135
109
|
## Post-Edit Hook Validation
|
|
136
110
|
|
|
@@ -15,11 +15,6 @@ acl_level: 1
|
|
|
15
15
|
validation_hooks:
|
|
16
16
|
- agent-template-validator
|
|
17
17
|
- test-coverage-validator
|
|
18
|
-
lifecycle:
|
|
19
|
-
pre_task: |
|
|
20
|
-
sqlite-cli exec "INSERT INTO agents (id, type, status, spawned_at) VALUES ('${AGENT_ID}', 'z-ai-specialist', 'active', CURRENT_TIMESTAMP)"
|
|
21
|
-
post_task: |
|
|
22
|
-
sqlite-cli exec "UPDATE agents SET status = 'completed', confidence = ${CONFIDENCE_SCORE}, completed_at = CURRENT_TIMESTAMP WHERE id = '${AGENT_ID}'"
|
|
23
18
|
---
|
|
24
19
|
|
|
25
20
|
# Z.ai Specialist Agent
|
|
@@ -619,6 +614,16 @@ Before reporting high confidence:
|
|
|
619
614
|
- Usage tracking accurate (100% requests logged)
|
|
620
615
|
- Confidence score ≥ 0.90
|
|
621
616
|
|
|
617
|
+
## Completion Protocol
|
|
618
|
+
|
|
619
|
+
Complete your work and provide a structured response with:
|
|
620
|
+
- Confidence score (0.0-1.0) based on work quality
|
|
621
|
+
- Summary of analysis/review completed
|
|
622
|
+
- List of findings or deliverables
|
|
623
|
+
- Any recommendations made
|
|
624
|
+
|
|
625
|
+
**Note:** Coordination instructions are provided when spawned via CLI.
|
|
626
|
+
|
|
622
627
|
## Skill References
|
|
623
628
|
→ **Z.ai Setup**: `.claude/skills/zai-platform-setup/SKILL.md`
|
|
624
629
|
→ **Cost Optimization**: `.claude/skills/ai-cost-optimization/SKILL.md`
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cto-agent
|
|
3
|
+
description: MUST BE USED when making strategic technical decisions and architectural oversight. Use PROACTIVELY for technical roadmap planning, architecture reviews, strategic guidance. Keywords - CTO, technical strategy, architecture, leadership, oversight
|
|
4
|
+
tools: [Read, Write, Edit, Bash, Grep, Glob, TodoWrite]
|
|
5
|
+
model: sonnet
|
|
6
|
+
type: coordinator
|
|
7
|
+
acl_level: 4
|
|
8
|
+
capabilities: [technical-strategy, architecture-oversight, leadership]
|
|
9
|
+
---
|
|
10
|
+
|
|
1
11
|
# CTO Agent - Dr. Tech
|
|
2
12
|
|
|
3
13
|
## Role Identity
|
|
@@ -256,4 +256,131 @@ redis-cli lpush "swarm:${TASK_ID}:${AGENT_ID}:done" "complete"
|
|
|
256
256
|
- `.claude/skills/cfn-redis-coordination/SKILL.md`: Coordination patterns
|
|
257
257
|
- `.claude/commands/cfn/CFN_COORDINATOR_PARAMETERS.md`: Parameter specifications
|
|
258
258
|
- `planning/cfn-v3/DUAL_MODE_IMPLEMENTATION.md`: Architecture details
|
|
259
|
-
- Planning documents: Sprint lessons and adaptive context insights
|
|
259
|
+
- Planning documents: Sprint lessons and adaptive context insights
|
|
260
|
+
|
|
261
|
+
## CFN Implementation Patterns & Lessons Learned
|
|
262
|
+
|
|
263
|
+
### Core Architecture Patterns
|
|
264
|
+
|
|
265
|
+
#### STRAT-007: Background Execution Strategy
|
|
266
|
+
- **Insight**: Use background execution with coordination monitoring for long-running orchestration workflows (>10 minutes). Bash tool has hard 10-minute timeout that cannot be extended.
|
|
267
|
+
- **Application**: Essential for CFN Loop orchestration that exceeds standard timeout limits.
|
|
268
|
+
|
|
269
|
+
#### PATTERN-008: Product Owner Decision Flow
|
|
270
|
+
- **Insight**: Implement explicit Product Owner decision flow after Loop 2 consensus to prevent validator scope creep and enforce strategic boundaries.
|
|
271
|
+
- **Application**: Core CFN Loop governance pattern ensuring proper decision hierarchy.
|
|
272
|
+
|
|
273
|
+
#### PATTERN-010: Parallel Execution with Temp Files
|
|
274
|
+
- **Insight**: Use background processes with temporary files to eliminate race conditions in parallel agent coordination. Pattern: spawn all agents in background with `(skill-execution > /tmp/output-file) &`, collect PIDs, use `wait` to synchronize, read results from temp files after completion.
|
|
275
|
+
- **Application**: Optimizes CFN Loop parallel agent execution while maintaining coordination integrity.
|
|
276
|
+
|
|
277
|
+
### Context Management Patterns
|
|
278
|
+
|
|
279
|
+
#### STRAT-021: Standardized Context Extraction Templates
|
|
280
|
+
- **Insight**: Use standardized context extraction templates in coordinators. Template structure: epicGoal (1-2 sentences), inScope (list), outOfScope (list), deliverables (file paths), directory (creation path), acceptanceCriteria (measurable requirements).
|
|
281
|
+
- **Application**: Prevents minimal context that causes wrong deliverables in CFN execution.
|
|
282
|
+
|
|
283
|
+
#### PATTERN-020: Multi-Layer Context Injection
|
|
284
|
+
- **Context**: Coordinator → Orchestrator → Agent Flow
|
|
285
|
+
- **Insight**: When implementing multi-layer coordination, ensure context flows through ALL layers. Breaking this chain causes 'consensus on vapor' (high confidence, zero deliverables).
|
|
286
|
+
- **Application**: Critical for CFN Loop context integrity across coordinator-orchestrator-agent chain.
|
|
287
|
+
|
|
288
|
+
#### PATTERN-021: Context Validation Pipeline
|
|
289
|
+
- **Context**: Multi-Layer Coordination
|
|
290
|
+
- **Insight**: Design context validation pipeline with checkpoints at each layer. Pattern: (1) Coordinator validates extracted context, (2) Orchestrator validates persistence retrieval, (3) Agents validate received context.
|
|
291
|
+
- **Application**: Fail-fast prevents cascading context loss in CFN workflows.
|
|
292
|
+
|
|
293
|
+
#### PATTERN-022: Agent Lifecycle - Clean Exit Protocol
|
|
294
|
+
- **Insight**: Agents must exit cleanly after reporting confidence. Pattern: (1) Signal done via coordination protocol, (2) Report confidence score, (3) Exit immediately.
|
|
295
|
+
- **Application**: Enables adaptive agent specialization and prevents orchestrator blocking.
|
|
296
|
+
|
|
297
|
+
### Sprint Execution Patterns
|
|
298
|
+
|
|
299
|
+
#### Sprint Context Structure
|
|
300
|
+
```json
|
|
301
|
+
{
|
|
302
|
+
"sprint_name": "P1 Coordinator Monitoring",
|
|
303
|
+
"sprint_num": 1,
|
|
304
|
+
"total_sprints": 7,
|
|
305
|
+
"deliverables": [
|
|
306
|
+
"test-p1-monitoring.sh",
|
|
307
|
+
"docs/P1_MONITORING_RESULTS.md"
|
|
308
|
+
],
|
|
309
|
+
"in_scope": [
|
|
310
|
+
"P1 coordinator monitoring validation",
|
|
311
|
+
"Test timeout mechanisms",
|
|
312
|
+
"Logging verification"
|
|
313
|
+
],
|
|
314
|
+
"out_of_scope": [
|
|
315
|
+
"P2-P7 monitoring",
|
|
316
|
+
"Cross-priority integration",
|
|
317
|
+
"Epic-level summary"
|
|
318
|
+
],
|
|
319
|
+
"directory": "/mnt/c/Users/masha/Documents/claude-flow-novice/tests/p1"
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
#### Sprint Execution Tool: `execute-sprint-task.sh`
|
|
324
|
+
- **Purpose**: Enables sprint-aware agent execution with focused context injection
|
|
325
|
+
- **Usage**: Decompose large epics into focused sprints with clear deliverables and scope boundaries
|
|
326
|
+
- **Key Principles**: Focused scope, incremental progress, precise deliverables, context specificity
|
|
327
|
+
|
|
328
|
+
### CFN v3 Advanced Patterns
|
|
329
|
+
|
|
330
|
+
#### STRAT-026: Persistence Context Storage Over CLI Parameters
|
|
331
|
+
- **Insight**: Use persistence layer for complex JSON context storage instead of CLI parameters. Eliminates shell escaping issues, enables swarm recovery, and provides single source of truth.
|
|
332
|
+
- **Application**: Foundation for CFN v3 dual-mode architecture.
|
|
333
|
+
|
|
334
|
+
#### PATTERN-023: Dual-Mode Architecture Pattern
|
|
335
|
+
- **Insight**: Implement dual execution modes (optimized vs simplified) sharing core logic. CLI mode for production (cost-optimized), Task mode for debugging (full visibility).
|
|
336
|
+
- **Application**: Enables flexible CFN execution based on user needs.
|
|
337
|
+
|
|
338
|
+
#### PATTERN-024: Swarm Recovery via Persistence
|
|
339
|
+
- **Insight**: Store swarm state in persistence layer with TTL to enable crash recovery. Agents can resume from last known state using task_id as recovery key.
|
|
340
|
+
- **Application**: Critical for long-running CFN Loops and system reliability.
|
|
341
|
+
|
|
342
|
+
#### STRAT-028: Modular Skill Architecture
|
|
343
|
+
- **Insight**: Decompose complex systems into independent skills (20 skills in CFN v3). Enables reuse, testing isolation, and incremental enhancement.
|
|
344
|
+
- **Application**: Core architectural principle for CFN system maintainability.
|
|
345
|
+
|
|
346
|
+
### CFN Anti-Patterns & Prevention
|
|
347
|
+
|
|
348
|
+
#### ANTI-020: Context Storage Without Injection
|
|
349
|
+
- **Context**: Coordination Systems
|
|
350
|
+
- **Insight**: Avoid storing context in persistence layer without retrieving and injecting it into agent prompts.
|
|
351
|
+
- **Prevention**: Always validate context injection chain: storage → retrieval → agent delivery.
|
|
352
|
+
|
|
353
|
+
#### ANTI-021: Generic Context When Specifics Exist
|
|
354
|
+
- **Context**: Agent Spawning
|
|
355
|
+
- **Insight**: Never pass generic iteration-level context when task-specific deliverables exist.
|
|
356
|
+
- **Prevention**: Always inject complete deliverables, directory paths, and acceptance criteria.
|
|
357
|
+
|
|
358
|
+
#### ANTI-023: Task-Spawned Validators Without Completion Protocol
|
|
359
|
+
- **Context**: Loop 2 Validation (Task Mode)
|
|
360
|
+
- **Insight**: Main Chat spawns validators via Task() without clear scope boundaries or mode-aware completion protocols.
|
|
361
|
+
- **Prevention**: Task-spawned validators should return structured output only - no coordination signals.
|
|
362
|
+
|
|
363
|
+
### CFN Testing & Debugging
|
|
364
|
+
|
|
365
|
+
#### EDGE-020: Comparative Agent Spawn Testing
|
|
366
|
+
- **Context**: Context Debugging
|
|
367
|
+
- **Insight**: When debugging context issues, use comparative agent spawn testing. Manual spawn with explicit context vs CFN Loop with generic context reveals injection failures.
|
|
368
|
+
- **Application**: Primary debugging technique for context-related CFN issues.
|
|
369
|
+
|
|
370
|
+
### Universal Anti-Patterns (CFN Relevance)
|
|
371
|
+
|
|
372
|
+
#### ANTI-004: Regex Validation Anti-Pattern
|
|
373
|
+
- **Insight**: Avoid simplistic regex matching for agent validation. Pattern `[[ $AGENTS =~ $AGENTS ]]` always returns true.
|
|
374
|
+
- **CFN Relevance**: Critical for agent validation logic in CFN coordination.
|
|
375
|
+
|
|
376
|
+
#### PATTERN-025: Comprehensive File Validation
|
|
377
|
+
- **Insight**: Implement multi-stage validation including file type, permissions, size constraints, and content integrity.
|
|
378
|
+
- **CFN Relevance**: Essential for CFN deliverable verification and security.
|
|
379
|
+
|
|
380
|
+
#### PATTERN-026: Shell Strict Mode
|
|
381
|
+
- **Insight**: Enable shell strict mode using `set -euo pipefail` for robust and predictable shell scripts.
|
|
382
|
+
- **CFN Relevance**: Critical reliability pattern for all CFN skill scripts.
|
|
383
|
+
|
|
384
|
+
#### PATTERN-028: Process Group Management
|
|
385
|
+
- **Insight**: Implement comprehensive process group management for clean termination and resource cleanup.
|
|
386
|
+
- **CFN Relevance**: Essential for CFN background process orchestration and preventing resource leaks.
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
name: cfn-docker-v3-coordinator
|
|
3
|
+
description: MUST BE USED when orchestrating container-based CFN Loop execution with MCP isolation. Use PROACTIVELY for docker-based agent coordination, skill selection, resource management. Keywords - docker, containers, orchestration, MCP, isolation
|
|
3
4
|
argument-hint: "[task-description] --mode=mvp|standard|enterprise --memory-limit=1g --docker-network=mcp-network"
|
|
4
5
|
allowed-tools: ["Bash", "Read", "Write", "Edit", "Grep", "Glob", "TodoWrite", "Task"]
|
|
6
|
+
model: sonnet
|
|
7
|
+
type: coordinator
|
|
8
|
+
acl_level: 3
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
# CFN Docker V3 Coordinator
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
name: c-suite-template
|
|
3
|
+
description: MUST BE USED when creating C-Suite executive personas for strategic decision-making. Use PROACTIVELY for organizational architecture, executive strategy, decision authority. Keywords - c-suite, executive, strategy, decision-making, leadership
|
|
3
4
|
tools: [Read, Write, TodoWrite, Bash]
|
|
4
5
|
priority: medium
|
|
5
6
|
tags: [csuite, executive, strategy, decision-making, cmo, cfo, coo, ceo]
|
|
7
|
+
model: sonnet
|
|
8
|
+
type: specialist
|
|
9
|
+
acl_level: 4
|
|
6
10
|
---
|
|
7
11
|
|
|
8
12
|
# C-Suite Agent Template
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
name: team-coordinator-template
|
|
3
|
+
description: MUST BE USED when generating team-specific coordinator configurations for Docker architecture. Use PROACTIVELY for infrastructure templating, team configuration, Docker services. Keywords - docker, infrastructure, templating, coordinator, team-config
|
|
3
4
|
tools: [Read, Write, Edit, Bash, Grep, Glob]
|
|
4
5
|
priority: high
|
|
5
6
|
tags: [docker, infrastructure, templating, coordinator, team-config]
|
|
7
|
+
model: haiku
|
|
8
|
+
type: specialist
|
|
9
|
+
acl_level: 3
|
|
6
10
|
---
|
|
7
11
|
|
|
8
12
|
# Team Coordinator Template Agent
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cost-tracker
|
|
3
|
+
description: MUST BE USED when monitoring Z.ai worker costs during pilot testing. Use PROACTIVELY for cost tracking, budget monitoring, expense reporting. Keywords - cost, tracking, monitoring, Z.ai, budget, expenses
|
|
4
|
+
tools: [Read, Write, Edit, Bash, Grep, Glob, TodoWrite]
|
|
5
|
+
model: haiku
|
|
6
|
+
type: specialist
|
|
7
|
+
acl_level: 2
|
|
8
|
+
capabilities: [cost-monitoring, budget-tracking, expense-reporting]
|
|
9
|
+
---
|
|
10
|
+
|
|
1
11
|
# Cost Tracking Agent
|
|
2
12
|
## Role
|
|
3
13
|
Monitor Z.ai worker costs during 48-hour pilot
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docker-deployer
|
|
3
|
+
description: MUST BE USED when deploying marketing coordinator services via Docker. Use PROACTIVELY for container deployment, service configuration, docker-compose management. Keywords - docker, deploy, containers, docker-compose, services
|
|
4
|
+
tools: [Read, Write, Edit, Bash, Grep, Glob, TodoWrite]
|
|
5
|
+
model: haiku
|
|
6
|
+
type: specialist
|
|
7
|
+
acl_level: 2
|
|
8
|
+
capabilities: [docker-deployment, container-management, service-configuration]
|
|
9
|
+
---
|
|
10
|
+
|
|
1
11
|
# Docker Deployer Agent
|
|
2
12
|
## Role
|
|
3
13
|
Deploy marketing coordinator using docker-compose.hybrid.yml
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: zai-worker-spawner
|
|
3
|
+
description: MUST BE USED when spawning Z.ai workers for marketing pilot testing. Use PROACTIVELY for worker orchestration, API configuration, service scaling. Keywords - Z.ai, worker, spawner, scaling, orchestration
|
|
4
|
+
tools: [Read, Write, Edit, Bash, Grep, Glob, TodoWrite]
|
|
5
|
+
model: haiku
|
|
6
|
+
type: specialist
|
|
7
|
+
acl_level: 2
|
|
8
|
+
capabilities: [worker-spawning, service-orchestration, api-configuration]
|
|
9
|
+
---
|
|
10
|
+
|
|
1
11
|
# Z.ai Worker Spawner Agent
|
|
2
12
|
## Role
|
|
3
13
|
Spawn 3 Z.ai workers for marketing pilot
|
|
@@ -15,15 +15,6 @@ validation_hooks:
|
|
|
15
15
|
- agent-template-validator
|
|
16
16
|
- cfn-loop-memory-validator
|
|
17
17
|
- test-coverage-validator
|
|
18
|
-
lifecycle:
|
|
19
|
-
pre_task: |
|
|
20
|
-
sqlite-cli exec "INSERT INTO agents (id, type, status, spawned_at)
|
|
21
|
-
VALUES ('${AGENT_ID}', 'npm-package-specialist', 'active', CURRENT_TIMESTAMP)"
|
|
22
|
-
post_task: |
|
|
23
|
-
sqlite-cli exec "UPDATE agents
|
|
24
|
-
SET status = 'completed', confidence = ${CONFIDENCE_SCORE},
|
|
25
|
-
completed_at = CURRENT_TIMESTAMP
|
|
26
|
-
WHERE id = '${AGENT_ID}'"
|
|
27
18
|
acl_level: 1
|
|
28
19
|
coordination_role: implementer
|
|
29
20
|
mode_support: [mvp, standard, enterprise]
|
|
@@ -311,23 +302,15 @@ npm publish --tag beta
|
|
|
311
302
|
- [ ] Documentation accessible
|
|
312
303
|
- [ ] npm registry page displays correctly
|
|
313
304
|
|
|
314
|
-
##
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
// Store publish metadata
|
|
325
|
-
await sqlite.memoryAdapter.set(
|
|
326
|
-
`npm-package/${agentId}/publish/${version}`,
|
|
327
|
-
publishMetadata,
|
|
328
|
-
{ aclLevel: 1, ttl: 31536000 } // 1 year
|
|
329
|
-
);
|
|
330
|
-
```
|
|
305
|
+
## Completion Protocol
|
|
306
|
+
|
|
307
|
+
Complete your work and provide a structured response with:
|
|
308
|
+
- Confidence score (0.0-1.0) based on work quality
|
|
309
|
+
- Summary of analysis/review completed
|
|
310
|
+
- List of findings or deliverables
|
|
311
|
+
- Any recommendations made
|
|
312
|
+
|
|
313
|
+
**Note:** Coordination instructions are provided when spawned via CLI.
|
|
331
314
|
|
|
332
315
|
## Success Metrics
|
|
333
316
|
|
|
@@ -467,7 +467,7 @@ Complex/Enterprise (>5 files, >500 LOC): +code-analyzer
|
|
|
467
467
|
### Complexity Analysis CLI
|
|
468
468
|
```bash
|
|
469
469
|
./.claude/skills/task-complexity/analyze.sh --task "$DESC" --files "$LIST"
|
|
470
|
-
# Output: {"score": 85, "category": "standard", "validators": ["reviewer","tester","architect","security-specialist"], "threshold": 0.90}
|
|
470
|
+
# Output: {"score": 85, "category": "standard", "validators": ["reviewer","tester","system-architect","security-specialist"], "threshold": 0.90}
|
|
471
471
|
```
|
|
472
472
|
|
|
473
473
|
---
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# CFN Post-Execution Memory Cleanup Hook
|
|
4
|
+
# Automatically cleans up memory resources after CFN operations
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
# Hook configuration
|
|
9
|
+
HOOK_SCRIPT_PATH="$(dirname "$0")/memory-cleanup.sh"
|
|
10
|
+
MEMORY_MANAGEMENT_SKILL="$(dirname "$0")/../../skills/cfn-memory-management/cleanup-memory.sh"
|
|
11
|
+
|
|
12
|
+
# Use the memory management skill if available, otherwise use local fallback
|
|
13
|
+
if [[ -f "$MEMORY_MANAGEMENT_SKILL" ]]; then
|
|
14
|
+
exec "$MEMORY_MANAGEMENT_SKILL" "$@"
|
|
15
|
+
elif [[ -f "$HOOK_SCRIPT_PATH" ]]; then
|
|
16
|
+
exec "$HOOK_SCRIPT_PATH" "$@"
|
|
17
|
+
else
|
|
18
|
+
echo "WARNING: Memory cleanup scripts not found, skipping cleanup"
|
|
19
|
+
exit 0
|
|
20
|
+
fi
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# CFN Pre-Execution Memory Check Hook
|
|
4
|
+
# Automatically checks memory availability before CFN operations
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
# Hook configuration
|
|
9
|
+
HOOK_SCRIPT_PATH="$(dirname "$0")/memory-check.sh"
|
|
10
|
+
MEMORY_MANAGEMENT_SKILL="$(dirname "$0")/../../skills/cfn-memory-management/check-memory.sh"
|
|
11
|
+
|
|
12
|
+
# Use the memory management skill if available, otherwise use local fallback
|
|
13
|
+
if [[ -f "$MEMORY_MANAGEMENT_SKILL" ]]; then
|
|
14
|
+
exec "$MEMORY_MANAGEMENT_SKILL" "$@"
|
|
15
|
+
elif [[ -f "$HOOK_SCRIPT_PATH" ]]; then
|
|
16
|
+
exec "$HOOK_SCRIPT_PATH" "$@"
|
|
17
|
+
else
|
|
18
|
+
echo "WARNING: Memory check scripts not found, proceeding without memory validation"
|
|
19
|
+
exit 0
|
|
20
|
+
fi
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Agent Lifecycle Management Skill
|
|
2
|
+
|
|
3
|
+
**Purpose:** Enable agents to execute SQLite lifecycle hooks for auditing purposes
|
|
4
|
+
|
|
5
|
+
**Description:** This skill provides agents with the ability to register their lifecycle events (spawn, confidence updates, completion) in a SQLite database for audit trail and cross-session recovery.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
### Agent Spawn Registration
|
|
10
|
+
```bash
|
|
11
|
+
# Register agent when starting work
|
|
12
|
+
./.claude/skills/agent-lifecycle/execute-lifecycle-hook.sh spawn \
|
|
13
|
+
--agent-id "${AGENT_ID}" \
|
|
14
|
+
--agent-type "${AGENT_TYPE}" \
|
|
15
|
+
--acl-level 1 \
|
|
16
|
+
--name "${AGENT_NAME}"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Confidence Updates
|
|
20
|
+
```bash
|
|
21
|
+
# Update confidence during work
|
|
22
|
+
./.claude/skills/agent-lifecycle/execute-lifecycle-hook.sh update \
|
|
23
|
+
--agent-id "${AGENT_ID}" \
|
|
24
|
+
--confidence 0.85 \
|
|
25
|
+
--reasoning "Implementation complete, all tests passing"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Agent Completion
|
|
29
|
+
```bash
|
|
30
|
+
# Mark agent as completed
|
|
31
|
+
./.claude/skills/agent-lifecycle/execute-lifecycle-hook.sh complete \
|
|
32
|
+
--agent-id "${AGENT_ID}" \
|
|
33
|
+
--confidence 0.90 \
|
|
34
|
+
--output "Successfully implemented feature with 95% test coverage"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Integration in Agent Profiles
|
|
38
|
+
|
|
39
|
+
Add to agent completion protocol:
|
|
40
|
+
|
|
41
|
+
```markdown
|
|
42
|
+
## Lifecycle Management
|
|
43
|
+
- Execute spawn registration at start
|
|
44
|
+
- Update confidence during implementation
|
|
45
|
+
- Log completion with confidence score
|
|
46
|
+
- Maintain audit trail in SQLite database
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Database Schema
|
|
50
|
+
|
|
51
|
+
The SQLite database contains:
|
|
52
|
+
- `agents` table: Agent information and status
|
|
53
|
+
- `lifecycle_events` table: Complete audit trail
|
|
54
|
+
|
|
55
|
+
## Security
|
|
56
|
+
|
|
57
|
+
- ACL levels enforced (1-6)
|
|
58
|
+
- Input validation for all parameters
|
|
59
|
+
- Sanitized error messages
|
|
60
|
+
- Atomic operations to prevent race conditions
|