align architecture
Detect and resolve architectural drift by aligning source code with LikeC4 models using archtrace.
Free
Works with the AI Agents you already use
align architecture
Example session with this skill installed
Align the code with the architecture. Our archtrace check failed and I need to resolve the violations.
- Read your context and instructions
- Compiled the align architecture
I have analyzed the project architecture using archtrace check. I found 2 violations where the implementation deviates from the LikeC4 model in architecture/.
Architecture Alignment Report
| Violation | Type | Evidence | Classification | Recommendation |
|---|---|---|---|---|
identity -> orders-db | Network | docker-compose.yml | Shortcut | Fix Code: Identity should use the Orders API instead of direct DB access. |
shipping -> inventory | Import | src/shipping/tracker.ts | New Need | Change Model: This is a valid new dependency for live tracking updates. |
Decision Log (ALIGNMENT.md)
## 2024-05-20: identity → orders-db (network)
- Evidence: docker-compose.yml lines 42-45
- Decision: Fix the code
- Reason: Identity service should not have direct credentials for the orders database.
- Status: open
## 2024-05-20: shipping → inventory (import)
- Evidence: src/shipping/tracker.ts:12
- Decision: Change the model
- Reason: Shipping requires inventory status for delivery estimates.
- Status: open
Next steps
- I will refactor
docker-compose.ymlto remove the unauthorized environment variables fororders-db. - I will update
architecture/system.c4to add the missing relationship betweenshippingandinventory. - I will run
npx likec4 validateto ensure the updated model is schema-compliant.
Connects securely to your tools. The creator never sees your data.
About this skill
Stop architecture drift from silently breaking your system design. This skill bridges the gap between your LikeC4 architecture models and your actual implementation by identifying and resolving illegal dependencies. It targets the common pain point where diagrams say one thing but code imports and network configurations say another.
What it does
- Detects violations by running
archtraceto find illegal imports and unauthorized network connections. - Analyzes root causes to classify violations as shortcuts, new requirements, dead code, or misplaced logic.
- Synchronizes models by automatically updating LikeC4
.c4files when the architecture needs to evolve. - Refactors code to remove illegal dependencies or reroute them through approved service paths.
- Audits decisions by maintaining an
ALIGNMENT.mdlog that tracks why specific design choices were made.
How it works
- Scan: Run
archtrace check --jsonto identify all mismatches between code folders and model elements. - Diagnose: Inspect the source code and configuration files to classify each violation.
- Decide: Present the user with options to either fix the code, update the model, or defer the decision.
- Execute: Apply changes to
.c4files or refactor the codebase, validating each step with tests and follow-up checks.
Frameworks & tools
Requires Node.js 20+ and the archtrace CLI. It works with LikeC4 architecture models and can optionally use Emerge for advanced cluster analysis.
Why this beats prompting it yourself
Generic prompts often hallucinate architecture rules or blindly update code without understanding the design intent. This skill enforces a strict decision-making flow that treats the model as the source of truth while ensuring every change is logged for auditability.
Use cases
- Fixing CI/CD failures caused by new unauthorized service-to-service communication.
- Onboarding new developers by ensuring their local changes don't violate existing design patterns.
- Cleaning up legacy debt by identifying and removing "shortcuts" where the web layer accesses the database directly.
Known limitations
Requires archtrace and likec4 to be installed locally. It cannot automatically resolve violations without manual user confirmation for each architectural decision.
Requires archtrace CLI and Node.js 20+. User must manually approve every change to the model or code. Limited to LikeC4 model formats.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 14 days ago
- Free with an Agensi account
Requires