Bootcamp — Toolkit
BOOTCAMP — TOOLKIT REFERENCE

Leave Management Toolkit

Everything you need in one place — skills, hooks, MCP configs, plugins, and ready-to-use prompts for the Leave Management project. Copy-paste directly into your setup.

FormatReference
TypeSingle Page
SectionBootcamp 2026

Start here — clone the base template. This repo already has the skills, hooks, MCP servers, and plugins from this page wired up. Clone it before you start building the Leave Management System.

Open repo →
bash
git clone https://github.com/FiftyfiveTech/claude-base-project-template.git
SKILL — feature-development

Feature Development

How to scope, plan, implement, and prove a feature works. Stack-independent discipline for any task.

Triggers when: starting any feature or bugfix — how to scope it, plan it, implement it, and prove it works. Read before writing code for a new task, and when a task is drifting or you've corrected the same mistake twice.

---
name: feature-development
description: Use when starting any feature or bugfix — how to scope it, plan it, implement it, and prove it works. Read before writing code for a new task, and when a task is drifting or you've corrected the same mistake twice.
---

# Feature Development

How to build one feature or fix one bug well, working with an AI agent. Stack-independent — the discipline is the same whether you're in a web app, a service, or a CLI.

## The loop: Explore → Plan → Implement → Verify → Commit

Never go straight to code. Have the agent read the relevant code and state a plan first; approve the plan, then implement.

**Why:** jumping to code produces a plausible-looking solution to the wrong problem. A wrong plan costs a paragraph to fix; a wrong implementation costs a day. Skip planning only when the change is genuinely a one-sentence diff.

## Define done before you start

Write the pass/fail signal *first*, as something a machine can run. Fill this in before the first line of code:

```
Goal:        <one sentence — the behaviour a user gets>
Done when:   <the exact command + expected output, or the test that must go green>
Touching:    <files/modules expected to change>
Out of scope: <what this task explicitly does NOT do>
```

**Why:** without an executable definition of done, an agent stops when work *looks* done, and every gap waits for a human to find it later. "Add validation" has no failure condition. "`createUser` rejects a blank email with a 400, and `npm test auth` passes" does.

## Point at existing code, don't describe abstractly

"Follow the pattern in `OrderService.create`" beats "add order creation logic." "Match the error shape in `handlers/users`" beats "handle errors properly."

**Why:** a concrete reference makes the agent match your codebase's real conventions instead of inventing a second, slightly different way to do something you already do.

## Delegate exploration, and scope it narrowly

Push investigation into a subagent so its reading cost stays out of your main conversation — only the summary comes back. But scope the ask: *"find every call site of `chargeCard` under `src/billing`"*, not *"investigate the payments system."*

**Why:** an unscoped investigation expands until it fills its own context and hands back a bloated, low-signal summary. Narrow questions get usable answers.

## Trust evidence, not assertions

Ask for the actual output: the test run, the command and its exit code, the response body, the screenshot. "Done, tests pass" is not evidence.

**Why:** it's the only way to check work you didn't watch happen, and reading real output is faster than re-deriving whether a claim is true.

## Course-correct twice, then start clean

Escalate in this order, cheapest first:

1. **Interrupt** mid-action and redirect — context is preserved.
2. **Ask for a revert** of the last change.
3. **Start a fresh session**, re-prompting with the lesson baked into the new instructions.

**Why:** a session that has failed the same correction twice is mostly a record of failed approaches, and the agent keeps re-reading that record. A short, well-aimed fresh prompt beats a long polluted one — but reach for the light tools first.

## Take risks cheaply with checkpoints

Let the agent attempt something uncertain and roll back if it's wrong, rather than over-planning every step. Claude Code snapshots on each prompt (`/rewind` to restore conversation, code, or both).

**Caveat:** snapshots only track the agent's own edits — not your manual edits and not changes made by shell commands. Commit to git at every working state anyway.

## Escalate thinking only when stuck

Default to normal effort. If the output is shallow or the agent is looping, retry with a higher effort setting; reserve maximum effort for genuine architecture decisions.

**Why:** most feature work doesn't benefit from extra deliberation — it just costs time.

## Interview-then-spec for anything non-trivial

For a feature bigger than a single file: have the agent ask *you* clarifying questions first, then write a self-contained spec (files touched, interfaces, out of scope, how to verify) — then implement from that spec in a **fresh session**.

**Why:** exploring tradeoffs and implementing are two different jobs with two different context needs. Separating them keeps both sharp, and the spec is a durable artifact you can review before any code exists.

## Keep the project briefing short

Your `CLAUDE.md` is read every session. Every line must pass: *"would removing this cause a mistake?"* If it wouldn't, delete it.

**Why:** long briefings bury signal in noise, and rules get silently deprioritized as the file grows. A correction you've had to give three times doesn't belong in more briefing text — it belongs in a hook, which the harness enforces rather than the model choosing to comply.

## Checklist

- [ ] Definition of done written as a runnable command or test, before starting.
- [ ] Out-of-scope stated explicitly.
- [ ] An existing pattern named for the agent to follow.
- [ ] Verified with real output, not a claim.
- [ ] Diff reviewed with fresh eyes before commit (see `code-review`).
- [ ] Committed at each working state.

## Don't

- Run a **kitchen-sink session** — asking an unrelated question mid-task pollutes the context for the rest of the work. Finish, then switch.
- Accept "done" without the output that proves it.
- Keep correcting the same misunderstanding in the same session past the second attempt.
- Let a task grow mid-flight. New requirement, new task, new definition of done.
- Treat checkpoints as a backup strategy. They aren't git.

## Pairs with

- `testing` — writing the failing test that becomes your definition of done.
- `code-review` — the fresh-eyes pass before you commit.
- `frontend-practices` / `backend-practices` — the standards to build against.
- `ponytail-minimalism` — keeping the implementation to the smallest thing that solves it.
SKILL — code-review

Code Review

Review order, per-layer checks, and how to report findings. Correctness first, style last.

Triggers when: reviewing a diff or PR before merge — your own or a teammate's, frontend or backend. Covers review order, per-layer checks, and how to report findings.

---
name: code-review
description: Use when reviewing a diff or PR before merge — your own or a teammate's, frontend or backend. Covers review order, per-layer checks, and how to report findings.
---

# Code Review

Review in this order. Correctness first, style last — a review that opens with naming nitpicks has already lost the author's attention.

## Review order (both layers)

1. **Correctness.** Does it do what it claims? Walk the actual logic with a concrete input. Don't skim variable names and assume.
2. **Edge cases.** Empty input, null/undefined, zero, very large input, duplicate or concurrent calls. Which of these is unhandled?
3. **Security.** Any untrusted input reaching a query, a shell command, a file path, or rendered output without being parameterized or escaped?
4. **Scope.** Does the diff touch only what the task asked for? Flag unrelated changes — they hide real ones.
5. **Tests.** Is the new behaviour tested? Would the test actually fail without this change?
6. **Simplification.** Duplicated logic that could reuse something existing? Abstraction added for a "future" case that doesn't exist yet?
7. **Style and naming** — only after 1–6.

**Why this order:** the cost of a missed bug is orders of magnitude above the cost of an imperfect name, and reviewer attention is finite. Spend it top-down.

## Every finding cites `file:line`

No citation, no finding. A claim inferred from a function's name — "this probably doesn't handle X" — is a guess, and sending the author to chase a non-issue is how a review loses credibility. Open the file, confirm the behaviour, cite the line.

## Frontend lane

| Check | Looking for |
| ----- | ----------- |
| Accessibility | Semantic elements over click-handlers on generic containers; visible focus state; keyboard-operable; labels on inputs; contrast met |
| States | Does every async/interactive surface handle loading, empty, error — not just the success path? |
| Double-submit | Is the submit control disabled while a request is in flight? |
| Tokens | Colors/spacing/type referencing shared tokens, or raw literals sprinkled inline? |
| Secrets | Any key, token, or credential in client code — anything shipped to the browser is public |
| Trust boundary | Client-side validation treated as *the* validation, with no server check behind it |
| Render cost | Work repeated on every render; unstable list keys; a heavy dependency pulled in for one helper |

## Backend lane

| Check | Looking for |
| ----- | ----------- |
| Authorization | Not just *is the caller logged in* but *may this caller touch this specific record* — the more commonly missed of the two |
| Input validation | Validated and typed at the boundary where it enters, with an allow-list of fields |
| Query construction | Parameterized/ORM-bound, never string-built from input |
| N+1 | A query inside a loop over results |
| Transactions | One unit of work per transaction, with explicit boundaries — no partial writes on failure |
| Idempotency | A retryable write that would double-apply if the client retries |
| Response shape | Consistent envelope; no internal-only or other users' fields leaked |
| Errors | Specific type, plain-language message out, full detail to the log, no stack trace in the response |
| Migrations | Reversible, and safe to run while the previous version is still serving traffic |
| Unbounded results | A list endpoint with no pagination |

## Output format

One line per finding: `severity — file:line — problem — suggested fix`.

