This directory contains Claude Code configuration, hooks, and skills for the StackMemory project.
.claude/
├── claude.json # Main configuration with hooks
├── hooks/ # Hook scripts
│ ├── skill-eval.sh # Shell wrapper for skill evaluation
│ ├── skill-eval.cjs # Node.js skill evaluation engine
│ └── skill-rules.json # Skill detection rules
├── agents/ # Agent definitions
│ ├── code-reviewer.md # Code review agent
│ └── github-workflow.md # Git workflow agent
└── skills/ # Skill definitions
├── code-quality.md # Code quality checks
├── pr-review.md # PR review skill
└── pr-summary.md # PR summary generation
- UserPromptSubmit: Analyzes prompts and suggests relevant skills
- PreToolUse: Prevents editing on main branch
- PostToolUse:
- Auto-formats TypeScript/JavaScript files
- Auto-installs dependencies when package.json changes
- Auto-runs tests when test files change
- Type-checks TypeScript files
The skill evaluation engine detects relevant skills based on:
- Keywords in prompts
- File paths mentioned
- Directory mappings
- Intent patterns
- Code content patterns
- frame-management: Frame stack and context management
- linear-integration: Linear API and task sync
- mcp-server: Model Context Protocol implementation
- testing-patterns: Jest testing infrastructure
- cli-commands: CLI command implementation
- storage-tiers: 3-tier storage system
- context-bridge: Cross-session synchronization
- task-management: Task tracking and persistence
- terminal-ui: Terminal UI with Ink
- claude-integration: Claude Code hooks and integration
- build-scripts: Build and deployment scripts
- documentation: Documentation and API reference
- github-actions: CI/CD workflows
- code-quality: Code review and quality checks
- performance-optimization: Performance analysis
- code-reviewer: Reviews code against StackMemory standards
- github-workflow: Manages git operations and PRs
The hooks and skills are automatically activated when using Claude Code in this project. The skill evaluation engine will analyze your prompts and suggest relevant skills to activate.
Test skill evaluation:
echo '{"prompt": "your test prompt"}' | node .claude/hooks/skill-eval.cjsEdit skill-rules.json to:
- Add new skills
- Modify detection patterns
- Adjust confidence scoring
- Update directory mappings
Domain-specific knowledge files loaded on keyword match. See skills/knowledge/ for available skills.
[LOAD]on keyword match from frontmatter `activates_on` → read matching .skill.md
[FALLBACK]if `expires` date passed → use Context7 `context7` field or fetch `sources[]`
[CACHE]loaded skills persist for session|don't re-read same skill
[FORMAT]frontmatter: name,version,domain,expires,activates_on[],sources[],context7
Available: esbuild-esm, vitest, better-sqlite3, mcp-protocol, commander-cli
Plus global skills at ~/.claude/skills/knowledge/: stripe-api, railway-deploy, anthropic-sdk
Key patterns enforced by hooks and agents:
- ESM Imports: Always add
.jsextension to relative imports - Context Bridge: Use
skipContextBridge: truefor CLI operations - Error Handling: Return
undefinedinstead of throwing in getFrame() - Database Paths: Use project-local
.stackmemory/not global - Frame Digests: Keep under 200 tokens
- Linear Integration: Reference tickets in commits (STA-XX)
- Update
skill-rules.jsonwhen adding new features - Keep agent definitions in sync with project standards
- Test hooks after major changes