AgentSkillsCN

Skill

技能

SKILL.md

/recursively Skill

Run a task recursively with K-line memory, allowing the agent to learn from previous iterations.

Usage

code
/recursively "task description" [--flags]

Flags

FlagDefaultDescription
--max-iterations <n>20Maximum number of iterations
--max-cost <n>50Maximum cost in USD (approximate)
--convergence-threshold <n>10Lines changed to consider converged
--auto-promotefalseAuto-append promoted K-lines to AGENTS.md
--verbosefalseShow detailed K-line activation logs
--dry-runfalsePlan decomposition without executing

Examples

code
/recursively "Implement user authentication with JWT tokens"

/recursively "Fix the bug in the payment processing flow" --max-iterations 10

/recursively "Refactor the API client to use async/await" --verbose

/recursively "Add comprehensive tests for the auth module" --dry-run

How It Works

  1. Task Decomposition: The coordinator agent breaks down your task into sub-goals
  2. K-line Activation: Relevant insights from previous runs are loaded into context
  3. Sub-agent Execution: Specialized agents work on each sub-goal
  4. Insight Capture: When agents solve problems, they create K-lines
  5. Progress Evaluation: The coordinator assesses progress after each iteration
  6. Iteration: Steps 2-5 repeat until the task is complete or limits are reached
  7. Promotion: High-value K-lines are promoted for future use

K-lines

K-lines (Knowledge lines) are persistent memory artifacts that capture insights from problem-solving. They're stored in .klines/ in your project root.

When agents discover something valuable—a bug fix, a pattern, a gotcha—they create a K-line. Future runs automatically activate relevant K-lines, priming agents with proven approaches.

Philosophy

  • Simplicity over complexity: The system rewards code reduction
  • Learn from experience: Each run makes future runs smarter
  • Autonomous operation: Minimal human intervention needed