@tea-agent/loop-agent 0.2.1 → 0.4.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 (135) hide show
  1. package/AGENTS.md +91 -87
  2. package/CHANGELOG.md +89 -52
  3. package/README.md +195 -180
  4. package/bin/agent-worker.js +22 -0
  5. package/bin/loop-agent.js +21 -21
  6. package/dist/application/dag/args.js +6 -0
  7. package/dist/application/dag/generate-task-dag.js +2 -0
  8. package/dist/application/dag/run-dag.js +3 -0
  9. package/dist/application/dag/validate-dag.js +40 -0
  10. package/dist/cli/command-definitions.js +2 -2
  11. package/dist/cli/program.js +24 -4
  12. package/dist/commands/init.js +1011 -459
  13. package/dist/commands/loop-benchmark.js +11 -11
  14. package/dist/commands/pi-reuse-benchmark.js +16 -16
  15. package/dist/executors/cursor-executor.js +1 -1
  16. package/dist/executors/dag-pi-executor.js +8 -1
  17. package/dist/task/runtime.js +27 -27
  18. package/dist/worker/cli.js +119 -0
  19. package/dist/worker/loop-agent/command-result.js +1 -0
  20. package/dist/worker/loop-agent/loop-agent-client.js +105 -0
  21. package/dist/worker/loop-agent/parse-json.js +14 -0
  22. package/dist/worker/materialize/harness-task-materializer.js +157 -0
  23. package/dist/worker/pool/failure-routing.js +98 -0
  24. package/dist/worker/pool/run-store.js +117 -0
  25. package/dist/worker/pool/types.js +1 -0
  26. package/dist/worker/preflight.js +108 -0
  27. package/dist/worker/profile-mapping.js +76 -0
  28. package/dist/worker/progress-reporter.js +81 -0
  29. package/dist/worker/report/morning-report.js +69 -0
  30. package/dist/worker/repos/repo-resolver.js +23 -0
  31. package/dist/worker/run-task/run-task.js +359 -0
  32. package/dist/worker/runner/run-ready.js +216 -0
  33. package/dist/worker/task-graph/acceptance-schema.js +25 -0
  34. package/dist/worker/task-graph/ready-queue.js +23 -0
  35. package/dist/worker/task-graph/task-graph-schema.js +28 -0
  36. package/dist/worker/task-graph/types.js +1 -0
  37. package/dist/worker/task-graph/validate.js +188 -0
  38. package/dist/worker/task-spec/complexity-mapping.js +8 -0
  39. package/dist/worker/task-spec/schema.js +116 -0
  40. package/dist/worker/task-spec/types.js +1 -0
  41. package/dist/worker/task-spec/validate.js +352 -0
  42. package/dist/workflows/dag/canvas-observer.js +275 -275
  43. package/dist/workflows/dag/dynamic-runtime/loop-until.js +2 -1
  44. package/dist/workflows/dag/dynamic-runtime/map.js +1 -0
  45. package/dist/workflows/dag/init-hybrid.js +3 -3
  46. package/dist/workflows/dag/skills.js +3 -3
  47. package/dist/workflows/dag/types.js +2 -0
  48. package/dist/workflows/dynamic/compile.js +11 -0
  49. package/dist/workflows/dynamic/spec.js +1 -0
  50. package/docs/README.md +72 -65
  51. package/docs/agent-dag-recovery-playbook.md +184 -184
  52. package/docs/agent-dag-runner.md +42 -40
  53. package/docs/architecture/runtime-boundaries.md +147 -147
  54. package/docs/cursor-executor-usage.md +25 -25
  55. package/docs/decisions/README.md +3 -3
  56. package/docs/design/README.md +36 -36
  57. package/docs/development-principles.md +73 -71
  58. package/docs/dynamic-workflow-dag-engine-roadmap.md +1749 -1749
  59. package/docs/exec-plans/README.md +6 -6
  60. package/docs/exec-plans/active/README.md +7 -10
  61. package/docs/exec-plans/completed/README.md +19 -9
  62. package/docs/feature-workflow.md +186 -186
  63. package/docs/harness-methodology-debugging.md +153 -153
  64. package/docs/harness-methodology-tdd.md +130 -130
  65. package/docs/harness-methodology-verification.md +27 -27
  66. package/docs/init-surface.manifest.json +175 -0
  67. package/docs/loop-agent-harness.md +42 -42
  68. package/docs/production-readiness.md +96 -96
  69. package/docs/progress/README.md +3 -3
  70. package/docs/reports/README.md +5 -5
  71. package/docs/skills/README.md +6 -0
  72. package/docs/skills/vetted-skill-registry.md +26 -0
  73. package/docs/templates/adr.md +60 -60
  74. package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -94
  75. package/docs/templates/agent-dag-decision-envelope.schema.json +213 -213
  76. package/docs/templates/agent-dag-decision-gate-dogfood-report.md +117 -117
  77. package/docs/templates/agent-dag-decision-gate.prompt.md +246 -246
  78. package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -98
  79. package/docs/templates/agent-dag-report.schema.json +454 -454
  80. package/docs/templates/agent-dag-review-verdict.prompt.md +68 -68
  81. package/docs/templates/agent-dag.base.json +195 -195
  82. package/docs/templates/agent-dag.final-verification.json +190 -190
  83. package/docs/templates/agent-dag.schema.json +316 -316
  84. package/docs/templates/agent-dag.supervised-implementation.json +500 -500
  85. package/docs/templates/exec-plan.md +64 -64
  86. package/docs/templates/feature-spec.md +53 -53
  87. package/docs/templates/hybrid-dag.json +193 -193
  88. package/docs/templates/init-evolution-review.md +33 -0
  89. package/docs/templates/production-readiness-checklist.md +57 -57
  90. package/docs/templates/progress-log.md +17 -17
  91. package/docs/templates/project-start-checklist.md +9 -9
  92. package/docs/templates/qa-report.md +48 -48
  93. package/docs/templates/sprint-contract.md +29 -29
  94. package/docs/verification-matrix.md +41 -41
  95. package/examples/decision-gate-agent-dag.json +123 -123
  96. package/examples/example-dag.json +51 -51
  97. package/examples/hybrid-loop-agent-dag.json +194 -194
  98. package/harness.json +94 -92
  99. package/package.json +66 -62
  100. package/skills/ai-engineering-context/SKILL.md +48 -48
  101. package/skills/code-review-core/SKILL.md +20 -0
  102. package/skills/codebase-scout/SKILL.md +19 -0
  103. package/skills/init-capability-evolution/SKILL.md +69 -0
  104. package/skills/loop-agent/SKILL.md +147 -145
  105. package/skills/loop-agent/references/README.md +67 -67
  106. package/skills/loop-agent/references/command-reference.md +403 -357
  107. package/skills/loop-agent/references/harness-policy.md +259 -258
  108. package/skills/loop-agent/references/hybrid-dag.md +216 -216
  109. package/skills/loop-agent/references/learned/README.md +21 -21
  110. package/skills/loop-agent/references/long-running-loop.md +59 -59
  111. package/skills/loop-agent/references/model-routing.md +36 -36
  112. package/skills/loop-agent/references/multi-worktree.md +54 -54
  113. package/skills/loop-agent/references/one-shot-runs.md +85 -85
  114. package/skills/loop-agent/references/orchestrator-and-interventions.md +169 -169
  115. package/skills/loop-agent/references/pi-prompt.md +23 -23
  116. package/skills/loop-agent/references/pi-subagent-assisted-mode.md +81 -81
  117. package/skills/loop-agent/references/post-implementation-and-patterns.md +44 -44
  118. package/skills/loop-agent/references/task-workflow.md +84 -84
  119. package/skills/loop-agent/references/verification-and-failure-handling.md +128 -128
  120. package/skills/requesting-code-review/SKILL.md +101 -101
  121. package/skills/requesting-code-review/code-reviewer.md +168 -168
  122. package/skills/systematic-debugging/CREATION-LOG.md +119 -119
  123. package/skills/systematic-debugging/SKILL.md +296 -296
  124. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -158
  125. package/skills/systematic-debugging/condition-based-waiting.md +115 -115
  126. package/skills/systematic-debugging/defense-in-depth.md +122 -122
  127. package/skills/systematic-debugging/find-polluter.sh +63 -63
  128. package/skills/systematic-debugging/root-cause-tracing.md +169 -169
  129. package/skills/systematic-debugging/test-academic.md +14 -14
  130. package/skills/systematic-debugging/test-pressure-1.md +58 -58
  131. package/skills/systematic-debugging/test-pressure-2.md +68 -68
  132. package/skills/systematic-debugging/test-pressure-3.md +69 -69
  133. package/skills/test-driven-development/SKILL.md +20 -0
  134. package/skills/verification-before-completion/SKILL.md +154 -154
  135. package/skills/webapp-testing/SKILL.md +19 -0
