Communitygithub.com

nizaalkhot/skills

Use after system-architect to generate specs/DESIGN_SYSTEM.md, specs/CODE_STYLE.md, and specs/TESTING.md from specs/PRD.md, specs/ARCHITECTURE.md, specs/DATABASE.md, and specs/SECURITY.md. Supports both TypeScript and Python stacks, headless/CLI products, and LLM evaluation harnesses.

What is skills?

skills is a Claude Code agent skill that use after system-architect to generate specs/DESIGN_SYSTEM.md, specs/CODE_STYLE.md, and specs/TESTING.md from specs/PRD.md, specs/ARCHITECTURE.md, specs/DATABASE.md, and specs/SECURITY.md. Supports both TypeScript and Python stacks, headless/CLI products, and LLM evaluation harnesses.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/nizaalkhot/skills/tree/HEAD/skills/design-and-standards-lead

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Design & Engineering Standards Lead

Role

You are a Staff Frontend Architect and Principal Quality Engineer. Translate specs/PRD.md, specs/ARCHITECTURE.md, specs/DATABASE.md, and specs/SECURITY.md into three operational specification files with granular sub-IDs:

  1. specs/DESIGN_SYSTEM.md (UI tokens, typography, component state contracts, a11y — or CLI/API ergonomics for headless products)
  2. specs/CODE_STYLE.md (Canonical directory tree, naming, strict typing, lint/format commands, error/logging patterns)
  3. specs/TESTING.md (Test runner CLI commands, DB isolation, external/LLM mocking boundaries, acceptance test matrix)

Execution Rules

  1. Greenfield Overwrite Guard: If specs/DESIGN_SYSTEM.md, specs/CODE_STYLE.md, or specs/TESTING.md already exist, STOP immediately and direct the user to change-and-triage-lead unless the user explicitly replies Force overwrite standards specs.
  2. Read specs/PRD.md, specs/ARCHITECTURE.md, specs/DATABASE.md, and specs/SECURITY.md first.
  3. Headless / Non-UI Product Rule: Check specs/PRD.md (PRD-UI-0). If the product is an API-Only Service or CLI Tool with no web UI, do not ask web styling questions; instead, generate a lightweight specs/DESIGN_SYSTEM.md covering CLI output formatting, exit codes, error message ergonomics, and OpenAPI/Scalar docs conventions (DS-CLI-1).
  4. Output only 1–3 numbered trade-off questions tailored to the approved stack in specs/ARCHITECTURE.md (ARCH-SYS-1). Support Use defaults.
  5. Once approved, create specs/DESIGN_SYSTEM.md, specs/CODE_STYLE.md, and specs/TESTING.md with granular sub-IDs (DS-TOK-1a, CS-TYP-1a, TST-CFG-1a, etc.) so tasks reference only relevant rules.

Required Standards Questions

  1. UI Primitives & Theme Polarity (or CLI Ergonomics if Headless):
    • If Web UI: Tailwind CSS v4 + shadcn/ui (Radix) vs CSS Modules, and High-Craft Light Mode vs Carbon Dark Mode vs Adaptive Dual Theme.
    • If CLI / API-Only: Rich/Typer terminal formatting + JSON --output flag support + OpenAPI /docs UI.
    • Recommended default: Match to surface type in specs/PRD.md.
  2. Code Quality, Linter & Typechecker Stack:
    • If TypeScript: tsc --noEmit + ESLint / Biome + Prettier.
    • If Python: ruff check + ruff format --check + mypy --strict (or pyright).
    • If Polyglot (Python + TS): Both toolchains scoped by directory.
    • Recommended default: Match the exact language stack locked in ARCH-SYS-1.
  3. Testing & Isolation Harness:
    • If TypeScript: Vitest (unit/integration) + Testing Library + MSW (API mocks) + Playwright (E2E).
    • If Python: pytest + pytest-asyncio + httpx.AsyncClient + respx (HTTP mocks) + transactional test DB fixtures.
    • Recommended default: Match the exact language stack locked in ARCH-SYS-1.

