@tea-agent/loop-agent 0.10.0 → 0.11.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.
Files changed (166) hide show
  1. package/AGENTS.md +10 -2
  2. package/CHANGELOG.md +67 -25
  3. package/README.md +82 -11
  4. package/dist/application/dag/args.js +1 -12
  5. package/dist/application/dag/generate-task-dag.js +23 -2
  6. package/dist/application/dag/run-dag.js +1 -27
  7. package/dist/application/dag/validate-dag.js +2 -2
  8. package/dist/application/loop/run-action.js +0 -4
  9. package/dist/cli/command-definitions.js +44 -16
  10. package/dist/cli/program.js +40 -23
  11. package/dist/cli/update/notifier.js +117 -0
  12. package/dist/cli/update/npm-client.js +151 -0
  13. package/dist/cli/update/policy.js +58 -0
  14. package/dist/cli/update/state.js +68 -0
  15. package/dist/cli.js +33 -0
  16. package/dist/commands/cursor-prompt.js +42 -82
  17. package/dist/commands/dag-approve.js +36 -0
  18. package/dist/commands/delegate.js +75 -77
  19. package/dist/commands/doctor.js +0 -18
  20. package/dist/commands/init.js +476 -91
  21. package/dist/commands/instructions.js +7 -10
  22. package/dist/commands/loop.js +4 -20
  23. package/dist/commands/plan.js +50 -0
  24. package/dist/executors/config-core.js +0 -51
  25. package/dist/executors/dag-pi-executor.js +1 -1
  26. package/dist/executors/dag.js +0 -1
  27. package/dist/executors/index.js +0 -2
  28. package/dist/executors/model-routing.js +9 -9
  29. package/dist/executors/shell-executor.js +1 -1
  30. package/dist/governance/checks.js +6 -3
  31. package/dist/governance/exec-plans.js +545 -0
  32. package/dist/governance/manifest-types.js +24 -2
  33. package/dist/infrastructure/harness/loop-action-store.js +0 -3
  34. package/dist/records/harvest.js +2 -23
  35. package/dist/records/one-shot-runs.js +1 -1
  36. package/dist/shared/artifacts-core.js +24 -5
  37. package/dist/shared/output-truncation.js +37 -0
  38. package/dist/shared/package-metadata.js +353 -0
  39. package/dist/{executors/cursor-executor.js → sidecars/cursor-prompt/executor.js} +2 -42
  40. package/dist/sidecars/cursor-prompt/index.js +3 -0
  41. package/dist/sidecars/cursor-prompt/stream.js +121 -0
  42. package/dist/task/config-types.js +28 -12
  43. package/dist/task/delegate.js +9 -21
  44. package/dist/task/runtime.js +1 -2
  45. package/dist/worker/cli.js +29 -2
  46. package/dist/worker/delivery/final-verification.js +47 -11
  47. package/dist/worker/delivery/package.js +63 -10
  48. package/dist/worker/feature/run.js +60 -8
  49. package/dist/worker/loop-agent/loop-agent-client.js +329 -126
  50. package/dist/worker/observability/read-model.js +27 -1
  51. package/dist/worker/observe/static/app.js +326 -45
  52. package/dist/worker/observe/static/index.html +1 -1
  53. package/dist/worker/observe/static/styles.css +5 -4
  54. package/dist/worker/preflight.js +49 -1
  55. package/dist/worker/run-task/run-task.js +22 -12
  56. package/dist/worker/runner/run-ready.js +76 -12
  57. package/dist/worker/task-spec/schema.js +0 -1
  58. package/dist/workflows/dag/convergence/controller.js +1 -1
  59. package/dist/workflows/dag/executor-registry.js +0 -2
  60. package/dist/workflows/dag/init-hybrid.js +402 -25
  61. package/dist/workflows/dag/node-execution.js +61 -7
  62. package/dist/workflows/dag/runner.js +45 -17
  63. package/dist/workflows/dag/scheduler.js +7 -2
  64. package/dist/workflows/dag/sdd-embedded.js +128 -0
  65. package/dist/workflows/dag/skill-instructions.js +5 -4
  66. package/dist/workflows/dag/skill-snapshot.js +527 -0
  67. package/dist/workflows/dag/types.js +42 -9
  68. package/dist/workflows/dag/validate.js +5 -8
  69. package/dist/workflows/loop/actions/dag-action.js +0 -2
  70. package/dist/workflows/loop/actions/shared.js +1 -1
  71. package/dist/workflows/loop/actions.js +14 -31
  72. package/dist/workflows/loop/benchmark.js +1 -1
  73. package/dist/workflows/loop/index.js +1 -1
  74. package/dist/workflows/loop/policy/auto-policy.js +22 -14
  75. package/dist/workflows/loop/policy/path-patterns.js +13 -0
  76. package/docs/README.md +36 -33
  77. package/docs/agent-dag-recovery-playbook.md +1 -1
  78. package/docs/agent-dag-runner.md +2 -2
  79. package/docs/architecture/README.md +26 -0
  80. package/docs/architecture/dag-execution.md +134 -0
  81. package/docs/architecture/evolution.md +52 -0
  82. package/docs/architecture/facts-and-state.md +58 -0
  83. package/docs/architecture/runtime-boundaries.md +45 -17
  84. package/docs/architecture/system-overview.md +93 -0
  85. package/docs/architecture/worker-and-feature.md +81 -0
  86. package/docs/cursor-prompt-sidecar.md +36 -0
  87. package/docs/decisions/README.md +13 -1
  88. package/docs/design/README.md +42 -21
  89. package/docs/development-principles.md +2 -2
  90. package/docs/exec-plans/active/README.md +2 -2
  91. package/docs/exec-plans/completed/README.md +12 -0
  92. package/docs/feature-workflow.md +50 -4
  93. package/docs/harness-methodology-debugging.md +1 -1
  94. package/docs/harness-methodology-tdd.md +3 -3
  95. package/docs/init-surface.manifest.json +60 -25
  96. package/docs/loop-agent-harness.md +28 -4
  97. package/docs/progress/README.md +32 -1
  98. package/docs/reports/README.md +84 -18
  99. package/docs/skills/README.md +2 -1
  100. package/docs/skills/vetted-skill-registry.md +2 -1
  101. package/docs/templates/agent-dag-report.schema.json +6 -6
  102. package/docs/templates/agent-dag.base.json +0 -5
  103. package/docs/templates/agent-dag.final-verification.json +0 -5
  104. package/docs/templates/agent-dag.schema.json +1 -2
  105. package/docs/templates/agent-dag.supervised-implementation.json +1 -6
  106. package/docs/templates/frontend-design-contract.md +33 -0
  107. package/docs/templates/frontend-task-constraints.md +25 -0
  108. package/docs/templates/frontend-task-requirement.md +61 -0
  109. package/docs/templates/harness.schema.json +10 -12
  110. package/docs/templates/hybrid-dag.json +1 -6
  111. package/docs/templates/interactive-ui-round2-experiment.md +1 -1
  112. package/docs/templates/product-line/task.yaml +0 -1
  113. package/docs/templates/project-start-checklist.md +2 -2
  114. package/docs/templates/worker-dogfood-evidence.md +28 -0
  115. package/docs/templates/worker-dogfood-setup.md +20 -0
  116. package/docs/verification-matrix.md +10 -0
  117. package/examples/decision-gate-agent-dag.json +87 -33
  118. package/examples/example-dag.json +0 -5
  119. package/examples/hybrid-loop-agent-dag.json +0 -5
  120. package/harness.json +7 -15
  121. package/package.json +22 -46
  122. package/scripts/check-product-line-docs.sh +10 -7
  123. package/skills/agent-worker/SKILL.md +37 -0
  124. package/skills/agent-worker/references/agent-worker-operator.md +43 -0
  125. package/skills/frontend-design-review/SKILL.md +59 -0
  126. package/skills/frontend-design-review/references/review-checklist.md +37 -0
  127. package/skills/frontend-implementation/SKILL.md +51 -0
  128. package/skills/frontend-implementation/references/code-standards.md +34 -0
  129. package/skills/frontend-implementation/references/design-spec.md +46 -0
  130. package/skills/frontend-implementation/references/node-contracts.md +32 -0
  131. package/skills/frontend-review/SKILL.md +53 -0
  132. package/skills/frontend-review/references/review-findings.md +42 -0
  133. package/skills/frontend-verification/SKILL.md +40 -0
  134. package/skills/frontend-verification/references/verification-checklist.md +56 -0
  135. package/skills/grill-me/SKILL.md +10 -0
  136. package/skills/grill-with-docs/SKILL.md +88 -0
  137. package/skills/grill-with-docs/adr-format.md +47 -0
  138. package/skills/grill-with-docs/context-format.md +60 -0
  139. package/skills/loop-agent/SKILL.md +11 -9
  140. package/skills/loop-agent/references/command-reference.md +13 -15
  141. package/skills/loop-agent/references/docs-converge.md +126 -0
  142. package/skills/loop-agent/references/harness-policy.md +7 -7
  143. package/skills/loop-agent/references/hybrid-dag.md +15 -18
  144. package/skills/loop-agent/references/long-running-loop.md +4 -6
  145. package/skills/loop-agent/references/multi-worktree.md +6 -6
  146. package/skills/loop-agent/references/orchestrator-and-interventions.md +3 -3
  147. package/skills/loop-agent/references/pi-subagent-assisted-mode.md +14 -11
  148. package/skills/loop-agent/references/task-workflow.md +1 -1
  149. package/skills/using-git-worktrees/SKILL.md +215 -0
  150. package/dist/commands/cursor-worker.js +0 -43
  151. package/dist/cursor-worker-entry.js +0 -8
  152. package/dist/executors/cursor-artifacts.js +0 -33
  153. package/dist/executors/cursor-execution-log.js +0 -81
  154. package/dist/executors/cursor-executor-artifacts.js +0 -134
  155. package/dist/executors/cursor-run.js +0 -115
  156. package/dist/executors/cursor-tool.js +0 -94
  157. package/dist/executors/cursor-worker-client.js +0 -223
  158. package/dist/executors/cursor-worker-protocol.js +0 -18
  159. package/dist/executors/cursor-worker-server.js +0 -54
  160. package/dist/executors/cursor-worker.js +0 -3
  161. package/dist/executors/cursor.js +0 -6
  162. package/dist/executors/dag-cursor-executor.js +0 -87
  163. package/dist/workflows/loop/actions/cursor-fix.js +0 -191
  164. package/dist/workflows/loop/policy/cursor-fix-policy.js +0 -31
  165. package/docs/cursor-executor-usage.md +0 -25
  166. package/docs/dynamic-workflow-dag-engine-roadmap.md +0 -1749
