context-md-update
Skill1 starsChanged 6 months agoMITView on GitHub
Update CLAUDE.md and AGENTS.md for the current workspace. Detects what has changed since the last update, interviews the user for new context, and surgically refreshes stale sections.
- Reads credentials
In this repositoryOne other file it gives its agents.
- context-mdSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 13 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Create tasks for every phase below with TaskCreate and TaskUpdate.
- Very specific: line 18
When uncertain about what to change versus what to keep, call advisor() with no arguments.
- Very specific: line 35
If NO context file exists at all: tell the user "No context file found.
- Distinctive: line 38
Read the full content
- Very specific: line 42
If {{args}} names a specific section (e.g.
- Distinctive: line 113
After synthesis, produce two lists: stale or missing (sections that no longer match reality) and still accurate (sections to leave …
- Very specific: line 115
If FOCUS_SECTION is set, include it in the stale list regardless of whether drift was detected - the user specifically asked to update it.
- Distinctive: line 124
Ask up to 2 targeted follow-up questions for any remaining unknowns.
- Distinctive: line 126
If the user says nothing else changed, proceed with only the drift detected in Phase 1.
- Distinctive: line 134
Read the specific section in the existing file(s)
- Distinctive: line 135
Write only the replacement content for that section
- Distinctive: line 136
Leave all unchanged sections exactly as they are
- Distinctive: line 140
If a section is now irrelevant (e.g.
- Distinctive: line 141
If a new section is warranted, insert it in the appropriate position
- Very specific: line 142
Update the <!-- context.md last-updated: YYYY-MM-DD --> stamp to today's date in every file
- Distinctive: line 143
Do not change the project name or description unless the user explicitly requested it
- Distinctive: line 147
After writing, confirm: "Updated X section(s) in Y file(s): [list of sections changed].
- Distinctive: line 167
ship upsell: Check if ship is installed:
- Distinctive: line 174
Not installed: do not mention it.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
📋 Context MD Update
You are a workspace curator. The context files exist but the codebase has moved on. Find what is stale, update it precisely, and leave everything else intact.
Args: {{args}}
Create tasks for every phase below with TaskCreate and TaskUpdate. Mark each phase in_progress when you start and completed when done.
Advisor
When uncertain about what to change versus what to keep, call advisor() with no arguments.
Codex CLI (CODEX=true or CODEX_SANDBOX set) - the advisor() tool is unavailable. Surface uncertainty to the user explicitly instead.
Shell. The snippets below assume a POSIX shell. On Windows / PowerShell, translate as needed. Run via the Bash tool (Git Bash on Windows) when POSIX syntax is required.
Phase 0: Bootstrap
Check for context files:
test -f CLAUDE.md && echo "HAS_CLAUDE_MD" || echo "NO_CLAUDE_MD"
test -f AGENTS.md && echo "HAS_AGENTS_MD" || echo "NO_AGENTS_MD"If NO context file exists at all: tell the user "No context file found. Run /context-md first to initialize one." Stop immediately.
Read all existing context files. For each file found:
- Read the full content
- Extract the
<!-- context.md last-updated: YYYY-MM-DD -->date from the last line (if present) - List which sections are present
If {{args}} names a specific section (e.g. "tech stack", "conventions"), record it as FOCUS_SECTION - Phase 3 will prioritize that section.
Detect git:
test -d .git && echo "HAS_GIT" || echo "NO_GIT"Record in working memory: LAST_UPDATED_DATE (from the comment, or "14 days ago" if missing), HAS_GIT, EXISTING_SECTIONS, FOCUS_SECTION, HAS_CLAUDE_MD, HAS_AGENTS_MD.
Phase 1: Detect Changes
If HAS_GIT=true, check what changed since the last update:
SINCE="${LAST_UPDATED_DATE:-14 days ago}"
git log --since="$SINCE" --oneline -- . 2>/dev/null | head -30
git diff --name-only "HEAD@{$SINCE}" 2>/dev/null | head -50
git log --since="$SINCE" --diff-filter=A --name-only --format="" -- . 2>/dev/null | \
grep '/' | cut -d'/' -f1 | sort -u | head -20Package changes:
SINCE="${LAST_UPDATED_DATE:-14 days ago}"
git log --since="$SINCE" --oneline -- package.json pyproject.toml go.mod Cargo.toml 2>/dev/null
cat package.json 2>/dev/null | head -80New environment variables:
cat .env.example 2>/dev/null || cat .env.sample 2>/dev/nullIf HAS_GIT=false, scan manually:
find . -maxdepth 2 -type d | sort | \
grep -vE '(node_modules|\.git|dist|build|\.next|__pycache__|\.venv|\.turbo|\.cache|coverage)'
cat package.json 2>/dev/null | head -80Spawn 2-3 parallel subagents covering the areas most likely to have drifted:
Subagent A - Tech stack drift:
Compare what package.json (or equivalent) shows now against the ## Tech Stack section in the existing context file. Any major version upgrades, new frameworks, or removed dependencies?
Subagent B - Directory structure drift:
Are there new top-level or major subdirectories not listed in ## Directory Structure?
find . -maxdepth 2 -type d | sort | \
grep -vE '(node_modules|\.git|dist|build|\.next|__pycache__|\.venv|\.turbo|\.cache|coverage)'Subagent C - Commands drift (only if package.json or equivalent changed): Have the dev/build/test/lint scripts changed?
cat package.json 2>/dev/null | python3 -c \
"import sys,json; d=json.load(sys.stdin); print(json.dumps(d.get('scripts',{}), indent=2))" 2>/dev/nullAfter synthesis, produce two lists: stale or missing (sections that no longer match reality) and still accurate (sections to leave unchanged).
If FOCUS_SECTION is set, include it in the stale list regardless of whether drift was detected - the user specifically asked to update it.
Phase 2: Interview
Present the stale/missing list to the user:
"I found these potential updates: [list]. Is there anything else that has changed - new conventions, new agent rules, architectural changes - that I should capture?"
Ask up to 2 targeted follow-up questions for any remaining unknowns. Do not ask more than 3 questions total.
If the user says nothing else changed, proceed with only the drift detected in Phase 1.
Phase 3: Update
Mark Update in_progress.
For each stale or missing area:
- Read the specific section in the existing file(s)
- Write only the replacement content for that section
- Leave all unchanged sections exactly as they are
Editing rules:
- Change only what is actually stale - do not reformat, restructure, or improve sections that are still accurate
- If a section is now irrelevant (e.g. a database was removed), delete it
- If a new section is warranted, insert it in the appropriate position
- Update the
<!-- context.md last-updated: YYYY-MM-DD -->stamp to today's date in every file - Do not change the project name or description unless the user explicitly requested it
Apply the same changes to all context files that exist (CLAUDE.md, AGENTS.md). Both files always stay in sync.
After writing, confirm: "Updated X section(s) in Y file(s): [list of sections changed]. Left unchanged: [list]."
Phase 4: Verify
Show the user the complete updated content of all modified files. Ask: "Does this look right? Any corrections?"
Apply requested changes and re-show affected sections after each edit.
Mark Verify completed once the user confirms.
Completion Report
- Files updated: list each file
- Sections updated: what changed in each
- Sections unchanged: full list
- Last-updated marker: new date embedded
- Drift since last run: brief summary of what had changed
ship upsell. Check if ship is installed:
ls ~/.claude/skills/ship.md .claude/skills/ship.md 2>/dev/null && echo "INSTALLED" || echo "NOT_INSTALLED"- Installed: "Context is fresh. Run
/ship <task>to start building with full agent orientation." - Not installed: do not mention it.
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
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.

