src/autoskillit/skills_extended/audit-arch/SKILL.md
Audit codebase for adherence to architectural standards, practices, and rules. Use when user says "audit arch", "audit architecture", "check architecture", or "architectural review". Spawns parallel subagents to examine multiple architectural aspects and generates a structured report.
npx skillsauth add talont-org/autoskillit audit-archInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit the codebase for adherence to architectural standards and rules.
NEVER:
run_in_background: true is prohibited)ALWAYS:
{{AUTOSKILLIT_TEMP}}/audit-arch/arch_audit_{YYYY-MM-DD_HHMMSS}.md (relative to the current working directory)Rule: All state reads must come from the authoritative source (database, API, configuration management). File outputs and caches are write-only. Systems never read files back as the primary source of state.
Audit Strategy - Data Flow Tracing:
Find all file read operations in core application code
For each read, trace the data flow:
Identify the PRIMARY source:
Check write/read symmetry:
Key Questions:
Critical: Apply this to ALL state loading code paths. Any component that restores or reconstructs system state must be examined. File-first with authoritative source sync afterward is still file-primary.
Cross-Reference: If you discover file-first patterns while auditing other principles, report them here as P1 violations, not just as inconsistencies.
Rule: Clear separation between domains with consistent structure.
Common patterns:
Audit Strategy:
Rule: Dependencies flow one direction. Higher layers depend on lower layers, never reverse.
Typical layering:
presentation/ -> depends on business logic, data access
business logic -> depends on data access, infrastructure
data access -> depends on infrastructure only
infrastructure -> depends on nothing project-specific
Also check internal layering: Within a domain, core modules should not import from higher-level modules (handlers, controllers, UI).
Audit Strategy:
Rule: Separate domains/modules must be independent. Feature A cannot import from Feature B directly.
Audit Strategy:
Rule: When using architectural patterns (MVC, repository pattern, state machines, etc.), implementations must follow consistent patterns across the codebase.
Audit Strategy:
Important: If a component bypasses the established pattern to use file-first state loading, that's a P1 violation - report it under P1, not here.
Rule: Shared functionality exists in exactly one location.
Audit Strategy:
Migration Awareness: During migration, shims are acceptable only if they re-export from new location. Full duplicate implementations are violations.
Rule: All data access through designated abstraction layer (repositories, DAOs, services), never direct client usage in business logic.
Audit Strategy:
Rule: No file should exceed 1000 lines. Large files should be decomposed.
Audit Strategy:
Rule: When constructing models/objects from dicts/external data, use factory methods or full validation. Never manually select fields in constructor calls.
Rationale: Manual field selection silently drops unlisted fields. Optional fields are especially vulnerable since missing them causes no validation error.
Audit Strategy:
Model(field1=dict["x"], field2=dict.get("y")) patternsSeverity: HIGH - silent data loss breaks downstream consumers
Rule: Classes extending external framework base classes must implement ALL interface methods explicitly. Avoid mixin patterns where method resolution order affects behavior.
Audit Strategy:
NotImplementedError stubs)Severity: CRITICAL - Interface mismatches only surface at runtime in specific code paths
Rule: Direct dependencies should track current major versions. Minor/patch drift is acceptable; lagging a major version is not.
Audit Strategy:
Severity: MEDIUM - stale major versions accumulate migration debt and miss security fixes
These apply across all principles when evaluating architectural decisions:
Implicit correction masks upstream failures — Reject invalid input rather than fixing it. Examples: silent type conversion, default values for required fields, translation layers that never reject, retry loops that swallow errors.
Functions that accept all inputs without rejection are fallbacks, not validators — If a "validator" or "normalizer" never raises an error, it's hiding problems.
System-derived values belong in code, not external input — Values determined by workflow state (status, IDs, counts) should be set by the system that owns them, not expected from external sources.
No backward compatibility — Flag any code containing these keywords as violations: legacy, deprecated, backward, compat, migration shim, old format, previous version, for compatibility. Dead code should be deleted, not preserved with comments explaining why it exists.
Pre-Flight Verification Checklist — Before reporting any finding, complete the mandatory verification for its category. A finding MUST NOT be reported unless the required verification has been performed.
| Finding category | Required verification before reporting |
|---|---|
| Missing export (symbol absent from public API) | Use the Read tool to open the relevant __init__.py. Verify both __all__ contents and direct re-export statements. Discard the finding if the symbol is present. |
| Missing decorator (e.g., runtime_checkable) | Use the Read tool to open the file containing the class definition. Inspect the 3–5 lines directly preceding the class keyword. Discard the finding if the decorator is present. |
| Enforcement gap (no test for a rule or constant) | Use the Grep tool to search tests/ for the exact symbol or constant name. Discard the finding if a matching test file is found. |
| Code duplication | Use the Read tool to retrieve the full body of each function. Compare the full signature (parameters, return type) and logic step-by-step. Same-named functions at different abstraction levels are NOT duplicates. Discard if logically distinct. |
| Misplaced file or incorrect import path | Use the Bash tool to run git log --oneline -- {file_path} (substituting the actual path). Inspect commit messages for intentional placement decisions. Discard the finding if a commit explains the placement. |
Launch parallel subagents for each principle
Consolidate findings by principle and severity
Cross-reference: Ensure findings are categorized by the principle they violate, not just where discovered
Suggest new principle (optional) - see below
Self-Validation Pass — Before finalizing findings, spot-check a sample of factual claims against the actual codebase. Perform all four checks:
a. HIGH/CRITICAL re-read: For every HIGH or CRITICAL finding, use the Read tool to re-open the exact file and line range cited. Confirm the code exhibits the claimed behavior. Downgrade or remove the finding if the evidence does not hold.
b. Concrete-class check (resource-leak and data-loss findings): For any
finding about a missing aclose, unclosed resource, or silent data loss, read
the concrete class body — not only the Protocol or interface declaration. If the
concrete implementation provides the method or handles the data correctly,
remove or revise the finding to reflect the accurate scope.
c. Enforcement-search confirmation (enforcement-gap findings): For any finding
claiming no test enforces a rule or constant, confirm that a Grep search of
tests/ for the exact symbol was performed during this audit. If it was not,
run it now; discard the finding if a matching test exists.
d. Internal validation note: After completing (a)–(c), record a one-sentence
note for each reviewed finding: either CONFIRMED – <original claim stands> or
REVISED – <corrected claim or reason for removal>. These notes are for
internal quality control and do not appear in the final report.
Write report to {{AUTOSKILLIT_TEMP}}/audit-arch/arch_audit_{YYYY-MM-DD_HHMMSS}.md (relative to the current working directory)
Output summary to terminal
After consolidating findings, consider whether a new architectural principle would significantly benefit the codebase.
Criteria - ALL must be true:
If criteria met: Add "Suggested Principle" section to report with:
If criteria NOT met: Omit section entirely. Do not suggest principles just to have a suggestion.
Do NOT flag:
CRITICAL:
HIGH:
MEDIUM:
LOW:
development
Generate YAML recipes for .autoskillit/recipes/. Use when user says "make script skill", "generate script", "script a workflow", "write a script", "create a script", "new recipe", "write a pipeline", or when loaded by other skills for script formatting.
data-ai
Create Uncertainty Representation visualization planning spec showing error bar definitions, distribution-aware alternatives, and multi-seed variance protocols. Statistical lens answering "How is uncertainty honestly represented?"
data-ai
Create Temporal Dynamics visualization planning spec showing axis scaling (linear vs log), smoothing disclosure, epoch/step alignment, run aggregation (mean + variance bands), early-stopping markers, and wall-clock vs step-count x-axis. Temporal lens answering "Are training dynamics shown clearly and honestly?"
data-ai
Create Narrative Story Arc visualization planning spec showing visual consistency across the report (same color = same model everywhere), logical figure progression, redundant figure detection, and narrative dependency between figures. Narrative lens answering "Do the figures tell a coherent story across the report?"