- Severities: 🔴 **Important** (correctness, security, data loss) · 🟡 **Nit** (style, preference) · 🟣 **Pre-existing** (already broken before this diff).
- Cap nits at **5** and tally the rest ("+8 similar naming nits"). Without a cap, reviews balloon into style noise and teams tune the review out entirely.
- Skip generated, vendored, and lockfile paths.
- Scale effort to risk: a copy change gets a skim; an auth or payment path gets the full ladder.
- Findings are **signal, not a merge gate.** A reviewer asked to find problems will always find something — false positives are what destroy trust in review.
- No praise padding, no "looks good overall" filler. Findings, or "no issues found."

## Review with fresh eyes

Have the reviewer see only the diff and the acceptance criteria — never the reasoning that produced the change. Self-review inherits the same blind spots that created the bug. When using an AI reviewer, run it on the diff in a separate session or via `/code-review` before you push; keep architecture and intent judgement with a human.

## Checklist

- [ ] Walked the main logic path with a concrete input.
- [ ] Edge cases named and checked (empty, null, zero, boundary, duplicate).
- [ ] Untrusted input traced to every place it lands.
- [ ] Diff contains nothing the task didn't ask for.
- [ ] New behaviour has a test that would fail without the change.
- [ ] Every finding has a `file:line`.

## Don't

- Rubber-stamp because the diff is small — small diffs ship outages too.
- Review the PR description instead of the code.
- Block on a style preference that isn't in the project's stated conventions.
- Report a suspicion as a defect. Verify it or drop it.
- Demand an abstraction the current requirements don't need.

## Pairs with

- `testing` — judging whether the tests in a diff are real or decorative.
- `backend-practices` / `frontend-practices` — the standards the lanes above are checking against.
- `ponytail-minimalism` — the over-engineering pass, run alongside this correctness pass.
SKILL — testing

Testing

How to write tests that catch bugs instead of padding a coverage number. Framework- and language-agnostic.

Triggers when: writing, updating, or reviewing any test — unit, integration, or end-to-end — and when fixing a bug (reproduce it with a failing test first). Covers what to test, structure, naming, mocking, flake prevention, and coverage stance.

---
name: testing
description: Use when writing, updating, or reviewing any test — unit, integration, or end-to-end — and when fixing a bug (reproduce it with a failing test first). Covers what to test, structure, naming, mocking, flake prevention, and coverage stance.
---

# Testing

How to write tests that catch bugs instead of padding a coverage number. Framework- and language-agnostic.

## Layer your verification

**Lint → unit → integration → end-to-end.** Require all four, weighted: most tests unit, fewest end-to-end.

**Why:** any single layer under-specifies "done." Lint says nothing about logic, unit tests miss integration boundaries, and end-to-end is too slow and too coarse to catch internal correctness early.

## Write the failing test first — and commit it

Confirm it fails for the right reason, commit it, then implement without touching the test until it's green.

**Why:** committing the test first gives you a diff that exposes the failure mode where the test gets quietly edited to match the code instead of the code being fixed. It also makes the test an executable definition of done rather than a description of one.

## The anti-pattern to watch for

Tests written **after** the implementation, mirroring its assumptions.

**Why:** such tests confirm the code does what it already does. They cannot catch the bug that matters, and they pass just as happily when the logic is wrong. If a test was written by reading the implementation, it's documentation, not verification.

## What to test

1. **Happy path** — normal input, expected output.
2. **Edge cases** — empty, null/undefined, zero, boundary values (min/max, off-by-one), duplicate calls, very large input.
3. **Error paths** — assert the *specific* error, not merely that something threw.
4. **One behaviour per test.** If the test name needs "and", split it.

## Structure: Arrange / Act / Assert

```
// Arrange — set up input and dependencies
// Act — call the thing under test, once
// Assert — check the result
```

Three visible beats. A test with assertions interleaved through five actions can't tell you which step broke.

## Naming

`should <expected behaviour> when <condition>` — e.g. `should return 404 when user not found`.

**Why:** the failure output should tell you what's broken without opening the test file.

## Mocking

- **Mock external boundaries only** — database, network, filesystem, third-party APIs, clock. Never mock the code under test.
- **Prefer a cheap real implementation** (an in-memory store, a temp directory) over a mock. Mocks drift out of sync with real behaviour and then pass while production fails.
- If you must mock, **mock the smallest thing** — one method, not a whole module.
- A test that mocks everything it touches asserts only that your mocks were configured as written.

## Determinism — the flake rules

- **No sleeps.** Wait on a condition, not on a duration.
- **Inject the clock**; never assert against the real current time.
- **Seed randomness** so a failure can be reproduced.
- **No shared mutable state**, and no test that depends on another test running first. Tests must pass in any order and in parallel.
- **Each test creates and cleans up its own data.**

**Why:** a flaky test is worse than no test — teams learn to re-run it, and the one time it was a real failure gets re-run away too.

## The mutation check

Revert the fix or the feature. Does the test fail?

If it passes either way, it tests nothing — regardless of the coverage it reports.

## Reproduce-then-fix, every bug

Write a failing test that reproduces the bug **before** touching the fix.

**Why:** it forces root-cause diagnosis instead of a patch that makes the symptom disappear, and it leaves behind a permanent regression guard for free.

## Coverage

Don't chase 100%. Spend effort on **auth, payments, and business logic**; skip the trivial glue. Coverage gains flatten hard once the risky paths are covered.

(~80% is a common convention, not a rule. A number is a smell detector, not a goal — 100% coverage of assertion-free tests is worth nothing.)

## Layer-specific notes

**Frontend:** assert user-visible behaviour through accessible queries (role, label, visible text), never internal state or CSS class names. A test that breaks when you rename a class is testing the wrong thing.

**Backend:** test through the real boundary where it's affordable — a real database in a container, or a transaction rolled back after each test — rather than mocking the data layer. Most data-layer bugs are exactly the ones a mocked repository hides.

## Working with an AI agent

Give concrete cases, not a vague ask:

> `validateEmail`: `user@example.com` → true, `invalid` → false, `user@.com` → false. Write the tests first, confirm they fail, then implement. Show me the test output.

**Why:** concrete examples double as the spec. "Add tests" gets generic happy-path coverage that doesn't stress the real risk. And ask for the actual run output — not a claim that it passed.

## Checklist

- [ ] Test written before the implementation, and confirmed failing first.
- [ ] Happy path, edge cases, and error paths all covered.
- [ ] One behaviour per test; name reads as a sentence.
- [ ] Only external boundaries mocked.
- [ ] No sleeps, no real clock, no shared state, passes in any order.
- [ ] Mutation check: fails if the change is reverted.
- [ ] Whole file/suite run, not just the new test.

## Don't

- Test private internals — test the public behaviour.
- Assert on log output as a proxy for behaviour.
- Write one giant test that asserts twelve unrelated things.
- Add assertion-free or `assert(true)`-shaped tests to lift a coverage number.
- Loosen an assertion to make a red test pass.
- Leave a skipped test in the suite with no issue tracking it.

## Pairs with

- `feature-development` — the failing test *is* your definition of done.
- `code-review` — judging whether the tests in a diff are real or decorative.
- `backend-practices` / `frontend-practices` — what's worth testing in each layer.
SKILL — backend-practices

Backend Practices

Industry-standard server-side engineering — layering, contracts, validation, auth, errors, data integrity, logging, and performance.

Triggers when: writing or reviewing server-side code — adding or changing an API endpoint, throwing or handling an error, touching auth or data access, writing a query or migration, or adding a background job.

---
name: backend-practices
description: Use when writing or reviewing server-side code — adding or changing an API endpoint, throwing or handling an error, touching auth or data access, writing a query or migration, or adding a background job. Covers layering, contracts, validation, auth, errors, data integrity, logging, and performance.
---

# Backend Practices

Industry-standard server-side engineering, framework- and language-agnostic. Applies to REST, RPC, GraphQL, and anything else with a request boundary.

## Layering

**Transport** (route/controller/handler) → **service** (business logic) → **repository** (data access).

- The transport layer parses, validates, and calls one service function. No business rules.
- The service layer holds the rules and knows nothing about HTTP status codes or request objects.
- The repository layer is the only place that talks to the database.

**Why:** business logic embedded in a route handler can't be reused, can't be tested without a fake request, and gets copy-pasted into the next endpoint that needs it.

## API contracts

- **Define the shape before you code it**: request params/body, success response, and every error case. Shape drift mid-implementation is where consumers break.
- **One envelope across the whole API.** Follow your project's existing success/error format; don't invent a one-off for this endpoint.
- **Empty results are a success**, returning an empty list — not a 404, not an error.
- **One shape per endpoint.** Never return an object sometimes and a list other times depending on internal state.
- **Breaking change → new version.** Don't mutate an existing contract under live consumers.
- Declare required vs optional explicitly, and document each error case you can actually produce.

## Validate at the boundary

Validate and type untrusted input **where it enters the system**, using an **allow-list** of known fields — unknown fields are rejected or stripped, never silently accepted and stored.

Validate once, at the edge. Internal functions then trust their callers instead of re-checking defensively at every level.

**Why:** a block-list is a list of the attacks you thought of. An allow-list is a list of what your system actually accepts. And input that came "from our own frontend" is still input from the network.

## Auth: two separate questions

1. **Authentication** — who is calling?
2. **Authorization** — is this caller allowed to touch *this specific resource*?

Both, on every endpoint. Missing the second — "user A can read user B's record by changing the ID in the URL" — is the single most common real-world security bug in application backends.

