@ps-neko/nekowork 0.1.0-alpha.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 (203) hide show
  1. package/AGENTS.md +112 -0
  2. package/CLAUDE.md +81 -0
  3. package/LICENSE +21 -0
  4. package/README.md +283 -0
  5. package/REVIEW.md +96 -0
  6. package/RULES.md +51 -0
  7. package/SOUL.md +21 -0
  8. package/WORKING-CONTEXT.md +52 -0
  9. package/agent.yaml +219 -0
  10. package/agents/architect.md +57 -0
  11. package/agents/code-reviewer.md +60 -0
  12. package/agents/codex-challenger.md +53 -0
  13. package/agents/codex-reviewer.md +56 -0
  14. package/agents/debugger.md +33 -0
  15. package/agents/doc-writer.md +51 -0
  16. package/agents/executor.md +41 -0
  17. package/agents/planner.md +49 -0
  18. package/agents/research.md +50 -0
  19. package/agents/security-reviewer.md +47 -0
  20. package/agents/test-engineer.md +41 -0
  21. package/bridge/mcp-server.js +301 -0
  22. package/commands/claude-led-codex-review.md +29 -0
  23. package/docs/ADVANCED.md +321 -0
  24. package/docs/AI-DEVELOPMENT-LIFECYCLE.md +105 -0
  25. package/docs/ARCHITECTURE.md +205 -0
  26. package/docs/AUDIT.md +114 -0
  27. package/docs/AUTH-MIGRATION.md +282 -0
  28. package/docs/CHANGELOG.md +97 -0
  29. package/docs/CLI-STAGES.md +89 -0
  30. package/docs/CODEMAPS/README.md +15 -0
  31. package/docs/CODEMAPS/agents.md +22 -0
  32. package/docs/CODEMAPS/bridge.md +18 -0
  33. package/docs/CODEMAPS/hooks.md +28 -0
  34. package/docs/CODEMAPS/manifests.md +14 -0
  35. package/docs/CODEMAPS/rules.md +22 -0
  36. package/docs/CODEMAPS/schemas.md +21 -0
  37. package/docs/CODEMAPS/scripts.md +158 -0
  38. package/docs/CODEMAPS/skills.md +29 -0
  39. package/docs/CODEMAPS/tests.md +98 -0
  40. package/docs/CORE-INVARIANTS.md +38 -0
  41. package/docs/DEMO.md +110 -0
  42. package/docs/EXAMPLE-PROJECT.md +92 -0
  43. package/docs/PORTING.md +154 -0
  44. package/docs/PRODUCT-PRINCIPLES.md +303 -0
  45. package/docs/PUBLISH-ALPHA.md +106 -0
  46. package/docs/QUICKSTART.md +344 -0
  47. package/docs/RELEASE-READINESS.md +140 -0
  48. package/docs/RISK-CLASSIFIER.md +50 -0
  49. package/docs/RUNBOOK.md +146 -0
  50. package/docs/SECURITY.md +79 -0
  51. package/docs/SETUP.md +142 -0
  52. package/docs/WHY-NEKOWORK.md +64 -0
  53. package/docs/case-studies/README.md +16 -0
  54. package/docs/case-studies/SINDRESORHUS-IS-PLAIN-OBJ.md +141 -0
  55. package/docs/dev-log/2026-04-29-p1-recovery.md +142 -0
  56. package/docs/dev-log/2026-04-29-week1-4.md +81 -0
  57. package/docs/examples/GITHUB-ACTIONS-HARDENING.md +86 -0
  58. package/docs/examples/QUALITY-LIFECYCLE-SMOKE.md +32 -0
  59. package/docs/examples/TRADING-DASHBOARD-MOCK.md +65 -0
  60. package/docs/workflows-stash/README.md +32 -0
  61. package/docs/workflows-stash/harness-review.yml +166 -0
  62. package/docs/workflows-stash/harness-validate.yml +48 -0
  63. package/examples/github-actions-hardening/.github/workflows/hardened-validate.yml +38 -0
  64. package/examples/github-actions-hardening/README.md +31 -0
  65. package/examples/github-actions-hardening/case-study/ASK.md +26 -0
  66. package/examples/github-actions-hardening/case-study/GATE_STATUS.md +28 -0
  67. package/examples/github-actions-hardening/case-study/PLAN.md +25 -0
  68. package/examples/github-actions-hardening/case-study/SHIP_READY.md +21 -0
  69. package/examples/github-actions-hardening/case-study/TASK.md +30 -0
  70. package/examples/github-actions-hardening/case-study/TEAM_HANDOFFS.md +37 -0
  71. package/examples/github-actions-hardening/case-study/VERIFY_SUMMARY.md +35 -0
  72. package/examples/github-actions-hardening/case-study/WORK_SUMMARY.md +24 -0
  73. package/examples/github-actions-hardening/package.json +12 -0
  74. package/examples/github-actions-hardening/scripts/check.mjs +43 -0
  75. package/examples/quality-lifecycle-smoke/README.md +30 -0
  76. package/examples/quality-lifecycle-smoke/case-study/ASK.md +24 -0
  77. package/examples/quality-lifecycle-smoke/case-study/GATE_STATUS.md +10 -0
  78. package/examples/quality-lifecycle-smoke/case-study/PLAN.md +19 -0
  79. package/examples/quality-lifecycle-smoke/case-study/SHIP_READY.md +11 -0
  80. package/examples/quality-lifecycle-smoke/case-study/TASK.md +19 -0
  81. package/examples/quality-lifecycle-smoke/case-study/TEAM_HANDOFFS.md +21 -0
  82. package/examples/quality-lifecycle-smoke/case-study/VERIFY_SUMMARY.md +44 -0
  83. package/examples/quality-lifecycle-smoke/case-study/WORK_SUMMARY.md +19 -0
  84. package/examples/quality-lifecycle-smoke/package.json +8 -0
  85. package/examples/quality-lifecycle-smoke/scripts/check.mjs +44 -0
  86. package/examples/trading-dashboard-mock/README.md +33 -0
  87. package/examples/trading-dashboard-mock/case-study/ASK.md +24 -0
  88. package/examples/trading-dashboard-mock/case-study/GATE_STATUS.md +28 -0
  89. package/examples/trading-dashboard-mock/case-study/PLAN.md +23 -0
  90. package/examples/trading-dashboard-mock/case-study/SHIP_READY.md +21 -0
  91. package/examples/trading-dashboard-mock/case-study/TASK.md +29 -0
  92. package/examples/trading-dashboard-mock/case-study/TEAM_HANDOFFS.md +49 -0
  93. package/examples/trading-dashboard-mock/case-study/VERIFY_SUMMARY.md +35 -0
  94. package/examples/trading-dashboard-mock/case-study/WORK_SUMMARY.md +27 -0
  95. package/examples/trading-dashboard-mock/fixtures/market.json +9 -0
  96. package/examples/trading-dashboard-mock/index.html +76 -0
  97. package/examples/trading-dashboard-mock/package.json +9 -0
  98. package/examples/trading-dashboard-mock/scripts/check.mjs +54 -0
  99. package/examples/trading-dashboard-mock/src/app.js +83 -0
  100. package/examples/trading-dashboard-mock/src/styles.css +227 -0
  101. package/hooks/hooks.json +44 -0
  102. package/hooks/scripts/config-protection.js +34 -0
  103. package/hooks/scripts/gateguard-fact-force.js +146 -0
  104. package/hooks/scripts/persistent-mode.mjs +27 -0
  105. package/hooks/scripts/pre-bash-dispatcher.js +63 -0
  106. package/hooks/scripts/quality-gate.js +106 -0
  107. package/manifests/install-components.json +195 -0
  108. package/manifests/install-modules.json +101 -0
  109. package/manifests/install-profiles.json +134 -0
  110. package/package.json +96 -0
  111. package/rules/common/coding-style.md +71 -0
  112. package/rules/common/security.md +69 -0
  113. package/rules/common/testing.md +58 -0
  114. package/rules/python/coding-style.md +80 -0
  115. package/rules/python/testing.md +86 -0
  116. package/rules/typescript/coding-style.md +97 -0
  117. package/rules/typescript/security.md +67 -0
  118. package/rules/typescript/testing.md +78 -0
  119. package/schemas/agent-yaml.schema.json +168 -0
  120. package/schemas/agent.schema.json +32 -0
  121. package/schemas/handoff.schema.json +105 -0
  122. package/schemas/hooks.schema.json +35 -0
  123. package/schemas/install-components.schema.json +46 -0
  124. package/schemas/install-modules.schema.json +39 -0
  125. package/schemas/install-profiles.schema.json +32 -0
  126. package/schemas/install-state.schema.json +42 -0
  127. package/schemas/routing.schema.json +42 -0
  128. package/schemas/skill.schema.json +19 -0
  129. package/scripts/agents/dispatch.js +144 -0
  130. package/scripts/agents/runners/claude.js +214 -0
  131. package/scripts/agents/runners/codex.js +233 -0
  132. package/scripts/agents/runners/gemini.js +92 -0
  133. package/scripts/agents/runners/mock.js +107 -0
  134. package/scripts/auth/github-import-gh.js +52 -0
  135. package/scripts/auth/github-login.js +79 -0
  136. package/scripts/auth/github-logout.js +21 -0
  137. package/scripts/auth/github-status.js +46 -0
  138. package/scripts/build-claude.js +101 -0
  139. package/scripts/build-codemaps.js +286 -0
  140. package/scripts/build-codex.js +93 -0
  141. package/scripts/build-cursor.js +132 -0
  142. package/scripts/build-gemini.js +117 -0
  143. package/scripts/build-opencode.js +117 -0
  144. package/scripts/ci/catalog.js +120 -0
  145. package/scripts/ci/check-markers.js +48 -0
  146. package/scripts/ci/security-hardening.js +270 -0
  147. package/scripts/ci/validate-agents.js +88 -0
  148. package/scripts/ci/validate-hooks.js +99 -0
  149. package/scripts/ci/validate-manifests.js +128 -0
  150. package/scripts/ci/validate-skills.js +93 -0
  151. package/scripts/cli.js +1134 -0
  152. package/scripts/core/auth-guard.js +22 -0
  153. package/scripts/core/build-roots.js +11 -0
  154. package/scripts/core/cli-resolver.js +64 -0
  155. package/scripts/core/execution-workspace.js +84 -0
  156. package/scripts/core/git-mutation-guard.js +79 -0
  157. package/scripts/core/install-state.js +125 -0
  158. package/scripts/core/json-extractor.js +32 -0
  159. package/scripts/core/subprocess.js +74 -0
  160. package/scripts/daemon/wait.js +278 -0
  161. package/scripts/demo-external-project.js +222 -0
  162. package/scripts/demo-quick-run.js +193 -0
  163. package/scripts/demo-review.js +204 -0
  164. package/scripts/doctor.js +296 -0
  165. package/scripts/install-apply.js +185 -0
  166. package/scripts/install-plan.js +411 -0
  167. package/scripts/lib/acceptance-criteria.js +105 -0
  168. package/scripts/lib/costs.js +82 -0
  169. package/scripts/lib/instincts.js +194 -0
  170. package/scripts/lib/keychain.js +85 -0
  171. package/scripts/lib/profile-policy.js +134 -0
  172. package/scripts/lib/profile-safety.js +81 -0
  173. package/scripts/lib/risk-classifier.js +145 -0
  174. package/scripts/lib/router.js +138 -0
  175. package/scripts/lib/severity.js +99 -0
  176. package/scripts/lib/token-vault.js +136 -0
  177. package/scripts/orchestrators/apply.js +225 -0
  178. package/scripts/orchestrators/ask.js +143 -0
  179. package/scripts/orchestrators/gate.js +179 -0
  180. package/scripts/orchestrators/ralph.js +179 -0
  181. package/scripts/orchestrators/review.js +452 -0
  182. package/scripts/orchestrators/run.js +151 -0
  183. package/scripts/orchestrators/ship.js +339 -0
  184. package/scripts/orchestrators/team-lite.js +270 -0
  185. package/scripts/orchestrators/team.js +244 -0
  186. package/scripts/orchestrators/verify.js +306 -0
  187. package/scripts/orchestrators/work.js +207 -0
  188. package/scripts/portability/simulate-port.js +220 -0
  189. package/scripts/repair.js +184 -0
  190. package/scripts/sync-claude-md.js +220 -0
  191. package/scripts/verify/claude-live.js +30 -0
  192. package/scripts/verify/codex-live.js +60 -0
  193. package/scripts/verify/gemini-live.js +48 -0
  194. package/scripts/verify/runtime.js +105 -0
  195. package/skills/claude-led-codex-review/SKILL.md +133 -0
  196. package/skills/plan-eng-review/SKILL.md +51 -0
  197. package/skills/porting/SKILL.md +69 -0
  198. package/skills/ralph/SKILL.md +48 -0
  199. package/skills/release-readiness/SKILL.md +62 -0
  200. package/skills/review/SKILL.md +42 -0
  201. package/skills/security-hardening/SKILL.md +59 -0
  202. package/skills/ship/SKILL.md +44 -0
  203. package/skills/tdd-workflow/SKILL.md +42 -0
