@sockulags/agent-os 0.15.0 → 0.17.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 (99) hide show
  1. package/README.md +105 -59
  2. package/cli/doctor.mjs +351 -0
  3. package/cli/index.mjs +328 -151
  4. package/cli/index.test.mjs +436 -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 +68 -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 +16 -7
  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 +151 -0
  14. package/{skills → plugins/agent-os-core/skills}/plan-work/references/elicitation.md +7 -3
  15. package/plugins/agent-os-core/skills/plan-work/references/spec-template.md +65 -0
  16. package/plugins/agent-os-core/skills/record-lesson/SKILL.md +47 -0
  17. package/{skills → plugins/agent-os-core/skills}/scope-guard/SKILL.md +11 -6
  18. package/{skills → plugins/agent-os-core/skills}/verify-before-done/SKILL.md +6 -2
  19. package/plugins/agent-os-dev/.claude-plugin/plugin.json +18 -0
  20. package/plugins/agent-os-dev/.codex-plugin/plugin.json +24 -0
  21. package/plugins/agent-os-dev/hooks/hooks.json +42 -0
  22. package/{skills → plugins/agent-os-dev/skills}/batch-work/SKILL.md +6 -2
  23. package/{skills → plugins/agent-os-dev/skills}/check-work/SKILL.md +33 -14
  24. package/{skills/deliver-work/workflow.md → plugins/agent-os-dev/skills/deliver-work/SKILL.md} +126 -57
  25. package/plugins/agent-os-dev/skills/deliver-work/references/work-records.md +20 -0
  26. package/plugins/agent-os-dev/skills/design-work/SKILL.md +160 -0
  27. package/plugins/agent-os-dev/skills/design-work/scripts/render-sketch.mjs +233 -0
  28. package/plugins/agent-os-dev/skills/design-work/scripts/render-sketch.test.mjs +73 -0
  29. package/plugins/agent-os-dev/skills/diagnose-before-fix/SKILL.md +29 -0
  30. package/{skills → plugins/agent-os-dev/skills}/dispatch-next/SKILL.md +11 -3
  31. package/plugins/agent-os-dev/skills/init-agent-os/SKILL.md +131 -0
  32. package/plugins/agent-os-dev/skills/init-agent-os/policy.md +91 -0
  33. package/plugins/agent-os-dev/skills/init-agent-os/references/guards.md +40 -0
  34. package/plugins/agent-os-dev/skills/init-agent-os/references/repository-init.md +115 -0
  35. package/plugins/agent-os-dev/skills/init-agent-os/references/review-template.md +35 -0
  36. package/plugins/agent-os-dev/skills/init-agent-os/references/workflow-template.md +80 -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 +104 -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 +177 -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 +135 -0
  54. package/plugins/agent-os-dev/skills/shape-work/references/implementation-issues.md +163 -0
  55. package/{skills/plan-work → plugins/agent-os-dev/skills/shape-work}/references/prototypes.md +9 -10
  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 +57 -30
  60. package/hooks/hooks.json +0 -17
  61. package/skills/deliver-work/SKILL.md +0 -12
  62. package/skills/diagnose-before-fix/SKILL.md +0 -24
  63. package/skills/explain-work/SKILL.md +0 -28
  64. package/skills/init-agent-os/SKILL.md +0 -55
  65. package/skills/init-agent-os/references/repository-init.md +0 -75
  66. package/skills/init-agent-os/scripts/policy-block.ps1 +0 -87
  67. package/skills/notice-lesson/SKILL.md +0 -20
  68. package/skills/plan-work/SKILL.md +0 -100
  69. package/skills/quality-ratchet/SKILL.md +0 -72
  70. package/skills/record-lesson/SKILL.md +0 -31
  71. package/skills/shape-work/SKILL.md +0 -71
  72. package/skills/shape-work/references/implementation-issues.md +0 -90
  73. package/skills/shape-work/references/mockups.md +0 -23
  74. package/skills/simplifier/SKILL.md +0 -35
  75. package/skills/simplifier-audit/SKILL.md +0 -30
  76. package/skills/simplifier-review/SKILL.md +0 -40
  77. package/skills/understand-work/SKILL.md +0 -32
  78. package/skills/understand-work/agents/openai.yaml +0 -2
  79. package/skills/writing-skills/SKILL.md +0 -68
  80. package/skills/writing-skills/agents/openai.yaml +0 -2
  81. /package/{skills/batch-work → plugins/agent-os-core/skills/capture-intent}/agents/openai.yaml +0 -0
  82. /package/{skills/deliver-work → plugins/agent-os-core/skills/explain-work}/agents/openai.yaml +0 -0
  83. /package/{skills/dispatch-next → plugins/agent-os-core/skills/list-skills}/agents/openai.yaml +0 -0
  84. /package/{skills → plugins/agent-os-core/skills}/plain-voice/references/tells.md +0 -0
  85. /package/{skills/explain-work → plugins/agent-os-core/skills/plan-work}/agents/openai.yaml +0 -0
  86. /package/{skills → plugins/agent-os-core/skills}/plan-work/references/map.md +0 -0
  87. /package/{skills/init-agent-os → plugins/agent-os-dev/skills/batch-work}/agents/openai.yaml +0 -0
  88. /package/{skills → plugins/agent-os-dev/skills}/batch-work/references/manifest.md +0 -0
  89. /package/{skills → plugins/agent-os-dev/skills}/batch-work/scripts/manifest-hash.mjs +0 -0
  90. /package/{skills → plugins/agent-os-dev/skills}/batch-work/scripts/test-manifest-hash.mjs +0 -0
  91. /package/{skills → plugins/agent-os-dev/skills}/check-work/references/findings.md +0 -0
  92. /package/{skills/list-skills → plugins/agent-os-dev/skills/deliver-work}/agents/openai.yaml +0 -0
  93. /package/{skills/plan-work → plugins/agent-os-dev/skills/design-work}/agents/openai.yaml +0 -0
  94. /package/{skills/record-lesson → plugins/agent-os-dev/skills/dispatch-next}/agents/openai.yaml +0 -0
  95. /package/{skills/shape-work → plugins/agent-os-dev/skills/init-agent-os}/agents/openai.yaml +0 -0
  96. /package/{skills → plugins/agent-os-dev/skills}/proportional-testing/references/strategy.md +0 -0
  97. /package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/references/structure.md +0 -0
  98. /package/{skills/simplifier-audit → plugins/agent-os-dev/skills/shape-work}/agents/openai.yaml +0 -0
  99. /package/{skills/simplifier → plugins/agent-os-dev/skills/simplify}/agents/openai.yaml +0 -0