Default to deny; grant explicitly. Give each service and credential the least privilege that lets it work.

## Errors

- **Throw specific, typed errors**, not a generic one, so callers can handle by type.
- **Plain-sentence message to the caller**, full detail to the logger. `"No account found with that ID."` — not `"Cannot read property 'id' of undefined"`.
- **Never swallow an error silently.** An empty catch block hides real bugs; at minimum, log it.
- **Only catch what you can handle** (retry, fall back, translate). Catch-and-rethrow with nothing added is noise.
- **A client mistake is not a 500.** Map validation failures, missing resources, and permission denials to their own statuses.
- No secrets, internal paths, SQL, or stack traces in a response body.

## Data integrity

- **One transaction per unit of work**, with explicit boundaries. A multi-step write that can half-succeed will half-succeed in production.
- **Constraints belong in the database** — not-null, unique, foreign keys — not only in application code. Application checks race; database constraints don't.
- **Idempotency on retryable writes.** Accept a client-supplied idempotency key on anything that charges, sends, or creates, so a retry after a timeout doesn't double-apply.
- **Migrations:** forward-only, reversible, and safe to run while the *previous* version of the app is still serving traffic. Add a column before you read it; stop reading a column before you drop it.

## Performance

- **Watch for N+1** — a query inside a loop over query results. It looks fine with 10 rows and falls over at 10,000.
- **Index what you filter, sort, and join on.** Read the query plan; don't guess.
- **Paginate every list endpoint.** No unbounded result sets, ever, including internal ones.
- **Cache only with an explicit invalidation story.** A cache you can't invalidate is a stale-data bug on a timer.
- **Measure with realistic data volumes.** Nothing is slow at 20 rows.

## Configuration and secrets

Config comes from the environment; the same built artifact runs in every environment. Nothing secret is committed, hardcoded, or logged. Fail fast and loudly at startup on missing required config rather than at 3am on the first request that needs it.

## Observability

- **Structured logs** (key-value fields), not prose strings you'll later regret grepping.
- Thread a **correlation/request ID** through the whole request, including into background jobs, so one user's failure can be traced end to end.
- Log the operation, the relevant inputs, and the outcome — enough to debug without the original request in front of you. Never log credentials, tokens, or personal data you don't need.
- A **health endpoint that actually checks dependencies**, not one that returns `200 OK` unconditionally.

## Security pass

- Parameterized/ORM-bound queries only — never a query string-built from input.
- **Rate-limit expensive and sensitive endpoints**: login, search, export, upload, anything that sends mail.
- Escape or sanitize anything rendered as HTML or written into a template.
- Validate uploads by declared type *and* real content *and* size, and store them outside the web root.
- Check responses for fields that shouldn't be there — password hashes, internal flags, other users' data.

## Background jobs

Jobs must be **idempotent and retry-safe** — assume every job runs at least once and sometimes twice. Set a timeout, cap retries with backoff, and route exhausted jobs to a dead-letter queue **that someone is alerted about**. A queue is not a place for failures to go quiet.

## Checklist

- [ ] Request, success, and error shapes written down before coding.
- [ ] Input validated and typed at the boundary, allow-list only.
- [ ] Authentication *and* per-resource authorization on the endpoint.
- [ ] Errors typed, messages plain, details logged, nothing sensitive leaked.
- [ ] Multi-step writes inside one transaction.
- [ ] List endpoint paginated; no query inside a loop.
- [ ] Config from environment; no secret in the diff.
- [ ] Migration is reversible and safe against the previous app version.

## Don't

- Put business logic in a route handler.
- Build a query by string concatenation with any input in it.
- Return a generic 500 for what is clearly a client error.
- Catch an error, rethrow it unchanged, and call that handling.
- Trust input because it came from your own frontend.
- Ship a list endpoint with no pagination.
- Add a cache without deciding how it gets invalidated.

## Pairs with

- `frontend-practices` — the client consuming these contracts.
- `testing` — testing through the real boundary instead of mocking the data layer.
- `code-review` — the backend lane runs this checklist against a diff.
SKILL — frontend-practices

Frontend Practices

Industry-standard frontend engineering — structure, state, accessibility (WCAG 2.2 AA), performance, design tokens, and client-side security.

Triggers when: building or reviewing any UI — a component, page, layout, form, or client-side data fetch. Framework-agnostic.

---
name: frontend-practices
description: Use when building or reviewing any UI — a component, page, layout, form, or client-side data fetch. Covers structure, state, accessibility (WCAG 2.2 AA), performance, design tokens, and client-side security.
---

# Frontend Practices

Industry-standard frontend engineering, framework-agnostic. Applies to plain HTML/CSS and to any component framework.

## Visual fundamentals

1. **Hierarchy before decoration.** Decide what the user sees first, second, third — then use size, weight, and spacing to enforce that order. Contrast creates hierarchy; decoration doesn't.
2. **Spacing on one scale.** Pick a scale (e.g. 4px steps: 4/8/12/16/24/32/48) and use only those values. Consistent rhythm reads as designed; arbitrary margins read as broken even when nothing is technically wrong.
3. **Restrained typography.** One or two families, a small type scale (e.g. 12/14/16/20/24/32), body line-height ~1.5, line length 45–75 characters.
4. **Colors named by role, not hue.** `--color-bg`, `--color-text`, `--color-danger` — never raw hex scattered through markup. Roughly 60% neutral / 30% secondary / 10% accent.
5. **Reuse before inventing.** Check for an existing component, token, or pattern first. A second slightly-different button is a bug, not a feature.

## Design tokens

Centralize color, spacing, type, radius, shadow, and z-index as **tokens** (e.g. `color.text.primary`, `space.4`). Components reference tokens; they never hardcode literals.

**Why:** tokens are the single source of truth that keeps a UI coherent as it grows, and they make re-theming possible without hunting through markup.

## Component structure

- **One responsibility per component.** If you can't name it without "and", split it.
- **Separate presentational from data-fetching.** A component that both queries and renders is hard to test and impossible to reuse.
- **Props are a contract** — explicit and typed where the language allows. Don't pass a bag of unrelated options.
- **Don't drill props more than about two levels.** Deeper than that, use composition or shared context.
- **Colocate** a component with its styles and its tests.

## State

- Keep state as **local as possible**; lift it only when a second component genuinely needs it.
- **Derive, don't duplicate.** Two sources of truth for the same fact will disagree eventually.
- **Server data is a cache**, not application state — it can be stale, absent, or failed, and needs invalidation.
- **The URL owns shareable state** — filters, tabs, pagination, selected item. If a user can't send a teammate the link and see the same screen, the state is in the wrong place.

## Data fetching: all four states, always

Every asynchronous surface ships **loading**, **empty**, **error**, and **success**. Not three of them.

**Why:** the missing states are exactly where a UI feels broken — a blank box instead of a helpful zero-state, a spinner that never resolves, a raw stack trace where a sentence should be.

## Forms

- Every input has a real, associated label — placeholder text is not a label.
- Validate on blur and again on submit; show each error adjacent to its field, in plain language, saying how to fix it.
- Disable the submit control while the request is in flight to prevent double-submit.
- **Client validation is a convenience, never the guarantee.** The server revalidates everything regardless.
- Don't clear the user's input on a failed submit.

## Accessibility — WCAG 2.2 AA, non-negotiable

- [ ] Contrast ≥ **4.5:1** body text, **3:1** large text and UI boundaries/icons.
- [ ] **Visible focus state** on every interactive element — never remove the outline without an equally visible replacement.
- [ ] Fully **keyboard operable**: logical tab order, Enter/Space activation, no keyboard traps, focus managed when opening/closing overlays.
- [ ] **Semantic HTML** — real `<button>`/`<a>`/`<label>`, landmarks, headings in order. A `<div>` with a click handler is not a button.
- [ ] Meaningful images have alt text; decorative ones use `alt=""`.
- [ ] Respect `prefers-reduced-motion`.
- [ ] Never convey meaning by **color alone** — add an icon, text, or shape.
- [ ] Touch/click targets ≥ **24×24px** (44px preferred).

**Why:** these are legal and ethical baselines, not polish. Skipping them locks real users out, and retrofitting costs multiples of building it in.

## Responsive

Mobile-first: style the small screen, then add `min-width` breakpoints. Prefer fluid units and `max-width: 100%` on media over fixed pixel widths. The page body must never scroll horizontally.

## Performance

- Set a **budget** and measure against it: Largest Contentful Paint, Cumulative Layout Shift, Interaction to Next Paint. "Feels fast on my machine" is not a measurement.
- **Code-split by route**; lazy-load anything below the fold.
- Give images explicit dimensions or an aspect ratio — undeclared media is the most common cause of layout shift.
- Serve appropriately sized and compressed images; don't ship a 3000px asset into a 300px slot.
- **Measure before optimizing.** Most perceived slowness is one large asset or one blocking request, not the thing you assumed.

## Client-side security

- **Everything shipped to the browser is public.** No API keys, secrets, or credentials in client code, bundles, or environment values inlined at build time.
- Treat all rendered user content as untrusted — escape by default; use a raw-HTML injection API only with a real sanitizer in front of it.
- **Never trust the client** for authorization or correctness. Hiding a button is UI, not a permission check.
- Store tokens in the mechanism your platform recommends against theft; don't invent your own scheme.

