Agent-Skill Architecture
How MeowKit agents load skills across the workflow phases: project context, phase ownership, step-file skills and the cross-cutting skills.
Agents are specialists, and skills are tools an agent loads when its task needs them. Every task is routed to the agent for its phase, and that agent activates only the skills for its domain. Loading skills on demand keeps context windows small and costs predictable. A full list is in the reference.
For the agents and skills overview, see How MeowKit works.
Project context first
docs/project-context.md is the agent constitution: tech stack, conventions, anti-patterns and testing approach. Every agent loads it at session start, before task-specific context. Without it, agents infer conventions separately and make conflicting assumptions.
/mk:docs-init # generate docs from codebase analysis (new projects)
/mk:document-release # diff-aware update after feature workPhases and the agents that own them
The phases are 0 Orient, 1 Plan, 2 Test, 3 Build, 3.5 Simplify, 3.6 Verify, 4 Review, 5 Ship and 6 Reflect. The phase column below is from .claude/agents/AGENTS_INDEX.md.
| Agent | Phase |
|---|---|
orchestrator | 0 Orient |
explore | 0 and any |
planner, architect, brainstormer | 1 Plan |
tester | 2 Test (red phase with --tdd) |
security | 2 and 4 |
developer | 3 Build |
ui-ux-designer | 3 Build, when frontend is detected |
evaluator | 3 (active verification) and 4 (contract review) |
reviewer | 4 Review |
shipper, git-manager | 5 Ship |
documenter, analyst, journal-writer | 6 Reflect (the analyst also at 0) |
The evaluator is the behavioral counterpart of the structural reviewer. It grades a running build against weighted rubrics, and in mk:autobuild the generator and evaluator are separate subagents. See Autonomous build and the evaluator reference.
Below the agent and skill layer, a hook dispatcher (dispatch.cjs and handlers.json) handles model detection, budget tracking, build verification, loop detection and checkpoints. Agents do not invoke it. See Hooks.
Plan first
Most skills follow a plan-first practice: before significant work they check that an agreed plan exists. Nothing blocks the work when it does not.
| Skill | Plan behavior | Skipped when |
|---|---|---|
mk:cook | Writes a plan if there is none | A plan path is passed, or the quick profile runs on a change of two files or fewer and about 30 minutes or less |
mk:fix | Plan when the fix touches more than 2 files | --quick |
mk:ship | Looks for a plan, suggests one for non-trivial changes | You choose to ship anyway |
mk:review | Reads the plan for context | A PR or pending diff is the context |
mk:investigate, mk:office-hours, mk:retro | Produce input for plans, or have no plan to scope | Always |
Orchestrator entry point
Two orchestrators exist: mk:cook (explicit invocation, single-task pipeline) and mk:workflow-orchestrator (auto-invoked on complex-feature intent). .claude/skills/cook/references/orchestration-rules.md decides which runs:
- An explicit
/mk:cookmakesmk:cookown the pipeline, and the workflow orchestrator stays out for the session. - At session start with complex-feature intent and no explicit invocation,
mk:workflow-orchestratorruns the phase flow. It defers tomk:cookfor single-task requests. - They never both run in the same session.
Skill frontmatter
SKILL.md frontmatter carries advisory fields that no hook reads (.claude/skills/skill-creator/references/skill-authoring-rules.md):
| Field | Values | Meaning |
|---|---|---|
preamble-tier | 1, 2 or 3 | Context-injection priority. 3 is injected before other context |
user-invocable | true (default) or false | false marks an internal skill that other skills invoke |
phase | 0 to 6, or on-demand | The workflow phase the skill belongs to |
trust_level | kit-authored or third-party | Provenance. Third-party skills treat external input as data |
injection_risk | low, medium or high | Prompt-injection exposure |
Step-file skills
Complex skills split into step files loaded one at a time, instead of one large SKILL.md. Only the active step is in context, each step writes a discrete artifact, and state is saved to .meowkit/state/{skill-name}-progress.json so an interrupted run resumes at the last completed step. Load one step at a time, and do not skip steps.
skills/review/
├── SKILL.md
├── workflow.md
├── step-01-gather-context.md
├── step-02-parallel-review.md
├── step-02b-persona-passes.md
├── step-03-triage.md
├── step-03b-whole-plan-sweep.md
└── step-04-verdict.mdmk:plan-creator uses step files 00 to 09, with one mode matrix in workflow.md. Its --fast path runs scope, draft, checks, the plan presentation and task hydration, and skips research, codebase scouting, red team and the validation interview. mk:autobuild has steps 0 to 6.
Cross-cutting skills
These activate in any phase when the task calls for them. They are not loaded in advance.
| Skill | Activates when |
|---|---|
careful | A phase runs destructive commands |
freeze | You want a debug session limited to one path |
scout | Phase 0 and any exploration task |
docs-finder | A phase needs current library docs |
multimodal | A phase involves images or visual content |
session-continuation | A handoff across sessions is needed |
context-engineering | A runtime context decision, such as what to read, when to compact or delegate |
henshin | Existing code should become a CLI, MCP server and companion skill |
Which skill do I need
| I want to | Skill | Phase |
|---|---|---|
| Plan a feature | mk:plan-creator | 1 |
| Validate a plan before building | mk:validate-plan | 1 |
| Compare approaches | mk:brainstorming, mk:office-hours | 1 |
| Research a technology | mk:research | 0, 1 |
| Write tests first | mk:testing | 2 |
| Check test-to-requirement coverage | mk:nyquist | 2, 4 |
| Implement a feature | mk:cook | 0 to 6 |
| Fix a bug | mk:fix | 3 |
| Debug without fixing | mk:investigate | 3 |
| Review code | mk:review | 4 |
| Push review findings further | mk:elicit | 4 |
| Audit security | mk:cso | 2, 4 |
| Ship | mk:ship | 5 |
| Update docs after shipping | mk:document-release | 6 |
| Run a retrospective | mk:retro | 6 |
| Explore the codebase | mk:scout | 0 |
| Look up library docs | mk:docs-finder | any |
Subagent status
Every subagent ends with a status block (DONE, DONE_WITH_CONCERNS, BLOCKED or NEEDS_CONTEXT), a summary and any concerns. The controller decides its next step from it. See .claude/rules/agent-conduct.md, section A1.