跳到正文
cccskills
免费在 GitHub 公开

auto-loop

TDD-based autonomous development loop with checkpoint recovery and observability changelog

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md7.8 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Auto-Loop

Execute a TDD-based autonomous development loop with full observability.


Usage

# Start new task
/auto-loop "Implement user login"

# With acceptance criteria
/auto-loop "Implement authentication

Acceptance Criteria:
- [ ] Login form (email + password)
- [ ] JWT token generation
- [ ] Error handling
"

# Resume interrupted session
/auto-loop --resume

# Force restart (clear old state)
/auto-loop --force "New task"

# Check status
/auto-loop --status

# With iteration limit
/auto-loop "Task" --max-iterations 15

How It Works

┌───────────────────────────────────────────────────────────────┐
│                      TDD Iteration                            │
├───────────┬───────────────────────────────────────────────────┤
│  RED      │ Write failing test for next AC                    │
│           │ → Auto-logged: file_write, test_fail              │
├───────────┼───────────────────────────────────────────────────┤
│  GREEN    │ Write implementation to make test pass            │
│           │ → Auto-logged: file_write/edit, test_pass         │
├───────────┼───────────────────────────────────────────────────┤
│  REFACTOR │ Improve code quality (no behavior change)         │
│           │ → Use code-reviewer agent for suggestions         │
├───────────┼───────────────────────────────────────────────────┤
│  VALIDATE │ Run full test suite + linter                      │
│           │ → Auto-logged: test_pass/fail                     │
├───────────┼───────────────────────────────────────────────────┤
│  COMMIT   │ Commit changes with descriptive message           │
│           │ → Auto-logged: commit                             │
├───────────┼───────────────────────────────────────────────────┤
│  DECIDE   │ Check AC completion → continue or complete        │
└───────────┴───────────────────────────────────────────────────┘

Execution

When user runs /auto-loop "<request>":

1. State Detection (Conflict Prevention)

STATE_DIR=".auto-loop"
CHECKPOINT="$STATE_DIR/checkpoint.json"

# Check for existing in-progress session
if [ -f "$CHECKPOINT" ]; then
    status=$(jq -r '.status // "unknown"' "$CHECKPOINT" 2>/dev/null || echo "unknown")
    iteration=$(jq -r '.current_iteration // 0' "$CHECKPOINT" 2>/dev/null || echo "0")

    if [ "$status" == "in_progress" ]; then
        echo "⚠️  Found interrupted session at iteration #$iteration"
        echo "Options:"
        echo "  /auto-loop --resume        → Continue"
        echo "  /auto-loop --force \"...\"  → Start fresh"
        exit 1
    fi
fi

Behavior Matrix:

Existing StateCommandAction
None/auto-loop "task"Start new
completed/auto-loop "task"Archive & start new
in_progress/auto-loop "task"Block - prompt user
in_progress/auto-loop --resumeContinue
in_progress/auto-loop --force "task"Archive & start new

2. Initialize

# Archive old changelog if > 100 lines
CHANGELOG_DIR=".director-mode"
CHANGELOG="$CHANGELOG_DIR/changelog.jsonl"

if [ -f "$CHANGELOG" ] && [ $(wc -l < "$CHANGELOG") -gt 100 ]; then
    mv "$CHANGELOG" "$CHANGELOG_DIR/changelog.$(date +%Y%m%d_%H%M%S).jsonl"
fi

# Create state directories
mkdir -p "$STATE_DIR" "$CHANGELOG_DIR"

# Initialize checkpoint
# Build with jq so multiline requests or embedded double quotes stay valid JSON
# (a raw heredoc would break on the quoted acceptance-criteria usage above).
jq -n --arg req "$ARGUMENTS" \
  '{request: $req, current_iteration: 0, max_iterations: 20, status: "in_progress", started_at: (now | todate), acceptance_criteria: [], last_test_result: null, files_changed: []}' \
  > "$CHECKPOINT"

# acceptance_criteria stays empty here; the parse step below fills it in.

3. Parse Acceptance Criteria

Input:
  "Implement authentication

  Acceptance Criteria:
  - [ ] Login form
  - [ ] JWT token
  "

Parsed:
{
  "acceptance_criteria": [
    { "id": 1, "description": "Login form", "done": false },
    { "id": 2, "description": "JWT token", "done": false }
  ]
}

4. DECIDE - Completion Check

┌─────────────────────────────────────────────────────────────┐
│  DECIDE - Iteration #3                                      │
├─────────────────────────────────────────────────────────────┤
│  [x] 1. Login form            ← test passing               │
│  [x] 2. JWT token             ← test passing               │
│  [ ] 3. Error handling        ← NO TEST YET                │
├─────────────────────────────────────────────────────────────┤
│  Decision: 2/3 complete → CONTINUE                          │
└─────────────────────────────────────────────────────────────┘

Complete when:

  • All AC marked done: true
  • All tests passing

Stop when:

  • max_iterations reached
  • .auto-loop/stop file exists

Flags

FlagDescription
--resumeContinue interrupted session
--forceClear old state, start fresh
--statusShow current session status
--max-iterations NSet iteration limit (default: 20)

Observability

All events are automatically logged via PostToolUse hooks:

EventTriggerHook
file_writeWrite toollog-file-change.sh
file_editEdit toollog-file-change.sh
test_pass/failBash (test)log-bash-event.sh
commitBash (git commit)log-bash-event.sh

Query with /changelog:

/changelog              # Recent events
/changelog --summary    # Statistics
/changelog --type test  # Filter by type

Stop / Resume

# Interrupt (stop after current iteration)
touch .auto-loop/stop

# Check status
/auto-loop --status

# Resume
/auto-loop --resume

# Force restart
/auto-loop --force "New task"

Related

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Validate custom agent file format and structure. Use after creating or editing an agent, before committing agent changes, or when an agent fails to load.

中文简介正在准备中。当前显示原文说明。

claude-world/director-mode-lite802026年8月31日 更新

Generate custom agent from template. Use when creating a new subagent from scratch, or scaffolding an agent file with correct frontmatter.

中文简介正在准备中。当前显示原文说明。

claude-world/director-mode-lite802026年8月31日 更新

agents

免费

List all available agents (core, expert, self-evolving). Use when the user asks what agents are available or runs /agents.

中文简介正在准备中。当前显示原文说明。

claude-world/director-mode-lite802026年8月31日 更新

changelog

免费

View and manage the runtime changelog for observability

中文简介正在准备中。当前显示原文说明。

claude-world/director-mode-lite802026年8月31日 更新

Track development session events in a daily markdown changelog, including file changes, test results, and key decisions.

中文简介正在准备中。当前显示原文说明。

claude-world/director-mode-lite802026年8月31日 更新

Verify Claude, Codex, and Grok availability plus Director guidance, relay, agents, and skills. Audit optional hooks only when selected. Use after installation or when a native surface misbehaves.

中文简介正在准备中。当前显示原文说明。

claude-world/director-mode-lite802026年8月31日 更新

查看 claude-world 的全部技能

报告此技能的问题