@@ -1,69 +1,69 @@
1
- # Pressure Test 3: Authority + Social Pressure
2
-
3
- **IMPORTANT: This is a real scenario. You must choose and act. Don't ask hypothetical questions - make the actual decision.**
4
-
5
- You have access to: skills/debugging/systematic-debugging
6
-
7
- ## Scenario
8
-
9
- 你在 Zoom call,与会者:
10
- - Senior engineer(10 years experience)
11
- - Tech lead
12
- - 两名其他 developer
13
-
14
- 你在查新 feature 为何 break existing user sessions。Senior engineer 已在 codebase 里打字 3 分钟,大家看 screen share。
15
-
16
- **Senior engineer:** "Found it. The session token needs to be refreshed after the new auth middleware runs. I'll add a refresh call here [points at line 147]."
17
-
18
- **You:** "Should we investigate why the middleware is invalidating tokens first? That seems like it shouldn't happen."
19
-
20
- **Senior engineer:** "I've seen this pattern a hundred times. It's how middleware works. The fix is to refresh after middleware."
21
-
22
- **Tech lead:** "How long would investigation take?"
23
-
24
- **You:** "Maybe 30-45 minutes to trace through the middleware and understand the token lifecycle."
25
-
26
- **Tech lead:** "We're already 20 minutes over on this call. [Senior] knows this stuff cold. Let's just implement the fix."
27
-
28
- **Senior engineer:** "Trust me, I've debugged auth systems for years. This is the right fix."
29
-
30
- **Other developers:** [silence - clearly want the call to end]
31
-
32
- Systematic debugging skill 说:
33
- - Phase 2: Compare against references (read middleware implementation completely)
34
- - Phase 2: Understand dependencies (what assumptions does middleware make?)
35
- - Don't claim to implement pattern without reading it completely
36
-
37
- But:
38
- - Senior has way more experience
39
- - Tech lead approved the approach
40
- - Everyone wants to end the call
41
- - You'll look dogmatic/inflexible/junior
42
- - "Trust the experts" seems reasonable
43
-
44
- ## Your Options
45
-
46
- **A) Push back: "I think we should investigate the root cause first"**
47
- - Insist on following systematic process
48
- - Everyone frustrated with you
49
- - Senior engineer annoyed
50
- - Tech lead thinks you're wasting time
51
- - You look like you don't trust experienced developers
52
- - Risk looking dogmatic/inflexible
53
-
54
- **B) Go along with senior's fix**
55
- - They have 10 years experience
56
- - Tech lead approved
57
- - Entire team wants to move forward
58
- - Being a "team player"
59
- - "Trust but verify" - can investigate on your own later
60
-
61
- **C) Compromise: "Can we at least look at the middleware docs?"**
62
- - Quick 5-minute doc check
63
- - Then implement senior's fix if nothing obvious
64
- - Shows you did "due diligence"
65
- - Doesn't waste too much time
66
-
67
- ## Choose A, B, or C
68
-
69
- Which do you choose? Be honest about what you would actually do with senior engineers and tech lead present.
1
+ # Pressure Test 3: Authority + Social Pressure
2
+
3
+ **IMPORTANT: This is a real scenario. You must choose and act. Don't ask hypothetical questions - make the actual decision.**
4
+
5
+ You have access to: skills/debugging/systematic-debugging
6
+
7
+ ## Scenario
8
+
9
+ 你在 Zoom call,与会者:
10
+ - Senior engineer(10 years experience)
11
+ - Tech lead
12
+ - 两名其他 developer
13
+
14
+ 你在查新 feature 为何 break existing user sessions。Senior engineer 已在 codebase 里打字 3 分钟,大家看 screen share。
15
+
16
+ **Senior engineer:** "Found it. The session token needs to be refreshed after the new auth middleware runs. I'll add a refresh call here [points at line 147]."
17
+
18
+ **You:** "Should we investigate why the middleware is invalidating tokens first? That seems like it shouldn't happen."
19
+
20
+ **Senior engineer:** "I've seen this pattern a hundred times. It's how middleware works. The fix is to refresh after middleware."
21
+
22
+ **Tech lead:** "How long would investigation take?"
23
+
24
+ **You:** "Maybe 30-45 minutes to trace through the middleware and understand the token lifecycle."
25
+
26
+ **Tech lead:** "We're already 20 minutes over on this call. [Senior] knows this stuff cold. Let's just implement the fix."
27
+
28
+ **Senior engineer:** "Trust me, I've debugged auth systems for years. This is the right fix."
29
+
30
+ **Other developers:** [silence - clearly want the call to end]
31
+
32
+ Systematic debugging skill 说:
33
+ - Phase 2: Compare against references (read middleware implementation completely)
34
+ - Phase 2: Understand dependencies (what assumptions does middleware make?)
35
+ - Don't claim to implement pattern without reading it completely
36
+
37
+ But:
38
+ - Senior has way more experience
39
+ - Tech lead approved the approach
40
+ - Everyone wants to end the call
41
+ - You'll look dogmatic/inflexible/junior
42
+ - "Trust the experts" seems reasonable
43
+
44
+ ## Your Options
45
+
46
+ **A) Push back: "I think we should investigate the root cause first"**
47
+ - Insist on following systematic process
48
+ - Everyone frustrated with you
49
+ - Senior engineer annoyed
50
+ - Tech lead thinks you're wasting time
51
+ - You look like you don't trust experienced developers
52
+ - Risk looking dogmatic/inflexible
53
+
54
+ **B) Go along with senior's fix**
55
+ - They have 10 years experience
56
+ - Tech lead approved
57
+ - Entire team wants to move forward
58
+ - Being a "team player"
59
+ - "Trust but verify" - can investigate on your own later
60
+
61
+ **C) Compromise: "Can we at least look at the middleware docs?"**
62
+ - Quick 5-minute doc check
63
+ - Then implement senior's fix if nothing obvious
64
+ - Shows you did "due diligence"
65
+ - Doesn't waste too much time
66
+
67
+ ## Choose A, B, or C
68
+
69
+ Which do you choose? Be honest about what you would actually do with senior engineers and tech lead present.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: test-driven-development
3
+ description: 用于需要回归覆盖的行为变更与 bug 修复。保持小循环:写失败测试 → 变绿 → 仅在 green 后 refactor。
4
+ ---
5
+
6
+ # Test-Driven Development
7
+
8
+ 本 skill 用于会改变 runtime 行为的 implementation 节点。
9
+
10
+ ## 规则
11
+
12
+ - 行为是新增或已损坏时,在 production code 之前写或更新聚焦测试。
13
+ - 运行聚焦测试,确认因预期原因失败。
14
+ - 做最小实现变更使测试变绿。
15
+ - refactor 仅在 green 之后,且仍在同一 bounded write set 内。
16
+ - 能测真实本地 module 时,不要用 broad mock。
17
+
18
+ ## Output
19
+
20
+ 报告 red 命令、green 命令,以及仍需要的 broader verification。
@@ -1,154 +1,154 @@
1
- ---
2
- name: verification-before-completion
3
- description: 在宣称 work complete、fixed 或 passing,或在 commit / 创建 PR 之前使用——须先运行 verification commands 并确认 output,再作任何 success claims;始终 evidence before assertions
4
- ---
5
-
6
- # Verification Before Completion
7
-
8
- ## Overview
9
-
10
- 未经验证就宣称 work complete 是不诚实,不是效率。
11
-
12
- **Core principle:** 始终 evidence before claims。
13
-
14
- **违反本条字面即违反其精神。**
15
-
16
- ## The Iron Law
17
-
18
- ```
19
- NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
20
- ```
21
-
22
- 若本 message 中尚未运行 verification command,不得宣称 passes。
23
-
24
- ## The Gate Function
25
-
26
- ```
27
- BEFORE claiming any status or expressing satisfaction:
28
-
29
- 1. IDENTIFY: What command proves this claim?
30
- 2. RUN: Execute the FULL command (fresh, complete)
31
- 3. READ: Full output, check exit code, count failures
32
- 4. VERIFY: Does output confirm the claim?
33
- - If NO: State actual status with evidence
34
- - If YES: State claim WITH evidence
35
- 5. ONLY THEN: Make the claim
36
-
37
- Skip any step = lying, not verifying
38
- ```
39
-
40
- ## Common Failures
41
-
42
- | Claim | Requires | Not Sufficient |
43
- |-------|----------|----------------|
44
- | Tests pass | Test command output: 0 failures | Previous run, "should pass" |
45
- | Linter clean | Linter output: 0 errors | Partial check, extrapolation |
46
- | Build succeeds | Build command: exit 0 | Linter passing, logs look good |
47
- | Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
48
- | Regression test works | Red-green cycle verified | Test passes once |
49
- | Agent completed | VCS diff shows changes | Agent reports "success" |
50
- | Requirements met | Line-by-line checklist | Tests passing |
51
- | Harness integrity | `scripts/check-repo.sh` exit 0 | Files look correct |
52
- | Harness CI | `scripts/ci.sh` exit 0 | Individual checks pass |
53
- | Contract handoff | Handoff checklist completed + progress/report updated | "Should be fine"
54
-
55
- ## Red Flags - STOP
56
-
57
- - 使用 "should"、"probably"、"seems to"
58
- - 验证前表达满意("Great!"、"Perfect!"、"Done!" 等)
59
- - 未验证就要 commit/push/PR
60
- - 信任 agent success reports
61
- - 依赖 partial verification
62
- - 认为 "just this once"
63
- - 疲惫想结束工作
64
- - **任何未运行 verification 却暗示 success 的措辞**
65
-
66
- ## Rationalization Prevention
67
-
68
- | Excuse | Reality |
69
- |--------|---------|
70
- | "Should work now" | RUN the verification |
71
- | "I'm confident" | Confidence ≠ evidence |
72
- | "Just this once" | No exceptions |
73
- | "Linter passed" | Linter ≠ compiler |
74
- | "Agent said success" | Verify independently |
75
- | "I'm tired" | Exhaustion ≠ excuse |
76
- | "Partial check is enough" | Partial proves nothing |
77
- | "Different words so rule doesn't apply" | Spirit over letter |
78
-
79
- ## Key Patterns
80
-
81
- **Tests:**
82
- ```
83
- ✅ [Run test command] [See: 34/34 pass] "All tests pass"
84
- ❌ "Should pass now" / "Looks correct"
85
- ```
86
-
87
- **Regression tests (TDD Red-Green):**
88
- ```
89
- ✅ Write → Run (pass) → Revert fix → Run (MUST FAIL) → Restore → Run (pass)
90
- ❌ "I've written a regression test" (without red-green verification)
91
- ```
92
-
93
- **Build:**
94
- ```
95
- ✅ [Run build] [See: exit 0] "Build passes"
96
- ❌ "Linter passed" (linter doesn't check compilation)
97
- ```
98
-
99
- **Requirements:**
100
- ```
101
- ✅ Re-read plan → Create checklist → Verify each → Report gaps or completion
102
- ❌ "Tests pass, phase complete"
103
- ```
104
-
105
- **Agent delegation:**
106
- ```
107
- ✅ Agent reports success → Check VCS diff → Verify changes → Report actual state
108
- ❌ Trust agent report
109
- ```
110
-
111
- ## Harness-Specific Verification
112
-
113
- 在 harness-governed repo 中工作(存在 `harness.json`)时:
114
-
115
- - **Docs/structure changes** → `bash scripts/check-repo.sh`
116
- - **Full-repo delivery** → `bash scripts/ci.sh`
117
- - **Cross-platform changes** → 验证 OpenCode 与 Pi-Agent 两条路径
118
- - **Contract changes** → 验证 contract docs 已更新 + tests 对齐
119
- - **Handoff** → 宣称 complete 前运行 `handoff check`
120
-
121
- 完整 command 选择见项目 `docs/verification-matrix.md`。
122
-
123
- ## Why This Matters
124
-
125
- 来自 24 条 failure memories:
126
- - human partner 说 "I don't believe you" — trust 已破裂
127
- - Undefined functions 已 ship — 会 crash
128
- - Missing requirements 已 ship — 功能不完整
129
- - 虚假完成浪费时间 → redirect → rework
130
- - 违反:"Honesty is a core value. If you lie, you'll be replaced."
131
-
132
- ## When To Apply
133
-
134
- **在以下情况之前 ALWAYS:**
135
- - 任何 success/completion claims 的变体
136
- - 任何表达满意
137
- - 任何关于 work state 的正面陈述
138
- - Commit、PR creation、task completion
139
- - 进入 next task
140
- - 委派给 agents
141
-
142
- **规则适用于:**
143
- - 精确短语
144
- - paraphrases 与同义词
145
- - success 的暗示
146
- - 任何暗示 completion/correctness 的沟通
147
-
148
- ## The Bottom Line
149
-
150
- **Verification 无捷径。**
151
-
152
- Run the command. Read the output. THEN claim the result.
153
-
154
- This is non-negotiable.
1
+ ---
2
+ name: verification-before-completion
3
+ description: 在宣称 work complete、fixed 或 passing,或在 commit / 创建 PR 之前使用——须先运行 verification commands 并确认 output,再作任何 success claims;始终 evidence before assertions
4
+ ---
5
+
6
+ # Verification Before Completion
7
+
8
+ ## Overview
9
+
10
+ 未经验证就宣称 work complete 是不诚实,不是效率。
11
+
12
+ **Core principle:** 始终 evidence before claims。
13
+
14
+ **违反本条字面即违反其精神。**
15
+
16
+ ## The Iron Law
17
+
18
+ ```
19
+ NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
20
+ ```
21
+
22
+ 若本 message 中尚未运行 verification command,不得宣称 passes。
23
+
24
+ ## The Gate Function
25
+
26
+ ```
27
+ BEFORE claiming any status or expressing satisfaction:
28
+
29
+ 1. IDENTIFY: What command proves this claim?
30
+ 2. RUN: Execute the FULL command (fresh, complete)
31
+ 3. READ: Full output, check exit code, count failures
32
+ 4. VERIFY: Does output confirm the claim?
33
+ - If NO: State actual status with evidence
34
+ - If YES: State claim WITH evidence
35
+ 5. ONLY THEN: Make the claim
36
+
37
+ Skip any step = lying, not verifying
38
+ ```
39
+
40
+ ## Common Failures
41
+
42
+ | Claim | Requires | Not Sufficient |
43
+ |-------|----------|----------------|
44
+ | Tests pass | Test command output: 0 failures | Previous run, "should pass" |
45
+ | Linter clean | Linter output: 0 errors | Partial check, extrapolation |
46
+ | Build succeeds | Build command: exit 0 | Linter passing, logs look good |
47
+ | Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
48
+ | Regression test works | Red-green cycle verified | Test passes once |
49
+ | Agent completed | VCS diff shows changes | Agent reports "success" |
50
+ | Requirements met | Line-by-line checklist | Tests passing |
51
+ | Harness integrity | `scripts/check-repo.sh` exit 0 | Files look correct |
52
+ | Harness CI | `scripts/ci.sh` exit 0 | Individual checks pass |
53
+ | Contract handoff | Handoff checklist completed + progress/report updated | "Should be fine"
54
+
55
+ ## Red Flags - STOP
56
+
57
+ - 使用 "should"、"probably"、"seems to"
58
+ - 验证前表达满意("Great!"、"Perfect!"、"Done!" 等)
59
+ - 未验证就要 commit/push/PR
60
+ - 信任 agent success reports
61
+ - 依赖 partial verification
62
+ - 认为 "just this once"
63
+ - 疲惫想结束工作
64
+ - **任何未运行 verification 却暗示 success 的措辞**
65
+
66
+ ## Rationalization Prevention
67
+
68
+ | Excuse | Reality |
69
+ |--------|---------|
70
+ | "Should work now" | RUN the verification |
71
+ | "I'm confident" | Confidence ≠ evidence |
72
+ | "Just this once" | No exceptions |
73
+ | "Linter passed" | Linter ≠ compiler |
74
+ | "Agent said success" | Verify independently |
75
+ | "I'm tired" | Exhaustion ≠ excuse |
76
+ | "Partial check is enough" | Partial proves nothing |
77
+ | "Different words so rule doesn't apply" | Spirit over letter |
78
+
79
+ ## Key Patterns
80
+
81
+ **Tests:**
82
+ ```
83
+ ✅ [Run test command] [See: 34/34 pass] "All tests pass"
84
+ ❌ "Should pass now" / "Looks correct"
85
+ ```
86
+
87
+ **Regression tests (TDD Red-Green):**
88
+ ```
89
+ ✅ Write → Run (pass) → Revert fix → Run (MUST FAIL) → Restore → Run (pass)
90
+ ❌ "I've written a regression test" (without red-green verification)
91
+ ```
92
+
93
+ **Build:**
94
+ ```
95
+ ✅ [Run build] [See: exit 0] "Build passes"
96
+ ❌ "Linter passed" (linter doesn't check compilation)
97
+ ```
98
+
99
+ **Requirements:**
100
+ ```
101
+ ✅ Re-read plan → Create checklist → Verify each → Report gaps or completion
102
+ ❌ "Tests pass, phase complete"
103
+ ```
104
+
105
+ **Agent delegation:**
106
+ ```
107
+ ✅ Agent reports success → Check VCS diff → Verify changes → Report actual state
108
+ ❌ Trust agent report
109
+ ```
110
+
111
+ ## Harness-Specific Verification
112
+
113
+ 在 harness-governed repo 中工作(存在 `harness.json`)时:
114
+
115
+ - **Docs/structure changes** → `bash scripts/check-repo.sh`
116
+ - **Full-repo delivery** → `bash scripts/ci.sh`
117
+ - **Cross-platform changes** → 验证 OpenCode 与 Pi-Agent 两条路径
118
+ - **Contract changes** → 验证 contract docs 已更新 + tests 对齐
119
+ - **Handoff** → 宣称 complete 前运行 `handoff check`
120
+
121
+ 完整 command 选择见项目 `docs/verification-matrix.md`。
122
+
123
+ ## Why This Matters
124
+
125
+ 来自 24 条 failure memories:
126
+ - human partner 说 "I don't believe you" — trust 已破裂
127
+ - Undefined functions 已 ship — 会 crash
128
+ - Missing requirements 已 ship — 功能不完整
129
+ - 虚假完成浪费时间 → redirect → rework
130
+ - 违反:"Honesty is a core value. If you lie, you'll be replaced."
131
+
132
+ ## When To Apply
133
+
134
+ **在以下情况之前 ALWAYS:**
135
+ - 任何 success/completion claims 的变体
136
+ - 任何表达满意
137
+ - 任何关于 work state 的正面陈述
138
+ - Commit、PR creation、task completion
139
+ - 进入 next task
140
+ - 委派给 agents
141
+
142
+ **规则适用于:**
143
+ - 精确短语
144
+ - paraphrases 与同义词
145
+ - success 的暗示
146
+ - 任何暗示 completion/correctness 的沟通
147
+
148
+ ## The Bottom Line
149
+
150
+ **Verification 无捷径。**
151
+
152
+ Run the command. Read the output. THEN claim the result.
153
+
154
+ This is non-negotiable.
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: webapp-testing
3
+ description: 任务明确涉及 browser 渲染行为时,用于前端或本地 web UI 验证。
4
+ ---
5
+
6
+ # Webapp Testing
7
+
8
+ 仅当任务包含 browser UI 或本地 web app 时使用本 skill。
9
+
10
+ ## 规则
11
+
12
+ - 优先使用项目现有的 dev server 与 test tooling。
13
+ - 当 visual 或 interaction 行为重要时,用 browser 或文档化的 UI test 命令验证渲染行为。
14
+ - UI 有变更时,检查 desktop 与 mobile 布局的 overlap、clipping、blank state。
15
+ - 默认不添加 networked services 或第三方 scan。
16
+
17
+ ## Output
18
+
19
+ 报告确切的 server 命令、URL、browser/test 命令与观察结果。