Skip to content

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

feat: Reorganize commands into skills + add docs-workflow skill

Jez965118c89be9
diff --git a/commands/README.md b/commands/README.md
index 522332df..9b159bd1 100644
--- a/commands/README.md
+++ b/commands/README.md
@@ -1,231 +1,37 @@
# Claude Code Slash Commands
-Ten slash commands for automating project exploration, planning, session workflow, knowledge capture, skill creation, deployment, and release safety with Claude Code.
+This directory contains **orphan commands** - specialized commands for managing the claude-skills repository itself. These are niche tools not needed by most users.
-## ⚠️ New Installation Method
+## ⚠️ Command Reorganization (2026-01-11)
-These commands are now bundled as the **project-workflow** skill!
+Most slash commands have been moved into their appropriate skills:
-### Recommended: Install via Marketplace
+| Command | Now In | Installation |
+|---------|--------|--------------|
+| `/explore-idea` | `project-workflow` | `/plugin install project-workflow@claude-skills` |
+| `/plan-project` | `project-workflow` | `/plugin install project-workflow@claude-skills` |
+| `/plan-feature` | `project-workflow` | `/plugin install project-workflow@claude-skills` |
+| `/wrap-session` | `project-workflow` | `/plugin install project-workflow@claude-skills` |
+| `/continue-session` | `project-workflow` | `/plugin install project-workflow@claude-skills` |
+| `/workflow` | `project-workflow` | `/plugin install project-workflow@claude-skills` |
+| `/release` | `project-workflow` | `/plugin install project-workflow@claude-skills` |
+| `/brief` | `project-workflow` | `/plugin install project-workflow@claude-skills` |
+| `/reflect` | `project-workflow` | `/plugin install project-workflow@claude-skills` |
+| `/deploy` | `cloudflare-worker-base` | `/plugin install cloudflare-worker-base@claude-skills` |
+| `/docs` | `docs-workflow` | `/plugin install docs-workflow@claude-skills` |
+| `/docs/init` | `docs-workflow` | `/plugin install docs-workflow@claude-skills` |
+| `/docs/update` | `docs-workflow` | `/plugin install docs-workflow@claude-skills` |
+| `/docs/claude` | `docs-workflow` | `/plugin install docs-workflow@claude-skills` |
-```bash
-# Add the marketplace
-/plugin marketplace add https://github.com/jezweb/claude-skills
-
-# Install project-workflow skill (includes all 7 commands)
-/plugin install project-workflow@claude-skills
-```
-
-All commands will be automatically available in Claude Code.
-
-### Alternative: Manual Installation
-
-If you prefer manual installation, copy commands to your `.claude/commands/` directory:
-
-```bash
-# From the claude-skills repo
-cp skills/project-workflow/commands/explore-idea.md ~/.claude/commands/
-cp skills/project-workflow/commands/plan-project.md ~/.claude/commands/
-cp skills/project-workflow/commands/plan-feature.md ~/.claude/commands/
-cp skills/project-workflow/commands/wrap-session.md ~/.claude/commands/
-cp skills/project-workflow/commands/continue-session.md ~/.claude/commands/
-cp skills/project-workflow/commands/workflow.md ~/.claude/commands/
-cp skills/project-workflow/commands/release.md ~/.claude/commands/
-cp commands/reflect.md ~/.claude/commands/
-```
-
-Commands are immediately available in Claude Code after copying.
-
-**Note:** This directory (`/commands/`) is maintained for reference and manual installation. The canonical source is now `skills/project-workflow/commands/`.
-
-## Commands
-
-### Exploration Command
-
-#### `/explore-idea`
-
-**Purpose**: Collaborative exploration and brainstorming for new project ideas (PRE-planning phase)
-
-**Usage**: Type `/explore-idea` when you have a rough idea and want to validate approach, research options, and create decision-ready brief
-
-**What it does**:
-1. Engages in free-flowing conversation to understand your vision
-2. Conducts heavy research (Explore agents, Context7 MCP, WebSearch)
-3. Validates tech stack and approach
-4. Challenges assumptions and prevents scope creep
-5. Creates PROJECT_BRIEF.md with validated decisions
-6. Recommends: Proceed/Pause/Pivot
-7. Seamlessly hands off to /plan-project if proceeding
-
-**Time savings**: 10-15 minutes per project idea (research + validation + scope management)
-
-**When to use**:
-- You have rough idea but not validated approach
-- Multiple tech options and unsure which fits
-- Want research/validation before committing to build
-- Need scope management before detailed planning
-
-**When to skip**:
-- You have crystal-clear requirements and validated stack (use /plan-project directly)
-
----
-
-### Planning Commands
-
-#### `/plan-project`
-
-**Purpose**: Automate initial project planning for NEW projects (POST-exploration phase)
-
-**Usage**: Type `/plan-project` after you've decided on project requirements (or after `/explore-idea`)
-
-**What it does**:
-1. Checks for PROJECT_BRIEF.md (from /explore-idea) and uses it as context
-2. Invokes project-planning skill to generate IMPLEMENTATION_PHASES.md
-3. Creates SESSION.md automatically
-4. Creates initial git commit with planning docs
-5. Shows formatted planning summary
-6. Asks permission to start Phase 1
-7. Optionally pushes to remote
-
-**Time savings**: 5-7 minutes per new project (15-20 manual steps → 1 command)
-
----
-
-#### `/plan-feature`
-
-**Purpose**: Add feature to existing project by generating and integrating new phases
-
-**Usage**: Type `/plan-feature` when you want to add a new feature to an existing project
-
-**What it does**:
-1. Verifies prerequisites (SESSION.md + IMPLEMENTATION_PHASES.md exist)
-2. Checks current phase status (warns if in progress)
-3. Gathers feature requirements (5 questions)
-4. Generates new phases via project-planning skill
-5. Integrates into IMPLEMENTATION_PHASES.md (handles phase renumbering)
-6. Updates SESSION.md with new pending phases
-7. Updates related docs (DATABASE_SCHEMA.md, API_ENDPOINTS.md if needed)
-8. Creates git commit for feature planning
-9. Shows formatted summary
-
-**Time savings**: 7-10 minutes per feature addition (25-30 manual steps → 1 command)
-
----
-
-### Session Management Commands
-
-#### `/wrap-session`
-
-**Purpose**: Automate end-of-session workflow
-
-**Usage**: Type `/wrap-session` in Claude Code
-
-**What it does**:
-1. Uses Task agent to analyze current session state
-2. Updates SESSION.md with progress
-3. Detects and updates relevant docs (CHANGELOG.md, ARCHITECTURE.md, etc.)
-4. Creates structured git checkpoint commit
-5. Outputs formatted handoff summary
-6. Optionally pushes to remote
-
-**Time savings**: 2-3 minutes per wrap-up (10-15 manual steps → 1 command)
-
----
-
-### `/continue-session`
-
-**Purpose**: Automate start-of-session context loading
-
-**Usage**: Type `/continue-session` in Claude Code
+## Orphan Commands (This Directory)
-**What it does**:
-1. Uses Explore agent to load session context (SESSION.md + planning docs)
-2. Shows recent git history (last 5 commits)
-3. Displays formatted session summary (phase, progress, Next Action)
-4. Shows verification criteria if in "Verification" stage
-5. Optionally opens "Next Action" file
-6. Asks permission to continue or adjust direction
-
-**Time savings**: 1-2 minutes per resume (5-8 manual reads → 1 command)
-
----
-
-### Knowledge Capture Commands
-
-#### `/reflect`
-
-**Purpose**: Self-reflection to capture operational knowledge before it's lost to context clearing
-
-**Usage**: Type `/reflect` before compacting context, after completing significant work, or when valuable learnings have accumulated
-
-**What it does**:
-1. Self-analyzes current conversation for operational knowledge
-2. Identifies workflows, patterns, tool sequences, corrections, discoveries
-3. Identifies **automation opportunities** - recurring processes worth scripting
-4. Categorizes each learning by appropriate destination
-5. Routes to: ~/.claude/CLAUDE.md (universal), ./CLAUDE.md (project), skills, docs/learnings.md, or SESSION.md
-6. Suggests creating scripts/commands for repeatable processes
-7. Presents findings with proposed destinations
-8. Applies updates and creates automation after user confirmation
-
-**Knowledge types captured**:
-- **Workflows**: Multi-step processes that achieved outcomes
-- **Patterns**: Reusable approaches to common problems
-- **Tool Sequences**: Effective tool combinations and order of operations
-- **Corrections**: What didn't work → what did work
-- **Discoveries**: New capabilities or undocumented behaviors
-- **Automation Opportunities**: Recurring processes worth scripting (suggests shell scripts, npm scripts, slash commands)
-
-**Time savings**: Preserves 5-15 minutes of operational learning per session (otherwise lost on context clear)
-
-**When to use**:
-- Before `/compact` or context clearing
-- After completing a significant task successfully
-- When you've discovered an effective workflow
-- Anytime important process knowledge has accumulated
-
-**When to skip**:
-- Session was purely routine (no new learnings)
-- All knowledge is already in commits/docs
-- Quick Q&A session with no process insights
-
-**Output**: Categorized learnings with routing suggestions, optional file updates
-
----
-
-### Helper Commands
-
-#### `/workflow`
+These commands are specific to the claude-skills repository and not bundled with any skill:
-**Purpose**: Interactive guide to the workflow system
-
-**Usage**: Type `/workflow` when you want to understand or navigate the workflow commands
-
-**What it does**:
-1. Shows overview of all 7 commands
-2. Asks what you're trying to do
-3. Provides context-aware guidance
-4. Shows decision trees (when to use which command)
-5. Offers to execute the appropriate command
-6. Points to comprehensive documentation
-
-**When to use**:
-- First time using the workflow system
-- Unsure which command to use
-- Want to see workflow examples
-- Need quick reference
-
-**Output**: Interactive guidance, optional command execution, reference to docs/JEZWEB_WORKFLOW.md
-
-**Time savings**: Instant navigation to correct command (vs reading docs)
-
----
-
-#### `/create-skill`
+### `/create-skill`
**Purpose**: Scaffold a new Claude Code skill from template
-**Usage**: Type `/create-skill my-skill-name` when you want to create a new skill
+**Usage**: `/create-skill my-skill-name`
**What it does**:
1. Validates skill name (lowercase-hyphen-case, max 40 chars)
@@ -235,267 +41,90 @@ Commands are immediately available in Claude Code after copying.
5. Applies type-specific customizations
6. Creates README.md with auto-trigger keywords
7. Runs metadata check
-8. Installs skill (symlinks to ~/.claude/skills/)
-
-**Time savings**: 5-10 minutes per skill (manual setup + remembering structure → 1 command)
-
-**When to use**:
-- Creating a new skill from scratch
-- Want proper directory structure
-- Need type-specific template guidance
-
-**When to skip**:
-- Copying/adapting an existing skill
-- Just need quick edit to existing skill
-
-**Related**: Use `skill-creator` skill for deeper guidance on designing effective skills (descriptions, token efficiency, freedom levels)
+8. Installs skill
-**Output**: Complete skill directory structure, installed and ready to fill with content
+**When to use**: Creating a new skill from scratch
---
-#### `/release`
+### `/review-skill`
-**Purpose**: Pre-release safety checks for GitHub publishing
+**Purpose**: Quality review and audit of an existing skill
-**Usage**: Type `/release` when ready to publish project to GitHub or create public release
+**Usage**: `/review-skill skill-name`
**What it does**:
+1. Checks SKILL.md structure and metadata
+2. Validates package versions against latest
+3. Reviews error documentation
+4. Checks template completeness
+5. Suggests improvements
-**Phase 1: Critical Safety (BLOCKERS)**
-1. Scans for secrets (API keys, tokens, passwords)
-2. Checks for personal artifacts (SESSION.md, planning/, screenshots/)
-3. Verifies git remote URL (pushing to correct repo)
-
-**Phase 2: Documentation Validation (REQUIRED)**
-4. Checks LICENSE file exists (creates if missing)
-5. Validates README completeness (>100 words, key sections)
-6. Checks CONTRIBUTING.md (recommended for >500 LOC)
-7. Checks CODE_OF_CONDUCT (recommended for >1000 LOC)
-
-**Phase 3: Configuration Validation**
-8. Validates .gitignore (essential patterns present)
-9. Checks package.json completeness (name, version, license, etc.)
-10. Verifies git branch (warns if on main/master)
-
-**Phase 4: Quality Checks (NON-BLOCKING)**
-11. Tests build (if build script exists)
-12. Checks dependency vulnerabilities (npm audit)
-13. Warns about large files (>1MB)
-
-**Phase 5: Release Readiness Report**
-- Comprehensive report with blockers/warnings/recommendations
-- Safe to release verdict
-
-**Phase 6-8: Auto-Fix & Publish**
-- Offers to fix issues (create LICENSE, update README, etc.)
-- Creates release preparation commit
-- Optional: Creates git tag and GitHub release
-
-**Time savings**: 10-15 minutes per release (comprehensive checks + automation)
-
-**When to use**:
-- Ready to push project to public GitHub
-- Before creating GitHub release
-- Want to ensure no secrets leaked
-- Need to validate documentation
-
-**When to skip**:
-- Private repository (some checks less critical)
-- Already manually verified everything
-
-**Output**: Release readiness report, optional auto-fixes, git commit, GitHub release
+**When to use**: Before publishing a skill update
---
-### Deployment Commands
-
-#### `/deploy`
+### `/audit`
-**Purpose**: Automated commit, push, and deploy for Cloudflare Workers projects
+**Purpose**: Multi-agent audit swarm for parallel skill verification
-**Usage**: Type `/deploy` in a Cloudflare Workers project when ready to ship changes
+**Usage**: `/audit` or `/audit skill-name`
**What it does**:
+1. Launches parallel agents to audit multiple skills
+2. Checks versions, metadata, content quality
+3. Generates consolidated report
-**Phase 1: Pre-flight Checks**
-1. Verifies wrangler.jsonc/toml exists (Cloudflare project)
-2. Runs `npm run build` (fails fast if build broken)
-3. Runs `npx tsc --noEmit` if TypeScript project
+**When to use**: Quarterly maintenance, bulk skill auditing
-**Phase 2: Commit & Push**
-4. Stages all changes
-5. Generates conventional commit message from diff
-6. Commits with Claude Code signature
-7. Pushes to remote
-
-**Phase 3: Deploy**
-8. Runs `npx wrangler deploy`
-9. Captures Worker URL from output
+---
-**Phase 4: Report**
-10. Shows summary: commit hash, push destination, Worker URL
-11. Reports any warnings from wrangler
+### `/deep-audit`
-**Time savings**: 2-3 minutes per deploy (manual steps → single command)
+**Purpose**: Deep content validation against official documentation
-**When to use**:
-- Ready to deploy Cloudflare Worker changes
-- Want automated commit message generation
-- Need consistent deploy workflow
+**Usage**: `/deep-audit skill-name`
-**When to skip**:
-- Non-Cloudflare projects (Vercel, Firebase, etc.)
-- Need manual control over commit message
-- Want to review changes before committing
+**What it does**:
+1. Fetches official documentation for the skill's technology
+2. Compares patterns and versions
+3. Identifies knowledge gaps or outdated content
+4. Suggests corrections and updates
-**Output**: Deploy summary with commit, push, and Worker URL
+**When to use**: Major version updates, accuracy verification
---
-## Requirements
+## Installation
-**Planning Commands**:
-- Project description (discussed with Claude)
-- Git repository initialized (recommended)
-- For `/plan-feature`: Existing SESSION.md and IMPLEMENTATION_PHASES.md
+For orphan commands, copy to your `.claude/commands/` directory:
-**Session Management Commands**:
-- `SESSION.md` file in project root (created by `/plan-project` or `project-session-management` skill)
-- `IMPLEMENTATION_PHASES.md` in project (optional but recommended)
-- Git repository initialized
+```bash
+cp commands/create-skill.md ~/.claude/commands/
+cp commands/review-skill.md ~/.claude/commands/
+cp commands/audit.md ~/.claude/commands/
+cp commands/deep-audit.md ~/.claude/commands/
+```
-## Integration
+## Related Skills
-These commands work together and integrate with planning/session skills:
-- **Planning**: `project-planning` skill generates IMPLEMENTATION_PHASES.md
-- **Session**: `project-session-management` skill provides SESSION.md protocol
-- **Agents**: Commands use Claude Code's built-in Task, Explore, and Plan agents
-- Manual workflow still available if preferred
+| Skill | Description | Commands Included |
+|-------|-------------|-------------------|
+| `project-workflow` | Project lifecycle management | 9 commands (explore-idea, plan-project, etc.) |
+| `docs-workflow` | Documentation lifecycle | 4 commands (docs, init, update, claude) |
+| `cloudflare-worker-base` | Cloudflare Workers setup | 1 command (deploy) |
-## Complete Workflow
+Install skills via marketplace:
-**Full workflow** (with exploration):
-```
-1. Rough idea → /explore-idea → [Creates PROJECT_BRIEF.md] → Decision
-2. If proceeding → /plan-project → [Reads brief, creates IMPLEMENTATION_PHASES.md + SESSION.md]
-3. Start Phase 1 → Work on phases
-4. Context full → /reflect → [Captures learnings] → /wrap-session → [git checkpoint]
-5. New session → /continue-session → [Loads context, continues from "Next Action"]
-6. Need feature → /plan-feature → [Adds phases to existing plan]
-7. Repeat wrap → resume cycle
-8. Ready to publish → /release → [Safety checks, sanitize, docs] → GitHub release
-```
-
-**Quick workflow** (clear requirements):
-```
-Clear requirements → /plan-project → Work → /wrap-session → /continue-session → /release
-```
-
-**Helper workflows**:
-```
-Need guidance? → /workflow → [Interactive guide to commands]
-Capture learnings? → /reflect → [Extracts operational knowledge → routes to docs]
-Release project? → /release → [Safety checks + GitHub release]
+```bash
+/plugin marketplace add https://github.com/jezweb/claude-skills
+/plugin install project-workflow@claude-skills
+/plugin install docs-workflow@claude-skills
+/plugin install cloudflare-worker-base@claude-skills
```
-**Complete Documentation**: See `docs/JEZWEB_WORKFLOW.md` for comprehensive guide with examples, decision trees, troubleshooting, and real-world workflows.
-
-## Features
-
-**`/explore-idea`**:
-- ✅ Free-flowing conversational exploration (not rigid questionnaire)
-- ✅ Heavy automated research (Explore agents, Context7 MCP, WebSearch)
-- ✅ Tech stack validation
-- ✅ Scope management and assumption challenges
-- ✅ Creates PROJECT_BRIEF.md with validated decisions
-- ✅ Recommends proceed/pause/pivot
-- ✅ Seamless handoff to /plan-project
-
-**`/plan-project`**:
-- ✅ Checks for PROJECT_BRIEF.md (from /explore-idea)
-- ✅ Invokes project-planning skill automatically
-- ✅ Creates SESSION.md from generated phases
-- ✅ Structured git commit format
-- ✅ Formatted planning summary
-- ✅ Asks permission before starting Phase 1
-
-**`/plan-feature`**:
-- ✅ Checks current phase status
-- ✅ Gathers requirements (5 questions)
-- ✅ Generates new phases via skill
-- ✅ Handles phase renumbering automatically
-- ✅ Updates all relevant docs
-- ✅ Smart integration into existing plan
-
-**`/wrap-session`**:
-- ✅ Auto-updates SESSION.md
-- ✅ Smart doc detection
-- ✅ Structured git checkpoint format
-- ✅ Comprehensive error handling
-
-**`/continue-session`**:
-- ✅ Multi-file context loading
-- ✅ Stage-aware (shows verification checklist when needed)
-- ✅ Detects uncommitted changes
-- ✅ Optional "Next Action" file opening
-
-**`/reflect`**:
-- ✅ Self-analyzes conversation for operational knowledge
-- ✅ Categorizes: workflows, patterns, tool sequences, corrections, discoveries
-- ✅ Identifies automation opportunities (recurring processes)
-- ✅ Smart routing to appropriate destinations
-- ✅ Routes to: CLAUDE.md (global/project), skills, docs/learnings.md, SESSION.md
-- ✅ Suggests scripts/commands for repeatable processes
-- ✅ Shows proposed changes before applying
-- ✅ Matches existing file styles when inserting
-- ✅ Prevents duplicate knowledge entries
-
-**`/workflow`**:
-- ✅ Interactive guidance based on user context
-- ✅ Shows decision trees (which command to use)
-- ✅ Offers to execute appropriate command
-- ✅ Quick reference card
-- ✅ Points to comprehensive documentation
-
-**`/release`**:
-- ✅ Comprehensive secrets scanning (gitleaks integration)
-- ✅ Personal artifacts detection and cleanup
-- ✅ Remote URL verification (prevent wrong repo push)
-- ✅ LICENSE file validation (creates if missing)
-- ✅ README completeness checks
-- ✅ .gitignore validation
-- ✅ package.json completeness
-- ✅ Build testing
-- ✅ Dependency vulnerability scanning
-- ✅ Large file warnings
-- ✅ Release readiness report
-- ✅ Auto-fix capabilities
-- ✅ GitHub release creation (optional)
-
-**`/deploy`**:
-- ✅ Cloudflare Workers project detection
-- ✅ Pre-flight build and TypeScript checks
-- ✅ Automatic conventional commit message generation
-- ✅ Git stage, commit, and push
-- ✅ Wrangler deploy execution
-- ✅ Worker URL extraction and reporting
-- ✅ Comprehensive error handling
-
-## Total Time Savings
-
-**45-75 minutes per project lifecycle**:
-- Exploration: 10-15 minutes (explore-idea)
-- Planning: 5-7 minutes (plan-project)
-- Feature additions: 7-10 minutes each (plan-feature)
-- Session cycles: 3-5 minutes each (wrap + resume)
-- Knowledge capture: 5-15 minutes per session (reflect)
-- Deployments: 2-3 minutes each (deploy)
-- Release safety: 10-15 minutes (release)
-- Workflow navigation: Instant (workflow)
-
---
-**Version**: 5.1.0
-**Last Updated**: 2025-12-12
+**Version**: 6.0.0
+**Last Updated**: 2026-01-11
**Author**: Jeremy Dawes | Jezweb
diff --git a/skills/cloudflare-worker-base/SKILL.md b/skills/cloudflare-worker-base/SKILL.md
index 0a5b0e50..cdbe6d8b 100644
--- a/skills/cloudflare-worker-base/SKILL.md
+++ b/skills/cloudflare-worker-base/SKILL.md
@@ -225,6 +225,28 @@ const { valid, userId } = await env.AUTH.verifyToken(authHeader)
- **Self-bindings**: In `wrangler dev`, shows as `[connected]` for same-Worker calls
+## Commands
+
+### `/deploy` - One-Command Deploy Pipeline
+
+**Use when**: Ready to commit, push, and deploy your Cloudflare Worker in one step.
+
+**Does**:
+1. **Pre-flight**: Verifies wrangler config, checks for changes, builds, runs TypeScript check
+2. **Commit & Push**: Stages changes, generates conventional commit message, pushes to remote
+3. **Deploy**: Runs `wrangler deploy`, captures Worker URL
+4. **Report**: Shows commit hash, branch, deployed URL, any warnings
+
+**Time savings**: 2-3 min per deploy cycle
+
+**Edge Cases Handled**:
+- No changes to commit → skips to deploy
+- Build script missing → warns and continues
+- No remote configured → reports error with suggestion
+- TypeScript errors → stops and reports
+
+---
+
## Bundled Resources
**Templates**: Complete setup files in `templates/` directory (wrangler.jsonc, vite.config.ts, package.json, tsconfig.json, src/index.ts, public/index.html, styles.css, script.js)
diff --git a/commands/deploy.md b/skills/cloudflare-worker-base/commands/deploy.md
similarity index 100%
rename from commands/deploy.md
rename to skills/cloudflare-worker-base/commands/deploy.md
diff --git a/skills/docs-workflow/README.md b/skills/docs-workflow/README.md
new file mode 100644
index 00000000..e7339fc1
--- /dev/null
+++ b/skills/docs-workflow/README.md
@@ -0,0 +1,40 @@
+# docs-workflow
+
+Documentation lifecycle management for Claude Code projects.
+
+## Auto-Trigger Keywords
+
+- "create CLAUDE.md"
+- "initialize documentation"
+- "docs init"
+- "update documentation"
+- "audit docs"
+- "CLAUDE.md maintenance"
+- "check documentation"
+- "create README"
+- "docs workflow"
+
+## Commands
+
+| Command | Description |
+|---------|-------------|
+| `/docs` | Main entry - shows available options |
+| `/docs/init` | Create CLAUDE.md + README.md + docs/ structure |
+| `/docs/update` | Audit and maintain all documentation |
+| `/docs/claude` | Smart CLAUDE.md maintenance |
+
+## What It Does
+
+- Creates CLAUDE.md from project-type templates (Cloudflare, Next.js, generic)
+- Creates README.md with standard structure
+- Scaffolds docs/ directory (optional)
+- Audits docs for staleness, broken links, outdated versions
+- Maintains CLAUDE.md to match actual project state
+
+## When to Use
+
+- Starting a new project
+- Onboarding to an existing project without CLAUDE.md
+- Before releases (audit documentation)
+- Monthly maintenance
+- After major code changes
diff --git a/skills/docs-workflow/SKILL.md b/skills/docs-workflow/SKILL.md
new file mode 100644
index 00000000..9836bdb2
--- /dev/null
+++ b/skills/docs-workflow/SKILL.md
@@ -0,0 +1,202 @@
+---
+name: docs-workflow
+description: |
+ Documentation lifecycle management for Claude Code projects. Create, maintain, and audit CLAUDE.md, README.md, and docs/ structure with smart templates.
+
+ Use when: starting new projects, maintaining documentation, auditing docs for staleness, or ensuring CLAUDE.md matches project state.
+user-invocable: true
+---
+
+# docs-workflow
+
+**Last Updated**: 2026-01-11
+**Purpose**: Manage project documentation throughout its lifecycle
+
+---
+
+## Overview
+
+This skill helps you:
+- **Initialize** documentation for new projects (CLAUDE.md, README.md, docs/)
+- **Maintain** CLAUDE.md to match actual project state
+- **Audit** all docs for staleness, broken links, outdated versions
+
+## Commands
+
+| Command | Purpose |
+|---------|---------|
+| `/docs` | Main entry - shows available subcommands |
+| `/docs/init` | Create CLAUDE.md + README.md + docs/ structure |
+| `/docs/update` | Audit and maintain all documentation |
+| `/docs/claude` | Smart CLAUDE.md maintenance only |
+
+## Quick Start
+
+### New Project
+
+```bash
+# In a new project directory
+/docs/init
+```
+
+This will:
+1. Detect project type (Cloudflare Workers, Next.js, generic)
+2. Create CLAUDE.md from appropriate template
+3. Create README.md if missing
+4. Optionally scaffold docs/ directory
+
+### Existing Project
+
+```bash
+# Audit all documentation
+/docs/update
+
+# Or just maintain CLAUDE.md
+/docs/claude
+```
+
+---
+
+## What Gets Created
+
+### CLAUDE.md
+
+Project-specific context for Claude Code, including:
+- Project overview and tech stack
+- Development setup commands
+- Architecture overview
+- Key file locations
+- Common tasks and workflows
+
+**Templates available:**
+- `CLAUDE-cloudflare.md` - Cloudflare Workers + Vite + D1 projects
+- `CLAUDE-nextjs.md` - Next.js App Router projects
+- `CLAUDE-generic.md` - Any other project type
+
+### README.md
+
+Standard README with:
+- Project name and description
+- Installation/setup instructions
+- Usage examples
+- Configuration
+- Contributing guidelines
+
+### docs/ Directory (Optional)
+
+Scaffolded documentation structure:
+- `docs/ARCHITECTURE.md` - System architecture
+- `docs/API.md` - API documentation
+- `docs/DATABASE.md` - Database schema
+
+---
+
+## Smart Maintenance
+
+### /docs/claude Features
+
+The CLAUDE.md maintenance command checks:
+
+1. **Tech Stack Match**
+ - Does CLAUDE.md list technologies that match package.json?
+ - Are versions mentioned still accurate?
+
+2. **Referenced Files**
+ - Do paths mentioned in CLAUDE.md still exist?
+ - Are there new important files not mentioned?
+
+3. **Section Freshness**
+ - Is "Last Updated" date recent?
+ - Are there outdated patterns or commands?
+
+4. **Critical Rules**
+ - For detected tech stack, are important rules present?
+ - E.g., Cloudflare project should mention wrangler.jsonc patterns
+
+### /docs/update Features
+
+Full documentation audit including:
+
+1. **Date Freshness**
+ - Compare doc dates against git history
+ - Flag docs not updated in >30 days
+
+2. **Version References**
+ - Check npm package versions mentioned
+ - Suggest updates for outdated versions
+
+3. **Broken Links**
+ - Verify internal markdown links
+ - Check that referenced files exist
+
+4. **Redundancy**
+ - Identify duplicate content across files
+ - Suggest consolidation
+
+5. **Orphaned Files**
+ - Find docs not referenced anywhere
+ - Suggest archiving or deletion
+
+---
+
+## Project Type Detection
+
+The skill auto-detects project type by looking for:
+
+| Indicator | Project Type |
+|-----------|-------------|
+| `wrangler.jsonc` or `wrangler.toml` | Cloudflare Workers |
+| `next.config.js` or `next.config.ts` | Next.js |
+| Neither | Generic |
+
+Additional indicators influence template content:
+- `package.json` dependencies (React, Vite, etc.)
+- Database config files (drizzle.config.ts, prisma/schema.prisma)
+- Auth config (clerk, better-auth)
+
+---
+
+## Integration with Other Skills
+
+- **project-workflow**: Use `/docs/init` after `/plan-project` to add documentation
+- **project-planning**: Generated `IMPLEMENTATION_PHASES.md` referenced in CLAUDE.md
+- **cloudflare-worker-base**: Cloudflare template includes Workers-specific patterns
+
+---
+
+## Best Practices
+
+### When to Run Each Command
+
+| Situation | Command |
+|-----------|---------|
+| New project | `/docs/init` |
+| After major changes | `/docs/claude` |
+| Before release | `/docs/update` |
+| Monthly maintenance | `/docs/update` |
+
+### CLAUDE.md Guidelines
+
+1. **Keep it current** - Update "Last Updated" when making changes
+2. **Focus on project-specific** - Don't duplicate generic tech docs
+3. **Include common tasks** - Commands you run frequently
+4. **Reference, don't duplicate** - Link to docs/ for detailed content
+
+---
+
+## Templates
+
+Templates are located in `templates/` within this skill:
+
+```
+templates/
+├── CLAUDE-cloudflare.md # Cloudflare Workers projects
+├── CLAUDE-nextjs.md # Next.js projects
+├── CLAUDE-generic.md # Generic projects
+└── README-template.md # Standard README
+```
+
+Templates use placeholders:
+- `{{PROJECT_NAME}}` - Detected from package.json or folder name
+- `{{DATE}}` - Current date
+- `{{TECH_STACK}}` - Detected technologies
diff --git a/skills/docs-workflow/commands/claude.md b/skills/docs-workflow/commands/claude.md
new file mode 100644
index 00000000..5bdadf29
--- /dev/null
+++ b/skills/docs-workflow/commands/claude.md
@@ -0,0 +1,235 @@
+# Smart CLAUDE.md Maintenance
+
+Focused maintenance for CLAUDE.md files. Ensures project context stays in sync with actual codebase state.
+
+## Command Usage
+
+`/docs/claude [options]`
+
+**Options:**
+- (no options) - Full maintenance check
+- `--quick` - Just check date and basic structure
+- `--sync` - Auto-fix sync issues without prompting
+
+## Process
+
+### 1. Read Current CLAUDE.md
+
+Parse the existing CLAUDE.md to understand:
+- Last Updated date
+- Tech stack mentioned
+- File paths referenced
+- Scripts/commands documented
+- Environment variables listed
+
+### 2. Scan Project State
+
+Gather actual project information:
+
+```javascript
+// From package.json
+const dependencies = { ...pkg.dependencies, ...pkg.devDependencies }
+const scripts = pkg.scripts
+
+// From wrangler.jsonc (if exists)
+const bindings = parseWranglerConfig()
+
+// From .env.example or .env (if exists)
+const envVars = parseEnvFile()
+
+// From file system
+const keyFiles = findKeyFiles() // src/index.ts, src/server/*, etc.
+```
+
+### 3. Compare & Identify Gaps
+
+**Tech Stack Sync:**
+```markdown
+## Tech Stack Analysis
+
+| Technology | In CLAUDE.md | In package.json | Status |
+|------------|--------------|-----------------|--------|
+| React | ✅ Yes | ✅ Yes | ✅ OK |
+| Drizzle ORM | ❌ No | ✅ Yes | ⚠️ Missing |
+| Tailwind | ✅ Yes | ✅ Yes | ✅ OK |
+| Hono | ❌ No | ✅ Yes | ⚠️ Missing |
+
+**Suggestion**: Add Drizzle ORM and Hono sections to CLAUDE.md
+```
+
+**File Path Validation:**
+```markdown
+## File Paths in CLAUDE.md
+
+| Referenced Path | Exists | Status |
+|-----------------|--------|--------|
+| `src/server/index.ts` | ✅ Yes | ✅ OK |
+| `src/lib/auth.ts` | ❌ No | ⚠️ Broken |
+| `src/config.ts` | ✅ Yes | ✅ OK |
+
+**Broken path**: `src/lib/auth.ts`
+- Did you mean: `src/auth/index.ts`?
+```
+
+**Script References:**
+```markdown
+## Scripts in CLAUDE.md
+
+| Script Mentioned | In package.json | Status |
+|------------------|-----------------|--------|
+| `pnpm dev` | ✅ Yes | ✅ OK |
+| `pnpm migrate` | ❌ No | ⚠️ Doesn't exist |
+| `pnpm build` | ✅ Yes | ✅ OK |
+
+**Note**: `pnpm migrate` is mentioned but doesn't exist in package.json
+```
+
+**Environment Variables:**
+```markdown
+## Environment Variables
+
+| Var in CLAUDE.md | In .env.example | Status |
+|------------------|-----------------|--------|
+| `DATABASE_URL` | ✅ Yes | ✅ OK |
+| `AUTH_SECRET` | ❌ No | ⚠️ Missing from .env.example |
+| `OLD_API_KEY` | ✅ Yes | ⚠️ Not used in code |
+```
+
+### 4. Check Critical Rules
+
+Based on detected tech stack, check if CLAUDE.md includes important patterns:
+
+**For Cloudflare Workers:**
+- Wrangler commands mentioned?
+- D1 migration workflow?
+- Workers-specific limitations noted?
+
+**For React/Vite:**
+- Dev server commands?
+- Build/preview workflow?
+- Environment variable patterns (VITE_ prefix)?
+
+**For Database (Drizzle/Prisma):**
+- Migration commands?
+- Schema location?
+- Common query patterns?
+
+### 5. Suggest Updates
+
+Present findings and offer to fix:
+
+```markdown
+## CLAUDE.md Maintenance Report
+
+### Date Check
+- Last Updated: 2025-10-15 (87 days ago)
+- Last git change: 2025-12-01
+- **Action**: Update date to today
+
+### Tech Stack Gaps
+Missing sections for detected technologies:
+1. **Drizzle ORM** - Database queries, migrations, schema
+2. **Hono** - API routing, middleware patterns
+
+### Broken References
+1. `src/lib/auth.ts` → Should be `src/auth/index.ts`
+2. `pnpm migrate` → Script doesn't exist (maybe `pnpm db:push`?)
+
+### Missing Critical Patterns
+For a Cloudflare Workers project, consider adding:
+- D1 binding usage
+- R2 storage patterns (if using R2)
+- Deployment checklist
+
+---
+
+**Proposed Changes:**
+1. [ ] Update "Last Updated" date
+2. [ ] Fix broken path: lib/auth.ts → auth/index.ts
+3. [ ] Add Drizzle ORM section
+4. [ ] Add Hono routing section
+
+Apply changes? [Y/n/select]
+```
+
+### 6. Apply Updates
+
+For approved changes:
+
+**Date Update:**
+- Find "Last Updated" pattern
+- Replace with current date
+
+**Path Fixes:**
+- Find-and-replace broken paths
+- Update to correct paths
+
+**Add Missing Sections:**
+- Generate section content based on detected tech
+- Insert at appropriate location (after existing tech sections)
+- Use templates from skill's templates/ directory
+
+### 7. Output Summary
+
+```markdown
+## CLAUDE.md Updated
+
+**Changes Made:**
+- Updated "Last Updated" to 2026-01-11
+- Fixed path: src/lib/auth.ts → src/auth/index.ts
+- Added Drizzle ORM section (15 lines)
+- Added Hono routing section (12 lines)
+
+**Manual Review Suggested:**
+- Drizzle section: Verify table names and query patterns
+- Hono section: Add project-specific middleware
+
+**Commit suggestion:**
+```bash
+git add CLAUDE.md
+git commit -m "docs: Update CLAUDE.md with current project state"
+```
+```
+
+## Section Templates
+
+When adding missing tech sections, use these templates:
+
+**Drizzle ORM:**
+```markdown
+## Database (Drizzle ORM)
+
+**Schema**: `src/db/schema.ts`
+**Migrations**: `drizzle/`
+
+**Common Commands:**
+- Generate migration: `pnpm drizzle-kit generate`
+- Push to DB: `pnpm drizzle-kit push`
+- Studio: `pnpm drizzle-kit studio`
+
+**Query Patterns:**
+[To be filled based on project usage]
+```
+
+**Hono:**
+```markdown
+## API (Hono)
+
+**Entry**: `src/server/index.ts`
+**Routes**: `src/server/routes/`
+
+**Route Pattern:**
+```typescript
+app.get('/api/resource', async (c) => {
+ // Handler
+})
+```
+```
+
+## Important Notes
+
+- Only modifies CLAUDE.md, not other documentation
+- Always shows diff before applying changes
+- Preserves existing content structure
+- Sections are added, not replaced (unless explicitly broken)
+- User can select which changes to apply
diff --git a/skills/docs-workflow/commands/docs.md b/skills/docs-workflow/commands/docs.md
new file mode 100644
index 00000000..522de3fb
--- /dev/null
+++ b/skills/docs-workflow/commands/docs.md
@@ -0,0 +1,76 @@
+# Documentation Workflow
+
+Main entry point for documentation management. Shows available subcommands and quick actions.
+
+## Command Usage
+
+`/docs [action]`
+
+**Actions:**
+- (no action) - Show available commands and project status
+- `init` - Create documentation for new project
+- `update` - Audit and maintain all documentation
+- `claude` - Smart CLAUDE.md maintenance
+
+## Process
+
+### 1. Check Current Project
+
+Quickly assess documentation status:
+
+```
+Look for:
+- CLAUDE.md exists? Y/N
+- README.md exists? Y/N
+- docs/ directory? Y/N
+- SESSION.md? Y/N
+```
+
+### 2. Present Options
+
+Based on what exists, show relevant options:
+
+```markdown
+## Documentation Status
+
+| File | Status |
+|------|--------|
+| CLAUDE.md | ✅ Exists (Last updated: 2025-12-01) |
+| README.md | ✅ Exists |
+| docs/ | ❌ Missing |
+| SESSION.md | ✅ Exists |
+
+## Available Commands
+
+1. `/docs/init` - Create missing documentation (will scaffold docs/)
+2. `/docs/update` - Audit all docs for staleness and issues
+3. `/docs/claude` - Check and update CLAUDE.md
+
+What would you like to do?
+```
+
+### 3. Handle Inline Action
+
+If an action was provided (e.g., `/docs update`), redirect to that command.
+
+## Quick Actions
+
+If user just wants a quick status without running full commands:
+
+```markdown
+## Quick Status
+
+**CLAUDE.md**: 847 lines, last git change 3 days ago
+**README.md**: 124 lines, matches package.json name
+**docs/**: 4 files (ARCHITECTURE.md, API.md, DATABASE.md, TESTING.md)
+
+No obvious issues detected. Run `/docs/update` for full audit.
+```
+
+## Integration
+
+This command is the entry point. For detailed work, use the specific subcommands:
+
+- `/docs/init` - Full initialization workflow
+- `/docs/update` - Full audit workflow
+- `/docs/claude` - CLAUDE.md-specific maintenance
diff --git a/skills/docs-workflow/commands/init.md b/skills/docs-workflow/commands/init.md
new file mode 100644
index 00000000..b195ff41
--- /dev/null
+++ b/skills/docs-workflow/commands/init.md
@@ -0,0 +1,162 @@
+# Initialize Documentation
+
+Create documentation structure for a new project. Detects project type and uses appropriate templates.
+
+## Command Usage
+
+`/docs/init [options]`
+
+**Options:**
+- `--type=cloudflare|nextjs|generic` - Force project type (auto-detects if not specified)
+- `--full` - Include docs/ directory scaffolding
+- `--minimal` - Only create CLAUDE.md
+
+## Process
+
+### 1. Detect Project Type
+
+Look for indicator files in this order:
+
+```
+Priority 1: wrangler.jsonc or wrangler.toml → Cloudflare Workers
+Priority 2: next.config.js or next.config.ts → Next.js
+Priority 3: package.json exists → Generic Node.js
+Priority 4: None of the above → Generic
+```
+
+Also scan package.json dependencies for additional context:
+- React, Vue, Svelte → Frontend framework
+- Hono, Express, Fastify → API framework
+- Drizzle, Prisma → Database ORM
+- Clerk, better-auth → Authentication
+
+### 2. Gather Project Info
+
+Extract from existing files:
+
+```javascript
+// From package.json
+const projectName = pkg.name || folderName
+const description = pkg.description || ''
+const techStack = Object.keys(pkg.dependencies || {})
+
+// From git
+const repoUrl = getGitRemoteUrl() // if available
+```
+
+### 3. Check Existing Files
+
+Before creating, check what exists:
+
+```markdown
+## Existing Documentation
+
+| File | Status | Action |
+|------|--------|--------|
+| CLAUDE.md | Missing | Will create |
+| README.md | Exists (124 lines) | Skip (use --force to overwrite) |
+| docs/ | Missing | Will create (with --full) |
+
+Proceed? [Y/n]
+```
+
+### 4. Create CLAUDE.md
+
+Use the appropriate template based on detected project type:
+
+**For Cloudflare Workers:**
+```bash
+# Copy from skill templates
+# Fill in: {{PROJECT_NAME}}, {{DATE}}, {{TECH_STACK}}
+```
+
+Template includes:
+- Wrangler commands
+- D1/KV/R2 bindings (if detected in wrangler.jsonc)
+- Cloudflare-specific patterns
+- Deployment workflow
+
+**For Next.js:**
+- App Router vs Pages Router patterns
+- Server Components guidance
+- Deployment (Vercel) workflow
+- API route patterns
+
+**For Generic:**
+- Basic project structure
+- Development commands
+- Key file locations
+
+### 5. Create README.md (if missing)
+
+Use README template with:
+- Project name and description from package.json
+- Standard sections (Installation, Usage, Development, License)
+- Placeholder content for user to fill in
+
+### 6. Scaffold docs/ (if --full)
+
+Create documentation directory:
+
+```bash
+mkdir -p docs
+```
+
+Create starter files:
+- `docs/ARCHITECTURE.md` - System overview placeholder
+- `docs/API.md` - API documentation placeholder
+- `docs/DATABASE.md` - Database schema placeholder (if ORM detected)
+
+Each file has basic structure and TODOs for user to complete.
+
+### 7. Output Summary
+
+```markdown
+## Documentation Initialized
+
+**Project Type**: Cloudflare Workers
+**Files Created**:
+- [x] CLAUDE.md (from cloudflare template)
+- [x] README.md (from standard template)
+- [x] docs/ARCHITECTURE.md
+- [x] docs/API.md
+- [x] docs/DATABASE.md
+
+**Next Steps**:
+1. Review CLAUDE.md and customize for your project
+2. Update README.md with accurate installation instructions
+3. Fill in docs/ files as you build features
+
+**Commit suggestion**:
+```bash
+git add CLAUDE.md README.md docs/
+git commit -m "docs: Initialize project documentation"
+```
+```
+
+## Template Placeholders
+
+Templates use these placeholders (auto-filled):
+
+| Placeholder | Source |
+|-------------|--------|
+| `{{PROJECT_NAME}}` | package.json name or folder name |
+| `{{DATE}}` | Current date (YYYY-MM-DD) |
+| `{{TECH_STACK}}` | Detected technologies |
+| `{{DESCRIPTION}}` | package.json description |
+| `{{REPO_URL}}` | Git remote URL (if available) |
+
+## Edge Cases
+
+**CLAUDE.md already exists:**
+- Skip creation unless `--force` specified
+- Suggest running `/docs/claude` instead for maintenance
+
+**No package.json:**
+- Use folder name for project name
+- Use generic template
+- Warn user to update tech stack section manually
+
+**Monorepo detected:**
+- Ask which package to document
+- Create docs at appropriate level (root vs package)
diff --git a/commands/update-docs.md b/skills/docs-workflow/commands/update.md
similarity index 88%
rename from commands/update-docs.md
rename to skills/docs-workflow/commands/update.md
index 77fef725..f59c523c 100644
--- a/commands/update-docs.md
+++ b/skills/docs-workflow/commands/update.md
@@ -1,10 +1,10 @@
# Update Documentation
-Audit and maintain documentation files in the current project. This command checks for stale content, outdated references, redundancy, and suggests improvements.
+Audit and maintain documentation files in the current project. Checks for stale content, outdated references, redundancy, and suggests improvements.
## Command Usage
-`/update-docs [scope]`
+`/docs/update [scope]`
**Scope options:**
- `all` (default) - Full audit of all documentation
@@ -87,7 +87,17 @@ Healthy patterns (don't flag these):
- Files in docs/ not referenced anywhere
- Archive files that may be safe to delete
-### 4. Generate Report
+### 4. Check CLAUDE.md Against Project State
+
+**Enhanced from original update-docs:**
+
+Additional checks specific to CLAUDE.md:
+- Does tech stack section match package.json dependencies?
+- Are referenced file paths still valid?
+- Are environment variables listed that don't exist in .env.example?
+- Are scripts mentioned that don't exist in package.json?
+
+### 5. Generate Report
Present findings organized by severity:
@@ -107,9 +117,13 @@ Present findings organized by severity:
### Suggestions
- [ ] planning/research-log.md: Contains 3 TODO items
- [ ] docs/DATABASE.md and docs/SCHEMA.md have 60% overlap
+
+### CLAUDE.md Sync Issues
+- [ ] package.json has `drizzle-orm` but CLAUDE.md doesn't mention it
+- [ ] CLAUDE.md references `src/lib/auth.ts` but file is at `src/auth/index.ts`
```
-### 5. Interactive Fixes
+### 6. Interactive Fixes
For each category, offer to fix:
@@ -128,7 +142,7 @@ For each category, offer to fix:
- Remove archive/ files permanently
- Major restructuring
-### 6. Archive Workflow
+### 7. Archive Workflow
When archiving content:
@@ -221,4 +235,3 @@ After completing audit:
- Version checks require network access (npm view)
- Git history is used for date comparisons (requires git repo)
- Large projects may take time to audit fully
-
diff --git a/skills/docs-workflow/rules/claude-md-patterns.md b/skills/docs-workflow/rules/claude-md-patterns.md
new file mode 100644
index 00000000..f046b01f
--- /dev/null
+++ b/skills/docs-workflow/rules/claude-md-patterns.md
@@ -0,0 +1,72 @@
+# CLAUDE.md Documentation Patterns
+
+Common mistakes and best practices for CLAUDE.md files.
+
+## Corrections
+
+| If Claude suggests... | Use instead... |
+|----------------------|----------------|
+| Copying full framework docs into CLAUDE.md | Link to official docs, only include project-specific patterns |
+| Generic tech tutorials | Project-specific workflows and commands |
+| Outdated "Last Updated" date | Current date when making changes |
+| Hardcoded paths that may change | Use relative paths or explain file discovery patterns |
+
+## Structure Best Practices
+
+### Required Sections
+
+Every CLAUDE.md should have:
+
+1. **Project Overview** - What it is, tech stack
+2. **Quick Start** - Essential commands to get running
+3. **Project Structure** - Key directories and their purposes
+4. **Common Tasks** - Frequent operations with commands
+
+### Optional but Recommended
+
+- **Environment Variables** - Required vars and where to set them
+- **Key Files** - Important files and their purposes
+- **Troubleshooting** - Common issues and solutions
+
+## Anti-Patterns
+
+### Don't Include
+
+- Full API references (link to docs instead)
+- Generic programming tutorials
+- Information that changes frequently without automated updates
+- Secrets or credentials
+- User-specific configuration
+
+### Keep Focused
+
+CLAUDE.md is for project-specific context:
+- ✅ "Run `pnpm db:push` to sync schema"
+- ❌ "Drizzle ORM is a TypeScript ORM that..."
+
+## Maintenance
+
+### Update Triggers
+
+Update CLAUDE.md when:
+- Adding new major dependencies
+- Changing project structure
+- Adding new workflows/commands
+- Fixing common developer issues
+
+### Don't Update For
+
+- Minor dependency patches
+- Small code changes
+- Bug fixes (unless pattern-breaking)
+
+## Size Guidelines
+
+| Project Size | CLAUDE.md Lines | Notes |
+|--------------|-----------------|-------|
+| Small/Simple | 100-200 | Just essentials |
+| Medium | 200-500 | Include troubleshooting |
+| Large/Complex | 500-1000 | Multiple workflows, detailed structure |
+| Enterprise | 1000+ | Consider splitting into docs/ |
+
+**Note**: Size isn't the metric - clarity and usefulness are. A well-organized 800-line CLAUDE.md is better than a cramped 200-line one.
diff --git a/skills/docs-workflow/templates/CLAUDE-cloudflare.md b/skills/docs-workflow/templates/CLAUDE-cloudflare.md
new file mode 100644
index 00000000..3258e8db
--- /dev/null
+++ b/skills/docs-workflow/templates/CLAUDE-cloudflare.md
@@ -0,0 +1,172 @@
+# {{PROJECT_NAME}}
+
+**Last Updated**: {{DATE}}
+
+---
+
+## Project Overview
+
+{{DESCRIPTION}}
+
+**Tech Stack**: Cloudflare Workers, {{TECH_STACK}}
+
+---
+
+## Quick Start
+
+```bash
+# Install dependencies
+pnpm install
+
+# Start dev server
+pnpm dev
+
+# Deploy to Cloudflare
+pnpm deploy
+```
+
+---
+
+## Development
+
+### Local Development
+
+```bash
+pnpm dev # Start Vite + Workers dev server
+```
+
+The dev server runs at `http://localhost:5173` (or next available port).
+
+### Build & Deploy
+
+```bash
+pnpm build # Build for production
+pnpm deploy # Deploy to Cloudflare Workers
+```
+
+### Database (D1)
+
+```bash
+# Generate migration from schema changes
+pnpm drizzle-kit generate
+
+# Apply migrations locally
+pnpm wrangler d1 execute {{DB_NAME}} --local --file=drizzle/XXXX_migration.sql
+
+# Apply migrations to production
+pnpm wrangler d1 execute {{DB_NAME}} --remote --file=drizzle/XXXX_migration.sql
+```
+
+**Important**: Always run migrations on BOTH local AND remote before testing.
+
+---
+
+## Project Structure
+
+```
+src/
+├── client/ # React frontend
+│ ├── components/ # UI components
+│ ├── pages/ # Page components
+│ └── main.tsx # Client entry
+├── server/ # Cloudflare Worker backend
+│ ├── routes/ # API routes
+│ ├── middleware/ # Hono middleware
+│ └── index.ts # Worker entry
+└── shared/ # Shared types and utilities
+```
+
+---
+
+## Environment Variables
+
+### Local Development (.dev.vars)
+
+```bash
+# Database is auto-created by wrangler
+# Add any API keys here
+```
+
+### Production (Cloudflare Secrets)
+
+```bash
+# Set secrets with wrangler
+echo "value" | pnpm wrangler secret put SECRET_NAME
+pnpm deploy # Redeploy to activate secrets
+```
+
+---
+
+## Key Files
+
+| File | Purpose |
+|------|---------|
+| `wrangler.jsonc` | Cloudflare Workers configuration |
+| `src/server/index.ts` | Worker entry point |
+| `src/client/main.tsx` | React app entry |
+| `drizzle/schema.ts` | Database schema |
+| `drizzle.config.ts` | Drizzle Kit configuration |
+
+---
+
+## Common Tasks
+
+### Add a New API Route
+
+1. Create route file in `src/server/routes/`
+2. Register route in `src/server/index.ts`
+3. Add types to `src/shared/types.ts` if needed
+
+### Add a New Page
+
+1. Create component in `src/client/pages/`
+2. Add route in `src/client/App.tsx`
+
+### Modify Database Schema
+
+1. Edit `drizzle/schema.ts`
+2. Generate migration: `pnpm drizzle-kit generate`
+3. Apply locally: `pnpm wrangler d1 execute ...`
+4. Test, then apply to production
+
+---
+
+## Cloudflare Bindings
+
+Configured in `wrangler.jsonc`:
+
+```jsonc
+{
+ "d1_databases": [...],
+ "kv_namespaces": [...],
+ "r2_buckets": [...],
+ // Add other bindings as needed
+}
+```
+
+Access in Worker:
+
+```typescript
+export default {
+ async fetch(request: Request, env: Env) {
+ const db = env.DB; // D1 database
+ const kv = env.KV; // KV namespace
+ const bucket = env.R2; // R2 bucket
+ }
+}
+```
+
+---
+
+## Troubleshooting
+
+### "Table not found" errors
+Run migrations on remote: `pnpm wrangler d1 execute {{DB_NAME}} --remote --file=...`
+
+### Changes not appearing after deploy
+1. Rebuild: `pnpm build`
+2. Redeploy: `pnpm deploy`
+3. Hard refresh browser: Ctrl+Shift+R
+
+### Secrets not working
+Secrets require redeploy to take effect: `pnpm deploy`
diff --git a/skills/docs-workflow/templates/CLAUDE-generic.md b/skills/docs-workflow/templates/CLAUDE-generic.md
new file mode 100644
index 00000000..c05e8b13
--- /dev/null
+++ b/skills/docs-workflow/templates/CLAUDE-generic.md
@@ -0,0 +1,140 @@
+# {{PROJECT_NAME}}
+
+**Last Updated**: {{DATE}}
+
+---
+
+## Project Overview
+
+{{DESCRIPTION}}
+
+**Tech Stack**: {{TECH_STACK}}
+
+---
+
+## Quick Start
+
+```bash
+# Install dependencies
+pnpm install
+
+# Start development
+pnpm dev
+
+# Build for production
+pnpm build
+```
+
+---
+
+## Development
+
+### Local Development
+
+```bash
+pnpm dev # Start dev server
+```
+
+### Build & Test
+
+```bash
+pnpm build # Build for production
+pnpm test # Run tests
+pnpm lint # Run linter
+```
+
+---
+
+## Project Structure
+
+```
+src/
+├── index.ts # Entry point
+├── lib/ # Core libraries
+├── utils/ # Utility functions
+└── types/ # TypeScript types
+
+tests/ # Test files
+docs/ # Documentation
+```
+
+---
+
+## Environment Variables
+
+### Local Development (.env or .env.local)
+
+```bash
+# Add environment variables here
+NODE_ENV=development
+```
+
+### Production
+
+Set via your deployment platform's environment variable configuration.
+
+---
+
+## Key Files
+
+| File | Purpose |
+|------|---------|
+| `src/index.ts` | Main entry point |
+| `package.json` | Dependencies and scripts |
+| `tsconfig.json` | TypeScript configuration |
+
+---
+
+## Common Tasks
+
+### Add a New Feature
+
+1. Create files in appropriate directory
+2. Add exports to index files
+3. Write tests
+4. Update documentation
+
+### Run Tests
+
+```bash
+pnpm test # Run all tests
+pnpm test:watch # Watch mode
+pnpm test:coverage # With coverage
+```
+
+---
+
+## Scripts
+
+| Script | Purpose |
+|--------|---------|
+| `pnpm dev` | Start development server |
+| `pnpm build` | Build for production |
+| `pnpm test` | Run tests |
+| `pnpm lint` | Run linter |
+| `pnpm format` | Format code |
+
+---
+
+## Dependencies
+
+Key dependencies used in this project:
+
+<!-- List major dependencies and their purposes -->
+
+---
+
+## Troubleshooting
+
+### Common Issues
+
+<!-- Add project-specific troubleshooting tips -->
+
+---
+
+## Contributing
+
+1. Create a feature branch
+2. Make changes
+3. Run tests and linter
+4. Submit pull request
diff --git a/skills/docs-workflow/templates/CLAUDE-nextjs.md b/skills/docs-workflow/templates/CLAUDE-nextjs.md
new file mode 100644
index 00000000..9feb919d
--- /dev/null
+++ b/skills/docs-workflow/templates/CLAUDE-nextjs.md
@@ -0,0 +1,243 @@
+# {{PROJECT_NAME}}
+
+**Last Updated**: {{DATE}}
+
+---
+
+## Project Overview
+
+{{DESCRIPTION}}
+
+**Tech Stack**: Next.js (App Router), {{TECH_STACK}}
+
+---
+
+## Quick Start
+
+```bash
+# Install dependencies
+pnpm install
+
+# Start dev server
+pnpm dev
+
+# Build for production
+pnpm build
+
+# Start production server
+pnpm start
+```
+
+---
+
+## Development
+
+### Local Development
+
+```bash
+pnpm dev # Start Next.js dev server (http://localhost:3000)
+```
+
+### Build & Deploy
+
+```bash
+pnpm build # Build for production
+pnpm start # Start production server locally
+```
+
+Deployment is typically automatic via Vercel on git push.
+
+---
+
+## Project Structure
+
+```
+app/
+├── layout.tsx # Root layout
+├── page.tsx # Home page
+├── globals.css # Global styles
+├── (routes)/ # Route groups
+│ ├── dashboard/ # Dashboard pages
+│ └── api/ # API routes
+└── components/ # Shared components
+
+lib/
+├── db.ts # Database client
+├── auth.ts # Authentication
+└── utils.ts # Utility functions
+
+public/ # Static assets
+```
+
+---
+
+## App Router Conventions
+
+### Route Files
+
+| File | Purpose |
+|------|---------|
+| `page.tsx` | Page component (required for route) |
+| `layout.tsx` | Shared layout |
+| `loading.tsx` | Loading UI |
+| `error.tsx` | Error boundary |
+| `not-found.tsx` | 404 page |
+
+### Server vs Client Components
+
+```tsx
+// Server Component (default)
+export default async function Page() {
+ const data = await fetchData(); // Can use async/await
+ return <div>{data}</div>;
+}
+
+// Client Component
+'use client';
+export default function Button() {
+ const [state, setState] = useState(); // Can use hooks
+ return <button onClick={() => {}}>{state}</button>;
+}
+```
+
+---
+
+## Environment Variables
+
+### Local Development (.env.local)
+
+```bash
+# Database
+DATABASE_URL="..."
+
+# Authentication
+AUTH_SECRET="..."
+
+# API Keys
+NEXT_PUBLIC_API_URL="..." # Exposed to client
+```
+
+### Production (Vercel)
+
+Set in Vercel Dashboard → Project → Settings → Environment Variables
+
+**Note**: Variables prefixed with `NEXT_PUBLIC_` are exposed to the browser.
+
+---
+
+## Key Files
+
+| File | Purpose |
+|------|---------|
+| `next.config.ts` | Next.js configuration |
+| `app/layout.tsx` | Root layout |
+| `app/page.tsx` | Home page |
+| `middleware.ts` | Request middleware |
+| `tailwind.config.ts` | Tailwind configuration |
+
+---
+
+## Common Tasks
+
+### Add a New Page
+
+1. Create folder in `app/` matching the route
+2. Add `page.tsx` file
+3. Optionally add `layout.tsx`, `loading.tsx`, `error.tsx`
+
+### Add an API Route
+
+1. Create `app/api/[name]/route.ts`
+2. Export route handlers:
+
+```typescript
+export async function GET(request: Request) {
+ return Response.json({ data: 'value' });
+}
+
+export async function POST(request: Request) {
+ const body = await request.json();
+ return Response.json({ received: body });
+}
+```
+
+### Add Server Action
+
+```typescript
+'use server';
+
+export async function submitForm(formData: FormData) {
+ const name = formData.get('name');
+ // Process and return result
+ return { success: true };
+}
+```
+
+---
+
+## Data Fetching
+
+### Server Component (Recommended)
+
+```typescript
+export default async function Page() {
+ // This runs on the server
+ const data = await db.query.table.findMany();
+ return <Component data={data} />;
+}
+```
+
+### Client-Side (When Needed)
+
+```typescript
+'use client';
+import useSWR from 'swr';
+
+export default function Page() {
+ const { data, error } = useSWR('/api/data', fetcher);
+ if (error) return <Error />;
+ if (!data) return <Loading />;
+ return <Component data={data} />;
+}
+```
+
+---
+
+## Authentication
+
+<!-- Customize based on auth solution (Clerk, NextAuth, etc.) -->
+
+### Protected Routes
+
+Use middleware or layout checks:
+
+```typescript
+// middleware.ts
+export function middleware(request: Request) {
+ const session = getSession(request);
+ if (!session) {
+ return NextResponse.redirect('/login');
+ }
+}
+
+export const config = {
+ matcher: ['/dashboard/:path*', '/api/protected/:path*'],
+};
+```
+
+---
+
+## Troubleshooting
+
+### Hydration Errors
+- Check for client-only code in Server Components
+- Ensure consistent rendering between server and client
+- Use `suppressHydrationWarning` for intentional differences
+
+### Build Errors
+- Check for dynamic code in static context
+- Verify all environment variables are set
+
+### 404 on API Routes
+- Ensure route file exports HTTP method handlers
+- Check route file is named `route.ts` (not `page.tsx`)
diff --git a/skills/docs-workflow/templates/README-template.md b/skills/docs-workflow/templates/README-template.md
new file mode 100644
index 00000000..b33a4162
--- /dev/null
+++ b/skills/docs-workflow/templates/README-template.md
@@ -0,0 +1,73 @@
+# {{PROJECT_NAME}}
+
+{{DESCRIPTION}}
+
+## Features
+
+- Feature 1
+- Feature 2
+- Feature 3
+
+## Installation
+
+```bash
+# Clone the repository
+git clone {{REPO_URL}}
+cd {{PROJECT_NAME}}
+
+# Install dependencies
+pnpm install
+```
+
+## Usage
+
+```bash
+# Development
+pnpm dev
+
+# Build
+pnpm build
+
+# Test
+pnpm test
+```
+
+## Configuration
+
+<!-- Document any configuration options -->
+
+## Development
+
+### Prerequisites
+
+- Node.js 20+
+- pnpm 9+
+
+### Getting Started
+
+1. Clone the repository
+2. Install dependencies: `pnpm install`
+3. Copy environment file: `cp .env.example .env`
+4. Start development: `pnpm dev`
+
+### Project Structure
+
+```
+src/
+├── index.ts # Entry point
+└── ... # Other source files
+```
+
+## Contributing
+
+Contributions are welcome! Please read the contributing guidelines first.
+
+1. Fork the repository
+2. Create your feature branch (`git checkout -b feature/amazing-feature`)
+3. Commit your changes (`git commit -m 'Add some amazing feature'`)
+4. Push to the branch (`git push origin feature/amazing-feature`)
+5. Open a Pull Request
+
+## License
+
+MIT License - see the [LICENSE](LICENSE) file for details.
diff --git a/skills/project-workflow/SKILL.md b/skills/project-workflow/SKILL.md
index ddb4364b..7dfebee2 100644
--- a/skills/project-workflow/SKILL.md
+++ b/skills/project-workflow/SKILL.md
@@ -1,15 +1,15 @@
---
name: project-workflow
description: |
- Seven integrated slash commands for complete project lifecycle: /explore-idea, /plan-project, /plan-feature, /wrap-session, /continue-session, /workflow, /release.
+ Nine integrated slash commands for complete project lifecycle: /explore-idea, /plan-project, /plan-feature, /wrap-session, /continue-session, /workflow, /release, /brief, /reflect.
- Use when starting projects, managing sessions across context windows, or preparing releases. Saves 35-55 minutes per lifecycle.
+ Use when starting projects, managing sessions across context windows, capturing learnings, or preparing releases. Saves 35-55 minutes per lifecycle.
user-invocable: true
---
# Project Workflow Skill
-7 integrated slash commands for complete project lifecycle automation: idea validation → planning → execution → session management → release.
+9 integrated slash commands for complete project lifecycle automation: idea validation → planning → execution → session management → context preservation → release.
**Time savings**: 35-55 minutes per project lifecycle
@@ -97,12 +97,38 @@ user-invocable: true
---
+### 8. `/brief` - Context Preservation Document
+
+**Use when**: Before clearing context, to preserve key decisions and requirements for future sessions.
+
+**Creates**: `docs/brief-[slug].md` with extracted information from current conversation.
+
+**Does**: Analyzes conversation → extracts what's being built, decisions made, technical details → creates organized markdown file → optionally creates GitHub issue for tracking.
+
+**Time savings**: 3-5 min
+
+---
+
+### 9. `/reflect` - Capture Operational Knowledge
+
+**Use when**: Before context compaction, after completing significant work, or when valuable learnings accumulated.
+
+**Does**: Reviews conversation → identifies workflows discovered, patterns learned, tool sequences, corrections made → routes each learning to appropriate destination (rules, CLAUDE.md, skills, docs) → optionally suggests automation (scripts, commands, custom agents).
+
+**Key Feature**: Considers whether processes should become custom agents when they require reasoning/decisions, benefit from parallel execution, or involve research/exploration.
+
+**Time savings**: 5-10 min
+
+---
+
## Workflow Examples
-**Full**: /explore-idea → /plan-project → work → /wrap-session → /continue-session → /plan-feature (if needed) → repeat → /release
+**Full**: /explore-idea → /plan-project → work → /wrap-session → /continue-session → /plan-feature (if needed) → repeat → /reflect → /release
**Quick** (clear requirements): /plan-project → work → /wrap-session → /continue-session → /release
+**Context Preservation**: /brief (before clearing context), /reflect (capture learnings)
+
**Helpers**: /workflow (guidance), /plan-feature (add feature), /release (publish)
---
@@ -147,6 +173,15 @@ Work on phases
↓
Continue wrap → resume cycle
↓
+CONTEXT PRESERVATION
+/brief (before clearing context)
+ ↓
+ Creates docs/brief-[slug].md
+ ↓
+/reflect (capture learnings)
+ ↓
+ Routes knowledge to rules, docs, CLAUDE.md
+ ↓
RELEASE PHASE
/release (when ready to publish)
↓
@@ -171,8 +206,10 @@ HELPER
| `/continue-session` | 1-2 min | Context loading, git history review, next action display |
| `/workflow` | Instant | Navigation, decision trees, command selection |
| `/release` | 10-15 min | Secret scanning, doc validation, build testing, release creation |
+| `/brief` | 3-5 min | Context extraction, decisions capture, markdown generation |
+| `/reflect` | 5-10 min | Learning extraction, knowledge routing, automation suggestions |
-**Total per project lifecycle:** 35-55 minutes
+**Total per project lifecycle:** 45-70 minutes
---
@@ -204,6 +241,12 @@ HELPER
## Version History
+**1.1.0** (2026-01-11)
+- Added `/brief` command for context preservation
+- Added `/reflect` command for capturing operational knowledge
+- `/reflect` now suggests custom agents for processes requiring reasoning
+- Total commands: 9
+
**1.0.0** (2025-11-12)
- Initial release
- 7 integrated slash commands
diff --git a/commands/brief.md b/skills/project-workflow/commands/brief.md
similarity index 100%
rename from commands/brief.md
rename to skills/project-workflow/commands/brief.md
diff --git a/commands/reflect.md b/skills/project-workflow/commands/reflect.md
similarity index 89%
rename from commands/reflect.md
rename to skills/project-workflow/commands/reflect.md
index 8256e59d..9f913be2 100644
--- a/commands/reflect.md
+++ b/skills/project-workflow/commands/reflect.md
@@ -169,6 +169,25 @@ Beyond documentation, look for processes worth **operationalizing**:
3. **npm script** (`package.json`) - For project-specific dev tasks
4. **Makefile target** - For build/deploy sequences
5. **Skill template** - If it's a reusable pattern across projects
+6. **Custom agent** (`.claude/agents/thing.md`) - For autonomous workflows requiring reasoning
+
+**When to suggest a custom agent vs script/command:**
+
+| Characteristic | Script/Command | Custom Agent |
+|----------------|----------------|--------------|
+| Sequential steps only | ✅ | Overkill |
+| Requires reasoning/decisions | Use command | ✅ |
+| Needs parallel execution | ❌ | ✅ |
+| Research/exploration task | Use command | ✅ |
+| Benefits from fresh context | ❌ | ✅ |
+| Variable inputs, same pattern | Either | ✅ |
+
+**Agent indicators** (suggest custom agent when):
+- Process requires reasoning, not just execution
+- Multiple tool calls with conditional logic
+- Would benefit from parallel agent swarm
+- Research/exploration that accumulates knowledge
+- Task would benefit from isolated context (no baggage from main conversation)
**When suggesting automation:**
```markdown
@@ -227,7 +246,8 @@ Show the user what was found in this format:
1. **[Process name]**: [What we did manually]
- Steps: ~[N] steps
- Frequency: [How often we'd do this]
- → Suggestion: Create [script/command/npm script] at [location]
+ - Reasoning required: [Yes/No]
+ → Suggestion: Create [script/command/agent] at [location]
---
@@ -240,6 +260,7 @@ Show the user what was found in this format:
- [ ] Create [scripts/thing.sh]: [Brief description]
- [ ] Add npm script "[name]": [Brief description]
- [ ] Create slash command [/name]: [Brief description]
+- [ ] Create custom agent [.claude/agents/name.md]: [Brief description]
Proceed? [Y/n/edit]
```
@@ -434,6 +455,34 @@ paths: "**/*.tsx", "**/*.jsx", "src/components/**"
**Detection method**: Scan conversation for the pattern `★ Insight` to extract these automatically.
+### Example 12: Custom Agent Opportunity
+**Discovered**: "When auditing skills, we: check official docs, compare patterns, verify versions, check for deprecations, update content. This requires reasoning about accuracy and completeness."
+
+**Routing**: Suggest creating `.claude/agents/skill-auditor.md`
+- Requires reasoning (is this pattern still accurate?)
+- Benefits from fresh context (no baggage from main conversation)
+- Multiple tool calls with conditional logic (read docs → compare → decide)
+- Could run in parallel (audit multiple skills at once)
+
+**Agent template:**
+```yaml
+---
+name: skill-auditor
+description: "Skill content auditor. MUST BE USED when auditing skills. Use PROACTIVELY for knowledge validation."
+tools: [Read, Grep, Glob, Bash, WebFetch, Write, Edit]
+model: sonnet
+---
+
+## Goal
+Validate skill content against official documentation.
+
+## Process
+1. Read skill's SKILL.md
+2. Fetch official documentation
+3. Compare patterns and versions
+4. Report gaps and inaccuracies
+```
+
## Important Guidelines
- **Extract from ACTUAL conversation** - don't invent learnings