Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .agents/skills/design-system/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: design-system
description: Build or restyle frontend UI the way this template's design system requires — tokens, palettes, App* components, Russian copy — add missing shadcn-vue primitives, and visually review the result in the browser. Use for any change to screens, components, styling, colors, theming, spacing or layout in frontend/, when a screen needs a UI primitive the kit lacks (accordion, slider, command, hover card…), and before finishing UI work.
---

# Design system

Rules: [frontend-concept.md](../../../docs/frontend-concept.md) — Design system, Templates, UI layers and visual review, Button and table variants. Live reference: `/ui`.

**Build**
1. Compose screens from `AppPageView`, `AppListTemplate`/`AppDetailTemplate`, `AppSection`, `AppCard` and other `App*` components. Features never import `reka-ui` or `shared/ui/shadcn` (the architecture guard fails).
2. Missing primitive? Extend a close `App*` component first; a genuinely new one → "Add a shadcn primitive" below.
3. Colors, radii, sizes only through tokens from `app/assets/styles/theme.css` via utilities (`bg-card`, `text-success`, `h-control-md`, `z-overlay`). No hex values, no `bg-[color:var(--…)]`, no inline geometry styles.
4. One vocabulary: `variant`, `tone` (`success`/`info`/`warning`/`destructive`), `size` (`xs`–`lg`). Two or more buttons in a row → `AppTemplateActions`; a single async click → `useActionState`.
5. Data through resource descriptors and Pinia Colada, never `useFetch`/`$fetch` for API resources. Icons: `@lucide/vue` components. Dates: `useDate()`.
6. Copy: **Russian** for product screens (titles, labels, placeholders, empty states, toasts, errors, aria-labels). `/ui` is the only English screen.
7. Re-branding (palette, neutral surfaces): "Re-branding a fork" in the doc; check `/ui` → Tokens.

