@gcunharodrigues/wrxn 0.1.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 (102) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +38 -0
  3. package/bin/wrxn.cjs +342 -0
  4. package/lib/connect.cjs +216 -0
  5. package/lib/executor.cjs +238 -0
  6. package/lib/install.cjs +105 -0
  7. package/lib/manifest.cjs +67 -0
  8. package/lib/migrate.cjs +93 -0
  9. package/lib/onboard.cjs +84 -0
  10. package/lib/semver.cjs +14 -0
  11. package/lib/update.cjs +91 -0
  12. package/lib/worktree.cjs +217 -0
  13. package/manifest.json +451 -0
  14. package/migrations/README.md +21 -0
  15. package/package.json +23 -0
  16. package/payload/.claude/constitution.local.md +13 -0
  17. package/payload/.claude/constitution.md +28 -0
  18. package/payload/.claude/hooks/code-intel-push.cjs +108 -0
  19. package/payload/.claude/hooks/enforce-managed-guard.cjs +68 -0
  20. package/payload/.claude/hooks/enforce-managed-precommit.cjs +74 -0
  21. package/payload/.claude/hooks/enforce-push-authority.cjs +51 -0
  22. package/payload/.claude/hooks/enforce-review-marker.cjs +62 -0
  23. package/payload/.claude/hooks/enforce-tests-on-push.cjs +40 -0
  24. package/payload/.claude/hooks/recall-surface.cjs +127 -0
  25. package/payload/.claude/hooks/reference-detect.cjs +83 -0
  26. package/payload/.claude/hooks/session-end.cjs +132 -0
  27. package/payload/.claude/hooks/session-history.cjs +76 -0
  28. package/payload/.claude/hooks/session-start.cjs +117 -0
  29. package/payload/.claude/hooks/synapse-engine.cjs +351 -0
  30. package/payload/.claude/hooks/wiki-lint.cjs +104 -0
  31. package/payload/.claude/settings.json +60 -0
  32. package/payload/.claude/skills/audit/SKILL.md +23 -0
  33. package/payload/.claude/skills/diagnose/SKILL.md +117 -0
  34. package/payload/.claude/skills/diagnose/scripts/hitl-loop.template.sh +41 -0
  35. package/payload/.claude/skills/grill-me/SKILL.md +10 -0
  36. package/payload/.claude/skills/grill-with-docs/ADR-FORMAT.md +47 -0
  37. package/payload/.claude/skills/grill-with-docs/CONTEXT-FORMAT.md +60 -0
  38. package/payload/.claude/skills/grill-with-docs/SKILL.md +88 -0
  39. package/payload/.claude/skills/handoff/SKILL.md +19 -0
  40. package/payload/.claude/skills/improve-codebase-architecture/DEEPENING.md +37 -0
  41. package/payload/.claude/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  42. package/payload/.claude/skills/improve-codebase-architecture/INTERFACE-DESIGN.md +44 -0
  43. package/payload/.claude/skills/improve-codebase-architecture/LANGUAGE.md +53 -0
  44. package/payload/.claude/skills/improve-codebase-architecture/SKILL.md +81 -0
  45. package/payload/.claude/skills/level-up/SKILL.md +28 -0
  46. package/payload/.claude/skills/memory/SKILL.md +79 -0
  47. package/payload/.claude/skills/onboard/SKILL.md +43 -0
  48. package/payload/.claude/skills/prototype/LOGIC.md +79 -0
  49. package/payload/.claude/skills/prototype/SKILL.md +30 -0
  50. package/payload/.claude/skills/prototype/UI.md +112 -0
  51. package/payload/.claude/skills/qa-walk/SKILL.md +227 -0
  52. package/payload/.claude/skills/qa-walk/references/cli-mode.md +28 -0
  53. package/payload/.claude/skills/qa-walk/references/finding-issue-template.md +48 -0
  54. package/payload/.claude/skills/qa-walk/references/walk-report-template.md +56 -0
  55. package/payload/.claude/skills/qa-walk/references/web-mode.md +112 -0
  56. package/payload/.claude/skills/setup-matt-pocock-skills/SKILL.md +121 -0
  57. package/payload/.claude/skills/setup-matt-pocock-skills/domain.md +51 -0
  58. package/payload/.claude/skills/setup-matt-pocock-skills/issue-tracker-github.md +22 -0
  59. package/payload/.claude/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +23 -0
  60. package/payload/.claude/skills/setup-matt-pocock-skills/issue-tracker-local.md +19 -0
  61. package/payload/.claude/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  62. package/payload/.claude/skills/skill-creator/LICENSE.txt +202 -0
  63. package/payload/.claude/skills/skill-creator/SKILL.md +209 -0
  64. package/payload/.claude/skills/skill-creator/scripts/init_skill.py +303 -0
  65. package/payload/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
  66. package/payload/.claude/skills/skill-creator/scripts/quick_validate.py +65 -0
  67. package/payload/.claude/skills/synapse/SKILL.md +132 -0
  68. package/payload/.claude/skills/synapse/assets/README.md +50 -0
  69. package/payload/.claude/skills/synapse/references/brackets.md +100 -0
  70. package/payload/.claude/skills/synapse/references/commands.md +118 -0
  71. package/payload/.claude/skills/synapse/references/domains.md +126 -0
  72. package/payload/.claude/skills/synapse/references/layers.md +186 -0
  73. package/payload/.claude/skills/synapse/references/manifest.md +142 -0
  74. package/payload/.claude/skills/tdd/SKILL.md +22 -0
  75. package/payload/.claude/skills/tech-search/SKILL.md +431 -0
  76. package/payload/.claude/skills/tech-search/prompts/page-extract.md +133 -0
  77. package/payload/.claude/skills/to-issues/SKILL.md +83 -0
  78. package/payload/.claude/skills/to-prd/SKILL.md +74 -0
  79. package/payload/.claude/skills/triage/AGENT-BRIEF.md +168 -0
  80. package/payload/.claude/skills/triage/OUT-OF-SCOPE.md +101 -0
  81. package/payload/.claude/skills/triage/SKILL.md +103 -0
  82. package/payload/.claude/skills/write-a-skill/SKILL.md +117 -0
  83. package/payload/.recon.json +3 -0
  84. package/payload/.synapse/global +6 -0
  85. package/payload/.synapse/manifest +38 -0
  86. package/payload/.synapse/pipeline +6 -0
  87. package/payload/.synapse/routing +8 -0
  88. package/payload/.wrxn/continuity/.gitkeep +0 -0
  89. package/payload/.wrxn/history/.gitkeep +0 -0
  90. package/payload/.wrxn/wiki/.gitkeep +0 -0
  91. package/payload/.wrxn/wiki/concepts/.gitkeep +0 -0
  92. package/payload/.wrxn/wiki/decisions/.gitkeep +0 -0
  93. package/payload/.wrxn/wiki/gotchas/.gitkeep +0 -0
  94. package/payload/.wrxn/wiki/sessions/.gitkeep +0 -0
  95. package/payload/.wrxn/wiki.cjs +164 -0
  96. package/payload/aios-intake.md +32 -0
  97. package/payload/connections.md +15 -0
  98. package/payload/decisions/log.md +18 -0
  99. package/payload/docs/agents/domain.md +38 -0
  100. package/payload/docs/agents/issue-tracker.md +25 -0
  101. package/payload/docs/agents/triage-labels.md +15 -0
  102. package/payload/docs/workspace/operator-layer.md +14 -0
