architecture-normalizer
Skill0 starsChanged 4 months agoMITView on GitHub
Decomposes large modules, god files, classes, or packages in reviewable steps while preserving public APIs. Not for routine refactors.
We split this skill into the rules it gives an agent
25 rules. About 0 are common, 15 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill as an architecture normalization engine, not as a general refactoring assistant.
- Very specific: line 16
Read references/policy-format.md before creating, editing, or applying architecture policies.
- Very specific: line 17
Read references/artifact-contract.md before generating, reviewing, or executing .architecture/ artifacts.
- Very specific: line 18
Read references/analysis-signals.md when scoring cohesion, coupling, entropy, god files/classes/packages, split candidates, or dependency …
- Very specific: line 19
Use scripts/repo_fingerprint.py <repo> --json for manifest repository hashes and execution preflight checks.
- Very specific: line 23
Do not modify source files during Analysis.
- Distinctive: line 24
Do not execute normalization without completed Analysis artifacts and explicit approval for the specific actions being executed.
- Distinctive: line 28
Keep output deterministic: sorted paths, stable action IDs, stable artifact filenames, and stable YAML/JSON ordering where feasible.
- Distinctive: line 29
Stop when the repository fingerprint differs from the manifest, artifacts conflict, a policy is missing or ambiguous, or validation cannot …
- Distinctive: line 30
Do not print or store secrets.
- Very specific: line 36
If no approved policy exists, resolve a conservative baseline policy from references/policy-format.md, write it under …
- Very specific: line 50
Use stable IDs such as MOVE-0001, SPLIT-0001, RENAME-0001, IMPORT-0001, EXPORT-0001, and COMPAT-0001.
- Very specific: line 53
Use generated_at: null unless a deterministic repository-derived timestamp is available, such as the HEAD commit timestamp.
- Very specific: line 71
If a graph format cannot be produced with available tooling, create the file with a deterministic placeholder graph containing the …
- Distinctive: line 77
Treat user edits to artifacts as authoritative unless they violate the non-negotiable contract.
- Distinctive: line 79
Treat missing, proposed, rejected, stale, or conflicting actions as not executable.
- Distinctive: line 80
If review changes introduce new decisions, return to Analysis and regenerate affected artifacts before execution.
- Distinctive: line 86
Before editing source files:
- Distinctive: line 91
Stop if the repository changed, unless the user explicitly asks to regenerate Analysis.
- Distinctive: line 95
Prefer git mv for file moves.
- Distinctive: line 98
Do not use wildcard exports.
- Distinctive: line 99
Delete obsolete files only when an approved delete action exists.
- Very specific: line 100
If a needed action is missing, stop and write .architecture/execution-blockers.yaml.
- Distinctive: line 108
Run the validation commands declared by policy and confirmed from repository configuration when available:
- Distinctive: line 114
import/public API validation
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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.
Files
Architecture Normalizer
Purpose
Use this skill as an architecture normalization engine, not as a general refactoring assistant. Its job is to move a repository toward deterministic, high-cohesion, low-coupling module hierarchy while preserving behavior and public APIs.
The central rule: every architectural decision must be produced as an explicit reviewable artifact before any source file is changed.
Required References
- Read
references/policy-format.mdbefore creating, editing, or applying architecture policies. - Read
references/artifact-contract.mdbefore generating, reviewing, or executing.architecture/artifacts. - Read
references/analysis-signals.mdwhen scoring cohesion, coupling, entropy, god files/classes/packages, split candidates, or dependency risk. - Use
scripts/repo_fingerprint.py <repo> --jsonfor manifest repository hashes and execution preflight checks.
Non-Negotiable Contract
- Do not modify source files during Analysis. Analysis may only create or update
.architecture/artifacts. - Do not execute normalization without completed Analysis artifacts and explicit approval for the specific actions being executed.
- During Execution, never invent moves, splits, renames, import updates, exports, compatibility layers, or deletes. Execute approved artifact actions only.
- Preserve public imports and exports whenever possible. Generate compatibility exports for moved public API paths.
- Load policies before analysis. Do not hardcode language thresholds, layout rules, public API rules, or allowed dependency rules into the plan.
- Keep output deterministic: sorted paths, stable action IDs, stable artifact filenames, and stable YAML/JSON ordering where feasible.
- Stop when the repository fingerprint differs from the manifest, artifacts conflict, a policy is missing or ambiguous, or validation cannot be run.
- Do not print or store secrets. Prefer structural evidence: imports, exported symbols, file names, non-secret config keys, tests, and public APIs.
Phase 0: Policy Loading
- Inspect repository structure and dependency/config files enough to identify languages and tooling.
- Load existing policies from
.architecture/policy.yamlor.architecture/policies/*.yamlwhen present. - If no approved policy exists, resolve a conservative baseline policy from
references/policy-format.md, write it under.architecture/policies/<language>.yamlwithstatus: proposed, and mark all execution actions unapproved. - Record the resolved policy files and versions in
.architecture/manifest.yaml.
Execution is forbidden when the relevant policy is only proposed, rejected, missing, or internally inconsistent.
Phase 1: Architecture Analysis
Analysis is read-only for repository source files. It must generate deterministic artifacts inside .architecture/.
Required analysis behavior:
- Compute the repository fingerprint with
scripts/repo_fingerprint.py. - Detect single-responsibility violations, multiple public types, god files, god classes, god packages, cyclic imports, dead code candidates, duplicate models/DTOs/enums/errors, forbidden generic names, large files/classes/functions, hidden public APIs, layer violations, dependency violations, feature envy, and architecture entropy.
- Generate explicit remediation artifacts for every proposed change.
- Use stable IDs such as
MOVE-0001,SPLIT-0001,RENAME-0001,IMPORT-0001,EXPORT-0001, andCOMPAT-0001. - Sort actions by normalized source path, action kind, then destination path.
- Include evidence and rationale for every action. Evidence should cite files, symbols, imports, exported APIs, tests, or dependency edges.
- Use
generated_at: nullunless a deterministic repository-derived timestamp is available, such as the HEAD commit timestamp.
Required artifact set:
.architecture/manifest.yaml.architecture/analysis.md.architecture/entropy.json.architecture/dependency-graph.graphml.architecture/package-layout.graphml.architecture/move-plan.yaml.architecture/split-plan.yaml.architecture/rename-plan.yaml.architecture/imports-plan.yaml.architecture/exports-plan.yaml.architecture/compatibility-plan.yaml.architecture/risk-report.yaml.architecture/validation-plan.yaml
If a graph format cannot be produced with available tooling, create the file with a deterministic placeholder graph containing the nodes/edges that were derived and record the tooling gap in risk-report.yaml.
Phase 2: Human Review
Artifacts are the review boundary.
- Treat user edits to artifacts as authoritative unless they violate the non-negotiable contract.
- Execute only actions with
status: approvedor with an explicit current user instruction approving the exact action set. - Treat missing, proposed, rejected, stale, or conflicting actions as not executable.
- If review changes introduce new decisions, return to Analysis and regenerate affected artifacts before execution.
Phase 3: Architecture Execution
Execution reads approved artifacts only. It must not perform fresh architectural analysis.
Before editing source files:
- Recompute the repository fingerprint.
- Compare it with
.architecture/manifest.yaml. - Inspect
git status --shortand avoid overwriting unrelated user changes. - Stop if the repository changed, unless the user explicitly asks to regenerate Analysis.
During execution:
- Prefer
git mvfor file moves. - Apply approved moves, splits, renames, import updates, public exports, and compatibility layers in dependency-safe order.
- Preserve public APIs through explicit exports: Python
__init__.py, TypeScript/JavaScriptindex.tsorindex.js, Rustpub use, Go exported symbols, C/C++ public headers. - Do not use wildcard exports.
- Delete obsolete files only when an approved delete action exists.
- If a needed action is missing, stop and write
.architecture/execution-blockers.yaml.
Execution must be idempotent. Running it twice against the same approved artifacts should produce no further source changes.
Phase 4: Validation
Validation is mandatory after execution.
Run the validation commands declared by policy and confirmed from repository configuration when available:
- formatter
- linter
- compiler or type checker
- unit and integration tests
- import/public API validation
- architecture layout validation
Record validation commands and results in .architecture/validation-results.yaml. Report failure exactly; do not claim success unless commands were run and passed.
Output Discipline
When reporting results:
- Separate Analysis, Review, Execution, and Validation status.
- List generated or changed artifacts.
- List source files changed only after Execution.
- Include exact validation commands and outcomes.
- State when execution was refused because approval, policy, fingerprint, or validation gates were not satisfied.
In this repository62 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibility-ui-reviewSkill
- agent-retrospectiveSkill
- agents-md-retrospectiveSkill
- agent-squadSkill
- architecture-mapSkill
- architecture-principlesSkill
- authz-boundary-reviewSkill
- c-cppSkill
- code-qualitySkill
- code-reviewSkill
- code-to-figmaSkill
- code-wiki-ruSkill
- context-packSkill
- core-engineeringSkill
- debuggingSkill
- dependency-advisory-auditSkill
- deserialization-parser-reviewSkill
- design-system-extractorSkill
- documentationSkill
- engineering-standardsSkill
- esp32Skill
- esphomeSkill
- external-agent-pack-auditSkill
- fastSkill
- figma-to-codeSkill
- fix-security-findingSkill
- goSkill
- homeassistantSkill
- mcp-tool-routerSkill
- migration-plannerSkill
- mobile-qaSkill
- multi-agent-pr-reviewSkill
- performanceSkill
- playwright-visual-qaSkill
- pythonSkill
- quality-gatesSkill
- refactoringSkill
- responsive-breakpoint-checkSkill
- review-routerSkill
- rustSkill
- secrets-and-config-reviewSkill
- security-diff-reviewSkill
- security-routerSkill
- securitySkill
- session-memorySkill
- specialist-dispatchSkill
- subagent-result-mergeSkill
- supply-chain-reviewSkill
- tdd-guardSkill
- testing-tddSkill
- threat-modelSkill
- typescriptSkill
- ui-buildSkill
- ui-business-appsSkill
- ui-concept-firstSkill
- ui-figmaSkill
- ui-qaSkill
- ui-researchSkill
- ui-routerSkill
- The first 60 shown.
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
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.

