@punks/cli 3.1.9 → 3.1.10

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.
@@ -0,0 +1,69 @@
1
+ # Glossary - Writing Great Skills
2
+
3
+ ## Predictability
4
+
5
+ The degree to which a skill makes the agent follow the same process on every run. The output may vary; the behavior should not.
6
+
7
+ ## Model-Invoked
8
+
9
+ A skill with a `description`, visible to the agent for autonomous use. It pays context load.
10
+
11
+ ## User-Invoked
12
+
13
+ A skill with `disable-model-invocation: true`. It is reached by the human, not by autonomous discovery. It pays cognitive load.
14
+
15
+ ## Description
16
+
17
+ The model-facing trigger for a model-invoked skill. It should describe branches that should cause invocation.
18
+
19
+ ## Context Load
20
+
21
+ The permanent attention and token cost a model-invoked skill imposes through its description.
22
+
23
+ ## Cognitive Load
24
+
25
+ The cost the human pays to remember and invoke user-invoked skills.
26
+
27
+ ## Branch
28
+
29
+ A distinct way a skill can be used.
30
+
31
+ ## Information Hierarchy
32
+
33
+ The ordering of skill material by how immediately the agent needs it: steps, inline reference, disclosed reference.
34
+
35
+ ## Steps
36
+
37
+ Ordered actions the agent performs. Each step needs a completion criterion.
38
+
39
+ ## Completion Criterion
40
+
41
+ The checkable condition that says a step is done.
42
+
43
+ ## Reference
44
+
45
+ Definitions, rules, caveats, and examples the agent consults while running a skill.
46
+
47
+ ## Progressive Disclosure
48
+
49
+ Moving branch-specific reference out of `SKILL.md` behind a clear pointer.
50
+
51
+ ## Leading Word
52
+
53
+ A compact, pretrained concept that anchors behavior and invocation.
54
+
55
+ ## Single Source of Truth
56
+
57
+ One authoritative home for one behavior or meaning.
58
+
59
+ ## Duplication
60
+
61
+ The same behavior or meaning repeated in multiple places.
62
+
63
+ ## No-op
64
+
65
+ An instruction that does not change behavior versus the agent default.
66
+
67
+ ## Sediment
68
+
69
+ Stale layers that remain because adding feels safer than removing.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: writing-great-skills
3
+ description: Deprecated compatibility reference for legacy manifests that write and edit skills. Prefer writing-for-agents for new work.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Writing Great Skills
8
+
9
+ Deprecated compatibility skill. New manifests use `writing-for-agents`.
10
+
11
+ A skill wrangles predictability out of a stochastic system. Predictability means the agent follows the same process every run, not that it produces the same output.
12
+
13
+ Bold terms are defined in [GLOSSARY.md](GLOSSARY.md).
14
+
15
+ ## Invocation
16
+
17
+ Two invocation modes trade different costs:
18
+
19
+ - **Model-invoked**: keep a `description` so the agent can discover and use the skill. This spends **context load** every turn.
20
+ - **User-invoked**: set `disable-model-invocation: true`; the human must remember and request it. This spends **cognitive load**, not context.
21
+
22
+ Use model invocation only when the agent or another skill must reach the skill on its own. Use user invocation when human judgement should be the router.
23
+
24
+ ## Description
25
+
26
+ A model-invoked **description** must state what triggers the skill.
27
+
28
+ - Front-load the leading word users and other skills will actually use.
29
+ - Keep one trigger per branch.
30
+ - Remove identity prose already obvious from the skill body.
31
+ - Prune synonyms that describe the same branch.
32
+
33
+ ## Information Hierarchy
34
+
35
+ Put material where the agent needs it:
36
+
37
+ 1. **Steps** in `SKILL.md`: ordered actions with checkable completion criteria.
38
+ 2. **Reference** in `SKILL.md`: rules or definitions every branch needs.
39
+ 3. Disclosed **reference**: linked files loaded only when a branch needs them.
40
+
41
+ Inline what every branch needs. Disclose what only some branches need. If a required pointer is missed in practice, sharpen the pointer before inlining the whole reference.
42
+
43
+ ## Splitting
44
+
45
+ Split skills only when the split earns its cost:
46
+
47
+ - By invocation: create a model-invoked skill when a distinct leading word should trigger it independently.
48
+ - By sequence: split steps when visible later steps cause premature completion of the current step.
49
+
50
+ Do not split merely for tidiness. Do not merge separate invocation branches just to reduce file count.
51
+
52
+ ## Pruning
53
+
54
+ Keep each behavior in one source of truth.
55
+
56
+ Check each sentence:
57
+
58
+ - Does it change agent behavior?
59
+ - Is it still relevant?
60
+ - Is it duplicated elsewhere?
61
+ - Is a stronger leading word enough?
62
+
63
+ Delete no-ops instead of polishing them.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Matt Pocock
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: effect-service-design
3
+ description: Design Effect services. Use when designing a new Effect service module or auditing an existing codebase for service, Layer, and composition improvements.
4
+ ---
5
+
6
+ # Effect Service Design
7
+
8
+ Treat a service as an **authority seam**: a cohesive capability whose requirements should propagate through Effect context. An **Effect service module** owns the service contract, construction, production Layer, and any honest reusable test implementation that belong to the same capability.
9
+
10
+ ## 1. Establish the local rules
11
+
12
+ Read the nearest `AGENTS.md`, architecture docs, coding standards, project Effect guidance, pinned Effect version/source, and relevant vendored examples. Prefer current project-compatible patterns over remembered APIs.
13
+
14
+ **Complete when:** the governing files and pinned source examples have been read and recorded for use in later decisions.
15
+
16
+ ## 2. Select the branch
17
+
18
+ - **Design branch:** for a new service or a focused redesign, bound the capability, trace one caller-visible operation to every effect, then continue below.
19
+ - **Audit branch:** for a codebase, package, feature slice, or diff, read and follow [`references/AUDIT.md`](references/AUDIT.md), applying the rules below to every candidate it finds.
20
+
21
+ **Complete when:** one branch is selected, its scope is bounded, and the caller-visible operations in scope are named.
22
+
23
+ ## 3. Apply the service test
24
+
25
+ A real service owns at least one meaningful capability:
26
+
27
+ - authority over persistence, credentials, external I/O, runtime resources, configuration, time, randomness, or lifecycle;
28
+ - state or behavior with real production and test/runtime variation;
29
+ - enough implementation complexity that deleting the module would spread complexity into callers.
30
+
31
+ Prefer an existing Effect service such as `Clock`, `Crypto`, `Random`, `Config`, `HttpClient`, `FileSystem`, or `Path` before defining an application service.
32
+
33
+ Keep these as values or pure modules:
34
+
35
+ - parsed domain inputs and per-call request data;
36
+ - deterministic calculations, projections, parsers, and constructors;
37
+ - options that select policy for one call;
38
+ - framework values confined to their adapter;
39
+ - wrappers that only rename or forward another service.
40
+
41
+ A test-only desire to inject a value is not enough. The seam must represent real ownership or variability in production.
42
+
43
+ **Complete when:** the deletion test and the existing-service/adapter audit both support either “service” or “value,” and the rejected alternative is stated plainly.
44
+
45
+ ## 4. Place the authority seam
46
+
47
+ - Domain modules stay pure.
48
+ - A concrete adapter owns its technology-specific `make` and `layer`.
49
+ - Composition roots select and provide concrete Layers. They do not become reusable policy modules.
50
+ - Runtime bindings are yielded in the composition root or owning adapter, then hidden behind application/domain types.
51
+
52
+ Yield stable dependencies while building the Layer and close over them in service methods. Yield request-, fiber-, or operation-scoped context inside the method that uses it. Let requirements propagate until the module that truthfully chooses an implementation provides them.
53
+
54
+ Passing an external library's constructor options remains correct after the owning adapter has yielded the relevant runtime capability. React props, request values, domain inputs, and framework constructors are not Effect dependency injection.
55
+
56
+ **Complete when:** dependencies point inward, raw technology types stop at adapters, and no inner caller chooses a concrete implementation it does not own.
57
+
58
+ ## 5. Shape the Effect service module
59
+
60
+ Follow the project's established equivalent of this shape:
61
+
62
+ ```ts
63
+ export interface Interface {
64
+ readonly operation: (input: Input) => Effect.Effect<Output, OperationError>
65
+ }
66
+
67
+ export class Service extends Context.Service<Service, Interface>()(
68
+ "@app/Capability",
69
+ ) {}
70
+
71
+ export const make: Effect.Effect<
72
+ Service["Service"],
73
+ never,
74
+ Dependency.Service
75
+ > = Effect.gen(function* () {
76
+ const dependency = yield* Dependency.Service
77
+
78
+ const operation = Effect.fn("Capability.operation")(function* (input: Input) {
79
+ return yield* dependency.operation(input)
80
+ })
81
+
82
+ return Service.of({ operation })
83
+ })
84
+
85
+ export const layerWithoutDependencies = Layer.effect(Service, make)
86
+
87
+ export const layer = layerWithoutDependencies.pipe(
88
+ Layer.provide([Dependency.layer]),
89
+ )
90
+
91
+ export const layerTest = Layer.succeed(
92
+ Service,
93
+ Service.of({
94
+ operation: (_input) => Effect.succeed(testOutput),
95
+ }),
96
+ )
97
+ ```
98
+
99
+ `layerWithoutDependencies` preserves the service's requirements for composition. `layer` is the ready production assembly and provides the concrete dependency Layers. `layerTest` illustrates a complete static substitute; export it only when that behavior is reusable and honest. Use `layerMemory` instead when an in-memory implementation faithfully preserves the observable contract.
100
+
101
+ Use `Layer.succeed` for an already-built value, `Layer.sync` for lazy synchronous construction, and `Layer.effect` for effectful acquisition. Preserve an established compatible naming convention when renaming would add churn without clarity.
102
+
103
+ Keep interfaces narrow and domain-shaped. Use named `Effect.fn` methods, typed expected errors, and yielded dependencies. Add options, methods, services, and combinators only when each hides enough complexity to earn its place.
104
+
105
+ **Complete when:** the tag, interface, `make`, dependency-preserving Layer, production `layer`, errors, methods, and test strategy have one clear owner, and every exported symbol is required by a caller.
106
+
107
+ ## 6. Choose test Layers honestly
108
+
109
+ - Use `Layer.succeed` for a complete static implementation.
110
+ - Add `layerTest` plus a test-control service when reusable state, failure injection, or observation is part of a real seam.
111
+ - Name a Layer `layerMemory` only when it faithfully implements the service's observable contract in memory.
112
+ - Prefer a real local substitute when persistence, transactions, serialization, or protocol behavior matters.
113
+ - Keep a tiny one-off fake in its test when promoting it would create production surface solely for that test.
114
+
115
+ Tests cross the same service interface as production callers. When a reusable control service exists, back its production tag and test-control tag with the same object. Partial objects with “unused” methods that die are focused test fixtures, not reusable in-memory adapters.
116
+
117
+ **Complete when:** each test implementation is complete for its advertised name, tests observe outcomes through the public interface, and no new seam exists only to support mocking.
118
+
119
+ ## 7. Finish the selected branch
120
+
121
+ - **Design branch:** record the service-or-value decision and its evidence. When implementation is requested, create or refactor the module, update composition roots and tests, and run the repository's required checks.
122
+ - **Audit branch:** produce prioritized findings with file/line or symbol evidence, target module shapes, composition and test impact, and explicit “keep” decisions.
123
+
124
+ **Complete when:** the designed capability has an explicit disposition and validated implementation when requested, or every audit inventory row has a disposition; validation passes or every failure is reported.
@@ -0,0 +1,98 @@
1
+ # Codebase audit branch
2
+
3
+ Use this branch for an entire codebase, package, feature slice, or diff.
4
+
5
+ ## 1. Build the inventory
6
+
7
+ Enumerate source and test files, then find:
8
+
9
+ - every `Context.Service`, tag, `Layer`, `make`, `provide`, and `provideService`;
10
+ - service-shaped interfaces/classes with effectful methods;
11
+ - parameter, property, constructor, callback, options-bag, and Layer injection;
12
+ - direct access to time, randomness, cryptography, IDs, configuration, HTTP, persistence, registries, renderers, filesystem, runtime bindings, and mutable globals;
13
+ - test fakes, in-memory implementations, module mocks, and hand-built `Layer.succeed` values.
14
+
15
+ For each service record:
16
+
17
+ | Field | Question |
18
+ | --- | --- |
19
+ | Owner | Which module owns the capability's meaning? |
20
+ | Contract | Where are the interface and tag? |
21
+ | Constructor | Does `make` yield every dependency? |
22
+ | Production | Which module owns the concrete `layer`? |
23
+ | Tests | Is there an honest reusable test/local implementation? |
24
+ | Consumers | Are capabilities yielded or drilled? |
25
+ | Requirements | Do Effect requirements propagate to the composition root? |
26
+ | Verdict | Keep, deepen, relocate, merge, remove, or create? |
27
+
28
+ **Complete when:** every discovered service/tag and Layer appears exactly once in the inventory.
29
+
30
+ ## 2. Trace requirements
31
+
32
+ For each service and service-shaped constructor:
33
+
34
+ 1. Trace one public operation to every effect.
35
+ 2. Mark where each dependency first appears.
36
+ 3. Mark where it is yielded, passed as a value, captured from a property, or concretely provided.
37
+ 4. Verify the module providing a Layer truthfully owns that implementation choice.
38
+ 5. Check pinned source for framework/runtime services before recommending a wrapper.
39
+
40
+ Pay special attention to:
41
+
42
+ - a service yielded once and then passed through several functions;
43
+ - a `Layer` accepted as a function argument;
44
+ - dependency bags and constructors in Effect-native code;
45
+ - plain service values passed into handler builders;
46
+ - local `Effect.provide` calls that erase requirements below the composition root;
47
+ - global Clock, crypto, random, environment, fetch, database, registry, or binding access;
48
+ - a service contract, `make`, production Layer, and test Layer scattered across unrelated modules.
49
+
50
+ **Complete when:** every capability in the inventory has an unbroken path from use to the composition root or a documented value boundary.
51
+
52
+ ## 3. Classify each candidate
53
+
54
+ Apply the service test from `SKILL.md`, then classify dependencies:
55
+
56
+ - **built-in Effect capability** — yield it directly;
57
+ - **technology adapter** — implement the port in the adapter module;
58
+ - **request/domain value** — keep it explicit;
59
+ - **framework boundary** — isolate its required constructor/property API in the adapter or root;
60
+ - **pass-through abstraction** — remove or fold into its owner.
61
+
62
+ Use the deletion test. Confirm an existing module cannot own the behavior before proposing a new one. Prefer merging duplicated capabilities over introducing a generic registry or dependency bag.
63
+
64
+ **Complete when:** every candidate has one classification and concrete evidence; no finding rests only on stylistic preference.
65
+
66
+ ## 4. Audit test implementations
67
+
68
+ For each service, inspect how tests replace or control it:
69
+
70
+ - static complete value → local or colocated `Layer.succeed`;
71
+ - reusable state/control → first-class test service and `layerTest`;
72
+ - faithful in-memory semantics → `layerMemory`;
73
+ - persistence/protocol semantics → real local adapter;
74
+ - narrow one-off behavior → fixture local to the test.
75
+
76
+ Compare the fake's advertised contract with its implementation. A partial fake can remain local, but it cannot be recommended as a general in-memory Layer.
77
+
78
+ **Complete when:** every production service has an intentional test strategy or an explicit reason no substitute is needed.
79
+
80
+ ## 5. Report only actionable findings
81
+
82
+ Prioritize by correctness and requirement visibility:
83
+
84
+ - **P0** — hidden authority, direct unsafe runtime access, broken or duplicated capability, wrong Layer ownership;
85
+ - **P1** — repeated dependency drilling, missing dependency-preserving or production Layer, scattered service module;
86
+ - **P2** — naming or colocation cleanup that should ride with a nearby refactor.
87
+
88
+ For each finding include:
89
+
90
+ 1. evidence with file/line or symbol references;
91
+ 2. why the current shape hides requirements or creates caller burden;
92
+ 3. the smallest target Effect service module shape, including `layerWithoutDependencies`, assembled `layer`, and any honest reusable test Layer;
93
+ 4. the composition-root and test impact;
94
+ 5. what should remain unchanged.
95
+
96
+ Include a final “keep” section covering explicit values, pure functions, framework boundaries, correctly separated ports/adapters, and request-scoped services.
97
+
98
+ **Complete when:** every inventory row has a disposition, every recommendation names its owner and target shape, and speculative abstractions have been removed from the report.
@@ -0,0 +1,29 @@
1
+ # Dependencies
2
+ node_modules/
3
+
4
+ # Website (lives on docs branch)
5
+ website/
6
+
7
+ # Build outputs
8
+ dist/
9
+ *.js
10
+ *.d.ts
11
+ *.js.map
12
+
13
+ # IDE
14
+ .idea/
15
+ .vscode/
16
+ *.swp
17
+ *.swo
18
+
19
+ # OS
20
+ .DS_Store
21
+ Thumbs.db
22
+
23
+ # Logs
24
+ *.log
25
+ npm-debug.log*
26
+
27
+ # Environment
28
+ .env
29
+ .env.local
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punks/cli",
3
- "version": "3.1.9",
3
+ "version": "3.1.10",
4
4
  "description": "Harness Intelligence scaffolding CLI",