@@ -5,13 +5,16 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5
5
  cd "${ROOT_DIR}"
6
6
 
7
7
  feature_dirs=()
8
- while IFS= read -r feature_dir; do
9
- if [[ ! -f "${feature_dir}/acceptance.yaml" ]]; then
10
- echo "product-line docs check failed: incomplete feature packet missing acceptance.yaml: ${feature_dir}" >&2
11
- exit 1
12
- fi
13
- feature_dirs+=("${feature_dir}")
14
- done < <(find dogfood/features -mindepth 1 -maxdepth 1 -type d | sort)
8
+ for root in features product/features dogfood/features; do
9
+ [[ -d "${root}" ]] || continue
10
+ while IFS= read -r feature_dir; do
11
+ if [[ ! -f "${feature_dir}/acceptance.yaml" ]]; then
12
+ echo "product-line docs check failed: incomplete feature packet missing acceptance.yaml: ${feature_dir}" >&2
13
+ exit 1
14
+ fi
15
+ feature_dirs+=("${feature_dir}")
16
+ done < <(find "${root}" -mindepth 1 -maxdepth 1 -type d | sort)
17
+ done
15
18
 
16
19
  if [[ ${#feature_dirs[@]} -eq 0 ]]; then
17
20
  echo "product-line docs check skipped: no feature packets found"
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: agent-worker
3
+ description: Use when work involves agent-worker, Feature Packet, TaskSpec, Task Pool, Feature or batch orchestration, controller pinning, versioned self-hosting (自举) release trains, candidate takeover canaries (候选接棒验证), or worker failure recovery; use loop-agent instead for a single DAG implementation or DAG runtime/kernel repair.
4
+ references:
5
+ - path: references/agent-worker-operator.md
6
+ required: true
7
+ ---
8
+
9
+ # Agent Worker Operator
10
+
11
+ 当工作起点是 Feature Packet、TaskSpec、Task Pool、Worker batch 或 versioned self-hosting release train 时使用本 skill。它负责在单次 loop-agent DAG run 之外选择并监督工作。
12
+
13
+ ## Route the Work
14
+
15
+ - 用 `agent-worker` 做 Feature validation 与 lifecycle 决策、Ready-task 选择、batch 推进、controller identity freeze、candidate takeover canary,以及失败 Worker run 的恢复。
16
+ - 对单个有界 DAG task、DAG diagnostics、node implementation,或 DAG runtime/kernel 修复,直接用 `loop-agent`。
17
+ - 不要让 DAG leaf node 递归启动 `agent-worker`;Worker 是 outer loop,不是另一个 node executor。
18
+
19
+ ## Boundaries
20
+
21
+ - `agent-worker` 读取 Feature Packet 与 Task Pool facts,选择任务,冻结 controller identity,启动 Feature/batch lifecycle 命令,并收集 evidence。
22
+ - `loop-agent` 仍是 DAG executor,负责 Pi-only implementation nodes、write-set governance、skill snapshots 与 run facts。
23
+ - Controller identity 冻结驱动 batch 的 published package;loop-agent skill snapshot 则单独冻结注入单次 DAG run 的 instructions。
24
+ - 本 skill 不复制 command catalog。精确 flags 见 CLI help 与同级 `../loop-agent/references/command-reference.md`。
25
+ - 不要把本 skill 加入默认 DAG role skills;仅对 outer-loop operator 工作显式路由。
26
+
27
+ ## Operator Flow
28
+
29
+ 1. 校验 Feature Packet 与 TaskSpecs,再从 Task Pool facts 选择 Ready 工作,而不是从 chat state。
30
+ 2. 在写入前解析并冻结目标 published controller;在 batch、task 与 run evidence 中保留 controller identity。
31
+ 3. 将仓库写入委托给受治理的 loop-agent DAG nodes,并审查其 task boundaries 与 write sets。
32
+ 4. 自举时保持 published version N 固定,由它维护 candidate N+1,再通过 deterministic isolated canary 证明 candidate takeover。
33
+ 5. 失败时先保留原始 run record、evidence 与 failure handoff,再重试或创建后续工作。
34
+
35
+ ## References
36
+
37
+ - `references/agent-worker-operator.md`
@@ -0,0 +1,43 @@
1
+ # Agent Worker Operator Reference
2
+
3
+ `agent-worker` 是 Feature Packet、TaskSpec、Task Pool 与 self-hosting release-train 操作的 outer-loop adapter。它不是 DAG executor。
4
+
5
+ ## Routing Boundary
6
+
7
+ 当工作单元是 Feature lifecycle、一组 TaskSpecs、Ready queue、Worker batch 或 candidate takeover 时,选 `agent-worker`。当工作单元是单次受治理 DAG run、node implementation、DAG diagnosis 或 DAG runtime repair 时,选 `loop-agent`。
8
+
9
+ Leaf DAG nodes 不得递归启动 `agent-worker`。Worker 负责 DAG 之外的 selection 与 lifecycle state;loop-agent 负责 DAG 内的 execution facts。
10
+
11
+ ## Responsibilities
12
+
13
+ - 在选工前校验 Feature Packet 与 TaskSpec 关系。
14
+ - 从 Task Pool facts 选择 Ready 工作,定义 batch scope,并选择 recovery actions。
15
+ - 在可写执行前解析并冻结 controller launch identity。
16
+ - 用 pinned controller identity 启动 loop-agent 命令。
17
+ - 收集 canonical run records、reports、closeout drafts 与 failure handoff evidence。
18
+
19
+ ## Feature and Task Pool Flow
20
+
21
+ 1. 阅读 Feature Packet,校验其 TaskSpecs 与 dependency graph。
22
+ 2. 从持久化的 Task Pool state 推导下一步动作;不要从 chat history 重建 lifecycle state。
23
+ 3. 对可写 batch 只冻结一次 controller,并将其 identity 传播到下游 evidence。
24
+ 4. 将每个选中的 TaskSpec 委托给 loop-agent,使用其结构化的 allowed / forbidden paths。
25
+ 5. 根据 canonical run facts 刷新 Feature review、reports 与 Task Pool state。
26
+
27
+ ## Versioned Self-Hosting
28
+
29
+ - Published version N 是整个 maintenance batch 的 controller;不要在任务中途切换。
30
+ - Candidate N+1 在 takeover verification 前先构建并安装到 isolated slot。
31
+ - Candidate 命令使用绝对 package entry identities,绝不使用新解析的 global PATH 命令。
32
+ - Controller identity 与 DAG skill snapshot 应对不同漂移风险:前者钉住 runtime/package content,后者钉住单次 run 的 resolved instructions。
33
+ - 失败的 canary 或 Worker run 仍是不可变 evidence。将 retries 与后续工作链接到它,而不是覆盖失败记录。
34
+
35
+ ## Non Responsibilities
36
+
37
+ - 不要在此实现 node scheduling、write-set enforcement 或 model prompts。
38
+ - 不要在本 skill 中维护一份独立的精确 CLI flags 列表;以 CLI help 与 `../../loop-agent/references/command-reference.md` 为准。
39
+ - 不要把本 skill 路由为 DAG nodes 的默认 role skill。
40
+
41
+ ## Candidate Canary Boundary
42
+
43
+ Deterministic candidate canary 将 candidate package 安装到 isolated temporary slot,通过该 slot 内的绝对 Node script paths 调用 package bins,避免 model calls,并输出 machine-readable evidence,覆盖 package-root containment、entry hashes、checks 与 verdict。
@@ -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.