Execute one Micro-Spec slice in the Nabaperks repo end to end — narrow the scope against live code, implement test-first (Red → Green → Refactor), and pass the full verification gate before declaring done. Use when asked to implement, change, or fix product behaviour here.
Resources
18Install
npx skillscat add lapeninns/nabaperks Install via the SkillsCat registry.
Ship a slice
A repeatable workflow for landing a change in this repo without widening scope or
breaking the trust mechanic. Binding rules live in CLAUDE.md,Instructions_tdd.md, and micro-specs/GLOBAL_CONTEXT.md — this skill is the
operational checklist.
1. Narrow the work
- Read the AI governance contract in
micro-specs/README.md, then find the
Micro-Spec inmicro-specs/(or write one withInstructions_MircroSpecsCreation.md). - Inspect live code first — much is already built. Reduce the task to what is
still missing. Never widen the spec's blast radius (the files/dirs it may
touch) without approval. - Confirm the spec is
activebefore implementation.draftandsuperseded
specs require a new active spec or anapproved_exceptionsrecord before
Red → Green → Refactor starts. - Confirm the change preserves the QR / customer / merchant / admin flows and the
mutation boundary (loyalty writes go through the security-definer RPCs).
2. Red — a failing test per in-scope requirement
- Vitest specs in
tests/micro-specs/(mock Supabase viatests/helpers/supabase.ts). - Postgres invariants RLS/atomicity can't be mocked → SQL in
supabase/tests/. - Run it and watch it fail for the right reason:
pnpm vitest run tests/micro-specs/<file>.test.ts
3. Green — the smallest code that passes
- Fake It (hardcode) when the algorithm is unclear, then Triangulate with a
second input. Obvious Implementation only for trivial behaviour. - Honour the design system: theme via
app/globals.csstokens + the Wet Inkdata-slotlayer; never restylecomponents/ui/primitives. Icons use the@hugeiconsfree set via the brandIconwrapper (the✱disc stays the
logo signature only). No emoji, no exclamation marks. Copy is plain, warm,
en-GB.
4. Refactor under green
- Remove duplication only on the third occurrence (Rule of Three). Change
structure, not behaviour.
5. Verification gate (all must pass)
pnpm lint
pnpm typecheck
pnpm test # add pnpm test:coverage when touching lib/
pnpm governance
pnpm quality # naming, debt, N+1, AGENTS.md, complexity, routes, dead/dup code
pnpm buildTouched the data layer or RLS? also pnpm db:verify and the relevantsupabase/tests SQL. Touched a customer surface? a Playwright smoke
(npx playwright test). New route or handler? pnpm docs:routes and commitdocs/ROUTES.md.
6. Definition of done
All in-scope Micro-Specs pass; production code satisfies only the required
behaviour; fakes are triangulated away; no out-of-scope functionality, no retired
naming, no new shared staff secrets. Then write the PR using.github/pull_request_template.md.