worker-workflow
8-phase task execution lifecycle for teamwork workers using native Claude Code APIs. Covers task discovery, claiming, structured description parsing, TDD workflow, implementation, verification, selective commit, and completion reporting.
What this skill does
# Task Execution Workflow
This skill provides the complete 8-phase lifecycle for executing teamwork tasks using native Claude Code APIs. Follow these phases in order.
---
## Structured Description Convention
The orchestrator creates tasks with structured markdown sections in the description. Workers MUST parse these sections to determine approach, criteria, and verification commands.
```markdown
## Description
What needs to be done
## Approach
standard | tdd
## Success Criteria
- Criterion 1
- Criterion 2
## Verification Commands
npm test -- path/to/test
npx tsc --noEmit src/file.ts
```
**Parsing rules:**
| Section | Required | Default |
|---------|----------|---------|
| `## Description` | Yes | N/A |
| `## Approach` | No | `standard` |
| `## Success Criteria` | No | Use general evidence collection |
| `## Verification Commands` | No | Skip automated verification |
Workers extract these sections from the task description after claiming. If `## Approach` is missing, default to `standard`. If `## Success Criteria` is missing, use general evidence collection.
---
## Phase 1: Find Task
List available tasks using native TaskList:
```python
# List all tasks in the team
tasks = TaskList()
```
Filter for tasks that are:
- **Unblocked**: No pending dependencies (all `blockedBy` tasks are completed)
- **Unowned**: No `owner` assigned yet
- **Open**: Status is not `completed` or `in_progress`
If your agent has a role specialization, prioritize tasks matching your role.
**If no task found:** Send a message to the orchestrator and wait for assignment.
```python
SendMessage(
type="message",
recipient="orchestrator",
content="No available tasks matching my role. Waiting for assignment.",
summary="Worker idle - no tasks available"
)
```
---
## Phase 2: Claim Task
Claim the task by setting yourself as the owner and updating the status:
```python
TaskUpdate(
taskId="<TASK_ID>",
owner="<your-agent-name>",
status="in_progress",
activeForm="Working on: <task subject>"
)
```
**If claim fails (conflict):** Another worker took it. Return to Phase 1 and find a different task.
---
## Phase 3: Parse Task
Extract the structured sections from the task description:
```python
# Get full task details
task = TaskGet(taskId="<TASK_ID>")
```
Parse the description to extract:
1. **Approach**: `standard` or `tdd` (default: `standard`)
2. **Success Criteria**: List of criteria to verify
3. **Verification Commands**: Commands to run during Phase 6
**Decision point after parsing:**
| Approach | Next Phase |
|----------|------------|
| `standard` | Skip to Phase 5 (Implement) |
| `tdd` | Proceed to Phase 4 (TDD RED) |
---
## Phase 4: TDD RED (approach=tdd only)
**Skip this phase if approach is `standard`.**
Write the test FIRST, before any implementation code.
### Steps
1. Create the test file based on success criteria
2. Run the test and verify it FAILS (exit code 1)
3. Record evidence with `TDD-RED:` prefix
```python
# Record test creation
TaskUpdate(
taskId="<TASK_ID>",
description="""
<original description>
## Evidence
- TDD-RED: Created test file tests/feature.test.ts
"""
)
```
```bash
# Run SCOPED test - MUST FAIL
npm test -- tests/feature.test.ts
```
```python
# Record failure (expected)
TaskUpdate(
taskId="<TASK_ID>",
description="""
<updated description>
## Evidence
- TDD-RED: Created test file tests/feature.test.ts
- TDD-RED: npm test -- tests/feature.test.ts (exit code 1)
"""
)
```
**Evidence required before proceeding:**
- Test file path created
- Scoped test execution showing failure
- Exit code 1 (expected)
**Do NOT write implementation files during this phase.** Only test files are allowed.
---
## Phase 5: Implement / TDD GREEN
### Standard Approach (approach=standard)
Execute the task using your specialization:
1. Read the task description and success criteria carefully
2. Use tools: Read, Write, Edit, Bash, Glob, Grep
3. Follow existing patterns in the codebase
4. Keep changes focused on the task scope
### TDD GREEN (approach=tdd)
Write **MINIMAL** code to make the test pass. Do NOT add extra functionality beyond what the test requires.
```bash
# Run SCOPED test - MUST PASS
npm test -- tests/feature.test.ts
```
```python
# Record implementation and passing test
TaskUpdate(
taskId="<TASK_ID>",
description="""
<updated description>
## Evidence
- TDD-RED: Created test file tests/feature.test.ts
- TDD-RED: npm test -- tests/feature.test.ts (exit code 1)
- TDD-GREEN: Implemented src/feature.ts
- TDD-GREEN: npm test -- tests/feature.test.ts (exit code 0)
"""
)
```
### TDD REFACTOR (optional, approach=tdd)
After GREEN, optionally improve code quality:
1. Rename variables, extract helpers, improve structure
2. Run scoped tests again to verify they still pass
3. Record with `TDD-REFACTOR:` prefix
```python
TaskUpdate(
taskId="<TASK_ID>",
description="""
<updated description>
## Evidence
...
- TDD-REFACTOR: Extracted helper function, npm test -- tests/feature.test.ts (exit code 0)
"""
)
```
---
## Phase 6: Verify
Before committing, run ALL verification commands and check ALL success criteria.
### Step 1: Run Verification Commands
Execute each command from `## Verification Commands` in the task description:
```bash
# Example: run scoped tests
npm test -- path/to/test.ts
# Example: scoped type check on modified files only
npx tsc --noEmit src/file1.ts src/file2.ts
```
### Step 2: Check Success Criteria
For each criterion from `## Success Criteria`, collect concrete evidence:
| Bad Evidence | Good Evidence |
|--------------|---------------|
| "Tests pass" | "npm test -- auth.test.ts: 15/15 passed, exit code 0" |
| "API works" | "curl /api/users: 200 OK, 5 users returned, exit code 0" |
| "File created" | "Created src/auth.ts (127 lines)" |
### Step 3: TypeScript Scoped Type Check
For TypeScript projects, type check ONLY the files you modified:
```bash
# SCOPED - Type check only changed files
npx tsc --noEmit src/file1.ts src/file2.ts
# FORBIDDEN - Full build is deferred to final-verifier
npm run build
npx tsc
```
### Step 4: Collect Exit Codes
Every verification command MUST have its exit code recorded.
### Step 5: Gate Decision
| All verifications pass | Proceed to Phase 7 (Commit) |
|------------------------|------------------------------|
| ANY verification fails | Do NOT commit, do NOT mark complete, report failure |
**On verification failure:**
```python
TaskUpdate(
taskId="<TASK_ID>",
description="""
<original description>
## Failure
- FAILED: npm test -- auth.test.ts exited with code 1
- Error: TypeError in auth.ts:42
- Root cause: Missing dependency injection for database client
""",
status="open",
owner=""
)
SendMessage(
type="message",
recipient="orchestrator",
content="Task <TASK_ID> failed verification. Reason: <failure description>. Released for retry.",
summary="Task <TASK_ID> failed - released"
)
```
Do NOT proceed to Phase 7 or Phase 8 if verification fails.
---
## Phase 7: Commit
**Only reach this phase if ALL verifications in Phase 6 passed.**
### Selective File Staging
```bash
# FORBIDDEN - NEVER use these:
git add -A # Stages ALL files
git add . # Stages ALL files
git add --all # Stages ALL files
git add * # Glob expansion - dangerous
# REQUIRED - Only add files YOU modified during this task:
git add path/to/file1.ts path/to/file2.ts
```
### Angular Commit Format
```bash
git add path/to/file1.ts path/to/file2.ts && git commit -m "$(cat <<'EOF'
<type>(<scope>): <short description>
[teamwork] Task: <TASK_ID>
<TASK_SUBJECT>
Evidence:
- <evidence 1>
- <evidence 2>
Files changed:
- path/to/file1.ts
- path/to/file2.ts
EOF
)"
```
### Angular Commit Message Types
| Type | When to Use |
|------|-------------|
| feat | New feature or functionality |
| fix | Bug fix |
| refactor | Code refactoring without behavior change |
| test | Adding or modifying tests 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.