project-memory
Use when setting up or organizing Claude Code project memory (CLAUDE.md, .claude/rules/) for better context awareness, consistent behavior, and project-specific instructions.
What this skill does
# Project Memory Skill
Set up and organize Claude Code's project memory system for consistent, context-aware assistance.
## Core Principle
**Project memory teaches Claude Code how to work with your specific codebase.** Well-organized project memory leads to more accurate, consistent, and helpful responses.
## Memory Hierarchy
Claude Code reads instructions in this order (higher = more precedence):
1. **Enterprise policy** (managed, highest)
2. **User memory** (`~/.claude/CLAUDE.md`)
3. **Project memory** (`CLAUDE.md` in project root)
4. **Modular rules** (`.claude/rules/*.md`)
5. **Local memory** (`CLAUDE.local.md`, gitignored)
Later sources override earlier ones for conflicting instructions.
## File Types
### CLAUDE.md (Project Root)
**Purpose:** Primary project instructions, conventions, and context
**Location:** Project root directory
**Visibility:** Checked into git, shared with team
**Contents:**
- Project overview and architecture
- Development commands (build, test, lint)
- Coding conventions and patterns
- Important constraints or requirements
- Links to key documentation
### .claude/rules/*.md
**Purpose:** Modular, path-specific rules
**Location:** `.claude/rules/` directory
**Visibility:** Checked into git
**Features:**
- Automatically loaded based on file path
- Supports subdirectories
- Can use YAML frontmatter with `globs` for path-specific targeting
### CLAUDE.local.md
**Purpose:** Personal, machine-specific instructions
**Location:** Project root directory
**Visibility:** Should be gitignored
**Use cases:**
- Personal preferences
- Local environment paths
- Machine-specific configurations
- Experimental instructions
## Setting Up Project Memory
### 1. Create CLAUDE.md
Start with essential project information:
```markdown
# Project Name
Brief description of what this project does.
## Development Commands
# Build
npm run build
# Test
npm test
# Lint
npm run lint
## Architecture
- `src/` - Source code
- `tests/` - Test files
- `docs/` - Documentation
## Conventions
- Use TypeScript for all new code
- Follow existing patterns in the codebase
- Run tests before committing
## Key Files
- `src/index.ts` - Main entry point
- `src/config.ts` - Configuration handling
```
### 2. Add Modular Rules (Optional)
Create path-specific rules in `.claude/rules/`:
```text
.claude/
rules/
api.md # Rules for API code
tests.md # Rules for test files
components/
forms.md # Rules for form components
```
### 3. Path-Specific Rules with Globs
Use YAML frontmatter to target specific paths:
```markdown
---
paths: ["src/api/**/*.ts", "src/services/**/*.ts"]
---
# API Development Rules
- All API functions must be async
- Always validate input parameters
- Use consistent error response format
- Include JSDoc with @throws annotations
```
### 4. Import Syntax
Reference other files from CLAUDE.md:
```markdown
# Project Instructions
See architecture: @docs/ARCHITECTURE.md
See API guidelines: @docs/API_GUIDELINES.md
```
Imported files are treated as direct context.
## CLAUDE.md Template
```markdown
# [Project Name]
[One-paragraph description of what this project does]
## Quick Start
# Install dependencies
[command]
# Run development server
[command]
# Run tests
[command]
## Architecture
[Brief overview of project structure]
### Key Directories
- `src/` - [Description]
- `tests/` - [Description]
- `config/` - [Description]
### Key Files
- `src/index.ts` - [Description]
- `src/config.ts` - [Description]
## Development Guidelines
### Code Style
- [Style convention 1]
- [Style convention 2]
### Testing
- [Testing convention 1]
- [Testing convention 2]
### Git Workflow
- [Commit convention]
- [Branch convention]
## Common Tasks
### Adding a New Feature
1. [Step 1]
2. [Step 2]
3. [Step 3]
### Running Tests
[test command]
## Important Notes
- [Critical constraint or requirement]
- [Security consideration]
- [Performance consideration]
```
## Path-Specific Rules Examples
### For API Code
```markdown
---
paths: ["src/api/**/*.ts"]
---
# API Development Rules
## Request Handling
- Validate all input with zod schemas
- Return consistent error format: `{ error: string, code: string }`
- Always set appropriate HTTP status codes
## Authentication
- All endpoints require auth unless in ALLOWED_PUBLIC_ROUTES
- Use `requireAuth()` middleware
## Response Format
// Success
{ data: T, meta?: { page, total } }
// Error
{ error: string, code: string, details?: object }
```
### For Test Files
```markdown
---
paths: ["**/*.test.ts", "**/*.spec.ts"]
---
# Testing Rules
## Structure
- Use `describe()` for grouping related tests
- Use `it()` with descriptive names: "should [action] when [condition]"
- One assertion per test when possible
## Mocking
- Prefer dependency injection over mocking
- Mock at boundaries (API, database, file system)
- Clear mocks between tests
## Coverage
- All public functions need tests
- Test happy path and error cases
- Include edge cases
```
### For React Components
```markdown
---
paths: ["src/components/**/*.tsx"]
---
# Component Rules
## Structure
- One component per file
- Export component as default
- Co-locate styles with component
## Props
- Define props interface above component
- Use destructuring in function signature
- Document required vs optional props
## State
- Prefer controlled components
- Lift state up when shared between components
- Use hooks for complex state logic
```
## Best Practices
### Keep It Concise
**Bad:**
```markdown
## Introduction
This project is a web application that allows users to manage their tasks.
It was started in 2023 and has grown to include many features including
task creation, task editing, task deletion, task filtering, task sorting,
task searching, task sharing, and task exporting...
```
**Good:**
```markdown
Task management web app. Users create, edit, filter, and share tasks.
```
### Be Specific and Actionable
**Bad:**
```markdown
Write good code and follow best practices.
```
**Good:**
```markdown
- Use TypeScript strict mode
- Run `npm run lint` before committing
- All functions need JSDoc comments
```
### Include Commands
**Bad:**
```markdown
Build the project before deploying.
```
**Good:**
```markdown
npm run build
npm run deploy
```
### Use Imports for Long Content
**Bad:** Everything in one huge CLAUDE.md
**Good:**
```markdown
# Project
Quick overview here.
## Detailed Documentation
Architecture: @docs/ARCHITECTURE.md
API Guide: @docs/API.md
Deployment: @docs/DEPLOYMENT.md
```
### Path-Specific Over Generic
**Bad:**
```markdown
# CLAUDE.md
When writing tests, always use Jest.
When writing API code, always validate input.
When writing components, always use TypeScript.
```
**Good:**
```
.claude/rules/tests.md -> Jest rules
.claude/rules/api.md -> Validation rules
.claude/rules/components.md -> TypeScript rules
```
## When to Update Project Memory
### Add New Instructions
- Onboarding reveals missing context
- Repeated questions indicate gaps
- New conventions are established
- Architecture changes significantly
### Review Existing Instructions
- Code changes make instructions outdated
- Team feedback indicates confusion
- Patterns evolve over time
## Common Patterns
### Monorepo Setup
```markdown
# Monorepo
## Packages
- `packages/core/` - Core library
- `packages/cli/` - CLI tool
- `packages/web/` - Web application
## Commands
# Build all packages
npm run build
# Test specific package
npm run test --workspace=packages/core
## Rules
See package-specific rules in each package's `.claude/rules/` directory.
```
### Environment-Specific Notes
Keep in `CLAUDE.local.md` (gitignored):
```markdown
# Local Setup Notes
## Environment
- Using Node 20.x
- PostgreSQL running on port 5433 (not default)
- Redis running in DockerRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.