@outerlayer/cli 0.13.0 → 0.14.1

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 (78) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/agent-setup-CN2HUBEJ.js +26 -0
  3. package/dist/{build-LELVCWHV.js → build-BG2YENGK.js} +2 -2
  4. package/dist/build-info.json +1 -1
  5. package/dist/{builder-UUS4ORDH.js → builder-2D3WSOOY.js} +4 -4
  6. package/dist/{check-63IDCEEV.js → check-SRGR36KI.js} +30 -30
  7. package/dist/{chunk-GI4XXD4I.js → chunk-3NLOVYJQ.js} +4 -4
  8. package/dist/{chunk-C6IV5BV7.js → chunk-4OGPT6I2.js} +11 -11
  9. package/dist/{chunk-DXQ5MHCO.js → chunk-FOJGZYFC.js} +11 -5
  10. package/dist/{chunk-HDTVTA6I.js → chunk-HFKKFTXU.js} +11 -15
  11. package/dist/{chunk-DPKX26LT.js → chunk-HFKQIZXL.js} +9 -6
  12. package/dist/{chunk-6S3H3J6H.js → chunk-JJEGKEFV.js} +5 -7
  13. package/dist/{chunk-P6FX4D43.js → chunk-JYIEHQIF.js} +1 -1
  14. package/dist/{chunk-XJKL4BNU.js → chunk-KFRM23WD.js} +2 -2
  15. package/dist/{chunk-3KTA5UU2.js → chunk-KMDLFI4P.js} +1 -1
  16. package/dist/{chunk-3D4OYFCD.js → chunk-MSASO5O4.js} +42 -6
  17. package/dist/chunk-MTF3PHVZ.js +161 -0
  18. package/dist/{chunk-SVEP7PVH.js → chunk-NHDVD7DU.js} +9 -9
  19. package/dist/{chunk-EFZLAYPE.js → chunk-NPQWKGUA.js} +1 -1
  20. package/dist/{chunk-SFFHGX3G.js → chunk-PQUM37BK.js} +1 -1
  21. package/dist/{chunk-MJXXRX4M.js → chunk-Q2UK3C4P.js} +2 -2
  22. package/dist/{chunk-MZN7AQOB.js → chunk-RBKIH5ST.js} +11 -11
  23. package/dist/{chunk-TOPDNXHZ.js → chunk-SMHOCDCI.js} +4 -4
  24. package/dist/{chunk-P4MM66C6.js → chunk-SWHQ4LUM.js} +4 -4
  25. package/dist/{agent-setup-QE6PSCEZ.js → chunk-SXWS25JC.js} +6 -19
  26. package/dist/{chunk-CNFVHDHG.js → chunk-WUYTWNMA.js} +3 -1
  27. package/dist/{chunk-R7OQTKWT.js → chunk-XCK2YAY5.js} +12 -3
  28. package/dist/{chunk-4QVZCVWT.js → chunk-YDSMROTB.js} +1 -1
  29. package/dist/{chunk-TCIW27FM.js → chunk-ZA5CHAFY.js} +1 -1
  30. package/dist/{cli-WSBIAVZU.js → cli-UW2H3UUW.js} +79 -62
  31. package/dist/{command-N7BAB4XJ.js → command-5LD7G2QQ.js} +22 -22
  32. package/dist/{connect-cmd-FGYRLLXL.js → connect-cmd-JUAW6MU4.js} +2 -2
  33. package/dist/{context-adopt-B3PWGFHL.js → context-adopt-PJUMW2EZ.js} +5 -5
  34. package/dist/{context-materialize-7S6NLLRO.js → context-materialize-FDHYKNDT.js} +5 -5
  35. package/dist/{docker-BZ55BMBJ.js → docker-4J77Q2BF.js} +5 -5
  36. package/dist/{doctor-3H25Q7WT.js → doctor-H7REBSLQ.js} +24 -24
  37. package/dist/{emit-artifact-cmd-IQCRXOH7.js → emit-artifact-cmd-FOGNJXVR.js} +15 -18
  38. package/dist/{emit-cmd-KDSM5VAO.js → emit-cmd-ZEYWLC2C.js} +3 -2
  39. package/dist/{emit-criteria-cmd-EYUXME26.js → emit-criteria-cmd-HBP6XS5C.js} +5 -8
  40. package/dist/{emit-finding-cmd-P4RKBPBB.js → emit-finding-cmd-DLI4MKMN.js} +5 -8
  41. package/dist/{emit-result-cmd-6XYENU6H.js → emit-result-cmd-MUSL7GQA.js} +9 -12
  42. package/dist/{hook-fast-PXWKQPN6.js → hook-fast-WYQD6D7T.js} +1 -1
  43. package/dist/{import-capture-cmd-2BKM5I2N.js → import-capture-cmd-6QVCOIHK.js} +8 -11
  44. package/dist/{import-ruler-cmd-IXR7YK47.js → import-ruler-cmd-KLRGRBCP.js} +5 -8
  45. package/dist/index.js +3 -3
  46. package/dist/{init-2LWVS4AH.js → init-NTXA3SN7.js} +23 -23
  47. package/dist/{init-ZL7ORPTF.js → init-UBXK6MF7.js} +23 -23
  48. package/dist/{init-cmd-JXOBCOIB.js → init-cmd-NARDUPIG.js} +13 -8
  49. package/dist/init-update-O5YYFGF4.js +165 -0
  50. package/dist/{loop-XOAE6ZIY.js → loop-SW2M5VDD.js} +30 -30
  51. package/dist/{machine-G6PY2J2J.js → machine-U66FKVDP.js} +21 -21
  52. package/dist/mcp-install-cmd-FDTPQQS6.js +9 -0
  53. package/dist/{runner-key-TDTLNAKJ.js → runner-key-3JSMDRJA.js} +23 -23
  54. package/dist/{session-sender-XVGZFWRK.js → session-sender-4M247XSV.js} +5 -5
  55. package/dist/{starter-pack-B7JPGEDO.js → starter-pack-IB4UUIX3.js} +2 -2
  56. package/dist/{status-MRTPG34B.js → status-STZYPU3W.js} +26 -26
  57. package/dist/{sync-cmd-UBUZMMDN.js → sync-cmd-UWD5JOFU.js} +4 -4
  58. package/dist/{watch-STNPEWD6.js → watch-DBNB7R6X.js} +4 -4
  59. package/dist/{work-claim-cmd-CWGYEIJE.js → work-claim-cmd-LY4U6QHN.js} +11 -11
  60. package/dist/{work-cmd-X7NMJDFL.js → work-cmd-RVRQ32EH.js} +4 -4
  61. package/dist/{work-comment-cmd-FI2TMAYQ.js → work-comment-cmd-FFUM4TJU.js} +7 -10
  62. package/dist/{work-open-pr-cmd-OVHJ5I5H.js → work-open-pr-cmd-HLDWP4T2.js} +7 -10
  63. package/dist/{work-pr-cmd-Y5TDMQ4O.js → work-pr-cmd-L77K32WK.js} +4 -4
  64. package/package.json +1 -1
  65. package/skill-pack/maintained/emitting-evidence/SKILL.md +8 -2
  66. package/skill-pack/shipped.json +75 -0
  67. package/skill-pack/template/build/SKILL.md +8 -3
  68. package/skill-pack/template/build/references/release.md +42 -11
  69. package/skill-pack/template/build/references/review-loop.md +1 -1
  70. package/skill-pack/template/build/scripts/criterion-citations.mjs +184 -0
  71. package/skill-pack/template/spec/SKILL.md +33 -22
  72. package/skill-pack/template/writing-specs/SKILL.md +36 -3
  73. package/skill-pack/template/writing-specs/references/agents-snippet.md +57 -0
  74. package/skill-pack/template/writing-tests/SKILL.md +117 -0
  75. package/skill-pack/validators/acceptance-criteria.yaml +35 -0
  76. package/dist/mcp-install-cmd-VXVIH7PH.js +0 -9
  77. package/dist/{chunk-NX57IBNK.js → chunk-4NPZVMJU.js} +2 -2
  78. package/dist/{chunk-3FMPZPJQ.js → chunk-R7PF5OOU.js} +1 -1
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: writing-specs
3
- description: How to write a feature spec: problem framing, goals and non-goals, assumptions, and acceptance criteria in Given/When/Then, before implementation begins. Use when asked to "write a spec", "spec this out", "write a PRD", "draft acceptance criteria", or when shaping the issue for a new feature.
3
+ description: Describes how to write a feature spec before implementation begins - problem framing, goals and non-goals, assumptions, acceptance criteria in Given/When/Then, and the docs and structural verdicts. Use when asked to "write a spec", "spec this out", "write a PRD", "draft acceptance criteria", or when shaping the issue for a new feature.
4
4
  ---