5
5
  "homepage": "https://github.com/wearedevpunks/harness-intelligence/tree/main/apps/cli#readme",
6
6
  "bugs": {
@@ -15,59 +15,5 @@
15
15
  "hi": "dist/index.js",
16
16
  "hint": "dist/index.js"
17
17
  },
18
- "files": [
19
- "dist",
20
- "README.md",
21
- "AGENTS.md"
22
- ],
23
- "type": "module",
24
- "scripts": {
25
- "build": "\"${HI_TEST_NODE_PATH:-node}\" ./scripts/build-dist.mjs",
26
- "baseline:build": "bun ./scripts/build-baseline.mjs",
27
- "baseline:publish": "node ./scripts/publish-baseline.mjs",
28
- "baseline:rollback": "node ./scripts/rollback-baseline.mjs",
29
- "check-types": "\"${HI_TEST_NODE_PATH:-node}\" --input-type=module -e \"await import(new URL('./bin/tsc', import.meta.resolve('@typescript/native/package.json')))\" -- tsc --noEmit",
30
- "dev": "bun run ./src/index.ts scaffold",
31
- "entrypoints": "bun ./scripts/print-entrypoints.mjs",
32
- "fixtures:check:managed-assets": "vitest run --config vitest.config.ts src/features/context-planning/managed-assets-fixture.native.test.ts",
33
- "fixtures:update:managed-assets": "bun run build && HI_UPDATE_MANAGED_ASSETS_FIXTURE=1 bun run fixtures:check:managed-assets",
34
- "local": "bun run build && bun run ./dist/index.js",
35
- "release:attest": "\"${HI_TEST_NODE_PATH:-node}\" ./scripts/run-cli-verification.mjs attest",
36
- "release:publish": "node ./scripts/release-dispatcher.mjs",
37
- "release:publish:beta": "NPM_TAG=beta node ./scripts/release-dispatcher.mjs",
38
- "release:verify": "HI_CACHE_NAMESPACE=protected node ./scripts/run-cli-verification.mjs release",
39
- "sync:skills": "node ./scripts/sync-skills-repo.mjs",
40
- "test": "vitest run --config vitest.config.ts",
41
- "test:parallel": "vitest run --config vitest.config.ts --fileParallelism --maxWorkers=2",
42
- "test:release": "\"${HI_TEST_NODE_PATH:-node}\" ./scripts/run-release-tests.mjs",
43
- "test:release:complete": "\"${HI_TEST_NODE_PATH:-node}\" ./scripts/run-release-tests.mjs complete",
44
- "test:release:ordinary:ambient": "\"${HI_TEST_NODE_PATH:-node}\" ./scripts/run-release-tests.mjs ordinary:ambient",
45
- "test:release:ordinary:deterministic": "\"${HI_TEST_NODE_PATH:-node}\" ./scripts/run-release-tests.mjs ordinary:deterministic",
46
- "test:release:ordinary:native:capability": "\"${HI_TEST_NODE_PATH:-node}\" ./scripts/run-release-tests.mjs ordinary:native:capability",
47
- "test:release:ordinary:native:forced": "\"${HI_TEST_NODE_PATH:-node}\" ./scripts/run-release-tests.mjs ordinary:native:forced",
48
- "test:release:update:0": "\"${HI_TEST_NODE_PATH:-node}\" ./scripts/run-release-tests.mjs update:0",
49
- "test:release:update:1": "\"${HI_TEST_NODE_PATH:-node}\" ./scripts/run-release-tests.mjs update:1",
50
- "test:release:update:2": "\"${HI_TEST_NODE_PATH:-node}\" ./scripts/run-release-tests.mjs update:2",
51
- "test:release:update:uncached": "\"${HI_TEST_NODE_PATH:-node}\" ./scripts/run-release-tests.mjs update:uncached",
52
- "ui:catalog": "bun ./scripts/run-renderer-catalog.mjs",
53
- "check": "oxlint src scripts && oxfmt --check src scripts package.json tsconfig.json vitest.config.ts && bun run fixtures:check:managed-assets"
54
- },
55
- "dependencies": {
56
- "react-devtools-core": "^6.1.5"
57
- },
58
- "devDependencies": {
59
- "@effect/eslint-plugin": "latest",
60
- "@effect/platform-bun": "catalog:",
61
- "@effect/vitest": "catalog:",
62
- "@punks/contract": "workspace:*",
63
- "@punks/env": "workspace:*",
64
- "@punks/scaffold": "workspace:*",
65
- "@types/node": "catalog:",
66
- "effect": "catalog:",
67
- "oxlint": "latest",
68
- "typescript": "catalog:",
69
- "ultracite": "latest",
70
- "vitest": "catalog:"
71
- },
72
- "packageManager": "bun@1.3.5"
18
+ "type": "module"
73
19
  }