From agent-skills
Updates existing CLAUDE.md files by analyzing code changes, GitHub PRs/issues, and Jira/Confluence activity since last modification, performing accuracy audit.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agent-skills:evolve-claudemdThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Update existing CLAUDE.md files by analyzing what changed in the codebase, GitHub, Jira, and Confluence since each file was last modified. Perform a full accuracy audit of existing content. Produce targeted, user-approved edits.
Update existing CLAUDE.md files by analyzing what changed in the codebase, GitHub, Jira, and Confluence since each file was last modified. Perform a full accuracy audit of existing content. Produce targeted, user-approved edits.
These rules govern every line written or kept. Apply them to both new content and existing content under audit.
# inferred.Same as bootstrap. Each CLAUDE.md uses:
<!-- Last reviewed: YYYY-MM -->
Section order (omit any that don't apply):
## Project — 2-4 sentences## Stack — language, runtime, framework, database, test runner, build tool, with versions## Commands — verified build, test, lint, run commands## Data Models — key data shapes, flows, codegen pipelines, cross-boundary contracts## Conventions — non-obvious patterns not enforced by tooling## Architecture — module boundaries or data flow, only if non-obvious## Constraints — hard rules with reasons## Anti-Patterns — Do NOT — things Claude must AVOID doing, each with evidence and a reason. Sourced from: reverted PRs, reviewer pushback, HACK/FIXME comments protecting intentional patterns, production incidents. Format: "Do NOT X — because Y (evidence: PR #N / revert hash / Jira ticket)."## Testing — only if non-standard## Related Systems — sibling repos/services, only if non-obviousFind all CLAUDE.md files in the repo:
find . -name "CLAUDE.md" -not -path "*/node_modules/*" -not -path "*/target/*" -not -path "*/.git/*" -not -path "*/dist/*" -not -path "*/build/*"
For each file, get the last commit that touched it:
git log -1 --format="%H %ai %s" -- <path>
Count commits and changed files since that commit within the file's scope:
git rev-list --count <last_commit>..HEAD -- <scope_dir>
git diff --stat <last_commit>..HEAD -- <scope_dir> | tail -1
Display a status table:
| File | Last Updated | Commits Since | Summary |
|------|-------------|---------------|---------|
| ./CLAUDE.md | 2026-01-15 | 147 | 312 files changed |
| ./lib/jdomodels/CLAUDE.md | 2026-02-20 | 43 | 89 files changed |
Extract GitHub remote URL for API calls: git remote get-url origin
IMPORTANT: Always use MCP server tools for all GitHub, Jira, and Confluence operations. Never use the gh CLI — it may not be available. Use mcp__github__* for GitHub, mcp__atlassian__* for Jira/Confluence.
Launch up to 3 agents in parallel:
For each CLAUDE.md, determine its scope (root = whole repo, module = that directory subtree).
Run git diff --stat <last_commit>..HEAD -- <scope_dir> and git log --oneline <last_commit>..HEAD -- <scope_dir>.
Categorize changes:
Use mcp__github__* tools. Parse org/repo from the remote URL.
mcp__github__list_pull_requests — last 100 merged PRs since each CLAUDE.md's last update date. Focus on:
mcp__github__list_issues — last 100 closed issues since last update (resolved architectural discussions). Last 100 open issues (planned changes, known problems).Use mcp__atlassian__* tools:
mcp__atlassian__getAccessibleAtlassianResources to get the cloudId.mcp__atlassian__searchJiraIssuesUsingJql:
project = <KEY> AND status = Done AND updated >= "<180_days_ago_date>" ORDER BY updated DESCproject = <KEY> AND type = Epic AND updated >= "<180_days_ago_date>" ORDER BY updated DESCmcp__atlassian__searchConfluenceUsingCql:
text ~ "<repo-name>" AND type = page AND lastModified >= "<last_update_date>" ORDER BY lastModified DESCBefore auditing details, score each existing CLAUDE.md against this rubric to establish a baseline:
| Criterion | Max Points | What to check |
|---|---|---|
| Commands/workflows | 20 | Are build, test, lint, deploy commands present with context? |
| Architecture clarity | 20 | Can Claude understand codebase structure, module relationships, entry points? |
| Non-obvious patterns | 15 | Are gotchas, quirks, workarounds, and "why we do it this way" captured? |
| Conciseness | 15 | No filler, no obvious info, no redundancy with code comments? |
| Currency | 15 | Do commands work? Are file references accurate? Tech stack current? |
| Actionability | 15 | Are instructions executable and copy-paste ready? Paths real? |
Grades: A (90-100), B (70-89), C (50-69), D (30-49), F (0-29)
Record the baseline score. After proposing changes in Step 7, project the new score to show improvement.
For each CLAUDE.md, read its content line by line and verify every concrete reference:
Before presenting changes to the user:
.eslintrc was added and it enforces a convention currently in CLAUDE.md, flag that line for removal.Before finalizing proposed changes, verify:
| Bad (remove) | Why it fails |
|---|---|
"The UserService class handles user operations." | Obvious from class name |
| "Always write tests for new features." | Generic advice, not project-specific |
| Verbose multi-paragraph explanation of a concept | Condense to one actionable line |
| "We fixed a bug in commit abc123 where login broke." | One-off fix, won't recur |
Every directory is a candidate for CLAUDE.md coverage — including non-code directories (e.g., docs/ with complex build systems like MkDocs/mkdocstrings). Scan all directories in the repo and verify that each one's non-obvious patterns are documented somewhere — either in its own CLAUDE.md, a parent's, or an ancestor's.
For each directory that currently lacks its own CLAUDE.md, launch Explore agents to read source files deeply (not just list them). Look for:
HACK, FIXME, WORKAROUND, XXX, DO NOT, NEVER, WARNING, CAREFUL. Each is a candidate anti-pattern guardrail — document what must NOT be changed and why.; exit 0)A directory with many of these patterns has high convention density and needs its own CLAUDE.md, even if it has few files or no separate build config.
### Rolled-up subdirectories section in the parent to name each covered child — so readers know it was intentionally covered there, not forgotten.Build a coverage map showing where every directory's patterns are (or should be) documented. Present gaps in the change analysis (Step 7) so no directory falls through the cracks.
Also check if recent commits/PRs introduced significant new directories or areas.
If sibling repos are accessible (in the same workspace directory):
If not accessible locally, check via GitHub API if possible.
For large change sets (many commits since last update): chunk findings by directory/module. Process each chunk fully (code + PRs + Jira). Present findings incrementally so the user can approve as you go. Large change sets deserve MORE scrutiny, not less — they represent the highest risk of CLAUDE.md drift.
Start with an executive summary, then present per-file reports:
## Evolution Summary
| File | Last Updated | Commits Since | Current Score | Projected Score |
|------|-------------|---------------|---------------|-----------------|
| ./CLAUDE.md | 2026-01-15 | 147 | 62/100 (C) | 85/100 (B) |
| ./lib/jdomodels/CLAUDE.md | 2026-02-20 | 43 | 78/100 (B) | 91/100 (A) |
- Files found: X
- Files needing update: X
- Stale references found: X
- New anti-patterns discovered: X
- Coverage gaps: X directories
Then for each CLAUDE.md, present a structured report:
## ./CLAUDE.md (last updated: YYYY-MM-DD, N commits since)
### Accuracy issues:
- Line 12: `DBOSearchIndex` renamed to `DBOSearchConfiguration` — update reference
- Line 34: Spring version "5.3.34" -> now "5.3.39" per pom.xml
- Line 78: Command `mvn test -pl lib/old-module` — module was renamed to `lib/new-module`
### Lines to remove:
- Line 45: "Use semicolons" — .eslintrc now enforces this (added in PR #412)
- Line 67: "Do not upgrade to React Router v6" — epic PORTALS-2847 completed
### Lines to add:
- Constraint: "Never use @Autowired on fields — constructor injection required for testability" (from PR #4521 review)
- Data Models: New search configuration schema in lib/lib-auto-generated — generates POJOs consumed by 3 modules
- Convention: Workers in search/ package use ConcurrentWorkerStack exclusively
### Anti-pattern guardrails to add:
- Do NOT: "Do NOT refactor X to Y — a previous attempt was reverted (hash) because Z" (from reverted PR)
- Do NOT: "Do NOT use bare set() for DataFrame construction — non-deterministic ordering broke tests (PR #621)" (from production incident)
- Do NOT: "Do NOT write custom column checks — use existing utility process_functions.checkColExist()" (from reviewer pushback in PR #622)
### Data model changes:
- New JSON schemas: SearchConfiguration.json, SynonymSet.json — codegen pipeline produces POJOs
- New DDL: SearchConfiguration-ddl.sql, SynonymSet-ddl.sql — DBO classes consume these
- New enum values added to MigrationType.json — migration order matters
### Coverage gaps:
#### Needs own CLAUDE.md:
- lib/lib-grid/ — CRDT implementation, specialized patterns, 15 files, non-obvious @GridTransaction annotation
#### Should roll up into parent:
- lib/lib-grid/util/ → cover in lib/lib-grid/CLAUDE.md — only 2 helper files, no distinct patterns
#### Already covered:
- lib/lib-common/ → covered by ./CLAUDE.md architecture section
### Line count: currently 120, after changes ~145 (concise but complete)
Ask the user to approve, modify, or skip each change set.
For each approved change:
<!-- Last reviewed: YYYY-MM --> date to the current month.Offer to commit the changes. Suggested message format:
Update CLAUDE.md files to reflect codebase evolution
- Updated N existing files
- Created N new module files
- Removed N stale references
Do NOT commit without explicit user approval.
/bootstrap-claudemd instead.After completing evolution, share these tips with the user:
/evolve-claudemd periodically (e.g., monthly or after major feature work) to prevent driftnpx claudepluginhub sage-bionetworks/agent-skills --plugin agent-skillsProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Searches MemPalace before answering questions about past work, people, projects, or prior decisions. Returns verbatim stored content instead of guessing from model memory.