@sockulags/agent-os 0.14.0 → 0.16.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 (101) hide show
  1. package/README.md +102 -49
  2. package/cli/doctor.mjs +307 -0
  3. package/cli/index.mjs +328 -151
  4. package/cli/index.test.mjs +406 -9
  5. package/package.json +5 -6
  6. package/plugins/agent-os-core/.claude-plugin/plugin.json +18 -0
  7. package/plugins/agent-os-core/.codex-plugin/plugin.json +24 -0
  8. package/plugins/agent-os-core/skills/capture-intent/SKILL.md +65 -0
  9. package/plugins/agent-os-core/skills/capture-intent/references/intent-template.md +47 -0
  10. package/plugins/agent-os-core/skills/explain-work/SKILL.md +42 -0
  11. package/{skills → plugins/agent-os-core/skills}/list-skills/SKILL.md +13 -6
  12. package/{skills → plugins/agent-os-core/skills}/plain-voice/SKILL.md +7 -4
  13. package/plugins/agent-os-core/skills/plan-work/SKILL.md +133 -0
  14. package/plugins/agent-os-core/skills/plan-work/references/elicitation.md +32 -0
  15. package/plugins/agent-os-core/skills/plan-work/references/map.md +108 -0
  16. package/plugins/agent-os-core/skills/plan-work/references/spec-template.md +64 -0
  17. package/plugins/agent-os-core/skills/record-lesson/SKILL.md +47 -0
  18. package/plugins/agent-os-core/skills/scope-guard/SKILL.md +53 -0
  19. package/{skills → plugins/agent-os-core/skills}/verify-before-done/SKILL.md +6 -2
  20. package/plugins/agent-os-dev/.claude-plugin/plugin.json +18 -0
  21. package/plugins/agent-os-dev/.codex-plugin/plugin.json +24 -0
  22. package/plugins/agent-os-dev/hooks/hooks.json +42 -0
  23. package/{skills → plugins/agent-os-dev/skills}/batch-work/SKILL.md +9 -4
  24. package/{skills → plugins/agent-os-dev/skills}/batch-work/references/manifest.md +8 -0
  25. package/{skills → plugins/agent-os-dev/skills}/check-work/SKILL.md +31 -14
  26. package/{skills/deliver-work/workflow.md → plugins/agent-os-dev/skills/deliver-work/SKILL.md} +85 -17
  27. package/plugins/agent-os-dev/skills/design-work/SKILL.md +145 -0
  28. package/plugins/agent-os-dev/skills/design-work/scripts/render-sketch.mjs +233 -0
  29. package/plugins/agent-os-dev/skills/design-work/scripts/render-sketch.test.mjs +73 -0
  30. package/plugins/agent-os-dev/skills/diagnose-before-fix/SKILL.md +29 -0
  31. package/{skills → plugins/agent-os-dev/skills}/dispatch-next/SKILL.md +10 -4
  32. package/plugins/agent-os-dev/skills/init-agent-os/SKILL.md +121 -0
  33. package/plugins/agent-os-dev/skills/init-agent-os/policy.md +88 -0
  34. package/plugins/agent-os-dev/skills/init-agent-os/references/guards.md +39 -0
  35. package/{skills → plugins/agent-os-dev/skills}/init-agent-os/references/repository-init.md +41 -9
  36. package/plugins/agent-os-dev/skills/init-agent-os/references/review-template.md +35 -0
  37. package/plugins/agent-os-dev/skills/init-agent-os/scripts/policy-block.mjs +187 -0
  38. package/plugins/agent-os-dev/skills/init-agent-os/templates/agent-review.yml +59 -0
  39. package/plugins/agent-os-dev/skills/init-agent-os/templates/lint-intents.yml +30 -0
  40. package/{skills → plugins/agent-os-dev/skills}/proportional-testing/SKILL.md +1 -1
  41. package/plugins/agent-os-dev/skills/quality-ratchet/SKILL.md +103 -0
  42. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/references/project-controls.md +31 -3
  43. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/analyzers.mjs +145 -0
  44. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/analyzers.test.mjs +158 -0
  45. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/guards.mjs +372 -0
  46. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/guards.test.mjs +138 -0
  47. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/intent-files.mjs +322 -0
  48. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/intent-files.test.mjs +172 -0
  49. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/project-controls.mjs +59 -8
  50. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/project-controls.test.mjs +134 -8
  51. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/quality-delta.mjs +296 -22
  52. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/quality-delta.test.mjs +114 -6
  53. package/plugins/agent-os-dev/skills/shape-work/SKILL.md +124 -0
  54. package/plugins/agent-os-dev/skills/shape-work/references/implementation-issues.md +143 -0
  55. package/{skills/chart-work → plugins/agent-os-dev/skills/shape-work}/references/prototypes.md +11 -13
  56. package/plugins/agent-os-dev/skills/simplify/SKILL.md +91 -0
  57. package/plugins/agent-os-dev/skills/simplify/scripts/audit-evidence.mjs +166 -0
  58. package/plugins/agent-os-dev/skills/simplify/scripts/audit-evidence.test.mjs +49 -0
  59. package/policy.md +53 -20
  60. package/hooks/hooks.json +0 -17
  61. package/skills/chart-work/SKILL.md +0 -42
  62. package/skills/chart-work/references/elicitation.md +0 -25
  63. package/skills/chart-work/references/map.md +0 -84
  64. package/skills/deliver-work/SKILL.md +0 -12
  65. package/skills/diagnose-before-fix/SKILL.md +0 -24
  66. package/skills/explain-work/SKILL.md +0 -27
  67. package/skills/guide-me/SKILL.md +0 -36
  68. package/skills/init-agent-os/SKILL.md +0 -54
  69. package/skills/init-agent-os/scripts/policy-block.ps1 +0 -87
  70. package/skills/notice-lesson/SKILL.md +0 -20
  71. package/skills/quality-ratchet/SKILL.md +0 -72
  72. package/skills/record-lesson/SKILL.md +0 -31
  73. package/skills/scope-guard/SKILL.md +0 -32
  74. package/skills/shape-work/SKILL.md +0 -48
  75. package/skills/shape-work/references/implementation-issues.md +0 -69
  76. package/skills/shape-work/references/mockups.md +0 -23
  77. package/skills/simplifier/SKILL.md +0 -35
  78. package/skills/simplifier/agents/openai.yaml +0 -2
  79. package/skills/simplifier-audit/SKILL.md +0 -30
  80. package/skills/simplifier-review/SKILL.md +0 -40
  81. package/skills/understand-work/SKILL.md +0 -31
  82. package/skills/understand-work/agents/openai.yaml +0 -2
  83. package/skills/writing-skills/SKILL.md +0 -68
  84. package/skills/writing-skills/agents/openai.yaml +0 -2
  85. /package/{skills/batch-work → plugins/agent-os-core/skills/capture-intent}/agents/openai.yaml +0 -0
  86. /package/{skills/chart-work → plugins/agent-os-core/skills/explain-work}/agents/openai.yaml +0 -0
  87. /package/{skills/deliver-work → plugins/agent-os-core/skills/list-skills}/agents/openai.yaml +0 -0
  88. /package/{skills → plugins/agent-os-core/skills}/plain-voice/references/tells.md +0 -0
  89. /package/{skills/dispatch-next → plugins/agent-os-core/skills/plan-work}/agents/openai.yaml +0 -0
  90. /package/{skills/explain-work → plugins/agent-os-dev/skills/batch-work}/agents/openai.yaml +0 -0
  91. /package/{skills → plugins/agent-os-dev/skills}/batch-work/scripts/manifest-hash.mjs +0 -0
  92. /package/{skills → plugins/agent-os-dev/skills}/batch-work/scripts/test-manifest-hash.mjs +0 -0
  93. /package/{skills → plugins/agent-os-dev/skills}/check-work/references/findings.md +0 -0
  94. /package/{skills/guide-me → plugins/agent-os-dev/skills/deliver-work}/agents/openai.yaml +0 -0
  95. /package/{skills/init-agent-os → plugins/agent-os-dev/skills/design-work}/agents/openai.yaml +0 -0
  96. /package/{skills/list-skills → plugins/agent-os-dev/skills/dispatch-next}/agents/openai.yaml +0 -0
  97. /package/{skills/record-lesson → plugins/agent-os-dev/skills/init-agent-os}/agents/openai.yaml +0 -0
  98. /package/{skills → plugins/agent-os-dev/skills}/proportional-testing/references/strategy.md +0 -0
  99. /package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/references/structure.md +0 -0
  100. /package/{skills → plugins/agent-os-dev/skills}/shape-work/agents/openai.yaml +0 -0
  101. /package/{skills/simplifier-audit → plugins/agent-os-dev/skills/simplify}/agents/openai.yaml +0 -0
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "agent-os-dev",
3
+ "description": "Agent OS development: shape plans, deliver against ground truth, review independently, and guard delivery with hooks. Requires agent-os-core.",
4
+ "version": "0.16.0",
5
+ "homepage": "https://sockulags.github.io/agent-os/",
6
+ "repository": "https://github.com/sockulags/agent-os",
7
+ "keywords": [
8
+ "workflow",
9
+ "delivery",
10
+ "code-review",
11
+ "testing",
12
+ "hooks",
13
+ "skills"
14
+ ],
15
+ "skills": "./skills/",
16
+ "interface": {
17
+ "displayName": "Agent OS Dev",
18
+ "shortDescription": "Delivery, review, and guard hooks for code",
19
+ "longDescription": "Shapes a spec into delivery units in plan.md, delivers one unit at a time against ground truth with draft pull requests, runs batches through isolated workers, reviews candidates independently in a session or in CI against REVIEW.md, reproduces bugs before fixing, keeps touched code no worse, and enforces it with hooks for spec freeze, test locks, protected paths, secret scans, and a delivery Stop gate. Requires agent-os-core.",
20
+ "developerName": "Lucas Skog",
21
+ "category": "Engineering",
22
+ "websiteURL": "https://sockulags.github.io/agent-os/"
23
+ }
24
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "description": "Agent OS dev hooks: the quality-ratchet delivery Stop gate and the guard hooks that read .agent-os/guards.json.",
3
+ "hooks": {
4
+ "SessionStart": [
5
+ {
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/skills/quality-ratchet/scripts/guards.mjs\" hook --agent-os-hook=guards",
10
+ "commandWindows": "powershell.exe -NoProfile -NonInteractive -EncodedCommand JAByAHUAbgBuAGUAcgAgAD0AIABKAG8AaQBuAC0AUABhAHQAaAAgACQAZQBuAHYAOgBQAEwAVQBHAEkATgBfAFIATwBPAFQAIAAnAHMAawBpAGwAbABzAFwAcQB1AGEAbABpAHQAeQAtAHIAYQB0AGMAaABlAHQAXABzAGMAcgBpAHAAdABzAFwAZwB1AGEAcgBkAHMALgBtAGoAcwAnADsAIABuAG8AZABlACAAJAByAHUAbgBuAGUAcgAgAGgAbwBvAGsAIAAtAC0AYQBnAGUAbgB0AC0AbwBzAC0AaABvAG8AawA9AGcAdQBhAHIAZABzAA==",
11
+ "timeout": 10
12
+ }
13
+ ]
14
+ }
15
+ ],
16
+ "PreToolUse": [
17
+ {
18
+ "matcher": "Edit|Write|MultiEdit|NotebookEdit|Bash|apply_patch|shell|exec_command|local_shell",
19
+ "hooks": [
20
+ {
21
+ "type": "command",
22
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/skills/quality-ratchet/scripts/guards.mjs\" hook --agent-os-hook=guards",
23
+ "commandWindows": "powershell.exe -NoProfile -NonInteractive -EncodedCommand JAByAHUAbgBuAGUAcgAgAD0AIABKAG8AaQBuAC0AUABhAHQAaAAgACQAZQBuAHYAOgBQAEwAVQBHAEkATgBfAFIATwBPAFQAIAAnAHMAawBpAGwAbABzAFwAcQB1AGEAbABpAHQAeQAtAHIAYQB0AGMAaABlAHQAXABzAGMAcgBpAHAAdABzAFwAZwB1AGEAcgBkAHMALgBtAGoAcwAnADsAIABuAG8AZABlACAAJAByAHUAbgBuAGUAcgAgAGgAbwBvAGsAIAAtAC0AYQBnAGUAbgB0AC0AbwBzAC0AaABvAG8AawA9AGcAdQBhAHIAZABzAA==",
24
+ "timeout": 10
25
+ }
26
+ ]
27
+ }
28
+ ],
29
+ "Stop": [
30
+ {
31
+ "hooks": [
32
+ {
33
+ "type": "command",
34
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/skills/quality-ratchet/scripts/quality-delta.mjs\" hook --agent-os-hook=quality-ratchet",
35
+ "commandWindows": "powershell.exe -NoProfile -NonInteractive -EncodedCommand JAByAHUAbgBuAGUAcgAgAD0AIABKAG8AaQBuAC0AUABhAHQAaAAgACQAZQBuAHYAOgBQAEwAVQBHAEkATgBfAFIATwBPAFQAIAAnAHMAawBpAGwAbABzAFwAcQB1AGEAbABpAHQAeQAtAHIAYQB0AGMAaABlAHQAXABzAGMAcgBpAHAAdABzAFwAcQB1AGEAbABpAHQAeQAtAGQAZQBsAHQAYQAuAG0AagBzACcAOwAgAG4AbwBkAGUAIAAkAHIAdQBuAG4AZQByACAAaABvAG8AawAgAC0ALQBhAGcAZQBuAHQALQBvAHMALQBoAG8AbwBrAD0AcQB1AGEAbABpAHQAeQAtAHIAYQB0AGMAaABlAHQA",
36
+ "timeout": 10
37
+ }
38
+ ]
39
+ }
40
+ ]
41
+ }
42
+ }
@@ -9,7 +9,8 @@ disable-model-invocation: true
9
9
  Read project policy and [references/manifest.md](references/manifest.md). The request defines whether