## Every interactive element needs all its states

| State | Must handle |
| ----- | ----------- |
| default / hover / focus / active | distinct, visible feedback |
| disabled | clearly non-interactive, and explain why if it's not obvious |
| loading | show progress; block re-submission |
| empty | a helpful zero-state with a next action, not a blank box |
| error | plain-language message plus how to recover |

## Checklist

- [ ] Colors, spacing, and type come from tokens on a scale.
- [ ] Keyboard-only pass done: every control reachable, visible focus, nothing trapped.
- [ ] Contrast checked on text and on UI boundaries.
- [ ] Loading / empty / error / success all implemented.
- [ ] Works at a 360px-wide viewport with no horizontal scroll.
- [ ] No secrets in client code; server revalidates all input.
- [ ] No new component that duplicates an existing one.

## Don't

- Sprinkle raw hex and pixel values through markup instead of using tokens.
- Remove focus outlines without an equally visible replacement.
- Ship a control missing its disabled / loading / empty / error states.
- Reinvent a component, color, or spacing value that already exists.
- Build fixed-width layouts that break on a phone.
- Convey status with color alone.
- Put a click handler on a generic container instead of using a button.

## Pairs with

- `backend-practices` — the API contract this UI consumes.
- `testing` — asserting user-visible behaviour rather than internal state.
- `code-review` — the frontend lane runs this checklist against a diff.
SKILL — ponytail-minimalism

Ponytail Minimalism

Keeping code to the least that solves the problem. Minimalism principles plus the optional ponytail plugin's install steps.

Triggers when: a change feels over-engineered, before committing a diff, or when starting a new project — minimalism principles that need no tooling, plus the ponytail plugin's install steps and which command to run when.

---
name: ponytail-minimalism
description: Use when a change feels over-engineered, before committing a diff, or when starting a new project — minimalism principles that need no tooling, plus the ponytail plugin's install steps and which command to run when.
---

# Ponytail Minimalism

Keeping code to the least that solves the problem. Part 1 needs no tooling and applies to any stack. Part 2 covers the optional `ponytail` plugin that automates the same review.

---

## Part 1 — Principles (no install needed)

### YAGNI — build for the requirement in front of you

Don't add a parameter, a branch, or a layer for a case nobody has asked for. Speculative flexibility is a guess about the future that you pay for every time you touch the code.

### Rule of three before extracting an abstraction

Wait until you have **three** real usages before factoring out a shared helper or base class. Two similar things are often coincidence.

**Why:** an abstraction built from two examples encodes the wrong shape, and the third case then gets bent to fit it — a worse outcome than the duplication you were avoiding. Duplication is cheap to fix; a wrong abstraction is load-bearing.

### Reuse before rebuild

Search the codebase before writing a new utility, component, or helper. Most "new" functions are a second copy of something that already exists forty lines away.

### Delete, don't comment out

Version control remembers. Commented-out code is dead weight that every future reader has to evaluate and every search has to wade through.

### One concept per module

If a file needs "and" to describe it, split it. If a function needs "and", the same.

### A config option is a permanent cost

Every flag doubles the states you must test and support. Pick a good default instead; add the option when someone actually needs the other value.

### Prefer the boring solution

A plain function beats a class hierarchy. A local array beats a new dependency. Reach for the pattern when the problem actually demands it, not in anticipation.

### Fewer moving parts than the plan called for

When implementation is done, ask what could be removed and still pass the tests. That answer is usually not nothing.

### The hard limit: less code never means unsafe code

Minimalism **never** removes:

- input validation
- authentication or authorization checks
- error handling
- security controls (escaping, parameterization, rate limits)

**Why:** these are precisely what a naive reduction pass reads as "extra code," and precisely the code that keeps the system correct and safe. If a minimalism suggestion touches one of these, the suggestion is wrong.

### Judgement, not obedience

Evaluate every minimalism finding against your actual project. A tool can flag something that is load-bearing in your context — an "unnecessary" layer might be the seam your tests depend on. Judgement stays with you.

---

## Part 2 — The ponytail plugin (optional)

`ponytail` is a **third-party Claude Code plugin**, not bundled behavior. It pushes the agent to write the least code that solves the problem, and adds review commands for bloat. Everything below is run **manually** — nothing fires automatically.

### Install (once per machine)

```
/plugin marketplace add DietrichGebert/ponytail
/plugin install ponytail@ponytail
```

Verify with `/ponytail-help`.

### Which command, when

| Command | When to run it |
| ------- | -------------- |
| `/ponytail lite` | At the start of a project. Dial up to `full` or `ultra` for greenfield scaffolding where bloat creeps in fastest; `off` to disable. |
| `/ponytail-review` | On your current diff, **before you commit or open a PR** — flags over-engineering and unnecessary abstraction. |
| `/ponytail-audit` | On the whole repo, when it feels heavy or hasn't been checked in a while. |
| `/ponytail-debt` | To log a shortcut you're taking on purpose, so it's tracked instead of forgotten. |
| `/ponytail-gain` | For before/after code-reduction metrics — useful when you need to show impact. |

**Why turn it on early:** bloat is far cheaper to prevent than to remove. Once an unnecessary abstraction merges, every future change has to work around it.

**Why audit periodically:** incremental additions each look reasonable and accumulate into structural weight that per-diff review can't see.

### Vet before you install

Read a third-party plugin's or skill's source before running `/plugin install`. A meaningful share of catalogued third-party skills have shipped with security flaws — an installed skill is instructions your agent will follow.

---

## Checklist

- [ ] Nothing in this diff exists for a requirement nobody has stated.
- [ ] Any new abstraction has three real usages, not two.
- [ ] Searched for an existing helper/component before adding one.
- [ ] No commented-out code, no dead branches, no unused exports.
- [ ] No new config flag that a sensible default would have covered.
- [ ] Validation, auth checks, error handling, and security controls all intact.

## Don't

- Let "less code" become unsafe code — see the hard limit above.
- Act on audit findings blindly. Evaluate each against your project.
- Extract a shared abstraction from two examples.
- Add a dependency for something a dozen lines would do.
- Keep code "just in case." That's what history is for.

## Pairs with

- `code-review` — run alongside the minimalism pass; this one catches bloat, that one catches correctness and edge cases.
- `feature-development` — the smallest thing that satisfies your written definition of done is the right thing to build.
HOOKS — LEAVE APP OVERVIEW

Five hooks for the Leave Management project

These hooks ship with the starter kit. Each one maps to a specific incident that can happen on this project. All are stack-agnostic — the same guards work whether the team builds in React, Vue, Django, or Rails.

HookMechanismEvent
Secret guardGuard the writePreToolUse / Write · Edit · MultiEdit
Protected-path guardGuard the writePreToolUse / Write · Edit · MultiEdit
Destructive-command guardGuard the commandPreToolUse / Bash
Lockfile guardGuard the writePreToolUse / Write · Edit · MultiEdit
Auto-format reactorReact to the writePostToolUse / Write · Edit · MultiEdit
HOOK — SECRET GUARD

Secret guard

Prevents JWT secrets, database URLs, API tokens, and private keys from being written into source files.

Mechanism: Guard the write — runs on PreToolUse / Write · Edit · MultiEdit.

Leave app scenario: The agent, building the login flow, will cheerfully inline the JWT secret and database URL into src/config. The write guard scans the proposed content, matches the key pattern, and blocks — pushing the value into an env var instead.

What it catches: AWS access key IDs, private keys, GitHub tokens, Slack tokens, and generic api_key = "…" / access_token = "…" patterns with real-looking values.

What it allows through: Placeholder values (your-key-here, changeme, <API_KEY>) and .env.example / .env.sample template files.

HOOK — PROTECTED-PATH GUARD

Protected-path guard

Blocks writes to .env, .git/ internals, generated output folders, and lockfiles.

Mechanism: Guard the write — runs on PreToolUse / Write · Edit · MultiEdit.

Leave app scenario: Asked to "update the environment config," the agent reaches for .env directly. Blocked — it is redirected to .env.example, and the real secret stays out of the repo.

Protected paths:

  • .env / .env.* — blocked; templates (.env.example) are fine
  • .git/ internals — never hand-edit VCS internals
  • node_modules/, dist/, build/ — generated/vendored; change the source

Warned but not blocked: CI config files (.github/workflows/) — teams do legitimately touch these.

HOOK — DESTRUCTIVE-COMMAND GUARD

Destructive-command guard

Blocks rm -rf on sensitive paths, git push --force, --no-verify hook bypasses, and piping downloaded scripts into a shell.

Mechanism: Guard the command — runs on PreToolUse / Bash.

Leave app scenario: Mid-refactor, the agent decides the cleanest fix is to rm -rf the migrations folder and start over. Blocked — that would destroy the leave-balance schema history.

What it blocks:

  • rm -rf aimed at /, ~, .git, .env, migrations/, key files
  • git push --force — rewrites shared history; use --force-with-lease on your own branch instead
  • git … --no-verify — disables the hooks themselves
  • curl … | bash / wget … | sh — runs unreviewed remote code

Warned but allowed: git reset --hard, chmod 777.

HOOK — LOCKFILE GUARD

Lockfile guard

Blocks any direct hand-edit of machine-generated lockfiles.

