AGENT SKILL

refresh-project-context

Updates CLAUDE.md project sections while keeping it lean. Adds detailed content to CHEATSHEET.md. Use when a framework upgrade has landed, when project context has drifted, or when the user says "update project docs", "refresh context", "CLAUDE.md is outdated", or "sync documentation".

License 许可
MIT
最近更新
2026-10-23
Stars
★ 0
Forks
0

01 前言 Front Matter

name
refresh-project-context
description
Updates CLAUDE.md project sections while keeping it lean. Adds detailed content to CHEATSHEET.md. Use when a framework upgrade has landed, when project context has drifted, or when the user says "update project docs", "refresh context", "CLAUDE.md is outdated", or "sync documentation".
allowed-tools
Read, Write, Edit, Bash, Glob, Grep, Task, TodoWrite, AskUserQuestion

03 SKILL.md 正文

Refresh Project Context Skill

Fills the root CLAUDE.md ## Project context skeleton (lean) and moves detailed reference content into CHEATSHEET.md. Keep the project-context section of CLAUDE.md to about 100 lines: it loads into every session, so each line costs context on every turn. CHEATSHEET.md is read on demand. Flow: Analyze → fill the skeleton → update CHEATSHEET.md.

Index

File or section Read when…
Key Principles / Invocation Choosing a mode (--quick, --prd, --full)
Phase 1: Analyze Discovering the stack and comparing documented vs actual state
Phase 2: Fill the skeleton Writing the six project-context headers, and what never goes there
Phase 3: Update CHEATSHEET.md Moving detail out of CLAUDE.md
Phase 4–5 Optional documentation audit and the progress-notes summary
Error Handling / Key Paths Sentinel missing, CLAUDE.md bloated, or locating framework paths

Key Principles

  1. CLAUDE.md = Index - Minimal framework instructions + project overview
  2. CHEATSHEET.md = Reference - All detailed tables, examples, workflows
  3. On-demand loading - Reference files in .claude/reference/ not inlined
  4. Token optimization - Every line in CLAUDE.md costs context window

Invocation

/refresh-project-context           # Update project sections in CLAUDE.md
/refresh-project-context --quick   # CLAUDE.md project sections only
/refresh-project-context --prd     # Include PRD update
/refresh-project-context --full    # Full refresh with @project-manager re-interview

Phase 1: Analyze Current Project State

1.1 Discover Project Structure

Check for:

  • package.json, requirements.txt, go.mod, Cargo.toml
  • Project structure (src/, app/, lib/)
  • Available commands (npm scripts, Makefile targets)

1.2 Read Current Files

Read:

  • CLAUDE.md - current project sections
  • CHEATSHEET.md - current reference content
  • Dependency files for tech stack

1.3 Present Findings

Show discovered vs documented state. Confirm before updating.


Phase 2: Fill the root CLAUDE.md "Project context" skeleton (KEEP LEAN)

install.sh --mode refresh-v3 scaffolds an empty project-context skeleton in the consumer's root CLAUDE.md (below the <!-- forge-flow:framework-import --> import, under a <!-- forge-flow:project-context --> sentinel). This skill's job is to populate that exact skeleton — never to invent a parallel section. Write to the headers below verbatim; do NOT create a ## PROJECT OVERVIEW or any other heading, or you'll leave the real skeleton empty beside a duplicate.

2.1 Target — the canonical project-context section

The skeleton (in the root CLAUDE.md) is exactly:

<!-- forge-flow:project-context -->
## Project context

### Identity
### Why it exists
### Architecture (deviations only)
### Version quirks & pins
### Global invariants & anti-patterns
### See also

Locate the <!-- forge-flow:project-context --> sentinel and edit the headers underneath it in place (replace the <!-- ... --> placeholder comment in each section with real content). If the sentinel is absent (older install, or a project that pre-dates the scaffold), the user should re-run the refresh first — or insert the skeleton manually before filling it.

2.2 What goes in each header — LEAN, document only the non-inferable

