- Home
- Skills
- Kaakati
- Rails Enterprise Dev
- Context Compilation
context-compilation_skill
- Shell
6
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill kaakati/rails-enterprise-dev --skill context-compilation- SKILL.md23.7 KB
Overview
This skill provides LSP-powered context extraction and type-safe code generation for Rails projects using cclsp MCP tools, Solargraph, and Sorbet. It packages patterns for interface extraction, vocabulary building, dependency graphing, and a Guardian-based validate-and-iterate cycle. The workflows are portable across Rails codebases and focus on safe generation and incremental typing.
How this skill works
It uses the cclsp MCP bridge to call LSP actions (find_definition, find_references, get_diagnostics, rename_symbol) and Solargraph for Ruby-aware symbol and diagnostic data. Sorbet is integrated for static type checks and runtime validations; Tapioca and RBI generation are suggested to bootstrap signatures for gems. Patterns combine LSP queries, file reads, and regex/AST scans to extract interfaces, build vocabularies, and drive pre- and post-generation Guardian checks.
When to use it
- When generating new Rails code that must align with existing interfaces and naming conventions.
- Before refactoring or renaming symbols to preview cross-file impacts and preserve type safety.
- To compile task-specific context for multi-agent workflows or code generation pipelines.
- When incrementally adopting Sorbet to validate newly generated code.
- When you need a reproducible generate-validate-execute-verify cycle for CI or developer tooling.
Best practices
- Run mcp__cclsp__get_diagnostics on files before generation to avoid propagating errors.
- Extract public interfaces and usage counts to guide conservative changes instead of global rewrites.
- Generate or update RBI files with Tapioca before relying on Sorbet checks for third-party types.
- Keep Solargraph configured to include app/**/*.rb and exclude test/vendor folders to reduce noise.
- Use dry_run when renaming symbols to preview changes and review call sites before applying.
Example use cases
- Extract a service class interface and generate a typed wrapper with Sorbet signatures.
- Build a dependency graph from an entry class to inform safe incremental refactors.
- Compile a task-specific context (interfaces, definitions, references) for a multi-agent code generation job.
- Run Guardian: generate code, run Solargraph diagnostics and Sorbet checks, apply fixes, and repeat until clean.
- Scan project files to build a vocabulary of models, services, domain terms to guide naming in generated code.
FAQ
Pre-generation checks should detect cclsp absence and short-circuit LSP-dependent steps; fall back to static parsing (parser gem or ripper) and flag missing LSP validation.
How do I handle Sorbet errors from generated code?
Run bundle exec srb tc for the specific file, surface errors via Guardian, apply minimal signature or implementation fixes, regenerate RBI for dependencies, and iterate until Sorbet reports no blocking errors.