package/manifest.json ADDED
@@ -0,0 +1,451 @@
1
+ {
2
+ "$schema": "internal://wrxn-manifest/v1",
3
+ "version": "1",
4
+ "description": "The file-class manifest: the single source of truth for what `wrxn init` lays and how each file is governed on update. Every payload file MUST be classified. Three classes: managed (kernel-owned, overwritten on update), seeded (created once at init, never overwritten), state (project-owned, kernel never touches contents). The installer refuses any payload file absent from this manifest and any class not in {managed,seeded,state}.",
5
+ "classes": [
6
+ "managed",
7
+ "seeded",
8
+ "state"
9
+ ],
10
+ "files": [
11
+ {
12
+ "path": ".claude/constitution.local.md",
13
+ "class": "seeded",
14
+ "profile": "project"
15
+ },
16
+ {
17
+ "path": ".claude/constitution.md",
18
+ "class": "managed",
19
+ "profile": "project"
20
+ },
21
+ {
22
+ "path": ".claude/hooks/code-intel-push.cjs",
23
+ "class": "managed",
24
+ "profile": "project"
25
+ },
26
+ {
27
+ "path": ".claude/hooks/enforce-managed-guard.cjs",
28
+ "class": "managed",
29
+ "profile": "project"
30
+ },
31
+ {
32
+ "path": ".claude/hooks/enforce-managed-precommit.cjs",
33
+ "class": "managed",
34
+ "profile": "project"
35
+ },
36
+ {
37
+ "path": ".claude/hooks/enforce-push-authority.cjs",
38
+ "class": "managed",
39
+ "profile": "project"
40
+ },
41
+ {
42
+ "path": ".claude/hooks/enforce-review-marker.cjs",
43
+ "class": "managed",
44
+ "profile": "project"
45
+ },
46
+ {
47
+ "path": ".claude/hooks/enforce-tests-on-push.cjs",
48
+ "class": "managed",
49
+ "profile": "project"
50
+ },
51
+ {
52
+ "path": ".claude/hooks/recall-surface.cjs",
53
+ "class": "managed",
54
+ "profile": "project"
55
+ },
56
+ {
57
+ "path": ".claude/hooks/reference-detect.cjs",
58
+ "class": "managed",
59
+ "profile": "project"
60
+ },
61
+ {
62
+ "path": ".claude/hooks/session-end.cjs",
63
+ "class": "managed",
64
+ "profile": "project"
65
+ },
66
+ {
67
+ "path": ".claude/hooks/session-history.cjs",
68
+ "class": "managed",
69
+ "profile": "project"
70
+ },
71
+ {
72
+ "path": ".claude/hooks/session-start.cjs",
73
+ "class": "managed",
74
+ "profile": "project"
75
+ },
76
+ {
77
+ "path": ".claude/hooks/synapse-engine.cjs",
78
+ "class": "managed",
79
+ "profile": "project"
80
+ },
81
+ {
82
+ "path": ".claude/hooks/wiki-lint.cjs",
83
+ "class": "managed",
84
+ "profile": "project"
85
+ },
86
+ {
87
+ "path": ".claude/settings.json",
88
+ "class": "managed",
89
+ "profile": "project"
90
+ },
91
+ {
92
+ "path": ".claude/skills/diagnose/SKILL.md",
93
+ "class": "managed",
94
+ "profile": "project"
95
+ },
96
+ {
97
+ "path": ".claude/skills/diagnose/scripts/hitl-loop.template.sh",
98
+ "class": "managed",
99
+ "profile": "project"
100
+ },
101
+ {
102
+ "path": ".claude/skills/grill-me/SKILL.md",
103
+ "class": "managed",
104
+ "profile": "project"
105
+ },
106
+ {
107
+ "path": ".claude/skills/grill-with-docs/ADR-FORMAT.md",
108
+ "class": "managed",
109
+ "profile": "project"
110
+ },
111
+ {
112
+ "path": ".claude/skills/grill-with-docs/CONTEXT-FORMAT.md",
113
+ "class": "managed",
114
+ "profile": "project"
115
+ },
116
+ {
117
+ "path": ".claude/skills/grill-with-docs/SKILL.md",
118
+ "class": "managed",
119
+ "profile": "project"
120
+ },
121
+ {
122
+ "path": ".claude/skills/handoff/SKILL.md",
123
+ "class": "managed",
124
+ "profile": "project"
125
+ },
126
+ {
127
+ "path": ".claude/skills/improve-codebase-architecture/DEEPENING.md",
128
+ "class": "managed",
129
+ "profile": "project"
130
+ },
131
+ {
132
+ "path": ".claude/skills/improve-codebase-architecture/HTML-REPORT.md",
133
+ "class": "managed",
134
+ "profile": "project"
135
+ },
136
+ {
137
+ "path": ".claude/skills/improve-codebase-architecture/INTERFACE-DESIGN.md",
138
+ "class": "managed",
139
+ "profile": "project"
140
+ },
141
+ {
142
+ "path": ".claude/skills/improve-codebase-architecture/LANGUAGE.md",
143
+ "class": "managed",
144
+ "profile": "project"
145
+ },
146
+ {
147
+ "path": ".claude/skills/improve-codebase-architecture/SKILL.md",
148
+ "class": "managed",
149
+ "profile": "project"
150
+ },
151
+ {
152
+ "path": ".claude/skills/memory/SKILL.md",
153
+ "class": "managed",
154
+ "profile": "project"
155
+ },
156
+ {
157
+ "path": ".claude/skills/prototype/LOGIC.md",
158
+ "class": "managed",
159
+ "profile": "project"
160
+ },
161
+ {
162
+ "path": ".claude/skills/prototype/SKILL.md",
163
+ "class": "managed",
164
+ "profile": "project"
165
+ },
166
+ {
167
+ "path": ".claude/skills/prototype/UI.md",
168
+ "class": "managed",
169
+ "profile": "project"
170
+ },
171
+ {
172
+ "path": ".claude/skills/qa-walk/SKILL.md",
173
+ "class": "managed",
174
+ "profile": "project"
175
+ },
176
+ {
177
+ "path": ".claude/skills/qa-walk/references/cli-mode.md",
178
+ "class": "managed",
179
+ "profile": "project"
180
+ },
181
+ {
182
+ "path": ".claude/skills/qa-walk/references/finding-issue-template.md",
183
+ "class": "managed",
184
+ "profile": "project"
185
+ },
186
+ {
187
+ "path": ".claude/skills/qa-walk/references/walk-report-template.md",
188
+ "class": "managed",
189
+ "profile": "project"
190
+ },
191
+ {
192
+ "path": ".claude/skills/qa-walk/references/web-mode.md",
193
+ "class": "managed",
194
+ "profile": "project"
195
+ },
196
+ {
197
+ "path": ".claude/skills/setup-matt-pocock-skills/SKILL.md",
198
+ "class": "managed",
199
+ "profile": "project"
200
+ },
201
+ {
202
+ "path": ".claude/skills/setup-matt-pocock-skills/domain.md",
203
+ "class": "managed",
204
+ "profile": "project"
205
+ },
206
+ {
207
+ "path": ".claude/skills/setup-matt-pocock-skills/issue-tracker-github.md",
208
+ "class": "managed",
209
+ "profile": "project"
210
+ },
211
+ {
212
+ "path": ".claude/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md",
213
+ "class": "managed",
214
+ "profile": "project"
215
+ },
216
+ {
217
+ "path": ".claude/skills/setup-matt-pocock-skills/issue-tracker-local.md",
218
+ "class": "managed",
219
+ "profile": "project"
220
+ },
221
+ {
222
+ "path": ".claude/skills/setup-matt-pocock-skills/triage-labels.md",
223
+ "class": "managed",
224
+ "profile": "project"
225
+ },
226
+ {
227
+ "path": ".claude/skills/skill-creator/LICENSE.txt",
228
+ "class": "managed",
229
+ "profile": "project"
230
+ },
231
+ {
232
+ "path": ".claude/skills/skill-creator/SKILL.md",
233
+ "class": "managed",
234
+ "profile": "project"
235
+ },
236
+ {
237
+ "path": ".claude/skills/skill-creator/scripts/init_skill.py",
238
+ "class": "managed",
239
+ "profile": "project"
240
+ },
241
+ {
242
+ "path": ".claude/skills/skill-creator/scripts/package_skill.py",
243
+ "class": "managed",
244
+ "profile": "project"
245
+ },
246
+ {
247
+ "path": ".claude/skills/skill-creator/scripts/quick_validate.py",
248
+ "class": "managed",
249
+ "profile": "project"
250
+ },
251
+ {
252
+ "path": ".claude/skills/synapse/SKILL.md",
253
+ "class": "managed",
254
+ "profile": "project"
255
+ },
256
+ {
257
+ "path": ".claude/skills/synapse/assets/README.md",
258
+ "class": "managed",
259
+ "profile": "project"
260
+ },
261
+ {
262
+ "path": ".claude/skills/synapse/references/brackets.md",
263
+ "class": "managed",
264
+ "profile": "project"
265
+ },
266
+ {
267
+ "path": ".claude/skills/synapse/references/commands.md",
268
+ "class": "managed",
269
+ "profile": "project"
270
+ },
271
+ {
272
+ "path": ".claude/skills/synapse/references/domains.md",
273
+ "class": "managed",
274
+ "profile": "project"
275
+ },
276
+ {
277
+ "path": ".claude/skills/synapse/references/layers.md",
278
+ "class": "managed",
279
+ "profile": "project"
280
+ },
281
+ {
282
+ "path": ".claude/skills/synapse/references/manifest.md",
283
+ "class": "managed",
284
+ "profile": "project"
285
+ },
286
+ {
287
+ "path": ".claude/skills/tdd/SKILL.md",
288
+ "class": "managed",
289
+ "profile": "project"
290
+ },
291
+ {
292
+ "path": ".claude/skills/tech-search/SKILL.md",
293
+ "class": "managed",
294
+ "profile": "project"
295
+ },
296
+ {
297
+ "path": ".claude/skills/tech-search/prompts/page-extract.md",
298
+ "class": "managed",
299
+ "profile": "project"
300
+ },
301
+ {
302
+ "path": ".claude/skills/to-issues/SKILL.md",
303
+ "class": "managed",
304
+ "profile": "project"
305
+ },
306
+ {
307
+ "path": ".claude/skills/to-prd/SKILL.md",
308
+ "class": "managed",
309
+ "profile": "project"
310
+ },
311
+ {
312
+ "path": ".claude/skills/triage/AGENT-BRIEF.md",
313
+ "class": "managed",
314
+ "profile": "project"
315
+ },
316
+ {
317
+ "path": ".claude/skills/triage/OUT-OF-SCOPE.md",
318
+ "class": "managed",
319
+ "profile": "project"
320
+ },
321
+ {
322
+ "path": ".claude/skills/triage/SKILL.md",
323
+ "class": "managed",
324
+ "profile": "project"
325
+ },
326
+ {
327
+ "path": ".claude/skills/write-a-skill/SKILL.md",
328
+ "class": "managed",
329
+ "profile": "project"
330
+ },
331
+ {
332
+ "path": ".claude/skills/audit/SKILL.md",
333
+ "class": "managed",
334
+ "profile": "workspace"
335
+ },
336
+ {
337
+ "path": ".claude/skills/level-up/SKILL.md",
338
+ "class": "managed",
339
+ "profile": "workspace"
340
+ },
341
+ {
342
+ "path": ".claude/skills/onboard/SKILL.md",
343
+ "class": "managed",
344
+ "profile": "workspace"
345
+ },
346
+ {
347
+ "path": "aios-intake.md",
348
+ "class": "seeded",
349
+ "profile": "workspace"
350
+ },
351
+ {
352
+ "path": "connections.md",
353
+ "class": "seeded",
354
+ "profile": "workspace"
355
+ },
356
+ {
357
+ "path": "decisions/log.md",
358
+ "class": "seeded",
359
+ "profile": "workspace"
360
+ },
361
+ {
362
+ "path": ".recon.json",
363
+ "class": "seeded",
364
+ "profile": "project"
365
+ },
366
+ {
367
+ "path": ".synapse/global",
368
+ "class": "managed",
369
+ "profile": "project"
370
+ },
371
+ {
372
+ "path": ".synapse/manifest",
373
+ "class": "managed",
374
+ "profile": "project"
375
+ },
376
+ {
377
+ "path": ".synapse/pipeline",
378
+ "class": "managed",
379
+ "profile": "project"
380
+ },
381
+ {
382
+ "path": ".synapse/routing",
383
+ "class": "seeded",
384
+ "profile": "project"
385
+ },
386
+ {
387
+ "path": ".wrxn/continuity/.gitkeep",
388
+ "class": "state",
389
+ "profile": "project"
390
+ },
391
+ {
392
+ "path": ".wrxn/history/.gitkeep",
393
+ "class": "state",
394
+ "profile": "project"
395
+ },
396
+ {
397
+ "path": ".wrxn/wiki.cjs",
398
+ "class": "managed",
399
+ "profile": "project"
400
+ },
401
+ {
402
+ "path": ".wrxn/wiki/.gitkeep",
403
+ "class": "state",
404
+ "profile": "project"
405
+ },
406
+ {
407
+ "path": ".wrxn/wiki/concepts/.gitkeep",
408
+ "class": "state",
409
+ "profile": "project"
410
+ },
411
+ {
412
+ "path": ".wrxn/wiki/decisions/.gitkeep",
413
+ "class": "state",
414
+ "profile": "project"
415
+ },
416
+ {
417
+ "path": ".wrxn/wiki/gotchas/.gitkeep",
418
+ "class": "state",
419
+ "profile": "project"
420
+ },
421
+ {
422
+ "path": ".wrxn/wiki/sessions/.gitkeep",
423
+ "class": "state",
424
+ "profile": "project"
425
+ },
426
+ {
427
+ "path": "docs/agents/domain.md",
428
+ "class": "seeded",
429
+ "profile": "project"
430
+ },
431
+ {
432
+ "path": "docs/agents/issue-tracker.md",
433
+ "class": "seeded",
434
+ "profile": "project"
435
+ },
436
+ {
437
+ "path": "docs/agents/triage-labels.md",
438
+ "class": "seeded",
439
+ "profile": "project"
440
+ },
441
+ {
442
+ "path": "docs/workspace/operator-layer.md",
443
+ "class": "seeded",
444
+ "profile": "workspace"
445
+ }
446
+ ],
447
+ "profiles": [
448
+ "project",
449
+ "workspace"
450
+ ]
451
+ }
@@ -0,0 +1,21 @@
1
+ # Migrations
2
+
3
+ Breaking kernel changes ship as ordered, run-once migration scripts (PRD US8). `wrxn update` runs
4
+ any pending migration whose `version` the install has reached, in `id` order, recording each in the
5
+ install receipt's `migrationsApplied`. A throwing migration halts the update and is left pending, so
6
+ the next `wrxn update` resumes from it (already-applied migrations never re-run).
7
+
8
+ A migration is a `.cjs` file in this directory:
9
+
10
+ ```js
11
+ // migrations/001-rename-wiki-tier.cjs
12
+ module.exports = {
13
+ id: '001', // orderable; migrations run in id order (default: filename without .cjs)
14
+ version: '0.2.0', // the release this ships with — runs once the install reaches it
15
+ up(ctx) { // ctx = { target, fromVersion, toVersion }; throw to fail (resumable)
16
+ // transform the install at ctx.target to be compatible with the new kernel
17
+ },
18
+ };
19
+ ```
20
+
21
+ No migrations ship yet — this directory documents the contract. Add one only with a breaking change.
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@gcunharodrigues/wrxn",
3
+ "version": "0.1.0",
4
+ "description": "WRXN Kernel — installable AI operating system. Two profiles (project | workspace), pull-based updates, managed/seeded/state file classes.",
5
+ "bin": {
6
+ "wrxn": "bin/wrxn.cjs"
7
+ },
8
+ "files": [
9
+ "bin",
10
+ "lib",
11
+ "payload",
12
+ "migrations",
13
+ "manifest.json"
14
+ ],
15
+ "scripts": {
16
+ "test": "node --test"
17
+ },
18
+ "engines": {
19
+ "node": ">=20"
20
+ },
21
+ "license": "MIT",
22
+ "private": false
23
+ }
@@ -0,0 +1,13 @@
1
+ # Project Constitution Addendum (seeded)
2
+
3
+ Created once at `wrxn init`. **The kernel never overwrites this file** — it is yours.
4
+ Record project-local conventions and the demoted universal preferences here.
5
+
6
+ ## Seeded defaults
7
+
8
+ - **CLI-First** — new capability works via CLI before any UI; dashboards observe, never control.
9
+ - **Import style** — prefer absolute imports; same-module relative imports are fine.
10
+
11
+ ## Project-local additions
12
+
13
+ <!-- Add your project's own conventions below. -->
@@ -0,0 +1,28 @@
1
+ # WRXN Constitution
2
+
3
+ The four universal articles. Managed law: kernel-owned, overwritten on `wrxn update`.
4
+ Project-local preferences live in the seeded `constitution.local.md` addendum, never here.
5
+
6
+ ## Article I — Agent Authority (NON-NEGOTIABLE)
7
+
8
+ - `git push`, PR creation, and release tags are EXCLUSIVE to the devops role.
9
+ - An agent acts only within its scope; it delegates when out of scope and never assumes
10
+ another agent's authority.
11
+
12
+ ## Article II — Issue-Driven (supersedes Story-Driven)
13
+
14
+ - The unit of work is an **issue with acceptance criteria**. No code is written without one.
15
+ - Acceptance criteria are explicit before implementation; progress is tracked against them.
16
+ - Issues are cut as vertical tracer-bullet slices — each independently buildable and walkable.
17
+
18
+ ## Article III — Quality-First
19
+
20
+ - Tests and typecheck pass on every commit; the full suite green is the push gate.
21
+ - Code review and security review gate integration; functional QA walks the real artifact.
22
+ - Coverage does not decrease.
23
+
24
+ ## Article IV — No-Invention
25
+
26
+ - Every claim in a spec traces to a stated requirement or a researched source.
27
+ - Do not add features absent from the requirements, assume unresearched implementation
28
+ details, or specify unvalidated technologies.
@@ -0,0 +1,108 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ // WRXN code-intel-push hook — first-touch code-intel / recon-freshness nudge (wrxn-kernel-11).
5
+ // PostToolUse (Edit|Write). On the FIRST touch of a code file this session it injects a <code-intel>
6
+ // nudge: where a recon graph exists it notes freshness (commit lag) and points at recon; absent a
7
+ // graph it nudges to build one. First-touch-GATED per session+file (a touched-list under
8
+ // .wrxn/history/<sid>.touched) so a repeat edit of the same file is silent — no per-edit spam.
9
+ //
10
+ // Self-contained: ships into installs, MUST NOT import the kernel lib (node stdlib only).
11
+ // Fail-open + recursion-safe: it only READS + appends to its own state file; any fault emits {}.
12
+ //
13
+ // Contract: PostToolUse event JSON on stdin → envelope JSON on stdout (exit 0).
14
+
15
+ const fs = require('fs');
16
+ const path = require('path');
17
+
18
+ const CODE_EXT = ['.cjs', '.js', '.mjs', '.ts', '.tsx', '.py', '.go', '.rs', '.java', '.rb'];
19
+
20
+ function emit(envelope) {
21
+ process.stdout.write(JSON.stringify(envelope));
22
+ process.exit(0);
23
+ }
24
+
25
+ function findInstallRoot(startDir) {
26
+ let dir = startDir || process.env.CLAUDE_PROJECT_DIR || process.cwd();
27
+ for (let i = 0; i < 12; i++) {
28
+ if (fs.existsSync(path.join(dir, 'wrxn.install.json'))) return dir;
29
+ const up = path.dirname(dir);
30
+ if (up === dir) break;
31
+ dir = up;
32
+ }
33
+ return null;
34
+ }
35
+
36
+ function safeId(sid) {
37
+ return String(sid || 'session')
38
+ .toLowerCase()
39
+ .replace(/[^a-z0-9]+/g, '-')
40
+ .replace(/^-+|-+$/g, '')
41
+ .slice(0, 48) || 'session';
42
+ }
43
+
44
+ // First-touch gate: append relPath to .wrxn/history/<sid>.touched; return true only the FIRST time
45
+ // this session sees this file. Hooks fire serially within a session, so a plain read-then-append is
46
+ // race-free. Fail-open: on any state error, treat as first touch (nudge once is safer than silence).
47
+ function isFirstTouch(root, sid, relPath) {
48
+ const dir = path.join(root, '.wrxn', 'history');
49
+ const marker = path.join(dir, `${safeId(sid)}.touched`);
50
+ try {
51
+ const seen = fs.existsSync(marker)
52
+ ? fs.readFileSync(marker, 'utf8').split('\n').map((l) => l.trim()).filter(Boolean)
53
+ : [];
54
+ if (seen.includes(relPath)) return false;
55
+ fs.mkdirSync(dir, { recursive: true });
56
+ fs.appendFileSync(marker, `${relPath}\n`);
57
+ return true;
58
+ } catch {
59
+ return true;
60
+ }
61
+ }
62
+
63
+ // A short freshness note: stale (or unknown) when the recon graph's commit doesn't prefix-match HEAD.
64
+ function freshnessNote(root) {
65
+ const graph = path.join(root, '.recon', 'graph.json');
66
+ if (!fs.existsSync(graph)) {
67
+ return 'No recon graph (.recon/graph.json absent) — build it for code-connection enrichment, then reindex.';
68
+ }
69
+ return 'recon graph present — reindex if it lags your edits (the graph is rebuilt at session close).';
70
+ }
71
+
72
+ function main() {
73
+ let event = {};
74
+ try {
75
+ const stdin = fs.readFileSync(0, 'utf8');
76
+ if (stdin.trim()) event = JSON.parse(stdin);
77
+ } catch {
78
+ emit({});
79
+ }
80
+
81
+ const root = findInstallRoot();
82
+ if (!root) emit({});
83
+
84
+ const filePath = event.tool_input && event.tool_input.file_path;
85
+ if (!filePath || typeof filePath !== 'string') emit({}); // not a file-touching tool
86
+ if (!CODE_EXT.some((ext) => filePath.endsWith(ext))) emit({}); // non-code → silent
87
+
88
+ const relPath = (path.isAbsolute(filePath) ? path.relative(root, filePath) : filePath)
89
+ .split(path.sep)
90
+ .join('/');
91
+
92
+ if (!isFirstTouch(root, event.session_id, relPath)) emit({}); // gated repeat → silent
93
+
94
+ const ctx = [
95
+ '<code-intel>',
96
+ `Touched ${relPath} (first this session).`,
97
+ freshnessNote(root),
98
+ '</code-intel>',
99
+ ].join('\n');
100
+
101
+ emit({ hookSpecificOutput: { hookEventName: 'PostToolUse', additionalContext: ctx } });
102
+ }
103
+
104
+ try {
105
+ main();
106
+ } catch {
107
+ emit({});
108
+ }