# Workflow — Feature Development Flow 默认循环。环境:本机 Go/Vite + deps-only Docker(见 [development.md](development.md))。 ``` Receive task ↓ 1. Understand - feature-map / lexicon / user-journey / page-tree(产品) - **feature-design.md + feature-spec/.md**(功能详细设计;缺失则先补) - domain-map / erd / OpenAPI(数据与契约) ↓ 2. Feature Spec(强制) - 新功能或重大行为:复制 _TEMPLATE → 填满 §1–§13 - 对照 Spec §4/§6/§7/§9/§12;playbook: feature-spec ↓ 3. Design(技术契约) - Update OpenAPI / erd / migration 草案(对齐 Spec §8/§9) - ADR if stack/API style changes - 更新 Spec §14 Implementation Notes ↓ 4. Implement - Backend(service 竖切)→ Frontend - Follow patterns + playbooks ↓ 5. Verify - Spec §12 Acceptance + definition-of-done.md(非仅 build) - commands(L0/L1/L2 as required) - Review Report + checklist ↓ 6. Document - OpenAPI / erd / Spec Gaps / p1-status 标签若变化 ↓ Commit(Conventional Commits,one concern) ``` ## Architecture Check 1. Reverse Accepted ADR? → ASK / new ADR. 2. Correct layer? Handler / Service / Repository? 3. Domain words = `.ai/domain.md` + lexicon for UI? 4. Envelope still `{code,message,data}`? 5. Local workflow still host runtime(非 Docker-only 编码)? ## Stop conditions - Unclear requirement → **ASK FIRST** - Need GraphQL / new auth scheme / new datastore → ADR before coding - Urge to “just ALTER TABLE” → write migration instead ## Playbooks Prefer: `feature-spec` · `add-api` · `new-page` · `new-table` · `payment` · `login`