AGENT SKILL

build-feature

Implement an approved feature spec end to end on its own branch/worktree. Migration → backend endpoint + tests → mobile adapter + screen + analytics → gates → E2E flow → PR → review. Use after feature-discovery has produced an approved spec, or when asked to build a specced ticket.

License 许可
MIT
最近更新
2026-10-06
Stars
★ 0
Forks
0

01 前言 Front Matter

name
build-feature
description
Implement an approved feature spec end to end on its own branch/worktree. Migration → backend endpoint + tests → mobile adapter + screen + analytics → gates → E2E flow → PR → review. Use after feature-discovery has produced an approved spec, or when asked to build a specced ticket.
allowed-tools
Bash(git:*), Bash(gh:*), Bash(scripts/dev-venv.sh:*), Bash(npm:*), Bash(npx:*), Bash(maestro:*), Bash(cd:*), Read, Glob, Grep, Edit, Write
argument-hint
<spec path or ticket id>

03 SKILL.md 正文

Build feature

Input: an approved spec in docs/product/specs/. No spec means you run feature-discovery first.

Claude Code accelerators (optional, both cost more tokens):

  • Thorough mode: the build-feature Workflow (.claude/workflows/build-feature.js) runs this same order as a script: plan, tests first, backend and mobile in parallel, break-it self-review, draft PR, then the pr-review workflow. Use it only when the owner asks for it.
  • Several specced tickets at once: spawn one background subagent per ticket with isolation: worktree, so each builds in its own checkout, and review each PR as it lands. In Codex, run tickets one after another (or in separate codex --worktree sessions).

Order of work (each step verified before the next)

  1. Re-screen the risk: python3 scripts/risk_gate.py rescreen --file <spec path>. A feature can carry the idea into a category it was never screened for (a map, a chat, a kids mode, a health log). If it reports a new category, the tier may rise and it opens that category's must-answer questions: stop and put them to the owner in one structured round before any code, write each answer back to design/brief.json → risk, add the misuse case it asks for, and regenerate docs/product/RISK.md. The answers usually change the design (who consents, who sees what, how long it's kept), and ship refuses while any stays open.
  2. Branch: new-worktree skill → feat/<ticket>-<slug>.
  3. Tests first where it's cheap: write the FR→TC tests from the spec's test plan (backend pytest; pure mobile logic in jest). Watch them fail.
  4. Migration (if any): new timestamped file, additive, RLS, rollback in header.
  5. Backend: service (pure logic) → router (I/O, get_current_user, scoped by user.id) → Wire response model. scripts/dev-venv.sh python -m pytest -q.
  6. Mobile: *Wire type + adapter in lib/api.ts → screen from components/ui primitives + theme tokens → analytics helpers (view event, success+failure) → honest loading/empty/error states → testIDs. cd mobile && npm run gates, which must pass the accessibility checks too: mobile/scripts/check-a11y.js (a role and a label on every control, images labelled or decorative, text that scales, motion through lib/motion.ts) and mobile/__tests__/a11y-screens.test.tsx (every route at 100% and 200% text). Fix the screen; an // a11y-ignore: <why> is for a real exception the reviewer can judge. Then python3 scripts/a11y_labels.py and commit docs/product/ACCESSIBILITY.md if it changed (CI fails on a stale one). Build to docs/DEFAULTS.md unless the spec or the ledger overrides it: ask for a permission only from the moment it's useful, after the payoff; a notification goes out at most once a day, never in quiet hours (9pm to 8am local), and points at the core loop.
  7. E2E: give the new screen a root <screen>-screen (or -sheet) testID and add a flow under mobile/.maestro/ for its happy path (check-maestro-coverage in the gates fails without one). Write the flow even when maestro isn't installed here: the YAML is the spec of the happy path. Run it through the Maestro MCP (list_devices → run; inspect_screen when a selector misses) and say in the PR whether it ran on a device, only passed maestro check-syntax, or is written but unrun. Never report an E2E pass you didn't watch. See docs/qa/MAESTRO.md.
  8. Self-review: re-read your diff as a hostile reviewer. What would break for a user on last month's app build? What if the request comes from a different user? What if the user taps twice on a slow network? For each important test, break the code on purpose (drop the filter, pick the wrong row, skip a field) and confirm the test goes red. A test whose fixture can't tell right from wrong (e.g. "latest by X" where X and list order agree) proves nothing.
  9. Context: update AGENTS.md → "Where things live" (a new screen, router, service or table gets its row; the harness lint fails CI otherwise), and any rule or product line this feature made untrue. Future agents read this first.
  10. PR: draft PR, body = spec link + what changed + how it was verified (real command output). Then run the land skill, which reviews (pr-review), fixes, waits on CI and merges. After it merges, run next.

