Self-Evolving Agent v5.11.0
[Version Check] → North Star Alignment → [Worktree Isolation] → PSB Environment Check → Goal Analysis (🔗 brainstorming) → Automatic Domain Identification → Capability Assessment → Skill Acquisition → PDCA Execution (🔗 TDD + verification) → Diagnosis (🔗 systematic-debugging) → Multi-Strategy Retries → Repo Memory → Regular Health Check → [Worktree Completion] → Until Success
Quick Overview
This skill adopts an atomic architecture, splitting knowledge into independent modules:
| Module | Purpose | Path |
|---|
| 00-getting-started | Getting Started & Environment Setup | → |
| 01-core | Core Workflow (PSB + PDCA) | → |
| 02-checkpoints | Mandatory Checkpoints (Guardrails) | → |
| 03-memory | Memory System Operations | → |
| 04-emergence | Emergence Mechanism | → |
| 05-integration | External Tool Integration (including superpowers) | → |
| 06-scaling | Large-Scale Project Optimization | → |
| 99-evolution | Self-Evolution Mechanism | → |
Usage
bash
/evolve [Goal Description]
# Examples
/evolve Create a ComfyUI workflow that automatically generates game item images
/evolve Optimize the performance of this code, targeting a 50% reduction in execution time
/evolve Establish full test coverage for this project to reach 80%
Flags
bash
--explore # Exploration Mode - Allow autonomous direction selection
--emergence # Emergence Mode - Enable cross-domain connection exploration
--autonomous # Autonomous Mode - Fully independent, pursuing systematic innovation
--max-iterations N # Maximum number of iterations (default 10)
--from-spec NAME # Execute from spec-workflow's tasks.md
Core Philosophy
The essence of human-AI collaboration: Communicate through abstract interfaces
| Traditional Software | AI Collaboration | Purpose |
|---|
| API | MCP | Capability Boundaries (what can be done) |
| SDK/Library | Tools | Specific Implementation (how to do it) |
| Docs + Practices | Skill | Domain Knowledge (when to use what) |
| Config | CLAUDE.md | Context Constraints (project specifications) |
Deep Insights:
- Skill is not just knowledge, but "packaged judgment"
- Tell the AI when to use which method to achieve what goal
- Reduce decision points > let the AI choose on its own
Design Principles
| Principle | Description |
|---|
| Opinionated Design | Reasonable defaults > letting AI choose, required parameters ≤ 2 |
| Deep & Narrow | Focus on 10% high-value tasks, do not pursue functional breadth |
| Expect Failure | 95% of Agents fail in production environments as normal, design graceful degradation |
| Enhanced Feedback | Remind of goals and progress during execution, explain impact scope when failing |
Execution Process Overview
Self-Evolving Loop v5.2
- 🔄 Version Check (Automatic) — Check for updates, ask user, auto-update
- 🌟 CP0: North Star Alignment — Vision, completion criteria, no-do list, motivation
- 🔒 CP0.5: Worktree Isolation (Conditional Trigger) — Level 2 / autonomous / parallel tasks
- PSB System — Plan → Setup → Build (environment preparation)
- Goal Analysis — In-depth interview + architecture level judgment (mandatory for Level 2)
- Capability Assessment → Skill Acquisition
- PDCA Cycle — Plan → Do → Check → Act (including multi-strategy selection)
- CP3: Direction Correction (align with North Star)
- Git-based Memory — Record learning experiences
- 🏥 CP6: Project Health Check (every 5 iterations) — Scope, direction, termination check
- 🏁 CP6.5: Worktree Completion (Conditional Trigger) — Merge/cleanup
↻ Repeat until: Goal achieved or maximum iterations reached
Key Features: Superpowers Integration | LEANN Semantic Search | Worktree Isolation | North Star System | In-Depth Interview
See details: CHANGELOG | 05-integration | 02-checkpoints
Three-Tier Architecture Consideration
| Layer | Phase | Action |
|---|
| 1 | Goal Analysis | Determine architecture level (0/1/2) |
| 2 | PDCA Plan | Conduct architecture design based on level |
| 3 | CP1.5 Phase 2 | Verify implementation complies with design |
→ Design → Implementation → Verification Loop
Mandatory Checkpoints (Guardrails)
These checkpoints cannot be skipped, see details in 02-checkpoints
| Checkpoint | Timing | Action |
|---|
| CP0 🌟 | Before project/task starts | North Star Alignment (create or read) |
| CP0.5 🔒 | After CP0 (conditional trigger) | Worktree isolation environment preparation |
| CP1 | Before task starts | Search .claude/memory/ for relevant experiences |
| CP1.5 | Before writing code | Consistency check (two phases) |
| CP2 | After code changes | Compilation + test verification |
| CP3 | After milestone completion | Confirm goal, direction correction, next steps |
| CP3.5 | After memory document creation | Immediately sync index.md |
| CP4 | After iteration completion | Emergence opportunity check (optional) |
| CP5 | When PDCA Check fails | Post-mortem analysis, generate structured Lesson |
| CP6 🏥 | Every 5 iterations | Project health check (Scope, direction, termination check) |
| CP6.5 🏁 | When task completes (conditional trigger) | Worktree merge/cleanup |
Checkpoint Parallelization
Efficiency Optimization: The following CPs can be executed in parallel:
- CP1 + CP1.5 Phase 1: Memory search and basic consistency check are independent, start simultaneously with
- CP4 + Next Iteration Plan: Emergence check runs in the background without blocking subsequent PDCA
Non-parallelizable: CP0/CP0.5 must be completed first; CP1.5 Phase 2 depends on CP1 results; CP2 → CP3 is sequential.
See details in 02-checkpoints/README.md
CP1.5 Two-Phase Design
Phase 1: Basic Check (Mandatory)
- Search existing implementations to avoid reinventing the wheel
- Check project conventions (naming, style)
- Check Schema/API consistency
Phase 2: Architecture Check (Automatically Triggered)
- Dependency direction, error handling consistency, cross-cutting concerns, design pattern consistency
Trigger Conditions: New directory/module added, changes involve 3+ directories, new external dependencies added, touching core/infra/domain/shared/, new public API added
Termination Conditions
| Status | Condition |
|---|
| ✅ Success | All sub-goals completed + acceptance criteria passed |
| ❌ Failure | Reached maximum iterations or 3 consecutive identical errors |
| ⏸️ Pause | User decision required or risky operation needs confirmation |
Completion Signals
✅ GOAL ACHIEVED: [Goal Description]
❌ CANNOT COMPLETE: [Reason]
Related Resources