translating-styleguides

Converts prose style guides into tested captain-hook enforcement rules.

13|Updated Jun 2, 2026
One-click install
npx skills add https://github.com/yasyf/captain-hook --skill translating-styleguides-yasyf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: translating-styleguides
Source: https://github.com/yasyf/captain-hook/tree/main/captain_hook/skills/translating-styleguides
Command: npx skills add https://github.com/yasyf/captain-hook --skill translating-styleguides-yasyf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Prose style guides (STYLEGUIDE.md, CONTRIBUTING.md, CLAUDE.md conventions) describe coding conventions but nothing enforces them, so agents and developers keep violating the same rules. This Skill turns each guide statement into an enforced captain-hook rule with inline tests. ## Core Features & Use Cases - Rule atomization and tier classification: Splits guide prose into candidate rules and classifies each as Tier 1 (declarative AST matcher), Tier 2 (custom check() logic), Tier 3 (LLM gate/nudge), or Tier 4 (unenforceable, reported with a reason). - Hook generation with inline tests: Writes .claude/hooks/style.py for deterministic rules and .claude/hooks/style_llm.py for semantic rules, synthesizing firing and allowing test inputs from the guide's own good/bad examples. - Verified enforcement report: Runs uvx --isolated capt-hook test until green and produces a per-rule report covering every guide statement, including rules that cannot be enforced. - Use Case: Point it at a repo's STYLEGUIDE.md and get working hooks that warn on broad except clauses, mutable default arguments, and nested imports, plus an LLM nudge for scope drift. ## Quick Start Ask the agent to enforce the style guide at STYLEGUIDE.md by turning it into captain-hook rules and verifying them with capt-hook test.

Frequently Asked Questions about translating-styleguides

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I turn a STYLEGUIDE.md into enforced coding rules?

Run this Skill with the path to your style guide, or let it auto-detect STYLEGUIDE.md, CONTRIBUTING.md, or CLAUDE.md. It atomizes the prose into rules, classifies each by enforcement tier, and writes tested hook files under .claude/hooks/.

How are style guide rules classified for enforcement?

Each rule lands in one of four tiers: Tier 1 rules are single-node AST predicates written as declarative matchers, Tier 2 rules need custom check() logic for cross-node analysis, Tier 3 rules require LLM judgment of intent or naming, and Tier 4 rules are unenforceable and reported with a reason.

Does this work for non-Python style guides?

AST-based Tier 1 and Tier 2 rules parse Python only. For other languages the Skill degrades to regex-based Content rules or Tier 3 LLM hooks, and notes the degradation in the enforcement report.

How are the generated hook rules tested?

Every Tier 1 and Tier 2 rule carries inline tests with at least one firing and one allowing input, synthesized from the guide's good and bad examples. The Skill runs uvx --isolated capt-hook test and iterates until all tests pass before reporting.

When are LLM hooks used instead of deterministic rules?

LLM hooks handle rules requiring judgment of intent, scope, or naming quality that no deterministic predicate can express. They ship with cost controls like only_if narrowing, max_fires limits, and the small model default, and use llm_nudge, llm_gate, or prompt_check depending on the rule shape.

What happens to style rules that cannot be enforced?

Unenforceable rules, such as project-wide consistency or PR process requirements, are classified as Tier 4 and included in the final enforcement report with a one-line reason. They are never silently dropped.