From mblode-agent-skills
Generates folder structures, module contracts, and frontend/backend boundaries for TypeScript full-stack applications. Also finds domain-informed deepening opportunities in existing codebases.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mblode-agent-skills:define-architectureThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Define durable, easy-to-change architecture defaults for TypeScript full-stack apps; produce an enforceable architecture brief.
Define durable, easy-to-change architecture defaults for TypeScript full-stack apps; produce an enforceable architecture brief.
scaffold-nextjs for a Next.js turborepo, scaffold-cli for a TypeScript CLI), multi-tenant domain/isolation/routing (multi-tenant-architecture), or structural review of a local diff (pr-reviewer).Track this checklist:
Architecture progress:
- [ ] Step 1: Pick workflow (new codebase: Setup; existing: Adoption)
- [ ] Step 2: Run it end to end
- [ ] Step 3: Write the brief (Output template)
- [ ] Step 4: Run Validation loop, record results in brief
- [ ] Step 5: Fix failed checks, re-run loop
Load references only when the condition applies:
| Reference | Read when |
|---|---|
| references/stack-defaults.md | Choosing libraries, tooling, or deploy targets |
| references/api-design.md | Designing endpoints, module contracts, or reviewing API surface changes |
| references/distributed-correctness.md | Designing flows that call external systems, consume webhooks, retry, need an audit trail, or move money (billing, credits, payouts) |
| references/deepening-existing.md | Running the Adoption workflow (domain mapping, opportunity patterns, output template) |
| references/craftsmanship.md | Writing the team-conventions, testing, or quality-bar sections |
| references/agent-friendly-codebase.md | Preparing a codebase for coding agents: guardrail tooling, invariant ratchets, legacy markers, generated contracts, verification tiers |
| references/shipping-practices.md | Writing the rollout and rollback section |
apps/ for deployable surfaces (api, web, admin).packages/ for shared libraries (shared, ui, icons, auth, proto).handler: transport only.service: business orchestration.dao: database access only.mapper: DB/proto/domain transformations.constants and types: module-local contracts.RequestContext:
import { AsyncLocalStorage } from "node:async_hooks";
type RequestContext = { tenantId: string; userId: string; traceId: string };
const store = new AsyncLocalStorage<RequestContext>();
export const getContext = () => store.getStore()!;
export const runWithContext = (ctx: RequestContext, fn: () => void) => store.run(ctx, fn);
getContext() throw far from the cause.getContext(); never thread a ctx parameter through business functions."use client" only at leaf components needing interactivity.useState or sync two stores with useEffect; both are the red flag that ownership is unclear.Goal: domain-informed deepening, not a rewrite. Load references/deepening-existing.md for the analysis method, opportunity patterns, and output template.
CONTEXT.md, docs/adr/, or local equivalents if present, then read the code for entities, actions, and bounded contexts as the team names them. Note divergence (one concept, three names; or one name, three concepts).Run before finalizing; record results in the brief (Open risks). Each check needs evidence; "looks consistent" is not a pass.
npm run lint, npm run check-types, npm run test --workspace=<pkg> or equivalents). Evidence: passing output.On failure: fix the brief or conventions, then re-run the loop.
Use this structure:
# Architecture brief
## Context and constraints
## Repo shape
## Backend module contracts
## Request context and middleware policy
## Frontend boundaries
## Testing strategy
## Quality bar and surface-area budget
## Rollout and rollback plan
## Open risks and follow-ups
scaffold-nextjs or scaffold-cli: scaffold the repo once the brief is agreed.multi-tenant-architecture: tenant identification, isolation, and domain strategy.pr-reviewer: structural review of a local diff once implemented.planning: turn an Adoption opportunity into an implementation plan, then stress-test it.agents-md: audit and refactor the AGENTS.md file itself; this skill decides what belongs in tooling instead.tidy: diff-scoped cleanup pass; references/agent-friendly-codebase.md covers the repo-wide guardrail setup that keeps those passes small.package.json: hoisting hides missing declarations, so an app builds locally but breaks deploying alone. Each app owns its deps.dao may not import handler) the day you write it."use client" at page or layout level: it converts the whole subtree to client rendering and forfeits streaming and direct server data access. Push it to leaves.packages/ early: wait until 3+ apps need the same code; a premature shared package couples release cycles for nothing.references/distributed-correctness.md.references/agent-friendly-codebase.md).npx claudepluginhub mblode/agent-skillsGuides structured conversations to define repository architecture principles in clean (default), hexagonal/ports & adapters, modular monolith, or custom styles. Produces formal architecture.md document for project standards.
Designs system architecture including tech stack selection, API contracts, data models, and infrastructure decisions. Supports brownfield-aware extension of existing codebases with ADR documentation.
Scaffolds greenfield project architecture and AI agent harness via interview-driven decisions. Outputs markdown spec with code structure exemplar, tests, guardrails, CLAUDE.md setup, and unified plan. Invoke via /scaffold for new projects.