10
10
  to plan the batch, execute it, or both.
11
11
 
12
- Batch-work consumes an existing set of implementation-ready, dependency-mapped issues. It does not
12
+ Batch-work consumes an existing set of implementation-ready, dependency-mapped issues, usually the
13
+ units of an `intents/<id>/plan.md`. It does not
13
14
  discover, decompose, or represent a product shape, and the existence of several issues does not
14
15
  invoke it. Use this workflow only when the developer explicitly requests an integrated batch.
15
16
 
@@ -25,17 +26,21 @@ invoke it. Use this workflow only when the developer explicitly requests an inte
25
26
  ## Loop
26
27
 
27
28
  1. Confirm every source issue has a stable identity, outcome, scope, dependencies, and checks. Route
28
- unresolved product decisions or missing decomposition to `shape-work` or `chart-work`.
29
+ unresolved product decisions or missing coherent delivery structure to `plan-work` or
30
+ `shape-work`.
29
31
  2. Create or update `.agent-os/batches/<batch-slug>.md`. Validate its graph and definition hashes.
30
32
  A planning-only request stops here; an execution request continues.
31
33
  3. Reconcile the manifest with live Git and worktree state before every dispatch wave.
32
34
  4. Dispatch the open frontier into isolated workspaces within project concurrency. Each worker gets
