agentleFS
pekralpekral/cursor-rules/skills/refresh-claude-md/SKILL.md

refresh-claude-md

Skill10 starsChanged 4 months agoMITView on GitHub

Use when the project's CLAUDE.md is stale or missing and must be regenerated from the current codebase — re-detect tech stack, commands, conventions, and structure, then update CLAUDE.md while preserving every human-authored customization. Adapted from the ECC codebase-onboarding skill.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep CLAUDE.md scannable and under ~100 lines.

    line 15
  2. Distinctive:

    Do not modify other skills, rules, or production code

    line 17
  3. Distinctive:

    Do not use this skill for ad-hoc codebase questions, code review, or onboarding write-ups — it has one job: keep CLAUDE.md correct.

    line 25
  4. Distinctive:

    Read the existing CLAUDE.md (if any) and record which sections are human-authored vs auto-generated.

    line 30
  5. Distinctive:

    Use Read only to disambiguate conflicting signals.

    line 47
  6. Distinctive:

    Update the auto-generated sections in place.

    line 50
  7. Distinctive:

    When creating a new file, use these sections, omitting any that do not apply: Tech Stack, Code Style, Testing, Build & Run, Project …

    line 51
  8. Distinctive:

    Run every command written into the Build & Run / Testing sections to confirm it exists and is correct.

    line 55
  9. Distinctive:

    Every pre-existing human-authored section is preserved verbatim

    line 64
  10. Distinctive:

    All documented commands have been run and confirmed to work

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Constraints

  • Apply @rules/php/core-standards.mdc
  • Apply @rules/git/general.mdc
  • Trigger only to update or create CLAUDE.md — never run this as a general onboarding or audit task
  • Reconnaissance uses Glob and Grep; use Read only to resolve an ambiguous signal, never to read every file
  • Enhance, never blindly replace: preserve all human-authored sections, custom rules, and project-specific instructions already in CLAUDE.md
  • Keep CLAUDE.md scannable and under ~100 lines; link to @rules/** instead of pasting rule content
  • Flag unknowns explicitly ("Could not determine X") rather than speculate
  • Do not modify other skills, rules, or production code

Use when

  • CLAUDE.md does not exist and the project needs one generated from the codebase
  • CLAUDE.md is stale — the tech stack, build/test commands, directory layout, or conventions have drifted from what the file documents
  • The user asks to "refresh", "regenerate", "update", or "rebuild" CLAUDE.md
  • A dependency, framework, or tooling change has invalidated the documented commands or structure

Do not use this skill for ad-hoc codebase questions, code review, or onboarding write-ups — it has one job: keep CLAUDE.md correct.

Execution

1. Decide whether a refresh is warranted

  • Read the existing CLAUDE.md (if any) and record which sections are human-authored vs auto-generated.
  • Confirm at least one trigger applies. If CLAUDE.md already matches the codebase, stop and report "no refresh needed" instead of rewriting it.

2. Reconnaissance (Glob + Grep only)

Gather signals without reading every file:

  • Manifests — composer.json, package.json, go.mod, pyproject.toml, Cargo.toml, Gemfile, etc.
  • Framework fingerprint — Laravel (artisan, bootstrap/app.php), vite.config.*, next.config.*, and similar config files
  • Entry points — public/index.php, artisan, app.*, main.*, src/ roots, routes/
  • Directory snapshot — top two levels, excluding vendor, node_modules, .git, dist, build, storage
  • Tooling — phpstan.neon, pint.json, rector.php, phpcs.xml, .github/workflows/, Dockerfile, .env.example
  • Tests — tests/, *Test.php, *.spec.ts, Pest/PHPUnit config

3. Synthesize

  • Tech stack — languages, framework versions, database, build tools, CI.
  • Commands — extract real dev/build/test/lint commands from composer.json scripts, package.json scripts, and Makefile; never invent a command.
  • Structure — map key directories to their purpose.
  • Conventions — naming, error handling, and Git workflow from recent git log (skip and note if history is shallow).
  • Use Read only to disambiguate conflicting signals; trust actual code over config when they disagree.

4. Merge into CLAUDE.md

  • Update the auto-generated sections in place; leave human-authored content untouched.
  • When creating a new file, use these sections, omitting any that do not apply: Tech Stack, Code Style, Testing, Build & Run, Project Structure, Conventions.
  • Mark each detected fact so the next refresh can tell generated content from custom edits.

5. Validate

  • Run every command written into the Build & Run / Testing sections to confirm it exists and is correct.
  • Run the project's detected build / quality command — the same one written into the Build & Run section — and fix any errors before declaring done. On a Composer/PHP project that command is typically composer build; on a Node project npm run build, on a Go project go build ./..., and so on. Never hard-assume a PHP toolchain on a project the reconnaissance fingerprinted as another stack.

Output

  • Updated (or newly created) CLAUDE.md at the project root.
  • A short summary covering: whether a refresh was needed, which sections were updated vs preserved, which commands were verified, and any facts that could not be determined.

Done when

  • CLAUDE.md reflects the current tech stack, verified commands, structure, and conventions
  • Every pre-existing human-authored section is preserved verbatim
  • All documented commands have been run and confirmed to work
  • The project's detected build / quality command finishes without errors (composer build on this Composer/PHP package)
  • The summary lists updated vs preserved sections and any unresolved unknowns

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.