convention-writing

Analyzes codebases for recurring patterns and writes standardized convention specs.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/astroville/sprout --skill convention-writing-astroville
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convention-writing
Source: https://github.com/astroville/sprout/tree/main/.claude/skills/convention-writing
Command: npx skills add https://github.com/astroville/sprout --skill convention-writing-astroville

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams accumulate inconsistent ways of doing the same thing across a codebase, causing bugs, review friction, and slow onboarding. This Skill guides an agent to find patterns worth standardizing, gather real evidence from the code, and produce concrete convention specs. ## Core Features & Use Cases - Pattern triage: Applies frequency, inconsistency, impact, and onboarding-cost criteria to decide which patterns deserve a convention. - Evidence gathering: Searches the codebase with glob and grep to count conforming instances, find best examples, and identify worst violations. - Spec authoring: Produces convention specs in .hero/conventions/{slug}/spec.md with frontmatter, scope globs, pattern, examples, anti-patterns, and exceptions sections. - Use Case: A delivery lead notices three different error-handling styles across API routes and asks for a convention; the agent surveys the codebase, picks the cleanest implementation, and writes a scoped spec with real examples and anti-patterns. ## Quick Start Ask the agent to analyze the codebase for inconsistent error handling and write a convention spec documenting the standard approach.

Frequently Asked Questions about convention-writing

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

FAQPage Schema
How do I write a coding convention for my codebase?▼

First search the codebase for existing instances of the pattern using glob and grep, count conforming versus deviating files, and identify the best examples. Then write a spec with a one-sentence pattern statement, scope globs, real code examples, anti-patterns with consequences, and an exceptions section.

When is a code pattern worth standardizing as a convention?▼

A pattern is worth standardizing when it meets at least two of four criteria: it appears in 5+ files, the codebase shows 2+ inconsistent approaches, getting it wrong has real consequences, or new contributors consistently get it wrong. Skip patterns already enforced by linting or self-evident from the framework.

How do scope globs work in a convention spec?▼

Scope globs are an array of patterns in the spec frontmatter that determine which files the convention applies to, so tools like hero relevant can inject it into agent context. Start narrow with patterns like src/api/**/*.ts rather than broad ones like src/**.

Should I write one convention or split into multiple specs?▼

Write one convention per concern so each spec is independently understandable and scoped. Merge only when two drafts share the same scope, audience, and would always be read together.

What makes a convention spec ready for active status?▼

A convention is ready when the pattern is a single clear statement, scope globs are tested against intended files, examples reference real code, anti-patterns explain consequences, and it has been checked against existing conventions for overlap.