Never

  • Weaken or delete a test to get green.
  • Change a wire field in place (add alongside).
  • Claim done on code you didn't run.
  • Widen scope silently. File a ticket for anything you notice and keep going.
  • Build past a re-screen with open risk questions, or edit design/brief.json → risk to quiet the gate. The owner answers or accepts them.

Ask the owner

Follow .agents/rules/product-judgement.md: ask with a structured question (recommended option first), never decide these silently. In this skill that means: Anything the spec didn't settle that a user would notice: an extra state or screen, cutting an acceptance criterion, copy, a default value, a limitation you'd ship with. Stop and ask before building it, not in the PR afterwards. Pure implementation choices stay yours.

04 同仓库更多 Skills

foxinthehenhouse
foxinthehenhouse/app-in-a-box

ship

Release checklist for getting a build to testers or the stores. Runs the risk gate first (refuses while a risk item is open) and walks the owner through the compliance checklist. Covers the version bump, EAS build and submit, OTA updates and when they're safe, changelog, store listing, privacy nutrition label / data safety form, the Accessibility Nutrition Labels, and the account-deletion requirement. Guidance-level; it never handles signing secrets. Use when asked to ship, release, submit to TestFlight / App Store / Play, or push an OTA update.

★ 0
foxinthehenhouse
foxinthehenhouse/app-in-a-box

routines

Put the project's recurring rituals on a schedule, with the owner's consent. Weekly north-star report, monthly market watch, dependency triage, Supabase advisor sweep, reflect and harness-optimize. Uses Claude Code Routines (cloud cron) where they fit, and documents the Codex / local cron equivalent. Use when asked to automate, schedule or "keep the project moving on its own", or after setup finishes.

★ 0
foxinthehenhouse
foxinthehenhouse/app-in-a-box

reflect

Consolidate what recent sessions learned into the project's long-term memory (.agents/memory). Use at the end of a substantial session, after a correction from the user, after a painful debugging session, when the session-start healthcheck says reflect is overdue or a pending-reflection seed is waiting, or when MEMORY.md exceeds its budget.

★ 0
foxinthehenhouse
foxinthehenhouse/app-in-a-box

pr-review

Review a pull request on the owner's behalf and fix what's safe to fix. Runs the deterministic gates first, then correctness/security, design-system, accessibility and analytics review passes, verifies each blocking finding, applies safe fixes, re-checks, and ends with a plain-English verdict. Use when a PR is opened, when asked to review a PR, a branch or a pasted diff, or before merging anything.

★ 0
foxinthehenhouse
foxinthehenhouse/app-in-a-box

north-star-report

Weekly product-analytics and reliability readout. Pulls the funnel of the brief's 5 north-star events from PostHog, finds the biggest drop-offs and errors, checks each SLO in docs/slo.yaml against its error budget, compares with last week, and proposes (then, with a yes, files) tickets that target them. Use weekly, when the session-start line says it's overdue, when the backlog is empty, or when asked "how is the app doing?".

★ 0
foxinthehenhouse
foxinthehenhouse/app-in-a-box

next

Decide the single next best thing to work on, with two alternates. Reads setup progress, work in progress, open PRs and failing CI, the backlog (GitHub Issues or Linear), overdue harness rituals, product decisions parked until now, and north-star analytics if PostHog is connected. Use when someone asks "what next?", "what should I work on?", at the start of a session, or after a PR merges.

★ 0