// Enforce Claude Compass development standards and best practices. This skill should be used when writing or modifying code in the Claude Compass repository, including parsers, database migrations, graph builders, MCP tools, and core services. It ensures adherence to code quality principles, proper error handling, self-documenting code, and established architectural patterns.
| name | claude-compass-best-practices |
| description | Enforce Claude Compass development standards and best practices. This skill should be used when writing or modifying code in the Claude Compass repository, including parsers, database migrations, graph builders, MCP tools, and core services. It ensures adherence to code quality principles, proper error handling, self-documenting code, and established architectural patterns. |
Maintain code quality and architectural consistency across the Claude Compass codebase by enforcing established development principles. This skill provides comprehensive guidance on code quality standards, parser development patterns, and database best practices specific to Claude Compass.
Apply these standards proactively when:
NEVER implement fallback business logic, backwards compatibility, or lazy solutions.
This principle permeates all Claude Compass development:
For detailed examples and anti-patterns, consult references/code-quality-standards.md.
Code should be self-explanatory through clear naming and structure. Use documentation comments for methods, classes, and properties to describe their purpose, not their implementation.
Key practices:
any, use proper TypeScript types)For comprehensive naming conventions and examples, consult references/code-quality-standards.md.
When working with parsers or adding new language support:
# Enable verbose debug logging
CLAUDE_COMPASS_DEBUG=true ./dist/src/cli/index.js analyze /path --verbose
# Debug single file (isolates parsing of one file)
./dist/src/cli/index.js analyze /path/to/repo \
--debug-file relative/path/to/file.cs \
--verbose
For complete parser patterns, including:
Consult references/parser-patterns.md
All database schema changes must be done through migrations. Never modify the database schema directly.
Naming: NNN_description.ts
NNN = 3-digit sequential number (001, 002, 003, ...)description = kebab-case descriptionStructure: Every migration MUST include both up and down methods
# Create new migration
npm run migrate:make add_entity_type_column
# Apply migrations
npm run migrate:latest
# Check status
npm run migrate:status
# Rollback (if needed)
npm run migrate:rollback
CASCADE, SET NULL, RESTRICT)For complete database patterns, including:
Consult references/database-patterns.md
Claude Compass follows strict modularization for maintainability:
Modularize when a file:
src/parsers/<feature>/
โโโ index.ts # Public API exports (backward compatibility)
โโโ <feature>.ts # Main logic
โโโ <service-1>.ts # Focused, single-purpose modules
โโโ <service-2>.ts
โโโ types.ts # Shared type definitions
Examples in codebase:
src/parsers/csharp/ - C# language parser (modularized)src/parsers/orm/ - ORM parsers (modularized)src/parsers/framework-detector/ - Framework detection (modularized)src/graph/builder/ - Graph construction (modularized)Detect and report errors as early as possible with maximum context.
Include all relevant information in error messages:
Example:
throw new ChunkingError(
`Failed to parse chunk: syntax error in object literal`,
{
filePath: '/path/to/file.ts',
chunkIndex: 3,
totalChunks: 5,
startLine: 250,
endLine: 499,
cause: originalError
}
);
Every feature or bug fix should include tests:
Test files: tests/**/*.test.ts
This skill includes three comprehensive reference documents:
references/code-quality-standards.md)Load when:
Contains:
references/parser-patterns.md)Load when:
Contains:
references/database-patterns.md)Load when:
Contains:
Use this guide to determine which reference to consult:
| Task | Reference to Load |
|---|---|
| Writing a new function/class | code-quality-standards.md |
| Adding language support (Rust, Go, etc.) | parser-patterns.md |
| Creating database migration | database-patterns.md |
| Implementing Tree-sitter parsing | parser-patterns.md |
| Designing database schema | database-patterns.md |
| Refactoring for code quality | code-quality-standards.md |
| Debugging parser errors | parser-patterns.md |
| Writing database queries | database-patterns.md |
| Modularizing a large file | code-quality-standards.md |
| Adding framework detection | parser-patterns.md |
Start with the relevant reference sections and load additional context as needed: