From coconut-rules
This skill provides guidance on organizing CLAUDE.md rules, category structures, and rule file best practices. Use when the user asks about 'how to organize Claude rules', 'CLAUDE.md structure', 'rule categories', 'rules best practices', or needs help understanding the rules system.
npx claudepluginhub FrancisVarga/coconut-claude-code-plugins --plugin coconut-rulesThis skill uses the workspace's default tool permissions.
Comprehensive guidance for managing CLAUDE.md user-specific rules with **context-based loading** for optimal performance.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Automates semantic versioning and release workflow for Claude Code plugins: bumps versions in package.json, marketplace.json, plugin.json; verifies builds; creates git tags, GitHub releases, changelogs.
Comprehensive guidance for managing CLAUDE.md user-specific rules with context-based loading for optimal performance.
Claude Code loads CLAUDE.md on every interaction. To avoid loading all rules upfront:
.claude/rules/ with trigger hints (loaded on-demand).claude/
├── CLAUDE.md # Critical rules + context hints
└── rules/ # Domain-specific rules (loaded when relevant)
├── python.md
├── typescript.md
├── docker.md
├── react.md
└── security-advanced.md
# Project Name
Brief project description.
## Critical Rules (Always Apply)
### Security
- Never commit secrets, API keys, or credentials
- Never disable security middleware or authentication checks
- Sanitize all user input before database operations
### Git Workflow
- Feature branches only, never commit directly to main
- Always run tests before committing
## Context (Read When Relevant)
Load context files based on what you're working on:
| Working On | Read |
|------------|------|
| Python/FastAPI backend | `.claude/rules/python.md` |
| React/TypeScript frontend | `.claude/rules/typescript.md` |
| Docker/containers | `.claude/rules/docker.md` |
| Authentication/security | `.claude/rules/security.md` |
Keep rules that are always relevant regardless of task:
Characteristics:
Move rules that are domain-specific:
Characteristics:
# [Technology/Domain] Context
Rules for [technology] development in this project.
## Key Patterns
- [Specific pattern or convention]
- [Another pattern]
## Examples
### Recommended
```python
# Good example with explanation
```
### Avoid
```python
# Bad example with explanation why
```
## Integration Points
- Related to: `.claude/context/[related].md` (when working with both)
The CLAUDE.md table tells Claude when to load context files from .claude/rules/:
| Trigger Keywords | Context File |
|---|---|
.py, Python, FastAPI, Pydantic | python.md |
.ts, .tsx, React, Next.js | typescript.md |
| Docker, container, Dockerfile | docker.md |
| auth, JWT, OAuth, security audit | security.md |
.go, Go, Gin, Echo | golang.md |
| database, SQL, migrations | database.md |
# CLAUDE.md
@rules/frontend/react.md
@rules/frontend/typescript.md
@rules/backend/python.md
@rules/backend/fastapi.md
@rules/devops/docker.md
@rules/security/auth.md
@rules/general/standards.md
Problem: All 7 files loaded on every interaction
# CLAUDE.md
## Critical Rules
- Never commit secrets
- Feature branches only
- Run tests before commit
## Context (Read When Relevant)
| Working On | Read |
|------------|------|
| Python backend | `.claude/rules/python.md` |
| TypeScript/React | `.claude/rules/typescript.md` |
| Containers | `.claude/rules/docker.md` |
Improvement: Only load what's needed per task
.py, .tsx)| Command | Purpose |
|---|---|
/coconut-rules:add-rule [desc] | Add rule with auto-placement (critical vs context) |
/coconut-rules:list-rules | Show current structure and loading pattern |
/coconut-rules:organize | Restructure rules to context-based pattern |