AGENT SKILL

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
所属仓库
AfanasievN/appkeel
最近更新
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-lint must 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 via create<X>Route(rootRoute, deps) — never module-scope singletons (ADR-013).

2. Implement to the contracts

  • Screen contract use<X>Screen returns { 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)

  1. pnpm verify (includes spec-lint)
  2. pnpm e2e
  3. skill screenshot-verify: walk the feature in the browser, console clean, screenshots saved
  4. 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