@@ -0,0 +1,344 @@
1
+ # Quickstart
2
+
3
+ This guide gets a new user from a clean checkout to the first NEKOWORK run.
4
+
5
+ ## 1. Install From Source
6
+
7
+ HARNESS `0.1.0-alpha.0` is prepared as a public alpha candidate but is not published to npm yet. Use the repository path:
8
+
9
+ ```bash
10
+ git clone https://github.com/Ps-Neko/NEKOWORK.git harness
11
+ cd harness
12
+ npm ci
13
+ ```
14
+
15
+ Verify the checkout:
16
+
17
+ ```bash
18
+ node scripts/cli.js doctor --quick
19
+ ```
20
+
21
+ `doctor --quick` checks Node.js, package metadata, git state, API key overrides, and provider CLI presence without running the slower freshness checks.
22
+
23
+ ## 2. One-Minute Demo
24
+
25
+ Use this first when you want the shortest no-API experience:
26
+
27
+ ```bash
28
+ npm run demo:quick -- --cleanup
29
+ ```
30
+
31
+ The quick demo creates a disposable target project, runs `doctor -> run -> gate status`, and removes the target when `--cleanup` is set. It uses mock providers and does not call Claude, Codex, Gemini, or paid APIs.
32
+
33
+ Expected shape:
34
+
35
+ ```text
36
+ doctor ... OK
37
+ run workflow ... OK
38
+ gate status ... OK
39
+ Demo completed: verdict=approve_with_fixes, ship_ready=false, applied=false
40
+ ```
41
+
42
+ ## 3. Beginner Path
43
+
44
+ Use this path first. It is the recommended shortest safe loop:
45
+
46
+ ```bash
47
+ node scripts/cli.js ask "clarify a risky or ambiguous request" --session first-ask
48
+ node scripts/cli.js run "implement, verify, and prepare ship readiness" --session first-run
49
+ node scripts/cli.js gate status --session first-run
50
+ ```
51
+
52
+ `run` is the short safe wrapper. It runs `work -> verify -> ship`, does not apply by default, and stops on Human Gate. `apply` is always explicit and requires a verified `SHIP_READY` live-work diff.
53
+
54
+ ## 4. Run A Mock Review
55
+
56
+ Mock mode is the default. It does not call Claude, Codex, Gemini, or any paid API.
57
+
58
+ For ambiguous or risky work, start with the local question gate:
59
+
60
+ ```bash
61
+ node scripts/cli.js ask "trading dashboard mockup" --session first-ask
62
+ ```
63
+
64
+ `ask` creates a question-gate handoff only. It does not call providers and does not mutate project files.
65
+
66
+ ```bash
67
+ node scripts/cli.js review "check the project setup" --no-ship --session first-smoke
68
+ ```
69
+
70
+ Expected result:
71
+
72
+ - session state under `.harness/state/sessions/first-smoke/`
73
+ - handoff markdown files under `handoffs/`
74
+ - `review-summary.json` with `mode: legacy-full-review-cycle`
75
+ - no PR or publish action because `--no-ship` is set
76
+
77
+ Example output:
78
+
79
+ ```text
80
+ [review:first-smoke] 1 ideate
81
+ [review:first-smoke] 2 plan
82
+ [review:first-smoke] 3 implement
83
+ [review:first-smoke] 4 self-review
84
+ [review:first-smoke] 5 codex-review
85
+ [review:first-smoke] 7 ship skipped (--no-ship)
86
+ ```
87
+
88
+ `review-cycle` is an explicit alias for the same legacy full cycle:
89
+
90
+ ```bash
91
+ node scripts/cli.js review-cycle "check the project setup" --no-ship --session first-review-cycle
92
+ ```
93
+
94
+ For a planning-only first pass:
95
+
96
+ ```bash
97
+ node scripts/cli.js plan "draft an implementation plan" --session first-plan
98
+ ```
99
+
100
+ For multiple read-only perspectives before implementation:
101
+
102
+ ```bash
103
+ node scripts/cli.js team "trading dashboard mockup" --workers planner,research,security,test --no-write --session first-team
104
+ ```
105
+
106
+ `team` writes handoffs and a `team-summary.json` file. It does not run an implement stage and does not mutate project files.
107
+
108
+ For a single-executor implementation handoff:
109
+
110
+ ```bash
111
+ node scripts/cli.js work "implement the planned dashboard mockup" --single-executor --session first-work
112
+ ```
113
+
114
+ In mock mode this writes an implement handoff only. In live mode the executor works in an isolated git worktree and NEKOWORK captures a diff under the session; the target project is not changed until a later verified apply path exists. `work` also writes `acceptance-criteria.json`, reusing `prd.json` when available or creating a deterministic minimum from the task.
115
+
116
+ Then verify that work with Codex:
117
+
118
+ ```bash
119
+ node scripts/cli.js verify "verify the planned dashboard mockup" --session first-work
120
+ ```
121
+
122
+ `verify` reads the prior `work` handoff and optional diff. It does not implement or ship. Add `--secure` when you want Codex challenge even if the task is not auto-detected as sensitive.
123
+
124
+ If verification creates a human gate, inspect it:
125
+
126
+ ```bash
127
+ node scripts/cli.js gate status --session first-work
128
+ ```
129
+
130
+ Then make an explicit human decision:
131
+
132
+ ```bash
133
+ node scripts/cli.js gate approve --session first-work --reason "Reviewed and accepted this risk"
134
+ node scripts/cli.js gate block --session first-work --reason "Release risk rejected"
135
+ ```
136
+
137
+ `gate approve` requires an open `HUMAN_GATE`. It records approval for audit; it does not delete the original gate file.
138
+
139
+ Then produce a ship/no-ship readiness handoff:
140
+
141
+ ```bash
142
+ node scripts/cli.js ship "prepare dashboard ship readiness" --require-clean-gates --session first-work
143
+ ```
144
+
145
+ `ship` requires the prior `work` and `verify` handoffs. It does not publish, deploy, create a PR, or mutate the target project. If Codex reported fixable findings, `ship` writes a no-ship handoff and `NO_SHIP`; if Codex fully approved, it writes `SHIP_READY`. Existing `HUMAN_GATE` always blocks it.
146
+
147
+ For live work that produced a captured diff, apply it only after ship readiness:
148
+
149
+ ```bash
150
+ node scripts/cli.js apply --session first-work
151
+ ```
152
+
153
+ `apply` requires `SHIP_READY`, no newer `NO_SHIP`, no unresolved gate, a clean git worktree excluding `.harness/` state, and a captured diff from `work --live`. It applies the diff but does not commit, push, publish, or deploy.
154
+
155
+ To run the decomposed wrapper in one command:
156
+
157
+ ```bash
158
+ node scripts/cli.js run "implement and verify a change" --session first-run
159
+ ```
160
+
161
+ `run` executes `work -> verify -> ship`. It does not apply by default. Add `--apply` only when live work produced a captured diff and you want the verified `SHIP_READY` diff applied.
162
+
163
+ ## 5. Inspect The Install Catalog
164
+
165
+ ```bash
166
+ node scripts/install-plan.js --list
167
+ node scripts/install-plan.js --profile developer
168
+ node scripts/install-plan.js --profile developer --target claude --json
169
+ ```
170
+
171
+ Profiles:
172
+
173
+ - `core`: minimal rules, agents, hooks, and platform configs
174
+ - `developer`: daily development, quality workflow, Codex loop, ops-readiness
175
+ - `security`: secure review defaults
176
+ - `product`: question gate, scope review, acceptance criteria
177
+ - `quality`: disciplined workflow, test-first planning, evidence-based review
178
+ - `frontend`: UI mockup, component review, accessibility-oriented flow
179
+ - `testing`: test planning, regression, and coverage-oriented flow
180
+ - `research`: research-oriented profile
181
+ - `full`: every current module
182
+
183
+ ## 6. Use HARNESS In A Target Project
184
+
185
+ For a disposable end-to-end target project demo:
186
+
187
+ ```bash
188
+ npm run demo:external
189
+ ```
190
+
191
+ Add `-- --cleanup` if you want the generated target removed after the run:
192
+
193
+ ```bash
194
+ npm run demo:external -- --cleanup
195
+ ```
196
+
197
+ See [EXAMPLE-PROJECT.md](EXAMPLE-PROJECT.md) for the full walkthrough and expected outputs.
198
+
199
+ For small checked-in case-study targets, inspect:
200
+
201
+ ```text
202
+ examples/trading-dashboard-mock/
203
+ examples/github-actions-hardening/
204
+ ```
205
+
206
+ Each example has its own `npm test` and NEKOWORK case-study artifacts under `case-study/`.
207
+
208
+ Recommended 0.0.3 integration:
209
+
210
+ ```bash
211
+ cd <target-project>
212
+ git submodule add https://github.com/Ps-Neko/NEKOWORK.git .harness-tool
213
+ ```
214
+
215
+ Run a non-destructive preflight:
216
+
217
+ ```bash
218
+ node .harness-tool/scripts/portability/simulate-port.js . --profile developer --verbose
219
+ ```
220
+
221
+ Apply generated harness surfaces:
222
+
223
+ ```bash
224
+ node .harness-tool/scripts/install-apply.js --profile developer --project-root .
225
+ ```
226
+
227
+ Smoke test in the target project:
228
+
229
+ ```bash
230
+ node .harness-tool/scripts/cli.js doctor --project-root . --quick
231
+ node .harness-tool/scripts/cli.js plan "target project smoke" --project-root . --session target-smoke
232
+ ```
233
+
234
+ Expected outputs in the target project:
235
+
236
+ - `.harness/install-state.json`
237
+ - `.harness/state/sessions/target-smoke/`
238
+ - `.claude/`
239
+ - `.codex/config.toml`
240
+ - `.cursor/hooks.json`
241
+ - `.gemini/GEMINI.md`
242
+ - `.opencode/config.json`
243
+
244
+ ## 7. Turn On Live Provider Calls
245
+
246
+ Live mode uses local CLI sessions by default.
247
+
248
+ Claude:
249
+
250
+ ```bash
251
+ claude auth status
252
+ npm run verify:claude
253
+ ```
254
+
255
+ Codex:
256
+
257
+ ```bash
258
+ npm install -g @openai/codex
259
+ codex login
260
+ npm run verify:codex
261
+ ```
262
+
263
+ Gemini:
264
+
265
+ ```bash
266
+ gemini
267
+ npm run verify:gemini
268
+ node scripts/cli.js doctor --quick --gemini-smoke
269
+ ```
270
+
271
+ Plain `doctor` reports Gemini installation only. Add `--gemini-smoke` when you want the live Gemini auth check included in the health report.
272
+
273
+ Then run:
274
+
275
+ ```bash
276
+ node scripts/cli.js review "live provider smoke" --live --no-ship
277
+ ```
278
+
279
+ If you have API key environment variables set, HARNESS blocks them by default before delegated CLI calls. Unset them for local CLI auth:
280
+
281
+ ```bash
282
+ unset ANTHROPIC_API_KEY
283
+ unset OPENAI_API_KEY
284
+ unset GEMINI_API_KEY
285
+ unset GOOGLE_API_KEY
286
+ ```
287
+
288
+ On PowerShell:
289
+
290
+ ```powershell
291
+ Remove-Item Env:ANTHROPIC_API_KEY -ErrorAction SilentlyContinue
292
+ Remove-Item Env:OPENAI_API_KEY -ErrorAction SilentlyContinue
293
+ Remove-Item Env:GEMINI_API_KEY -ErrorAction SilentlyContinue
294
+ Remove-Item Env:GOOGLE_API_KEY -ErrorAction SilentlyContinue
295
+ ```
296
+
297
+ ## 8. Future npm Install Path
298
+
299
+ The package metadata is prepared as `@ps-neko/nekowork@0.1.0-alpha.0`, but publish execution requires npm owner auth.
300
+
301
+ After the public alpha is published, the intended install paths are:
302
+
303
+ ```bash
304
+ npm i --save-dev @ps-neko/nekowork
305
+ ```
306
+
307
+ or:
308
+
309
+ ```bash
310
+ npm i -g @ps-neko/nekowork
311
+ ```
312
+
313
+ Do not use these npm commands until a public package has actually been published.
314
+
315
+ ## Troubleshooting
316
+
317
+ `npm ci` fails:
318
+
319
+ - Confirm Node.js 22 or newer with `node -v`.
320
+ - Check corporate proxy or registry settings in `.npmrc`.
321
+
322
+ `--live` fails immediately:
323
+
324
+ - Confirm the provider CLI is installed and logged in.
325
+ - Unset API key environment variables unless you intentionally opted into a metered path.
326
+
327
+ `doctor` exits with `FAIL`:
328
+
329
+ - Read the failed row first.
330
+ - Run without `--quick` if you need repair/sync/codemap freshness checks.
331
+ - Use `--json` for CI or issue reports.
332
+
333
+ `repair --check` reports stale output:
334
+
335
+ - Run `node scripts/repair.js`.
336
+ - Then rerun `node scripts/repair.js --check`.
337
+
338
+ `sync-claude-md --check` reports a diff:
339
+
340
+ - Run `node scripts/sync-claude-md.js`.
341
+
342
+ `build-codemaps --check` reports stale codemaps:
343
+
344
+ - Run `node scripts/build-codemaps.js`.
@@ -0,0 +1,140 @@
1
+ # Release Readiness
2
+
3
+ Status date: 2026-05-07
4
+
5
+ NEKOWORK / HARNESS is release-ready for local use and repository-based installation. Public npm publishing is prepared as an alpha candidate, but execution requires npm owner auth.
6
+
7
+ ## Decision
8
+
9
+ - Decision: do not publish 0.0.3 to npm.
10
+ - Public alpha candidate: `0.1.0-alpha.0`, publish with `--tag alpha`.
11
+ - `package.json` is set to `private: false` for the public alpha candidate.
12
+ - The canonical repo is `Ps-Neko/NEKOWORK`.
13
+ - Current release track is `0.1.0-alpha.0`.
14
+ - Required local provider auth is delegated CLI auth, not long-lived API keys.
15
+ - Core workflow invariant is Claude work -> Codex verification -> Human Gate.
16
+ - Risk classifier, acceptance criteria artifacts, and profile safety validation are part of the release gate.
17
+ - Remaining optional work is internal project/provider integration on request.
18
+ - Public package metadata is prepared as `@ps-neko/nekowork`, but actual `npm publish` still requires npm owner auth.
19
+ - See [PUBLISH-ALPHA.md](PUBLISH-ALPHA.md) for the public alpha checklist.
20
+
21
+ ## Required Gates
22
+
23
+ Run these before a release tag or public package decision:
24
+
25
+ ```bash
26
+ node scripts/cli.js doctor
27
+ node scripts/cli.js doctor --quick --gemini-smoke
28
+ npm run lint
29
+ npm test
30
+ npm run demo:quick -- --cleanup
31
+ npm run demo:external -- --cleanup
32
+ npm audit --audit-level=moderate
33
+ node scripts/repair.js --check
34
+ node scripts/sync-claude-md.js --check
35
+ node scripts/build-codemaps.js --check
36
+ npm run security:hardening
37
+ npm pack --dry-run --json
38
+ npm publish --dry-run --access public --tag alpha
39
+ ```
40
+
41
+ Current local verification after the decomposed workflow expansion:
42
+
43
+ - `npm run test:unit`: covered by full `npm test`
44
+ - `npm run validate:all`: pass
45
+ - `npm run lint`: pass
46
+ - `node scripts/sync-claude-md.js --check`: pass
47
+ - `node scripts/build-codemaps.js --check`: pass
48
+ - `npm test`: 238 tests pass
49
+ - `npm run demo:quick -- --cleanup`: pass
50
+ - `npm audit --audit-level=moderate`: 0 vulnerabilities
51
+ - `npm pack --dry-run --json`: pass
52
+ - `npm publish --dry-run --access public --tag alpha`: pass
53
+ - `npm publish --access public --tag alpha`: blocked by `ENEEDAUTH`
54
+
55
+ ## Install Smoke
56
+
57
+ For the default developer profile:
58
+
59
+ ```bash
60
+ node scripts/install-plan.js --list --json
61
+ node scripts/install-plan.js --profile developer --json
62
+ node scripts/portability/simulate-port.js <target> --profile developer --json
63
+ node scripts/install-apply.js --profile developer --project-root <target>
64
+ node scripts/cli.js plan "release readiness smoke" --project-root <target>
65
+ node scripts/cli.js run "release readiness decomposed smoke" --project-root <target> --session release-run-smoke
66
+ ```
67
+
68
+ The disposable install equivalent is:
69
+
70
+ ```bash
71
+ npm run demo:external -- --cleanup
72
+ ```
73
+
74
+ Expected target outputs:
75
+
76
+ - `.harness/install-state.json`
77
+ - `.harness/state/sessions/`
78
+ - `.harness/state/sessions/release-run-smoke/run-summary.json`
79
+ - `.claude/`
80
+ - `.codex/config.toml`
81
+ - `.cursor/hooks.json`
82
+ - `.gemini/GEMINI.md`
83
+ - `.opencode/config.json`
84
+
85
+ The one-command workflow equivalent is:
86
+
87
+ ```bash
88
+ npm run demo:quick -- --cleanup
89
+ ```
90
+
91
+ Expected quick-demo outputs:
92
+
93
+ - `.harness/state/sessions/<session>/work-summary.json`
94
+ - `.harness/state/sessions/<session>/verify-summary.json`
95
+ - `.harness/state/sessions/<session>/ship-summary.json`
96
+ - `.harness/state/sessions/<session>/run-summary.json`
97
+
98
+ ## Full Builder Smoke
99
+
100
+ The install profile currently projects the runtime-required Claude/Codex surfaces. The full builder surface is verified separately:
101
+
102
+ ```bash
103
+ HARNESS_PROJECT_ROOT=<target> node scripts/build-claude.js
104
+ HARNESS_PROJECT_ROOT=<target> node scripts/build-codex.js
105
+ HARNESS_PROJECT_ROOT=<target> node scripts/build-cursor.js
106
+ HARNESS_PROJECT_ROOT=<target> node scripts/build-gemini.js
107
+ HARNESS_PROJECT_ROOT=<target> node scripts/build-opencode.js
108
+ ```
109
+
110
+ Expected target outputs:
111
+
112
+ - `.claude/`
113
+ - `.codex/config.toml`
114
+ - `.cursor/hooks.json`
115
+ - `.gemini/GEMINI.md`
116
+ - `.opencode/config.json`
117
+
118
+ ## Not Included
119
+
120
+ - `npm publish`
121
+ - Public package publish execution, pending npm owner auth
122
+ - Internal LLM provider wiring
123
+ - Internal project rollout
124
+ - Automatic apply, commit, push, PR creation, release, or deploy
125
+ - Automatic promotion of learned instincts without human approval
126
+
127
+ ## Public npm Checklist
128
+
129
+ Only run this checklist after the project owner explicitly approves public publishing:
130
+
131
+ 1. Confirm the npm package name is still `@ps-neko/nekowork`.
132
+ 2. Confirm the `harness` binary is still intentional.
133
+ 3. Confirm the public alpha version is `0.1.0-alpha.0`.
134
+ 4. Run the required gates above.
135
+ 5. Inspect `npm pack --dry-run --json` and confirm only intended files are included.
136
+ 6. Confirm npm account access and 2FA readiness with `npm whoami`.
137
+ 7. Confirm `private: false` in `package.json`.
138
+ 8. Publish with `npm publish --access public --tag alpha`.
139
+ 9. Smoke test from a fresh directory with `npx @ps-neko/nekowork@alpha doctor --quick`.
140
+ 10. Restore documentation from "future npm path" to "published npm path" where appropriate.
@@ -0,0 +1,50 @@
1
+ # Risk Classifier
2
+
3
+ NEKOWORK classifies task and file risk before verification and ship readiness. The shared implementation lives in:
4
+
5
+ ```text
6
+ scripts/lib/risk-classifier.js
7
+ ```
8
+
9
+ ## Outputs
10
+
11
+ The classifier returns:
12
+
13
+ - `risk`: `low`, `medium`, `high`, or `critical`
14
+ - `tags`: detected risk categories
15
+ - `requiresCodexChallenge`: whether Codex challenge should run
16
+ - `requiresHumanGate`: whether a human decision is required
17
+ - `sensitive`: whether the work is sensitive for challenge/gate purposes
18
+
19
+ ## Gate-Sensitive Tags
20
+
21
+ | Tag | Examples | Policy |
22
+ |---|---|---|
23
+ | `security` | auth, OAuth, JWT, token, secret, TLS, CSRF, CORS, XSS, webhook | Codex challenge |
24
+ | `financial` | trading, broker, orders, payment, billing, refunds | Codex challenge + Human Gate |
25
+ | `deploy` | production, release, CI/CD, workflows, cloud, infrastructure | Codex challenge + Human Gate |
26
+ | `data` | database migration, delete, truncate, PII, rollback-sensitive work | Codex challenge |
27
+ | `product-ui` | UI, UX, frontend, dashboard, mockup, prototype | scope questions |
28
+
29
+ Critical verification findings always require Human Gate.
30
+
31
+ ## Current Enforcement
32
+
33
+ - `ask` uses the classifier to shape questions and draft success criteria.
34
+ - `dispatch` records classifier risk in routing traces.
35
+ - `verify` uses it to decide Codex challenge and risk-policy Human Gate.
36
+ - `ship` rechecks risk policy so seeded or manually edited sessions cannot bypass a gate.
37
+
38
+ ## Human Gate Reasons
39
+
40
+ Verification handoffs trigger gate reasons when:
41
+
42
+ - a Codex handoff returns `verdict: block`
43
+ - any issue has `severity: critical`
44
+ - task/file policy requires a human gate, such as financial or deploy-sensitive work
45
+
46
+ The gate marker is written as:
47
+
48
+ ```text
49
+ .harness/state/sessions/<id>/HUMAN_GATE
50
+ ```
@@ -0,0 +1,146 @@
1
+ # Runbook
2
+
3
+ This is the operator checklist for maintaining NEKOWORK.
4
+
5
+ ## Daily Health
6
+
7
+ ```bash
8
+ git status --short --branch
9
+ node scripts/cli.js doctor
10
+ npm run lint
11
+ npm test
12
+ npm audit --audit-level=moderate
13
+ ```
14
+
15
+ `doctor` exits with failure if required freshness checks fail. Use `--quick` for a faster local environment check. Use `node scripts/cli.js doctor --quick --gemini-smoke` when Gemini live auth readiness matters for the release or machine being checked.
16
+
17
+ ## Catalog Changes
18
+
19
+ When changing `agent.yaml`, `agents/`, `skills/`, `hooks/`, `rules/`, `manifests/`, or generated docs:
20
+
21
+ ```bash
22
+ npm run lint
23
+ node scripts/repair.js
24
+ node scripts/sync-claude-md.js
25
+ node scripts/build-codemaps.js
26
+ node scripts/repair.js --check
27
+ node scripts/sync-claude-md.js --check
28
+ node scripts/build-codemaps.js --check
29
+ ```
30
+
31
+ Then run:
32
+
33
+ ```bash
34
+ npm test
35
+ ```
36
+
37
+ Profile changes must also preserve the profile safety validator:
38
+
39
+ - every profile keeps the core modules
40
+ - no profile can disable Codex verification or Human Gate
41
+ - mutation policy cannot become parallel or unrestricted by profile default
42
+ - outbound network cannot become unrestricted by profile default
43
+
44
+ The validator runs through `npm run lint`.
45
+
46
+ ## Project Install Smoke
47
+
48
+ Use a temporary target project:
49
+
50
+ ```bash
51
+ node scripts/portability/simulate-port.js <target> --profile developer --verbose
52
+ node scripts/install-apply.js --profile developer --project-root <target>
53
+ node scripts/cli.js doctor --project-root <target> --quick
54
+ node scripts/cli.js plan "release smoke" --project-root <target> --session release-smoke
55
+ node scripts/cli.js run "release decomposed smoke" --project-root <target> --session release-run-smoke
56
+ ```
57
+
58
+ Expected target outputs:
59
+
60
+ - `.harness/install-state.json`
61
+ - `.harness/state/sessions/release-smoke/`
62
+ - `.harness/state/sessions/release-run-smoke/run-summary.json`
63
+ - `.claude/`
64
+ - `.codex/config.toml`
65
+ - `.cursor/hooks.json`
66
+ - `.gemini/GEMINI.md`
67
+ - `.opencode/config.json`
68
+
69
+ ## Release Gates
70
+
71
+ Before a tag, GitHub Release, or npm publish decision:
72
+
73
+ ```bash
74
+ npm run lint
75
+ npm test
76
+ npm audit --audit-level=moderate
77
+ node scripts/repair.js --check
78
+ node scripts/sync-claude-md.js --check
79
+ node scripts/build-codemaps.js --check
80
+ npm run security:hardening
81
+ npm pack --dry-run --json
82
+ ```
83
+
84
+ ## Public npm Publish Checklist
85
+
86
+ Do not run this checklist unless public publish is explicitly approved.
87
+
88
+ 1. Confirm `package.json#name` is `@ps-neko/nekowork`.
89
+ 2. Confirm the `harness` binary name is still intentional.
90
+ 3. Run all release gates.
91
+ 4. Inspect `npm pack --dry-run --json`.
92
+ 5. Confirm npm identity with `npm whoami`.
93
+ 6. Confirm account 2FA readiness.
94
+ 7. Confirm `private: false`.
95
+ 8. Confirm the public alpha version, for example `0.1.0-alpha.0`.
96
+ 9. Run `npm publish --access public --tag alpha`.
97
+ 10. Update README, Quickstart, Changelog, and release notes from "future npm path" to "published npm path".
98
+
99
+ ## GitHub Release Checklist
100
+
101
+ ```bash
102
+ git tag -a v0.0.3 -m "HARNESS v0.0.3"
103
+ git push origin v0.0.3
104
+ npm pack --json
105
+ gh release create v0.0.3 ps-neko-nekowork-0.0.3.tgz --title "HARNESS v0.0.3" --prerelease --notes-file <notes.md>
106
+ ```
107
+
108
+ Remove the local tarball after it is uploaded.
109
+
110
+ ## Advanced Operations
111
+
112
+ Advanced workflows are documented in [ADVANCED.md](ADVANCED.md):
113
+
114
+ - `team-lite`
115
+ - `ralph`
116
+ - `wait`
117
+ - `instincts`
118
+ - cost tracking
119
+ - Rust runtime
120
+
121
+ ## Troubleshooting
122
+
123
+ `doctor` reports API key warnings:
124
+
125
+ - Unset provider API keys for delegated local CLI auth.
126
+ - Keep `HARNESS_AUTH_ALLOW_ENV_OVERRIDE=1` only for intentional metered paths.
127
+
128
+ `repair --check` fails:
129
+
130
+ - Run `node scripts/repair.js`.
131
+ - Re-run `node scripts/repair.js --check`.
132
+
133
+ `sync-claude-md --check` fails:
134
+
135
+ - Run `node scripts/sync-claude-md.js`.
136
+
137
+ `build-codemaps --check` fails:
138
+
139
+ - Run `node scripts/build-codemaps.js`.
140
+
141
+ CI fails on security hardening:
142
+
143
+ - Check workflow permissions.
144
+ - Check job timeouts.
145
+ - Check MCP pins and HTTPS URLs.
146
+ - Check package-lock and dependency specs.