build_modules-layer
Builds and evaluates Python module layers for the Gentleman-Skills ecosystem. Generates eval scenarios, adapts skills for LLM targets, and performs code analysis (dead code, complexity, blast radius).
SKILL.md.claude/skills/build_modules/SKILL.md
GitHub<!-- L1:START -->
Don't: Mix adaptation targets — using
build_modules-layer
This layer provides tools for building, evaluating, and analyzing Python modules within the Gentleman-Skills ecosystem. It handles module generation, LLM target adaptation, and code quality analysis.
Trigger: When working in build_modules/ directory — adding, modifying, or debugging module generation, adaptation, or analysis.
Quick Reference
| Task | Pattern |
|---|---|
| Run eval scenarios | python -m eval.harness run_all |
| Adapt skills for LLM targets | adapt_for_cursor/Codex/Gemini/Copilot |
| Detect dead code | detect_dead_code() |
Critical Patterns (Summary)
- Pattern 1: Module Generation: Use
make_fastapi_crud_module,make_nextjs_page_module,make_mixed_layer, ormake_go_service_modulefromeval/harness.pyto generate module skeletons in various frameworks. - Pattern 2: Skill Adaptation: Use
adapt_for_cursor,adapt_for_codex,adapt_for_gemini, oradapt_for_copilotfromrepoforge/adapters.pyto transform skill dictionaries for specific LLM targets.
When to Use
- Adding a new module generation function to
eval/harness.py - Adapting existing skills for a different LLM target platform
- Detecting dead code or analyzing module complexity
- Running eval scenarios against generated modules
Adding a New Module Generation Function
- Add a new function to
eval/harness.pyfollowing the patternmake_<framework>_module() -> tuple[dict, dict] - Export the function in
eval/harness.py__all__if present - Test with
run_scenariousing the new module config - Verify output with
print_report
Commands
python -m eval.harness run_all
python -m eval.harness run_scenario <scenario_name>
adapt_for_cursor <skills_json>
adapt_for_copilot <skills_json>
detect_dead_code <ast_symbols_dict>
Anti-Patterns
Don't: Mix adaptation targets — using adapt_for_copilot skills with adapt_for_cursor expectations — each adapter formats skill dicts differently for its target LLM, causing integration failures.
# BAD: Mixing adaptation targets
skills = adapt_for_cursor(skills_dict)
# Later using skills with Cursor — works
# But passing these same skills to adapt_for_codex will produce
# incorrectly formatted output for Codex's expectations.
<!-- L3:END -->