Keep every section to 1–3 lines. The rule (same as the skeleton's own guidance): document only what Claude cannot infer from the code. Depth lives in Tier-2, not here.

Header Content Length
Identity One line: what the project is, plain terms. 1 line
Why it exists The problem it solves / value delivered — the strategic why, not visible in code. 2–3 lines
Architecture (deviations only) ONLY the parts that depart from convention. Skip anything a reader infers from structure. Often empty — that's fine. 0–3 lines
Version quirks & pins "This library version behaves this way / is real, don't reinvent it." Tribal knowledge (e.g. a framework's new middleware file Claude would otherwise deny exists). 0–4 lines
Global invariants & anti-patterns Verifiable hard rules: "never bypass getOrCreateX", "all auth errors route through Y", "parameterize all SQL". 0–5 lines
See also Pointer line(s): - Full intent & architecture: .claude/reference/01-system-overview.md and - CHEATSHEET.md for command/agent tables. 1–2 lines

2.3 Boundaries

  • Write only under the six skeleton headers above.
  • Summarize intent in a line and point to reference/01-system-overview.md for the full prose.
  • Examples, routing tables, workflows and code snippets go in CHEATSHEET.md.
  • Replace only the remaining <!-- ... --> placeholders; a section the user already filled with real content stays as written unless they ask.

2.4 Link to references (the See also line)

The ### See also header must point at the authoritative sources rather than inline them:

  • .claude/reference/01-system-overview.md — full intent & architecture (Tier-2 source-of-truth)
  • CHEATSHEET.md — full command/agent tables and examples

Phase 3: Update CHEATSHEET.md

Move any detailed content to CHEATSHEET.md:

  • Full command list with examples
  • Full agent list with descriptions
  • Full best practices list
  • Detailed workflows
  • Session protocol steps

Phase 4: Documentation Audit (Optional)

If not --quick:

Audit, in this skill (no delegation), whether each source agrees with the code as it is now:

  1. The populated docs in .claude/reference/ (architecture and development docs live there, not in docs/)
  2. The task registry (forge task ls — statuses match what the code shows is done)
  3. Project memory at docs/project-memory/

Done when every reference doc either agrees with the code or its mismatch is listed in the Phase 5 summary with the file and the line that is wrong.


Phase 5: Summary

Append to .claude/memories/progress-notes.md:

## Project Context Refresh - [DATE]

- CLAUDE.md: Filled root `## Project context` skeleton (kept lean)
- CHEATSHEET.md: Added detailed references
- Framework alignment verified

Error Handling

Issue Action
No CLAUDE.md Run /new-project --current
No <!-- forge-flow:project-context --> sentinel in root CLAUDE.md Re-run install.sh --mode refresh-v3 to scaffold the skeleton, then fill it
CLAUDE.md bloated (>150 lines) Move content to CHEATSHEET.md
Missing .claude/reference/ Framework not initialized properly

Key Paths (Framework)

Type Location
Reference docs .claude/reference/
Rules .claude/rules/
Agents .claude/agents/
Sessions .claude/memories/sessions/
Tasks docs/tasks/registry.json
Project memory docs/project-memory/

Note: Architecture, development standards, and framework docs are in .claude/reference/, NOT in a separate docs/ directory.


Project-specific overrides: if SKILL.local.md exists in this directory, read it — it is consumer-owned, survives framework refresh, and wins on conflict. A sidecar that relaxes a gate defined above must state how to prove the gate is wrong in that case. Doctrine: rules/framework-vs-project-root.md.

04 同仓库更多 Skills

rynhardt81
rynhardt81/forgeFlow

wizard

Generates an interactive bash wizard that walks a human through steps only they can perform — opens each URL, says what to click and copy, captures values (hidden entry for secrets), writes .env and GitHub secrets, confirms before irreversible actions. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.

★ 0
rynhardt81
rynhardt81/forgeFlow

vet-idea

Vets an idea, decision, or plan BEFORE it is built. Runs a single model through five fixed adversarial advisor roles, a peer-review pass, and a chairman synthesis that emits a halt-capable GO / NO-GO / RECONSIDER verdict. Advisory and non-mutating — outputs a report, never writes task state. Use when an idea, feature, or costly hard-to-reverse decision is of uncertain worth and the question is whether to build it at all. NOT FOR settled work (bug fixes, approved features) or for shaping how to build it (the ISA Interview workflow).

★ 0
rynhardt81
rynhardt81/forgeFlow

triage-incident

Production incident triage — from "something is broken for users" to fixed, verified, and learned-from. Pulls the error signal (Sentry/logs/user report), reproduces before touching code, routes the fix through /fix-bug's prod fast path, and closes with a postmortem entry. Use when something is broken for users in production — an outage, data corruption, a Sentry spike, or a crash-rate alert. NOT FOR bugs found in development (use /fix-bug directly) or CI failures (use /diagnose-ci).

★ 0
rynhardt81
rynhardt81/forgeFlow

setup-review-bot

Configures a repo's AI code reviewers — the post-PR mention bot and the pre-push local reviewer — and writes the AGENTS.md the reviewers read. Interviews the user for what the reviewer should weight, then sets git config forge.reviewBot / forge.localReview and populates AGENTS.md at the project root. Use when a repo has no reviewer configured, when review findings are consistently off-target, or when onboarding a new project.

★ 0
rynhardt81
rynhardt81/forgeFlow

security-review

Portable security review for a feature, endpoint, or change before it ships. Orchestrates the existing OWASP review (@security-boss) and secrets scan (security_secrets validator), then adds the pass they miss — an explicit business-logic-flaw walkthrough (IDOR, race/TOCTOU, state-machine bypass, privilege escalation, price/quantity tampering). Advisory and non-mutating — produces a findings report; real findings are filed as tasks. Use when a change touching money, access control, or multi-step state is about to ship, or when the auth looks fine but the flow could be abused. NOT FOR SAST or dependency-CVE scanning (consumer CI owns those).

★ 0
rynhardt81
rynhardt81/forgeFlow

run-epic

Autonomously drains every open task in a single epic. Pulls ready tasks via the forge CLI, executes the work in-context using the matching discipline (fix-bug / new-feature / refactor), files newly-discovered work as follow-up tasks without stopping to ask, opens a PR per completed task via /create-pr, and repeats until the epic has zero ready/in-progress/pending tasks. Use when the user says `/run-epic E##`, "run epic autonomously", "finish all remaining tasks for epic X", or "drive epic X to completion".

★ 0