Skip to content

Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.

Add project-health skill: merged project-kickoff + context-manager

Jeremy Dawes55e9e42f9a15
diff --git a/plugins/dev-tools/skills/project-health/SKILL.md b/plugins/dev-tools/skills/project-health/SKILL.md
new file mode 100644
index 00000000..3836583c
--- /dev/null
+++ b/plugins/dev-tools/skills/project-health/SKILL.md
@@ -0,0 +1,263 @@
+---
+name: project-health
+description: "All-in-one project configuration and health management. Sets up new projects (settings.local.json, CLAUDE.md, .gitignore), audits existing projects (permissions, context quality, MCP coverage, leaked secrets, stale docs), tidies accumulated cruft, captures session learnings, and adds permission presets. Uses sub-agents for heavy analysis to keep main context clean. Trigger with 'project health', 'check project', 'setup project', 'kickoff', 'bootstrap', 'tidy permissions', 'clean settings', 'capture learnings', 'audit context', 'add python permissions', or 'init project'."
+compatibility: claude-code-only
+---
+
+# Project Health
+
+One skill for everything about your project's Claude Code configuration. Run it at the start, middle, or end of a project — it figures out what's needed.
+
+**Goal**: Zero permission prompts, well-organised context files, no cruft.
+
+## When to Use
+
+| You say... | What happens |
+|-----------|-------------|
+| "project health" / "check project" | Full audit: permissions + context + docs |
+| "setup project" / "kickoff" / "bootstrap" | New project setup from scratch |
+| "tidy permissions" / "clean settings" | Fix permissions file only |
+| "capture learnings" / "update CLAUDE.md" | Save session discoveries |
+| "add python" / "add docker permissions" | Add a preset to existing settings |
+| "audit context" / "audit memory" | Context-focused audit only |
+
+## Architecture: Sub-Agents
+
+**Heavy analysis runs in sub-agents** to keep the main conversation clean. The main agent orchestrates; sub-agents do the scanning and return summaries.
+
+### Agent 1: Permission Auditor
+
+Launched with `Task(subagent_type: "general-purpose")`. Prompt:
+
+```
+Read .claude/settings.local.json. Use ToolSearch to discover all connected MCP servers
+(search "mcp" and extract unique server prefixes from tool names like mcp__vault__secret_list → vault).
+
+Report:
+1. MCP servers connected but NOT in settings (missing)
+2. MCP servers in settings but NOT connected (stale)
+3. Leaked secrets: entries containing API keys, tokens, bearer strings, hex >20 chars
+4. Legacy colon syntax: entries like Bash(git:*) instead of Bash(git *)
+5. Shell fragments: Bash(do), Bash(fi), Bash(then), Bash(else), Bash(done)
+6. Duplicates: entries covered by a broader pattern (e.g. Bash(git add *) redundant if Bash(git *) exists)
+7. Missing presets: based on files present, suggest presets from [permission-presets.md]
+
+Return a structured summary, not raw data.
+```
+
+### Agent 2: Context Auditor
+
+Launched with `Task(subagent_type: "general-purpose")`. Prompt:
+
+```
+Audit the project context landscape at [repo-path]:
+
+1. Find all CLAUDE.md files. For each:
+ - Count lines (target: root 50-150, subdirs 15-50)
+ - Score quality on 6 criteria (see quality-criteria.md)
+ - Check for stale file/path references
+ - Flag oversized files
+
+2. Find .claude/rules/ topic files. Check sizes (target: 20-80 lines).
+
+3. Detect project type from files present (see project-types.md).
+ Check expected docs exist (ARCHITECTURE.md, DATABASE_SCHEMA.md, etc.)
+
+4. Find public markdown (README.md, LICENSE, CONTRIBUTING.md).
+ Check for overlap with CLAUDE.md content.
+
+5. Check auto-memory at ~/.claude/projects/*/memory/MEMORY.md
+
+Return: project type, quality scores, missing docs, stale refs, overlaps,
+size violations, and total markdown footprint.
+```
+
+### Parallel Execution
+
+For a full health check, **launch both agents in parallel**:
+
+```
+Task(subagent_type: "general-purpose", name: "permission-audit", prompt: "...")
+Task(subagent_type: "general-purpose", name: "context-audit", prompt: "...")
+```
+
+Both return summaries. The main agent combines them into one report and proposes fixes.
+
+## Mode 1: Full Health Check
+
+**The default.** Run this anytime.
+
+### Steps
+
+1. Launch Permission Auditor and Context Auditor agents **in parallel**
+2. Combine findings into a single report:
+
+ ```
+ ## Project Health Report
+
+ **Project type**: [detected type]
+ **CLAUDE.md quality**: [score]/100 ([grade])
+
+ ### Permissions
+ - Missing MCP servers: [list]
+ - Leaked secrets: [count] found
+ - Legacy syntax: [count] entries
+ - Missing presets: [list]
+
+ ### Context
+ - Oversized files: [list]
+ - Stale references: [list]
+ - Missing docs: [list]
+ - Overlaps: [list]
+
+ ### Recommended Fixes
+ 1. [fix 1]
+ 2. [fix 2]
+ ...
+ ```
+
+3. Apply fixes after single yes/no confirmation
+
+## Mode 2: New Project Setup
+
+**When**: No `.claude/settings.local.json` exists, or user says "setup" / "kickoff".
+
+### Steps
+
+1. **Detect project type** from files present:
+
+ | Indicator | Type |
+ |-----------|------|
+ | `wrangler.jsonc` or `wrangler.toml` | cloudflare-worker |
+ | `vercel.json` or `next.config.*` | vercel-app |
+ | `package.json` (no deploy target) | javascript-typescript |
+ | `pyproject.toml` or `setup.py` or `requirements.txt` | python |
+ | `Cargo.toml` | rust |
+ | `go.mod` | go |
+ | `Gemfile` or `Rakefile` | ruby |
+ | `composer.json` or `wp-config.php` | php |
+ | `Dockerfile` or `docker-compose.yml` | docker |
+ | `.claude/agents/` or operational scripts | ops-admin |
+ | Empty directory | Ask the user |
+
+ Types stack (e.g. cloudflare-worker + javascript-typescript).
+
+2. **Generate `.claude/settings.local.json`**:
+ - Read [references/permission-presets.md](references/permission-presets.md)
+ - Always include Universal Base
+ - Add detected language + deployment presets
+ - **Launch Permission Auditor agent** to discover MCP servers and add per-server wildcards
+ - Always include `WebSearch`, `WebFetch`
+ - Always include explicit `gh` subcommands (workaround for `Bash(gh *)` bug)
+ - Write with `//` comment groups
+
+3. **Generate `CLAUDE.md`**:
+ - Read [references/templates.md](references/templates.md)
+ - Use project-type-appropriate template
+
+4. **Generate `.gitignore`**:
+ - Read [references/templates.md](references/templates.md)
+ - Always include `.claude/settings.local.json`
+
+5. **Optionally** (ask first): `git init` + `gh repo create`
+
+6. **Warn**: "Project settings.local.json SHADOWS global settings (does not merge). Session restart needed."
+
+## Mode 3: Tidy Permissions
+
+**When**: User says "tidy permissions" or health check found permission issues.
+
+Launch the Permission Auditor agent, then apply its recommended fixes.
+
+## Mode 4: Capture Learnings
+
+**When**: End of session, "capture learnings", "save what we learned".
+
+This runs in the **main context** (not a sub-agent) because it needs access to the conversation history.
+
+1. Review conversation for discoveries worth preserving
+2. Decide placement:
+ ```
+ Applies to all projects?
+ ├── YES → ~/.claude/rules/<topic>.md
+ └── NO → Specific to a subdirectory?
+ ├── YES → <dir>/CLAUDE.md
+ └── NO → Reference or operational?
+ ├── Reference → docs/ or ARCHITECTURE.md
+ └── Operational → ./CLAUDE.md (root)
+ ```
+3. Draft all changes as diffs in a single batch
+4. Apply after single yes/no confirmation
+
+**Keep it concise**: one line per concept.
+
+## Mode 5: Add Preset
+
+**When**: "add python permissions", "add docker", "add MCP servers".
+
+1. Read the preset from [references/permission-presets.md](references/permission-presets.md)
+2. Read existing `.claude/settings.local.json`
+3. Merge without duplicating
+4. Remind: **session restart required**
+
+## Mode 6: Restructure Context
+
+**When**: Root CLAUDE.md over 200 lines, "restructure memory".
+
+1. Launch Context Auditor agent first
+2. Based on findings:
+ - Split oversized CLAUDE.md into `.claude/rules/<topic>.md`
+ - Extract directory-specific content to sub-directory CLAUDE.md
+ - Move reference material to `docs/`
+ - Resolve overlaps
+ - Create missing docs for project type
+3. Present plan, apply after approval
+
+### Size Targets
+
+| File | Target | Maximum |
+|------|--------|---------|
+| Root CLAUDE.md | 50-150 lines | 200 |
+| Sub-directory CLAUDE.md | 15-50 lines | 80 |
+| Rules topic file | 20-80 lines | 120 |
+
+## Permission Syntax Quick Reference
+
+| Pattern | Meaning |
+|---------|---------|
+| `Bash(git *)` | Preferred — space before `*` = word boundary |
+| `Bash(nvidia-smi)` | Exact match, no arguments |
+| `WebFetch` | Blanket web fetch |
+| `WebSearch` | Blanket web search |
+| `mcp__brain__*` | All tools on one MCP server |
+
+### What Does NOT Work
+
+| Pattern | Why |
+|---------|-----|
+| `mcp__*` | Wildcard doesn't cross `__` boundary |
+| `mcp__*__*` | Still doesn't work |
+| `Bash(git:*)` | Deprecated colon syntax (works but prefer space) |
+
+### Important Behaviours
+
+- **Not hot-reloaded**: `settings.local.json` edits need session restart
+- **"Don't ask again"** injects at runtime (no restart) using colon format — normal
+- **Shadows, not merges**: Project settings completely replace global
+- **`gh` bug**: `Bash(gh *)` sometimes misses subcommands — include explicit `Bash(gh issue *)` etc.
+
+## Autonomy
+
+- **Just do it**: Detect project type, launch audit agents, discover MCP servers
+- **Brief confirmation**: Write/update files (single batch yes/no)
+- **Ask first**: git init, GitHub repo, delete existing content, major restructures
+
+## Reference Files
+
+| When | Read |
+|------|------|
+| Building permission presets | [references/permission-presets.md](references/permission-presets.md) |
+| Generating CLAUDE.md, .gitignore | [references/templates.md](references/templates.md) |
+| Scoring CLAUDE.md quality | [references/quality-criteria.md](references/quality-criteria.md) |
+| Detecting project type + expected docs | [references/project-types.md](references/project-types.md) |
+| Setting up commit capture hook | [references/commit-hook.md](references/commit-hook.md) |
diff --git a/plugins/dev-tools/skills/project-health/references/commit-hook.md b/plugins/dev-tools/skills/project-health/references/commit-hook.md
new file mode 100644
index 00000000..25aa8216
--- /dev/null
+++ b/plugins/dev-tools/skills/project-health/references/commit-hook.md
@@ -0,0 +1,43 @@
+# Recommended Hook: Context Capture on Commit
+
+Automatically remind Claude to capture learnings after every git commit. This pairs with Mode 1 (Session Capture) — the hook triggers the prompt, the skill handles the capture.
+
+## Setup
+
+Create this file at `~/.claude/hookify.context-capture-reminder.local.md` for global coverage, or `project/.claude/hookify.context-capture-reminder.local.md` for a single project:
+
+```markdown
+---
+name: context-capture-reminder
+enabled: true
+event: bash
+pattern: git\s+commit
+action: warn
+---
+
+Context check: Were any patterns, gotchas, or commands discovered during this work that should be captured to CLAUDE.md or .claude/rules/? If yes, update them now before moving on. If nothing new was learned, carry on.
+```
+
+## How It Works
+
+1. You finish work and commit
+2. The hook fires after the `git commit` Bash call
+3. Claude pauses to consider whether anything learned during this work should be persisted
+4. If yes, Claude updates CLAUDE.md or creates/updates a `.claude/rules/` file
+5. If nothing new, Claude continues
+
+## Why Commit Time?
+
+- Context is fresh — you just finished the work
+- You're creating a permanent record anyway
+- Natural checkpoint before moving to the next task
+- Pairs with `git log` for tracing when a pattern was discovered
+
+## Requires
+
+This hook uses the [hookify](https://github.com/jezweb/claude-skills) plugin for Claude Code. If you don't have hookify, you can add the same reminder as a line in your CLAUDE.md:
+
+```markdown
+## Workflow
+- Before committing: check if any discoveries should be captured to CLAUDE.md or .claude/rules/
+```
diff --git a/plugins/dev-tools/skills/project-health/references/permission-presets.md b/plugins/dev-tools/skills/project-health/references/permission-presets.md
new file mode 100644
index 00000000..48c92362
--- /dev/null
+++ b/plugins/dev-tools/skills/project-health/references/permission-presets.md
@@ -0,0 +1,408 @@
+# Permission Presets
+
+Curated permission presets for `settings.local.json`. Each preset is a JSON array of permission strings grouped with `//` comments. Compose presets by stacking: Universal Base + language preset + deployment preset + extras.
+
+## Syntax Reference
+
+| Pattern | Meaning |
+|---------|---------|
+| `Bash(git *)` | Space before `*` = word boundary. Matches `git status` but not `gitk`. **Preferred syntax.** |
+| `Bash(git*)` | No space = prefix match. Matches `git status` AND `gitk`. |
+| `Bash(nvidia-smi)` | Exact match — no arguments. Use for bare commands. |
+| `WebFetch` | Blanket web fetch (all domains) |
+| `WebFetch(domain:example.com)` | Domain-scoped web fetch |
+| `WebSearch` | Blanket web search |
+| `mcp__brain__*` | All tools on one MCP server |
+| `mcp__brain__brain_sites` | One specific MCP tool |
+
+### Format Notes
+
+- **Deprecated**: `Bash(git:*)` colon syntax still works but prefer space syntax `Bash(git *)`
+- **"Don't ask again"** prompt uses legacy colon format (e.g. `node:*`) — it's equivalent but looks different
+- **Comments**: `"// --- Section ---"` strings in the allow array are ignored and useful for organisation
+- **Not hot-reloaded**: Changes to `settings.local.json` require a session restart. "Don't ask again" bypasses this because it injects into the running session directly.
+
+**Critical**: Project `settings.local.json` **SHADOWS** global settings (does not merge). If a project has its own allow list, the global allow list is ignored entirely for that project.
+
+Shell operators (`&&`, `||`, `;`) are handled safely — `Bash(git *)` won't match `git add && rm -rf /`.
+
+---
+
+## Universal Base
+
+Every project gets these. Version control, file operations, and basic tools needed for all development.
+
+```json
+"// --- Version Control ---",
+"Bash(git *)",
+"Bash(gh *)",
+"Bash(gh repo *)",
+"Bash(gh issue *)",
+"Bash(gh pr *)",
+"Bash(gh api *)",
+"Bash(gh search *)",
+"Bash(gh run *)",
+"Bash(gh release *)",
+
+"// --- File Operations ---",
+"Bash(ls *)",
+"Bash(cat *)",
+"Bash(head *)",
+"Bash(tail *)",
+"Bash(wc *)",
+"Bash(sort *)",
+"Bash(mkdir *)",
+"Bash(cp *)",
+"Bash(mv *)",
+"Bash(touch *)",
+"Bash(chmod *)",
+"Bash(find *)",
+"Bash(tree *)",
+"Bash(du *)",
+"Bash(df *)",
+
+"// --- Archives ---",
+"Bash(tar *)",
+"Bash(zip *)",
+"Bash(unzip *)",
+"Bash(gzip *)",
+
+"// --- Text Processing ---",
+"Bash(grep *)",
+"Bash(rg *)",
+"Bash(awk *)",
+"Bash(sed *)",
+"Bash(diff *)",
+"Bash(jq *)",
+"Bash(echo *)",
+"Bash(printf *)",
+"Bash(tee *)",
+
+"// --- System ---",
+"Bash(which *)",
+"Bash(whereis *)",
+"Bash(type *)",
+"Bash(ps *)",
+"Bash(env *)",
+"Bash(date *)",
+"Bash(uname *)",
+"Bash(make *)",
+
+"// --- Network ---",
+"Bash(curl *)",
+"Bash(wget *)",
+"Bash(ssh *)",
+"Bash(scp *)",
+"Bash(rsync *)",
+"Bash(dig *)",
+
+"// --- Web ---",
+"WebSearch",
+"WebFetch"
+```
+
+---
+
+## JavaScript / TypeScript
+
+For any JS/TS project. Add to Universal Base.
+
+```json
+"// --- Node.js ---",
+"Bash(node *)",
+"Bash(npm *)",
+"Bash(npx *)",
+
+"// --- Alternative Runtimes ---",
+"Bash(bun *)",
+"Bash(bunx *)",
+"Bash(deno *)",
+
+"// --- Package Managers ---",
+"Bash(pnpm *)",
+"Bash(yarn *)",
+
+"// --- TypeScript ---",
+"Bash(tsc *)",
+"Bash(tsx *)",
+
+"// --- Bundlers ---",
+"Bash(esbuild *)",
+"Bash(vite *)",
+"Bash(turbo *)",
+
+"// --- Testing ---",
+"Bash(jest *)",
+"Bash(vitest *)",
+"Bash(playwright *)",
+"Bash(cypress *)",
+
+"// --- Linting / Formatting ---",
+"Bash(eslint *)",
+"Bash(prettier *)",
+"Bash(biome *)"
+```
+
+---
+
+## Python
+
+For Python projects. Add to Universal Base.
+
+```json
+"// --- Python Runtime ---",
+"Bash(python *)",
+"Bash(python3 *)",
+
+"// --- Package Managers ---",
+"Bash(pip *)",
+"Bash(pip3 *)",
+"Bash(uv *)",
+"Bash(poetry *)",
+"Bash(pipx *)",
+"Bash(conda *)",
+
+"// --- Testing / Quality ---",
+"Bash(pytest *)",
+"Bash(mypy *)",
+"Bash(ruff *)",
+"Bash(black *)",
+"Bash(flake8 *)",
+"Bash(isort *)",
+
+"// --- Dev Servers ---",
+"Bash(flask *)",
+"Bash(uvicorn *)",
+"Bash(gunicorn *)",
+"Bash(django-admin *)",
+
+"// --- Notebooks ---",
+"Bash(jupyter *)"
+```
+
+---
+
+## PHP
+
+For PHP projects including WordPress and Laravel. Add to Universal Base.
+
+```json
+"// --- PHP Runtime ---",
+"Bash(php *)",
+"Bash(composer *)",
+
+"// --- WordPress ---",
+"Bash(wp *)",
+
+"// --- Testing / Quality ---",
+"Bash(phpunit *)",
+"Bash(phpstan *)",
+"Bash(phpcs *)",
+"Bash(phpcbf *)",
+"Bash(pest *)",
+
+"// --- Laravel ---",
+"Bash(artisan *)",
+"Bash(sail *)"
+```
+
+---
+
+## Go
+
+For Go projects. Add to Universal Base.
+
+```json
+"// --- Go ---",
+"Bash(go *)",
+"Bash(golangci-lint *)"
+```
+
+---
+
+## Rust
+
+For Rust projects. Add to Universal Base.
+
+```json
+"// --- Rust ---",
+"Bash(cargo *)",
+"Bash(rustc *)",
+"Bash(rustup *)"
+```
+
+---
+
+## Ruby
+
+For Ruby / Rails projects. Add to Universal Base.
+
+```json
+"// --- Ruby ---",
+"Bash(ruby *)",
+"Bash(gem *)",
+"Bash(bundle *)",
+"Bash(bundler *)",
+"Bash(rails *)",
+"Bash(rake *)",
+"Bash(rspec *)"
+```
+
+---
+
+## Cloudflare Worker
+
+Deployment preset. Add to Universal Base + JavaScript/TypeScript.
+
+```json
+"// --- Wrangler ---",
+"Bash(wrangler *)",
+"Bash(npx wrangler *)"
+```
+
+---
+
+## Vercel
+
+Deployment preset. Add to Universal Base + JavaScript/TypeScript.
+
+```json
+"// --- Vercel ---",
+"Bash(vercel *)",
+"Bash(npx vercel *)",
+
+"// --- Prisma (common with Vercel) ---",
+"Bash(prisma *)",
+"Bash(npx prisma *)"
+```
+
+---
+
+## Docker / Containers
+
+For containerised projects. Add to any stack.
+
+```json
+"// --- Docker ---",
+"Bash(docker *)",
+"Bash(docker-compose *)",
+
+"// --- Kubernetes ---",
+"Bash(kubectl *)",
+"Bash(helm *)",
+
+"// --- IaC ---",
+"Bash(terraform *)",
+"Bash(pulumi *)"
+```
+
+---
+
+## Database
+
+For projects that interact with databases directly. Add to any stack.
+
+```json
+"// --- SQL ---",
+"Bash(psql *)",
+"Bash(mysql *)",
+"Bash(sqlite3 *)",
+
+"// --- NoSQL ---",
+"Bash(redis-cli *)",
+"Bash(mongosh *)"
+```
+
+---
+
+## Cloud CLIs
+
+For cloud-deployed projects. Add to any stack.
+
+```json
+"// --- AWS ---",
+"Bash(aws *)",
+
+"// --- Google Cloud ---",
+"Bash(gcloud *)",
+"Bash(gsutil *)",
+
+"// --- Azure ---",
+"Bash(az *)"
+```
+
+---
+
+## AI / GPU
+
+For AI/ML workloads. Add to any stack.
+
+```json
+"// --- Local LLM ---",
+"Bash(ollama *)",
+
+"// --- GPU ---",
+"Bash(nvidia-smi *)",
+"Bash(nvidia-smi)"
+```
+
+Note: `Bash(nvidia-smi)` (no wildcard) matches the bare command with no arguments, which is the most common usage.
+
+---
+
+## MCP Servers
+
+MCP (Model Context Protocol) servers provide tool access to external services. Permission patterns use the format `mcp__servername__toolname`.
+
+### Per-Server Wildcards (Recommended)
+
+Allow all tools on each MCP server you trust. You must list each server individually — `mcp__*` does NOT work as a blanket (the wildcard only matches within the last segment, not across the `__` boundary).
+
+```json
+"mcp__brain__*",
+"mcp__playwright__*",
+"mcp__vault__*"
+```
+
+### Individual Tools
+
+For maximum control, allow specific tools only:
+
+```json
+"mcp__brain__brain_sites",
+"mcp__brain__brain_recall"
+```
+
+---
+
+## Combining Presets
+
+Presets stack. Examples:
+
+| Project Type | Presets to Combine |
+|-------------|-------------------|
+| Next.js on Vercel | Universal + JavaScript/TypeScript + Vercel |
+| Cloudflare Worker | Universal + JavaScript/TypeScript + Cloudflare Worker |
+| Django app | Universal + Python + Database + Docker |
+| WordPress plugin | Universal + PHP |
+| Rust CLI | Universal + Rust |
+| ML project | Universal + Python + AI/GPU |
+| Full-stack ops | Universal + JavaScript/TypeScript + Python + Docker + Database + MCP (blanket) |
+
+When merging, deduplicate and keep the grouped `//` comment structure. The final `settings.local.json` should look like:
+
+```json
+{
+ "permissions": {
+ "allow": [
+ "// --- Version Control ---",
+ "Bash(git *)",
+ "Bash(gh *)",
+ "// --- Node.js ---",
+ "Bash(node *)",
+ "..."
+ ],
+ "deny": []
+ }
+}
+```
diff --git a/plugins/dev-tools/skills/project-health/references/project-types.md b/plugins/dev-tools/skills/project-health/references/project-types.md
new file mode 100644
index 00000000..f4dcdf08
--- /dev/null
+++ b/plugins/dev-tools/skills/project-health/references/project-types.md
@@ -0,0 +1,149 @@
+# Project Types
+
+Detect project type from file presence to determine which documentation files are expected. Only suggest docs that match — no enterprise bloat.
+
+## Detection Heuristics
+
+Check indicators in priority order (first match wins for primary type, but types can stack):
+
+| Indicator Files | Project Type |
+|----------------|-------------|
+| `wrangler.jsonc` or `wrangler.toml` | cloudflare-worker |
+| `vite.config.*` + `src/` with `.tsx` files | vite-react |
+| `vite.config.*` without React | vite-app |
+| `next.config.*` | nextjs |
+| `src/index.ts` + `FastMCP` or `McpAgent` imports | mcp-server |
+| `skills/` dir + SKILL.md files within | skills-repo |
+| `src/routes/` or `src/api/` or `app/api/` | api-project |
+| `drizzle.config.*` or `prisma/schema.prisma` or D1 bindings in wrangler | database-project |
+| `.claude/agents/` + operational scripts | claude-ops |
+| `package.json` only (generic Node) | node-project |
+| `pyproject.toml` or `setup.py` | python-project |
+
+**Stacking**: A Cloudflare Worker with D1 bindings is both `cloudflare-worker` and `database-project`. Union the expected docs.
+
+## Expected Documentation Per Type
+
+### All projects
+
+| Doc | Purpose |
+|-----|---------|
+| `CLAUDE.md` (root) | Project identity, stack, commands, critical rules |
+
+### cloudflare-worker
+
+| Doc | Purpose |
+|-----|---------|
+| `ARCHITECTURE.md` | Worker entry point, bindings, routes, middleware |
+
+### vite-react / nextjs
+
+| Doc | Purpose |
+|-----|---------|
+| `ARCHITECTURE.md` | Component tree, routing, state management, build pipeline |
+
+### mcp-server
+
+| Doc | Purpose |
+|-----|---------|
+| `ARCHITECTURE.md` | Server structure, tool registration, auth flow |
+| `API_ENDPOINTS.md` | Tool catalogue with parameters and return types |
+
+### api-project
+
+| Doc | Purpose |
+|-----|---------|
+| `API_ENDPOINTS.md` | Routes, methods, request/response schemas, auth requirements |
+| `DATABASE_SCHEMA.md` | Tables, relationships, indexes, migration workflow |
+
+### database-project
+
+| Doc | Purpose |
+|-----|---------|
+| `DATABASE_SCHEMA.md` | Tables, relationships, indexes, migration commands |
+
+### skills-repo
+
+| Doc | Purpose |
+|-----|---------|
+| Per-skill `SKILL.md` | Each skill directory needs its own SKILL.md |
+
+### claude-ops
+
+No additional docs beyond CLAUDE.md — operational repos are typically self-documenting through their agents and scripts.
+
+## Doc Templates
+
+### ARCHITECTURE.md outline
+
+```markdown
+# Architecture
+
+## Overview
+[One paragraph: what this project does and how it's structured]
+
+## Stack
+[Tech stack with versions]
+
+## Directory Structure
+[Tree with purpose annotations]
+
+## Key Flows
+[1-3 main data/request flows through the system]
+
+## Deployment
+[How to deploy, what happens on deploy]
+```
+
+### DATABASE_SCHEMA.md outline
+
+```markdown
+# Database Schema
+
+## Tables
+[Table per section: name, columns, types, constraints]
+
+## Relationships
+[Foreign keys, join patterns]
+
+## Migrations
+[How to create/run migrations, local vs remote]
+
+## Indexes
+[Non-obvious indexes and why they exist]
+```
+
+### API_ENDPOINTS.md outline
+
+```markdown
+# API Endpoints
+
+## Authentication
+[Auth method, where tokens come from]
+
+## Endpoints
+[Per endpoint: method, path, params, response shape, auth required]
+
+## Error Handling
+[Standard error format, common error codes]
+```
+
+## docs/ Directory
+
+Projects with a `docs/` folder get its contents scanned for staleness and overlap with CLAUDE.md. Common patterns:
+
+| Pattern | Example |
+|---------|---------|
+| Component docs | `docs/RICH_CONTENT_COMPONENTS.md` |
+| API guides | `docs/api-guide.md` |
+| Planning briefs | `docs/briefs/feature-x.md` |
+
+The audit doesn't manage docs/ content — it flags staleness (broken file references) and overlap (sections duplicated with CLAUDE.md).
+
+## Rules
+
+- Only suggest docs that match detected project type
+- Simple projects (node-project, python-project) just need CLAUDE.md
+- Don't create empty template docs — only suggest when there's content to fill
+- Prefer one well-maintained doc over three sparse ones
+- If CLAUDE.md duplicates ARCHITECTURE.md or docs/, move the content to docs/ and keep CLAUDE.md concise
diff --git a/plugins/dev-tools/skills/project-health/references/quality-criteria.md b/plugins/dev-tools/skills/project-health/references/quality-criteria.md
new file mode 100644
index 00000000..c28561f5
--- /dev/null
+++ b/plugins/dev-tools/skills/project-health/references/quality-criteria.md
@@ -0,0 +1,97 @@
+# Quality Criteria
+
+Score CLAUDE.md files on a 100-point scale across 6 criteria. Use this when running a full audit (Mode 2) or restructure (Mode 3).
+
+## Scoring Rubric
+
+### Commands/Workflows (20 points)
+
+Build, test, deploy, and dev commands documented with context.
+
+| Score | Meaning |
+|-------|---------|
+| 20 | All essential commands with context (when to use, flags) |
+| 15 | Most commands documented, some missing context |
+| 10 | Basic commands only (e.g. `npm run dev`) |
+| 5 | Few commands, no context |
+| 0 | None documented |
+
+### Architecture Clarity (20 points)
+
+Directory structure, module relationships, entry points, data flow.
+
+| Score | Meaning |
+|-------|---------|
+| 20 | Clear codebase map with relationships and entry points |
+| 15 | Good overview, minor gaps |
+| 10 | Basic directory listing only |
+| 5 | Vague or incomplete |
+| 0 | None |
+
+### Non-Obvious Patterns (15 points)
+
+Gotchas, quirks, edge cases, workarounds, "why" for unusual decisions.
+
+| Score | Meaning |
+|-------|---------|
+| 15 | Gotchas and quirks captured with explanations |
+| 10 | Some patterns documented |
+| 5 | Minimal |
+| 0 | None |
+
+### Conciseness (15 points)
+
+Dense, valuable content. No filler, no redundancy, each line earns its place.
+
+| Score | Meaning |
+|-------|---------|
+| 15 | Every line adds value, no filler |
+| 10 | Mostly concise, minor bloat |
+| 5 | Verbose in places |
+| 0 | Mostly filler or generic advice |
+
+### Currency (15 points)
+
+Reflects the actual current codebase. Commands work, files exist, stack is correct.
+
+| Score | Meaning |
+|-------|---------|
+| 15 | All references valid, commands work, stack current |
+| 10 | Mostly current, minor staleness |
+| 5 | Several outdated references |
+| 0 | Severely outdated |
+
+### Actionability (15 points)
+
+Instructions are executable. Copy-paste ready commands, real paths, concrete steps.
+
+| Score | Meaning |
+|-------|---------|
+| 15 | Copy-paste ready, concrete, real paths |
+| 10 | Mostly actionable |
+| 5 | Some vague instructions |
+| 0 | Theoretical or generic |
+
+## Grading Scale
+
+| Grade | Score | Meaning |
+|-------|-------|---------|
+| A | 90-100 | Comprehensive, current, actionable |
+| B | 70-89 | Good coverage, minor gaps |
+| C | 50-69 | Basic info, missing key sections |
+| D | 30-49 | Sparse or outdated |
+| F | 0-29 | Missing or severely outdated |
+
+## Red Flags
+
+Flag these during audit — each indicates a quality problem:
+
+- Commands that fail when run
+- References to files/directories that don't exist
+- Outdated technology versions or deprecated APIs
+- Generic advice not specific to the project (e.g. "write clean code")
+- Copy-paste templates that weren't customised
+- "TODO" items that were never completed
+- Duplicated content across multiple CLAUDE.md files
+- Verbose explanations of things Claude already knows
+- Changelogs or version history (belongs in git, not CLAUDE.md)
diff --git a/plugins/dev-tools/skills/project-health/references/templates.md b/plugins/dev-tools/skills/project-health/references/templates.md
new file mode 100644
index 00000000..3870f4d7
--- /dev/null
+++ b/plugins/dev-tools/skills/project-health/references/templates.md
@@ -0,0 +1,386 @@
+# Templates
+
+Templates for CLAUDE.md files, rules topic files, sub-directory context, and .gitignore. Use these when creating new files or restructuring existing ones.
+
+---
+
+## Root CLAUDE.md (Minimal)
+
+For simple projects with a single developer:
+
+```markdown
+# [Project Name]
+
+[One-line description]
+
+## Stack
+
+[Tech stack summary]
+
+## Commands
+
+| Command | Purpose |
+|---------|---------|
+| `npm run dev` | Start dev server |
+| `npm run build` | Production build |
+| `npm run deploy` | Deploy to [platform] |
+
+## Gotchas
+
+- [Non-obvious thing 1]
+- [Non-obvious thing 2]
+```
+
+Target: 30-60 lines.
+
+## Root CLAUDE.md (Comprehensive)
+
+For projects with external integrations, multiple contributors, or complex workflows:
+
+```markdown
+# [Project Name]
+
+**Repository**: [URL]
+**Owner**: [Name]
+
+[One-line description]
+
+## Stack
+
+[Tech stack with key decisions noted]
+
+## Directory Structure
+
+[Annotated tree of key directories]
+
+## Commands
+
+| Command | Purpose |
+|---------|---------|
+| `npm run dev` | Start dev server |
+| `npm run build` | Production build |
+| `npm run deploy` | Deploy to [platform] |
+| `npm test` | Run test suite |
+
+## Key Files
+
+| File | Purpose |
+|------|---------|
+| `src/index.ts` | Entry point |
+| `wrangler.jsonc` | Cloudflare config |
+
+## Critical Rules
+
+- [Never do X because Y]
+- [Always do A before B]
+
+## Gotchas
+
+- [Non-obvious thing 1]
+- [Non-obvious thing 2]
+```
+
+Target: 60-150 lines.
+
+---
+
+## Project-Type Templates
+
+### Cloudflare Worker
+
+```markdown
+# [Project Name]
+
+**Repository**: https://github.com/[org]/[repo-name]
+**Last Updated**: [date]
+
+## Stack
+
+- Cloudflare Workers + Static Assets
+- Vite + React 19 + @cloudflare/vite-plugin
+- Tailwind v4 + shadcn/ui (neutral palette)
+- D1 (SQLite) + Drizzle ORM
+- Hono (API routing)
+- pnpm
+
+## Commands
+
+| Command | Purpose |
+|---------|---------|
+| `pnpm dev` | Local dev server (Vite + Miniflare) |
+| `pnpm build` | Production build |
+| `pnpm deploy` | Deploy to Cloudflare |
+| `pnpm db:migrate:local` | Run D1 migrations locally |
+| `pnpm db:migrate:remote` | Run D1 migrations on production |
+
+## Cloudflare
+
+- **Compatibility flags**: `nodejs_compat` (never use `node_compat`)
+- Always use Workers + Static Assets (never Cloudflare Pages)
+
+## Critical Rules
+
+- Run migrations on BOTH local AND remote before testing
+- Set `account_id` in wrangler.jsonc to avoid interactive prompts
+- D1 bulk inserts: batch into chunks of ~10 rows (parameter limit)
+- `wrangler secret put` does NOT auto-deploy — run `wrangler deploy` after
+
+## Gotchas
+
+[Add as discovered]
+```
+
+### Vercel App
+
+```markdown
+# [Project Name]
+
+**Repository**: https://github.com/[org]/[repo-name]
+**Last Updated**: [date]
+
+## Stack
+
+- Next.js / Vite + React 19
+- Tailwind v4 + shadcn/ui (neutral palette)
+- pnpm
+
+## Commands
+
+| Command | Purpose |
+|---------|---------|
+| `pnpm dev` | Local dev server |
+| `pnpm build` | Production build |
+| `vercel deploy` | Deploy to Vercel |
+| `vercel deploy --prod` | Deploy to production |
+
+## Gotchas
+
+[Add as discovered]
+```
+
+### Node Generic
+
+```markdown
+# [Project Name]
+
+**Repository**: https://github.com/[org]/[repo-name]
+**Last Updated**: [date]
+
+## Stack
+
+- Node.js + TypeScript (ES modules)
+- pnpm
+
+## Commands
+
+| Command | Purpose |
+|---------|---------|
+| `pnpm dev` | Local dev server |
+| `pnpm build` | Production build |
+| `pnpm test` | Run tests |
+
+## Gotchas
+
+[Add as discovered]
+```
+
+### Python
+
+```markdown
+# [Project Name]
+
+**Repository**: https://github.com/[org]/[repo-name]
+**Last Updated**: [date]
+
+## Stack
+
+- Python 3.12+
+- uv (package management)
+
+## Commands
+
+| Command | Purpose |
+|---------|---------|
+| `uv run python main.py` | Run the application |
+| `uv sync` | Install dependencies |
+| `uv run pytest` | Run tests |
+
+## Gotchas
+
+[Add as discovered]
+```
+
+### Ops / Admin (Claude Code Plugin)
+
+```markdown
+# [Project Name]
+
+**Repository**: https://github.com/[org]/[repo-name]
+**Last Updated**: [date]
+
+## Purpose
+
+[What this operational project does]
+
+## MCP Servers
+
+| Server | Purpose |
+|--------|---------|
+| [server] | [what it does] |
+
+## Gotchas
+
+[Add as discovered]
+```
+
+---
+
+## Sub-Directory CLAUDE.md
+
+For directories with external integrations, non-obvious config, or common gotchas:
+
+```markdown
+# [Component Name]
+
+## Key Integrations
+
+- **[Service]**: [endpoint], [auth method], [secret location]
+
+## Commands
+
+[Directory-specific commands if different from root]
+
+## Gotchas
+
+- [Non-obvious thing specific to this directory]
+```
+
+Target: 15-50 lines.
+
+**Don't create when**: parent CLAUDE.md covers it, directory is self-explanatory, content would be under 10 lines.
+
+## Rules Topic File (.claude/rules/*.md)
+
+For correction rules, patterns, and technical facts:
+
+```markdown
+# [Topic Name]
+
+## [Pattern/Rule Category]
+
+| If Claude suggests... | Use instead... |
+|----------------------|----------------|
+| [Wrong pattern] | [Correct pattern] |
+
+[Code example if helpful]
+
+**Last Updated**: [date]
+```
+
+Target: 20-80 lines per topic file.
+
+---
+
+## Section Placement Guide
+
+| Content Type | Where It Goes |
+|-------------|---------------|
+| Project name, owner, purpose | Root CLAUDE.md |
+| Tech stack, architecture overview | Root CLAUDE.md |
+| Build/deploy/test commands | Root CLAUDE.md |
+| Critical "never do X" rules | Root CLAUDE.md |
+| Directory structure | Root CLAUDE.md |
+| External service integrations | Sub-directory CLAUDE.md |
+| Directory-specific gotchas | Sub-directory CLAUDE.md |
+| Correction rules (training cutoff) | `.claude/rules/<topic>.md` |
+| Session-specific discoveries | Auto-memory (managed by Claude Code) |
+
+## Anti-Patterns
+
+- Verbose explanations of standard tools or frameworks
+- Changelogs or version history (use git)
+- Content Claude already knows from training
+- Duplicating parent CLAUDE.md content in child files
+- Generic best practices not specific to the project
+- Empty template sections with placeholder text
+
+---
+
+## .gitignore Templates
+
+### Cloudflare Worker / Node
+
+```
+node_modules/
+.wrangler/
+dist/
+.dev.vars
+*.log
+.DS_Store
+.env
+.env.local
+.claude/settings.local.json
+.claude/plans/
+```
+
+### Python
+
+```
+__pycache__/
+*.pyc
+.venv/
+dist/
+*.egg-info/
+.env
+.env.local
+.DS_Store
+.claude/settings.local.json
+.claude/plans/
+```
+
+### Ops / Admin
+
+```
+.DS_Store
+.env
+.env.local
+.claude/settings.local.json
+.claude/plans/
+```
+
+### PHP / WordPress
+
+```
+vendor/
+node_modules/
+*.log
+.DS_Store
+.env
+.env.local
+.claude/settings.local.json
+.claude/plans/
+```
+
+### Go
+
+```
+bin/
+*.exe
+*.test
+*.out
+.DS_Store
+.env
+.claude/settings.local.json
+.claude/plans/
+```
+
+### Rust
+
+```
+target/
+Cargo.lock
+.DS_Store
+.env
+.claude/settings.local.json
+.claude/plans/
+```