5
5
 
6
6
  # Writing Specs
@@ -10,8 +10,9 @@ in the issue body: one clean spec, edited in place as the shape is agreed,
10
10
  never a trail of amendment comments. Its acceptance criteria sit under an
11
11
  `## Acceptance criteria` heading. Each criterion has an id, and an id is any
12
12
  stable label the team chooses, such as `LOGIN-01` or `AC-12-03`. Pick a scheme
13
- once and keep to it. Planning scratch is local and disposable. Nothing durable
14
- belongs there.
13
+ once and keep to it. The body also records the docs and structural verdicts,
14
+ each with a one-line reason. Planning scratch is local and disposable. Nothing
15
+ durable belongs there.
15
16
 
16
17
  ## Lead with a summary block
17
18
 
@@ -104,6 +105,30 @@ implementing. Never write them by reading the finished implementation back.
104
105
  changes. The proof shows the running page, never a component render. The
105
106
  emitting-evidence skill covers capture.
106
107
 
108
+ ## The two verdicts
109
+
110
+ Every feature spec declares two verdicts, each with a one-line reason. They
111
+ are decided when the spec is written, and decided again from the finished
112
+ change before the pull request opens.
113
+
114
+ - **Docs.** `docs-required` when the change alters what a user sees or does.
115
+ Judge it against the repository's own docs: a `README.md`, a `docs/`
116
+ directory, a docs site. A new capability with no page yet is
117
+ `docs-required` too, and its criterion names the page to add. That no page
118
+ covers it is a reason to write one, not a reason to skip. Generated
119
+ reference, such as an API spec rendered as pages, is not a docs surface. A
120
+ new endpoint still needs a guide when using it takes a step the reference
121
+ cannot show, such as a credential to create or calls to make in order. When
122
+ required, the spec carries a criterion naming the page and its proof form.
123
+ - **Structural.** `structural-required` when the change adds a package or an
124
+ app, introduces a seam between components, or moves data across a
125
+ boundary. When in doubt, say required: approval is where it gets argued
126
+ down. A structural change is worth planning before it is implemented.
127
+
128
+ A verdict reversed when the change is finished is not a fault. The gap
129
+ between the two calls is the useful signal, so state it rather than quietly
130
+ adopting the later one.
131
+
107
132
  ## Honest limits
