Agent skill

Inherit Legacy Style

by affaan-m in affaan-m/ECC

Prevent AI style drift on legacy projects by scanning the codebase for implicit conventions, resolving conflicts with the operator one at a time, and writing an enforceable .ai-style-rules.md…

MITAuto-check: notesAgent Workflows

Install Inherit Legacy Style

skills CLI
$ npx skills add affaan-m/ECC --skill inherit-legacy-style -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install affaan-m/ECC inherit-legacy-style --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/affaan-m/ECC.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/inherit-legacy-style .claude/skills/inherit-legacy-style && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
inherit-legacy-style
GitHub stars
277k
Used in
1 other repo
Token cost
~2.1k tokens
SKILL.md length
1,008 words
Files
1
Skills in repo
683
Repo updated
First seen
Licence
MIT

At a glance

Prevent AI style drift on legacy projects by scanning the codebase for implicit conventions, resolving conflicts with the operator one at a time, and writing an enforceable .ai-style-rules.md…

  • Works in 4 steps: File Anatomy — in-file declaration order… → State & Control Flow — naming… → Infrastructure — where cross-cutting… → …
  • Onboarding an AI agent onto a hand-written legacy codebase
  • SKILL.md covers When to Activate, When to Use, Prerequisites and Workflow, plus 6 more sections
  • Calls git, tsx and go

What it does

Inherit Legacy Style is an agent skill from affaan-m/ECC. Prevent AI style drift on legacy projects by scanning the codebase for implicit conventions, resolving conflicts with the operator one at a time, and writing an enforceable .ai-style-rules.md (Golden Files, naming rules, DONTs) plus an optional CLAUDE.md hook. Use when onboarding an AI agent onto a hand-written legacy codebase or extracting a project's unwritten coding rules.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Plain language and style rules and Agent instruction files. The repository describes itself as: The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond. The licence is MIT.

When your agent uses it

  • Onboarding an AI agent onto a hand-written legacy codebase
  • Extracting a projects unwritten coding rules

Example prompts

  • “/inherit-legacy-style”

Requirements

  • Pre-approved tools (allowed-tools): Read, Glob, Grep, Bash, Edit, Write, AskUserQuestion

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. File Anatomy — in-file declaration order (imports → types → main logic → helpers → export)
  2. State & Control Flow — naming conventions for async state, pagination, flags
  3. Infrastructure — where cross-cutting utils live (interceptors, formatters, middleware)
  4. Error Handling — try/catch vs global interceptor vs Result return; null-check habits

What it can do on your machine

Read from SKILL.md and the folder at commit 2d515e4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Glob
    • Grep
    • Bash
    • Edit
    • Write
    • AskUserQuestion

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • tsx
    • go
    • java
    • php
    • swift

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Inherit Legacy Style loads about 2.1k tokens when it runs. Until then it costs about 100 tokens; SKILL.md has 1,008 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~100
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Glob, Grep, Bash, Edit, Write, AskUserQuestion

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from affaan-m/ECC at commit 2d515e4, republished under its MIT licence (© affaan-m). 1,008 words, ~2,079 tokens.

