From design-docs
Update CLAUDE.md files to improve efficiency and structure. Use when optimizing LLM context files, implementing review recommendations, splitting large files, or adding design doc pointers.
How this skill is triggered — by the user, by Claude, or both
Slash command
/design-docs:context-updateThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Updates CLAUDE.md and child CLAUDE.md files to improve context efficiency
Updates CLAUDE.md and child CLAUDE.md files to improve context efficiency based on review findings or user requests.
This skill runs in a forked context to avoid cluttering the main conversation with detailed file modifications.
This skill implements improvements to CLAUDE.md files:
Read configuration:
Load .claude/design/design.config.json to understand:
Read existing CLAUDE.md files:
Understand current structure and content before modifying.
Check for review report:
If user mentions review findings or provides a report, prioritize those recommendations.
Based on the situation, choose approach:
When a section is too detailed for CLAUDE.md:
.claude/design/{module}/{topic}.mdWhen design docs exist but aren't referenced:
When root CLAUDE.md is too large:
{module}/CLAUDE.md for each moduleWhen content is repeated across files:
For each file modification:
If moving content to design doc:
---
status: current
module: {module-name}
category: {category}
created: YYYY-MM-DD
updated: YYYY-MM-DD
last-synced: YYYY-MM-DD
---
# {Topic Name}
## Overview
[Content moved from CLAUDE.md]
## Current State
[Detailed implementation details]
## Rationale
[Why this approach was chosen]
Replace detailed section with:
## {Topic}
[1-2 sentence high-level summary]
**For detailed information:**
- Architecture → `@./.claude/design/{module}/architecture.md`
- Performance → `@./.claude/design/{module}/performance.md`
**When to load:**
Load these docs when working on {specific scenarios}.
**Do NOT load unless directly relevant to your task.**
For new child file at {module}/CLAUDE.md:
# {Module Name}
High-level guidance specific to this module.
## Module Overview
[Brief description]
## Key Commands
[Module-specific commands]
## Design Documentation
Complex systems have detailed design docs:
**When working on these areas, load relevant context:**
- {Topic} → `@../.claude/design/{module}/{topic}.md`
## Common Tasks
[Module-specific task guidance]
In root CLAUDE.md, replace module details with:
## {Module Name}
[1 sentence description]
See `{module}/CLAUDE.md` for module-specific guidance.
After modifications:
Line count check:
Link validation:
Content check:
Duplication check:
Provide summary of modifications:
# CLAUDE.md Update Summary
## Files Modified
### {file-path}
**Before:** {line-count} lines
**After:** {line-count} lines
**Change:** {percentage}% reduction
**Changes made:**
- Moved "{section-name}" to `.claude/design/{path}.md`
- Added pointer to {design-doc}
- [Other changes]
### {file-path}
[Similar structure]
## Files Created
### {file-path}
**Type:** Design document
**Lines:** {line-count}
**Purpose:** Detailed {topic} documentation
### {file-path}
**Type:** Child CLAUDE.md
**Lines:** {line-count}
**Purpose:** {Module} specific guidance
## Quality Improvements
- Total line reduction: {number} lines
- New design docs: {count}
- New child CLAUDE.md files: {count}
- Design doc pointers added: {count}
## Validation Results
✓ All files within line limits
✓ All pointers reference existing files
✓ No content duplication
✓ Clear instruction hierarchy
## Next Steps
[If further improvements needed, suggest them]
Before (CLAUDE.md):
## Testing Strategy
We use Vitest with multiple test types:
1. Unit tests run with mocked services...
[50 lines of detailed testing instructions]
2. Integration tests make real API calls...
[40 lines of integration test details]
3. Coverage is tracked using v8 provider...
[30 lines of coverage configuration]
After (CLAUDE.md):
## Testing
Run tests with `pnpm test` (unit) or `pnpm test:all` (includes integration).
**For detailed testing guidance:**
→ `@./.claude/design/project/testing-strategy.md`
Load this doc when writing tests, debugging test failures, or
configuring test infrastructure.
New design doc (.claude/design/project/testing-strategy.md):
Contains the detailed 120 lines of testing documentation with proper frontmatter.
Before:
## Architecture
The system uses Effect-TS for functional architecture. See the
architecture design doc for details.
After:
## Architecture
The system uses Effect-TS for functional architecture.
**For architectural details:**
→ `@./.claude/design/{module}/architecture.md`
Load when making architectural changes or adding new systems.
Before (root CLAUDE.md has 200-line section for my-package):
After (root CLAUDE.md):
## Packages
### my-package
TypeScript type registry with Effect-TS architecture.
See `pkgs/my-package/CLAUDE.md` for package-specific guidance.
New (pkgs/my-package/CLAUDE.md):
# my-package
TypeScript type definition registry with caching and VFS support.
## Development
Commands:
- `pnpm test` - Run unit tests
- `pnpm build` - Build package
## Design Documentation
**When working on these systems, load context:**
- Architecture → `@../.claude/design/my-package/architecture.md`
- Observability → `@../.claude/design/my-package/observability.md`
## Implementation Notes
[Package-specific high-level guidance]
Preserve user customizations:
Don't remove sections users explicitly added unless they're duplicates or too detailed.
Maintain CLAUDE.local.md:
If present, apply same standards. Note it overrides CLAUDE.md.
Monorepo hierarchies:
Ensure clear delegation: root → package CLAUDE.md → design docs.
Incremental updates:
Don't try to fix everything at once. Prioritize high-impact changes.
A successful update:
npx claudepluginhub spencerbeggs/bot --plugin design-docsFetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Applies a firm's KYC/AML rules grid to parsed onboarding records: assigns risk rating, checks required documents, outputs rule outcomes with citations, and routes for escalation.
Generates daily or weekly digests of activity from connected sources (chat, email, docs, tasks, CRM), highlighting action items, decisions, mentions, and project updates.