108
133
 
109
134
  A criterion may carry prose admitting what it does not cover. Useful idioms:
@@ -132,3 +157,11 @@ the one most often skipped. Re-reading your own spec does not satisfy it. Run it
132
157
  against the issue body as published, not the draft in the working tree. A spec
133
158
  whose design lives in links the reader cannot follow fails this test, and that
134
159
  failure is invisible to whoever wrote it.
160
+
161
+ ## Writing rules for the instructions file
162
+
163
+ The reader test holds a spec to the rules in
164
+ [references/agents-snippet.md](references/agents-snippet.md): write for a
165
+ reader who was not in the session, and keep session history out of code
166
+ comments. Paste that file into the repository's instructions file, such as
167
+ `AGENTS.md`, to hold every agent's prose to the same rules.
@@ -0,0 +1,57 @@
1
+ <!-- outerlayer:writing-rules -->
2
+ ## Write for a reader who was not in the session
3
+
4
+ This applies to anything a person reads: replies, commit messages, pull
5
+ request titles and bodies, issue bodies, review comments, docs and code
6
+ comments.
7
+
8
+ The reader test: someone who knows this codebase but has never seen this
9
+ session, the skill that ran it, or any label coined while working. If they
10
+ would have to ask what a word means, explain it or cut it. Names made up
11
+ during a session never appear in anything published: reviewer names, round
12
+ labels, finding ids like C1 or N3, stage names, internal agent roles.
13
+ Describe the thing instead.
14
+
15
+ Lead with the outcome. One sentence: what changed, or what you found. Then
16
+ only the detail that changes what the reader does next. Keep exact paths,
17
+ numbers, identifiers and caveats. Cut the packaging around them.
18
+
19
+ A sentence carries one idea and stays under about 20 words. A sentence with
20
+ three clauses becomes three sentences. Break paragraphs often.
21
+
22
+ Say what you mean. Use the literal phrase, not a metaphor or a flourish:
23
+ "a parameter worth varying", not "a dial worth turning". Use everyday words:
24
+ "use", not "leverage"; "start", not "initiate"; "so", not "thereby".
25
+
26
+ Session telemetry, review-round tables, agent counts and raw command output
27
+ belong in the report to the person who asked. They never go in a pull
28
+ request or issue body.
29
+
30
+ Before posting, read the text as that outsider. If they would stall on a
31
+ term or a sentence, rewrite it.
32
+
33
+ ## Code comments
34
+
35
+ A comment states a present-tense fact the code cannot express: a why, a
36
+ constraint, a gotcha or an invariant. Everything else is noise that leaks
37
+ the history of how the code was written.
38
+
39
+ Never put these in a comment, a test title or a user-facing string:
40
+
41
+ - Change narration: "previously…", "now uses…", "removed X", "renamed from
42
+ Y". Version control holds what changed. The comment says why the current
43
+ code is the way it is.
44
+ - Issue, pull request or ticket numbers. They mean nothing to a reader
45
+ without access. If the context matters, restate its substance.
46
+ - Project codenames, phase labels and spec section references. Describe
47
+ the behavior instead.
48
+ - Labels from a working session: reviewer names, round labels, finding ids.
49
+
50
+ One exception: an acceptance-criterion id may sit in a comment directly
51
+ above the test that proves it, so a reader can find the test from the
52
+ criterion. Never put it in the test's title.
53
+
54
+ Keep comments that document constraints, invariants, footguns, security
55
+ posture and real rationale, and do not weaken them when editing nearby. If
56
+ a comment narrates a change but carries a real reason, rewrite it as
57
+ present-tense rationale rather than deleting it.
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: writing-tests
3
+ description: Writes and reviews tests that catch a specific bug - assertion strength, the seam each test binds at, binding a test to an acceptance-criterion id, and checking by mutation that a test would notice a break. Use when writing or changing any test, when binding a test to a criterion id, when reviewing whether a test proves anything, or when a mutation tool reports survivors.
4
+ ---
5
+
6
+ # Writing tests
7
+
8
+ A test earns its place by catching a specific bug. Before keeping one, ask:
9
+ what is the smallest change to production code that would still pass this
10
+ test? If the answer is "almost anything", the test checks wiring, not
11
+ behavior. Strengthen it or delete it.
12
+
13
+ The rules here hold in any language and any test framework. The examples
14
+ use TypeScript with a Jest-style `expect`. Read each one as the equivalent
15
+ assertion in the repository's own framework.
16
+
17
+ ## Assertion strength
18
+
19
+ These pass for almost any implementation, so they are never the only proof
20
+ in a test:
21
+
22
+ - An "is defined" or "is not null" check passes for any value at all.
23
+ - A truthy or falsy check. Assert the exact value instead.
24
+ - "Was called" proves it ran, not what it ran with.
25
+ - "Does not throw" on its own. Assert the return value too.
26
+
27
+ Negative forms state a real expectation and are fine: "was never called",
28
+ "is absent". Prefer:
29
+
30
+ - Exact equality on the actual return value or the whole object shape.
31
+ - "Called with" and the full argument shape.
32
+ - Positional equality on lists. It catches reordering and off-by-one.
33
+ - A negative assertion that pins an injection path shut, such as
34
+ `expect(query).not.toContain(rawUserValue)`.
35
+ - On an error path, the message or status a user or operator sees, not only
36
+ that something failed.
37
+
38
+ Do not pin brittle internals: exact log strings, incidental call counts, the
39
+ order of unrelated calls. Those break on refactors without catching bugs.
40
+
41
+ ## Choose the seam
42
+
43
+ Name the seam before writing the test: the boundary the test drives the code
44
+ through.
45
+
46
+ - Business behavior is proven below the user interface, in the service or
47
+ the pure function.
48
+ - A user interface contract is proven at the component level, through what
49
+ the user sees and does.
50
+ - Behavior that lives in the data store, such as an access rule, a trigger
51
+ or the real shape of a query, is proven against the real store.
52
+ - A criterion that spans two seams gets two tests, one at each.
53
+
54
+ Check two blind spots every time:
55
+
56
+ - **Fake-seam blindness.** A fake that returns every field whatever the query
57
+ asked for proves nothing about the query. Pin the contract: assert the
58
+ request the code sent, make the fake honor what was asked for, or test
59
+ against the real dependency.
60
+ - **Structural pinning.** "X is never called for Y" needs a spy that is
61
+ present and asserts zero calls. A missing fake skips silently, exactly like
62
+ the real skip.
63
+
64
+ A field that crosses a module or package boundary needs an assertion at every
65
+ hop: writer, relay, reader. Pinning only the ends leaves the middle free to
66
+ drop it.
67
+
68
+ ## Bind a test to its criterion
69
+
70
+ When a spec has acceptance criteria with ids, the test that proves a
71
+ criterion carries the id in a comment directly above the test, never in its
72
+ title:
73
+
74
+ ```ts
75
+ // proves LOGIN-03
76
+ it("refuses a password reset for an unknown address without saying so", () => {
77
+ // ...
78
+ });
79
+ ```
80
+
81
+ The title says what the test proves to someone reading a failure. The
82
+ comment lets a reader, or a script, find the test from the criterion. Never
83
+ put a criterion id in a comment that is not that binding, because a reader
84
+ will take it as one.
85
+
86
+ Write the test from the criterion's words, at the seam it names, before the
87
+ implementation exists. Run it and read the failure. It must fail because the
88
+ behavior is absent, not because of a typo or a missing import.
89
+
90
+ A criterion with a proof form such as `(proof: screenshot)` is proven by the
91
+ evidence a reviewer sees, not by a test. It may still have one.
92
+
93
+ ## Mutation: prove the test would notice
94
+
95
+ A green suite proves the tests run, not that they would catch a bug. Check
96
+ the code the change adds or alters.
97
+
98
+ **By hand.** For every condition, guard, limit and assignment the change
99
+ adds, break it: invert it, widen it, drop half of an `and`, ignore the field.
100
+ Run the one test file that should catch it. If nothing fails, write the
101
+ assertion that would. Then take each criterion and break the production code
102
+ it describes. Its test must fail. A test bound to a criterion that survives
103
+ the break is not coverage.
104
+
105
+ **With a tool.** Mutation testing is optional. Where the repository has a
106
+ mutation tool, run it over the changed lines only. Each mutant that survives
107
+ is a test still to write, not a score to accept. Two mutants are equivalent
108
+ only when no observable output can differ; say why when you claim it. Hand
109
+ breaks still matter for files the tool does not mutate, such as SQL, shell
110
+ scripts, markup and configuration.
111
+
112
+ ## The repository's own rules
113
+
114
+ The instructions file may name test commands, required checks, mocking rules
115
+ or coverage thresholds. Those come first where they are stricter than this
116
+ skill. Add them here when they are the team's standard, because this file is
117
+ the team's to edit.
@@ -0,0 +1,35 @@
1
+ # Yours to edit. Written once by outerlayer init; never overwritten.
2
+ #
3
+ # How to satisfy this row: once the pull request is open, have an agent that
4
+ # did not write the change judge each recorded acceptance criterion against
5
+ # the test that cites it. Write its verdicts as an .html file and emit it as
6
+ # a report artifact bound to this check:
7
+ # outerlayer emit artifact criteria.html --for acceptance-criteria --caption "Each criterion judged against the test that cites it"
8
+ # Then run `outerlayer sync`, and copy the report's deep link from the pull
9
+ # request's evidence comment. The link can take up to a minute to appear
10
+ # after the sync. If it is not there yet, wait a minute and read the comment
11
+ # again; do not give up after one look. Never build the link by hand, and
12
+ # never link a pull request comment: a comment can be edited or deleted later.
13
+ #
14
+ # Then record the verdict once, with that link as its proof:
15
+ # outerlayer emit acceptance-criteria --item "$OUTERLAYER_WORK" --result pass --link <the report's deep link>
16
+ # Use --result pass only when the judge found every criterion it judged met.
17
+ # Use --result fail when it found one unmet. A criterion whose proof is a
18
+ # screenshot, video or other artifact is not judged here: its own criterion
19
+ # row asks for that artifact.
20
+ # When there is no criterion to judge, nothing is judged and nothing is
21
+ # recorded, so the row never reads as passed.
22
+ # Until a result is recorded, the row reads "not proven". While a host still
23
+ # holds the work item's claim, it reads as waiting.
24
+ #
25
+ # `where: ci` means the result comes from `outerlayer emit`: OuterLayer runs
26
+ # nothing for this check, and a result from a session, CI or a person counts.
27
+ # The row claims only what that proves: a criteria judge's result is
28
+ # recorded, not that the criteria hold.
29
+ id: acceptance-criteria
30
+ kind: validation
31
+ row: "A criteria judge result is recorded for this change"
32
+ level: warn
33
+ run:
34
+ where: ci
35
+ emit: acceptance-criteria
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'node:module';
3
- export { DEFAULT_MCP_COMMAND, DOCS_MCP_SERVER_NAME, McpInstallError, addDocsMcpEntryIfAbsent, addStdioMcpEntryIfAbsent, buildServerEntry, buildStdioServerEntry, defaultMcpUrl, handleMcpInstallError, runMcpInstall } from './chunk-R7OQTKWT.js';
4
- import './chunk-YRYMNBGQ.js';
5
- import './chunk-EABW6AJQ.js';
6
- import './chunk-VNVZDWO3.js';
7
- import './chunk-Z5GEFMRW.js';
8
-
9
- createRequire(import.meta.url);
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { BUILDKIT_IMAGE } from './chunk-CX22S5BA.js';
4
- import { compareVersions } from './chunk-JXYVA45C.js';
5
3
  import { parseSize } from './chunk-7RQ73DLO.js';
