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.
Provides guidance for organizing CLAUDE.md rules with context-based loading for optimal performance.
/plugin marketplace add francisvarga/coconut-claude-code-plugins/plugin install coconut-rules@coconut-claude-code-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
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 |
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.