Download SKILL.mdSave it as .claude/skills/inherit-legacy-style/SKILL.md (or your agent's skills folder).
name
inherit-legacy-style
description
Prevent AI style drift on legacy projects by scanning the codebase for implicit conventions, resolving conflicts with the operator one at a time, and writing an enforceable .ai-style-rules.md (Golden Files, naming rules, DONTs) plus an optional CLAUDE.md hook. Use when onboarding an AI agent onto a hand-written legacy codebase or extracting a project's unwritten coding rules.
allowed-tools
Read, Glob, Grep, Bash, Edit, Write, AskUserQuestion
metadata.origin
community

Inherit Legacy Style

Prevents AI code style drift in legacy projects by scanning the codebase for implicit conventions across 4 meta-architecture dimensions, resolving conflicts with the user one at a time, and crystallizing the consensus into an enforceable .ai-style-rules.md. Fully language- and framework-agnostic.

When to Activate

  • User types /inherit-legacy-style
  • User mentions onboarding AI onto a hand-written legacy project
  • User is worried about AI-generated code "drifting" from existing project conventions
  • User wants to extract and codify their project's implicit coding rules

When to Use

Use this skill when you need to preserve legacy project style and prevent AI-generated style drift. See When to Activate above for trigger conditions.

Prerequisites

  • Git (recommended; non-Git projects fall back to file timestamps for incremental mode)
  • Read/Write access to the project root (generates .ai-style-rules.md and optionally CLAUDE.md)

Workflow

Step 0 — Auto-Detect Mode

Silently check for .ai-style-rules.md at the project root:

File exists?Mode
NoBranch A — First-time Full-Scan
YesBranch B — Incremental Sniff

Announce the mode in one line and proceed — never ask the user to pick.

Branch A — First-time Full-Scan

1. Measure scale, pick a scanning tier

bash
git ls-files | grep -cE '\.(js|ts|jsx|tsx|vue|py|go|rs|java|kt|rb|php|cs|swift|c|cpp|h)$'
TierSource filesStrategy
Small≲ 50Full close-read every source
Medium50–500Infra layer = full read; business layer = sample 2–3 per dimension
Large≳ 500Strict sampling + budget cap; --stat summary first, then targeted reads

2. Scan along 4 dimensions

  1. File Anatomy — in-file declaration order (imports → types → main logic → helpers → export)
  2. State & Control Flow — naming conventions for async state, pagination, flags
  3. Infrastructure — where cross-cutting utils live (interceptors, formatters, middleware)
  4. Error Handling — try/catch vs global interceptor vs Result return; null-check habits

3. Apply signal-threshold noise reduction

Before interrupting the user, evaluate signal strength:

  • Weak signal → auto-suppress: minority <5% AND count <10 → majority wins, minority goes to DONTs
  • Strong signal → grill: near-even split, or semantic fork on a core dimension
  • Small-project exception: sources ≲50, "3 vs 2" is NOT a majority → grill it

4. Resolve conflicts one at a time (Grilling Protocol)

For each strong-signal conflict, present exactly ONE question with 4 options:

Evidence: pathA uses style X, pathB uses style Y WARNING: Risk: mixing both fractures the project style Choose: 1 follow X 2 follow Y 3 this is evolution, update rules 4 I have a new rule

Suspend until the user answers, then proceed to the next conflict. Never stack questions.

5. Generate .ai-style-rules.md with three mandatory sections:

  • [Golden Files] — real exemplar paths annotated with what they demonstrate
  • [Naming & State-Control Rules] — concrete, checkable conventions
  • [DONTs] — anti-patterns that must not propagate

6. Install the persistent hook

Ask the user for enforcement strength (use AskUserQuestion):

OptionMechanism
1 Soft hook (recommended)Write @.ai-style-rules.md reference into project CLAUDE.md
2 Hard hookSoft hook + PreToolUse[Write|Edit|MultiEdit] Hook in settings.json
3 No hookKeep the rules file; user references manually
Branch B — Incremental Sniff
  1. Read existing .ai-style-rules.md; if it has a commit fingerprint, git diff <last_hash> HEAD --stat to pinpoint delta
  2. Read recent Git changes (git log -3 --stat → inspect suspect files on demand)
  3. For oversized diffs (>hundreds of files): --stat summary only + sample the largest changes
  4. Compare new code against recorded rules → conflicts go through Grilling Protocol
  5. Append evolution log at the end of .ai-style-rules.md (never overwrite old rules)
Per-Turn Enforcement

When .ai-style-rules.md is in context (loaded via CLAUDE.md), every code-writing task must open with a compliance declaration in the reasoning chain, naming the exemplar being followed and the DONTs being avoided.

Show full SKILL.md (441 more words)Show less

How It Works

This skill auto-detects whether it's a first-time or incremental run via .ai-style-rules.md presence:

  • First-time (Branch A) — Measures project scale, scans codebase across 4 meta-architecture dimensions (File Anatomy, State & Control Flow, Infrastructure, Error Handling), applies signal-threshold noise reduction to suppress weak conflicts, resolves strong-signal conflicts one-at-a-time with the user, generates .ai-style-rules.md with Golden Files / Naming Rules / DONTs, and offers optional enforcement hooks.
  • Incremental (Branch B) — Reads existing rules, checks recent Git diffs for new or conflicting patterns, runs the same one-at-a-time grilling protocol for any conflicts found, and appends evolution logs without overwriting existing rules.
  • Per-Turn Enforcement — When hooked via CLAUDE.md, every code-writing task opens with a compliance declaration naming the exemplar followed and the DONTs avoided.

Output Specification

  • .ai-style-rules.md at project root (with commit fingerprint + scale tier in header)
  • Optionally CLAUDE.md with @.ai-style-rules.md reference
  • Evolution logs appended as ### [YYYY-MM-DD] Style Evolution Log entries

Anti-Patterns

  • FAIL: Do NOT skip the scale measurement step — sampling a 30-file project "starves" it; full-scanning a 5,000-file repo blows up
  • FAIL: Do NOT stack multiple conflict questions at once — grilling is strictly one-at-a-time
  • FAIL: Do NOT overwrite old rules in incremental mode — always append evolution logs
  • FAIL: Do NOT default to "hard hook" without asking — enforcement strength is the user's call
  • FAIL: Do NOT judge syntax or tech-stack quality — this skill aligns meta-architecture only
  • FAIL: Do NOT copy bugs from exemplar files — reuse structure, flag defects

Best Practices

  • Announce the detected mode (first-time vs incremental) and scale tier in one line before scanning
  • For large projects, read --stat summaries first, then targeted Read on suspect files
  • Let the signal threshold handle noise — a 843-vs-8 naming split should auto-resolve without user interruption
  • When in doubt about signal strength, lean toward asking
  • The CLAUDE.md soft hook (@.ai-style-rules.md) is usually sufficient; hard hook only if the user wants mechanical enforcement
  • init — initialize a new CLAUDE.md with codebase documentation
  • code-review — review diffs for correctness and style issues
  • simplify — review code for reuse and simplification opportunities

Examples

  1. First-time onboarding

    • User: "Help me onboard AI to this older codebase without changing its style."
    • Action: Run Branch A full-scan → measure scale → scan 4 dimensions → grill conflicts → generate .ai-style-rules.md → offer hook strength (soft/hard/none).
  2. Incremental update after team changes

    • User: "We added a new module; keep existing style rules intact."
    • Action: Run Branch B incremental sniff → compare Git deltas to recorded rules → grill any new conflicts → append evolution log without overwriting.
  3. Enforcing DONTs via CLAUDE.md

    • User: "Make sure all new code stays consistent with the project's rules."
    • Action: Soft hook installed → .ai-style-rules.md auto-loaded every session → every code-writing task opens with compliance declaration, reusing exemplar patterns and avoiding DONTs.

© affaan-m, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/inherit-legacy-style of affaan-m/ECC.

Open the folder on GitHubat commit 2d515e4

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in affaan-m/ECC, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Inherit Legacy Style next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Inherit Legacy Style compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Inherit Legacy Style this skillaffaan-m/ECC277k1 repos~2.1kAutomated safety check: NotesMIT
Audit Session Metricscentminmod/my-claude-code-setup2.7k—~2.1kAutomated safety check: PassMIT
Ponylang Prose Reviewponylang/ponylang-website160—~2.9kAutomated safety check: PassBSD-2-Clause
Talk Normalhexiecs/talk-normal1.9k—~784Automated safety check: PassMIT
Asd Ste100danyuchn/asd-ste100-skill4.3k—~4.1kAutomated safety check: PassMIT
Firstmate Coding Guidelineskunchenguid/firstmate7.8k—~3.1kAutomated safety check: PassMIT

Similar skills

  • Audit Session Metrics

    centminmod/my-claude-code-setup

    Audit a session-metrics JSON export for token-usage waste and produce a plain-English findings report.

    2.7k GitHub stars~2.1k tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed
  • Ponylang Prose Review

    ponylang/ponylang-website

    Ensemble review of ponylang blog and Last Week in Pony prose.

    160 GitHub stars~2.9k tokensUpdated 7 days ago
    Agent WorkflowsAuto-check passed
  • Talk Normal

    hexiecs/talk-normal

    Installs an always-on set of rules into your agent's workspace config that cuts filler, hedging and padded closings from its replies.

    1.9k GitHub stars~784 tokensUpdated 5 mo ago
    Agent WorkflowsAuto-check passed
  • Asd Ste100

    danyuchn/asd-ste100-skill

    A skill your agent uses when English text must be parsed without a human to resolve ambiguity — tool descriptions, error messages, inter-agent instructions, system prompts, status reports — and…

    4.3k GitHub stars~4.1k tokensUpdated 7 days ago
    Writing & ContentAuto-check passed
  • Firstmate Coding Guidelines

    kunchenguid/firstmate

    Agent-only reference for changing firstmate's shared, tracked material per AGENTS.md section 1.

    7.8k GitHub stars~3.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Rules To Guards

    RyanAlberts/best-of-Agent-Harnesses

    Rule enforcer that finds which written rules in AGENTS.md, CLAUDE.md, and GEMINI.md a coding agent keeps breaking, counts every violation in recent Claude Code, Codex, Gemini CLI, and OpenCode…

    1.1k GitHub stars~2.7k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check: notes

More from affaan-m/ECC

All 682 skills in this repo
  • Skill Stocktake

    affaan-m/ECC

    Audits your installed Claude skills and commands for quality, with a quick mode for recently changed skills and a full mode that evaluates all of them through subagents.

    277k GitHub starsUsed in 5 repos~3.1k tokens
    Auto-check passed
  • Ingests, indexes, searches, edits and monitors video, audio and live streams through the VideoDB Python SDK, returning stream links, clips and timestamps.

    277k GitHub starsUsed in 3 repos~3.5k tokens
    Auto-check: notes
  • Docs Governance

    affaan-m/ECC

    Route broad documentation-governance requests to existing ECC skills and run an opt-in, read-only audit of mapped documentation roles, links, ADR indexes, and evidence references.

    277k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Rules Distillation

    affaan-m/ECC

    Scans installed skills for principles that recur across them and proposes rule-file changes: append, revise, add a section, create a file or leave as covered.

    277k GitHub starsUsed in 2 repos~2.3k tokens
    Auto-check passed
  • Builds DRAFT counterparty agreements from one markdown template and a small JSON spec per party, with clauses picked by the party's role.

    277k GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Set an ECC-specific frontend design direction for production UI work.

    277k GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed

Questions about Inherit Legacy Style

What does Inherit Legacy Style do?

Prevent AI style drift on legacy projects by scanning the codebase for implicit conventions, resolving conflicts with the operator one at a time, and writing an enforceable .ai-style-rules.md…. Inherit Legacy Style is an agent skill from affaan-m/ECC.md hook.

When should I use Inherit Legacy Style?

Inherit Legacy Style fits situations like: onboarding an AI agent onto a hand-written legacy codebase; extracting a projects unwritten coding rules.

How do I install Inherit Legacy Style in Claude Code?

Run `npx skills add affaan-m/ECC --skill inherit-legacy-style -a claude-code`. Or copy the skill folder (skills/inherit-legacy-style in affaan-m/ECC) into .claude/skills/inherit-legacy-style in your project. Claude Code loads it when a task matches its description.

How do I install Inherit Legacy Style in Codex?

Run `npx skills add affaan-m/ECC --skill inherit-legacy-style -a codex`. Or copy the skill folder (skills/inherit-legacy-style in affaan-m/ECC) into .agents/skills/inherit-legacy-style in your project. Codex loads it when a task matches its description.

Can I use Inherit Legacy Style in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add affaan-m/ECC --skill inherit-legacy-style -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/inherit-legacy-style, .gemini/skills/inherit-legacy-style, .github/skills/inherit-legacy-style and .opencode/skills/inherit-legacy-style in your project.

What does Inherit Legacy Style need to run?

Going by SKILL.md and its folder, Inherit Legacy Style needs the command-line tools its instructions call (git, tsx, go, java, php and swift). Its frontmatter pre-approves these tools: Read, Glob, Grep, Bash, Edit, Write, AskUserQuestion.

Does Inherit Legacy Style access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Inherit Legacy Style safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Inherit Legacy Style use?

Inherit Legacy Style is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Inherit Legacy Style use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Inherit Legacy Style?

Skills that share tags, products or a category with Inherit Legacy Style: Audit Session Metrics (centminmod/my-claude-code-setup, 2.7k stars), Ponylang Prose Review (ponylang/ponylang-website, 160 stars), Talk Normal (hexiecs/talk-normal, 1.9k stars) and Asd Ste100 (danyuchn/asd-ste100-skill, 4.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Inherit Legacy Style?

affaan-m (a GitHub user) maintains it in affaan-m/ECC, which has 276,673 GitHub stars. The repository holds 683 skills in this directory. The repository was last updated on October 11, 2026.

Source: affaan-m/ECC on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.