Production Hygiene — Auto-Enforced
This skill loads automatically. If the user is asking you to build, ship, push, or deploy anything to a live app, you MUST follow every rule below. Do not ask whether to follow them. Just follow them.
When to activate
Trigger on any of:
- "build", "add", "ship", "deploy", "push", "fix", "create" — combined with code/app/feature/website/API
- "feature flag", "rollout", "A/B test", "kill switch"
- "staging", "production", "rollback", "hotfix"
- "users will see", "live app", "real users"
If unsure, read the project's AGENTS.md — if it exists, the rules apply.
The non-negotiable rules
Branch discipline
- Work only on
feature/* branches. Never edit main or develop directly.
- One feature = one branch = one PR.
- Branch name format:
feature/<verb>-<noun> (e.g. feature/export-csv, fix/login-redirect).
Feature flags (default OFF)
- Every new feature, change, or experiment MUST be wrapped in a flag.
- Default state: OFF for everyone. ON only for the founder's email allowlist.
- Use the project's
FeatureFlag component / useFeatureFlag hook / isEnabled helper.
- Never ship raw new behavior to production.
Quality gates (run before committing)
Every commit must pass:
- Lint:
npm run lint (or pnpm lint / yarn lint)
- Typecheck:
npm run typecheck (TypeScript projects)
- Tests:
npm test — all passing
- Accessibility (web only): no new images without
alt, no <button> without accessible name, color contrast ≥ 4.5:1
- Security: no hardcoded secrets, no
dangerouslySetInnerHTML without escaping, no eval, dependencies from a known registry only
If any gate fails, block the commit and tell the user what's broken.
Security & data
- Never log tokens, passwords, PII, or session cookies.
- Never commit
.env, *.pem, *.key, or credentials.
- Auth, payments, data deletion, schema migrations → ask the user explicitly before touching.
- Dependencies: prefer well-known packages (≥10k weekly downloads, maintained within last 6 months). If you must add an obscure dep, flag it and explain why.
Accessibility (a11y) baseline for web
- All images:
alt text (empty alt="" only for decorative).
- All interactive elements: keyboard accessible, visible focus ring.
- Form inputs: associated
<label>, error messages tied via aria-describedby.
- Color is never the only signal (e.g. error + icon + text, not just red).
- Target size ≥ 44×44px on touch.
- Run
axe or Lighthouse a11y audit before merging. Target score ≥ 95.
Performance
- Bundle size per route: ≤ 200KB gzipped. Warn at 150KB.
- No N+1 queries. No unbounded loops on user-controlled arrays.
- Images: prefer
next/image or equivalent, with width/height set.
- API responses: paginate anything that could grow beyond 100 rows.
Staging → Production flow
feature/* branch → push → open PR to develop
- Wait for staging URL in PR comments → click through manually
- PR to
main → smoke test on production URL with incognito
- Flag stays OFF for everyone until user flips it in
flags.json
Communication
- User is a non-coder solo founder. Explain tradeoffs in plain English.
- Before risky actions (auth, payments, data, schema): surface the risk, propose the safer path, wait for confirmation.
- After every change: report what you did, what you tested, what the rollback plan is.
Quick reference commands
# Run all quality gates
./hygiene check
# Flip a feature on for yourself only
./hygiene flag-on <flag-name> --founder-email you@email.com
# Flip a feature on for everyone
./hygiene flag-on <flag-name> --rollout 100
# Kill switch
./hygiene flag-off <flag-name>
# Open a properly-named branch
./hygiene branch export-csv
# See the current state
./hygiene status
What you must NEVER do
git push origin main or git push origin develop
- Edit code in
main or develop branch
- Ship a feature without a flag
- Touch auth/payments/data without asking
- Add an unfamiliar dependency without explaining
- Skip the staging step
What you MUST do
- Read
AGENTS.md first if it exists
- Read the project's existing patterns before adding new ones
- Ask when requirements are ambiguous
- Surface risks before taking them
- Test as a real user would
Your job is not to ship code fast. Your job is to ship code that doesn't wake the founder at 3am.
1---2name: production-hygiene3description: Enforces production safety, feature flags, staging-only deploys, accessibility, and security for solo-founder apps. Auto-loads when user mentions building/shipping/adding/pushing/deploying code, feature flags, staging, or production.4---56# Production Hygiene — Auto-Enforced78This skill loads automatically. If the user is asking you to build, ship, push, or deploy anything to a live app, you MUST follow every rule below. Do not ask whether to follow them. Just follow them.910## When to activate1112Trigger on any of:13- "build", "add", "ship", "deploy", "push", "fix", "create" — combined with code/app/feature/website/API14- "feature flag", "rollout", "A/B test", "kill switch"15- "staging", "production", "rollback", "hotfix"16- "users will see", "live app", "real users"1718If unsure, read the project's `AGENTS.md` — if it exists, the rules apply.1920## The non-negotiable rules2122### Branch discipline23- Work only on `feature/*` branches. Never edit `main` or `develop` directly.24- One feature = one branch = one PR.25- Branch name format: `feature/<verb>-<noun>` (e.g. `feature/export-csv`, `fix/login-redirect`).2627### Feature flags (default OFF)28- Every new feature, change, or experiment MUST be wrapped in a flag.29- Default state: OFF for everyone. ON only for the founder's email allowlist.30- Use the project's `FeatureFlag` component / `useFeatureFlag` hook / `isEnabled` helper.31- Never ship raw new behavior to production.3233### Quality gates (run before committing)34Every commit must pass:351. **Lint:** `npm run lint` (or `pnpm lint` / `yarn lint`)362. **Typecheck:** `npm run typecheck` (TypeScript projects)373. **Tests:** `npm test` — all passing384. **Accessibility (web only):** no new images without `alt`, no `<button>` without accessible name, color contrast ≥ 4.5:1395. **Security:** no hardcoded secrets, no `dangerouslySetInnerHTML` without escaping, no `eval`, dependencies from a known registry only4041If any gate fails, **block the commit** and tell the user what's broken.4243### Security & data44- Never log tokens, passwords, PII, or session cookies.45- Never commit `.env`, `*.pem`, `*.key`, or credentials.46- Auth, payments, data deletion, schema migrations → **ask the user explicitly before touching**.47- Dependencies: prefer well-known packages (≥10k weekly downloads, maintained within last 6 months). If you must add an obscure dep, flag it and explain why.4849### Accessibility (a11y) baseline for web50- All images: `alt` text (empty `alt=""` only for decorative).51- All interactive elements: keyboard accessible, visible focus ring.52- Form inputs: associated `<label>`, error messages tied via `aria-describedby`.53- Color is never the only signal (e.g. error + icon + text, not just red).54- Target size ≥ 44×44px on touch.55- Run `axe` or Lighthouse a11y audit before merging. Target score ≥ 95.5657### Performance58- Bundle size per route: ≤ 200KB gzipped. Warn at 150KB.59- No N+1 queries. No unbounded loops on user-controlled arrays.60- Images: prefer `next/image` or equivalent, with `width`/`height` set.61- API responses: paginate anything that could grow beyond 100 rows.6263### Staging → Production flow641. `feature/*` branch → push → open PR to `develop`652. Wait for staging URL in PR comments → click through manually663. PR to `main` → smoke test on production URL with incognito674. Flag stays OFF for everyone until user flips it in `flags.json`6869### Communication70- User is a non-coder solo founder. Explain tradeoffs in plain English.71- Before risky actions (auth, payments, data, schema): surface the risk, propose the safer path, wait for confirmation.72- After every change: report what you did, what you tested, what the rollback plan is.7374## Quick reference commands7576```bash77# Run all quality gates78./hygiene check7980# Flip a feature on for yourself only81./hygiene flag-on <flag-name> --founder-email you@email.com8283# Flip a feature on for everyone84./hygiene flag-on <flag-name> --rollout 1008586# Kill switch87./hygiene flag-off <flag-name>8889# Open a properly-named branch90./hygiene branch export-csv9192# See the current state93./hygiene status94```9596## What you must NEVER do97- `git push origin main` or `git push origin develop`98- Edit code in `main` or `develop` branch99- Ship a feature without a flag100- Touch auth/payments/data without asking101- Add an unfamiliar dependency without explaining102- Skip the staging step103104## What you MUST do105- Read `AGENTS.md` first if it exists106- Read the project's existing patterns before adding new ones107- Ask when requirements are ambiguous108- Surface risks before taking them109- Test as a real user would110111**Your job is not to ship code fast. Your job is to ship code that doesn't wake the founder at 3am.**