Back to Documentation & Writing

docs-workflow

documentationworkflowproject setupreadmeclaudemlautomationcode qualitymaintenance
⭐ 860πŸ“„ MITπŸ•’ 2026-06-11Source β†—

Install this skill

npx skills add jezweb/claude-skills

Works across Claude Code, Cursor, Codex, Copilot & Antigravity

The docs-workflow skill automates the creation and maintenance of project documentation to keep context files synchronized with evolving codebases. It specifically manages CLAUDE.md, README.md, and local documentation directories by detecting project frameworks like Next.js or Cloudflare Workers. The system performs automated audits to ensure that internal links, file references, and dependency versions cited in text match the actual state of the repository. By running diagnostic checks against the package manifest and filesystem, it identifies stale information, orphaned files, or missing rules. This utility provides a structured way to handle project history, reducing the manual effort required to keep guidance current for AI agents and human contributors alike. It replaces guesswork with systematic template-driven documentation that grows alongside the project structure.

When to Use This Skill

  • β€’Setting up documentation standards for a newly initialized repository
  • β€’Synchronizing CLAUDE.md contents after major dependency updates
  • β€’Performing a pre-release audit to ensure all docs are accurate
  • β€’Cleaning up dead or redundant documentation files after refactoring

How to Invoke This Skill

Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:

  • β€œInitialize the project documentation
  • β€œUpdate my CLAUDE.md and audit all docs
  • β€œCheck if my documentation has broken links
  • β€œCreate standard README and CLAUDE files
  • β€œRefresh the documentation to match the current code

Pro Tips

  • πŸ’‘Integrate `/docs-update` into your CI/CD pipeline as a pre-commit hook or daily cron job to ensure documentation never drifts too far from the codebase.
  • πŸ’‘Customize the underlying templates for CLAUDE.md and README.md in your skill configuration to perfectly match your organization's specific documentation standards.
  • πŸ’‘Combine `/docs-claude` with a separate skill that reviews code for new features or dependencies, then prompts for CLAUDE.md updates based on those changes.

What this skill does

  • β€’Scaffolds CLAUDE.md and README.md based on framework detection
  • β€’Audits documentation for broken internal links and missing file references
  • β€’Updates version numbers and metadata against the current project state
  • β€’Identifies orphaned documentation files that are no longer linked
  • β€’Applies tech-stack specific templates for specialized configurations

When not to use it

  • βœ•When you need to write complex narrative-heavy technical whitepapers
  • βœ•In repositories that rely solely on external wikis or cloud-hosted CMS
  • βœ•For projects with highly custom proprietary build systems that lack standard metadata

Example workflow

  1. Run /docs-init to generate the base structure for a new project
  2. Modify the source code or install new dependencies
  3. Execute /docs-claude to refresh the context file with new stack info
  4. Run /docs-update to perform a comprehensive audit of all project docs
  5. Review the flagged files and perform final cleanup

Prerequisites

  • –A project with a package.json file
  • –A repository initialized with git

Pitfalls & limitations

  • !Overwriting manually added sections if they conflict with template structure
  • !Providing inaccurate information if package.json dependencies are not clean
  • !Excessive audit logs if documentation files are spread across hundreds of subdirectories

FAQ

How does it detect my project type?
It examines root configuration files like wrangler.jsonc, next.config.js, and package.json entries to determine the underlying framework.
Will it delete my existing documentation?
It will suggest archiving or deletion for orphaned files but generally updates rather than destroys core files unless explicitly told to manage them.
Can I use this for non-web projects?
Yes, it defaults to a generic template for any repository that does not match specific framework signatures.

How it compares

While manual documentation requires frequent human intervention to stay current, this skill uses automated git-based checks and code analysis to prevent the common drift between documentation and implementation.

Source & trust

⭐ 860 starsπŸ“„ MITπŸ•’ Updated 2026-06-11
πŸ“„ Full skill instructions β€” original source: jezweb/claude-skills
# 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

# 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

# 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


---

# 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.

How to Use This Skill Unit

Option A: Project-Specific (Recommended)

  1. Click "Download" above
  2. In your project, create the directory: .agent/skills/docs-workflow/
  3. Save the file as SKILL.md
  4. The agent will automatically discover the skill based on its description.

Option B: Global Installation (All Agents)

Save the file to these locations to make it available across all projects:

  • Claude Code: ~/.claude/skills/jezweb/claude-skills/docs-workflow/SKILL.md
  • Cursor: ~/.cursor/skills/jezweb/claude-skills/docs-workflow/SKILL.md
  • Antigravity: ~/.gemini/antigravity/skills/jezweb/claude-skills/docs-workflow/SKILL.md

πŸš€ Install with CLI:
npx skills add jezweb/claude-skills

Read the Master Guide: Mastering Agent Skills β†’

Recommended Rules

View more rules β†’

Recommended Workflows

View more workflows β†’

Recommended MCP Servers

View more MCP servers β†’

Take It Further

Maximize your productivity with these powerful resources

πŸ“‹

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
πŸ“–

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide

How to use this Skill in Claude Code & Cursor

For Claude Code (CLI)

To use this skill in Claude Code, copy the rule content into your project's custom instructions or follow our Add-Skill CLI guide. This ensures Claude follows your standards during every code generation.

For Cursor & Windsurf

For Cursor or Windsurf, individual skills are best used in the "Rules for AI" section. This specific unit helps the agent avoid documentation & writing issues, leading to cleaner, more efficient code.

Why the skill format matters: the standardized Agent Skills format lets your AI agent load detailed instructions only when they are relevant, keeping your prompt clean while improving results.

Source & attribution

This skill is categorized under Documentation & Writing and is published by JezWeb, maintained in jezweb/claude-skills.

← Browse All Agent Skills
Sponsored AI assistant. Recommendations may be paid.