Skip to main content
ClaudeWave
EN, English
Skill1.7k repo starsupdated 1mo ago

autonomous-skill

The autonomous-skill executes complex tasks across multiple Claude Code sessions with automatic continuation and progress tracking. It supports two execution modes (headless spawning child sessions or hook-based in-session looping) and two task strategies (structured decomposition into phased sub-tasks or lightweight iteration), with completion detected via promise tags or checkbox counting in task lists.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/feiskyer/claude-code-settings /tmp/autonomous-skill && cp -r /tmp/autonomous-skill/skills/autonomous-skill ~/.claude/skills/autonomous-skill
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Autonomous Skill - Multi-Session Task Execution

Execute complex tasks across multiple Claude Code sessions with automatic continuation,
progress tracking, and two completion mechanisms (promise tags + checkbox counting).

## Two Execution Modes

### Headless Mode (default)
Spawns `claude -p` child sessions in a bash loop. Best for background/unattended work.
```bash
bash <skill-dir>/scripts/run-session.sh "Build a REST API" --max-sessions 10
```

### Hook Mode (in-session)
Uses a Stop hook to intercept session exit and feed the prompt back. Runs inside
the current interactive session — no nesting issues.
```bash
bash <skill-dir>/scripts/setup-loop.sh "Build a REST API" --max-iterations 10
```

## Two Task Strategies

### Structured (default)
Full task decomposition: Initializer creates `task_list.md` with phased sub-tasks,
Executor picks up and completes them one by one. Best for complex, multi-phase projects.
```bash
bash <skill-dir>/scripts/run-session.sh "Build a REST API for todo app"
```

### Lightweight (`--lightweight`)
Ralph-style iteration: same prompt repeated each session, no task decomposition.
Best for iterative tasks with clear success criteria (TDD, bug fixing, refactoring).
```bash
bash <skill-dir>/scripts/run-session.sh "Fix all failing tests in src/" --lightweight
```

## Completion Detection

Two complementary mechanisms — whichever triggers first wins:

1. **Promise tags** (both modes): The agent outputs `<promise>DONE</promise>` when
   work is genuinely complete. Default promise is `DONE`; customize with
   `--completion-promise`. The agent is instructed to only output the promise when
   the work is truly finished — not to escape the loop.

2. **Checkbox counting** (structured mode only): All `[ ]` items in `task_list.md`
   are marked `[x]`.

## Directory Layout

```
project-root/
├── .autonomous/
│   └── <task-name>/
│       ├── task_list.md      # Master checklist (structured mode)
│       ├── progress.md       # Per-session progress log
│       ├── .mode             # "structured" or "lightweight"
│       ├── sessions/         # Transcript logs per session
│       │   ├── session-001.log
│       │   └── session-002.log
│       └── run.lock          # Prevents concurrent runs
└── .claude/
    └── autonomous-loop.local.md  # Hook mode state (when active)
```

## Headless Mode — CLI Reference

```bash
bash <skill-dir>/scripts/run-session.sh "task description" [OPTIONS]
```

| Flag | Description | Default |
|------|-------------|---------|
| `--lightweight` | Ralph-style iteration (no task decomposition) | structured |
| `--task-name <name>` | Explicit task name | Auto-generated |
| `--continue, -c` | Continue most recent or named task | — |
| `--list, -l` | List all tasks with progress | — |
| `--completion-promise TEXT` | Promise phrase for completion | DONE |
| `--max-sessions N` | Stop after N sessions | Unlimited |
| `--max-budget N.NN` | Per-session dollar budget | 5.00 |
| `--model <model>` | Model alias or full name | sonnet |
| `--fallback-model <m>` | Fallback if primary overloaded | — |
| `--effort <level>` | Thinking effort (low/medium/high) | high |
| `--no-auto-continue` | Run one session only | — |
| `--permission-mode <m>` | Permission mode | auto |
| `--add-dir <dirs>` | Extra directories to allow | — |

## Hook Mode — Setup

For in-session loops (no child process spawning):

```bash
bash <skill-dir>/scripts/setup-loop.sh "task description" [OPTIONS]
```

| Flag | Description | Default |
|------|-------------|---------|
| `--mode structured\|lightweight` | Task strategy | structured |
| `--max-iterations N` | Max loop iterations | Unlimited |
| `--completion-promise TEXT` | Promise phrase | DONE |
| `--task-name NAME` | Explicit task name | Auto-generated |

The hook is registered in `hooks/hooks.json`. When active, the Stop hook reads
`.claude/autonomous-loop.local.md` and blocks exit until the promise is detected
or max iterations reached.

