# Skills

Skills are instruction sets that the AI agent reads at runtime. Each skill is a directory containing a `SKILL.md` file with YAML frontmatter and markdown instructions.

## How Skills Work

1. Before each agent call, the daemon symlinks `skills/` into the project at `.cursor/skills/autobuilder/`
2. Cursor discovers skills via this symlink
3. The agent prompt references specific skills (e.g., "Read `.cursor/skills/autobuilder/product-review/SKILL.md`")
4. The agent reads and follows the skill instructions

Skills are the agent's "how-to" manual. The prompt provides the "what" (context, mode, strategy); the skill provides the "how" (methodology, output format, rules).

## Core Skills

### build-feature

The orchestrator documentation. Describes the full build loop, project structure, task format, and iteration workflow. This is the primary skill the agent reads to understand its role.

**Contains:** Role definition, project structure reference, task YAML template, phase descriptions, initiative concept.

### product-review

The review phase methodology. Defines the "ruthless product critic" persona and the step-by-step review workflow.

**Contains:**
- Review persona and mindset
- Browser interaction workflow (screenshots vs snapshots)
- Task creation format and severity classification
- Strategy compliance rules
- Polish mode vs feature mode behavior

### plan-task

The planning phase methodology. Turns unplanned tasks into implementable work items.

**Contains:**
- Research and architecture analysis steps
- One-week decision framework (defer if >1 week of work)
- Task splitting rules (max 3 children per split)
- Dependency graph construction
- Implementation plan format

### execute-task

The execution phase methodology. Implements one task per iteration.

**Contains:**
- Strict TDD workflow (test first, then implement)
- Commit format rules (one commit per task)
- File organization constraints
- Code quality requirements
- Task locking (mark `executed: true` on success)

### create-project

Project bootstrapping. Used once to set up a new project for the autobuilder.

**Contains:**
- Requirements gathering process
- Initiative spec writing guide
- Root task creation
- `.autobuilder/.env` credential storage
- Config scaffolding

### create-initiative

Creates follow-up initiatives for existing projects.

**Contains:**
- Initiative spec template
- PRODUCT.md creation/update (project-wide context)
- Initiative numbering and organization
- Active initiative switching

### steer

Runtime steering interface. Used to modify a running project's direction.

**Contains:**
- How to edit initiative spec/constraints
- Backlog usage (one-shot feedback)
- PRODUCT.md updates
- Status checking
- Initiative management

## Infrastructure Skills

### agent-browser

Browser automation for AI agents using the `agent-browser` CLI.

**Contains:**
- Command reference (open, screenshot, snapshot, click, type, wait)
- Authentication patterns
- Session management
- Proxy support
- Video recording
- Performance profiling

### react-doctor

React code quality scanning. Runs automated analysis and produces a score (0-100).

**Contains:**
- Scan methodology
- Scoring rubric
- Common issue categories
- Fix recommendations

### thermo-nuclear-code-quality-review

Plan/code quality gate applied automatically during the planning phase (controlled by `plan_quality_review` in `.autobuilder/config.yaml`, default `true`). Rejects plans that work but make the codebase messier.

**Contains:**
- The four tests: delete don't move complexity, 1,000-line file cap, no thin wrappers / no leaked logic, net-cleanliness check
- Plan-evidence format (the `## Code Quality Check` section appended to task files)
- Reject examples and common failure modes
- Quick diff-time checks for the execute phase

### dogfood

QA testing methodology and checklists.

**Contains:**
- Manual testing workflow
- Report template
- Bug classification
- Test coverage tracking

## Skill Loading Order

Skills are loaded from three locations (in priority order):

1. **Per-project skills** — `<project_dir>/skills/<name>/SKILL.md`
2. **Global skills** — `<repo_root>/skills/<name>/SKILL.md`
3. **Autobuilder skills** — `skills/<name>/SKILL.md` (via symlink)

Per-project skills can override autobuilder skills by using the same directory name.

## Creating Custom Skills

A skill is a directory with a `SKILL.md` file:

```
my-skill/
├── SKILL.md           # Required: instructions with YAML frontmatter
└── references/        # Optional: additional context files
    ├── api-docs.md
    └── examples.md
```

**SKILL.md format:**

```markdown
---
name: my-skill
description: When to use this skill and what triggers it.
---

# My Skill

Instructions for the AI agent...
```

Place custom skills in:
- `<project_dir>/skills/` for project-specific skills
- `<repo_root>/skills/` for skills shared across all projects
