Production ready

From thoughtfulllc/gridland · View interactive version

Production ready is an AI agent skill from the GitHub repository thoughtfulllc/gridland. Review a component for production readiness as a UI framework. Assesses code quality, patterns, tests, docs, and API design. Produces a prioritized fix plan. Use before shipping a new or updated component to users.

How to use this skill

Skill file

Production-readiness review for a @gridland/ui component. Evaluates whether a component is ready to ship to framework consumers who will add it to their own repos.

The user may specify a component name (e.g., /production-ready MultiSelect) or you can infer it from recent changes. If ambiguous, ask.

Phase 1 — Identify scope

Determine the target component and gather all relevant files:

# If no component specified, infer from recent changes
git diff --name-only HEAD

Read all files for the target component:

Phase 2 — Architecture classification

First, separate the primary component from companion demo utilities. Files that exist to showcase or preview variants (e.g., SpinnerPicker, SpinnerShowcase) are demo utilities — not shipped components. Only apply the full P0–P2 checklist to the primary component. Demo utilities only need basic correctness (// @ts-nocheck if needed, no crashes). Do not review their docs, add Controls tables, or treat them as consumer-facing API.

Signs something is a demo utility:

Then classify the primary component. This is critical — the rules differ:

Container components (e.g., SideNav, Modal, ChatPanel) manage their own focus scope. They MUST:

Embedded components (e.g., SelectInput, MultiSelect, PromptInput) receive useKeyboard as a prop and are focus-managed by a parent. They do NOT call useInteractive, focusRef, FocusScope, or useShortcuts. This is intentional — not a gap.

How to tell: If the component accepts a useKeyboard prop and calls useKeyboardContext(useKeyboardProp), it is embedded. If it imports useInteractive from @gridland/utils, it is a container.

Static components (e.g., Spinner, Ascii, Table) have no keyboard interaction. Focus rules don't apply.

Phase 3 — Code review

Check the implementation against these criteria, ordered by severity:

P0 — Blocking (must fix before shipping)

  1. API correctness for framework consumers
  1. Keyboard handler correctness
  1. // @ts-nocheck on component files using intrinsics
  1. Theme compliance
  1. Export registration
  1. Registry sync
  1. Unnecessary indirection

P1 — Significant (should fix)

  1. Performance
  1. React key stability and data-driven value uniqueness
  1. Edge cases
  1. Cross-environment safety

P2 — Polish (nice to have)

  1. Test coverage by code path
  1. Documentation — code examples are valid
  1. Documentation — prose matches implementation
  1. Documentation — API table and controls
  1. Documentation — example coverage
  1. Demo validity and feature coverage

Phase 4 — Cross-reference with sibling components, shadcn, and ai-elements

Read the equivalent sibling component (e.g., if reviewing MultiSelect, read SelectInput) to verify:

If the component has a shadcn/ui equivalent (Table, Tabs, Select, Modal/Dialog, etc.), compare API expressiveness:

If the component has an equivalent in ai-elements, do a line-by-line comparison:

Phase 5 — Draft report (internal, do NOT present yet)

Draft the report internally. Do NOT show the user anything yet — you must self-verify first (Phase 6).

Phase 6 — Self-verification (REQUIRED before presenting)

This phase exists because issues repeatedly slip through single-pass reviews. You MUST complete every step below before presenting the report to the user. The goal is to catch everything in ONE run.

Step 1: Checklist audit

Walk through EVERY numbered item in the Phase 3 checklist (1–17) and confirm each one was actually checked against the code. For each item, write a one-line internal note:

If any item shows [not checked], go back and check it now. Do not skip items because they "probably" pass.

Step 2: Re-read the source file

Re-read the component source file (packages/ui/components/<name>/<name>.tsx) one more time. On this read-through, focus specifically on:

Step 3: Cross-check exports

Run this verification:

  1. List every export in the component source file
  2. For each export, grep packages/ui/components/index.ts to confirm it's re-exported
  3. For each exported type/interface, confirm it has a export type { ... } line in index.ts
  4. Flag any export that exists in the source but not in index.ts

Step 4: Cross-check docs against code

For each prop in the component's Props interface:

  1. Verify it appears in the docs API Reference table with the correct type, default, and description
  2. Verify at least one code example uses it (for non-trivial props)

For each code example in the docs:

  1. Verify the imports are valid (exist in index.ts)
  2. Verify all required props are passed
  3. Verify no removed/renamed props are used

Step 5: Verify fix plan completeness

For every issue found (P0, P1, P2):

  1. Confirm the fix plan has a concrete action item with a file path
  2. Confirm the fix plan actions will actually resolve the issue (not just describe it)

Step 6: Final gate

Ask yourself: "If I run /production-ready <component> again after these fixes, will I find zero new issues?" If the answer is no, you missed something — go back and find it.

Phase 7 — Present report

Only after completing Phase 6, output the final report:

## Production Readiness: <ComponentName>

### Architecture: [Container | Embedded | Static]

### P0 — Blocking
- [file:line] Issue — what to fix

### P1 — Significant
- [file:line] Issue — what to fix

### P2 — Polish
- [file:line] Issue — what to fix

### Passing
- [list of checks that passed]

### Fix Plan
Ordered list of changes to make, with file paths and what to change.
Estimated scope: [trivial | small | medium | large]

After presenting the report, ask: "Want me to make these fixes?"

Important guidance

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.