33
35
  one current task definition and returns a commit SHA, changed files, checks, and uncertainty.
36
+ A unit taken from a plan keeps its `Intent-Unit: <intent-id>/<unit-key>` line in the commit or
37
+ pull request that delivers it, so the plan's status can be read from history.
34
38
  5. Integrate completed tasks in dependency order. Detect already-contained commits, rerun relevant
35
39
  checks on the integrated head, and stop on conflicts rather than guessing.
36
- 6. After all tasks integrate, run fresh aggregate checks.
40
+ 6. After all tasks integrate, run the epic or feature's aggregate verification contract when one
41
+ exists, then run fresh aggregate checks. Child checks never prove the shared result.
37
42
  7. Treat the integrated batch as material. Apply the
38
- [deliver-work review gate](../deliver-work/workflow.md#review-gate) to the complete candidate,
43
+ [deliver-work review gate](../deliver-work/SKILL.md#review-gate) to the complete candidate,
39
44
  resolve supported findings, and rerun affected aggregate checks.
40
45
  8. Deliver the candidate only to the boundary named by the request or project policy.
41
46
 
@@ -98,3 +98,11 @@ Worker-local checks are useful context but are not proof of the integrated syste
98
98
 
99
99
  The original request and project policy define whether delivery stops at local changes, a commit, a
100
100
  pull request, merge, or deployment. Destructive cleanup requires the request or policy to include it.
101
+
102
+ ## Shared verification contract
103
+
104
+ When the source issue graph belongs to an epic or planned feature, keep the canonical epic contract
105
+ linked from the manifest rather than copying it into a competing specification. The manifest's
106
+ `aggregate_checks` must cover the shared outcome and acceptance, and its final verification step
107
+ must name the owner from that contract. Worker-local green checks never close the parent; the
108
+ coordinator follows the same aggregate verification direction as `deliver-work`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: check-work
3
- description: Reviews a diff, commit, branch, pull request, or completed implementation for supported correctness, scope, risk, and unnecessary-complexity findings, and in explicit fix mode applies supported in-scope fixes with verification and targeted re-review. It skips merely running tests, checking status, initial design, and repository-wide audits.
3
+ description: Code review of changes, a diff, a commit, a branch, or a pull request, in a session or headless in CI. Reviews them for bugs, scope, risk, and needless complexity against the spec and the repository's REVIEW.md, reports findings first, and fixes only when the user asks for fixes. Use when the user says things like review my changes, take a look before I push, sanity-check the last commit, review this PR, or review and fix what is broken. Not for only running tests, checking git status, designing a feature before code exists, or auditing the whole repository.
4
4
  ---
5
5
 
6
6
  # Check work
@@ -19,34 +19,50 @@ merge, deploy, publication, approval, comment, or other external effect.
19
19
  - `check-work fix` reviews first, then fixes only supported findings inside the requested scope,
20
20
  runs relevant verification, and gets a targeted independent re-review of every changed area.
21
21
  The explicit fix request is the authority; do not ask for a second approval.
22
+ - `check-work ci` is report mode for a non-interactive run on a pull request, such as the
23
+ `agent-review` workflow. It never asks, never edits, and writes the findings as its final output
24
+ for the workflow to post.
22
25
  - For an implicit request, infer the mode from authority: “review this” is report-only; “review
23
26
  and fix this” is fix mode. Ask before inspection only when the requested authority is genuinely
24
27
  ambiguous.
25
28
 
29
+ ## Review policy and contract
30
+
31
+ Read `REVIEW.md` at the repository root when it exists. It is the repository's review policy: focus
32
+ areas, severity tiers, what counts as a blocking finding, and limits such as a cap on minor
33
+ findings. It narrows and ranks findings; it never turns a speculative concern into a supported one.
34
+
35
+ When the candidate carries `Intent-Unit: <intent-id>/<unit-key>`, read that unit in
36
+ `intents/<intent-id>/plan.md` and the spec beside it. The spec's behavior, boundaries, and ground
37
+ truth are the review contract: report a candidate that misses an acceptance example, crosses a
38
+ non-goal, or edits an accepted intent or spec.
39
+
26
40
  ## Review loop
27
41
 
28
42
  1. Establish the review target, candidate identity, requested scope, non-goals, and ground truth
29
43
  from the request, repository policy, working-tree state, and relevant source and tests. A
30
44
  missing target or material unresolved product choice is a blocker, not a reason to invent scope.
31
45
  2. Freeze the candidate to be reviewed. Launch a fresh-context, read-only reviewer through a real host reviewer launch tool, using the independent-review semantics in
32
- [`deliver-work`](../deliver-work/workflow.md#review-gate). A wait tool alone is not a launch
46
+ [`deliver-work`](../deliver-work/SKILL.md#review-gate). A wait tool alone is not a launch
33
47
  mechanism. If no reviewer can be launched or the launched reviewer does not return a result,
34
- report `BLOCKED`; never present self-review as independent review.
48
+ report `BLOCKED`; never present self-review as independent review. In `ci` mode the run itself is
49
+ the independent reviewer: it started in a fresh context with no part in the implementation, so
50
+ review directly without launching another.
35
51
  3. Give the reviewer the outcome, boundaries, ground truth, candidate identity, and available
36
52
  verification evidence. Synthesize only findings supported by the code, diff, tests, policy, or
37
53
  returned review evidence. Omit speculative and cosmetic findings.
38
54
  Apply [references/findings.md](references/findings.md) when reporting and resolving findings;
39
55
  include that contract in the independent review brief.
40
- 4. Apply the relevant existing disciplines only when the question needs them: use
41
- [`scope-guard`](../scope-guard/SKILL.md) for drift, [`simplifier-review`](../simplifier-review/SKILL.md)
42
- for unnecessary complexity, [`proportional-testing`](../proportional-testing/SKILL.md) when
43
- test adequacy is part of the finding, [`diagnose-before-fix`](../diagnose-before-fix/SKILL.md)
44
- when a finding's cause is not established, and [`verify-before-done`](../verify-before-done/SKILL.md)
45
- after fixes. These are lenses, not unconditional passes.
46
- 5. In report mode, leave the candidate unchanged. In fix mode, apply only supported, in-scope
47
- findings; preserve unrelated work and stop at the local authority boundary. Re-run the relevant
48
- checks on the final candidate and launch a targeted fresh-context read-only re-review after any
49
- fix. If that reviewer cannot launch or return, report `BLOCKED`.
56
+ 4. Apply the relevant existing disciplines only when the question needs them: use the `scope-guard`
57
+ skill for drift, [`simplify`](../simplify/SKILL.md) review mode for unnecessary complexity,
58
+ [`proportional-testing`](../proportional-testing/SKILL.md) when test adequacy is part of the
59
+ finding, [`diagnose-before-fix`](../diagnose-before-fix/SKILL.md) when a finding's cause is not
60
+ established, and the `verify-before-done` skill after fixes. These are lenses, not unconditional
61
+ passes.
62
+ 5. In report and ci modes, leave the candidate unchanged. In fix mode, apply only supported,
63
+ in-scope findings; preserve unrelated work and stop at the local authority boundary. Re-run the
64
+ relevant checks on the final candidate and launch a targeted fresh-context read-only re-review
65
+ after any fix. If that reviewer cannot launch or return, report `BLOCKED`.
50
66
 
51
67
  ## Findings-first result
52
68
 
@@ -60,4 +76,5 @@ Start with actionable findings, each containing:
60
76
  Then report “No actionable findings” when none are supported. Fix mode additionally reports applied
61
77
  fixes, fresh verification, and targeted re-review. State the candidate identity, reviewer identity
62
78
  and role, and any material unverified claim. End the response with exactly one status line:
63
- `APPROVED`, `CHANGES_REQUESTED`, or `BLOCKED`.
79
+ `APPROVED`, `CHANGES_REQUESTED`, or `BLOCKED`. In `ci` mode, `APPROVED` means no blocking finding;
80
+ it never replaces the human approval that branch protection requires.
@@ -1,9 +1,29 @@
1
- # Delivery contract
1
+ ---
2
+ name: deliver-work
3
+ description: Delivers one decision-ready change against explicit boundaries and ground truth. User-invoked for implementation, including as a batch worker. Not for exploration or specification-only work.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Deliver work
8
+
9
+ The invocation grants authority to change repository files inside the requested scope. It does not
10
+ grant authority to choose unresolved product behavior or to merge, deploy, perform destructive
11
+ cleanup, or affect external systems unless the request or project policy includes those actions.
12
+ This file is the complete delivery contract; it stays in context after compaction.
13
+
14
+ ## Stop conditions
15
+
16
+ Stop with the exact decision or external action needed when the request does not cover it. Stop a
17
+ completion claim when ground truth fails or cannot be exercised. Otherwise continue until the
18
+ requested delivery target is reached.
2
19
 
3
20
  ## Establish the contract
4
21
 
5
22
  Read the request, repository policy, relevant code, and working-tree state. Preserve existing work.
6
- Resolve discoverable facts yourself. Before editing, know:
23
+ Resolve discoverable facts yourself. When the unit comes from `intents/<id>/plan.md`, or from a
24
+ tracker issue whose `Origin` names an intent, read its plan entry or issue, spec, and intent: the
25
+ unit's contract, the spec's boundaries, its `## Interface` entries with their sketches, and its
26
+ ground truth are the contract below. Before editing, know:
7
27
 
8
28
  - **Outcome:** the observable change requested.
9
29
  - **Boundaries:** explicit non-goals and the smallest plausible change surface.
@@ -14,6 +34,17 @@ An implementation request authorizes in-scope repository edits. Ask one focused
14
34
  an unresolved product decision has materially different outcomes. Reversible implementation choices
15
35
  belong to the implementer.
16
36
 
37
+ A stale source is an unresolved product decision. When the spec's `built_on` revision is older than
38
+ its intent, or the plan's is older than its spec, stop before mutation and return the unit to
39
+ `plan-work` or `shape-work` with the revisions that differ. A unit that contradicts the spec it
40
+ cites goes back the same way, because the spec wins. Delivery never edits an accepted intent,
41
+ spec, or plan entry; a needed change goes back through those workflows.
42
+
43
+ An open or deferred interface surface is also an unresolved product decision. When the unit builds
44
+ a screen whose `## Interface` entry is not decided, stop before mutating that screen and return it
45
+ to `design-work`. Build decided screens to match their sketch, using production components rather
46
+ than the sketch's code.
47
+
17
48
  ## Confirm one delivery unit
18
49
 
19
50
  Before editing each unit, verify that it is one coherent implementation issue or an equivalently
@@ -23,7 +54,8 @@ different delivery targets, or unresolved product choices, stop before mutation
23
54
  shaping into implementation-ready issues. Do not choose `batch-work`; execution strategy belongs to
24
55
  the developer.
25
56
 
26
- When the request explicitly covers a bounded set of already shaped issues, deliver one ready unit
57
+ Skip a unit that already has an open pull request carrying its `Intent-Unit` line: someone else has
58
+ claimed it. When the request explicitly covers a bounded set of already shaped issues, deliver one ready unit
27
59
  at a time and continue sequentially within that authority. Re-read dependencies and project state
28
60
  after each unit; stop for a material unresolved decision or an exhausted ready frontier. This repeats
29
61
  the active delivery contract, not `dispatch-next` or an implicit batch. An undecomposed epic still
@@ -31,11 +63,16 @@ needs shaping; a one-issue request does not authorize the rest of its epic. Keep
31
63
  baseline for the authorized sequence and refresh its check per candidate; do not call `begin` again
32
64
  for each unit while that baseline is active.
33
65
 
66
+ The same rule applies when the request names a planned feature or epic: delivery owns the complete
67
+ authorized result, not merely whichever child happens to be green. When the request covers an epic,
68
+ run its aggregate verification and report the final verification owner. Child success never closes
69
+ the parent or grants authority over its siblings.
70
+
34
71
  ## Work loop
35
72
 
36
73
  1. Inspect enough of the affected system to choose a coherent change. Apply quality-ratchet's
37
74
  reuse and responsibility guidance before writing. If a solution-changing uncertainty remains,
38
- use the [experiment decision](../chart-work/references/prototypes.md); clear tasks need no prototype.
75
+ use the [experiment decision](../shape-work/references/prototypes.md); clear tasks need no prototype.
39
76
  2. If available, run [`quality-ratchet`](../quality-ratchet/SKILL.md)'s `begin` before the first
40
77
  mutation. It captures the exact worktree entry state without stashing or editing user files; an
41
78
  unavailable capability is reported rather than turned into a substitute gate.
@@ -47,14 +84,22 @@ for each unit while that baseline is active.
47
84
  cause is unknown and `scope-guard` when discoveries threaten the boundary.
48
85
  5. Apply [`proportional-testing`](../proportional-testing/SKILL.md) when selecting or creating tests.
49
86
  Run fast, relevant checks while working and adapt from their results.
50
- 6. Before [`simplifier-review`](../simplifier-review/SKILL.md), run quality-ratchet's `check` when
87
+ 6. Before [`simplify`](../simplify/SKILL.md)'s review mode, run quality-ratchet's `check` when
51
88
  its baseline is active and pass the evidence to the semantic review. Treat file, NLOC, legacy,
52
89
  dependency, and analyzer values as signals, never as an aggregate score or threshold gate.
53
90
  7. Review the resulting diff for correctness, unnecessary complexity, and scope. Apply the
54
- simplifier-review lens and resolve findings using the
91
+ `simplify` review lens and resolve findings using the
55
92
  [finding contract](../check-work/references/findings.md) before freezing the candidate.
56
93
  8. Complete the review gate below.
57
- 9. Apply `verify-before-done` to the final candidate and deliver only to the requested boundary.
94
+ 9. Apply `verify-before-done` to the final candidate, run quality-ratchet's `finish` when its
95
+ baseline is active, and deliver only to the requested boundary.
96
+
97
+ When the delivery target includes a pull request, claim the unit early: work on a branch named by
98
+ the project policy, or `<intent-id>-<unit-key>` by default, and open a draft pull request with the
99
+ first commit. Its body carries `Intent-Unit: <intent-id>/<unit-key>`, the outcome, the ground truth,
100
+ and, as delivery proceeds, the evidence and review record. Mark it ready for review only after the
101
+ final verification. In the pull request that delivers the last open unit of a plan, also set the
102
+ intent's and plan's `status: done`. Never write delivery progress into `plan.md`.
58
103
 
59
104
  Ground truth governs the loop; no prescribed implementation sequence substitutes for it.
60
105
 
@@ -84,7 +129,7 @@ waive required review; do not solicit a waiver. When review is required:
84
129
  callable or returns no ID, stop without calling a wait tool. Never call a wait tool with empty
85
130
  receiver IDs or construct a `/root/...` reviewer label yourself. Use the host's equivalent launch
86
131
  receipt elsewhere. Give the reviewer the outcome, boundaries, ground truth, candidate diff, and
87
- verification evidence — not the implementer's reasoning.
132
+ verification evidence, not the implementer's reasoning.
88
133
  4. Use one general evidence-based reviewer by default, briefed with the finding contract above.
89
134
  Add a focused security or compatibility reviewer
90
135
  only when a distinct risk needs that lens; do not create a panel by default.
@@ -103,9 +148,37 @@ containing the frozen candidate, review scope including unnecessary solution com
103
148
  required ground truth. Self-review never
104
149
  substitutes for required independent review.
105
150
 
151
+ ## Handle discoveries without fragmenting the mission
152
+
153
+ During delivery, update the current work when the discovery is necessary and within the existing
154
+ contract:
155
+
156
+ - a necessary technical detail is solved and delivery continues;
157
+ - a missed technical prerequisite is added to the work plan and delivery continues within mandate;
158
+ - an incorrect order is corrected when acceptance, ownership, and delivery boundaries remain the
159
+ same;
160
+ - a unit is split, combined, or has responsibility moved only through targeted `shape-work`;
161
+ - a product contract or explicit boundary is changed only by reopening that decision through
162
+ `plan-work`;
163
+ - an adjacent improvement stays out without separate authority.
164
+
165
+ Diagnose technical blockers before forwarding them. Do not create a blocking side issue merely
166
+ because a necessary detail was discovered late. Continue independent authorized work during a
167
+ partial block. A context or session limit calls for a compact continuation record, not a new
168
+ product issue. Changing workflow names is not itself a new approval step.
169
+
170
+ No workflow grants tracker write access automatically. Tracker maintenance is allowed only when the
171
+ request or project policy grants it, and then only for implementation detail and technical
172
+ ordering/readiness inside the authorized set. It does not include changing acceptance, owners,
173
+ delivery scope, adding unrequested work, or closing an issue. A ready issue is not authorization.
174
+ Without tracker mandate, keep corrections local and report the delta. If it must survive a session,
175
+ use the work record's existing sections and add `Pending tracker updates` only when needed; record
176
+ the unsynced delta, never a copied plan.
177
+
106
178
  ## Resume only when useful
107
179
 
108
- Ordinary work needs no workflow record. For work expected to span sessions, keep a compact
180
+ Ordinary work needs no workflow record, and a draft pull request is the record for claimed units.
181
+ For work expected to span sessions without a pull request, keep a compact
109
182
  `.agent-os/work/<slug>.md`:
110
183
 
111
184
  ```yaml
@@ -118,8 +191,9 @@ next_action: <concrete continuation>
118
191
  ```
119
192
 
120
193
  Record only Outcome, Boundaries, Ground truth, Decisions, and Evidence. Use `blocked`, `verified`, or
121
- `delivered` when those words help the next session resume accurately. The record is working memory,
122
- not an approval ledger.
194
+ `delivered` when those words help the next session resume accurately. Add `Pending tracker updates`
195
+ only when an authorized or reported tracker delta needs to survive the session. The record is working memory,
196
+ not an approval ledger, plan copy, or audit receipt.
123
197
 
124
198
  ## Batch workers
125
199
 
@@ -127,9 +201,3 @@ A batch task definition supplies the outcome, scope, dependencies, and checks. W
127
201
  assigned task workspace, commit there, and return the head SHA, changed files, checks, and remaining
128
202
  uncertainty to the coordinator. The coordinator owns integration, aggregate review, and aggregate
129
203
  verification.
130
-
131
- ## Stop conditions
132
-
133
- Stop with the exact decision or external action needed when the request does not cover it. Stop a
134
- completion claim when ground truth fails or cannot be exercised. Otherwise continue until the
135
- requested delivery target is reached.
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: design-work
3
+ description: Sketches the user-facing interface of planned work in the medium the project has chosen, such as standalone HTML, a component workshop, or images, inside the real layout with the project's own look, and records the decisions in the spec's Interface section. User-invoked, or continued into from plan-work when a spec changes what a person sees or does. Not for production UI implementation, polish of shipped screens, or work with no user-facing change.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Design work
8
+
9
+ Settle what people will see and do before delivery starts. The result is a set of sketches in the
10
+ medium the project chose, and a spec whose `## Interface` section says, for every new or changed
11
+ screen and state, what was decided and why. A product owner or account manager should be able to
12
+ judge the sketches without a design tool or a checkout; when the person deciding has no checkout,
13
+ give them images.
14
+
15
+ ## Inputs
16
+
17
+ Read the project policy, the intent and spec when they exist, and the request. The policy's
18
+ `## Design` section names how sketches are made (`Sketch with`), where they live (`Sketches live`),
19
+ and the widths that matter. Then inspect the tokens, the shared components, and the nearest existing
20
+ views. Resolve these facts yourself; ask the person only about what the product should be.
21
+
22
+ ## Medium
23
+
24
+ `Sketch with` is the project's choice, and this skill is not tied to any tool:
25
+
26
+ - `html`: standalone files that need no install and no project dependency, styled from the project's
27
+ real tokens and layout.
28
+ - A component workshop such as Storybook, named with the command that starts it: stories built from
29
+ the project's own components.
30
+ - `image`: pictures only, for a project with nothing to sketch in.
31
+ - Anything else the policy describes, followed as described.
32
+
33
+ When the policy sets no medium, ask once: recommend the workshop when the repository has one, and
34
+ `html` otherwise. Ask where sketches live in the same question, recommending
35
+ `intents/<id>/sketches/`. Offer to save the answer as a `## Design` section in the file that holds
36
+ the project policy, and write it only on a yes; with no such file, `init-agent-os` records it. Do not add Storybook or another dependency on your own. When the named tool is unavailable, or a
37
+ workshop's configuration does not pick up the sketch location, tell the person what is missing and
38
+ offer `html` for this run instead of changing the configuration.
39
+
40
+ `Sketches live` is a path in the repository, or `not in the repository`. Images are always available
41
+ as the way a sketch reaches people when its files cannot be committed: keep the working files
42
+ outside the checkout, render the sketch to PNG, and put the images on the pull request or at the
43
+ place the policy or the person names. With neither, ask where they should go.
44
+
45
+ Render with `scripts/render-sketch.mjs`, resolved relative to this `SKILL.md`:
46
+ `node <script> <file or local URL> --out <folder> --widths 390,1280`. It uses a Chrome or Edge already
47
+ on the machine, writes one PNG per width, and lists page errors and overflow. Exit 0 is clean, 1 means
48
+ it rendered with page errors, and 2 means it could not render. Never install a browser for it. When
49
+ you cannot render an image, say so and ask where the files should go.
50
+
51
+ ## Working surface
52
+
53
+ The invocation authorizes sketch files, the made-up data they need, the spec's `## Interface`
54
+ section, plus its `rev` and `## Decision log` when the spec is already accepted, and a policy
55
+ `## Design` section the person agreed to save. It does not
56
+ authorize production components, routes, state, API, or dependency changes. When a sketch needs
57
+ something the design system lacks, build it inside the sketch area and label it as a new proposal;
58
+ never change a shared component to make a sketch work.
59
+
60
+ A spec is open for edits until its review merges. After that, every edit to `## Interface` is a
61
+ reconsideration, including settling an open or deferred decision or adding a missing section: raise
62
+ `rev` and add a `## Decision log` line, as `plan-work` describes. A plan built on the earlier spec
63
+ revision is then stale and is reshaped by `shape-work`.
64
+
65
+ ## Sketch
66
+
67
+ Start from the spec's `## Interface` section: the surfaces it lists per role and the decisions it
68
+ marks open. A surface that is already decided is sketched only when the decision is about to
69
+ change. When the section says `None`, report that there is nothing to sketch and write no files.
70
+ When the section is missing or empty, derive the surfaces from the spec's behavior examples and
71
+ confirm the list with the person before sketching.
72
+
73
+ - **Real context.** Render each screen inside the layout the person will actually see, such as the
74
+ application shell, navigation, and page frame, not as a lone component on a blank canvas.
75
+ - **The project's own look.** In a workshop, use the project's components and tokens. In any other
76
+ medium, reproduce the look from the real tokens and layout, and state on the sketch that it is an
77
+ approximation. Reuse established patterns, and mark anything new as new so nobody mistakes it for
78
+ existing behavior.
79
+ - **Every state that matters.** Show the states the behavior examples imply, such as empty,
80
+ loading, error, success, no permission, and long content, for each role that sees the screen.
81
+ When layout depends on width, show the widths the policy names, or else common mobile, tablet,
82
+ and desktop widths together with the breakpoints the application itself defines. Show keyboard or
83
+ focus behavior when it is in scope.
84
+ - **Realistic made-up data.** Use plausible data in the product's own language. Never use real
85
+ personal or customer data.
86
+ - **Invented wording.** Text the spec does not give, such as an error message, is a proposal. Mark
87
+ it so in the sketch, list it in `## Interface`, and have the person confirm it with the decision
88
+ it belongs to.
89
+ - **Alternatives for real choices.** When a design question has materially different answers, build
90
+ two or three comparable alternatives with the same data side by side, recommend one, and let the
91
+ person decide. Do not decide a product preference for them.
92
+
93
+ Keep fidelity at what the open decision needs. A structure question needs a rough layout; a
94
+ question about hierarchy or interaction needs the real components and states.
95
+
96
+ ## Show it
97
+
98
+ Make each sketch openable for the person: start the workshop or check that it is running, give the
99
+ path of each HTML file, or show the images. Give the direct address of each sketch. Present each
100
+ open decision in plain language: what the person is looking at, the options, your recommendation,
101
+ and what changes if they choose otherwise. Ask one question at a time.
102
+
103
+ Iterate in the sketches until every listed decision is made or the person explicitly defers it.
104
+ When the person cannot answer now, commit the spec on a branch, with the sketches when they can be
105
+ committed, open a draft pull request that lists each open decision with the address or image of its
106
+ sketch, and wait. Never record your own recommendation as their decision.
107
+
108
+ ## Record
109
+
110
+ Write the outcome into the spec's `## Interface` section, one bullet per surface: the role and the
111
+ screen or state, then `Decided:` with the decision, its reason, the alternatives rejected, and the
112
+ sketch's location; `Deferred to <who> by <when>:` with what is undecided; or `Open:` with the question
113
+ while it waits on the person. The text must stand on its own: a reader who can no longer open the
114
+ sketch still knows what was decided.
115
+
116
+ A sketch's location must be reachable by everyone who reads the spec: a repository path, a pull
117
+ request image, or a URL, never a path that exists only on this machine. Until one exists, write that
118
+ the sketch is not yet published, and add the location when it is.
119
+
120
+ The sketches belong with the spec when they can be committed: commit them in the same change as the
121
+ spec when the request or the project's delivery defaults include committing, or when waiting on the
122
+ person as above. `deliver-work` reads the Interface section and its sketches;
123
+ a sketch is never promoted to production code.
124
+
125
+ ## Ground truth
126
+
127
+ The work is done when:
128
+
129
+ - every sketch opens and renders without errors in its medium, with no render or console errors
130
+ where those exist, and every image is legible;
131
+ - every behavior example with a visible result on a sketched surface appears in at least one
132
+ sketch, or the Interface section says why it is not visual;
133
+ - the sketches were inspected visually at the widths and states that matter, by you and by the
134
+ person; and
135
+ - every surface in `## Interface` has a decision or an explicit deferral with an owner.
136
+
137
+ Check these with the tools available, such as `scripts/render-sketch.mjs`, a browser on the sketch
138
+ or the workshop, the workshop's static build, or its test runner. Report a check you could not run instead of claiming it.
139
+
140
+ ## Exit
141
+
142
+ Report which surfaces are settled, which are deferred, and where the sketches are. When this run
143
+ continued from `plan-work`, return to it so the plan can be marked ready. When it started from a
144
+ `shape-work` hand-back, shaping continues from the current spec revision. Planning or sketching
145
+ never starts product implementation.