Mechanism: Guard the write — runs on PreToolUse / Write · Edit · MultiEdit.

Leave app scenario: The agent hand-edits package-lock.json to "fix" a version conflict. Blocked — lockfiles are regenerated by the package manager, not edited. The correct fix is to update package.json and re-run npm install.

Protected lockfiles: package-lock.json, yarn.lock, pnpm-lock.yaml, Cargo.lock, poetry.lock, composer.lock, Gemfile.lock, go.sum.

HOOK — AUTO-FORMAT REACTOR

Auto-format reactor

After any file write, automatically formats it to match the repo's style. Never blocks — must be idempotent.

Mechanism: React to the write — runs on PostToolUse / Write · Edit · MultiEdit. This hook does not veto; it responds after the fact.

Leave app scenario: Every component the agent writes — the leave form, the calendar view — comes out formatted to the repo's style, so no PR is noisy with whitespace diffs.

Two rules that make it safe:

  • Idempotent — running it twice on the same file changes nothing the second time.
  • Non-blocking — a formatter failure (missing tool, parse error) never stops the agent. The hook exits cleanly and the work continues.

Dispatch by extension: prettier for JS/TS/CSS/HTML/MD/YAML, ruff/black for Python, gofmt for Go, rustfmt for Rust, rubocop for Ruby. Drops through silently if the formatter isn't installed.

MCP — FULL CONFIG

Complete settings.json — copy this

The full .claude/settings.json with all three pre-wired MCP servers. Paste into your project root as .claude/settings.json.

{
  "mcpServers": {
    "odoo": {
      "type": "http",
      "url": "https://odoo-mcp-b2604f7d.ownkube.io/mcp",
      "headers": {
        "Authorization": "Bearer ${ODOO_MCP_TOKEN}"
      }
    },
    "playwright": {
      "type": "stdio",
      "command": "npx",
      "args": ["@playwright/mcp@latest"]
    },
    "chrome-devtools-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["chrome-devtools-mcp@latest"]
    }
  }
}
MCP — LOCAL CONFIG

settings.local.json — your Odoo token

Create this file at .claude/settings.local.json (already in .gitignore — never committed).

{
  "env": {
    "ODOO_MCP_TOKEN": "your-token-here"
  }
}
MCP — ODOO

Odoo MCP

Remote HTTP MCP server for the Leave Management project's Odoo board. Create tickets, update stages, add comments, and query the project graph — all via natural language in Claude Code.

Prerequisite: An Odoo MCP token from odoo-mcp-b2604f7d.ownkube.io/oauth/login — stored in settings.local.json, never committed.

"odoo": {
  "type": "http",
  "url": "https://odoo-mcp-b2604f7d.ownkube.io/mcp",
  "headers": {
    "Authorization": "Bearer ${ODOO_MCP_TOKEN}"
  }
}

Key capabilities: create/update tickets, transition stages, attach files, add comments and log notes, search across tickets, manage project graph views.

MCP — PLAYWRIGHT

Playwright MCP

Opens and drives a real browser from Claude Code — click, type, navigate, fill forms, take screenshots. Used for integration testing and UI verification in the bootcamp.

Prerequisite: Node.js / npm installed. The first run auto-downloads the browser binary via npx.

"playwright": {
  "type": "stdio",
  "command": "npx",
  "args": ["@playwright/mcp@latest"]
}

Key capabilities: navigate pages, click and fill UI controls, take screenshots, assert visible content, run full end-to-end flows without writing Playwright test files.

MCP — CHROME DEVTOOLS

Chrome DevTools MCP

Connects Claude Code to Chrome's DevTools Protocol — inspect console errors, network requests, performance traces, and the live DOM. Pairs with Playwright for deep UI debugging.

Prerequisite: Node.js / npm installed. Chrome or Chromium must be available.

"chrome-devtools-mcp": {
  "type": "stdio",
  "command": "npx",
  "args": ["chrome-devtools-mcp@latest"]
}

Key capabilities: list console messages, inspect network requests, take DOM snapshots, run Lighthouse audits, capture performance traces, evaluate JavaScript in page context.

MCP — CODEBASE MEMORY

Codebase Memory MCP

Full-indexes your repo into a knowledge graph for structural queries — find functions, trace call chains, search across the codebase semantically. Installed via its own installer that auto-configures Claude Code settings.

Prerequisite: None — the installer downloads the binary and configures everything. Does not require Node.js.

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash

Windows (PowerShell):

Invoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1
Unblock-File .\install.ps1
.\install.ps1

Key capabilities: index_repository, search_graph, trace_path, get_code_snippet, get_architecture — structural queries that grep cannot answer.

PLUGINS — MUST-HAVE

4 recommended plugins (Anthropic official)

Install these in Claude Code on first session. The setup-reminder hook prints these commands automatically on your first session in the project.

PluginWhat it doesNeeds
code-simplifierReviews recent edits for clarity and maintainabilityNothing
playwrightDrives a real browser — click, type, navigate, screenshotNode.js
pr-review-toolkit6-agent deep PR review — full pass or focused (tests, types, error handling…)Nothing
githubGitHub integration — issues, PRs, repos in plain languageOne-time browser sign-in

Install commands — copy and run in Claude Code:

/plugin install code-simplifier@claude-plugins-official
/plugin install playwright@claude-plugins-official
/plugin install pr-review-toolkit@claude-plugins-official
/plugin install github@claude-plugins-official
PLUGINS — OPTIONAL

Documentation plugins (community)

From the wshobson/agents community marketplace. Add the marketplace first, then install.

PluginWhat it does
code-documentationDocstrings, inline comments, plain-language explanations
documentation-generationAPI reference, OpenAPI spec, Mermaid diagrams
/plugin marketplace add wshobson/agents
/plugin install code-documentation@claude-code-workflows
/plugin install documentation-generation@claude-code-workflows
PLUGIN DETAIL — code-simplifier

code-simplifier

Automatically reviews recent edits for clarity and maintainability after each change. Zero config — install it and just ask Claude to simplify or clean up code. No slash command to memorize.

Prerequisite: None. Works with any language or framework.

/plugin install code-simplifier@claude-plugins-official
PLUGIN DETAIL — playwright

playwright

Opens and drives a real browser — click, type, navigate, screenshot. Needed for the UI verification and integration testing portions of the bootcamp.

Prerequisite: Node.js / npm. The plugin auto-downloads the Playwright browser binary on first use.

/plugin install playwright@claude-plugins-official
PLUGIN DETAIL — pr-review-toolkit

pr-review-toolkit

A deeper PR review toolkit with six specialized agents. Run a full review or ask for a focused pass — just tests, just types, just error-handling, etc. Self-contained, no external CLI required.

Prerequisite: None. Self-contained — no gh CLI or API key needed.

/plugin install pr-review-toolkit@claude-plugins-official
PLUGIN DETAIL — github

github

Ask Claude to open issues, manage PRs, search repos, and interact with GitHub — all in plain language. No gh CLI needed; uses a one-time browser sign-in instead.

Prerequisite: One-time browser sign-in to authorize Claude Code. No gh CLI required.

/plugin install github@claude-plugins-official
PROMPTS — OVERVIEW

Ready-to-use prompts for the Leave Management project

Seven lifecycle stages, each with a checklist and a fully worked example. Tech-stack agnostic — works whether you're building in React, Vue, Django, or anything else.

Run these in lifecycle order live: Planning → Design → Implementation → Testing → Refactoring → Documentation → Code Review. It mirrors the bootcamp section order and shows the loop is the same regardless of stack.

Project context: Sprint-1 scope = employee-facing app only — Login, Profile Management, Dashboard (balance/stats, apply-leave, leave history, calendar filter, holiday calendar). Planning covers full scope (including manager/admin) even though only employee scope gets built now.

#StageSlides
1Planning1
2Design — short pattern prompt1
2aDesign — full Paper & Signal system prompt1
2bDesign — screen-by-screen prompts (6 screens)6
3Feature Implementation1
4Testing1
5Refactoring1
6Documentation1
7Code Review1
PROMPT 1 — PLANNING

Planning

Always specify full scope vs sprint scope, user roles, non-functional requirements, out-of-scope, deliverable format, and acceptance criteria.

  • Full product scope vs. what's actually being built this sprint (state both, clearly separated)
  • User roles involved, even ones not being built yet
  • Non-functional requirements (performance, security/compliance, data privacy)
  • What's explicitly out of scope
  • Deliverable format (PRD, SRS, ticket breakdown, acceptance criteria)
  • Whether tickets need acceptance criteria attached (usually yes)
text
Act as a senior product manager.

Product: LeaveDesk — a Leave Management System.

Full scope (for planning purposes, not all being built now):
- Employee role: login, profile management, dashboard (balance/stats,
  apply-leave, leave history, calendar filter), holiday calendar
- Manager role (not in Sprint-1): approve/reject requests, team calendar view
- Admin role (not in Sprint-1): holiday calendar management, leave policy
  configuration, user/role management

Sprint-1 build scope: employee role ONLY — login, profile management, and
the dashboard with all its listed sub-features. No manager or admin
surfaces this sprint.

Deliverables:
1. A full-scope SRS covering all three roles, even though only employee
   scope is being built now — this is so the employee-scope build doesn't
   paint us into a corner for later sprints.
