---
name: pstack-init
preamble-tier: 3
version: 0.1.0
description: |
  Scaffold pstack content into a project: docs/ folder structure, CLAUDE.md
  rendered from template, anti-patterns.md, and a .pstack-version marker.
  Detects monorepo vs single-app. Use when asked to "init pstack", "scaffold pstack",
  "set up pstack in this project", or "pstack init".
triggers:
  - pstack init
  - scaffold pstack
  - init pstack
allowed-tools:
  - Bash
  - Read
  - Write
---

# pstack-init

Run the init script for the current project.

## Steps

1. Confirm the user is in the project root (look for `package.json` or `.git/`).
2. Show the user what will be created/modified before doing it:
   - `CLAUDE.md` (created or appended)
   - `docs/{domains,specs,decisions,plans,research,handovers/archive}/`
   - `docs/anti-patterns.md`
   - `.pstack-version`
3. Ask for confirmation.
4. Run: `${CLAUDE_SKILL_DIR}/../../scripts/init.sh <target>`
5. Show the output and the suggested next steps.

## Do not

- Do not commit the changes — let the developer review and commit.
- Do not overwrite existing CLAUDE.md content; append a `## pstack scaffolding` section if missing.
