@tea-agent/loop-agent 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +10 -2
- package/CHANGELOG.md +91 -24
- package/README.md +84 -12
- package/dist/application/dag/args.js +1 -12
- package/dist/application/dag/generate-task-dag.js +38 -2
- package/dist/application/dag/run-dag.js +11 -27
- package/dist/application/dag/validate-dag.js +13 -2
- package/dist/application/loop/run-action.js +0 -4
- package/dist/cli/command-definitions.js +44 -16
- package/dist/cli/program.js +40 -23
- package/dist/cli/update/notifier.js +117 -0
- package/dist/cli/update/npm-client.js +151 -0
- package/dist/cli/update/policy.js +58 -0
- package/dist/cli/update/state.js +68 -0
- package/dist/cli.js +33 -0
- package/dist/commands/cursor-prompt.js +42 -82
- package/dist/commands/dag-approve.js +36 -0
- package/dist/commands/delegate.js +75 -77
- package/dist/commands/doctor.js +0 -18
- package/dist/commands/init.js +547 -95
- package/dist/commands/instructions.js +7 -10
- package/dist/commands/loop.js +4 -20
- package/dist/commands/plan.js +50 -0
- package/dist/executors/config-core.js +0 -51
- package/dist/executors/dag-pi-executor.js +1 -1
- package/dist/executors/dag.js +0 -1
- package/dist/executors/index.js +0 -2
- package/dist/executors/model-routing.js +9 -9
- package/dist/executors/shell-executor.js +1 -1
- package/dist/governance/checks.js +6 -3
- package/dist/governance/exec-plans.js +545 -0
- package/dist/governance/manifest-types.js +24 -2
- package/dist/infrastructure/harness/loop-action-store.js +0 -3
- package/dist/records/harvest.js +2 -23
- package/dist/records/one-shot-runs.js +1 -1
- package/dist/shared/artifacts-core.js +24 -5
- package/dist/shared/output-truncation.js +37 -0
- package/dist/shared/package-metadata.js +488 -0
- package/dist/{executors/cursor-executor.js → sidecars/cursor-prompt/executor.js} +2 -42
- package/dist/sidecars/cursor-prompt/index.js +3 -0
- package/dist/sidecars/cursor-prompt/stream.js +121 -0
- package/dist/task/config-types.js +29 -12
- package/dist/task/delegate.js +9 -21
- package/dist/task/runtime.js +1 -2
- package/dist/worker/cli.js +32 -3
- package/dist/worker/delivery/final-verification.js +47 -11
- package/dist/worker/delivery/package.js +63 -10
- package/dist/worker/feature/run.js +60 -8
- package/dist/worker/loop-agent/loop-agent-client.js +329 -126
- package/dist/worker/observability/event-history.js +216 -0
- package/dist/worker/observability/read-model.js +338 -83
- package/dist/worker/observe/paths.js +17 -0
- package/dist/worker/observe/routes.js +165 -21
- package/dist/worker/observe/server.js +59 -1
- package/dist/worker/observe/static/api.js +27 -0
- package/dist/worker/observe/static/app.js +120 -2317
- package/dist/worker/observe/static/constants.js +148 -0
- package/dist/worker/observe/static/copy.js +67 -0
- package/dist/worker/observe/static/dag-helpers.js +172 -0
- package/dist/worker/observe/static/dag-model.js +72 -0
- package/dist/worker/observe/static/dom.js +61 -0
- package/dist/worker/observe/static/format-pool.js +67 -0
- package/dist/worker/observe/static/format.js +292 -0
- package/dist/worker/observe/static/index.html +300 -82
- package/dist/worker/observe/static/kpi.js +94 -0
- package/dist/worker/observe/static/relations.js +128 -0
- package/dist/worker/observe/static/router.js +85 -0
- package/dist/worker/observe/static/run-processing.js +148 -0
- package/dist/worker/observe/static/shell-chrome.js +68 -0
- package/dist/worker/observe/static/state.js +253 -0
- package/dist/worker/observe/static/styles.css +1720 -495
- package/dist/worker/observe/static/views/batch.js +226 -0
- package/dist/worker/observe/static/views/dag-graph.js +172 -0
- package/dist/worker/observe/static/views/dag-inspector.js +477 -0
- package/dist/worker/observe/static/views/dag.js +362 -0
- package/dist/worker/observe/static/views/dashboard.js +442 -0
- package/dist/worker/observe/static/views/failures.js +143 -0
- package/dist/worker/observe/static/views/feature.js +453 -0
- package/dist/worker/observe/static/views/pool.js +347 -0
- package/dist/worker/observe/static/views/run.js +453 -0
- package/dist/worker/observe/static/views/session-timeline.js +205 -0
- package/dist/worker/observe/static/views/shell.js +7 -0
- package/dist/worker/observe/static/views/task.js +260 -0
- package/dist/worker/observe/static/views/timeline.js +163 -0
- package/dist/worker/preflight.js +49 -1
- package/dist/worker/run-task/run-task.js +22 -12
- package/dist/worker/runner/run-ready.js +76 -12
- package/dist/worker/task-spec/schema.js +0 -1
- package/dist/workflows/dag/controller-identity.js +104 -0
- package/dist/workflows/dag/convergence/controller.js +1 -1
- package/dist/workflows/dag/executor-registry.js +0 -2
- package/dist/workflows/dag/init-hybrid.js +797 -27
- package/dist/workflows/dag/node-execution.js +183 -35
- package/dist/workflows/dag/repair-artifact.js +91 -0
- package/dist/workflows/dag/report.js +50 -0
- package/dist/workflows/dag/retry-policy.js +138 -0
- package/dist/workflows/dag/runner.js +77 -17
- package/dist/workflows/dag/runtime-contract.js +87 -0
- package/dist/workflows/dag/scheduler.js +7 -2
- package/dist/workflows/dag/sdd-embedded.js +128 -0
- package/dist/workflows/dag/skill-instructions.js +5 -4
- package/dist/workflows/dag/skill-snapshot.js +529 -0
- package/dist/workflows/dag/types.js +86 -10
- package/dist/workflows/dag/validate.js +73 -12
- package/dist/workflows/loop/actions/dag-action.js +0 -2
- package/dist/workflows/loop/actions/shared.js +1 -1
- package/dist/workflows/loop/actions.js +14 -31
- package/dist/workflows/loop/benchmark.js +1 -1
- package/dist/workflows/loop/index.js +1 -1
- package/dist/workflows/loop/policy/auto-policy.js +22 -14
- package/dist/workflows/loop/policy/path-patterns.js +13 -0
- package/docs/README.md +36 -33
- package/docs/agent-dag-recovery-playbook.md +1 -1
- package/docs/agent-dag-runner.md +28 -3
- package/docs/architecture/README.md +26 -0
- package/docs/architecture/dag-execution.md +140 -0
- package/docs/architecture/evolution.md +53 -0
- package/docs/architecture/facts-and-state.md +58 -0
- package/docs/architecture/runtime-boundaries.md +45 -17
- package/docs/architecture/system-overview.md +93 -0
- package/docs/architecture/worker-and-feature.md +81 -0
- package/docs/cursor-prompt-sidecar.md +36 -0
- package/docs/decisions/README.md +13 -1
- package/docs/design/README.md +43 -21
- package/docs/development-principles.md +2 -2
- package/docs/exec-plans/active/README.md +1 -3
- package/docs/exec-plans/completed/README.md +23 -0
- package/docs/feature-workflow.md +78 -4
- package/docs/harness-methodology-debugging.md +1 -1
- package/docs/harness-methodology-tdd.md +3 -3
- package/docs/init-surface.manifest.json +60 -25
- package/docs/loop-agent-harness.md +28 -4
- package/docs/progress/README.md +50 -1
- package/docs/reports/README.md +90 -18
- package/docs/skills/README.md +2 -1
- package/docs/skills/vetted-skill-registry.md +2 -1
- package/docs/templates/agent-dag-report.schema.json +23 -6
- package/docs/templates/agent-dag.base.json +0 -5
- package/docs/templates/agent-dag.final-verification.json +0 -5
- package/docs/templates/agent-dag.schema.json +70 -3
- package/docs/templates/agent-dag.supervised-implementation.json +9 -8
- package/docs/templates/backend-test-dag.generate-pytest.prompt.md +139 -0
- package/docs/templates/backend-test-dag.json +276 -0
- package/docs/templates/backend-test-dag.retrospect.prompt.md +125 -0
- package/docs/templates/backend-test-dag.review-cases.prompt.md +81 -0
- package/docs/templates/frontend-design-contract.md +33 -0
- package/docs/templates/frontend-task-constraints.md +25 -0
- package/docs/templates/frontend-task-requirement.md +61 -0
- package/docs/templates/harness.schema.json +10 -12
- package/docs/templates/hybrid-dag.json +1 -6
- package/docs/templates/interactive-ui-round2-experiment.md +1 -1
- package/docs/templates/product-line/task.yaml +0 -1
- package/docs/templates/project-start-checklist.md +2 -2
- package/docs/templates/worker-dogfood-evidence.md +28 -0
- package/docs/templates/worker-dogfood-setup.md +20 -0
- package/docs/verification-matrix.md +10 -0
- package/examples/decision-gate-agent-dag.json +87 -33
- package/examples/example-dag.json +0 -5
- package/examples/hybrid-loop-agent-dag.json +0 -5
- package/harness.json +7 -15
- package/package.json +22 -46
- package/scripts/check-product-line-docs.sh +10 -7
- package/skills/agent-worker/SKILL.md +37 -0
- package/skills/agent-worker/references/agent-worker-operator.md +43 -0
- package/skills/frontend-design-review/SKILL.md +59 -0
- package/skills/frontend-design-review/references/review-checklist.md +37 -0
- package/skills/frontend-implementation/SKILL.md +51 -0
- package/skills/frontend-implementation/references/code-standards.md +34 -0
- package/skills/frontend-implementation/references/design-spec.md +46 -0
- package/skills/frontend-implementation/references/node-contracts.md +32 -0
- package/skills/frontend-review/SKILL.md +53 -0
- package/skills/frontend-review/references/review-findings.md +42 -0
- package/skills/frontend-verification/SKILL.md +40 -0
- package/skills/frontend-verification/references/verification-checklist.md +56 -0
- package/skills/grill-me/SKILL.md +10 -0
- package/skills/grill-with-docs/SKILL.md +88 -0
- package/skills/grill-with-docs/adr-format.md +47 -0
- package/skills/grill-with-docs/context-format.md +60 -0
- package/skills/loop-agent/SKILL.md +11 -9
- package/skills/loop-agent/references/command-reference.md +14 -15
- package/skills/loop-agent/references/docs-converge.md +126 -0
- package/skills/loop-agent/references/harness-policy.md +7 -7
- package/skills/loop-agent/references/hybrid-dag.md +36 -20
- package/skills/loop-agent/references/long-running-loop.md +4 -6
- package/skills/loop-agent/references/multi-worktree.md +6 -6
- package/skills/loop-agent/references/orchestrator-and-interventions.md +3 -3
- package/skills/loop-agent/references/pi-subagent-assisted-mode.md +14 -11
- package/skills/loop-agent/references/task-workflow.md +1 -1
- package/skills/loop-agent/references/verification-and-failure-handling.md +6 -0
- package/skills/using-git-worktrees/SKILL.md +215 -0
- package/dist/commands/cursor-worker.js +0 -43
- package/dist/cursor-worker-entry.js +0 -8
- package/dist/executors/cursor-artifacts.js +0 -33
- package/dist/executors/cursor-execution-log.js +0 -81
- package/dist/executors/cursor-executor-artifacts.js +0 -134
- package/dist/executors/cursor-run.js +0 -115
- package/dist/executors/cursor-tool.js +0 -94
- package/dist/executors/cursor-worker-client.js +0 -223
- package/dist/executors/cursor-worker-protocol.js +0 -18
- package/dist/executors/cursor-worker-server.js +0 -54
- package/dist/executors/cursor-worker.js +0 -3
- package/dist/executors/cursor.js +0 -6
- package/dist/executors/dag-cursor-executor.js +0 -87
- package/dist/workflows/loop/actions/cursor-fix.js +0 -191
- package/dist/workflows/loop/policy/cursor-fix-policy.js +0 -31
- package/docs/cursor-executor-usage.md +0 -25
- package/docs/dynamic-workflow-dag-engine-roadmap.md +0 -1749
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-design-review
|
|
3
|
+
description: Use for the frontend plan design gate before any writer runs.
|
|
4
|
+
references:
|
|
5
|
+
- path: references/review-checklist.md
|
|
6
|
+
required: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Frontend Design Review
|
|
10
|
+
|
|
11
|
+
Use for `frontend-design-gate-pi`. Read the required checklist first. Review the
|
|
12
|
+
contract, scout report, plan, task source/constraints, `task.json` boundaries, and
|
|
13
|
+
traceable component/design evidence. The connector format is TODO; never fabricate
|
|
14
|
+
a result. When knowledge-base access is absent, failed, or unmatched, require evidence
|
|
15
|
+
that `<repoRoot>/openSpec/**` was searched before accepting other repo conventions.
|
|
16
|
+
|
|
17
|
+
## Verdict Contract
|
|
18
|
+
|
|
19
|
+
The first non-empty line must be exactly:
|
|
20
|
+
|
|
21
|
+
- `VERDICT: pass`
|
|
22
|
+
- `VERDICT: request-revision`
|
|
23
|
+
|
|
24
|
+
Use request-revision for any blocker. The shell gate reads this line exactly.
|
|
25
|
+
|
|
26
|
+
## Blocking Conditions
|
|
27
|
+
|
|
28
|
+
- An acceptance criterion lacks implementation or verification coverage.
|
|
29
|
+
- Applicable UI states are missing without a reason.
|
|
30
|
+
- A dependency is not explicitly permitted.
|
|
31
|
+
- Confirmed project primitives/rules are ignored, or a claim has neither knowledge-base nor required `openSpec/` fallback evidence.
|
|
32
|
+
- Planned paths exceed allowed/write scope or touch forbidden/generated paths.
|
|
33
|
+
- Required static or behavior commands are missing or non-deterministic.
|
|
34
|
+
- Interaction, responsive, accessibility, data, or failure behavior is ambiguous enough to require guessing.
|
|
35
|
+
|
|
36
|
+
Knowledge-base unavailability alone is advisory when relevant `openSpec/` rules were
|
|
37
|
+
searched and applied. Block when that fallback was skipped, sources conflict without
|
|
38
|
+
resolution, or no source resolves a required user-visible decision.
|
|
39
|
+
|
|
40
|
+
## Method And Output
|
|
41
|
+
|
|
42
|
+
Map each criterion to steps, files, states, and checks; audit paths; verify evidence;
|
|
43
|
+
then classify findings as Blocking or Advisory. Do not edit files.
|
|
44
|
+
|
|
45
|
+
```markdown
|
|
46
|
+
VERDICT: pass
|
|
47
|
+
|
|
48
|
+
## Findings
|
|
49
|
+
- None blocking.
|
|
50
|
+
|
|
51
|
+
## Required Plan Corrections
|
|
52
|
+
- None.
|
|
53
|
+
|
|
54
|
+
## Checked Items
|
|
55
|
+
- ...
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
For revisions, every correction names the criterion/section, missing evidence or
|
|
59
|
+
decision, and exact plan change required.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Frontend Design Review Checklist
|
|
2
|
+
|
|
3
|
+
## Requirement And State Coverage
|
|
4
|
+
|
|
5
|
+
- Target route/page/component and non-goals are clear.
|
|
6
|
+
- Every acceptance criterion maps to steps, files, UI behavior, and verification.
|
|
7
|
+
- Assumptions and unresolved ambiguity are explicit.
|
|
8
|
+
- Success, error/validation, loading, empty, disabled, permission, retry, repeated-action, stale-response, and boundary states are handled or marked not applicable.
|
|
9
|
+
|
|
10
|
+
## Project And Knowledge Fit
|
|
11
|
+
|
|
12
|
+
- Existing components, hooks, API helpers, mocks, schemas, router patterns, templates, tokens, and theme rules were considered.
|
|
13
|
+
- Component/design choices cite a knowledge-base result or relevant `openSpec/` rule.
|
|
14
|
+
- If knowledge-base setup/query failed or returned no match, `<repoRoot>/openSpec/**` was recursively searched before other repo evidence.
|
|
15
|
+
- Source is `knowledge-base`, `openSpec fallback`, `repository fallback`, or `unavailable`; evidence includes query/search terms, matched paths/headings, and conflicts.
|
|
16
|
+
- Dependencies are authorized; paths fit allowed/write scope and avoid forbidden/generated files.
|
|
17
|
+
|
|
18
|
+
## Interaction And Quality
|
|
19
|
+
|
|
20
|
+
- Actions, feedback, validation timing, navigation, persistence, and recovery are unambiguous.
|
|
21
|
+
- Responsive and overflow behavior covers target environments.
|
|
22
|
+
- Keyboard, focus, semantics, contrast, reduced motion, data lifecycle, cancellation, and error recovery are addressed when applicable.
|
|
23
|
+
|
|
24
|
+
## Verification
|
|
25
|
+
|
|
26
|
+
- Static and behavior commands are exact, discoverable, and deterministic.
|
|
27
|
+
- Tests prove changed state logic and flows at repository-supported levels.
|
|
28
|
+
- Browser/visual checks are required only by task intent or existing gates.
|
|
29
|
+
- Every missing verification path is a blocker or disclosed risk.
|
|
30
|
+
|
|
31
|
+
## Verdict Matrix
|
|
32
|
+
|
|
33
|
+
- Coverage gap, unsafe scope, unauthorized dependency, unresolved required interaction, or missing required verification: request revision.
|
|
34
|
+
- Missing knowledge-base evidence and skipped `openSpec/` fallback: request revision.
|
|
35
|
+
- No relevant knowledge-base or `openSpec/` rule for a required decision: request revision.
|
|
36
|
+
- Knowledge-base unavailable but relevant `openSpec/` rules were applied: advisory connection gap, not a specification gap.
|
|
37
|
+
- Optional cleanup that cannot affect acceptance: advisory.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-implementation
|
|
3
|
+
description: >-
|
|
4
|
+
Use for frontend contract, scout, plan, and implementation DAG nodes.
|
|
5
|
+
references:
|
|
6
|
+
- path: references/node-contracts.md
|
|
7
|
+
required: true
|
|
8
|
+
maxChars: 3000
|
|
9
|
+
- path: references/design-spec.md
|
|
10
|
+
required: true
|
|
11
|
+
maxChars: 3000
|
|
12
|
+
- path: references/code-standards.md
|
|
13
|
+
required: true
|
|
14
|
+
maxChars: 3000
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Frontend Implementation
|
|
18
|
+
|
|
19
|
+
Use for `frontend-contract-pi`, `frontend-scout-pi`, `frontend-plan-pi`, and
|
|
20
|
+
`frontend-implement-pi`. Read every required reference before acting.
|
|
21
|
+
|
|
22
|
+
## Source And Evidence Rules
|
|
23
|
+
|
|
24
|
+
Use task source and references first, then constraints and `task.json`. Resolve
|
|
25
|
+
component/design rules by the required sequence in `design-spec.md`: connect/query
|
|
26
|
+
the knowledge base first; when it is not configured, connection/query fails, or no
|
|
27
|
+
relevant result exists, search `<repoRoot>/openSpec/**` and treat matching rules as
|
|
28
|
+
the current project's specification. Use other repository evidence only afterward.
|
|
29
|
+
|
|
30
|
+
- Cite repository findings with paths and symbols or tight line ranges.
|
|
31
|
+
- Label assumptions, unresolved questions, and unavailable evidence.
|
|
32
|
+
- Never invent conventions, component APIs, tokens, commands, or knowledge-base results.
|
|
33
|
+
- Record the selected source as `knowledge-base`, `openSpec fallback`, `repository fallback`, or `unavailable`, with evidence and conflicts.
|
|
34
|
+
|
|
35
|
+
## Implementation Discipline
|
|
36
|
+
|
|
37
|
+
- Treat explicit project specs and repo-local skills as authoritative within their stated scope.
|
|
38
|
+
- Reuse confirmed components, tokens, helpers, APIs, mocks, schemas, and test patterns.
|
|
39
|
+
- Do not add dependencies unless the task allows them and the approved plan justifies them.
|
|
40
|
+
- Cover applicable success, error, loading, empty, disabled, permission, and boundary states; mark non-applicable states with reasons.
|
|
41
|
+
- Keep state and validation logic testable where project conventions support it.
|
|
42
|
+
- Writer nodes stay inside `writeSet`, preserve unrelated behavior, and update tests with behavior.
|
|
43
|
+
- Never relax lint/type/test/build configuration or write unauthorized generated output.
|
|
44
|
+
|
|
45
|
+
## Output And Failure Rules
|
|
46
|
+
|
|
47
|
+
- Follow the node-specific headings in `node-contracts.md` exactly.
|
|
48
|
+
- Read-only nodes return Markdown and never edit repository files.
|
|
49
|
+
- Missing input blocks a node when proceeding would guess behavior, design compliance, write boundaries, or verification.
|
|
50
|
+
- Keep protocol tokens, commands, paths, identifiers, and configured output language unchanged.
|
|
51
|
+
- Implementation may report attempted checks, but completion requires fresh downstream shell evidence.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Frontend Code Standards
|
|
2
|
+
|
|
3
|
+
Discover project rules from task constraints, the component/design source sequence
|
|
4
|
+
in `design-spec.md`, configuration, source, tests, manifests, and generated types.
|
|
5
|
+
When knowledge-base access is unavailable, relevant `<repoRoot>/openSpec/**` rules
|
|
6
|
+
are normative for the current project. Generic style preferences are not rules, and
|
|
7
|
+
documentation never overrides an installed API without an explicit compatibility decision.
|
|
8
|
+
|
|
9
|
+
## Discover And Cite
|
|
10
|
+
|
|
11
|
+
- Routing, server/client boundaries, state, forms, data fetching, cache/invalidation, and error boundaries.
|
|
12
|
+
- API, mock, page, component, hook, utility, schema, template, and test directories.
|
|
13
|
+
- Component, hook, route, mock, utility, and test naming.
|
|
14
|
+
- Unit, component, integration, browser/e2e, fixture, and mock expectations.
|
|
15
|
+
- Approved/forbidden dependencies and human-approval rules.
|
|
16
|
+
|
|
17
|
+
Cite a representative file or configuration for every convention. When neighboring
|
|
18
|
+
code conflicts, describe the alternatives rather than silently choosing one.
|
|
19
|
+
|
|
20
|
+
## Plan And Implement
|
|
21
|
+
|
|
22
|
+
- Map each acceptance criterion to code and verification.
|
|
23
|
+
- Determine component placement, state ownership, request lifecycle, validation, error handling, API/schema compatibility, mocks, and fixtures.
|
|
24
|
+
- Prefer existing helpers and public APIs; preserve behavior outside the contract.
|
|
25
|
+
- Keep rendering, transitions, validation, and side effects separable where the project pattern supports it.
|
|
26
|
+
- Handle cancellation, stale responses, repeated actions, and boundary inputs when applicable.
|
|
27
|
+
- Update tests at repository-supported levels; update relevant existing tests before adding duplicates.
|
|
28
|
+
- Keep writes inside `writeSet`; generated output requires explicit authorization.
|
|
29
|
+
|
|
30
|
+
## Prohibited
|
|
31
|
+
|
|
32
|
+
- Do not relax lint/type/test configuration.
|
|
33
|
+
- Do not add dependencies, a parallel component library, styling system, or state framework without permission.
|
|
34
|
+
- Do not describe an unexecuted command or unavailable browser/knowledge-base flow as verified.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Frontend Design And Component Specification
|
|
2
|
+
|
|
3
|
+
## Required Source Sequence
|
|
4
|
+
|
|
5
|
+
1. Attempt the configured component/design knowledge-base query first.
|
|
6
|
+
2. If unavailable, failed, timed out, or unmatched, recursively search the project root's exact `openSpec/` directory.
|
|
7
|
+
3. Treat relevant matches as the current project's specification for this run.
|
|
8
|
+
4. Only then use component source, tokens, stories, tests, and pages as non-normative repository fallback.
|
|
9
|
+
|
|
10
|
+
Never skip `openSpec/` directly to neighboring-code conventions. Report source
|
|
11
|
+
conflicts instead of combining them. Explicit task requirements remain the contract;
|
|
12
|
+
flag conflicts with knowledge-base or `openSpec/` rules.
|
|
13
|
+
|
|
14
|
+
## Knowledge Base Connection — TODO
|
|
15
|
+
|
|
16
|
+
Request format is undecided. TODO: define connector/owner, namespaces, secret-free
|
|
17
|
+
auth, query fields, result identity/version/time, and failure behavior.
|
|
18
|
+
|
|
19
|
+
Attempt only a connector actually available in the execution environment. Otherwise
|
|
20
|
+
record `not-configured` and run the `openSpec/` fallback; never invent a connection.
|
|
21
|
+
|
|
22
|
+
## `openSpec/` Fallback Procedure
|
|
23
|
+
|
|
24
|
+
- Confirm whether `<repoRoot>/openSpec/` exists and enumerate its files recursively.
|
|
25
|
+
- Read indexes first, then search names/content using task, route, component, interaction, theme, token, and state terms.
|
|
26
|
+
- Read relevant matches in context; do not treat a filename-only hit as a rule.
|
|
27
|
+
- Record search terms, inspected/matched paths, headings or tight line ranges, applied rules, and conflicts.
|
|
28
|
+
- If the directory or relevant rules are absent, record that fact before using repository fallback.
|
|
29
|
+
|
|
30
|
+
## Retrieval Evidence
|
|
31
|
+
|
|
32
|
+
Record source as `knowledge-base`, `openSpec fallback`, `repository fallback`, or
|
|
33
|
+
`unavailable`. Knowledge-base evidence includes query, source ID/version/time, rules,
|
|
34
|
+
and conflicts. `openSpec fallback` includes terms, paths/headings/lines, rules, and conflicts.
|
|
35
|
+
|
|
36
|
+
## Rules To Retrieve Or Discover
|
|
37
|
+
|
|
38
|
+
- Components, variants, props, composition, accessibility, deprecations, placement, forms, overlays, navigation, and state patterns.
|
|
39
|
+
- Tokens, typography, color, layout, breakpoints, motion, focus/keyboard/contrast, exceptions, design debt, and forbidden patterns.
|
|
40
|
+
|
|
41
|
+
## Gate Expectations
|
|
42
|
+
|
|
43
|
+
- Reuse confirmed primitives unless a new pattern is authorized.
|
|
44
|
+
- Define applicable states and responsive behavior before implementation.
|
|
45
|
+
- Cite knowledge-base or `openSpec/` evidence for component/token choices; label weaker repository fallback.
|
|
46
|
+
- Make deviations and unresolved gaps explicit.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Frontend Node Contracts
|
|
2
|
+
|
|
3
|
+
## `frontend-contract-pi`
|
|
4
|
+
|
|
5
|
+
- Read task source, constraints, `task.json`, and explicit references; do not edit.
|
|
6
|
+
- Define scope, non-goals, routes/components, runtime, user flows, acceptance criteria, states, risks, and verification expectations.
|
|
7
|
+
- Preserve requirement IDs and language; never turn an implementation guess into a requirement.
|
|
8
|
+
- For every standard UI state, specify behavior or mark it not applicable with a reason.
|
|
9
|
+
- Output: `Scope`, `Non-goals`, `Acceptance Criteria`, `UI States`, `Target Runtime Environment`, `Risks`, `Verification Expectations`.
|
|
10
|
+
|
|
11
|
+
## `frontend-scout-pi`
|
|
12
|
+
|
|
13
|
+
- Inspect routes, pages, components, styles/tokens, state/data flow, API/mocks, scripts, tests, and reusable assets; do not edit.
|
|
14
|
+
- Separate confirmed facts, inferred conventions, and missing information.
|
|
15
|
+
- Attempt knowledge-base first. If absent, failed, or unmatched, recursively inspect `<repoRoot>/openSpec/**` before other repo conventions.
|
|
16
|
+
- Record source as `knowledge-base`, `openSpec fallback`, `repository fallback`, or `unavailable`, with query/search terms and matched paths.
|
|
17
|
+
- Output: `Frontend Stack`, `Routes`, `Components`, `Styling System`, `Existing Design Conventions`, `State / Data Flow`, `Test Entry Points`, `Reuse Opportunities`, `Risks`.
|
|
18
|
+
|
|
19
|
+
## `frontend-plan-pi`
|
|
20
|
+
|
|
21
|
+
- Map every acceptance criterion to ordered implementation and verification steps.
|
|
22
|
+
- Name target files and reasons; keep them within allowed paths and expected `writeSet`.
|
|
23
|
+
- Define states, component/styling reuse, interaction behavior, dependency policy, and exact static/behavior commands.
|
|
24
|
+
- Knowledge-base failure is not approval: apply relevant `openSpec/` matches as current-project rules. Request clarification only when neither source resolves required compliance or they conflict materially.
|
|
25
|
+
- Output: `Implementation Steps`, `Target Files`, `UI State Handling`, `Styling / Component Strategy`, `Interaction Notes`, `Dependency Policy`, `Verification Plan`, `Residual Risks`.
|
|
26
|
+
|
|
27
|
+
## `frontend-implement-pi`
|
|
28
|
+
|
|
29
|
+
- Run only after design gate pass and implement only the approved plan inside `writeSet`.
|
|
30
|
+
- Re-read current files; stop instead of crossing forbidden paths or guessing a blocking decision.
|
|
31
|
+
- Reuse confirmed project primitives and update tests. Do not claim knowledge-base or downstream verification without evidence.
|
|
32
|
+
- Output: `Changed Files`, `Implemented Behavior`, `UI States Covered`, `Styling / Component Notes`, `Verification Attempted`, `Residual Risks`.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-review
|
|
3
|
+
description: Use to review completed frontend code and verification before closeout.
|
|
4
|
+
references:
|
|
5
|
+
- path: references/review-findings.md
|
|
6
|
+
required: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Frontend Review
|
|
10
|
+
|
|
11
|
+
Use for `frontend-review-pi`; read the findings guide first. Required inputs are
|
|
12
|
+
original task/reference material, derived contract/constraints, approved plan and
|
|
13
|
+
design verdict, implementation summary, actual diff, and shell evidence. Missing
|
|
14
|
+
actual diff or required evidence forces revision; never infer it from a summary.
|
|
15
|
+
|
|
16
|
+
## Verdict Contract
|
|
17
|
+
|
|
18
|
+
The first non-empty line must be exactly `VERDICT: pass` or
|
|
19
|
+
`VERDICT: request-revision`. Any Critical/Important finding, failed or missing
|
|
20
|
+
required check, forbidden write, or unmet acceptance criterion forces revision.
|
|
21
|
+
|
|
22
|
+
## Review Scope
|
|
23
|
+
|
|
24
|
+
- Compare original intent, derived artifacts, approved plan, actual diff, and evidence; report lost or altered requirements.
|
|
25
|
+
- Inspect every changed file against allowed, forbidden, and approved write scope.
|
|
26
|
+
- Map criteria to behavior, applicable UI states, tests, and shell evidence.
|
|
27
|
+
- Review state/data flow, validation, async/error behavior, components/design, responsive behavior, accessibility, dependencies, maintenance, and regression risk when applicable.
|
|
28
|
+
- Component/design claims require traceable knowledge-base evidence or, after connection/query failure or no match, relevant `<repoRoot>/openSpec/**` evidence. The connector format is TODO; never claim a query or fallback search without evidence.
|
|
29
|
+
- Treat shell exit status as authoritative. Do not edit files.
|
|
30
|
+
|
|
31
|
+
## Evidence And Output
|
|
32
|
+
|
|
33
|
+
Findings cite a tight file location, exact command/result, or named DAG artifact.
|
|
34
|
+
Separate confirmed defects, missing evidence, and residual risks.
|
|
35
|
+
|
|
36
|
+
```markdown
|
|
37
|
+
VERDICT: request-revision
|
|
38
|
+
|
|
39
|
+
## Findings
|
|
40
|
+
- [Important] `path:line` — issue, impact, and required correction.
|
|
41
|
+
|
|
42
|
+
## Verification Assessment
|
|
43
|
+
- ...
|
|
44
|
+
|
|
45
|
+
## UX Assessment
|
|
46
|
+
- ...
|
|
47
|
+
|
|
48
|
+
## Residual Risks
|
|
49
|
+
- ...
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
A pass requires no Critical/Important findings and all required shell checks passed.
|
|
53
|
+
Still report knowledge-source status and optional browser/manual gaps.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Frontend Review Findings Guide
|
|
2
|
+
|
|
3
|
+
## Severity
|
|
4
|
+
|
|
5
|
+
- **Critical**: blocks primary flow, corrupts data, violates security/privacy, writes forbidden paths, or bypasses required verification.
|
|
6
|
+
- **Important**: acceptance/state/validation gap, material convention drift, missing behavior tests, unauthorized dependency, or failed/missing required verification.
|
|
7
|
+
- **Minor**: non-blocking maintainability, copy, layout, or cleanup issue.
|
|
8
|
+
|
|
9
|
+
## Evidence
|
|
10
|
+
|
|
11
|
+
- Cite tight file locations, exact commands/results, or named DAG artifacts.
|
|
12
|
+
- Never invent evidence; name the missing check. An implementation summary is not the actual diff.
|
|
13
|
+
- Failed required static/behavior verification is at least Important unless proven unrelated.
|
|
14
|
+
- A knowledge-base claim records connector/query, source ID/version, and retrieval time. If absent, failed, or unmatched, review evidence must show `<repoRoot>/openSpec/**` search terms and matched paths/headings; label `openSpec fallback`, `repository fallback`, or `unavailable` accurately.
|
|
15
|
+
|
|
16
|
+
## Review Sequence
|
|
17
|
+
|
|
18
|
+
1. Establish changed-file inventory and write boundaries.
|
|
19
|
+
2. Compare original requirement with derived contract/constraints.
|
|
20
|
+
3. Map each criterion to code, states, tests, and evidence.
|
|
21
|
+
4. Inspect interactions, state/data/API behavior, failure paths, and regression risk.
|
|
22
|
+
5. Check component/design evidence, responsive/accessibility behavior, dependencies, and maintenance fit when applicable.
|
|
23
|
+
6. Classify findings and derive the verdict mechanically.
|
|
24
|
+
|
|
25
|
+
Skipping the required `openSpec/` search after knowledge-base failure is Important
|
|
26
|
+
when component/design compliance affects acceptance or implementation choices.
|
|
27
|
+
|
|
28
|
+
Use one issue per finding:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
- [Critical|Important|Minor] path:line — Problem; impact; required correction; evidence.
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Avoid vague advice. When no source location exists, cite the command or artifact.
|
|
35
|
+
|
|
36
|
+
## Pass Rules
|
|
37
|
+
|
|
38
|
+
- No Critical or Important findings remain.
|
|
39
|
+
- Required static and behavior nodes ran and passed.
|
|
40
|
+
- Changed files are authorized.
|
|
41
|
+
- Criteria and applicable states have implementation and evidence.
|
|
42
|
+
- Optional unavailable knowledge-base, browser, visual, or manual checks remain explicit risks.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-verification
|
|
3
|
+
description: Use to assess frontend evidence and produce closeout.
|
|
4
|
+
references:
|
|
5
|
+
- path: references/verification-checklist.md
|
|
6
|
+
required: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Frontend Verification
|
|
10
|
+
|
|
11
|
+
Use for `frontend-closeout-pi`. Shell nodes execute commands; this read-only skill
|
|
12
|
+
assesses their evidence. Read the checklist first.
|
|
13
|
+
|
|
14
|
+
Required inputs: criteria, implementation summary/change inventory, static and
|
|
15
|
+
behavior shell commands/source/status/artifacts, review verdict/findings, and any
|
|
16
|
+
required browser, visual, manual, or knowledge-base validation.
|
|
17
|
+
|
|
18
|
+
## Evidence Rules
|
|
19
|
+
|
|
20
|
+
- Static evidence covers type/lint/build/schema checks; behavior evidence covers tests or interaction checks that actually exercise the flow.
|
|
21
|
+
- Shell exit status is authoritative. Classify checks as `passed`, `failed`, `not-run`, `blocked`, or `unavailable`; only passed satisfies a required check.
|
|
22
|
+
- Never use static success as behavior proof, or tests as visual/browser proof they did not exercise.
|
|
23
|
+
- Unavailable commands remain gaps, not weaker success claims.
|
|
24
|
+
- Resolve component/design evidence as knowledge base first, then `<repoRoot>/openSpec/**` when setup/query fails or has no match. Mark `openSpec fallback` as the active project specification source; do not report it as missing merely because the connector format is TODO.
|
|
25
|
+
|
|
26
|
+
## Method And Output
|
|
27
|
+
|
|
28
|
+
Inventory required checks, map each to fresh evidence, classify gaps, confirm review
|
|
29
|
+
pass, and state only proven user-visible changes.
|
|
30
|
+
|
|
31
|
+
Return Markdown headings:
|
|
32
|
+
|
|
33
|
+
- `Changes`: changed behavior and areas.
|
|
34
|
+
- `Verification Evidence`: table of check, command/source, status, and artifact/result.
|
|
35
|
+
- `Review Result`: exact review verdict and findings.
|
|
36
|
+
- `Known Risks`: missing optional checks and environment caveats.
|
|
37
|
+
- `Follow-up`: concrete work or `None`.
|
|
38
|
+
|
|
39
|
+
Do not edit files. Do not claim complete when review is not pass or a required check
|
|
40
|
+
is failed, not-run, blocked, unavailable, stale, or contradicted.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Frontend Verification Checklist
|
|
2
|
+
|
|
3
|
+
## Static And Behavior Evidence
|
|
4
|
+
|
|
5
|
+
- Type/compile, lint/format, build, and schema/client checks ran when required.
|
|
6
|
+
- Generated output was authorized.
|
|
7
|
+
- Unit/component/integration tests cover changed logic and flows; regressions pass.
|
|
8
|
+
- Browser/e2e/manual evidence exists when explicitly required.
|
|
9
|
+
- API/mock behavior and applicable loading, empty, error, success, disabled, permission, retry, and boundary states have evidence.
|
|
10
|
+
|
|
11
|
+
## Design And Component Evidence
|
|
12
|
+
|
|
13
|
+
- Claims cite traceable knowledge-base retrieval or relevant `<repoRoot>/openSpec/**` fallback evidence.
|
|
14
|
+
- Retrieval includes connector/query, collection/document ID, version when available, and time.
|
|
15
|
+
- When connector setup/query fails or has no match, evidence shows recursive `openSpec/` search terms, inspected paths, matched headings/lines, and applied rules.
|
|
16
|
+
- Relevant `openSpec/` matches become the current-project specification and satisfy source availability; only the knowledge-base connection remains unavailable.
|
|
17
|
+
- Missing both sources blocks explicit compliance or an unresolved required design decision.
|
|
18
|
+
|
|
19
|
+
## Status
|
|
20
|
+
|
|
21
|
+
- `passed`: fresh successful evidence matches current implementation.
|
|
22
|
+
- `failed`: check ran and failed.
|
|
23
|
+
- `not-run`: no fresh attempt exists.
|
|
24
|
+
- `blocked`: a prerequisite prevented execution.
|
|
25
|
+
- `unavailable`: tool, environment, connector, or source was absent.
|
|
26
|
+
|
|
27
|
+
Only passed satisfies a required check. Other optional statuses remain disclosed risks.
|
|
28
|
+
|
|
29
|
+
## Closeout Checks
|
|
30
|
+
|
|
31
|
+
- List exact commands, source, exit status, and archived output/artifact when available.
|
|
32
|
+
- Map every criterion to evidence or a named gap.
|
|
33
|
+
- Record review verdict before completion.
|
|
34
|
+
- Do not conflate static, behavior, browser/visual/manual, or knowledge-base proof.
|
|
35
|
+
|
|
36
|
+
```markdown
|
|
37
|
+
## Changes
|
|
38
|
+
- ...
|
|
39
|
+
|
|
40
|
+
## Verification Evidence
|
|
41
|
+
| Check | Command or source | Status | Evidence |
|
|
42
|
+
|---|---|---|---|
|
|
43
|
+
| ... | ... | passed | ... |
|
|
44
|
+
|
|
45
|
+
## Review Result
|
|
46
|
+
- Verdict: `VERDICT: pass`
|
|
47
|
+
|
|
48
|
+
## Known Risks
|
|
49
|
+
- ...
|
|
50
|
+
|
|
51
|
+
## Follow-up
|
|
52
|
+
- None.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If review is not pass or a required check is not passed, describe the task as
|
|
56
|
+
incomplete and list concrete follow-up.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grill-me
|
|
3
|
+
description: Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
|
|
7
|
+
|
|
8
|
+
Ask the questions one at a time.
|
|
9
|
+
|
|
10
|
+
If a question can be answered by exploring the codebase, explore the codebase instead.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grill-with-docs
|
|
3
|
+
description: Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<what-to-do>
|
|
7
|
+
|
|
8
|
+
Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
|
|
9
|
+
|
|
10
|
+
Ask the questions one at a time, waiting for feedback on each question before continuing.
|
|
11
|
+
|
|
12
|
+
If a question can be answered by exploring the codebase, explore the codebase instead.
|
|
13
|
+
|
|
14
|
+
</what-to-do>
|
|
15
|
+
|
|
16
|
+
<supporting-info>
|
|
17
|
+
|
|
18
|
+
## Domain awareness
|
|
19
|
+
|
|
20
|
+
During codebase exploration, also look for existing documentation:
|
|
21
|
+
|
|
22
|
+
### File structure
|
|
23
|
+
|
|
24
|
+
Most repos have a single context:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
/
|
|
28
|
+
├── CONTEXT.md
|
|
29
|
+
├── docs/
|
|
30
|
+
│ └── adr/
|
|
31
|
+
│ ├── 0001-event-sourced-orders.md
|
|
32
|
+
│ └── 0002-postgres-for-write-model.md
|
|
33
|
+
└── src/
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
If a `CONTEXT-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
/
|
|
40
|
+
├── CONTEXT-MAP.md
|
|
41
|
+
├── docs/
|
|
42
|
+
│ └── adr/ ← system-wide decisions
|
|
43
|
+
├── src/
|
|
44
|
+
│ ├── ordering/
|
|
45
|
+
│ │ ├── CONTEXT.md
|
|
46
|
+
│ │ └── docs/adr/ ← context-specific decisions
|
|
47
|
+
│ └── billing/
|
|
48
|
+
│ ├── CONTEXT.md
|
|
49
|
+
│ └── docs/adr/
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Create files lazily — only when you have something to write. If no `CONTEXT.md` exists, create one when the first term is resolved. If no `docs/adr/` exists, create it when the first ADR is needed.
|
|
53
|
+
|
|
54
|
+
## During the session
|
|
55
|
+
|
|
56
|
+
### Challenge against the glossary
|
|
57
|
+
|
|
58
|
+
When the user uses a term that conflicts with the existing language in `CONTEXT.md`, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y — which is it?"
|
|
59
|
+
|
|
60
|
+
### Sharpen fuzzy language
|
|
61
|
+
|
|
62
|
+
When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account' — do you mean the Customer or the User? Those are different things."
|
|
63
|
+
|
|
64
|
+
### Discuss concrete scenarios
|
|
65
|
+
|
|
66
|
+
When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.
|
|
67
|
+
|
|
68
|
+
### Cross-reference with code
|
|
69
|
+
|
|
70
|
+
When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible — which is right?"
|
|
71
|
+
|
|
72
|
+
### Update CONTEXT.md inline
|
|
73
|
+
|
|
74
|
+
When a term is resolved, update `CONTEXT.md` right there. Don't batch these up — capture them as they happen. Use the format in [context-format.md](./context-format.md).
|
|
75
|
+
|
|
76
|
+
`CONTEXT.md` should be totally devoid of implementation details. Do not treat `CONTEXT.md` as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.
|
|
77
|
+
|
|
78
|
+
### Offer ADRs sparingly
|
|
79
|
+
|
|
80
|
+
Only offer to create an ADR when all three are true:
|
|
81
|
+
|
|
82
|
+
1. **Hard to reverse** — the cost of changing your mind later is meaningful
|
|
83
|
+
2. **Surprising without context** — a future reader will wonder "why did they do it this way?"
|
|
84
|
+
3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
|
|
85
|
+
|
|
86
|
+
If any of the three is missing, skip the ADR. Use the format in [adr-format.md](./adr-format.md).
|
|
87
|
+
|
|
88
|
+
</supporting-info>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# ADR Format
|
|
2
|
+
|
|
3
|
+
ADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.
|
|
4
|
+
|
|
5
|
+
Create the `docs/adr/` directory lazily — only when the first ADR is needed.
|
|
6
|
+
|
|
7
|
+
## Template
|
|
8
|
+
|
|
9
|
+
```md
|
|
10
|
+
# {Short title of the decision}
|
|
11
|
+
|
|
12
|
+
{1-3 sentences: what's the context, what did we decide, and why.}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
That's it. An ADR can be a single paragraph. The value is in recording *that* a decision was made and *why* — not in filling out sections.
|
|
16
|
+
|
|
17
|
+
## Optional sections
|
|
18
|
+
|
|
19
|
+
Only include these when they add genuine value. Most ADRs won't need them.
|
|
20
|
+
|
|
21
|
+
- **Status** frontmatter (`proposed | accepted | deprecated | superseded by ADR-NNNN`) — useful when decisions are revisited
|
|
22
|
+
- **Considered Options** — only when the rejected alternatives are worth remembering
|
|
23
|
+
- **Consequences** — only when non-obvious downstream effects need to be called out
|
|
24
|
+
|
|
25
|
+
## Numbering
|
|
26
|
+
|
|
27
|
+
Scan `docs/adr/` for the highest existing number and increment by one.
|
|
28
|
+
|
|
29
|
+
## When to offer an ADR
|
|
30
|
+
|
|
31
|
+
All three of these must be true:
|
|
32
|
+
|
|
33
|
+
1. **Hard to reverse** — the cost of changing your mind later is meaningful
|
|
34
|
+
2. **Surprising without context** — a future reader will look at the code and wonder "why on earth did they do it this way?"
|
|
35
|
+
3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
|
|
36
|
+
|
|
37
|
+
If a decision is easy to reverse, skip it — you'll just reverse it. If it's not surprising, nobody will wonder why. If there was no real alternative, there's nothing to record beyond "we did the obvious thing."
|
|
38
|
+
|
|
39
|
+
### What qualifies
|
|
40
|
+
|
|
41
|
+
- **Architectural shape.** "We're using a monorepo." "The write model is event-sourced, the read model is projected into Postgres."
|
|
42
|
+
- **Integration patterns between contexts.** "Ordering and Billing communicate via domain events, not synchronous HTTP."
|
|
43
|
+
- **Technology choices that carry lock-in.** Database, message bus, auth provider, deployment target. Not every library — just the ones that would take a quarter to swap out.
|
|
44
|
+
- **Boundary and scope decisions.** "Customer data is owned by the Customer context; other contexts reference it by ID only." The explicit no-s are as valuable as the yes-s.
|
|
45
|
+
- **Deliberate deviations from the obvious path.** "We're using manual SQL instead of an ORM because X." Anything where a reasonable reader would assume the opposite. These stop the next engineer from "fixing" something that was deliberate.
|
|
46
|
+
- **Constraints not visible in the code.** "We can't use AWS because of compliance requirements." "Response times must be under 200ms because of the partner API contract."
|
|
47
|
+
- **Rejected alternatives when the rejection is non-obvious.** If you considered GraphQL and picked REST for subtle reasons, record it — otherwise someone will suggest GraphQL again in six months.
|