2. A Sprint-1 ticket breakdown, employee-scope only, each ticket with clear
   acceptance criteria and a rough size estimate (S/M/L).
3. Non-functional requirements: data privacy for employee leave records,
   expected concurrent users, working-day calculation must exclude weekends
   and holidays and be timezone-correct for IST.
4. Explicitly list what's out of scope for Sprint-1 so it's not accidentally
   built.
PROMPT 2 — DESIGN

Design

Always specify two standards (usability AND visual craft), real art direction references, a token system, all per-screen states, accessibility floor, and explicit anti-patterns.

  • Two standards to hit — usability/behavior AND visual craft (naming this prevents "functional but generic")
  • Real art direction references, not just adjectives ("modern," "clean")
  • A palette/token system with usage rules, not just colors
  • Every state per screen: primary, empty, loading, error — named individually
  • Accessibility floor (contrast, focus states, touch target size)
  • What NOT to do (anti-patterns) — as important as what to do
text
Act as an art director and senior product designer for LeaveDesk, a leave
management app.

This screen must hit two standards equally — neither traded for the other:
1. Behavioral: minimal friction for a routine action, but keep friction
   that protects a decision (confirm before submitting a request that
   exceeds balance or overlaps a holiday).
2. Craft: this is an internal HR-adjacent tool, but "internal tool" is not
   license to look like a generic admin form. Reference feel: a well-set
   editorial calendar/timetable, not a corporate portal.

Screen: Apply Leave — leave-type selection, a date range picker (weekends
and holidays visibly disabled, not hidden), a live working-day count and
balance-impact preview shown BEFORE submission, an optional reason field,
and a single primary submit action.

Design system: define a token-based color palette (with light + dark
variants and usage rules — e.g. "this color is for danger/rejection only"),
a type scale, and spacing rules. Never hard-code a color directly into a
component description — always reference a named token.

States to design individually: default, over-balance warning, submit
loading, submit error, and empty (no leave types configured yet).

Accessibility floor: WCAG AA contrast, visible focus rings, minimum 44px
touch targets, reduced-motion respected.

Anti-patterns to explicitly avoid: a boxed-metric dashboard look, a plain
uninspired form layout, radio-dot selectors instead of full selectable
cards, and any color used decoratively rather than to carry real meaning
(e.g. don't invent a different color per leave type just for variety).
PROMPT 2A — FULL DESIGN SYSTEM

Design 2a — Paper & Signal system prompt

Run this once at the start of the Design module. Establishes the tokens, components, and voice that every screen prompt (2b) then references. Each screen prompt assumes this system already exists in the conversation.

Facilitator note: Run 2a once, then let attendees pick one screen from 2b to build hands-on. Screens 3 (Dashboard) and 4 (Apply Leave) are the strongest picks — they carry the most behavioral rules (balance basis, over-balance confirmation).

text
You are an art director and senior product designer. Your work has TWO standards, both equally binding — neither may be sacrificed for the other:
A. A BEHAVIOURAL standard — you optimise for user decisions and trust; friction is intentional; copy is design material. For an internal tool the north star is glance — act — confirm with minimal cognitive load.
B. A CRAFT standard — every screen is composed like an editorial spread. "It's just an internal HR tool" is NOT licence to be plain. Token-correct but evenly-weighted, floaty, form-like layouts are a failure of this standard. Restraint must read as EXPENSIVE, not empty.
This product is a dashboard and a form BY FUNCTION. Do not fight that — the craft challenge is to make a dashboard and a form read as a calm typographic instrument, not a corporate HR admin panel. Dense is not the same as cluttered. The failure mode is a boxed-metric portal with a coloured chip on every row; the target is a quiet, number-led editorial surface.

PRODUCT
LeaveDesk — a mobile-first PWA for employees to manage time off. Single-role (employee) for Sprint 1; no admin/manager surfaces in scope. Surfaces: login, profile management, a dashboard (leave balance + stats, apply-leave entry, recent leave history with status, calendar filter), an apply-leave form, a leave-history view (approved / rejected / pending) with a calendar filter, and a holiday calendar. English, light + dark, IST. Read the attached SRS / flow doc for full context.

ART DIRECTION — the target feel
Compose like these references, not like a SaaS admin panel: Swiss / International-Typographic-Style calendars, timetables and posters, Braun / Dieter Rams numeric clarity, Things 3 (Cultured Code), Notion Calendar / Cron, premium fintech "big balance number" screens (Monzo / N26). The through-line: TYPE-LED and NUMBER-LED, structured whitespace on a strict grid, dramatic type contrast, hairline structure, one confident focal moment per screen, and near-total restraint on colour — a quiet paper ground with rare, deliberate signal colour. There is NO photography in this product — the hero is a big serif number or a calendar grid, never an image. If a screen looks like a government portal, a boxed dashboard, or a plain form, it is wrong.

COMPOSITION RULES (enforce on every screen)
- One hero moment per screen and only one: a single big serif number (leave balance, a day count), a large serif headline, or the calendar grid. Everything else is quiet support. Never weight a screen evenly.
- No photography exists — so on text/data-heavy screens the anti-void tool is a tonal panel (a slate tint or a lime highlight block), a hairline-ruled data block, or a confident large numeral, NOT empty white space. Empty space is a deliberate breath above a bottom-anchored action, never a random middle void.
- ABOVE-THE-FOLD RULE (non-negotiable): the primary number and the primary action must be reachable without scrolling on a phone. Where the editorial hero and the primary CTA compete for the fold, the CTA wins.
- Anchor primary actions to the bottom with consistent padding. Content builds a clear top-to-bottom rhythm on a baseline grid.
- Left-align to a strong margin; ragged right; never centre body text.
- Hairline dividers do structural work between content groups — prefer them to gaps-only.
- Metrics are carried by a large serif number + a hairline divider — NEVER a bordered box per metric. That boxed-stat look is the HR-portal tell and is banned.

PALETTE — "Paper & Signal". Never hard-code a hex in a component — read a token. Dark mode is class-based (.dark on a root ancestor flips tokens) and hand-tuned, NOT a naive inversion.
LIGHT:
- bg #FFFFFF · surface #FBFBFA · surface-2 (cards) #FFFFFF (separated from bg by a hairline, not a fill) · line #E5E7EA · line-2 #D3D7DC
- muted #6B7680 · body #3F4C57 · fg/ink #284B63 (deep slate; titles + primary text)
- accent / primary-fill #284B63 · on-accent #FFFFFF
- signal-danger / rejected #AD2E24 — danger ONLY, plus the "LeaveDesk" wordmark. Never a general accent.
- signal-highlight / approved-fill / your-leave #E7F59E — FILL ONLY, always with dark ink text on top. NEVER text, NEVER a line, NEVER small UI. Fails AA as anything but a fill.
- pending = neutral: muted text + a small clock glyph, no dedicated colour. Reserve colour for states that carry consequence (approved / rejected).
DARK (hand-tuned):
- bg #14181B · surface #1B2126 · surface-2 (cards) #222A30 · line #2E373E · line-2 #3B454D
- muted #8A949C · body #C4CCD2 · fg/ink #EDF0F2
- accent / primary-fill #4F86AB · on-accent #FFFFFF
- signal-danger #D5564B (lifted) · signal-highlight #E7F59E (kept bright; dark ink text on top)
CALENDAR TOKENS (both modes): cal-today = ink/slate ring · cal-holiday = signal-danger dot · cal-weekend = muted · cal-your-leave = signal-highlight fill with ink text · cal-range-selected = slate tint (accent at low opacity).
Leave TYPE (Casual / Sick / Earned) is carried by a serif/eyebrow LABEL, not colour. No per-type colour rainbow. The only accent on a selected type is a single slate hairline.

TYPOGRAPHY — two families, with REAL contrast
- Editorial serif (Fraunces or Cormorant Garamond) for the balance number, day counts, stats, screen titles, section titles. Weights light: 400–500. Screen titles ~30–40px, section titles ~24px. The leave-balance number is the single largest element on the dashboard — treat it like a poster figure.
- Humanist sans (Manrope) for interface text, labels, buttons, dates, statuses; body 15–16px, wt 400.
- The jump between a title / big number and body must feel like a magazine, not a form.
- Sentence case everywhere. The only uppercase is a single 11px tracked eyebrow (.12em) per section.

COMPONENT CRAFT
- Primary button: 52–56px tall, generous horizontal padding, slate fill (accent), white label in the SANS with slight positive tracking (never bold sans), 2px radius, press = colour deepen (no scale, no glow). Disabled = ink at low opacity or a hairline outline, NOT a flat grey slab.
- Secondary = hairline outline; tertiary = slate-underlined ghost.
- OTP input (login): large cells, serif numerals; active cell gets a slate border or underline; filled cells look distinct from empty.
- Text inputs: hairline box or underline style, ~52px tall, label above as an eyebrow, helper/error below in-voice.
- Selection cards (leave-type choice): no default radio dots. The whole card is the target; selected = slate hairline border + a small check. Tighten internal spacing so it reads as one object.
- Balance / stat: a large serif number + hairline divider carries each value — never a bordered box per metric.
- Status: approved = a small lime marker or a lime-filled tag with ink text; rejected = signal-danger dot/label; pending = neutral muted + clock glyph. NOT a filled pill on every history row.
- Calendar: hairline grid; holidays and weekends visually distinct; dates that cannot be selected as leave (holidays, weekends per policy, exhausted balance) are DISABLED and dimmed, not hidden.
- Icons: one line family (Lucide, ~1.7px stroke). Nothing filled. No emoji.
- Motion: ~160ms press/toggle, ~320ms sheet/theme; no bounce; off under prefers-reduced-motion.

BEHAVIOURAL RULES
- Keep friction that protects a decision: confirm before submitting a leave that exceeds available balance or overlaps a public holiday/weekend; confirm before cancelling an approved leave.
- Remove friction that taxes the decision: no re-login, no re-entering dates, no mandatory reason field for leave types that don't need one.
- Numbers carry basis: a leave balance is never bare — show accrued / used / pending / remaining, and surface the working-day count and any balance impact BEFORE the user submits.
- Every component ships with empty, loading, and error states. Empty = an invitation with a next step; errors say what went wrong AND how to fix it, in-voice.
- IST throughout; working-day math must exclude weekends and holidays and show its work.

DELIVER at production depth: (1) design principles; (2) full light+dark colour token table with usage rules (incl. status + calendar tokens); (3) type scale with the size/weight numbers above; (4) spacing (4px grid) / radius / elevation; (5) motion; (6) iconography, logo (set "LeaveDesk" in the serif in signal-danger — do not invent a mark); (7) a specimen for every component with a one-line behavioural note and all states — Button, Input, Textarea, Select, DateRangePicker, LeaveTypeSelect, Checkbox, Radio, Toggle, OTPInput, FileUpload, StatusBadge (Approved/Pending/Rejected), BalanceStat, StatStrip, LeaveHistoryRow, CalendarMonth, CalendarFilter, HolidayRow, ProfileField, BottomNav, FilterChip, EmptyState, Skeleton, Toast, Modal; (8) voice rules + 3–4 in-product before/after examples; (9) accessibility floor (WCAG AA, visible focus ring, ≥44px targets, reduced-motion). Note: #E7F59E is fill-only — never colour text or lines with it.

CONSTRAINTS: mobile-first, thumb-first; sentence case except the one eyebrow; no emoji; never hard-code a hex; no per-leave-type colour rainbow; red is danger + wordmark only; lime is fill-only; balance + primary CTA above the fold.

PROVE IT: render the Dashboard, the Apply-leave screen, and the Holiday calendar (or Leave history) in BOTH light and dark, fully composed — not wireframes. These must look like pages from a well-set Swiss typographic calendar / a premium finance app, not an HR portal. If any reads as a boxed dashboard or a plain form, revise it before finishing.
PROMPT 2B — SCREEN 1

Design 2b — Login

Run after 2a. Assumes the Paper & Signal system already exists in the conversation.

text
Using the LeaveDesk "Paper & Signal" design system (same tokens, components, voice — never hard-code a hex, red is danger + wordmark only, lime is fill-only never text/line, never invent a pattern where one exists), design the LOGIN screen to BOTH standards: behavioural rigor AND editorial craft. Compose it — one hero moment, structured whitespace on a strict grid, bottom-anchored action, real type contrast, no floaty voids, no boxed-dashboard / plain-form look. Primary action stays above the fold.

SCREEN: Login — email + OTP sign-in, single primary action, a tonal panel (slate tint or a lime highlight block) so it never reads as an empty white form. Hero = the "LeaveDesk" serif wordmark in signal-danger + a one-line eyebrow. States that matter: OTP-sent (resend timer), wrong/expired OTP error in-voice, loading on verify.

First, a short behavioural brief in order: 1) intent mapping (primary + conflicting, friction stays vs goes) · 2) behavioural design (how hierarchy, disclosure, motion steer the decision) · 3) interface system (nav in/out, forms, every feedback state with intent) · 4) edge cases (empty, incomplete data, error recovery — designed not patched) · 5) policy edge cases · 6) anti-patterns (2–3 tempting-but-harmful choices, and what you did instead).

