xiaohongshu
xiaohongshu
maintaining-project-context
Use when completing development phases or branches to identify and update CLAUDE.md files that may have become stale - analyzes what changed, determines affected contracts and documentation, and coordinates updates
Full skill instructions
REQUIRED SUB-SKILL: Use writing-claude-md-files for all context file creation and updates.
Context files (CLAUDE.md) document contracts and architectural intent. When code changes contracts, the documentation must update. Stale documentation is worse than no documentation.
Trigger: End of development phase, branch completion, or any work that changed contracts, APIs, or domain structure.
| Change Type | Update Required? | What to Update |
|---|---|---|
| New domain/module | Yes | Create domain context file |
| API/interface change | Yes | Contracts section |
| Architectural decision | Yes | Key Decisions section |
| Invariant change | Yes | Invariants section |
| Dependency change | Yes | Dependencies section |
| Bug fix (no contract change) | No | - |
| Refactor (same behavior) | No | - |
| Test additions | No | - |
Diff against the base (branch start or phase start):
# Get changed files
git diff --name-only <base-sha> HEAD
# Get detailed changes
git diff <base-sha> HEAD --stat
Categorize changes:
For each significant change, determine which context file should document it:
| Change Location | Context File Location |
|---|---|
| Project-wide pattern | Root CLAUDE.md |
| New domain | <domain>/CLAUDE.md (create) |
| Existing domain contract | <domain>/CLAUDE.md (update) |
| Cross-domain dependency | Both affected domains |
Hierarchy rule: Information belongs at the lowest level where it applies. Domain-specific contracts go in domain files, not root.
For each affected context file, verify:
# Find domain's public exports
grep -r "export" <domain>/index.ts
# Find domain's imports (dependencies)
grep -r "from '\.\." <domain>/
For updates:
date +%Y-%m-%dFor new domains:
<domain>/CLAUDE.md using template from writing-claude-md-filesgit add <affected CLAUDE.md files>
git commit -m "docs: update project context for <branch-name>"
Has code changed?
├─ No → Skip (nothing to update)
└─ Yes → What changed?
├─ Only tests/internal details → Skip
└─ Contracts/APIs/structure → Continue
│
├─ New domain created?
│ └─ Create CLAUDE.md
│
├─ Existing domain changed?
│ └─ Update domain CLAUDE.md
│
└─ Project-wide pattern changed?
└─ Update root CLAUDE.md
Always update when:
Never update for:
| Mistake | Fix |
|---|---|
| Updating for every change | Only update for contract changes |
| Forgetting freshness date | Always use date +%Y-%m-%d |
| Documenting implementation | Document contracts and intent |
| Putting domain info in root | Use domain context files for domain contracts |
| Skipping verification | Read the code, confirm contracts hold |
Called by:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience