[Back to table of contents](./README.md)

# 02. Core concepts

Once you understand the terms and concepts on this page, you can apply the examples from every other guide page directly.

## Skill, Agent, Executor, Task

| Term | Meaning |
|---|---|
| **Skill** | A procedure users invoke directly, such as `/ywc-plan`. It is defined in `claude-code/skills/<name>/SKILL.md`, and most of this Guidebook is about Skills. |
| **Agent (Subagent)** | A specialized execution unit delegated to internally by a Skill, such as `ywc-backend-coder` or `ywc-security-engineer`. Users do not invoke these directly; Skills dispatch them through the Task tool. |
| **Executor** | A collective term for the two Skills that actually execute Tasks: `ywc-sequential-executor` (sequential) and `ywc-parallel-executor` (parallel). |
| **Task** | One `tasks/<phase>-<sequence>-<slug>/` directory created when `ywc-task-generator` decomposes a spec. It consists of `README.md` (metadata) and `task.md` (implementation checklist). |

### Agents by tool

Agents run inside Skills; you never call them yourself. The two tools ship different sets: 13 agents for Claude Code and 10 for Codex. In Claude Code, worker agents write server, UI and test code. In Codex the Skill session writes the code itself, and most agents are read-only advisors and reviewers.

| Agent | Role | Main calling Skills | Claude Code | Codex |
|---|---|---|---|---|
| `ywc-architect` | Architecture decisions and trade-offs (read-only) | `ywc-plan`, `ywc-impl-review` | ✓ | ✓ |
| `ywc-security-engineer` | Static security review (read-only) | `ywc-security-audit`, `ywc-impl-review`, `ywc-infra-review` | ✓ | ✓ |
| `ywc-root-cause-analyst` | Root-cause analysis (read-only) | `ywc-debug-rootcause` | ✓ | ✓ |
| `ywc-performance-engineer` | Performance analysis and profiling advice (read-only) | `ywc-impl-review` | ✓ | ✓ |
| `ywc-typescript-reviewer` / `ywc-python-reviewer` / `ywc-go-reviewer` | Language-specific review (read-only) | `ywc-impl-review` | ✓ | ✓ |
| `ywc-cloud-engineer` | Terraform IaC. Writes and reviews it in Claude Code; review only (read-only) in Codex | `ywc-iac-author`, `ywc-infra-review`, `ywc-infra-optimize` | ✓ | ✓ |
| `ywc-backend-coder` / `ywc-frontend-coder` / `ywc-qa-engineer` | Write server code / UI code / test code | `ywc-code-gen`, both executors | ✓ | |
| `ywc-refactor-cleaner` | Runs the safe dead-code deletion loop | `ywc-refactor-clean` | ✓ | |
| `ywc-doc-writer` | Writes documentation | `ywc-auth-implement`, `ywc-project-docs` | ✓ | |
| `ywc-complexity-cleaner` / `ywc-test-hardener` | Quality-gate workers: reduce production-code complexity / harden tests against surviving mutants | executor quality gate ([18](./13-executor-and-codegen-patterns.md)) | | ✓ |

## Scale determines the flow

Every work item starts with `ywc-plan`. `ywc-plan` judges the scale of the request and routes it into one of two flows.

| Scale | Decision criteria | Output | Next step |
|---|---|---|---|
| **Small** | A change that can finish in a single PR, with no DB migration or new Library adoption | `plan.md` | [05. general cycle (small)](./04-general-cycle-small.md) |
| **Medium/Large** | Must be split into multiple Tasks, or includes a DB migration or new Library adoption | `docs/ywc-plans/<slug>.md` | [06. general cycle (medium/large)](./05-general-cycle-medium-large.md) |

DB migrations and new Library adoption are **always handled separately**, regardless of scale. This is a Safety Invariant for both `ywc-plan` and `ywc-task-generator`.

## The four completion states

Almost every Skill finishes with one of the four states below. Once you know this vocabulary, you can read any Skill's completion report and immediately decide what to do next.

| State | Meaning | What the user should do |
|---|---|---|
| `DONE` | Fully finished, no issues | Move to the next step |
| `DONE_WITH_CONCERNS` | Finished, but with something to watch | Read the Concern; fix it if it is a correctness issue, otherwise proceed |
| `BLOCKED` | Cannot proceed - human judgment is needed | Review the stated blocker, resolve it directly, then rerun |
| `NEEDS_CONTEXT` | Not enough information to start | Provide the requested information and invoke again |

## Overall flow at a glance

- Idea
- ywc-plan (scale decision)
- **Small**
  - plan.md → ywc-spec-ready → ywc-code-gen → ywc-impl-review → ywc-create-pr
- **Medium/Large**
  - docs/ywc-plans/<slug>.md → ywc-spec-ready → ywc-task-generator
  - ywc-sequential-executor --review or ywc-parallel-executor --review
  - PR → CI → Bot Review → Merge (automated by Executor)
- Testing &amp; integration testing (ywc-gen-testcase, ywc-e2e-test-strategy when needed)

Each branch of this flow is covered in detail with concrete command examples on pages [05](./04-general-cycle-small.md) and [06](./05-general-cycle-medium-large.md), and the final testing step is covered on pages [11](./09-testing-guide.md) and [12](./10-e2e-test-strategy.md).

## Shared PR Delivery mode concepts

`ywc-finish-branch`, `ywc-sequential-executor`, and `ywc-parallel-executor` share the mode concepts below for task-based delivery. The Small flow based on `plan.md` has no task artifact, so it opens a PR with `ywc-create-pr` and handles review/merge separately. Exact flag combinations are covered in [18. Executor / Code-gen Prompt patterns](./13-executor-and-codegen-patterns.md).

| Mode | Meaning |
|---|---|
| `normal-pr` (default) | Automatically handle PR creation -> CI wait -> Bot Review response -> Merge |
| `--draft` | Create only a PR and stop - Merge is manual |
| `--local-merge` | Merge directly into the base branch locally without a PR |
| `--aggregate-pr` (executor only) | Collect multiple Tasks onto one branch and deliver them as **one** PR |

---

[Previous: 01. Introduction](./01-introduction.md) · [Next: 03. Prerequisites and installation](./15-prerequisites-installation.md)
