implementation-order ยท diff
git:20260507.fc5df68 to git:20261004.8e8554b
4 added, 6 removed. Audit A to A.
---
description: Layered implementation order (cake model)
globs: cmd/**/*.go, internal/**/*.go, external/**/*.go, lib/**/*.go, tools/**/*.go
alwaysApply: false
---
# Implementation order
- For **new behavior**, **`workflow.mdc` wins** on red-green order. Use this file to decide **where** code lives and which layer to extend first.
+ For **new behavior**, the **workflow rule** wins on red-green order. Use this file to decide **where** code lives and which layer to extend first.
1. Extend the **lowest** layer that can own the change with no new upward dependencies.
- 2. Add tests at that layer before or with the change (see **`testing.mdc`**).
+ 2. Add tests at that layer before or with the change (see the **testing rule**).
3. Wire through **`internal/agent`** or **`internal/acp`** only after lower pieces exist and pass tests.
- 4. Optional HTTP surface - last mile in **`external/httpserver`**, then refresh **`openapi.go`** and docs per **`api-layer.mdc`** and **`workflow.mdc`**.
+ 4. Optional HTTP surface - last mile in **`external/httpserver`**, then refresh **`openapi.go`** and docs per the **API-layer** and **workflow** rules.
## Forbidden
- Skipping tests for new behavior.
- Placing domain logic in **`cmd/`** or duplicating it in HTTP handlers instead of reusing **`internal/`** APIs.
## References
- @architecture.mdc
- @workflow.mdc
- @api-layer.mdc
+ @docs/contributing/architecture.md