implement-spec
Implement a feature end-to-end from its FEAT-xxxx spec — scaffold, code to the fixed contracts, tests per the Verification mapping, full verification pyramid, self-review, MR-ready summary. Usage - /implement-spec FEAT-0002. The spec is the single source of truth; do not invent requirements.
- License 许可
- MIT
- 最近更新
- 2026-07-16
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- implement-spec
- description
- Implement a feature end-to-end from its FEAT-xxxx spec — scaffold, code to the fixed contracts, tests per the Verification mapping, full verification pyramid, self-review, MR-ready summary. Usage - /implement-spec FEAT-0002. The spec is the single source of truth; do not invent requirements.
03 SKILL.md 正文
Implement a spec
Input: a spec id (e.g. FEAT-0002). The spec file is docs/specs/FEAT-xxxx-<name>.md.
0. Gate
pnpm spec-lintmust be green for the spec. If it errors, STOP and report — an incomplete spec is the author's work, not yours to guess (§10.4).- Read the spec fully. The sections "Acceptance criteria", "UI contract (test hooks)" and "Interface contracts" are BINDING — exact ids, testids, types, storage keys.
1. Scaffold
pnpm new-feature <name>(skill: new-feature). Register the route as the generator prints.- Feature deps (ports from "Interface contracts") are assembled in
apps/app/src/composition/and passed viacreate<X>Route(rootRoute, deps)— never module-scope singletons (ADR-013).
2. Implement to the contracts
- Screen contract
use<X>Screenreturns{ state, actions }and OWNS every behavior rule (e.g.canAdd) — the View renders state, it never re-derives rules (§6). - Errors as values up to the Query boundary; storage/HTTP failures normalized to
DomainError. - Analytics events exactly as the spec lists them, fired on mutation success, no PII.
- One a11y rule that bites in WebViews: user-visible composite strings ("N open") must be a SINGLE text node — split JSX children surface as separate iOS a11y elements.
3. Tests = Verification mapping
Implement exactly the levels the spec's Verification mapping table assigns per AC:
unit/component (Vitest + RTL + fakes from @app/testing), Playwright (e2e/playwright/tests/),
Maestro (e2e/maestro/<name>/) for on-device criteria. Test names cite AC ids.
4. Verify (all must pass before review)
pnpm verify(includes spec-lint)pnpm e2e- skill screenshot-verify: walk the feature in the browser, console clean, screenshots saved
- If the spec has on-device criteria: skill run-android (and iOS simulator when available), run the Maestro flow on BOTH platforms — a11y trees differ per platform.
5. Self-review
Run the code-reviewer agent on the diff. Fix HIGH/MEDIUM findings; record justified
deferrals in the spec ("Deferred verification" section). Re-run step 4 after fixes.
6. Hand off
Summarize for the MR: what was built, AC → test evidence table, screenshots, verification results, deviations from the spec (if any — each needs a reason). Update the feature CLAUDE.md and any docs the change made stale. A human approves the MR — never merge autonomously.
04 同仓库更多 Skills
screenshot-verify
Visually verify a UI change in the browser (app dev server, production/PWA build, or Storybook) before claiming it works. The primary agent verification loop (ARCHITECTURE.md §10.6) — no emulator needed.
run-android
Build, deploy and visually verify the app on an Android emulator or device via the Capacitor shell, then verify with Maestro. Use when a change touches the native shell, plugins, or needs on-device confirmation.
new-feature
Scaffold a new feature package the canonical way and wire it into the app. This is the ONLY correct way to start a feature (ARCHITECTURE.md §5, §10.2 "one way to do a thing").
build-verify
Verify this repo exactly like CI does (lint, format, boundaries, dep-cruise, typecheck, tests, build) and fix the common failure classes. Use before claiming any change is done, and to reproduce CI failures locally.
screenshot-verify
暂无简介
run-android
暂无简介