**Add a shadcn primitive** — procedure: [frontend-concept.md → Adding a shadcn primitive](../../../docs/frontend-concept.md#adding-a-shadcn-primitive).
1. Confirm it is missing in `frontend/app/shared/ui/shadcn/` and `shared/ui/app/App*`.
2. `cd frontend && pnpm ui:add <name>` — never `pnpm dlx shadcn-vue` directly (the script fixes the `cn` import and formats).
3. Review `shared/ui/shadcn/<name>/`: `z-50` → `z-overlay`, semantic token classes only, everything exported from `<name>/index.ts`.
4. Wrap it as `shared/ui/app/App<Name>.vue`: Russian default texts, the shared vocabulary and control sizes (`shared/ui/app/types/control.ts`). Features use only the wrapper.
5. Showcase it on `/ui` in the matching `features/ui/components/Ui*Showcase.vue` (English) with variants and states — knip fails on unused files. New building block → add it to the Templates table in the doc.

**Review in the browser** (required; `make check` does not replace it)
1. `make run-backend` + `make run-frontend` (or reuse running servers), sign in at `/auth`. Map the diff (`git diff HEAD -- frontend/app`) to routes: `pages/**` → its route, feature views → the pages that mount them, `shared/ui/**` → `/ui` plus every screen using the component.
2. Each affected route at **390, 768 and 1440 px**, in **light and dark**, and with a non-default palette when colors changed.
3. Walk "UI layers and visual review" in the doc: empty/loading/error/retry, long text, create/edit/delete, disabled/loading buttons, modals and drawers (stacking, Escape, focus return), no horizontal page scroll, double scrollbars or overlapping fixed regions, no console errors or hydration warnings after reload.
4. Report the routes, viewports and themes you checked and what you fixed; say plainly if no browser was available.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: new-domain
description: Add a new business entity end to end (backend domain + frontend feature) in this FastAPI + Nuxt template. Use when the user asks to add a domain, model, entity, CRUD screen, resource or "a list of X" to the product, or runs /new-domain. Not for extending an existing domain.
description: Add a new business entity end to end (backend domain + frontend feature) in this FastAPI + Nuxt template, then self-review it against the backend rules. Use when the user asks to add a domain, model, entity, CRUD screen, resource or "a list of X" to the product, or invokes new-domain (/new-domain, $new-domain). Not for extending an existing domain.
---

# New domain
Expand All @@ -11,9 +11,16 @@ Scaffold first, then shape. Rules live in the docs; this is the order of work.
2. **Scaffold:** `make new-domain name=<snake_name> title="Счета" item_title="Счёт"` (`plural=<snake_plural>` if the default is wrong). It refuses to overwrite; read its "Next steps".
3. **Backend fields** in `backend/app/domains/<name>/`: `models.py` (keep `organization` FK + `tenant_scope` unless the user says otherwise), `schemas.py` (separate update schema; immutable ownership fields only on create), `filters.py`. Non-CRUD logic → `services/<name>_service.py` class. Rules: [backend-concept.md](../../../docs/backend-concept.md) (Model, Schemas, Views, Scoping, Services).
4. **Tests:** extend `tests/test_<name>.py` for every non-obvious rule. Run `cd backend && uv run pytest app/domains/<name> --sqlite` (no migration exists yet).
5. **Migration:** do NOT run `make mm` / `make m`. Tell the user the domain needs a migration and ask them to run both (a hook blocks it; `ALLOW_MIGRATIONS=1` only after their explicit yes).
5. **Migration:** do NOT run `make mm` / `make m`. Tell the user the domain needs a migration and ask them to run both (`ALLOW_MIGRATIONS=1` only after their explicit yes; in Claude Code a hook enforces this).
6. **Client:** `make gen-client`, then adapt `frontend/app/features/<camelName>/resources/<camelName>.ts` (form type, `toCreate`/`toUpdate`) and the list/detail views. UI copy Russian; App* components only — [frontend-concept.md](../../../docs/frontend-concept.md) (Resource descriptor, Templates).
7. **Navigation:** the scaffolder added an entry to `frontend/app/navigation/settings.ts` with a `Folder` icon — pick a fitting Lucide icon; set `superuserOnly` if needed. Main-app (non-settings) screens go to `layouts/default.vue` instead.
8. **Docs:** add the scenario to `docs/product.md` (what the user can see and do).
9. **Verify:** `make lint`, then the `/verify` skill (`make check`; `PYTEST_ARGS=--sqlite` until the user has migrated). For UI, the `design-system` skill's visual review; optionally the `domain-reviewer` and `ui-reviewer` subagents on the diff.
10. **Commit:** `feat(<name>): …` — one feature per commit series.
9. **Self-review the backend diff** (`git diff HEAD -- backend/`) against [backend-concept.md](../../../docs/backend-concept.md) and the canonical `backend/app/domains/organization/`; fix every miss:
- every model has `tenant_scope` (`Scope(user=...)`, plus `organization=` for org data) or `Unscoped(reason=...)` with a real reason; no superuser bypass inside the scope;
- models inherit `BaseModel`, FK + `<name>_id: UUID` annotation, plural `related_name`, `Meta.table` and `ordering`;
- Create / Update / Read schemas; ownership fields never in Update; `organization` from auth, not the body;
- viewset is thin (schema, permissions, queryset, filterset) and `views.py` exports `routers`; loading and rule checks live in the service (`validate_*`);
- errors via `AppException.from_attrs(ErrorCode...)`; router has a plural kebab tag, actions have return types, `openapi.json` + generated client regenerated;
- tests cover the non-obvious rules and tenant isolation, using the `auth_headers` / `*_factory` fixtures.
10. **Verify:** `make lint`, then `make check` (`PYTEST_ARGS=--sqlite` until the user has migrated). UI → the `design-system` skill's visual review.
11. **Commit:** `feat(<name>): …` — one feature per commit series. Report the pending migration to the user.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sync-template
description: Pull improvements from the upstream FastAPI + Nuxt template into a product created from it, path by path according to the ownership map. Use when the user asks to sync, update or upgrade from the template, pull template changes, or runs /sync-template in a fork.
description: Pull improvements from the upstream FastAPI + Nuxt template into a product created from it, path by path according to the ownership map. Use when the user asks to sync, update or upgrade from the template, pull template changes, or invokes sync-template (/sync-template, $sync-template) in a fork.
---

# Sync template
Expand Down
24 changes: 0 additions & 24 deletions .claude/agents/domain-reviewer.md

This file was deleted.

21 changes: 0 additions & 21 deletions .claude/agents/ui-reviewer.md

This file was deleted.

16 changes: 0 additions & 16 deletions .claude/skills/add-shadcn-component/SKILL.md

This file was deleted.

1 change: 1 addition & 0 deletions .claude/skills/design-system
23 changes: 0 additions & 23 deletions .claude/skills/design-system/SKILL.md

This file was deleted.

1 change: 1 addition & 0 deletions .claude/skills/new-domain
15 changes: 0 additions & 15 deletions .claude/skills/release/SKILL.md

This file was deleted.

1 change: 1 addition & 0 deletions .claude/skills/sync-template
Loading