6
4
  import { JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_PORT, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-4Q7OMKAT.js';
5
+ import { BUILDKIT_IMAGE } from './chunk-CX22S5BA.js';
6
+ import { compareVersions } from './chunk-JXYVA45C.js';
7
7
  import { runnerDir } from './chunk-ZM2IMMYN.js';
8
8
  import { createHash } from 'crypto';
9
9
  import { realpathSync } from 'fs';
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { startTimeOf, claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-N5FOE5PS.js';
4
3
  import { RecipeError, locateRecipe, readRecipe, assertBuildable, writeSanitizedRecipe, classifyProperties, SANITIZED_NAME } from './chunk-QOZKPLVJ.js';
4
+ import { startTimeOf, claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-N5FOE5PS.js';
5
5
  import { CLAUDE_CODE_VERSION, NODE_IMAGE, DEFAULT_BASE_IMAGE, TINI_VERSION, GH_VERSION, GH_SHA256, TINI_SHA256 } from './chunk-CX22S5BA.js';
6
6
  import { withGitConfig, tokenHeader } from './chunk-BYT5O5RV.js';
7
7
  import { RUNNER_DIR_MODE, repoCacheDir, imagesDir, attemptStamp, runnerDir, rootfsPathFor, RUNNER_FILE_MODE } from './chunk-ZM2IMMYN.js';