selfwork
Autonomous end-to-end development orchestrator. Load this skill when a user requests a new feature, refactor, or any multi-task implementation that benefits from parallel agent execution — e.g. "implement X", "build feature Y", "set up selfwork", or resuming an in-progress run. Orchestrates Architect, Developer, and Reviewer subagents through a single human approval gate, then runs the implementation loop to completion automatically.
What this skill does
# selfwork — Autonomous Development Orchestrator
## Core Role
You are the CEO. You plan, delegate, and decide — you never write code or run tests yourself.
- Read state → decide → dispatch subagents → loop → report
- One human gate: plan approval. Everything after is fully automatic.
- Never ask the user whether to continue after the plan is approved.
## Bootstrap
Run once at startup to create directories and initialise an empty `state.json`:
```
bun "${CLAUDE_PLUGIN_ROOT}/skills/selfwork/scripts/bootstrap.ts"
```
Returns `run_id` and the path to `state.json`.
> For the full state schema and directory layout, see `references/state-model.md`.
## Phases
### 1. Clarify (optional)
If the requirement is ambiguous, ask the user directly. 1–3 questions max, in one message.
If the requirement is already clear, skip this phase entirely and go straight to Plan.
### 2. Plan
Dispatch the Architect agent. It reads the codebase, designs the solution, decomposes into tasks, and writes:
- `plan.md` — human-readable plan with task list and dependency notes
- `specs/tN.md` — one spec file per task (the execution contract for developers)
After the Architect completes:
1. Read `.claude/selfwork/runs/<run-id>/plan.md`
2. Present a concise summary to the user: what will be built, how many tasks, which run in parallel
3. Wait for user approval (the **one and only human gate**)
4. On approval: populate `tasks` in `state.json` from the plan, set `status=executing`
5. Write the updated `state.json`, then immediately start the Execute loop
> For agent prompt templates and selection rules, see `references/agent-dispatch.md`.
### 3. Execute (fully automatic)
Run this loop until `status=completed` or `status=blocked`. Do not stop to ask the user.
```
loop:
runnable = tasks where status=pending AND all deps have status=done
if runnable is empty AND any task has status=running OR reviewing:
subagents are still working — wait for them to return
if runnable is empty AND all tasks have status=done:
→ set status=completed, go to Report
if runnable is empty AND any task has status=failed:
→ set status=blocked, go to Report
launch ALL runnable tasks IN PARALLEL
(one assistant message with multiple Agent tool calls)
when a developer agent completes:
update that task's status to reviewing
dispatch the reviewer for it (can overlap with other running tasks)
when a reviewer agent completes:
read verdict from .claude/selfwork/runs/<run-id>/reviews/tN.md
if verdict = approved:
task.status = done
if verdict = changes_requested AND task.retries < task.max_retries:
task.retries++
task.failure_notes = issues from review
task.status = pending ← re-queues automatically with retry context
if verdict = changes_requested AND task.retries >= task.max_retries:
task.status = failed
write state.json after every status change
continue loop
```
### 4. Report
**On completed:** Summarize what was built, list changed files, report test results, note any reviewer warnings.
**On blocked:** Explain which tasks failed and why (include reviewer issues), suggest next steps (re-specify, manual fix, re-run with `/selfwork`).
## Resume Behaviour
When an active run exists, read `state.json` and resume from current `status`:
- `planning`: plan.md may or may not exist — if missing, re-dispatch Architect; if present, re-present plan to user for approval
- `executing`: re-enter the Execute loop from current task statuses (running/reviewing tasks may need re-dispatch if agents were lost)
- `completed` / `blocked`: show the Report immediately
## Commands
- `/selfwork` — Start or resume orchestration
- `/selfwork:status` — Show current run state and task progress
- `/selfwork:queue` — Show runnable tasks and what's blocking others
- `/selfwork:clean` — Archive completed runs
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.