@sockulags/agent-os 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +65 -41
  2. package/cli/index.mjs +735 -412
  3. package/cli/index.test.mjs +300 -142
  4. package/package.json +32 -31
  5. package/policy.md +6 -6
  6. package/skills/batch-work/SKILL.md +43 -0
  7. package/skills/batch-work/agents/openai.yaml +2 -0
  8. package/skills/batch-work/references/manifest.md +100 -0
  9. package/skills/batch-work/scripts/manifest-hash.mjs +263 -0
  10. package/skills/batch-work/scripts/test-manifest-hash.mjs +132 -0
  11. package/skills/chart-work/SKILL.md +37 -0
  12. package/skills/chart-work/agents/openai.yaml +2 -0
  13. package/skills/chart-work/references/elicitation.md +25 -0
  14. package/skills/chart-work/references/map.md +84 -0
  15. package/skills/chart-work/references/prototypes.md +21 -0
  16. package/skills/deliver-work/SKILL.md +12 -0
  17. package/skills/deliver-work/agents/openai.yaml +2 -0
  18. package/skills/deliver-work/workflow.md +113 -0
  19. package/skills/diagnose-before-fix/SKILL.md +24 -0
  20. package/skills/dispatch-next/SKILL.md +28 -0
  21. package/skills/dispatch-next/agents/openai.yaml +2 -0
  22. package/skills/explain-work/SKILL.md +27 -0
  23. package/skills/explain-work/agents/openai.yaml +2 -0
  24. package/skills/guide-me/SKILL.md +36 -0
  25. package/skills/guide-me/agents/openai.yaml +2 -0
  26. package/skills/init-agent-os/SKILL.md +39 -0
  27. package/skills/init-agent-os/agents/openai.yaml +2 -0
  28. package/skills/init-agent-os/scripts/policy-block.ps1 +87 -87
  29. package/skills/list-skills/SKILL.md +42 -0
  30. package/skills/list-skills/agents/openai.yaml +2 -0
  31. package/skills/notice-lesson/SKILL.md +20 -0
  32. package/skills/proportional-testing/SKILL.md +30 -0
  33. package/skills/proportional-testing/references/strategy.md +75 -0
  34. package/skills/record-lesson/SKILL.md +31 -0
  35. package/skills/record-lesson/agents/openai.yaml +2 -0
  36. package/skills/scope-guard/SKILL.md +21 -0
  37. package/skills/shape-work/SKILL.md +39 -0
  38. package/skills/shape-work/agents/openai.yaml +2 -0
  39. package/skills/shape-work/references/implementation-issues.md +69 -0
  40. package/skills/shape-work/references/mockups.md +23 -0
  41. package/skills/simplifier/SKILL.md +34 -0
  42. package/skills/simplifier/agents/openai.yaml +2 -0
  43. package/skills/simplifier-audit/SKILL.md +28 -0
  44. package/skills/simplifier-audit/agents/openai.yaml +2 -0
  45. package/skills/simplifier-review/SKILL.md +29 -0
  46. package/skills/understand-work/SKILL.md +31 -0
  47. package/skills/understand-work/agents/openai.yaml +2 -0
  48. package/skills/verify-before-done/SKILL.md +29 -0
  49. package/skills/writing-skills/SKILL.md +68 -0
  50. package/skills/writing-skills/agents/openai.yaml +2 -0
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: record-lesson
3
+ description: Records one durable lesson where it applies — the repo's project policy or the global agent-os policy. User-invoked when a session produced a lesson worth keeping, often after notice-lesson offers it. Not for session-specific details or facts the repository already records.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Record lesson
8
+
9
+ Capture the lesson while its evidence is fresh, at the narrowest level where it holds.
10
+
11
+ ## Choose the level
12
+
13
+ - **Repo:** conventions, gotchas, verify commands, and delivery defaults that hold only in this
14
+ repository go to the project policy section that `init-agent-os` seeds.
15
+ - **Global:** lessons about how the developer works that would hold in a repository that has never
16
+ seen them go to `policy.md` in the agent-os repository — the source of truth behind the managed
17
+ blocks. After that edit, remind the developer to run `init-agent-os global` to reinstall the
18
+ blocks. Never edit an installed managed block directly; if the agent-os repository is not
19
+ reachable, stop with the exact lesson text as a handoff.
20
+
21
+ Default to repo level.
22
+
23
+ ## Write the lesson
24
+
25
+ State the smallest rule the next agent can act on, with the observed failure or insight that
26
+ motivates it. Search the target for an existing line with the same meaning: update it rather than
27
+ duplicating, and delete a line the lesson proves wrong. Show the resulting diff.
28
+
29
+ A machine-checkable lesson belongs in a test, script, or validator per the
30
+ [writing-skills enforcement ladder](../writing-skills/SKILL.md); route it there and record at most
31
+ a pointer in policy prose.
@@ -0,0 +1,2 @@
1
+ policy:
2
+ allow_implicit_invocation: false
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: scope-guard
3
+ description: Detects and contains task drift while implementation or review is already in progress. It activates when unrelated work, opportunistic cleanup, extra dependencies, or broadened requirements appear beyond the agreed request or spec, before adding them to the diff. It skips initial scoping and planning, root-cause diagnosis, and verification of work already inside scope.
4
+ ---
5
+
6
+ # Guard scope
7
+
8
+ Keep the active change aligned with the developer's requested outcome.
9
+
10
+ The direct request, accepted spec, and project policy define the boundary. When new work appears,
11
+ classify it:
12
+
13
+ - **Required:** the requested outcome cannot work or be verified without it. Include it and explain
14
+ the dependency.
15
+ - **Adjacent:** useful cleanup or hardening that is not needed now. Leave it out and mention it only
16
+ when it is actionable.
17
+ - **Conflicting:** it changes product behavior, architecture, dependencies, a public interface, or
18
+ delivery risk. Ask the developer before crossing that boundary.
19
+
20
+ Before delivery, inspect the diff for unrelated edits. Preserve pre-existing developer work; scope
21
+ control never grants permission to revert it.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: shape-work
3
+ description: Shapes a bounded idea into implementation-ready issues backed by settled product decisions. User-invoked while material product choices remain. Not for small fixes or work whose outcome is already clear.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # shape-work
8
+
9
+ Produce the smallest set of implementation-ready issues that lets delivery proceed without inventing
10
+ product intent.
11
+
12
+ Read [references/implementation-issues.md](references/implementation-issues.md) before shaping.
13
+
14
+ ## Loop
15
+
16
+ Read the repository, project policy, and any linked chart-work decisions before asking questions.
17
+ Resolve facts from those sources. For each remaining material choice, recommend an answer, explain
18
+ the consequence, and ask only what the developer must decide.
19
+
20
+ Use a diagram or mockup when it makes behavior, layout, states, or boundaries materially easier to
21
+ judge. Frontend proposals follow [references/mockups.md](references/mockups.md). Do not create a
22
+ visualization merely to satisfy the workflow.
23
+
24
+ Deliver the coherent product shape: outcome, boundaries, acceptance examples, affected seams,
25
+ ground truth, settled decisions, and open risks. Then create or reuse its implementation issues on
26
+ the configured planning surface. With no configured tracker, use the local-file fallback in the
27
+ reference. Link dependencies and expose the first claimable delivery frontier.
28
+
29
+ One shape may produce one or several sequential or parallel issues. Multiple issues do not imply
30
+ `batch-work`: each ready issue can be delivered with `deliver-work`, while `batch-work` remains an
31
+ explicit developer choice for integrated parallel execution. Do not start either workflow unless
32
+ the request includes implementation.
33
+
34
+ When shaping started from a chart-work handoff, reconcile the issue links and readiness back into
35
+ the origin handoff and map. A handoff alone is not delivery-ready. Shape-work is complete only when
36
+ every selected branch points to implementation-ready issues or is explicitly parked or rejected.
37
+
38
+ The invocation authorizes planning artifacts, not product code. A deferred product choice remains
39
+ explicit; a reversible implementation choice does not need to become a question.
@@ -0,0 +1,2 @@
1
+ policy:
2
+ allow_implicit_invocation: false
@@ -0,0 +1,69 @@
1
+ # Implementation issues
2
+
3
+ The configured planning surface owns implementation issues. Research, grilling, and prototypes are
4
+ decision evidence; the durable output of shaping is the issue set that a developer can choose to
5
+ run with `deliver-work` or `batch-work`.
6
+
7
+ With no project convention, use:
8
+
9
+ ```text
10
+ planning/<shape-slug>/implementation/<unit-key>.md
11
+ ```
12
+
13
+ When the shape originates from `guide-me`, place the approved plain-language summary as a `## TLDR`
14
+ at the top of the shape's origin document, so the shape opens with what it solves before any
15
+ technical detail.
16
+
17
+ ## Completion invariant
18
+
19
+ A selected product branch is not `delivery-ready`, and shape-work is not complete, until one or
20
+ more implementation issues have been created or reused. A parked or rejected branch needs no issue.
21
+
22
+ Each issue represents one coherent delivery unit: one observable outcome with a reviewable change
23
+ boundary and ground truth that can verify it. The unit may depend on earlier units, but it must not
24
+ contain an unresolved product decision or several separately closable delivery targets.
25
+
26
+ ## Issue contract
27
+
28
+ Identity is `(origin, unit key)`. Search the configured planning surface before creating anything so
29
+ retrying the same shape updates existing issues instead of duplicating them.
30
+
31
+ ```text
32
+ ## Implementation issue
33
+ Origin: <shape-work handoff, planning artifact, or request link>
34
+ Unit key: <stable key>
35
+ Status: ready | blocked
36
+
37
+ ## Outcome
38
+ ## Boundaries
39
+ ## Acceptance
40
+ ## Ground truth
41
+ ## Dependencies
42
+ ## Evidence and settled decisions
43
+ ## Delivery target
44
+ ## Open risks
45
+ ```
46
+
47
+ Use dependencies to distinguish order from execution strategy. An issue is `ready` when its product
48
+ decisions are settled and its dependencies are satisfied; otherwise record the exact blocker. The
49
+ delivery frontier is the set of ready, unblocked implementation issues. Use the planning surface's
50
+ existing status and label conventions rather than inventing a parallel queue vocabulary.
51
+
52
+ ## Routing belongs to the developer
53
+
54
+ Expose the frontier without choosing an execution workflow:
55
+
56
+ - `deliver-work` can deliver any one ready issue, including issues from a larger sequential graph;
57
+ - `batch-work` consumes an existing dependency-mapped issue set only when the developer explicitly
58
+ requests integrated parallel execution;
59
+ - the existence of several issues never invokes or recommends batch-work by itself.
60
+
61
+ Issue creation is a planning write, not implementation authority. Do not edit product code, start a
62
+ batch, merge, deploy, or perform external delivery effects under a shape-work invocation.
63
+
64
+ ## Chart-work reconciliation
65
+
66
+ When the origin is a chart-work handoff, update the handoff and map idempotently after materializing
67
+ the issues. Link every implementation issue, record the ready or blocked frontier, and move the
68
+ branch from shaping to `delivery-ready` only when the completion invariant holds. Preserve
69
+ concurrent map entries and keep decision tickets canonical for their evidence.
@@ -0,0 +1,23 @@
1
+ # Frontend mockups
2
+
3
+ Use a mockup only when seeing the behavior will improve a decision.
4
+
5
+ ## Grounding
6
+
7
+ Inspect the project's tokens, components, and nearby views. Reuse established patterns. When the
8
+ system lacks a needed pattern, label the proposal as new instead of presenting it as existing.
9
+
10
+ ## Fidelity scaling
11
+
12
+ - **Sketch or wireframe:** enough to compare structure, states, or flow.
13
+ - **Renderable proposal:** useful when visual hierarchy or interaction behavior cannot be judged
14
+ from a sketch.
15
+
16
+ Build only the fidelity needed for the open decision.
17
+
18
+ ## Evidence
19
+
20
+ Show the states and viewport sizes relevant to the decision, including keyboard or failure behavior
21
+ when those are in scope. Keep the artifact inspectable and capture the developer's decision and the
22
+ reason behind it. Implementation authority comes from the later implementation request, not from a
23
+ separate mockup approval state.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: simplifier
3
+ description: Simplifies an existing implementation or diff by removing unnecessary code, abstractions, dependencies, and solution layers while preserving required behavior. Use manually when the developer asks to simplify, reduce code, remove over-engineering, or find a more direct solution. Not for code golf, speculative rewrites, initial feature design, or changing product behavior.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Simplifier
8
+
9
+ Make the solution smaller in concepts and code without making it harder to understand.
10
+
11
+ Read the request, affected code, project conventions, current diff, and relevant checks. Establish
12
+ the required behavior before editing. Then simplify in this order:
13
+
14
+ 1. Delete code, options, branches, configuration, and files that serve no current requirement.
15
+ 2. Reuse an existing project helper or pattern instead of maintaining a duplicate.
16
+ 3. Prefer the standard library, native platform behavior, or an already-installed dependency over
17
+ custom machinery.
18
+ 4. Collapse wrappers, layers, and abstractions that add indirection without a second real use.
19
+ 5. Express the remaining behavior directly and readably.
20
+
21
+ Reduce lines when deletion reflects a simpler solution. Do not compress readable code into dense
22
+ expressions merely to lower the line count. A clear loop can be simpler than a clever one-liner.
23
+
24
+ Preserve required behavior, public contracts, validation at trust boundaries, security,
25
+ accessibility, error handling that prevents data loss, and justified performance characteristics.
26
+ Keep tests that protect behavior; remove only tests for behavior that no longer exists or tests
27
+ that duplicate the same signal without value.
28
+
29
+ Stay inside the requested surface. Do not turn a focused simplification into an architectural
30
+ rewrite or introduce a new dependency to save a few lines.
31
+
32
+ After editing, inspect the final diff and run the smallest relevant checks. Report what was removed
33
+ or made more direct, the verification result, and any complexity that remains because it serves a
34
+ real requirement. If the implementation is already simple, leave it unchanged and say so.
@@ -0,0 +1,2 @@
1
+ policy:
2
+ allow_implicit_invocation: false
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: simplifier-audit
3
+ description: Audits an entire repository for unnecessary code, abstractions, dependencies, and solution layers while leaving files unchanged. Use manually when the developer asks for a simplification audit, over-engineering audit, deletion candidates, or a repo-wide search for simpler solutions. Not for applying fixes, code golf, or a general correctness, security, or performance audit.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Audit for simplification
8
+
9
+ Find the repository's strongest opportunities to own less code and fewer solution layers without
10
+ changing required behavior.
11
+
12
+ Inspect the project structure, dependencies, conventions, representative flows, and usages of each
13
+ candidate before reporting it. Look for:
14
+
15
+ - dead or speculative behavior that no current requirement or caller uses;
16
+ - duplicate helpers and parallel implementations;
17
+ - custom code replaced by the standard library, native platform behavior, or an installed
18
+ dependency;
19
+ - wrappers, factories, layers, configuration, and abstractions without real variation;
20
+ - dependencies used for behavior the project or platform already provides.
21
+
22
+ Prefer a short ranked list of high-confidence findings over a large speculative inventory. For each
23
+ finding, name the location, evidence that the complexity is unnecessary, the simpler replacement,
24
+ and any behavior or migration constraint that must be preserved. Do not estimate saved lines unless
25
+ the deletion is directly countable.
26
+
27
+ Do not apply fixes. Do not treat required validation, security, accessibility, data-loss protection,
28
+ justified performance, or useful tests as bloat. If the repository is already simple, say so.
@@ -0,0 +1,2 @@
1
+ policy:
2
+ allow_implicit_invocation: false
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: simplifier-review
3
+ description: Reviews the current implementation diff for unnecessary code, abstractions, dependencies, and solution layers without changing files. It activates during code review, including deliver-work review, when the candidate should be checked for a simpler solution. It skips whole-repository audits, initial design, code golf, and correctness or security review outside complexity caused by the diff.
4
+ ---
5
+
6
+ # Review for simplification
7
+
8
+ Find concrete ways to make the current diff smaller in concepts and code while preserving its
9
+ required behavior.
10
+
11
+ Read the request, diff, affected code, project conventions, and relevant checks. Look for:
12
+
13
+ - code, branches, configuration, options, files, or dependencies with no current requirement;
14
+ - duplicated behavior already provided by the project;
15
+ - custom machinery covered by the standard library, native platform behavior, or an installed
16
+ dependency;
17
+ - wrappers, layers, factories, and abstractions without a second real use;
18
+ - indirect or dense code that has a more direct, readable form.
19
+
20
+ Do not recommend code golf. Do not remove required behavior, public contracts, trust-boundary
21
+ validation, security, accessibility, data-loss protection, justified performance, or tests that
22
+ protect real behavior.
23
+
24
+ Report only supported, actionable findings. For each, name the location, unnecessary complexity,
25
+ and simpler replacement. Rank material deletions and dependency removals first. Do not invent a
26
+ line-savings total. If there is nothing worth changing, report `No simplification findings.`
27
+
28
+ This review is read-only and complements correctness, security, and scope review; it never replaces
29
+ them.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: understand-work
3
+ description: Questions out what the developer actually needs behind a stated wish, one load-bearing question at a time. User-invoked directly or as the questioning stage of guide-me. Not for requests whose goal is already articulated or for facts the repository answers.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Understand work
8
+
9
+ Find the need behind the stated wish. The deliverable is a settled understanding — what the
10
+ developer wants, why now, and what was ruled out — not a plan or a solution.
11
+
12
+ ## Questioning loop
13
+
14
+ Resolve everything the repository, project policy, and conversation already answer before asking
15
+ anything. Then, for each open point that materially changes the goal:
16
+
17
+ - Present the concrete tension with materially different alternatives.
18
+ - Recommend one and name its consequence.
19
+ - Ask one load-bearing question at a time and wait for the answer.
20
+ - Record the choice, the reason, and every ruled-out direction with its reason.
21
+
22
+ Dig beneath the stated wish: what becomes possible when this exists, who feels the difference, and
23
+ why it matters now. Do not treat silence, momentum, or approval of a larger bundle as an answer to
24
+ a specific question. Do not propose a technical solution while the goal is still moving.
25
+
26
+ ## Exit
27
+
28
+ Questioning ends when the developer says it is done or when further answers stop changing the goal.
29
+ Deliver the settled understanding: the goal, its motivation, the choices made with their reasons,
30
+ the ruled-out directions, and the questions that remain open. Under guide-me this feeds the
31
+ plain-language gate in explain-work; standalone, report it directly.
@@ -0,0 +1,2 @@
1
+ policy:
2
+ allow_implicit_invocation: false
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: verify-before-done
3
+ description: Requires fresh execution evidence before an agent states that implemented work is complete, fixed, passing, or ready to ship. It activates at the completion-claim boundary after changes or validation, including requests to mark work done or report test status. It skips diagnosis, planning, speculative review, and status reports that make no completion claim.
4
+ ---
5
+
6
+ # Verify before done
7
+
8
+ Match each material completion claim to fresh evidence from the final candidate.
9
+
10
+ ## Loop
11
+
12
+ Identify the material outcomes the final response will claim. Choose the closest practical checks,
13
+ prefer the project's documented acceptance path, and run them against the final state. Inspect what
14
+ the result actually proves. Fix failures and rerun affected checks.
15
+
16
+ ## Evidence strength
17
+
18
+ Use the strongest practical layer:
19
+
20
+ 1. Acceptance-path observation or end-to-end test.
21
+ 2. Focused automated test that exercises the changed behavior.
22
+ 3. Broader build, lint, typecheck, or suite result.
23
+ 4. Static inspection only when execution is impossible and the limitation is explicit.
24
+
25
+ Passing a weaker layer does not prove a stronger claim. Stale or second-hand results are context, not
26
+ verification.
27
+
28
+ Lead with the outcome and cite the decisive checks compactly. If a material check cannot run, name
29
+ the unverified claim and its impact instead of calling the whole result complete.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: writing-skills
3
+ description: Doctrine for writing and validating agent-os skills, loaded before creating or editing any SKILL.md, description, or eval case in this framework. Not for ordinary coding tasks that do not touch skill files.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Writing skills
8
+
9
+ Write a skill as a compact program for an agent, not a transcript of how one successful run happened.
10
+
11
+ ## Contract
12
+
13
+ Make these elements discoverable without forcing headings when prose is clearer:
14
+
15
+ - **Objective:** the observable result.
16
+ - **Inputs:** the minimum context and tools to inspect.
17
+ - **Working surface:** what the agent may create or change when the request authorizes it.
18
+ - **Boundaries:** product decisions, destructive actions, or external effects the request does not cover.
19
+ - **Ground truth:** the checks or observations that decide success.
20
+ - **Loop:** inspect, act, evaluate, and adapt.
21
+ - **Exit:** the delivered artifact, evidence, or precise blocker.
22
+
23
+ The description says what the skill does, when it applies, and when it does not. Keep execution detail
24
+ in the body.
25
+
26
+ ## Freedom and control
27
+
28
+ - Lock objectives, boundaries, ground truth, and stop conditions. Let the agent choose local tactics.
29
+ - The developer's request is the authority boundary. Do not add a second approval ceremony for work
30
+ the request already asks the agent to perform.
31
+ - Ask the developer only when an unresolved product choice would materially change the outcome.
32
+ - Use prose for judgment, examples for preferred shapes, and scripts for exact transformations.
33
+ - Add ordering only where changing the order causes a demonstrated failure.
34
+ - Keep references one hop away and load them only when the task needs them.
35
+
36
+ ## Enforcement ladder
37
+
38
+ Choose the lowest layer that can reliably stop the failure:
39
+
40
+ 1. **Deterministic invariant → test or lint.** Machine-checkable repository facts belong in an
41
+ executable validator with a red case.
42
+ 2. **Fragile operation → script, hook, or CI.** Put parsing, identity, idempotency, and exact writes
43
+ behind one deterministic operation.
44
+ 3. **Semantic judgment → skill plus eval.** Use prose for reasoning that depends on meaning, then
45
+ test it with trigger cases and blind forward tests.
46
+ 4. **Context or preference → policy.** Record project-specific defaults where the agent reads them
47
+ at decision time.
48
+ 5. **Product intent → developer decision.** Ask only for the unresolved choice, with a recommendation.
49
+
50
+ Start from observed failure evidence and recurrence risk. Do not promote a preference into
51
+ infrastructure or leave a deterministic invariant as a reminder.
52
+
53
+ ## Anti-patterns (delete on sight)
54
+
55
+ - **No-ops**: lines the agent already does by default.
56
+ - **Tactic locks**: prescribing the method when several methods can satisfy the contract.
57
+ - **Duplication**: one source of truth per meaning; link, do not restate.
58
+ - **Sediment**: stale layers from old iterations; prune when editing.
59
+ - **Audit theater**: receipts, states, or logs that do not protect recovery, correctness, or trust.
60
+ - **Authority theater**: asking again for permission already granted by the direct request.
61
+
62
+ ## Definition of done — a skill is not finished until
63
+
64
+ 1. Structural validation passes: folder name equals `name`, frontmatter has `name` + `description`, manual skills (all workflows and this meta-skill) have `disable-model-invocation: true` and `agents/openai.yaml` with `policy.allow_implicit_invocation: false`.
65
+ 2. At least two positive and two negative trigger cases describe the intended boundary.
66
+ 3. Risky or complex behavior has a blind forward test against the observable contract, not the
67
+ preferred reasoning trace.
68
+ 4. Retired skills move to root `deprecated/`, never get deleted, and re-enter `skills/` only through this definition of done again.
@@ -0,0 +1,2 @@
1
+ policy:
2
+ allow_implicit_invocation: false