# Project Instructions

See `.claude/checklist.md` for command restrictions and script reference.

Use only the provided assist scripts in `tools/` for file inspection, validation, and status checks.

## General Rules

- **G1**: Run shell scripts (`.sh`) directly. NEVER run Python scripts directly.
- **G2**: Do NOT use ad-hoc commands (cat/ls/find/grep/mkdir/for-loops).
  - *Exception:* The **Read tool** is permitted ONLY for checking `.smbatcher/REGISTRY.md` existence.
- **G3**: NEVER use HEREDOC for ad-hoc file writing. Use **Write tool** or **filesystem MCP**.
- **G4**: Use `${TMP}` from `.wdmaker/config.toml` for temp files, NOT `/tmp`.
- **G5**: Use provided scripts for directories; never mkdir; no .gitkeep files.
- **G6**: Do NOT delete generated reports (batch reports, logs, etc.).

## Pipeline Overview

This repository is a batch website design/implement pipeline with phases:

```
Prepare --> Design --> Implement
```

Status flow: `-` -> `B` -> `d` -> `D` -> `O` -> `i` -> `I` -> `Q`

## Agent Architecture

- **Orchestrator commands** (`MDESIGN_OC`, `MIMPLEMENT_OC`) run on the primary agent (Sonnet model).
- **Worker subagents** (`design-worker`, `implement-worker`) are dispatched via the Task tool and run on Opus model.
- Each subagent handles exactly ONE domain. Launch up to 10 in parallel via a single message with multiple Task calls.
- Use `todowrite` to track domain progress across context compaction.

## Parallel Subagent Launch

**CRITICAL**: To launch subagents in parallel, send a **SINGLE message** with **MULTIPLE Task tool calls**.

```
DO:     One message with 10 Task calls = 10 parallel subagents
DO NOT: 10 sequential messages with 1 Task call each
```

## OpenCode-Specific Commands

All OpenCode commands are in `.opencode/commands/` and end with `_OC`:

| Command | Purpose |
|---------|---------|
| `/CPREPARE_OC` | Prepare phase (register + batch) |
| `/WDStatus_OC` | Status check |
| `/MDESIGN_OC` | Design orchestrator |
| `/MIMPLEMENT_OC` | Implement orchestrator |
| `/SDESIGN_OC` | Design worker (subtask, internal) |
| `/SIMPLEMENT_OC` | Implement worker (subtask, internal) |

## Custom Subagents

| Agent | Mode | Model | Purpose |
|-------|------|-------|---------|
| `design-worker` | subagent | claude-opus-4.6 | Writes DESIGN.md for one domain |
| `implement-worker` | subagent | claude-opus-4.6 | Writes HTML/CSS/JS for one domain |

Both are hidden from `@` autocomplete and invoked only by orchestrator commands via Task tool.
