This is not negotiable. This is not optional. You cannot rationalize your way out of this.
IF A FULLSTACK-AGENTS SKILL APPLIES TO YOUR TASK, YOU DO NOT HAVE A CHOICE. YOU MUST USE IT.
Using Fullstack Agents
The Rule
Before writing ANY backend or frontend code, check if a fullstack-agents skill covers it. Even a 1% chance means invoke the skill. If it turns out to be wrong for the situation, you don't need to follow it — but you MUST check first.
Language Separation — Python vs Rust (HARD RULE)
This plugin serves polyglot microservices: Python (FastAPI) and Rust (Axum)
backends behind ONE Next.js frontend. Skills are language-scoped and MUST NOT
cross:
LANGUAGE LANE DETECTION (before any routing):
Cargo.toml / *.rs / migrations next to a Cargo workspace → RUST lane
pyproject.toml / requirements.txt / *.py → PYTHON lane
package.json + next / *.ts / *.tsx → FRONTEND lane
Both Cargo.toml and pyproject.toml in the repo → route PER FILE/SERVICE,
never blend idioms
- RUST lane skills:
rust-clean-architecture, rust-axum-api, rust-sqlx,
rust-correctness, rust-testing, rust-quality-gates, rust-nextjs-contract.
- PYTHON lane skills:
fastapi (existing simplified pattern),
python-clean-architecture (new DDD microservices), celery,
tasks-management. Within Python: codebase-scanning decides — existing
simplified-pattern services stay on fastapi; NEW microservices use
python-clean-architecture.
- NEVER transplant idioms across lanes: no Pydantic/CamelModel concepts in Rust
code, no thiserror/ownership patterns in Python, no SQLAlchemy patterns in
SQLx code or vice versa. The CONCEPTS align (same clean-architecture layers,
same four-stage error model, same wire contract) — the idioms never do.
- ANY Rust endpoint consumed by Next.js must follow
rust-nextjs-contract so
Rust and FastAPI services are interchangeable behind the same frontend.
When to choose which language (new services): Rust for performance-critical,
high-throughput, or long-lived always-on services; Python for ML/data-heavy
work, rapid iteration, and extending the existing FastAPI estate. If the user
hasn't specified, ask — never guess the lane for a NEW service.
Coexistence with generic rule systems (e.g. ECC's ~/.claude/rules): generic
language rules fill gaps; they never override stack-specific guidance. The
order is: project constitution > fullstack-agents skills > generic rules. If a
generic rule conflicts with the wire contract, the layer rules, or the lane
discipline, the fullstack-agents skill wins — note the conflict to the user.
Routing Table
When you detect the user's intent, route to the correct skill or agent. Two kinds of targets:
- Skill — invoke with the
Skill tool using the exact name shown (e.g. fullstack-agents:fastapi).
- Agent — launch as a subagent using the exact agent name shown (the user-facing equivalent is the slash command in parentheses).
| User Intent Pattern |
Target |
| "create entity", "add model", "CRUD", "backend API for X" |
Skill fullstack-agents:fastapi (agent: generate-fastapi-entity, /generate entity) |
| "data table", "management page", "list page with CRUD" |
Skill fullstack-agents:data-table (agent: generate-nextjs-data-table, /generate data-table) |
| "create page", "new page", "frontend page" |
Skill fullstack-agents:nextjs (agent: generate-nextjs-page, /generate page) |
| "migrate frontend", "port React to Next.js", "convert/transform frontend 1:1" |
Skill fullstack-agents:frontend-transformation |
| "migrate backend", "rewrite API in framework X", "reproduce backend behavior from the UI" |
Skill fullstack-agents:backend-migration-from-frontend |
| "API route", "proxy route", "Next.js API" |
Skill fullstack-agents:fetch-architecture (agent: generate-api-route, /generate api-route) |
| "celery task", "background task", "async task" |
Skill fullstack-agents:celery (agent: generate-celery-task, /generate task) |
| "scheduled job", "cron job", "periodic task" |
Skill fullstack-agents:tasks-management (agent: generate-scheduled-job, /generate job) |
| "docker service", "add container", "compose setup" |
Skill fullstack-agents:docker (agent: generate-docker-service, /generate docker-service) |
| "websocket", "real-time", "live updates" |
Skill fullstack-agents:websocket |
| "fullstack feature", "create X end-to-end" |
/generate fullstack orchestration (fastapi → fetch → data-table skills in sequence) |
| "debug", "error", "fix", "broken", "not working" |
Skill fullstack-agents:debug |
| build/tests/lint failing with MULTIPLE errors |
Skill fullstack-agents:batch-error-resolution |
| "review", "check quality", "audit" |
Agent review-code-quality (/review quality) |
| "security review", "security audit" |
Agent review-security (/review security) |
| "performance review", "slow", "optimize" |
Agent review-performance or optimize-performance (/review performance, /optimize) |
| "check patterns", "validate patterns" |
Agent review-patterns-compliance (/review patterns) |
| "analyze codebase", "architecture review" |
Agent analyze-codebase or analyze-architecture (/analyze) |
| "scaffold project", "new project", "bootstrap" |
Agent scaffold-project-fastapi / scaffold-project-nextjs (/scaffold) |
| "validate entity", "check entity compliance" |
/validate command |
| "validate fetch", "check fetch patterns", "fetch audit" |
Skill fullstack-agents:fetch-validate |
| "plan fetch", "fetch layers for X" |
Skill fullstack-agents:fetch-plan |
| "scaffold fetch", "generate fetch boilerplate" |
Skill fullstack-agents:fetch-implement |
| "refactor", "clean up", "reduce duplication", "extract shared logic" |
Skill fullstack-agents:senior-engineer (agent: optimize-refactoring, /optimize) |
| ANY implementation work (standing discipline, see gate step 3) |
Skill fullstack-agents:senior-engineer |
| ANY request, before acting (refine intent / scope / success criteria) |
Skill fullstack-agents:prompt-polish (also auto-injected by the prompt-polish hook) |
| a change spanning 5+ similar units (pages / entities / files / endpoints) |
Decomposition flow — split into tracked tasks, confirm concurrency, audit (orchestration.md) |
| high-stakes decision (architecture, risky migration, security, stubborn bug) |
Skill fullstack-agents:fusion-panel |
| RUST LANE (Cargo.toml / *.rs detected) |
|
| "rust service", "rust microservice", "structure rust", "rust entity", "where does this go (rust)" |
Skill fullstack-agents:rust-clean-architecture (agent: generate-rust-entity) |
| "axum handler", "rust endpoint", "rust route", "rust middleware", "rust websocket" |
Skill fullstack-agents:rust-axum-api |
| "sqlx", "rust query", "rust migration", "rust repository" |
Skill fullstack-agents:rust-sqlx |
| borrow checker / lifetime / Send/Sync / E0382-E0599 errors |
Skill fullstack-agents:rust-correctness |
| "rust test", cargo test failures |
Skill fullstack-agents:rust-testing |
| "validate rust", "gate rust", post-Rust-generation verify |
Skill fullstack-agents:rust-quality-gates |
| Rust endpoint that Next.js will consume |
Skill fullstack-agents:rust-nextjs-contract (ALWAYS, with the generating skill) |
| PYTHON LANE (pyproject.toml / *.py detected) |
|
| "new python microservice", "python DDD", "python clean architecture" |
Skill fullstack-agents:python-clean-architecture |
| existing simplified-pattern FastAPI work |
Skill fullstack-agents:fastapi (codebase-scanning decides) |
| "constitution", "project principles", "amend the constitution" |
Skill fullstack-agents:constitution |
Hard Gate — 5-Step Check Before ANY Code Generation
Before writing ANY code that touches FastAPI or Next.js, run this mental gate:
1. DETECT → What type of code is being requested?
(model, schema, router, page, component, API route, task, etc.)
2. MATCH → Does a fullstack-agents skill cover this?
(Check the routing table above)
3. REUSE → Does this functionality (or something close) already exist?
Search the codebase for existing implementations, helpers,
utilities, hooks, and components BEFORE writing new code.
Never knowingly duplicate business logic — reuse, extend, or
extract a shared abstraction instead.
(Discipline: fullstack-agents:senior-engineer)
4. INVOKE → If a skill matched: invoke it BEFORE writing any code
If NO match: proceed normally but still respect codebase
patterns and the senior-engineer discipline
5. SCAN → Has codebase-scanning run this session?
If NO: invoke fullstack-agents:codebase-scanning first
If YES: use the detected style profile
The scan loads the project CONSTITUTION when one exists —
precedence: constitution > codebase patterns > skill references
Do NOT skip to step 4. Detection, matching, and the reuse search must happen first.
The gate applies to ADVISORY questions too, not just code generation.
Planning and design questions about the stack — "what pages does this app
need", "how should the frontend fetch this", "what endpoints are missing",
"how should this service be structured" — route through the same gate: invoke
the lane's skills (e.g. nextjs + data-table + fetch-architecture for a page
inventory) BEFORE answering, so the answer reflects the project's actual
patterns instead of generic knowledge.
Senior Engineer Standard (always on)
The fullstack-agents:senior-engineer skill governs ALL implementation work —
generation, modification, and bug fixes alike. Its non-negotiables:
- Search before implement — find existing implementations before writing new ones.
- No knowing duplication — reuse, extend, or extract; never fork business logic.
- Hard limits — functions < 50 lines, files < 800 lines, nesting <= 4 levels.
- Right layer — presentation, business logic, domain, and data access stay
separated; dependencies point inward.
- Leave it cleaner — when touching existing code, improve naming, control flow,
and boundaries in the code you touch.
For the full workflow, search recipe, and definition of done, invoke
fullstack-agents:senior-engineer via the Skill tool.
Working Method (always on)
Three capabilities apply to how you handle every request — no command needed:
- Refine the prompt first (
fullstack-agents:prompt-polish). Before acting,
turn the raw request into a precise spec: intent, scope (state breadth
explicitly), success criteria, constraints, output, and whether action or only
advice is wanted. Pass the refined spec — not the raw prompt — to any worker
subagents. The prompt-polish hook keeps this in the loop on every prompt; ask
up to 3 clarifying questions only when a point that changes the outcome is
genuinely ambiguous, otherwise state your interpretation and proceed.
- Decompose large, repetitive work (orchestration.md). When a request spans
5+ similar units, enumerate them, create one tracked task per unit so progress
is visible, ask the user before running anything in parallel (sequential is
the default), dispatch one worker per unit on opt-in, then audit each unit
against its success criteria.
- Convene a panel for high-stakes calls (
fullstack-agents:fusion-panel).
For decisions where being wrong is costly, take several independent passes
(blind to each other) and synthesize consensus, contradictions, unique
insights, and blind spots into a grounded answer. Reserve it for genuinely
high-stakes calls — routine work does not need a panel.
Rationalization Prevention
These thoughts mean STOP — you're rationalizing skipping the skill:
| Thought |
Reality |
| "This is just a simple endpoint" |
Simple endpoints still need pattern compliance (CamelModel, session handling, response schemas). |
| "I'll just add one field to the model" |
Model changes cascade to schemas, routers, and frontend types. Check the skill. |
| "It's only a small component" |
Small components still need to follow existing naming, import, and state patterns. |
| "I know how FastAPI works" |
Knowing FastAPI ≠ knowing THIS project's FastAPI patterns. Invoke the skill. |
| "I know how Next.js works" |
Knowing Next.js ≠ knowing THIS project's data-fetching and state patterns. |
| "The user said to do it quickly" |
Fast AND correct > fast AND wrong. Skills prevent rework. |
| "This is a trivial change" |
Trivial changes with wrong patterns create tech debt. Check first. |
| "I'll fix the patterns later" |
Later never comes. Get it right the first time. |
| "This doesn't need a full generation" |
Even partial generation benefits from pattern detection. |
| "I remember the patterns from earlier" |
Patterns evolve. Skills have the current reference. Re-read. |
| "Let me just scaffold this by hand" |
The generate agents handle scaffolding WITH pattern compliance. |
| "It's just a type definition" |
Types must match CamelModel conventions and API contracts. |
| "It's faster to copy that existing function" |
Copying forks the logic forever. Reuse or extract — never duplicate. |
| "I'll extract the duplication later" |
Later never comes. Extract NOW, while both copies are in context. |
| "A small private helper here won't hurt" |
Three private helpers in three files IS the duplication problem. Search first. |
| "Rust and Python are similar enough here" |
Same concepts, different idioms. Wrong-lane patterns are bugs (e.g. :id routes, Pydantic-style DTOs in Rust). |
| "The frontend will adapt to my response shape" |
The frontend adapts to NOTHING. Match the FastAPI wire contract exactly (rust-nextjs-contract). |
Automatic Chaining Rules
After ANY code generation completes, the following chain fires automatically:
GENERATE → REVIEW PATTERNS → FIX VIOLATIONS → VALIDATE → PRESENT NEXT STEPS
Specifically:
Generate — the agent produces code
Review patterns — automatically run pattern compliance review on generated code (equivalent to /review patterns {entity})
Fix violations — if any violations found, fix them immediately
Validate — run type check + lint verification from the DETECTED project roots
(repo root for flat layouts; src/backend/ / src/frontend/ for nested layouts —
use whatever codebase-scanning detected, never assume the nested layout),
matched to the LANGUAGE LANE of the generated code:
- Python backend:
uv run mypy . && uv run ruff check .
- Rust backend:
cargo fmt --all --check && cargo clippy --workspace --all-targets -- -D warnings && cargo test --workspace (full chain: rust-quality-gates)
- Frontend:
npx tsc --noEmit && npm run lint
A PostToolUse hook also runs ruff on edited Python files and rustfmt on
edited Rust files — if it reports violations, fix them immediately; they are
the same gate enforced by the harness.
Present next steps — only THEN show the user what was created and suggest follow-up actions
Do NOT ask the user's permission between steps 1-4. They are mandatory.
Codebase Scanning Mandate
On the first code generation in any session:
- You MUST invoke the
fullstack-agents:codebase-scanning skill BEFORE generating code
- This detects project structure, naming conventions, and existing patterns
- The detected style profile overrides any reference patterns in the skills
- Subsequent generations in the same session can reuse the cached profile
Skill Priority
When both superpowers and fullstack-agents apply:
- superpowers handles workflow orchestration (brainstorm → plan → execute)
- fullstack-agents handles code generation specifics (pattern detection, generation, review)
They complement each other. Use superpowers for the workflow, fullstack-agents for the code.
Token Discipline (efficiency without quality loss)
Quality steps are never skipped to save tokens — waste is eliminated instead:
- Scan once. The codebase-scanning profile (and constitution) is cached in
context for the whole session — NEVER re-scan or re-read the constitution
unless the project structure visibly changed.
- Skills load once. After a skill's content is in context, follow it from
memory — do not re-invoke the same skill or Read its file again.
- Batch, don't loop. Multiple compiler/lint/test errors are fixed as ONE
batch then verified ONCE (batch-error-resolution) — never fix-one-rebuild-one.
- Parallelize. Independent reads, greps, and checks go in one message as
parallel tool calls, not sequential round-trips.
- Targeted reads. Read the specific lines or one representative example
(one router, one entity), not whole directories; the scan profile already
summarizes the rest.
- Delegate bulk work. Sweeping multi-file searches go to a subagent that
returns conclusions, not file dumps.
What is NEVER cut: dialogue questions, the confirmation plan, pattern review,
validation runs, and tests. Those are the quality floor.
How to Access Skills
Use the Skill tool to invoke any fullstack-agents skill. When you invoke a skill, its content is loaded and presented to you — follow it directly. Never use the Read tool on skill files.
Skill Types
Rigid (generate agents, review agents): Follow the agent lifecycle exactly. Don't skip phases.
Flexible (analyze, optimize): Adapt the approach to the specific situation.
The skill/agent itself tells you which type it is.
1---2name: using-fullstack-agents3description: Auto-triggering guide for fullstack-agents — ensures Claude automatically invokes the right code generation, review, and debugging skills before writing any FastAPI or Next.js code.4---56<EXTREMELY-IMPORTANT>7If you are about to write, modify, or generate ANY code in a FastAPI backend or Next.js frontend, you MUST consult fullstack-agents skills first.89This is not negotiable. This is not optional. You cannot rationalize your way out of this.1011IF A FULLSTACK-AGENTS SKILL APPLIES TO YOUR TASK, YOU DO NOT HAVE A CHOICE. YOU MUST USE IT.12</EXTREMELY-IMPORTANT>1314# Using Fullstack Agents1516## The Rule1718**Before writing ANY backend or frontend code, check if a fullstack-agents skill covers it.** Even a 1% chance means invoke the skill. If it turns out to be wrong for the situation, you don't need to follow it — but you MUST check first.1920## Language Separation — Python vs Rust (HARD RULE)2122This plugin serves polyglot microservices: Python (FastAPI) and Rust (Axum)23backends behind ONE Next.js frontend. Skills are language-scoped and MUST NOT24cross:2526```27LANGUAGE LANE DETECTION (before any routing):28 Cargo.toml / *.rs / migrations next to a Cargo workspace → RUST lane29 pyproject.toml / requirements.txt / *.py → PYTHON lane30 package.json + next / *.ts / *.tsx → FRONTEND lane31 Both Cargo.toml and pyproject.toml in the repo → route PER FILE/SERVICE,32 never blend idioms33```3435- RUST lane skills: `rust-clean-architecture`, `rust-axum-api`, `rust-sqlx`,36 `rust-correctness`, `rust-testing`, `rust-quality-gates`, `rust-nextjs-contract`.37- PYTHON lane skills: `fastapi` (existing simplified pattern),38 `python-clean-architecture` (new DDD microservices), `celery`,39 `tasks-management`. Within Python: codebase-scanning decides — existing40 simplified-pattern services stay on `fastapi`; NEW microservices use41 `python-clean-architecture`.42- NEVER transplant idioms across lanes: no Pydantic/CamelModel concepts in Rust43 code, no thiserror/ownership patterns in Python, no SQLAlchemy patterns in44 SQLx code or vice versa. The CONCEPTS align (same clean-architecture layers,45 same four-stage error model, same wire contract) — the idioms never do.46- ANY Rust endpoint consumed by Next.js must follow `rust-nextjs-contract` so47 Rust and FastAPI services are interchangeable behind the same frontend.4849**When to choose which language (new services):** Rust for performance-critical,50high-throughput, or long-lived always-on services; Python for ML/data-heavy51work, rapid iteration, and extending the existing FastAPI estate. If the user52hasn't specified, ask — never guess the lane for a NEW service.5354**Coexistence with generic rule systems (e.g. ECC's ~/.claude/rules):** generic55language rules fill gaps; they never override stack-specific guidance. The56order is: project constitution > fullstack-agents skills > generic rules. If a57generic rule conflicts with the wire contract, the layer rules, or the lane58discipline, the fullstack-agents skill wins — note the conflict to the user.5960## Routing Table6162When you detect the user's intent, route to the correct skill or agent. Two kinds of targets:6364- **Skill** — invoke with the `Skill` tool using the exact name shown (e.g. `fullstack-agents:fastapi`).65- **Agent** — launch as a subagent using the exact agent name shown (the user-facing equivalent is the slash command in parentheses).6667| User Intent Pattern | Target |68|---|---|69| "create entity", "add model", "CRUD", "backend API for X" | Skill `fullstack-agents:fastapi` (agent: `generate-fastapi-entity`, `/generate entity`) |70| "data table", "management page", "list page with CRUD" | Skill `fullstack-agents:data-table` (agent: `generate-nextjs-data-table`, `/generate data-table`) |71| "create page", "new page", "frontend page" | Skill `fullstack-agents:nextjs` (agent: `generate-nextjs-page`, `/generate page`) |72| "migrate frontend", "port React to Next.js", "convert/transform frontend 1:1" | Skill `fullstack-agents:frontend-transformation` |73| "migrate backend", "rewrite API in framework X", "reproduce backend behavior from the UI" | Skill `fullstack-agents:backend-migration-from-frontend` |74| "API route", "proxy route", "Next.js API" | Skill `fullstack-agents:fetch-architecture` (agent: `generate-api-route`, `/generate api-route`) |75| "celery task", "background task", "async task" | Skill `fullstack-agents:celery` (agent: `generate-celery-task`, `/generate task`) |76| "scheduled job", "cron job", "periodic task" | Skill `fullstack-agents:tasks-management` (agent: `generate-scheduled-job`, `/generate job`) |77| "docker service", "add container", "compose setup" | Skill `fullstack-agents:docker` (agent: `generate-docker-service`, `/generate docker-service`) |78| "websocket", "real-time", "live updates" | Skill `fullstack-agents:websocket` |79| "fullstack feature", "create X end-to-end" | `/generate fullstack` orchestration (fastapi → fetch → data-table skills in sequence) |80| "debug", "error", "fix", "broken", "not working" | Skill `fullstack-agents:debug` |81| build/tests/lint failing with MULTIPLE errors | Skill `fullstack-agents:batch-error-resolution` |82| "review", "check quality", "audit" | Agent `review-code-quality` (`/review quality`) |83| "security review", "security audit" | Agent `review-security` (`/review security`) |84| "performance review", "slow", "optimize" | Agent `review-performance` or `optimize-performance` (`/review performance`, `/optimize`) |85| "check patterns", "validate patterns" | Agent `review-patterns-compliance` (`/review patterns`) |86| "analyze codebase", "architecture review" | Agent `analyze-codebase` or `analyze-architecture` (`/analyze`) |87| "scaffold project", "new project", "bootstrap" | Agent `scaffold-project-fastapi` / `scaffold-project-nextjs` (`/scaffold`) |88| "validate entity", "check entity compliance" | `/validate` command |89| "validate fetch", "check fetch patterns", "fetch audit" | Skill `fullstack-agents:fetch-validate` |90| "plan fetch", "fetch layers for X" | Skill `fullstack-agents:fetch-plan` |91| "scaffold fetch", "generate fetch boilerplate" | Skill `fullstack-agents:fetch-implement` |92| "refactor", "clean up", "reduce duplication", "extract shared logic" | Skill `fullstack-agents:senior-engineer` (agent: `optimize-refactoring`, `/optimize`) |93| ANY implementation work (standing discipline, see gate step 3) | Skill `fullstack-agents:senior-engineer` |94| ANY request, before acting (refine intent / scope / success criteria) | Skill `fullstack-agents:prompt-polish` (also auto-injected by the prompt-polish hook) |95| a change spanning 5+ similar units (pages / entities / files / endpoints) | Decomposition flow — split into tracked tasks, confirm concurrency, audit (orchestration.md) |96| high-stakes decision (architecture, risky migration, security, stubborn bug) | Skill `fullstack-agents:fusion-panel` |97| **RUST LANE** (Cargo.toml / *.rs detected) | |98| "rust service", "rust microservice", "structure rust", "rust entity", "where does this go (rust)" | Skill `fullstack-agents:rust-clean-architecture` (agent: `generate-rust-entity`) |99| "axum handler", "rust endpoint", "rust route", "rust middleware", "rust websocket" | Skill `fullstack-agents:rust-axum-api` |100| "sqlx", "rust query", "rust migration", "rust repository" | Skill `fullstack-agents:rust-sqlx` |101| borrow checker / lifetime / Send/Sync / E0382-E0599 errors | Skill `fullstack-agents:rust-correctness` |102| "rust test", cargo test failures | Skill `fullstack-agents:rust-testing` |103| "validate rust", "gate rust", post-Rust-generation verify | Skill `fullstack-agents:rust-quality-gates` |104| Rust endpoint that Next.js will consume | Skill `fullstack-agents:rust-nextjs-contract` (ALWAYS, with the generating skill) |105| **PYTHON LANE** (pyproject.toml / *.py detected) | |106| "new python microservice", "python DDD", "python clean architecture" | Skill `fullstack-agents:python-clean-architecture` |107| existing simplified-pattern FastAPI work | Skill `fullstack-agents:fastapi` (codebase-scanning decides) |108| "constitution", "project principles", "amend the constitution" | Skill `fullstack-agents:constitution` |109110## Hard Gate — 5-Step Check Before ANY Code Generation111112Before writing ANY code that touches FastAPI or Next.js, run this mental gate:113114```1151. DETECT → What type of code is being requested?116 (model, schema, router, page, component, API route, task, etc.)1171182. MATCH → Does a fullstack-agents skill cover this?119 (Check the routing table above)1201213. REUSE → Does this functionality (or something close) already exist?122 Search the codebase for existing implementations, helpers,123 utilities, hooks, and components BEFORE writing new code.124 Never knowingly duplicate business logic — reuse, extend, or125 extract a shared abstraction instead.126 (Discipline: fullstack-agents:senior-engineer)1271284. INVOKE → If a skill matched: invoke it BEFORE writing any code129 If NO match: proceed normally but still respect codebase130 patterns and the senior-engineer discipline1311325. SCAN → Has codebase-scanning run this session?133 If NO: invoke fullstack-agents:codebase-scanning first134 If YES: use the detected style profile135 The scan loads the project CONSTITUTION when one exists —136 precedence: constitution > codebase patterns > skill references137```138139**Do NOT skip to step 4.** Detection, matching, and the reuse search must happen first.140141**The gate applies to ADVISORY questions too, not just code generation.**142Planning and design questions about the stack — "what pages does this app143need", "how should the frontend fetch this", "what endpoints are missing",144"how should this service be structured" — route through the same gate: invoke145the lane's skills (e.g. nextjs + data-table + fetch-architecture for a page146inventory) BEFORE answering, so the answer reflects the project's actual147patterns instead of generic knowledge.148149## Senior Engineer Standard (always on)150151The `fullstack-agents:senior-engineer` skill governs ALL implementation work —152generation, modification, and bug fixes alike. Its non-negotiables:153154- **Search before implement** — find existing implementations before writing new ones.155- **No knowing duplication** — reuse, extend, or extract; never fork business logic.156- **Hard limits** — functions < 50 lines, files < 800 lines, nesting <= 4 levels.157- **Right layer** — presentation, business logic, domain, and data access stay158 separated; dependencies point inward.159- **Leave it cleaner** — when touching existing code, improve naming, control flow,160 and boundaries in the code you touch.161162For the full workflow, search recipe, and definition of done, invoke163`fullstack-agents:senior-engineer` via the Skill tool.164165## Working Method (always on)166167Three capabilities apply to how you handle every request — no command needed:168169- **Refine the prompt first** (`fullstack-agents:prompt-polish`). Before acting,170 turn the raw request into a precise spec: intent, scope (state breadth171 explicitly), success criteria, constraints, output, and whether action or only172 advice is wanted. Pass the refined spec — not the raw prompt — to any worker173 subagents. The `prompt-polish` hook keeps this in the loop on every prompt; ask174 up to 3 clarifying questions only when a point that changes the outcome is175 genuinely ambiguous, otherwise state your interpretation and proceed.176- **Decompose large, repetitive work** (orchestration.md). When a request spans177 5+ similar units, enumerate them, create one tracked task per unit so progress178 is visible, **ask the user before running anything in parallel** (sequential is179 the default), dispatch one worker per unit on opt-in, then audit each unit180 against its success criteria.181- **Convene a panel for high-stakes calls** (`fullstack-agents:fusion-panel`).182 For decisions where being wrong is costly, take several independent passes183 (blind to each other) and synthesize consensus, contradictions, unique184 insights, and blind spots into a grounded answer. Reserve it for genuinely185 high-stakes calls — routine work does not need a panel.186187## Rationalization Prevention188189These thoughts mean STOP — you're rationalizing skipping the skill:190191| Thought | Reality |192|---|---|193| "This is just a simple endpoint" | Simple endpoints still need pattern compliance (CamelModel, session handling, response schemas). |194| "I'll just add one field to the model" | Model changes cascade to schemas, routers, and frontend types. Check the skill. |195| "It's only a small component" | Small components still need to follow existing naming, import, and state patterns. |196| "I know how FastAPI works" | Knowing FastAPI ≠ knowing THIS project's FastAPI patterns. Invoke the skill. |197| "I know how Next.js works" | Knowing Next.js ≠ knowing THIS project's data-fetching and state patterns. |198| "The user said to do it quickly" | Fast AND correct > fast AND wrong. Skills prevent rework. |199| "This is a trivial change" | Trivial changes with wrong patterns create tech debt. Check first. |200| "I'll fix the patterns later" | Later never comes. Get it right the first time. |201| "This doesn't need a full generation" | Even partial generation benefits from pattern detection. |202| "I remember the patterns from earlier" | Patterns evolve. Skills have the current reference. Re-read. |203| "Let me just scaffold this by hand" | The generate agents handle scaffolding WITH pattern compliance. |204| "It's just a type definition" | Types must match CamelModel conventions and API contracts. |205| "It's faster to copy that existing function" | Copying forks the logic forever. Reuse or extract — never duplicate. |206| "I'll extract the duplication later" | Later never comes. Extract NOW, while both copies are in context. |207| "A small private helper here won't hurt" | Three private helpers in three files IS the duplication problem. Search first. |208| "Rust and Python are similar enough here" | Same concepts, different idioms. Wrong-lane patterns are bugs (e.g. `:id` routes, Pydantic-style DTOs in Rust). |209| "The frontend will adapt to my response shape" | The frontend adapts to NOTHING. Match the FastAPI wire contract exactly (rust-nextjs-contract). |210211## Automatic Chaining Rules212213After ANY code generation completes, the following chain fires **automatically**:214215```216GENERATE → REVIEW PATTERNS → FIX VIOLATIONS → VALIDATE → PRESENT NEXT STEPS217```218219Specifically:2202211. **Generate** — the agent produces code2222. **Review patterns** — automatically run pattern compliance review on generated code (equivalent to `/review patterns {entity}`)2233. **Fix violations** — if any violations found, fix them immediately2244. **Validate** — run type check + lint verification from the DETECTED project roots225 (repo root for flat layouts; `src/backend/` / `src/frontend/` for nested layouts —226 use whatever codebase-scanning detected, never assume the nested layout),227 matched to the LANGUAGE LANE of the generated code:228 - Python backend: `uv run mypy . && uv run ruff check .`229 - Rust backend: `cargo fmt --all --check && cargo clippy --workspace --all-targets -- -D warnings && cargo test --workspace` (full chain: rust-quality-gates)230 - Frontend: `npx tsc --noEmit && npm run lint`231232 A PostToolUse hook also runs `ruff` on edited Python files and `rustfmt` on233 edited Rust files — if it reports violations, fix them immediately; they are234 the same gate enforced by the harness.2355. **Present next steps** — only THEN show the user what was created and suggest follow-up actions236237**Do NOT ask the user's permission between steps 1-4. They are mandatory.**238239## Codebase Scanning Mandate240241On the **first code generation** in any session:242- You MUST invoke the `fullstack-agents:codebase-scanning` skill BEFORE generating code243- This detects project structure, naming conventions, and existing patterns244- The detected style profile overrides any reference patterns in the skills245- Subsequent generations in the same session can reuse the cached profile246247## Skill Priority248249When both `superpowers` and `fullstack-agents` apply:250251- **superpowers** handles workflow orchestration (brainstorm → plan → execute)252- **fullstack-agents** handles code generation specifics (pattern detection, generation, review)253254They complement each other. Use superpowers for the workflow, fullstack-agents for the code.255256## Token Discipline (efficiency without quality loss)257258Quality steps are never skipped to save tokens — waste is eliminated instead:259260- **Scan once.** The codebase-scanning profile (and constitution) is cached in261 context for the whole session — NEVER re-scan or re-read the constitution262 unless the project structure visibly changed.263- **Skills load once.** After a skill's content is in context, follow it from264 memory — do not re-invoke the same skill or Read its file again.265- **Batch, don't loop.** Multiple compiler/lint/test errors are fixed as ONE266 batch then verified ONCE (batch-error-resolution) — never fix-one-rebuild-one.267- **Parallelize.** Independent reads, greps, and checks go in one message as268 parallel tool calls, not sequential round-trips.269- **Targeted reads.** Read the specific lines or one representative example270 (one router, one entity), not whole directories; the scan profile already271 summarizes the rest.272- **Delegate bulk work.** Sweeping multi-file searches go to a subagent that273 returns conclusions, not file dumps.274275What is NEVER cut: dialogue questions, the confirmation plan, pattern review,276validation runs, and tests. Those are the quality floor.277278## How to Access Skills279280Use the `Skill` tool to invoke any fullstack-agents skill. When you invoke a skill, its content is loaded and presented to you — follow it directly. Never use the Read tool on skill files.281282## Skill Types283284**Rigid** (generate agents, review agents): Follow the agent lifecycle exactly. Don't skip phases.285286**Flexible** (analyze, optimize): Adapt the approach to the specific situation.287288The skill/agent itself tells you which type it is.