Generates technical contracts (Prisma schema, GraphQL API, architecture, testing plan) based on SPEC.md and a UI prototype. Also reviews an already-created blueprint on request. Run when SPEC.md is approved and it's time to move to technical design, or when the user says "check the spec", "validate the blueprint". Do NOT run if SPEC.md is still a draft or the task is refactoring existing code.
86%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
The skill creates five documents that fully describe the product's technical implementation:
When to run:
prototype/ folderWhen NOT to run:
Before generation, you must read and analyze:
1_PRODUCT_VISION/VISION.md — goal, scope, success metrics2_PRODUCT_SPEC/SPEC.md — entities, operations, pages, testing (the main source of truth)prototype/ — only to understand the scope: which pages exist, the flows between them, the forms. Do not copy technical decisions from the prototype. The prototype was built quickly and without regard for best practices — it shows "what", not "how". Everything architectural follows the stack's best practices, regardless of how it's implemented in the prototype.schema.prisma or schema.graphql: read it before generation, this means update modeIf there isn't enough input — ask no more than 2 clarifying questions.
Before generation, build an internal list:
Projects are built on top of two pre-built starter templates (boilerplate — a ready codebase with the basic tasks already solved): a backend template (NestJS) and a frontend template (React). They already implement authentication, user handling, and the test infrastructure. Don't design them again — only extend them.
The Prisma model Profile (already exists, do not duplicate):
model Profile {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
oidcSub String @unique // link to the OIDC provider
roles ProfileRole[] @default([USER])
avatarUrl String?
}
enum ProfileRole { ADMIN USER }GraphQL operations (already implemented, do not include in the Blueprint):
| Operation | Type | Access |
|---|---|---|
me | Query | JwtAuthGuard |
updateProfile(input) | Mutation | JwtAuthGuard |
profileUpdated | Subscription | by userId |
debug | Query | JwtOptionalAuthGuard |
echo | Query + Mutation | public |
Infrastructure (configured, just use it):
JwtAuthGuard, JwtOptionalAuthGuard, RolesGuard, @CurrentUser(), @Roles()gqlErrorFormatter — maps ZodValidationException and HttpException to GraphQL errors@All() → NotFoundExceptionGET /healthBackend test infrastructure:
E2EClient.loginAs(profile) — auth via the x-mock-sub headerclearDatabase() + clearRedis() — mandatory in beforeEach()OIDC_MOCK_ENABLED=true — mock-auth mode in .env.testFSD slices (FSD — Feature-Sliced Design, a methodology for structuring frontend code by business layers) already implemented, do not include in the Blueprint:
| Layer | Slice | What it contains |
|---|---|---|
features | auth | OIDC PKCE configuration, AuthGuard, MockAuthProvider |
widgets | Header | Navigation + auth buttons (auth state) |
pages | 404 | Fully implemented with "Back" and "Home" buttons |
shared/api | graphql-client | URQL client factory with a Bearer token |
Routes (already implemented):
| Route | Purpose |
|---|---|
/callback | OIDC redirect handler (after login) |
* (any non-existent) | 404 page via defaultNotFoundComponent |
Frontend test infrastructure:
VITE_MOCK_AUTH=true — MockAuthProvider for Playwright e2etests/setup.ts — a global mock of react-oidc-context for Vitest unit/component testsThe technical contracts are stored separately from the product documentation (doc-gen), so as not to mix business artifacts with technical ones:
docs/<project_name>/ ← product documentation (doc-gen)
├── INDEX.md
├── 1_PRODUCT_VISION/
└── 2_PRODUCT_SPEC/
blueprint/<project_name>/ ← technical contracts (this skill)
└── 3_TECH_BLUEPRINT/
├── IMPLEMENTATION_GUIDE.md ← developer onboarding (generate first)
├── DATABASE_MODEL.md
├── API_CONTRACTS.md
├── ARCHITECTURE.md
└── TESTING_PLAN.mdCreate the folder before generation:
mkdir -p blueprint/<ProjectName>/3_TECH_BLUEPRINT# Data model: <Product name>
**Status:** draft | **Date:** YYYY-MM-DD
## Links
- Specification: [SPEC.md](../2_PRODUCT_SPEC/SPEC.md)
## Implementation context
- **ORM:** Prisma (TypeScript ORM) — the schema is in `prisma/schema.prisma`, migrations via `prisma migrate dev`
- **DB:** PostgreSQL
- **`Profile` — the current user's model** (already exists in the starter template, do not duplicate): contains `id`, `oidcSub @unique` (the identifier from the OIDC provider), `roles`, `avatarUrl`. To link a business entity to the user: `profileId Int` + `@relation(fields: [profileId], references: [id])`.
- **Authentication via OIDC** (OpenID Connect — a sign-in protocol via an external service, for example Logto or Keycloak): the `User`, `Session`, `AuthToken` tables — **do not create**. Authentication is entirely delegated to the external provider.
- **Soft delete:** `deletedAt DateTime?` — the entity is not deleted physically. Queries to such models always filter: `WHERE deletedAt IS NULL`.
## Entities and relations
<for each model: what it stores, key fields, relations — business language, not database language>
## Database schema
```prisma
// schema.prisma — <Product name>
// Generated based on SPEC.md
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
// <models and enums><for each enum: name, values, when and why it's used>
| Model | Field(s) | Type | Reason |
|---|
| Model | Relation field | onDelete | onUpdate | Rationale |
|---|
### Mandatory rules
**Traceability.** Add a reference comment to each model:
```prisma
// The "Order" entity — SPEC.md §Entities
model Order {Technical fields. Each model (except join tables, see below) must contain:
createdAt DateTime @default(now())
updatedAt DateTime @updatedAtSoft delete. For critical business entities (Users, Orders, Projects, and the like per SPEC.md), add deletedAt DateTime? unless SPEC.md forbids it. All queries to such models account for WHERE deletedAt IS NULL.
Enums instead of strings. For enumerable values — only enum, no String:
// Correct:
enum OrderStatus { DRAFT CONFIRMED COMPLETED CANCELLED }
// Forbidden:
status String // instead of an enumRelations. Each relation — with an explicit @relation, onDelete, onUpdate.
Unique indexes. @@unique for business-unique combinations of fields.
Join tables. Name them with a _ in the name (for example, _UserToRole, Post_Tag). Technical fields are optional for them.
Profile already exists. Don't add a User, Account, Session, or AuthToken model — authentication is entirely on the side of the external OIDC provider. To link business entities to the user, use profileId:
// Correct:
model Order {
// ...
profileId Int
profile Profile @relation(fields: [profileId], references: [id], onDelete: Cascade)
}
// Forbidden:
model User { /* duplicates Profile */ }
model Session { /* OIDC — external provider */ }Forbidden:
String for enumerable values (statuses, roles, types)onDeleteid fieldUser, Account, Session, AuthToken models (duplicate the boilerplate)# API contracts: <Product name>
**Status:** draft | **Date:** YYYY-MM-DD
## Links
- Specification: [SPEC.md](../2_PRODUCT_SPEC/SPEC.md)
- Data model: [DATABASE_MODEL.md](./DATABASE_MODEL.md)
## Implementation context
- **GraphQL engine:** MercuriusDriver — a GraphQL implementation for the Fastify web framework (used instead of Apollo Server; behavior is identical, only the configuration differs).
- **Auth guards** (a NestJS guard — a decorator that checks access rights before a resolver runs):
- `@UseGuards(JwtAuthGuard)` — requires a valid JWT token
- `@UseGuards(JwtOptionalAuthGuard)` — auth is optional (works both with and without a token)
- `@UseGuards(JwtAuthGuard) @Roles(ProfileRole.ADMIN)` — only for the ADMIN role
- `@CurrentUser()` — a resolver parameter decorator, returns the current `Profile`
- **Starter-template operations (already done, do not include in the Blueprint):** `me`, `updateProfile`, `profileUpdated`, `debug`, `echo`
- **Error handling:** `gqlErrorFormatter` automatically converts `ZodValidationException` and `HttpException` into correct GraphQL errors — no manual handling needed.
- **Subscriptions:** work via WebSocket + Redis pub/sub — the infrastructure is already configured, just use it.
- **OIDC operations** (login/logout/registration): `login`, `register`, `logout`, `refreshToken` — **do not describe**, they live in the OIDC provider (an external service).
## API overview
<number of operations, main domains, key decisions>
## Custom errors
| Code | Description | When it occurs |
|-----|----------|----------------|
## GraphQL schema
```graphql
# schema.graphql — <Product name>
# Generated based on SPEC.md
# <directives, scalars, types, inputs, queries, mutations><for non-trivial operations: inputs, result, access rule, possible errors>
### Mandatory rules
**Traceability.** In the comment to each Query and Mutation:
```graphql
# Described in SPEC.md §Key operations — creating an order
createOrder(input: CreateOrderInput!): CreateOrderResult!Access directives. Each Query and Mutation is marked with a comment:
# @public
products(limit: Int! = 20, offset: Int! = 0): ProductsPage!
# @auth
myOrders(limit: Int! = 20, offset: Int! = 0): OrdersPage!
# @auth @hasRole(ADMIN)
deleteUser(id: ID!): DeleteUserResult!If an operation is public — write # @public. Without this comment the operation is considered unmarked — an error.
Strict pagination. Any field returning a list must have pagination. Use a wrapper type:
# Correct:
type Query {
orders(limit: Int! = 20, offset: Int! = 0, filter: OrderFilterInput): OrdersPage!
}
type OrdersPage {
items: [Order!]!
total: Int!
hasMore: Boolean!
}
# Forbidden:
type Query {
orders: [Order!]! # a bare array without pagination — an error
}Input types. Each mutation takes a separate Input type, not a set of scalar arguments:
# Correct:
createOrder(input: CreateOrderInput!): CreateOrderResult!
# Forbidden:
createOrder(userId: ID!, productId: ID!, quantity: Int!): Order!Custom errors. For operations with business errors — a union result type:
union CreateOrderResult = Order | OrderError | InsufficientStockErrorGraphQL engine: MercuriusDriver (Fastify). Don't describe Apollo Server directives and mechanisms. Subscriptions — via WebSocket + Redis pub/sub (already configured in the boilerplate).
Guard syntax in comments. Use NestJS-style for precision:
# @UseGuards(JwtAuthGuard) — requires auth
# @UseGuards(JwtOptionalAuthGuard) — auth is optional
# @UseGuards(JwtAuthGuard) @Roles(ADMIN) — only for the ADMIN role
# @public — no authBoilerplate operations are already implemented. Don't include in the Blueprint:
me, updateProfile(input), profileUpdated, debug, echo
Forbidden to describe: auth operations (login, register, logout, refreshToken) — that's the OIDC provider. File uploads and session management — if they don't carry unique business logic.
Forbidden:
[Entity!]! in Query/Mutationme, updateProfile, profileUpdated operations (already in the boilerplate)LoginInput, RegisterInput, SessionType (OIDC — external provider)# Architecture: <Product name>
**Status:** draft | **Date:** YYYY-MM-DD
## Links
- Specification: [SPEC.md](../2_PRODUCT_SPEC/SPEC.md)
## Implementation context
**Stack:**
- Backend: NestJS + Fastify, Prisma ORM, PostgreSQL, GraphQL (MercuriusDriver), Redis (BullMQ — task queues; pub/sub — GraphQL Subscriptions)
- Frontend: React + Vite, TanStack Router (file-based routing), FSD (Feature-Sliced Design — a methodology for structuring code by business layers), URQL (a GraphQL client with caching), Zustand (a UI-state store), ParaglideJS (an i18n library for Vite)
**Already implemented in the starter templates (do not include in the Blueprint):**
| Layer | What's done |
|----------|------------|
| Backend | Auth: the `JwtAuthGuard`, `JwtOptionalAuthGuard`, `RolesGuard` guards; OIDC JWT via an external provider |
| Backend | Profile GraphQL: the `me`, `updateProfile`, `profileUpdated` operations; the `Profile` model in the DB |
| Backend | Infrastructure: Health check `GET /health`, BullMQ, Redis pub/sub, i18n (en/ru), gqlErrorFormatter |
| Frontend | `features/auth` — OIDC PKCE auth, `AuthGuard` (blocks unauthenticated users), `MockAuthProvider` (for tests) |
| Frontend | `widgets/Header` (navigation + login/logout buttons), `pages/404`, `shared/api/graphql-client` (URQL with a Bearer token) |
| Frontend | Routes: `/callback` (OIDC redirect after login), `*` (404 via `defaultNotFoundComponent`) |
**Protected routes (TanStack Router):** the `beforeLoad` + `redirect()` pattern. The page content is wrapped in `AuthGuard` — a component that redirects an unauthenticated user.
## Backend: NestJS modules
| Module | Responsibility | Dependencies |
|--------|----------------|-------------|
## Frontend: FSD slices
### Entities (business entities)
| Entity | What it represents | Data model |
|---------|-----------------|---------------|
### Features (user actions)
| Feature | What the user does | Related API operation |
|------|------------------------|----------------------|
### Widgets (composite UI blocks)
| Widget | Which features it's made of | Where it's used |
|--------|---------------------|-----------------|
### Pages (application pages)
<a hierarchy of pages from prototype/ without file paths>
## Frontend: state management
### Server state (URQL cache)
<which data is cached via URQL: entities, lists, their invalidation>
### UI state (Zustand)
<which states are in Zustand: open modals, active filters, theme, local flags>
## Frontend: localization (i18n)
<ParaglideJS namespaces based on the prototype or "i18n not required">
## Environment variables
| Variable | Type | Purpose | BE/FE |
|-----------|-----|-----------|-------|STRICT BAN on file paths. Any strings like src/features/auth, src/entities/user, app/pages/dashboard, components/Button are forbidden. Only logical names: the auth feature, the User entity, the Dashboard page.
State separation is mandatory. Explicitly state for each data area:
You can't leave the "State management" section without concrete content or write "URQL is used" without naming the specific entities.
FSD without implementation details. Describe only the business meaning of the slice. Don't mention the file structure, barrel exports, or the folder model.
ENV — business variables only. Don't include PORT, NODE_ENV, DATABASE_URL, REDIS_URL, or the standard framework variables. Only the ones specific to this product.
i18n. If the prototype has text (labels, buttons, messages, notifications) — list the ParaglideJS namespaces. If the prototype has no text — write explicitly: "i18n not required".
Router: TanStack Router (file-based). Don't describe Next.js or React Router patterns. Protected pages use beforeLoad + redirect():
// Protected route pattern (beforeLoad):
if not authenticated → redirect to home
the page content is wrapped in AuthGuardExisting FSD slices from the starter template — do not include in the Blueprint:
features/auth — OIDC auth, AuthGuard, MockAuthProviderwidgets/Header — navigation with login/logout buttonspages/404 — a "not found" pageshared/api/graphql-client — URQL (the GraphQL client) with a Bearer tokenZustand: the store pattern. All new stores use the wrapper with devtools:
// New Zustand store pattern:
create(devtools<MyStore>((set) => ({ ... })))Forbidden:
src/, app/, components/)auth, Header, 404) in the Blueprint# Testing plan: <Product name>
**Status:** draft | **Date:** YYYY-MM-DD
## Links
- Specification: [SPEC.md](../2_PRODUCT_SPEC/SPEC.md) — the source of scenarios
## Testing context
**Backend (Vitest):**
- `E2EClient` — a built-in test utility from `test/utils/`, runs GraphQL queries with authentication via a special HTTP header `x-mock-sub` (without a real OIDC provider).
- Usage: `await client.loginAs(profile)` — run queries on behalf of a user.
- Mandatory in `beforeEach()`: `clearDatabase()` (clear the DB tables) + `clearRedis()` (reset the Redis cache) — so the tests don't affect each other.
- In `.env.test`: `OIDC_MOCK_ENABLED=true` — enables mock-auth mode, the JWT is verified via `x-mock-sub`, not via a real OIDC.
**Frontend (Vitest + React Testing Library + Playwright):**
- Unit/component tests: `tests/setup.ts` globally mocks `react-oidc-context` (the OIDC auth library) — the OIDC state is available in tests with no extra setup.
- E2E tests (Playwright): run with `VITE_MOCK_AUTH=true` — activates `MockAuthProvider`, which automatically authenticates the user in the browser without a real OIDC provider.
**Coverage targets:** lines / functions / statements ≥ 80%, branches ≥ 70%
## Unit tests: complex business logic
| What we test | Inputs | Expected result | Why it's non-trivial |
|--------------|----------------|--------------------|--------------------|
## E2E scenarios (Playwright)
| Scenario | Steps | Expected result | Source in SPEC.md |
|----------|------|--------------------|--------------------|
## Critical paths (from SPEC.md §Testing)
<a full transfer of the critical scenarios without abbreviations>
## Negative scenarios (from SPEC.md §Testing)
<a full transfer of the negative scenarios without abbreviations>E2E tests use the ready-made infrastructure from test/utils/:
// Authentication in a test:
await client.loginAs(profile)
// Query:
const result = await client.requestGraphQL<MyQuery>(query, variables)
// Cleanup (mandatory in beforeEach):
await clearDatabase()
await clearRedis()Auth mock: OIDC_MOCK_ENABLED=true + the x-mock-sub header. Don't write your own mock mechanism.
Unit tests: Vitest + NestJS Testing Module. Service mocks — via the factories from test/utils/mocks.ts.
Three testing levels:
| Level | Tool | What to test |
|---|---|---|
| Unit | Vitest | Store logic, utilities, data transformations |
| Component | Vitest + React Testing Library | Component rendering, interactions, states |
| E2E | Playwright | User scenarios from SPEC.md |
Auth in tests:
tests/setup.ts (unauthenticated by default). Override it locally in a specific test.VITE_MOCK_AUTH=true — MockAuthProvider authenticates automatically.Coverage targets (mandatory):
An onboarding document: lets a new developer take the Blueprint and start working without learning the boilerplate. Generate it last — after DATABASE_MODEL.md, API_CONTRACTS.md, ARCHITECTURE.md, TESTING_PLAN.md, since it summarizes their contents.
# Implementation guide: <Product name>
**Status:** draft | **Date:** YYYY-MM-DD
## Stack
| Layer | Technology | Purpose |
|------|-----------|-----------|
| Backend | NestJS + Fastify | Node.js framework for the API server |
| GraphQL | MercuriusDriver | GraphQL server (Fastify adapter) |
| ORM | Prisma | TypeScript ORM for working with the DB |
| DB | PostgreSQL | Relational database |
| Queues | BullMQ + Redis | Background jobs and queues |
| Frontend | React + Vite | UI library + bundler |
| Router | TanStack Router | File-based routing for React |
| GraphQL client | URQL | API requests with caching |
| UI state | Zustand | Local state store |
| i18n | ParaglideJS | Localization (Vite plugin) |
| Backend tests | Vitest + E2EClient | Unit and E2E for the backend |
| Frontend tests | Vitest + RTL + Playwright | Unit, component, E2E for the frontend |
## What's already implemented
> These parts **don't need to be written** — they're ready in the project's starter templates.
### Backend
- **Authentication (OIDC JWT):** login via an external OIDC provider (Logto/Keycloak). NestJS guards: `JwtAuthGuard` (requires a token), `JwtOptionalAuthGuard` (optional), `RolesGuard` (by role). Resolver decorators: `@CurrentUser()` (get the current Profile), `@Roles(ProfileRole.ADMIN)` (restrict by role).
- **Profile — the user model:** `Profile { id, oidcSub @unique, roles, avatarUrl }`. The GraphQL operations are already implemented: `me` (get your profile), `updateProfile` (update it), `profileUpdated` (subscribe to changes).
- **Infrastructure:** Health check `GET /health`, BullMQ (task queues on Redis), Redis pub/sub (for GraphQL Subscriptions), nestjs-i18n en/ru, `gqlErrorFormatter` (automatic mapping of errors to the GraphQL format).
### Frontend
- **Authentication (OIDC PKCE):** `react-oidc-context` — a library for OAuth2/OIDC in React. The FSD slice `features/auth` contains: `AuthGuard` (blocks access for unauthenticated users), `MockAuthProvider` (automatic authentication in tests).
- **Ready-made UI components:** `widgets/Header` (navigation with login/logout buttons), `pages/404` (an error page with "Back" and "Home" buttons).
- **GraphQL API:** `shared/api/graphql-client` — a configured URQL client (a GraphQL client for React) with automatic insertion of the auth Bearer token.
- **Routing (TanStack Router):** `/callback` — the OIDC redirect handler after login; `*` — a 404 fallback via `defaultNotFoundComponent`.
## What needs to be implemented
> Everything described in this Blueprint.
### Backend modules
<the list from ARCHITECTURE.md §Backend: NestJS modules>
### Frontend slices (new)
<the list from ARCHITECTURE.md §Frontend: FSD slices — only the ones not in the boilerplate>
## Local run
### Requirements
- Node.js 20+, pnpm
- Docker (PostgreSQL + Redis)
- OIDC: mock mode is used for development
### Backend
```bash
pnpm install
cp .env.example .env
# Fill in: DATABASE_URL, REDIS_URL, JWT_SECRET, OIDC_ISSUER
docker compose up -d postgres redis
pnpm prisma migrate dev
pnpm start:devpnpm install
cp .env.example .env
# Fill in: VITE_API_URL, VITE_OIDC_AUTHORITY, VITE_OIDC_CLIENT_ID
VITE_MOCK_AUTH=true pnpm dev # development with mock authpnpm test # unit (Vitest)
pnpm test:e2e # e2e (requires Postgres + Redis)pnpm test # unit + component (Vitest + RTL)
VITE_MOCK_AUTH=true pnpm test:e2e # e2e (Playwright)Coverage: lines / functions / statements ≥ 80%, branches ≥ 70%
<Rationale for non-trivial technical decisions. Example: "Soft delete for Order — SPEC.md §Data forbids physical deletion". If there are no non-trivial decisions — write "No special non-trivial decisions".>
### Mandatory rules
- `## Stack` — a complete technology table with no abbreviations
- `## What's already implemented` — a precise list of the boilerplate: the developer sees what **doesn't need to be written**
- `## What needs to be implemented` — a concrete list of modules and slices from ARCHITECTURE.md, not generic phrases
- `## Local run` — real shell commands with `.env` and docker; not "see README"
- `## Testing` — run commands + coverage targets
- `## Key decisions` — not an empty section: either a rationale for the decisions or the explicit phrase "no non-trivial decisions"
**Forbidden:**
- Empty sections
- `## What needs to be implemented` without a list of concrete modules/slices
- Generic phrases instead of commands in `## Local run`
- Duplicating the full contents of the other Blueprint documents
---
## Adaptability: project update mode
If the project already has a `schema.prisma` or `schema.graphql`:
1. **Don't rewrite the schema from scratch.** Read the existing schemas, describe only the delta.
2. **DATABASE_MODEL.md must contain a `## Migration plan` section:**
```markdown
## Migration plan
### New tables
- `Notification` — user notifications
### Changes to existing tables
- `User` — add the field `avatarUrl String?`
- `Order` — add the enum value `OrderStatus.REFUNDED`
### Dangerous operations
- None## New operations and ## Changed operations.When the user says "check the spec", "validate the blueprint", "check blueprint", "look at what I changed" — perform the following sequence:
# Standard mode:
python3 {BLUEPRINT} validate "ProjectName"
# If the project is an update to an existing one:
python3 {BLUEPRINT} validate "ProjectName" --update-modeIMPLEMENTATION_GUIDE.md, DATABASE_MODEL.md, API_CONTRACTS.md, ARCHITECTURE.md, TESTING_PLAN.md
User, Session, AuthToken models — the user is only via Profile (oidcSub)login, register, logout, refreshToken GraphQL operations — OIDC is externalme, updateProfile, profileUpdated operations — already in the boilerplatefeatures/auth, widgets/Header, pages/404 — they already existbeforeLoad patternE2EClient.loginAs() (BE) or VITE_MOCK_AUTH=true (FE)## Blueprint review: <ProjectName>
### Validator script
✓ Passed without errors
— or —
✗ Errors: <list>
⚠ Warnings: <list>
### Conflicts with the boilerplate
✓ None found
— or —
✗ Found:
- <issue> → <how to fix>
### Consistency with SPEC.md
✓ All requirements covered
— or —
⚠ Not covered:
- <what's missing from the Blueprint>
### Conclusion
Ready for development / Needs fixes: <N issues>After the fixes — re-run the validator and create a git commit.
Script:
~/.config/opencode/skills/tech-blueprint/scripts/blueprint_validator.pyThe script is NOT copied into the project — it is used directly from the skill folder. Below:{BLUEPRINT}= the full path above.
prototype/: record the list of pages and the transitions between them. Don't transfer the implementation — only the scope. The prototype is a draft, architectural decisions are made independentlyschema.prisma, schema.graphql → determine the mode (new / update)Fill in strictly in this order:
DATABASE_MODEL.md → API_CONTRACTS.md → ARCHITECTURE.md → TESTING_PLAN.md → IMPLEMENTATION_GUIDE.mdEach subsequent document builds on the previous one (the API on the DB models, the architecture on the API). IMPLEMENTATION_GUIDE.md — last: it summarizes all four documents.
_ in the name) has createdAt/updatedAtdeletedAt DateTime? is added for critical entities[Type!]! in Query/Mutation without paginationsrc/, app/)## Migration plan section exists## Stack, ## What's already implemented, ## Local run# New project:
python3 {BLUEPRINT} validate "ProjectName"
# Updating an existing project:
python3 {BLUEPRINT} validate "ProjectName" --update-mode
# Non-standard output folder:
python3 {BLUEPRINT} validate "ProjectName" --output /path/to/blueprintThe documentation is not considered ready until validation passes without errors.
The script runs 8 or 9 checks:
```prisma and ```graphql blocks[...] have pagination argumentscreatedAt/updatedAt in each Prisma model (except join tables)## Stack, ## What's already implemented, ## Local run)--update-mode) The presence of a "Migration plan" section in DATABASE_MODEL.mdgit add blueprint/<ProjectName>/3_TECH_BLUEPRINT/
git commit -m "feat(blueprint): technical contracts for <ProjectName>"| Term | Meaning |
|---|---|
| Boilerplate | A starter project template with ready-made basic solutions (auth, infrastructure) |
| OIDC | OpenID Connect — an authentication protocol via an external service (Logto, Keycloak, Google) |
| JWT | JSON Web Token — a signed token confirming a user's identity |
| FSD | Feature-Sliced Design — a methodology for structuring the frontend by layers: app, pages, widgets, features, entities, shared |
| MercuriusDriver | A NestJS GraphQL adapter for the Fastify web framework (an alternative to Apollo Server) |
| URQL | A GraphQL client for React with a built-in cache and invalidation |
| Zustand | A minimalist state library for React (an alternative to Redux) |
| ParaglideJS | An i18n library with typed translation keys, runs as a Vite plugin |
| BullMQ | A task-queue library for Node.js based on Redis |
| E2EClient | A built-in test utility (test/utils/) for running GraphQL queries with mock auth |
| Profile | The user model in the DB; linked to OIDC via the oidcSub @unique field |
| TanStack Router | A file-based router for React: routes are defined by the structure of the src/routes/ folders |
| AuthGuard | An FSD slice component that redirects an unauthenticated user away from a protected page |
| beforeLoad | A TanStack Router hook for checking conditions before a page loads (used for protecting routes) |
[...] — must have pagination (limit/offset or first/after)@public, @UseGuards(JwtAuthGuard), @Roles(ADMIN))createdAt/updatedAtE2EClient.loginAs() (BE) and VITE_MOCK_AUTH=true (FE), coverage ≥ 80%/70%uxname/kodu
db733be
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.