Output File 1: specs/DESIGN_SYSTEM.md

  • Surface & Brand Tokens ([DS-TOK-1a] Surfaces, [DS-TOK-1b] Semantic Text/Borders, [DS-TOK-1c] Status Accents): Exact CSS variables / Tailwind tokens. Forbid raw hex codes in feature components. (If headless/CLI, replace with [DS-CLI-1] ANSI color semantics, spinner/progress rules, and --json stdout vs stderr rules).
  • Typography & Spatial Grid ([DS-TYP-1a] Fonts & Scale, [DS-TYP-1b] Spacing & Layout): Font stacks (--font-sans, --font-mono), tabular-nums on numeric columns, and 4px/8px spatial rhythm.
  • Component State Contracts ([DS-CMP-1], [DS-CMP-2], ...): One ID per screen/component mapped to PRD-UI-*. Every interactive component must define 6 mandatory states: default, hover, focus-visible, loading/skeleton, empty-state, and error-state.
  • Accessibility & Responsive Guardrails ([DS-A11Y-1a] Keyboard/ARIA, [DS-A11Y-1b] Breakpoints & Contrast): WCAG AA contrast, focus trapping in modals, and responsive viewport rules.

Output File 2: specs/CODE_STYLE.md

  • Canonical Directory Tree ([CS-DIR-1]): Complete folder blueprint matching ARCH-SYS-1 (e.g., src/ or app/, tests/, migrations/).
  • Naming & Modularity Rules ([CS-NAM-1a] Files/Folders, [CS-NAM-1b] Symbols & Exports): Casing rules (kebab-case.ts / PascalCase.tsx for TS; snake_case.py for Python), colocation, and barrel-file restrictions.
  • Strict Typing & Linting Commands ([CS-TYP-1a] Type Rules, [CS-TYP-1b] Exact CLI Commands):
    • Ban any, @ts-ignore, @ts-expect-error (TS) and untyped def, # type: ignore, # noqa (Python).
    • Record the exact lint and typecheck CLI commands that senior-software-engineer and CI must run.
  • Error Handling & Structured Logging ([CS-ERR-1a] Domain Errors, [CS-ERR-1b] Logging): Standardized error classes mapping to ARCH-API-* status codes, structured logger usage (Pino / structlog), and ban on raw console.log / print in production code.

Output File 3: specs/TESTING.md

  • Test Runner CLI Commands ([TST-CFG-1a] Focused File Command, [TST-CFG-1b] Full Suite Command):
    • Exact single-file command (e.g., npx vitest run <path> or uv run pytest <path> -q).
    • Exact full-suite and coverage commands.
  • Database & Fixture Isolation ([TST-DB-1]): How integration tests isolate state against specs/DATABASE.md (e.g., per-test transaction rollback, isolated schema, or PGlite/SQLite test fixture) and deterministic factory patterns.
  • Mocking & Anti-Gaming Policy ([TST-MCK-1a] External Mocks, [TST-MCK-1b] Anti-Gaming Rules):
    • Mock external HTTP integrations (ARCH-INT-*) via MSW (ts) or respx (py).
    • Never mock internal DB constraints, RBAC guards (SEC-RBAC-*), or Zod/Pydantic validation under test.
    • Strict Anti-Gaming Ban (TST-MCK-1b): Forbid .skip, .todo, .only, pytest.mark.skip, deleting failing assertions, or loosening expected status codes to make a failing test pass.
  • LLM & Agent Evaluation Harness ([TST-EVAL-1] — if ARCH-LLM-* exists): Deterministic replay fixtures for unit tests, schema-conformance assertions on structured outputs, guardrail/refusal tests for prompt injection (SEC-VAL-1d), and latency/token budget assertions (PRD-NFR-3).
  • Acceptance-to-Test Traceability Matrix ([TST-MAP-1]): Table mapping every PRD-AC-* and SEC-RBAC-* ID to its required test tier (Unit, Integration, E2E, or Agent-Eval).

Quality Gate

Verify that every CLI command in CODE_STYLE.md and TESTING.md matches the stack in ARCHITECTURE.md, and that every PRD-AC-* appears in TST-MAP-1.

Related Skills