agentsclimarketplace

Claude md

Skill Data-Wise/craft/skills/docs/claude-md

This skill should be used when the user asks to "create CLAUDE.md", "scaffold CLAUDE.md", "sync CLAUDE.md", "update CLAUDE.md", "audit CLAUDE.md", "fix CLAUDE.md", "optimize CLAUDE.md", "edit CLAUDE.md sections", or otherwise wants to manage the CLAUDE.md lifecycle (init, sync, edit). Covers project-local and global (`~/.claude/CLAUDE.md`) files. For applying suggestions from the /insights report specifically, use the `insights-apply` skill instead.From its SKILL.md

Install
npx -y skills add Data-Wise/craft --skill claude-md

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

6.6 KB, as published. Nobody here has run it

CLAUDE.md Lifecycle

End-to-end management of CLAUDE.md files: scaffold from project-type templates, sync with project state (audit + fix + optimize), and edit sections interactively. Targets both project-local CLAUDE.md and global ~/.claude/CLAUDE.md.

When to Use

  • User asks to create a CLAUDE.md from scratch (new project, missing file)
  • User asks to sync / update / audit / fix / optimize an existing CLAUDE.md
  • User asks to edit a specific section with preview and validation
  • File is over the 150-line budget and needs trimming via pointer architecture
  • Version/count drift detected between CLAUDE.md and project sources (plugin.json, DESCRIPTION, etc.)

When NOT to Use

SituationUse Instead
Applying suggestions from /insights report to global CLAUDE.mdinsights-apply skill
Classifying which doc types a feature needsdoc-classifier skill
Generating release notes / CHANGELOGchangelog-automation skill

The boundary with insights-apply: that skill is the rule-applier for one specific source (the /insights report → global CLAUDE.md). This skill is the editor for the full lifecycle (init/sync/edit) of any CLAUDE.md. They share the underlying sync pipeline (utils/claude_md_sync.py) but enter it from different intents.

Three Phases

Phase 1: Init (scaffold)

Create a new CLAUDE.md from a project-type template (lean, < 150 lines, pointer architecture).

StepAction
1Detect project type: plugin (.claude-plugin/plugin.json), teaching (_quarto.yml + course.yml), r-package (DESCRIPTION)
2Scan metadata: version, counts (commands/skills/agents), test count, repo URL, git branch
3Populate lean template with discovered values
4Show preview with line count vs budget
5Create file after confirmation; run post-creation audit

Flags: --type, --force (overwrite), --dry-run, --global (target ~/.claude/CLAUDE.md)

Refusal: if file exists and --force not set, redirect to sync.

Phase 2: Sync (update + audit + fix + optimize)

Four-phase pipeline against an existing CLAUDE.md.

PhaseWhatTrigger
DetectProject type, version sourcealways
Update MetricsVersion, counts, tests, docs%always
Audit5 checks + anti-pattern + budgetalways
FixAuto-fix fixable issues--fix
OptimizeEnforce budget, move bloat to detail files--optimize

Anti-patterns blocked (refuse to add to CLAUDE.md):

PatternRedirect To
Release notes (### v\d+)docs/VERSION-HISTORY.md
Diffstats (Files Changed)delete
"What Shipped" / "Merged PR"docs/VERSION-HISTORY.md
"Status: Complete" / Released ✅docs/VERSION-HISTORY.md
Phase details (### Phase N)detail file

Budget resolution order: .claude-plugin/config.json → package.json claudeMd.budget → default 150. Never store in plugin.json (strict schema rejects it).

Sections: --section status|commands|testing|all (default all).

Phase 3: Edit (interactive section editing)

Open one or more sections in an external editor with TODO hints, validate after.

StepAction
1Parse sections (H2 headers + horizontal rules)
2Display section table with line ranges
3User picks section (or all)
4Insert <!-- TODO: ... --> hints (unless --no-hints)
5Open in editor (default ia, also code / sublime / cursor)
6Wait for user to say "done"
7Re-read, strip TODO comments
8Run post-edit audit (unless --no-validate)
9Show diff preview before applying

iA Writer integration (default): open via AppleScript

osascript -e 'tell application "iA Writer"
    activate
    open POSIX file "/path/to/CLAUDE.md"
end tell'

Pointer Architecture

The 150-line budget is enforced by pointing out of CLAUDE.md rather than inlining detail:

## References

-> Release history: [VERSION-HISTORY.md](docs/VERSION-HISTORY.md)
-> Architecture: [ARCHITECTURE.md](docs/ARCHITECTURE.md)
-> Contributing: [CONTRIBUTING.md](CONTRIBUTING.md)
-> Command reference: [COMMANDS.md](docs/COMMANDS.md)

Claude Code follows markdown links naturally — keep CLAUDE.md as an index, not an encyclopedia.

Global vs Project Targeting

All three phases accept --global / -g:

if "--global" in args or "-g" in args:
    target = Path.home() / ".claude" / "CLAUDE.md"
else:
    target = Path.cwd() / "CLAUDE.md"

Use global for cross-project rules (workflow, git, safety); use project-local for project-specific commands and structure.

Underlying Utilities

UtilityRole
utils/claude_md_detector.pyProject type detection
utils/claude_md_template_populator.pyLean template variable substitution
utils/claude_md_sync.py4-phase sync pipeline (also called by insights-apply)
utils/claude_md_optimizer.pyBudget enforcement + bloat detection
templates/claude-md/*.mdLean templates per project type

Decision Flow

User intent ─┐
             ├─► file missing?       → Init (Phase 1)
             ├─► drift / audit needed?→ Sync (Phase 2)
             ├─► specific section?    → Edit (Phase 3)
             └─► /insights source?    → use `insights-apply` skill

Error Recovery

ErrorRecovery
CLAUDE.md not found (sync/edit)Suggest Init
Project type unknown (init)Offer generic template or --type <name>
Over budget after edit/syncOffer --optimize or manual edit
Section not found (edit)Show available sections + fuzzy suggestion
Editor not installed (edit)List available editors, prompt to pick
Anti-pattern submittedBlock, redirect to detail file

See Also

  • insights-apply — apply /insights report suggestions to global CLAUDE.md (specific source)
  • doc-classifier — decide what doc types a feature needs (sibling in skills/docs/)
  • changelog-automation — release notes / CHANGELOG generation (sibling)
  • /craft:check — invokes sync internally as part of pre-commit validation

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.