setup
Initialize the docs/ folder structure for spec-driven development and ensure CLAUDE.md and .github/copilot-instructions.md defer task tracking to /project-management. Called automatically by /spec-writer and /project-management. Also use when user says 'setup docs', 'initialize docs', 'create docs structure'.
What this skill does
# Setup
This skill scaffolds the `docs/` folder structure required for spec-driven development and ensures project instruction files (`CLAUDE.md`, `.github/copilot-instructions.md`) properly defer task tracking to the `/project-management` skill. It is called automatically by `/spec-writer` and `/project-management` as a prerequisite.
## When to Use
- **Automatically** — Invoked by `/spec-writer` and `/project-management` at the start of every invocation
- **Manually** — When user says "setup docs", "initialize docs", "create docs structure", or "setup project"
- **Fresh projects** — When starting a new project that will use spec-driven development
## Workflow
### Step 1: Check Existing Structure
```bash
ls -la docs/ 2>/dev/null
ls docs/specs/ docs/changes/ 2>/dev/null
test -f docs/tasks.md && echo "tasks.md exists" || echo "tasks.md missing"
test -f docs/index.yml && echo "index.yml exists" || echo "index.yml missing"
test -f docs/index.md && echo "index.md exists" || echo "index.md missing"
```
**If all docs/ files exist**, skip to Step 6 (instruction files check). Do not overwrite existing docs/ files.
**If partially exists**, only create what's missing in Steps 2-5. Never overwrite existing files.
### Step 2: Create Directory Structure
```bash
mkdir -p docs/specs
mkdir -p docs/changes
```
### Step 3: Create `docs/tasks.md`
Only if it doesn't exist. If `docs/PROJECT.md` exists, offer to migrate it.
```markdown
# Tasks
Catch-all task list for work not tracked in a specific [change document](changes/).
## Backlog
## Completed
```
**Migration from PROJECT.md:** If `docs/PROJECT.md` exists, read it and migrate tasks to the new format. Use AskUserQuestion to confirm:
```
AskUserQuestion:
question: "Found existing docs/PROJECT.md. Migrate tasks to docs/tasks.md?"
options:
- label: "Yes, migrate"
description: "Move tasks to docs/tasks.md and keep PROJECT.md as backup"
- label: "No, start fresh"
description: "Create empty docs/tasks.md, leave PROJECT.md untouched"
```
### Step 4: Create `docs/index.yml`
Only if it doesn't exist. **Use this exact structure — field names and format are strict:**
```yaml
# Documentation Index
# Auto-updated by /spec-writer and /project-management skills
specs:
# - name: <spec-name>
# path: specs/<spec-name>/
# description: <one-line description>
# status: active | deprecated
changes:
# - id: "NNNN"
# name: <change-name>
# path: changes/NNNN-<change-name>.md
# description: <one-line description>
# spec: <spec-name>
# status: draft | in-progress | complete
# depends_on: []
```
### Step 5: Create `docs/index.md`
Only if it doesn't exist. **Use these exact column names — table schema is strict:**
```markdown
# Documentation
## Specs
| Spec | Description | Status |
|------|-------------|--------|
## Changes
| # | Change | Spec | Status | Depends On |
|---|--------|------|--------|------------|
```
---
### Step 6: Ensure CLAUDE.md Defers to /project-management
Check the project root `CLAUDE.md`. If it doesn't exist, create it with the block below.
#### 6.1 Check for CURRENT language
Search `CLAUDE.md` for the exact string `/project-management`. This is the only valid marker.
- **If `/project-management` is found** → current. Skip to Step 7.
- **If NOT found** → missing or stale. Proceed to 6.2.
#### 6.2 Handle stale or missing language
**If stale task-tracking language exists** (anything referencing `PROJECT.md`, `docs/specs/` for tasks, `- [x]`, `mark.*done`, or task-tracking rules that don't mention `/project-management`):
- Remove the entire stale section
- Insert the new block in its place
**If no task-tracking language exists at all:**
- Append the new block to the end of `CLAUDE.md`
**The EXACT block to insert (do NOT add to, modify, or expand this):**
```markdown
## Task Tracking
**You MUST load the `/project-management` skill before creating, modifying, or completing any task.** It owns all task-tracking rules and knows where tasks belong. Do not manage tasks without it.
```
**⛔ FORBIDDEN: Do NOT add ANY of the following to CLAUDE.md:**
- Descriptions of docs/ folder structure
- Rules about `- [x]`, PR numbers, status fields, or task placement
- Explanations of specs vs changes vs tasks.md
- Anything beyond the exact block above
The `/project-management` skill contains all the rules. CLAUDE.md just says "load it."
---
### Step 7: Ensure `.github/copilot-instructions.md` Has PR Review Cross-Reference
Check `.github/copilot-instructions.md`. Create `.github/` directory and the file if they don't exist.
Copilot cannot load skills — it only reviews PRs. So this file tells it WHERE to cross-reference, not how to manage tasks.
#### 7.1 Check for CURRENT language
Search `.github/copilot-instructions.md` for the exact string `docs/changes/`.
- **If `docs/changes/` is found** → current. Skip to Step 8.
- **If NOT found** → missing or stale. Proceed to 7.2.
#### 7.2 Handle stale or missing language
**If the file does NOT exist**, create `.github/copilot-instructions.md` with the block below.
**If the file DOES exist but has stale language** (references `PROJECT.md` or `docs/specs/` for tasks):
- Remove the stale section
- Prepend the new block at the TOP, followed by `---` and a blank line
**The EXACT block to insert (do NOT add to, modify, or expand this):**
```markdown
# PR Review
## Task Cross-Reference
Cross-reference every PR against task lists in `docs/changes/` and `docs/tasks.md`. If the PR completes work tracked in those files, the task checkboxes MUST be updated in this same PR. Request changes if missing.
```
**⛔ FORBIDDEN: Do NOT add ANY of the following to copilot-instructions.md:**
- Detailed rules about `- [x]` format, PR numbers, or status fields
- Explanations of the spec/change/task system
- Instructions about where tasks should be placed
- Anything beyond the exact block above
---
### Step 8: Report
If any files were created or modified, report what was done:
```
Docs structure ready:
docs/
├── specs/ (living specifications)
├── changes/ (change documents with task tracking)
├── tasks.md (catch-all task list)
├── index.yml (machine-readable index)
└── index.md (human-readable index)
Instruction files:
├── CLAUDE.md (defers task tracking to /project-management)
└── .github/copilot-instructions.md (PR review checks)
```
If everything was already current, report briefly: "Docs structure and instruction files verified — no changes needed."
## Rules
- **Never overwrite** existing docs/ files — only create what's missing
- **Offer migration** if PROJECT.md exists
- **Keep it minimal** — bare templates, not example content
- **Idempotent** — safe to run multiple times; repeated runs MUST NOT duplicate content
- **Exact marker checks** — CLAUDE.md checks for `/project-management`, copilot-instructions checks for `docs/changes/`
- **Replace stale language** — if old-style references exist (`PROJECT.md`, `docs/specs/` for tasks), remove and replace them
- **Insert ONLY the exact blocks specified** — do NOT expand, embellish, or add detail to the CLAUDE.md or copilot-instructions content. The blocks above are the complete content. Adding anything extra violates the design
- **Prepend for copilot-instructions** — review rules go at the TOP so they're seen first
- **Append for CLAUDE.md** — task tracking section is appended to not disrupt existing structure
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.