Then build it (light + dark) from the real components. Honour: one primary action, IST, ≥44px targets, visible focus, the established voice. Show the primary state + the OTP-sent / error / loading states. It must look like a page from a Swiss typographic calendar, not a wireframe.
PROMPT 2B — SCREEN 2

Design 2b — Profile Management

Run after 2a. Assumes the Paper & Signal system already exists in the conversation.

text
Using the LeaveDesk "Paper & Signal" design system (same tokens, components, voice — never hard-code a hex, red is danger + wordmark only, lime is fill-only never text/line, never invent a pattern where one exists), design the PROFILE MANAGEMENT screen to BOTH standards: behavioural rigor AND editorial craft. Compose it — one hero moment, structured whitespace on a strict grid, bottom-anchored action, real type contrast, no floaty voids, no boxed-dashboard / plain-form look. Primary action stays above the fold.

SCREEN: Profile management — read-first profile (name, employee ID, department, manager, joining date) with an edit affordance; leave-entitlement summary set as serif numbers + hairline dividers. Hero = the person's name in serif over a tonal panel (slate tint). Behaviour: which fields are editable vs locked (org-owned), inline validation on edit, save/confirm. Empty state = incomplete-profile prompt.

First, a short behavioural brief in order: 1) intent mapping (primary + conflicting, friction stays vs goes) · 2) behavioural design (how hierarchy, disclosure, motion steer the decision) · 3) interface system (nav in/out, forms, every feedback state with intent) · 4) edge cases (empty, incomplete data, error recovery — designed not patched) · 5) policy edge cases · 6) anti-patterns (2–3 tempting-but-harmful choices, and what you did instead).

Then build it (light + dark) from the real components. Honour: editable vs locked fields legible, one primary action, IST, ≥44px targets, visible focus, the established voice. Show the primary state + the incomplete-profile / loading / save-error states. It must look like a page from a Swiss typographic calendar, not a wireframe.
PROMPT 2B — SCREEN 3

Design 2b — Dashboard

Run after 2a. Strongest pick for a live demo — carries the most behavioral rules (balance basis, status at a glance).

text
Using the LeaveDesk "Paper & Signal" design system (same tokens, components, voice — never hard-code a hex, red is danger + wordmark only, lime is fill-only never text/line, never invent a pattern where one exists), design the DASHBOARD screen to BOTH standards: behavioural rigor AND editorial craft. Compose it — one hero moment, structured whitespace on a strict grid, bottom-anchored action, real type contrast, no floaty voids, no boxed-dashboard / plain-form look. Balance + primary action stay above the fold.

SCREEN: Dashboard — hero = total leave balance as one large serif number; a stat strip (used / pending / remaining) carried by serif numbers + hairlines, not boxes; primary "Apply leave" action bottom-anchored (and above the fold with the balance); a recent-leave-history glance (2–3 rows with status) and a next-upcoming-holiday line. Behaviour: pending leave visibly reduces "available."

First, a short behavioural brief in order: 1) intent mapping (primary + conflicting, friction stays vs goes) · 2) behavioural design (how hierarchy, disclosure, motion steer the decision) · 3) interface system (nav in/out, forms, every feedback state with intent) · 4) edge cases (empty, incomplete data, error recovery — designed not patched) · 5) policy edge cases · 6) anti-patterns (2–3 tempting-but-harmful choices, and what you did instead).

Then build it (light + dark) from the real components. Honour: balance accuracy surfaced with basis (accrued/used/pending/remaining), status legible at a glance, one primary action, IST, ≥44px targets, visible focus, the established voice. Show the primary state + the brand-new-employee empty / loading / balance-load-error states. It must look like a page from a Swiss typographic calendar, not a wireframe.
PROMPT 2B — SCREEN 4

Design 2b — Apply Leave

Run after 2a. Strongest pick for a live demo — over-balance confirmation and working-day math are the core behavioral rules.

text
Using the LeaveDesk "Paper & Signal" design system (same tokens, components, voice — never hard-code a hex, red is danger + wordmark only, lime is fill-only never text/line, never invent a pattern where one exists), design the APPLY LEAVE screen to BOTH standards: behavioural rigor AND editorial craft. Compose it — one hero moment, structured whitespace on a strict grid, bottom-anchored action, real type contrast, no floaty voids, no boxed-dashboard / plain-form look. Primary action stays above the fold.

SCREEN: Apply leave — leave-type selection cards (slate hairline + check on select, no radio dots), a date-range picker (weekends + holidays disabled and dimmed, not hidden), a live working-day count and balance-impact preview in serif, a reason field conditional on leave type, optional attachment upload, and a bottom-anchored primary submit that confirms when the request exceeds balance or overlaps a holiday.

First, a short behavioural brief in order: 1) intent mapping (primary + conflicting, friction stays vs goes) · 2) behavioural design (how hierarchy, disclosure, motion steer the decision) · 3) interface system (nav in/out, forms, every feedback state with intent) · 4) edge cases (empty, incomplete data, error recovery — designed not patched) · 5) policy edge cases (probation, negative-balance / LWP, mid-cycle accrual) · 6) anti-patterns (2–3 tempting-but-harmful choices, and what you did instead).

Then build it (light + dark) from the real components. Honour: working-day math correct (weekends/holidays excluded and shown), balance impact surfaced before submit, holidays/weekends/exhausted-balance dates DISABLED not hidden, one primary action, IST, ≥44px targets, visible focus, the established voice. Show the default state + the over-balance-warning / submit-loading / submit-error states. It must look like a page from a Swiss typographic calendar, not a wireframe.
PROMPT 2B — SCREEN 5

