Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/kaelsensei/magicaibuilder/architecture-skillgit clone --depth 1 https://github.com/KaelSensei/MagicAIBuilderWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/kaelsensei/magicaibuilder/architecture-skill)<a href="https://agentmods.dev/rules/kaelsensei/magicaibuilder/architecture-skill"><img src="https://agentmods.dev/badge/rules/kaelsensei/magicaibuilder/architecture-skill.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00739 | $0.00739 |
| Opus 5 | $0.00369 | $0.00369 |
| Sonnet 5 | $0.00148 | $0.00148 |
| Haiku 4.5 | $0.00074 | $0.00074 |
Grade A, and why
architecture-skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Clean Architecture Rule
Based on Robert C. Martin (Clean Architecture) and Alistair Cockburn (Hexagonal
Architecture), adapted to Next.js 15 App Router. For the full reference, see the
clean-architecture skill under .agents/skills/clean-architecture/SKILL.md.
Core principle
Dependencies point inward, toward the domain. Outer layers know about inner layers; inner layers do NOT know about outer ones.
Layers in this repo
- Domain —
src/types/,src/lib/<domain>/types.ts,src/lib/<domain>/constants.ts. Pure TypeScript, no framework imports. - Use cases —
src/lib/<domain>/*.ts. Pure functions, unit-tested. - Infrastructure —
src/lib/db/*.ts(Prisma),src/lib/scryfall.ts,src/lib/moxfield.ts,src/lib/auth.ts. Wraps external systems behind domain-shaped APIs. - Interface —
src/app/**/page.tsx,layout.tsx, route handlers, server actions, and client components insrc/components/. Thin — delegate to use cases.
Dependency rules
- Domain types import nothing.
- Use cases import domain types only.
- Infrastructure may import domain + use cases to satisfy ports.
- Server components may compose use cases + infrastructure.
- Client components reach infrastructure only through server actions, route handlers, or a typed fetch wrapper — never direct Prisma imports.
- API route handlers and server actions stay thin: parse with Zod → call a use case → shape the response.
Hexagonal ports and adapters
- When the domain needs external I/O, define a port (interface) in the domain / use-case layer and implement adapters in infrastructure.
- Use cases depend on ports, never on concrete adapters.
Decision guide — where does this code go?
- Compute something from domain data, no I/O →
src/lib/<domain>/. - Persist, read, or call an external service →
src/lib/db/orsrc/lib/<provider>.ts. - Render UI →
src/components/(reusable) orsrc/app/**(route-scoped). - Client-side state or effects →
src/hooks/or a Zustand store undersrc/stores/. - HTTP → domain translation →
src/app/api/**/route.ts(thin handler) that delegates tosrc/lib/.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 72 lines · 739 tokens per session scan A e001df09c8f5
architecture-skill is a cursor rule published in the GitHub repository KaelSensei/MagicAIBuilder (2 stars, last pushed 4d ago), licensed MIT. It adds 739 tokens to every session, about $0.0037 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
ui-design-system
UI, design tokens and mobile-first rules.
performance
Navigation, caching and PWA contract.
upgrade-tests
// ✅ CORRECT: Upgrade package pattern await using ctx = testReactResource(appRouter, { server: { // server configuration }, client(opts) { return { links: [ httpLink({ url: opts.httpUrl, // client configuration }), ], }; }, }).
react-query-tests
// ✅ CORRECT: Legacy React Query pattern const ctx = konn() .beforeEach(() => createAppRouter()) .afterEach((ctx) => ctx?.close?.()) .done().
tanstack-react-query-tests
// ✅ CORRECT: Use await using for automatic cleanup await using ctx = testReactResource(appRouter, { server: { // server configuration }, client(opts) { return { links: [ httpLink({ url: opts.httpUrl, // client configuration }), ], }; }, }).
server-actions
Server Action, service and tenancy contract.