---
model: sonnet
---

# /tas-init

Initialize TAS kit for the current project.

## Actions
1. Need context from root/`tas.yaml`. If absent, copy from `.tas/tas-example.yaml` to root, ask user to fill required info.
1.5. **Gate enforcement preset** — ask the user (AskUserQuestion) which mode fits this project, then write the boolean `workflow.gate_enforcement` in `tas.yaml`:
   - **solo** → `gate_enforcement: false` — frictionless; no upstream-approval gates. Good for solo dev / prototype.
   - **team** → `gate_enforcement: true` (default) — strict ordering; a command STOPS unless its nearest upstream artifact(s) are `Approved`. Each command enforces this inline (see its "Gate" step).
2. Create directory structure: `.tas/templates/`, `docs/`, `docs/adr/`, `docs/features/`, `docs/bugs/`, `docs/ref/`
3. Create root/`project-status.yaml` from `.tas/project-status-example.yaml` (flat `features` map; no `epics`/`stories` nesting).
4. Copy default templates to `.tas/templates/` if missing.
5. If project type is `brownfield` and `codebase_scan_on_init = true`:
   - Scan existing codebase
   - Create `docs/codebase-overview.md` summarizing current architecture
   - **Seed the baseline coverage ledger** — if `docs/architecture-map.yaml` is later created (or if you seed it now), record every component/module/entity/contract/security control already present in the code as `status: built, origin: baseline` with its `code_anchor`, leaving claim fields (`built_by`/`owner`/`producer`/`addressed_by`) empty. Per `.tas/rules/common/architecture-map.md`, baseline items are **Covered without a Feature** — this prevents coverage gates from demanding fake Features for working pre-existing code. Only design items with no code yet remain `origin: feature` and need Features.
6. Display status: project type, team roles, enabled workflow phases.

## Notes
- DO NOT recreate files if they already exist
- Ask for confirmation before executing
- Migrating from a previous kit version that had `docs/epics/`? See migration note in repo CHANGELOG — flatten manually (move `docs/epics/*/Feature-*/Feature-*.md` → `docs/features/{CODE}-Feature-{NNN}-{slug}/`).