To cancel an active hook-mode loop: `rm .claude/autonomous-loop.local.md`

## Workflow Detail

### Structured Mode

1. **Initializer Agent** — analyzes task, creates phased `task_list.md`, begins work
2. **Executor Agent** — reads task list + progress, verifies previous work, completes next task
3. **Auto-Continue** — checks promise tags + checkboxes; if not done, spawns next session

### Lightweight Mode

1. Same prompt fed each iteration
2. Agent sees its previous work in files and git history
3. Iterates until work is complete and promise tag is output
4. No task_list.md — completion is purely promise-based

### When to Use Which

| Scenario | Strategy | Mode |
|----------|----------|------|
| Build a full application | Structured | Headless |
| Fix all failing tests | Lightweight | Either |
| Refactor a module | Lightweight | Either |
| Multi-phase project | Structured | Headless |
| Quick iterative fix | Lightweight | Hook |
| Overnight batch work | Structured | Headless |

## Important Constraints

1. **task_list.md is append-only for completions**: Only change `[ ]` → `[x]`
2. **One runner per task**: Lock file prevents concurrent sessions on same task
3. **Project files stay in project root**: `.autonomous/` is only for tracking
4. **Promise integrity**: The agent must not output `<promise>DONE</promise>` until genuinely complete
5. **Cost awareness**: Default per-session budget is $5. Adjust with `--max-budget`

## Troubleshooting

| Issue | Solution |
|-------|----------|
| "Lock file exists" | Previous run crashed. Remove `.autonomous/<task>/run.lock` |
| Session keeps failing | Check `sessions/session-NNN.log` for errors |
| Nested session error | Script auto-unsets CLAUDECODE; use hook mode as alternative |
| Hook loop won't stop | Delete `.claude/autonomous-loop.local.md` |
| Task not found | Run `--list` to see available tasks |
| Want to restart | Delete the task directory and start fresh |
| Cost too high | Lower `--max-budget` or use `--model sonnet` |
brainstormingSkill

Explore user intent, requirements, and design options through collaborative dialogue before implementation. Use before building new features, components, or systems — whenever the user describes something to build and design decisions are involved. Triggers: \"brainstorm\", \"help me design\", \"think through the requirements\", \"头脑风暴\", \"设计方案\", \"梳理需求\". Not for bug fixes, config changes, or tasks with an obvious implementation path.

codex-skillSkill

Leverage OpenAI Codex/GPT models for autonomous code implementation, code review, and plan review. Triggers: "codex", "use gpt", "gpt-5", "let openai", "full-auto", "adversarial review", "second opinion review", "用codex", "让gpt实现", "对抗式审查", "让codex审查计划", "第二意见". Use this skill whenever the user wants to delegate coding tasks to OpenAI models, run code or plan reviews via codex, get a second-opinion review from a different model, or execute tasks in a sandboxed environment.

command-creatorSkill

Create Claude Code custom slash commands with proper structure, frontmatter, and best practices. Use this skill whenever the user wants to create a new command, add a slash command, build a custom command, or mentions "create-command", "new command", "add command", or "make a command" for Claude Code. Also trigger when the user wants to turn a workflow into a reusable command.

deep-reflectorSubagent

Comprehensive session analysis and learning capture specialist. Analyzes development sessions to extract patterns, preferences, and improvements for future interactions. Use after significant work sessions to capture learnings.

deep-researchSkill

Multi-agent research orchestration: split a research goal into parallel sub-goals, run each via headless `claude -p` subprocesses, aggregate results into a polished report file. Use for systematic web/document research, competitive or industry analysis, batch link/dataset processing, and long-form evidence synthesis. Triggers: "深度调研", "deep research", "wide research", "多 Agent 调研", "系统调研".

eurekaSkill

Capture technical breakthroughs and transform them into actionable, reusable documentation. Use this skill when the user has achieved a significant technical insight, solved a hard problem, discovered a non-obvious solution, or wants to document a breakthrough moment. Also trigger when the user mentions "eureka", "breakthrough", "document this insight", "capture this discovery", or wants to turn a technical win into reusable knowledge.

github-fix-issueSkill

Fix GitHub issues end-to-end — analysis, branch creation, implementation, testing, and PR submission. Use whenever the user mentions fixing a GitHub issue, says "fix issue #123", "work on this issue", "修复 issue", or references a GitHub issue number or URL.

github-issue-fixerSubagent

GitHub issue resolution specialist. Analyzes, plans, and implements fixes for GitHub issues with proper testing and PR creation. Use when fixing specific GitHub issues.