@@ -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
 
@@ -32,12 +33,15 @@ invoke it. Use this workflow only when the developer explicitly requests an inte
32
33
  3. Reconcile the manifest with live Git and worktree state before every dispatch wave.
33
34
  4. Dispatch the open frontier into isolated workspaces within project concurrency. Each worker gets
34
35
  one current task definition and returns a commit SHA, changed files, checks, and uncertainty.
36
+ A unit that is a tracker issue without an intent keeps the tracker's closing reference to it.
37
+ A unit taken from a plan keeps its `Intent-Unit: <intent-id>/<unit-key>` line in the commit or
38
+ pull request that delivers it, so the plan's status can be read from history.
35
39
  5. Integrate completed tasks in dependency order. Detect already-contained commits, rerun relevant
36
40
  checks on the integrated head, and stop on conflicts rather than guessing.
37
41
  6. After all tasks integrate, run the epic or feature's aggregate verification contract when one
38
42
  exists, then run fresh aggregate checks. Child checks never prove the shared result.
39
43
  7. Treat the integrated batch as material. Apply the
40
- [deliver-work review gate](../deliver-work/workflow.md#review-gate) to the complete candidate,
44
+ [deliver-work review gate](../deliver-work/SKILL.md#review-gate) to the complete candidate,
41
45
  resolve supported findings, and rerun affected aggregate checks.
42
46
  8. Deliver the candidate only to the boundary named by the request or project policy.
43
47
 
@@ -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,52 @@ 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 links a tracker issue with no intent behind it, that issue is the contract:
36
+ review against its outcome, boundaries, acceptance, and ground truth.
37
+ When the candidate carries `Intent-Unit: <intent-id>/<unit-key>`, read that unit in
38
+ `intents/<intent-id>/plan.md` and the spec beside it. The spec's behavior, boundaries, and ground
39
+ truth are the review contract: report a candidate that misses an acceptance example, crosses a
40
+ non-goal, or edits an accepted intent or spec.
41
+
26
42
  ## Review loop
27
43
 
28
44
  1. Establish the review target, candidate identity, requested scope, non-goals, and ground truth
29
45
  from the request, repository policy, working-tree state, and relevant source and tests. A
30
46
  missing target or material unresolved product choice is a blocker, not a reason to invent scope.
31
47
  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
48
+ [`deliver-work`](../deliver-work/SKILL.md#review-gate). A wait tool alone is not a launch
33
49
  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.
50
+ report `BLOCKED`; never present self-review as independent review. In `ci` mode the run itself is
51
+ the independent reviewer: it started in a fresh context with no part in the implementation, so
52
+ review directly without launching another.
35
53
  3. Give the reviewer the outcome, boundaries, ground truth, candidate identity, and available
36
54
  verification evidence. Synthesize only findings supported by the code, diff, tests, policy, or
37
55
  returned review evidence. Omit speculative and cosmetic findings.
38
56
  Apply [references/findings.md](references/findings.md) when reporting and resolving findings;
39
57
  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`.
58
+ 4. Apply the relevant existing disciplines only when the question needs them: use the `scope-guard`
59
+ skill for drift, [`simplify`](../simplify/SKILL.md) review mode for unnecessary complexity,
60
+ [`proportional-testing`](../proportional-testing/SKILL.md) when test adequacy is part of the
61
+ finding, [`diagnose-before-fix`](../diagnose-before-fix/SKILL.md) when a finding's cause is not
62
+ established, and the `verify-before-done` skill after fixes. These are lenses, not unconditional
63
+ passes.
64
+ 5. In report and ci modes, leave the candidate unchanged. In fix mode, apply only supported,
65
+ in-scope findings; preserve unrelated work and stop at the local authority boundary. Re-run the
66
+ relevant checks on the final candidate and launch a targeted fresh-context read-only re-review
67
+ after any fix. If that reviewer cannot launch or return, report `BLOCKED`.
50
68
 
51
69
  ## Findings-first result
52
70
 
@@ -60,4 +78,5 @@ Start with actionable findings, each containing:
60
78
  Then report “No actionable findings” when none are supported. Fix mode additionally reports applied
61
79
  fixes, fresh verification, and targeted re-review. State the candidate identity, reviewer identity
62
80
  and role, and any material unverified claim. End the response with exactly one status line:
63
- `APPROVED`, `CHANGES_REQUESTED`, or `BLOCKED`.
81
+ `APPROVED`, `CHANGES_REQUESTED`, or `BLOCKED`. In `ci` mode, `APPROVED` means no blocking finding;
82
+ it never replaces the human approval that branch protection requires.
@@ -1,9 +1,30 @@
1
- # Delivery contract
1
+ ---
2
+ name: deliver-work
3
+ description: Delivers one decision-ready change, or every unit of a finished intent in sequence, 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. A tracker issue with no intent behind it is itself the whole
27
+ contract: its need, outcome, boundaries, acceptance, and ground truth. Before editing, know:
7
28
 
8
29
  - **Outcome:** the observable change requested.
9
30
  - **Boundaries:** explicit non-goals and the smallest plausible change surface.
@@ -14,16 +35,32 @@ An implementation request authorizes in-scope repository edits. Ask one focused
14
35
  an unresolved product decision has materially different outcomes. Reversible implementation choices
15
36
  belong to the implementer.
16
37
 
38
+ A stale source is an unresolved product decision. When the spec's `built_on` revision is older than
39
+ its intent, or the plan's is older than its spec, stop before mutation and return the unit to
40
+ `plan-work` or `shape-work` with the revisions that differ. A unit that contradicts the spec it
41
+ cites goes back the same way, because the spec wins. Delivery never edits an accepted intent,
42
+ spec, or plan entry; a needed change goes back through those workflows.
43
+
44
+ An open or deferred interface surface is also an unresolved product decision. When the unit builds
45
+ a screen whose `## Interface` entry is open or deferred, stop before mutating that screen and return
46
+ it to the developer through `plan-work`. A screen left to delivery is yours to build inside the
47
+ entry's constraints and the project's established patterns; show the built screen with the
48
+ delivery, as an image when the developer has no checkout, so they can judge it. Build decided
49
+ screens to match their sketch when one exists, using production components rather than the sketch's
50
+ code.
51
+
17
52
  ## Confirm one delivery unit
18
53
 
19
54
  Before editing each unit, verify that it is one coherent implementation issue or an equivalently
20
55
  bounded direct request: one observable outcome, one reviewable change boundary, explicit ground
21
56
  truth, and satisfied dependencies. If an unshaped target contains several separately closable outcomes,
22
57
  different delivery targets, or unresolved product choices, stop before mutation and return it for
23
- shaping into implementation-ready issues. Do not choose `batch-work`; execution strategy belongs to
58
+ shaping into implementation-ready issues, unless the request is to finish a whole intent, which
59
+ covers that shaping. Do not choose `batch-work`; execution strategy belongs to
24
60
  the developer.
25
61
 
26
- When the request explicitly covers a bounded set of already shaped issues, deliver one ready unit
62
+ Skip a unit that already has an open pull request carrying its `Intent-Unit` line, or for an issue
63
+ without an intent, an open pull request that links the issue: someone else has claimed it. When the request explicitly covers a bounded set of already shaped issues, deliver one ready unit
27
64
  at a time and continue sequentially within that authority. Re-read dependencies and project state
28
65
  after each unit; stop for a material unresolved decision or an exhausted ready frontier. This repeats
29
66
  the active delivery contract, not `dispatch-next` or an implicit batch. An undecomposed epic still
@@ -36,11 +73,39 @@ authorized result, not merely whichever child happens to be green. When the requ
36
73
  run its aggregate verification and report the final verification owner. Child success never closes
37
74
  the parent or grants authority over its siblings.
38
75
 
76
+ ## Finish a whole intent
77
+
78
+ When the request is to finish an intent, the target is every unit of its plan, and the request
79
+ covers that bounded set and the shaping it needs. Nothing else changes: each unit still goes
80
+ through the work loop and the review gate.
81
+
82
+ - **Before anything.** The intent and spec must be accepted and current, and no `## Interface`
83
+ surface may be `Open:` or `Deferred to`. Otherwise stop with the file and the question. A surface
84
+ left to delivery does not stop the run.
85
+ - **Plan.** With no plan, or a plan built on an older spec revision, shape the units with
86
+ `shape-work` first and commit the plan with the work; it needs no separate review. A unit that
87
+ shaping must block on a product choice stays blocked while the others proceed.
88
+ - **Units.** Deliver ready units one at a time in dependency order, as the sequence rule above
89
+ describes. A unit delivered earlier in this run counts as delivered for the units that depend on
90
+ it. Running units in parallel is `batch-work` and stays the developer's explicit choice.
91
+ - **One candidate.** Unless the project policy asks for a pull request per unit, work on one branch
92
+ named `<intent-id>` and one draft pull request. Each unit's commits carry its `Intent-Unit` line,
93
+ and the pull request body carries one line per delivered unit.
94
+ - **Finish.** After the last unit, run the spec's ground truth and any epic's aggregate
95
+ verification on the whole result, run the initiative's finishing tasks, apply the review gate to
96
+ the complete candidate, set the intent's and plan's `status: done`, and mark the pull request
97
+ ready. Never merge unless the
98
+ request or project policy includes it.
99
+ - **Stop and resume.** Stop when what remains is blocked, when ground truth fails and the fix is
100
+ outside the unit, or when a finding needs a product decision. Report the units delivered, the
101
+ units left, and the exact blocker. A later run reads what is delivered from the `Intent-Unit`
102
+ lines on the branch and the pull request, never from notes.
103
+
39
104
  ## Work loop
40
105
 
41
106
  1. Inspect enough of the affected system to choose a coherent change. Apply quality-ratchet's
42
107
  reuse and responsibility guidance before writing. If a solution-changing uncertainty remains,
43
- use the [experiment decision](../plan-work/references/prototypes.md); clear tasks need no prototype.
108
+ use the [experiment decision](../shape-work/references/prototypes.md); clear tasks need no prototype.
44
109
  2. If available, run [`quality-ratchet`](../quality-ratchet/SKILL.md)'s `begin` before the first
45
110
  mutation. It captures the exact worktree entry state without stashing or editing user files; an
46
111
  unavailable capability is reported rather than turned into a substitute gate.
@@ -52,44 +117,42 @@ the parent or grants authority over its siblings.
52
117
  cause is unknown and `scope-guard` when discoveries threaten the boundary.
53
118
  5. Apply [`proportional-testing`](../proportional-testing/SKILL.md) when selecting or creating tests.
54
119
  Run fast, relevant checks while working and adapt from their results.
55
- 6. Before [`simplifier-review`](../simplifier-review/SKILL.md), run quality-ratchet's `check` when
120
+ 6. Before [`simplify`](../simplify/SKILL.md)'s review mode, run quality-ratchet's `check` when
56
121
  its baseline is active and pass the evidence to the semantic review. Treat file, NLOC, legacy,
57
122
  dependency, and analyzer values as signals, never as an aggregate score or threshold gate.
58
123
  7. Review the resulting diff for correctness, unnecessary complexity, and scope. Apply the
59
- simplifier-review lens and resolve findings using the
124
+ `simplify` review lens and resolve findings using the
60
125
  [finding contract](../check-work/references/findings.md) before freezing the candidate.
61
126
  8. Complete the review gate below.
62
- 9. Apply `verify-before-done` to the final candidate and deliver only to the requested boundary.
127
+ 9. Apply `verify-before-done` to the final candidate, run quality-ratchet's `finish` when its
128
+ baseline is active, and deliver only to the requested boundary.
129
+
130
+ When the delivery target includes a pull request, claim the unit early: work on a branch named by
131
+ the project policy, or `<intent-id>-<unit-key>` by default, and open a draft pull request with the
132
+ first commit. Its body carries `Intent-Unit: <intent-id>/<unit-key>`, or for an issue without an
133
+ intent the tracker's closing reference such as `Closes #12` and a branch named after the issue, then
134
+ the outcome, the ground truth, and, as delivery proceeds, the evidence and review record. Mark it ready for review only after the
135
+ final verification. In the pull request that delivers the last open unit of a plan, also set the
136
+ intent's and plan's `status: done`. Never write delivery progress into `plan.md`.
137
+
138
+ ## Route and finishing tasks
139
+
140
+ Read the route for this kind of work from `.agent-os/workflow.md` when the project policy points to
141
+ one, otherwise from a default path the project policy states, otherwise from the global policy's
142
+ default routes. When the route puts `shape-work` before delivery and the work has no issue or plan
143
+ unit, say so in one sentence and recommend `shape-work`. Stop before mutation only when the project
144
+ has a workflow file, a tracker can be written, and the request does not say to skip the issue;
145
+ otherwise continue with the delivery.
146
+
147
+ When the work is complete, run the workflow file's `## Finishing tasks` for this kind of work; for
148
+ an initiative, in the pull request that delivers its last unit. A repository task, such as a
149
+ changelog entry, joins that pull request and its review gate. An external task runs when a tool can
150
+ write there, since the workflow file is project policy; otherwise hand over the finished text with
151
+ its destination. Report each task as done or handed off; none merges, deploys, or closes anything
152
+ unless it says so. End with the route line, naming the issue or unit and the resume command.
63
153
 
64
154
  Ground truth governs the loop; no prescribed implementation sequence substitutes for it.
65
155
 
66
- ## Handle discoveries without fragmenting the mission
67
-
68
- During delivery, update the current work when the discovery is necessary and within the existing
69
- contract:
70
-
71
- - a necessary technical detail is solved and delivery continues;
72
- - a missed technical prerequisite is added to the work plan and delivery continues within mandate;
73
- - an incorrect order is corrected when acceptance, ownership, and delivery boundaries remain the
74
- same;
75
- - a unit is split, combined, or has responsibility moved only through targeted `shape-work`;
76
- - a product contract or explicit boundary is changed only by reopening that decision through
77
- `plan-work`;
78
- - an adjacent improvement stays out without separate authority.
79
-
80
- Diagnose technical blockers before forwarding them. Do not create a blocking side issue merely
81
- because a necessary detail was discovered late. Continue independent authorized work during a
82
- partial block. A context or session limit calls for a compact continuation record, not a new
83
- product issue. Changing workflow names is not itself a new approval step.
84
-
85
- No workflow grants tracker write access automatically. Tracker maintenance is allowed only when the
86
- request or project policy grants it, and then only for implementation detail and technical
87
- ordering/readiness inside the authorized set. It does not include changing acceptance, owners,
88
- delivery scope, adding unrequested work, or closing an issue. A ready issue is not authorization.
89
- Without tracker mandate, keep corrections local and report the delta. If it must survive a session,
90
- use the work record's existing sections and add `Pending tracker updates` only when needed; record
91
- the unsynced delta, never a copied plan.
92
-
93
156
  ## Review gate
94
157
 
95
158
  Independent review is required unless the final candidate is a small fix and all of these are true:
@@ -116,7 +179,7 @@ waive required review; do not solicit a waiver. When review is required:
116
179
  callable or returns no ID, stop without calling a wait tool. Never call a wait tool with empty
117
180
  receiver IDs or construct a `/root/...` reviewer label yourself. Use the host's equivalent launch
118
181
  receipt elsewhere. Give the reviewer the outcome, boundaries, ground truth, candidate diff, and
119
- verification evidence — not the implementer's reasoning.
182
+ verification evidence, not the implementer's reasoning.
120
183
  4. Use one general evidence-based reviewer by default, briefed with the finding contract above.
121
184
  Add a focused security or compatibility reviewer
122
185
  only when a distinct risk needs that lens; do not create a panel by default.
@@ -135,24 +198,36 @@ containing the frozen candidate, review scope including unnecessary solution com
135
198
  required ground truth. Self-review never
136
199
  substitutes for required independent review.
137
200
 
138
- ## Resume only when useful
201
+ ## Handle discoveries without fragmenting the mission
139
202
 
140
- Ordinary work needs no workflow record. For work expected to span sessions, keep a compact
141
- `.agent-os/work/<slug>.md`:
203
+ During delivery, update the current work when the discovery is necessary and within the existing
204
+ contract:
142
205
 
143
- ```yaml
144
- ---
145
- agent_os_work: 2
146
- title: <work title>
147
- status: active
148
- next_action: <concrete continuation>
149
- ---
150
- ```
206
+ - a necessary technical detail is solved and delivery continues;
207
+ - a missed technical prerequisite is added to the work plan and delivery continues within mandate;
208
+ - an incorrect order is corrected when acceptance, ownership, and delivery boundaries remain the
209
+ same;
210
+ - a unit is split, combined, or has responsibility moved only through targeted `shape-work`;
211
+ - a product contract or explicit boundary is changed only by reopening that decision through
212
+ `plan-work`;
213
+ - an adjacent improvement stays out without separate authority.
214
+
215
+ Diagnose technical blockers before forwarding them. Do not create a blocking side issue merely
216
+ because a necessary detail was discovered late. Continue independent authorized work during a
217
+ partial block. A context or session limit calls for a compact continuation record, not a new
218
+ product issue. Changing workflow names is not itself a new approval step.
151
219
 
152
- Record only Outcome, Boundaries, Ground truth, Decisions, and Evidence. Use `blocked`, `verified`, or
153
- `delivered` when those words help the next session resume accurately. Add `Pending tracker updates`
154
- only when an authorized or reported tracker delta needs to survive the session. The record is working memory,
155
- not an approval ledger, plan copy, or audit receipt.
220
+ No workflow grants tracker write access automatically; the global policy's tracker rule decides
221
+ what a mandate covers, and a ready issue is not authorization. Without a mandate, keep corrections
222
+ local and report the delta, in the work record's `Pending tracker updates` when it must survive the
223
+ session.
224
+
225
+ ## Resume only when useful
226
+
227
+ Ordinary work needs no workflow record, and a draft pull request is the record for claimed units.
228
+ For work expected to span sessions without a pull request, keep a compact `.agent-os/work/<slug>.md`
229
+ in the [work record format](references/work-records.md). The record is working memory, not an
230
+ approval ledger, plan copy, or audit receipt.
156
231
 
157
232
  ## Batch workers
158
233
 
@@ -160,9 +235,3 @@ A batch task definition supplies the outcome, scope, dependencies, and checks. W
160
235
  assigned task workspace, commit there, and return the head SHA, changed files, checks, and remaining
161
236
  uncertainty to the coordinator. The coordinator owns integration, aggregate review, and aggregate
162
237
  verification.
163
-
164
- ## Stop conditions
165
-
166
- Stop with the exact decision or external action needed when the request does not cover it. Stop a
167
- completion claim when ground truth fails or cannot be exercised. Otherwise continue until the
168
- requested delivery target is reached.
@@ -0,0 +1,20 @@
1
+ # Work records
2
+
3
+ A work record is resumable working memory for delivery that spans sessions without a pull request.
4
+ Ordinary work needs none, and a draft pull request is the record for a claimed unit.
5
+
6
+ Keep it as `.agent-os/work/<slug>.md`:
7
+
8
+ ```yaml
9
+ ---
10
+ agent_os_work: 2
11
+ title: <work title>
12
+ status: active
13
+ next_action: <concrete continuation>
14
+ ---
15
+ ```
16
+
17
+ Record only Outcome, Boundaries, Ground truth, Decisions, and Evidence. Use the status `blocked`,
18
+ `verified`, or `delivered` when that word helps the next session resume accurately. Add a
19
+ `Pending tracker updates` section only when an authorized or reported tracker delta needs to survive
20
+ the session, and record the unsynced delta, never a copied plan.
@@ -0,0 +1,160 @@
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 at any point, or continued into from plan-work when the developer chooses to sketch; no workflow requires it. 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
+ Sketch what people will see and do, so the person can decide it by looking. When is their choice:
10
+ before a spec exists, to find out what they are trying to solve; before delivery, to settle a
11
+ screen; after delivery, to reconsider a screen that was left to it; or not at all. No workflow
12
+ requires this skill. The result is a set of sketches in the medium the project chose and, when a
13
+ spec exists, an `## Interface` section that says for each sketched screen and state what was decided
14
+ and why. A product owner or account manager should be able to
15
+ judge the sketches without a design tool or a checkout; when the person deciding has no checkout,
16
+ give them images.
17
+
18
+ ## Inputs
19
+
20
+ Read the project policy, the intent and spec when they exist, and the request. The policy's
21
+ `## Design` section names how sketches are made (`Sketch with`), where they live (`Sketches live`),
22
+ the widths that matter, and optionally when the project sketches (`When`: `before delivery`,
23
+ `after delivery`, `ask`, or `never`). Then inspect the tokens, the shared components, and the nearest existing
24
+ views. Resolve these facts yourself; ask the person only about what the product should be.
25
+
26
+ ## Medium
27
+
28
+ `Sketch with` is the project's choice, and this skill is not tied to any tool:
29
+
30
+ - `html`: standalone files that need no install and no project dependency, styled from the project's
31
+ real tokens and layout.
32
+ - A component workshop such as Storybook, named with the command that starts it: stories built from
33
+ the project's own components.
34
+ - `image`: pictures only, for a project with nothing to sketch in.
35
+ - Anything else the policy describes, followed as described.
36
+
37
+ When the policy sets no medium, ask once: recommend the workshop when the repository has one, and
38
+ `html` otherwise. Ask where sketches live in the same question, recommending
39
+ `intents/<id>/sketches/`. Offer to save the answer as a `## Design` section in the file that holds
40
+ 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
41
+ workshop's configuration does not pick up the sketch location, tell the person what is missing and
42
+ offer `html` for this run instead of changing the configuration.
43
+
44
+ `Sketches live` is a path in the repository, or `not in the repository`. Images are always available
45
+ as the way a sketch reaches people when its files cannot be committed: keep the working files
46
+ outside the checkout, render the sketch to PNG, and put the images on the pull request or at the
47
+ place the policy or the person names. With neither, ask where they should go.
48
+
49
+ Render with `scripts/render-sketch.mjs`, resolved relative to this `SKILL.md`:
50
+ `node <script> <file or local URL> --out <folder> --widths 390,1280`. It uses a Chrome or Edge already
51
+ on the machine, writes one PNG per width, and lists page errors and overflow. Exit 0 is clean, 1 means
52
+ it rendered with page errors, and 2 means it could not render. Never install a browser for it. When
53
+ you cannot render an image, say so and ask where the files should go.
54
+
55
+ ## Working surface
56
+
57
+ The invocation authorizes sketch files, the made-up data they need, the spec's `## Interface`
58
+ section, plus its `rev` and `## Decision log` when the spec is already accepted, and a policy
59
+ `## Design` section the person agreed to save. It does not
60
+ authorize production components, routes, state, API, or dependency changes. When a sketch needs
61
+ something the design system lacks, build it inside the sketch area and label it as a new proposal;
62
+ never change a shared component to make a sketch work.
63
+
64
+ A spec is open for edits until its review merges. After that, every edit to `## Interface` is a
65
+ reconsideration, including settling an open or deferred decision or adding a missing section: raise
66
+ `rev` and add a `## Decision log` line, as `plan-work` describes. A plan built on the earlier spec
67
+ revision is then stale and is reshaped by `shape-work`.
68
+
69
+ ## Sketch
70
+
71
+ Start from the spec's `## Interface` section: the surfaces it lists per role and the decisions it
72
+ marks open. A surface that is already decided is sketched only when the decision is about to
73
+ change. When the section says `None`, report that there is nothing to sketch and write no files.
74
+ When the section is missing or empty, derive the surfaces from the spec's behavior examples and
75
+ confirm the list with the person before sketching. With no spec yet, sketch from the request and
76
+ write no spec: report what the sketches settled, so `capture-intent` or `plan-work` can start from
77
+ them. A surface marked `Left to delivery:` is sketched only when the person asks, and its decision
78
+ then replaces that entry.
79
+
80
+ - **Real context.** Render each screen inside the layout the person will actually see, such as the
81
+ application shell, navigation, and page frame, not as a lone component on a blank canvas.
82
+ - **The project's own look.** In a workshop, use the project's components and tokens. In any other
83
+ medium, reproduce the look from the real tokens and layout, and state on the sketch that it is an
84
+ approximation. Reuse established patterns, and mark anything new as new so nobody mistakes it for
85
+ existing behavior.
86
+ - **Every state that matters.** Show the states the behavior examples imply, such as empty,
87
+ loading, error, success, no permission, and long content, for each role that sees the screen.
88
+ When layout depends on width, show the widths the policy names, or else common mobile, tablet,
89
+ and desktop widths together with the breakpoints the application itself defines. Show keyboard or
90
+ focus behavior when it is in scope.
91
+ - **Realistic made-up data.** Use plausible data in the product's own language. Never use real
92
+ personal or customer data.
93
+ - **Invented wording.** Text the spec does not give, such as an error message, is a proposal. Mark
94
+ it so in the sketch, list it in `## Interface`, and have the person confirm it with the decision
95
+ it belongs to.
96
+ - **Alternatives for real choices.** When a design question has materially different answers, build
97
+ two or three comparable alternatives with the same data side by side, recommend one, and let the
98
+ person decide. Do not decide a product preference for them.
99
+
100
+ Keep fidelity at what the open decision needs. A structure question needs a rough layout; a
101
+ question about hierarchy or interaction needs the real components and states.
102
+
103
+ ## Show it
104
+
105
+ Make each sketch openable for the person: start the workshop or check that it is running, give the
106
+ path of each HTML file, or show the images. Give the direct address of each sketch. Present each
107
+ open decision in plain language: what the person is looking at, the options, your recommendation,
108
+ and what changes if they choose otherwise. Ask one question at a time.
109
+
110
+ Iterate in the sketches until every listed decision is made or the person explicitly defers it.
111
+ When the person cannot answer now, commit the spec on a branch, with the sketches when they can be
112
+ committed, open a draft pull request that lists each open decision with the address or image of its
113
+ sketch, and wait. Never record your own recommendation as their decision.
114
+
115
+ The one exception is a person who explicitly hands the open decisions to you for this run, for
116
+ example so that work can continue while they are away. Then still build each sketch, choose your
117
+ recommendation, and record it as `Decided: (delegated)` with the reason and the rejected
118
+ alternatives. List every delegated decision in the pull request so the person can overturn it
119
+ there; merging the review is still their acceptance. A person who is only unavailable has delegated
120
+ nothing.
121
+
122
+ ## Record
123
+
124
+ Write the outcome into the spec's `## Interface` section, one bullet per surface: the role and the
125
+ screen or state, then `Decided:` with the decision, its reason, the alternatives rejected, and the
126
+ sketch's location; `Deferred to <who> by <when>:` with what is undecided; or `Open:` with the question
127
+ while it waits on the person. Leave a `Left to delivery:` entry the person did not ask to sketch
128
+ as it is. The text must stand on its own: a reader who can no longer open the
129
+ sketch still knows what was decided.
130
+
131
+ A sketch's location must be reachable by everyone who reads the spec: a repository path, a pull
132
+ request image, or a URL, never a path that exists only on this machine. Until one exists, write that
133
+ the sketch is not yet published, and add the location when it is.
134
+
135
+ The sketches belong with the spec when they can be committed: commit them in the same change as the
136
+ spec when the request or the project's delivery defaults include committing, or when waiting on the
137
+ person as above. `deliver-work` reads the Interface section and its sketches;
138
+ a sketch is never promoted to production code.
139
+
140
+ ## Ground truth
141
+
142
+ The work is done when:
143
+
144
+ - every sketch opens and renders without errors in its medium, with no render or console errors
145
+ where those exist, and every image is legible;
146
+ - every behavior example with a visible result on a sketched surface appears in at least one
147
+ sketch, or the Interface section says why it is not visual;
148
+ - the sketches were inspected visually at the widths and states that matter, by you and by the
149
+ person; and
150
+ - every surface in `## Interface` has a decision or an explicit deferral with an owner.
151
+
152
+ Check these with the tools available, such as `scripts/render-sketch.mjs`, a browser on the sketch
153
+ or the workshop, the workshop's static build, or its test runner. Report a check you could not run instead of claiming it.
154
+
155
+ ## Exit
156
+
157
+ Report which surfaces are settled, which are deferred, and where the sketches are. When this run
158
+ continued from `plan-work`, return to it so the plan can be marked ready. When it started from a
159
+ `shape-work` hand-back, shaping continues from the current spec revision. Planning or sketching
160
+ never starts product implementation.