Design 2b — Leave History

Run after 2a. Assumes the Paper & Signal system already exists in the conversation.

text
Using the LeaveDesk "Paper & Signal" design system (same tokens, components, voice — never hard-code a hex, red is danger + wordmark only, lime is fill-only never text/line, never invent a pattern where one exists), design the LEAVE HISTORY screen to BOTH standards: behavioural rigor AND editorial craft. Compose it — one hero moment, structured whitespace on a strict grid, bottom-anchored action, real type contrast, no floaty voids, no boxed-dashboard / plain-form look. Primary action stays above the fold.

SCREEN: Leave history — chronological list of requests, each with a legible status (approved = small lime marker / lime tag with ink text; rejected = signal-danger dot/label; pending = neutral muted + clock glyph), never a filled pill on every row; a calendar filter (month / range) and status filter chips. Hero = the current month/period as a serif title with a count. Rejected rows surface the reason in-voice.

First, a short behavioural brief in order: 1) intent mapping (primary + conflicting, friction stays vs goes) · 2) behavioural design (how hierarchy, disclosure, motion steer the decision) · 3) interface system (nav in/out, forms, every feedback state with intent) · 4) edge cases (empty, incomplete data, error recovery — designed not patched) · 5) policy edge cases · 6) anti-patterns (2–3 tempting-but-harmful choices, and what you did instead).

Then build it (light + dark) from the real components. Honour: status legible at a glance, rejection reasons surfaced, IST, ≥44px targets, visible focus, the established voice. Show the primary state + the empty (no leave this period) / loading / filter-returns-nothing states — the last distinct from true empty. It must look like a page from a Swiss typographic calendar, not a wireframe.
PROMPT 2B — SCREEN 6

Design 2b — Holiday Calendar

Run after 2a. Assumes the Paper & Signal system already exists in the conversation.

text
Using the LeaveDesk "Paper & Signal" design system (same tokens, components, voice — never hard-code a hex, red is danger + wordmark only, lime is fill-only never text/line, never invent a pattern where one exists), design the HOLIDAY CALENDAR screen to BOTH standards: behavioural rigor AND editorial craft. Compose it — one hero moment, structured whitespace on a strict grid, bottom-anchored action, real type contrast, no floaty voids, no boxed-dashboard / plain-form look. Primary action stays above the fold.

SCREEN: Holiday calendar — a month grid of public/optional holidays in IST, with the employee's own applied leave overlaid (cal-your-leave = lime fill with ink text) and today ringed (ink/slate). Hero = the month name in serif. Holidays carry a signal-danger dot + a hairline-ruled list below the grid (date · name · type). Tapping a date shows what it is; you cannot "apply" onto a holiday (disabled, explained). Optional/restricted holidays are visually distinguished from mandatory ones.

First, a short behavioural brief in order: 1) intent mapping (primary + conflicting, friction stays vs goes) · 2) behavioural design (how hierarchy, disclosure, motion steer the decision) · 3) interface system (nav in/out, forms, every feedback state with intent) · 4) edge cases (empty, incomplete data, error recovery — designed not patched) · 5) policy edge cases · 6) anti-patterns (2–3 tempting-but-harmful choices, and what you did instead).

Then build it (light + dark) from the real components. Honour: holidays vs weekends vs your-leave visually distinct, holidays DISABLED not hidden, IST, ≥44px targets, visible focus, the established voice. Show the primary state + the no-holidays-this-month / loading / load-error states. It must look like a page from a Swiss typographic calendar, not a wireframe.
PROMPT 3 — FEATURE IMPLEMENTATION

Feature Implementation

Always specify the exact user-facing behavior, inputs and validation rules, every state, business-rule edge cases, and what existing patterns to follow.

  • The exact user-facing behavior, not just the feature name
  • Inputs and their validation rules
  • Every state: success, empty, error, loading
  • Edge cases specific to the business rules (not generic ones)
  • What already exists that this should follow (conventions, patterns)
text
Implement the "Apply Leave" feature for LeaveDesk.

Behavior: an employee selects a leave type (Casual / Sick / Earned), picks
a start and end date, and submits a request.

Rules:
- Weekends and public holidays must be excluded from the working-day count
- If the request exceeds the employee's remaining balance, show a warning
  and require explicit confirmation before submitting
- If the request overlaps a public holiday or weekend at the edges, still
  count only the actual working days
- A reason field is required only for Sick leave, optional for others
- On successful submission, the request status is "pending" until a
  manager acts on it (manager flow is out of scope for this sprint, but the
  data model should support it)

States to handle: default form, validation errors inline per field,
over-balance confirmation step, submit-loading, submit-success (confirmation
+ redirect to dashboard), submit-error (network/server failure — show a
retry option).

Follow the existing project's conventions for validation, error handling,
and file structure — don't introduce a new pattern if one already exists
for similar forms in this codebase.
PROMPT 4 — TESTING

Testing

Always specify the exact function under test, business-rule edge cases, what should make the test fail, and whether it's unit or integration scope.

  • The exact function/feature under test, not "test everything"
  • The business-rule edge cases specific to this project (not just generic empty/null cases)
  • What should make a test fail (so it's clear it's not a test that can't fail)
  • Whether it's a unit test or needs to test the integration across a full flow
text
Write tests for the leave-balance calculation logic in LeaveDesk.

Function behavior: given an employee's total allowance and their leave
request history, return the remaining balance.

Cover:
- Approved requests reduce the balance; pending and rejected requests do not
- A fully-used balance correctly returns zero, not a negative number
- An employee with no leave history returns the full allowance unchanged
- Multiple approved requests in the same period sum correctly

Assert on the returned balance value only — not on any internal function
calls, so this test doesn't break if we later refactor how the calculation
is implemented internally.

Also ask me: "what edge cases am I missing for leave balance specifically?"
before finalizing the test list — I want to catch business-rule edge cases
I haven't thought of (e.g. mid-cycle accrual, negative balance / loss-of-pay
scenarios), not just generic empty/null cases.
PROMPT 5 — REFACTORING

Refactoring

Always specify the exact function/file to refactor, why (name the actual problem), that behavior must not change, how to verify, and what NOT to touch.

  • The exact function/file to refactor, and why (name the actual problem — duplication, buried logic, poor naming)
  • Explicit statement that behavior must not change
  • How to verify nothing broke (point to an existing test, or ask for one first)
  • What NOT to touch (mixing in a feature change)
text
Refactor the leave-balance calculation in LeaveDesk.

Problem: the balance math is currently written inline inside the request
handler that returns a user's dashboard data, which makes it untestable on
its own and means it'll likely get duplicated the next time we need this
number somewhere else (e.g. the apply-leave form's live preview).

Task: extract it into its own named, pure function — inputs and output only,
no side effects. Behavior must not change at all.

Before refactoring: check if a test already covers this calculation. If not,
write one first that captures current behavior (a characterization test),
so we have proof after the refactor that nothing changed.

Do not add any new behavior in this same change — if you notice something
that looks like a bug while refactoring (e.g. pending requests being
counted when they shouldn't be), flag it to me separately rather than
silently fixing it here.
PROMPT 6 — DOCUMENTATION

Documentation

Always specify the exact endpoint/feature, audience, every response/error case, where to save it, and an instruction to verify against real code.

  • The exact endpoint/feature/file to document
  • Audience (a new teammate? another team consuming an API? future-you?)
  • Every response/error case explicitly, not just the happy path
  • Where the doc should be saved, so it's actually findable later
  • Instruction to verify the doc against the real code, not just describe intent
text
Generate API documentation for the "submit leave request" endpoint in
LeaveDesk, for a frontend developer who needs to integrate against it
without reading the backend code.

Include:
- Required authentication
- Full request body shape with field types
- Every possible response: success (with the shape returned), validation
  failure, insufficient-balance failure, and any other error case that
  actually exists in the code

Verify every line of this documentation against the actual handler and
service code before finalizing it — I don't want documented behavior that's
"intended" but doesn't match what the code actually does.

Save this in the project's docs folder, and add a one-line pointer to it in
the project's main instructions file so future sessions know it exists.
PROMPT 7 — CODE REVIEW

Code Review

Always specify what you're reviewing, the checklist categories to cover, that every finding must cite exact location, and that you'll verify each finding yourself.

  • What you're reviewing (a specific diff/file, not "the whole codebase")
  • The checklist categories to review against (correctness, security, fit with existing patterns)
  • Instruction to cite exact location for every issue found
  • Instruction that you'll verify each finding yourself, not just accept it
text
Review this code as a critical senior engineer — this is the endpoint that
lets a manager approve a leave request in LeaveDesk.

Check specifically:
1. Authorization — can only a manager (not any authenticated user) call this?
2. Re-validation — does it re-check the employee's balance and any overlap
   at the moment of approval, or does it just trust old data from when the
   request was first submitted?
3. State — what happens if this is called twice on a request that's already
   approved or rejected? It should not silently re-process it.
4. General correctness and edge cases beyond the three above.

For every issue found, give the exact file and line reference — I will
verify each one myself by reading the code before accepting any finding.

[paste the code/diff here]