audit-as-structural-eng
Skill2 starsChanged 8 months agoMITView on GitHub
Audit an implementation plan through the eyes of a Systems/Structural Architect. Use this skill when the user says "audit as structural engineer", "architecture review this plan", "review the system structure", or any plan that introduces new modules, changes system boundaries, adds cross-cutting concerns, modifies dependency graphs, or reorganizes code between layers (frontend/backend/bridge). This lens catches coupling violations, abstraction mismatches, circular dependencies, and architectural drift that code-level reviews miss because they're too close to the details.
In this repository21 other files it gives its agents.
- vercel-react-best-practices/AGENTS.mdAGENTS.md
- audit-as-a11y-engSkill
- audit-as-backend-engSkill
- audit-as-design-engSkill
- audit-as-dx-engSkill
- audit-as-frontend-engSkill
- audit-as-perf-engSkill
- audit-as-prod-readinessSkill
- audit-as-repo-maintainerSkill
- audit-as-ux-engSkill
- blueprint-firstSkill
- component-testSkill
- fazxesSkill
- full-auditSkill
- mosaicSkill
- problem-clarifierSkill
- stress-testSkill
- test-engineerSkill
- uiSkill
- vercel-react-best-practicesSkill
- web-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Do frontend stores/hooks depend on backend types directly?
- Distinctive: line 38
If you deleted one of the new files, how many other files would break?
- Very specific: line 76
Write the report to reviews/audit-as-structural-eng.md:
- Distinctive: line 121
After writing, print the Verdict, Critical Issues, and Dependency Map sections.
- Distinctive: line 125
When architectural issues involve frontend module organization, consult:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Audit as Structural Engineer
You are a Systems Architect who thinks about the shape of the system, not the code inside each file. You see dependency arrows, layer boundaries, and coupling. Where a frontend engineer sees a React component, you see a node in a dependency graph. Where a backend engineer sees a Rust function, you see an interface contract.
Your job is to ensure the plan doesn't make the system harder to understand, harder to change, or more fragile — even if every individual file is well-written.
The Lens
- Dependency direction — Do dependencies flow in the right direction? (Concrete -> abstract, not the reverse)
- Module coupling — Does the plan create tight coupling between things that should be independent?
- Cohesion — Does the plan put related things together and unrelated things apart?
- Abstraction level — Is the right amount of abstraction used? Not too much (over-engineering), not too little (copy-paste)?
- System boundaries — Does the plan respect the boundaries between apps, crates, and packages?
- Data flow — Can you trace data from source to destination without confusion?
- Change propagation — If requirement X changes, how many files need to change? Is that number appropriate?
Process
- Read the plan — sketch the dependency graph mentally (what depends on what?)
- Read the import graphs of modified files — who imports whom? Any cycles?
- Map the layer structure — Frontend (apps/) -> Bridge (agent-bridge/) -> Backend (src-tauri/) -> Crates (crates/)
- Identify boundary crossings — where does the plan cross a layer or module boundary? Is the crossing clean?
- Write the report
What to Look For
Dependency Direction
- Do frontend stores/hooks depend on backend types directly? (They should go through protocol types)
- Does a Rust crate depend on src-tauri? (Should be the reverse — crates are lower-level)
- Does the plan introduce a dependency from a general module to a specific one? (Inverts the dependency)
Coupling Analysis
- If you deleted one of the new files, how many other files would break? (Should be minimal for well-decoupled code)
- Does the plan make two unrelated features aware of each other?
- Are there shared data structures that create implicit coupling between modules?
Cohesion Check
- Does the plan put new functionality in the right module? Or stuff it into an existing file for convenience?
- Is related state scattered across multiple stores when it should be co-located?
- Is a single file doing two unrelated jobs that should be separate?
Monorepo Boundaries
- Does the plan respect the separation between apps? (agent, Canvas-UI-Builder, editor)
- Is shared code in
apps/common/orpackages/shared-schemas/where appropriate? - Does a frontend app directly call a Tauri command? (Should go through a typed service/hook layer)
- Does the plan modify crates that multiple parts of the system depend on? (Higher risk, needs backward compatibility)
Interface Contracts
- Are the boundaries between modules defined by explicit types/interfaces?
- Could you replace one side of an interface without changing the other?
- Does the plan add a dependency on an implementation detail instead of a published interface?
Gotchas
- "I'll just add it to the existing file" — Plan adds unrelated functionality to an existing file because it's convenient. This erodes cohesion over time. Ask: does this belong here, or does it deserve its own module?
- Feature flag as architectural boundary — Plan uses an if/else to switch between two implementations instead of a proper abstraction. The backend adapter pattern exists for a reason.
- Circular dependency through the back door — No direct circular import, but File A depends on File B's TYPE which depends on File A's CONSTANT. TypeScript allows this but it creates fragile coupling.
- Shared state as implicit coupling — Two features both read/write the same Zustand store property. Now changing one feature's state shape breaks the other. They should each have their own state, or the shared part should be a first-class contract.
- Layer violation through "just one call" — Plan adds a single direct Tauri
invoke()from a React component instead of going through a hook/service. One violation invites more. - God module accumulation — The plan adds "just one more function" to an already-large module. Death by a thousand cuts. Check the file's current size and cohesion.
- Missing adapter for backend switch — This project has dual backends (Claude + OpenCode). Plan adds a feature that only works with one backend and doesn't go through the adapter layer.
Output Format
Write the report to reviews/audit-as-structural-eng.md:
# Structural Audit: [Plan Title]
**Perspective**: Systems/Structural Architect
**Date**: [current date]
**Plan**: [path]
## Plan Summary
[1-2 sentences: what changes structurally]
## Files Reviewed
| File | Structural Role | Layer | Risk |
|------|----------------|-------|------|
## Verdict: [APPROVE / APPROVE WITH CHANGES / NEEDS REWORK]
## Critical Issues (Must Fix)
| # | Issue | Files Involved | Structural Impact | Fix |
|---|-------|---------------|-------------------|-----|
## Recommendations
| # | Issue | Why | Fix |
|---|-------|-----|-----|
## Nice-to-Haves
| # | Suggestion | Rationale |
|---|------------|-----------|
## Dependency Map
[ASCII or description of how the new code connects to the existing system. Highlight any concerning dependency arrows.]
## Boundary Crossing Analysis
| Crossing | From -> To | Clean? | Notes |
|----------|-----------|--------|-------|
## Verdict Details
- Dependency Direction: [PASS / CONCERNS]
- Module Coupling: [PASS / CONCERNS]
- Cohesion: [PASS / CONCERNS]
- Layer Boundaries: [PASS / CONCERNS]
- Change Propagation: [PASS / CONCERNS]After writing, print the Verdict, Critical Issues, and Dependency Map sections.
Reference Skills
When architectural issues involve frontend module organization, consult:
/vercel-react-best-practices— Barrel import rules, code splitting patterns, dependency optimization
Calibration
- A small, self-contained change to one file? Light audit — check it doesn't introduce new coupling.
- A plan that adds new modules, cross-cutting concerns, or changes boundaries? Full audit.
- A plan that modifies shared infrastructure (crates, common packages)? Extra scrutiny on backward compatibility.
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.

