agentleFS
dafaalzdafaalz/agent-skills/skills/s13n/SKILL.md

s13n

Skill2 starsChanged 2 months agoMITView on GitHub

Use when standardizing inconsistent code patterns across a repository, resolving architectural divergence, or installing linter guards. Don't use for deep module redesign or single-file refactoring.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Never silently select a canonical variant without verified repository evidence or user authorization.

    line 13
  2. Very specific:

    If the repository is mid-migration (indicated by TODO(migrate) comments or dual implementations), clarify migration intent before touching …

    line 62
  3. Distinctive:

    When code patterns conflict and rank 1 or 2 does not specify a rule, present options to the user:

    line 84
  4. Distinctive:

    Update every caller site across the codebase.

    line 112
  5. Distinctive:

    Update associated test cases and documentation.

    line 113
  6. Very specific:

    Add an automated linter guard (such as no-restricted-imports in ESLint or banned-api in Ruff) to prevent regressions.

    line 114
  7. Very specific:

    Never touch generated files, lockfiles, or external vendor dependencies (vendor/, node_modules/, dist/).

    line 116
  8. Distinctive:

    Test suite passes completely.

    line 124

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Standardization (s13n)

Normalize diverging patterns across a repository into a single canonical architecture protected by automated linter guards.

Governing principle

Never silently select a canonical variant without verified repository evidence or user authorization. The majority pattern is evidence, not authority. A minority pattern may represent an active architectural migration. Normalizing to the majority without checking destroys intentional migrations.

Precedence hierarchy

Resolve convention questions against this hierarchy, evaluated highest to lowest:

RankSourceAuthorityAction
1Repository convention documents (AGENTS.md, CLAUDE.md, CODEBASE.md)AbsoluteApply documented standard. Never ask user to vote against their own docs
2Enforced tooling configuration (.editorconfig, eslint.config.js, ruff.toml)AbsoluteApply configured rules directly
3Dominant unambiguous pattern in code (such as 47 out of 48 files)TentativeRecommend majority but check git history for intentional migrations
4User confirmationAuthoritativeAsk via structured choice when patterns conflict
5Per-language standards in references/std-*.mdAdvisoryBaseline default when the repository lacks conventions

Reference modules

Load relevant reference files on demand based on repository language and scope:

ConcernReference File
Divergence taxonomy and probesreferences/divergence-taxonomy.md
Architecture and file layoutreferences/std-structure.md
TypeScript and JavaScriptreferences/std-ts.md, references/std-js.md
Pythonreferences/std-python.md
Goreferences/std-go.md
PHPreferences/std-php.md
Rustreferences/std-rust.md
Java and C#references/std-java.md, references/std-csharp.md
SQL, Shell, HTML, CSSreferences/std-sql.md, references/std-shell.md, references/std-html.md, references/std-css.md
Configuration, Docs, Gitreferences/std-yaml-json.md, references/std-docs.md, references/std-git.md

Workflow

Phase 1. Reconnaissance

Inspect existing repository conventions and tool configurations before modifying code:

ls -la AGENTS.md CLAUDE.md CODEBASE.md CONTRIBUTING.md .editorconfig 2>/dev/null
ls -la .eslintrc* eslint.config* .prettierrc* ruff.toml pyproject.toml .golangci.yml 2>/dev/null

Determine primary languages and file distributions:

find . -type f -not -path './.git/*' -not -path '*/node_modules/*' -not -path '*/vendor/*' \
  | sed 's/.*\.//' | sort | uniq -c | sort -rn | head -15

If the repository is mid-migration (indicated by TODO(migrate) comments or dual implementations), clarify migration intent before touching files.

Completion criterion. An inventory of repository convention files, active formatters, and language distribution counts.

Phase 2. Detect divergences

Probe codebase concerns systematically. Consult references/divergence-taxonomy.md for full taxonomy:

grep -rn --exclude-dir={node_modules,.git,dist,build,vendor} -E "require\(|from ['\"]|import .* from" . | head -30
grep -rn --exclude-dir={node_modules,.git,dist,build,vendor} -E "\.then\(|await |async function" . | head -30
grep -rn --exclude-dir={node_modules,.git,dist,build,vendor} -E "throw new|raise |return Err|panic\(" . | head -30

Record each divergence with exact file counts and sample locations. Check git history for recent changes in minority variants to distinguish intentional modernizations from accidental deviations.

Completion criterion. A catalog of identified divergences mapping file counts and sample snippets to each variant.

Phase 3. Resolve canonical variants

Resolve canonical patterns using the Precedence Hierarchy. When rank 1 and rank 2 answer the question, proceed directly to normalization.

When code patterns conflict and rank 1 or 2 does not specify a rule, present options to the user:

  • State the concern concisely in one line.
  • Present each variant with its file count and sample snippet.
  • Highlight the recommended variant with clear rationale.
  • Highlight counter-signals such as newer modules or recent commit ranges.
  • Cap questions to at most four major divergences per round.

Completion criterion. A confirmed canonical variant selected via convention documents, tool configs, or explicit user sign-off.

Phase 4. Normalize

Execute normalization in two distinct stages:

  1. Mechanical normalization. Run project formatters and linters first:
# JS/TS
npx prettier --write . && npx eslint . --fix

# Python
ruff format . && ruff check . --fix

# Go
gofmt -w . && goimports -w .
  1. Semantic normalization. Update call sites, imports, and error handling manually:
  • Replace losing variants with the canonical pattern.
  • Update every caller site across the codebase.
  • Update associated test cases and documentation.
  • Add an automated linter guard (such as no-restricted-imports in ESLint or banned-api in Ruff) to prevent regressions.

Never touch generated files, lockfiles, or external vendor dependencies (vendor/, node_modules/, dist/).

Completion criterion. All instances of the deprecated variant replaced across the codebase, with automated linter guards installed.

Phase 5. Verify

Confirm the codebase is healthy and consistent:

  • Project builds cleanly with zero errors.
  • Test suite passes completely.
  • Linter passes with new guard rules enabled.
  • Repository search for the eliminated variant returns zero matches outside documented exemptions:
grep -rn "disallowed-pattern" --exclude-dir={node_modules,.git,dist,build,vendor} . && echo "FAIL" || echo "CLEAN"

Completion criterion. Clean build exit code, passing test suite, and grep confirmation showing zero remaining deprecated occurrences.

Common mistakes

MistakeConsequenceCorrect Approach
Selecting majority pattern automaticallyDestroys ongoing architectural migrationsVerify git history and confirm with user when ambiguous
Asking questions answered by AGENTS.mdWastes user attention and invites documentation driftInspect convention documents first
Hand-editing formatting discrepanciesIntroduces typos and contradicts formatter rulesRun project formatter directly
Modifying definitions without updating callersBreaks builds and unit testsSearch repository for all caller references
Omitting automated linter guardDivergence returns in subsequent pull requestsAdd linter restriction rule to config
Normalizing third-party or generated directoriesEdits get overwritten on subsequent buildsExclude vendor and build output paths

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.