opencode-code-archaeology 2.0.2 → 2.2.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 (58) hide show
  1. package/.github/pull_request_template.md +1 -0
  2. package/.github/workflows/release.yml +46 -0
  3. package/AGENTS.md +42 -10
  4. package/CHANGELOG.md +59 -0
  5. package/CONTRIBUTING.md +2 -0
  6. package/INSTALL.md +90 -20
  7. package/README.md +90 -29
  8. package/VERSION +1 -1
  9. package/assets/code-archaeology-banner.svg +173 -44
  10. package/commands/code-archaeology.md +7 -5
  11. package/dist/cli.js +28 -2
  12. package/dist/cli.js.map +1 -1
  13. package/dist/index.d.ts +1 -5
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +1 -17
  16. package/dist/index.js.map +1 -1
  17. package/dist/platform.d.ts +4 -0
  18. package/dist/platform.d.ts.map +1 -0
  19. package/dist/platform.js +11 -0
  20. package/dist/platform.js.map +1 -0
  21. package/dist/plugin.d.ts +2 -2
  22. package/dist/plugin.d.ts.map +1 -1
  23. package/dist/plugin.js +2 -1
  24. package/dist/plugin.js.map +1 -1
  25. package/dist/runtime.d.ts +18 -0
  26. package/dist/runtime.d.ts.map +1 -0
  27. package/dist/runtime.js +49 -0
  28. package/dist/runtime.js.map +1 -0
  29. package/dist/types.d.ts +1 -6
  30. package/dist/types.d.ts.map +1 -1
  31. package/dist/types.js.map +1 -1
  32. package/docs/ARCHITECTURE.md +41 -10
  33. package/docs/INSTALL.md +50 -11
  34. package/docs/README.md +37 -9
  35. package/docs/RELEASE.md +20 -16
  36. package/docs/index.html +740 -0
  37. package/hooks/hermes/runner.ps1 +247 -0
  38. package/hooks/hermes/runner.sh +262 -0
  39. package/hooks/hermes/setup.ps1 +41 -0
  40. package/hooks/hermes/setup.sh +41 -0
  41. package/hooks/opencode/init.ps1 +83 -0
  42. package/hooks/opencode/revert-phase.ps1 +12 -0
  43. package/hooks/opencode/revert-phase.sh +3 -8
  44. package/hooks/opencode/update-expedition.ps1 +51 -0
  45. package/hooks/opencode/verify-package.sh +1 -0
  46. package/hooks/opencode/verify-phase.ps1 +35 -0
  47. package/hooks/opencode/verify-phase.sh +7 -7
  48. package/hooks/shared/command-utils.ps1 +100 -0
  49. package/package.json +16 -2
  50. package/skills/code-archaeology/SKILL.md +2 -2
  51. package/skills/hermes/INTEGRATION.md +120 -0
  52. package/skills/hermes/README.md +167 -0
  53. package/skills/hermes/code-archaeology-prompt.md +203 -0
  54. package/wiki/Expedition-Workflow.md +3 -1
  55. package/wiki/Home.md +2 -2
  56. package/wiki/Installation.md +2 -0
  57. package/wiki/Release-Process.md +5 -5
  58. package/plugins/code-archaeology.ts +0 -8
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <h1 align="center">Code Archaeology</h1>
2
2
 
3
3
  <p align="center">
4
- <img src="assets/code-archaeology-banner.svg" alt="Code Archaeology OpenCode plugin banner" width="900">
4
+ <img src="assets/code-archaeology-banner.svg" alt="Code Archaeology multi-runtime banner" width="900">
5
5
  </p>
6
6
 
7
7
  <p align="center">
@@ -23,7 +23,9 @@
23
23
  <a href="#release-docs">Release</a>
24
24
  </p>
25
25
 
26
- Code Archaeology is an OpenCode plugin that surveys, catalogs, and safely restores codebases by removing accumulated technical sediment in a fixed, test-gated expedition order.
26
+ Excavate technical debt. Restore with confidence.
27
+
28
+ Code Archaeology is a multi-runtime plugin that surveys, catalogs, and safely restores codebases by removing accumulated technical sediment in a fixed, test-gated expedition order. It runs on **OpenCode** (interactive slash commands) and **Hermes Agent** (cron-based background execution).
27
29
 
28
30
  ```text
29
31
  +---------------------------------------------------------------+
@@ -33,7 +35,8 @@ Code Archaeology is an OpenCode plugin that surveys, catalogs, and safely restor
33
35
  | Review mode | excavate: reports plus mock patches |
34
36
  | Restore mode | applies approved changes with test gates |
35
37
  | Local state | .archaeology/ runtime artifacts |
36
- | Runtime | OpenCode plugin inside the target repo |
38
+ | Runtimes | OpenCode plugin + Hermes Agent cron |
39
+ | Platforms | macOS/Linux (bash) + Windows (PowerShell) |
37
40
  | Expedition order | fixed stratigraphy from survey to catalog |
38
41
  +-------------------+-------------------------------------------+
39
42
  ```
@@ -49,13 +52,16 @@ Code Archaeology runs a systematic excavation of a repository before it changes
49
52
  - Hardens weak types without guessing uncertain replacements.
50
53
  - Finds semantic duplication and error-handling slop while preserving I/O boundaries.
51
54
  - Produces `.archaeology/` reports that stay local to the working repository.
55
+ - Supports both **OpenCode** interactive sessions and **Hermes Agent** cron-based phased execution.
52
56
 
53
57
  ## Installation
54
58
 
55
- For OpenCode, paste this handoff into your agent:
59
+ ### OpenCode
60
+
61
+ Paste this handoff into your agent:
56
62
 
57
63
  ```text
58
- Fetch and follow instructions from https://raw.githubusercontent.com/Maleick/Code-Archaeology/refs/heads/main/INSTALL.md
64
+ Run `npm pack opencode-code-archaeology@2.2.0`, extract the tarball, then open `package/INSTALL.md` from that archive and follow its instructions.
59
65
  ```
60
66
 
61
67
  Recommended plugin install in `opencode.json`:
@@ -63,7 +69,7 @@ Recommended plugin install in `opencode.json`:
63
69
  ```json
64
70
  {
65
71
  "plugin": [
66
- "opencode-code-archaeology@git+https://github.com/Maleick/Code-Archaeology.git"
72
+ "opencode-code-archaeology@2.2.0"
67
73
  ]
68
74
  }
69
75
  ```
@@ -71,30 +77,43 @@ Recommended plugin install in `opencode.json`:
71
77
  Global npm install path:
72
78
 
73
79
  ```bash
74
- npm install -g opencode-code-archaeology
75
- opencode-code-archaeology install
76
- opencode-code-archaeology doctor
77
- opencode-code-archaeology version
80
+ npm install -g opencode-code-archaeology@2.2.0 && opencode-code-archaeology install && opencode-code-archaeology doctor
78
81
  ```
79
82
 
80
83
  One-time package runner path, if your OpenCode setup supports package execution through Bun:
81
84
 
82
85
  ```bash
83
- bunx opencode-code-archaeology install
84
- bunx opencode-code-archaeology doctor
86
+ bunx opencode-code-archaeology@2.2.0 install
87
+ bunx opencode-code-archaeology@2.2.0 doctor
88
+ ```
89
+
90
+ ### Hermes Agent
91
+
92
+ ```bash
93
+ npm install -g opencode-code-archaeology@2.2.0
94
+ cd ~/projects/Code-Archaeology
95
+ bash hooks/hermes/setup.sh
96
+
97
+ hermes cronjob create \
98
+ --name "code-archaeology-expedition" \
99
+ --schedule "every 15m" \
100
+ --workdir ~/projects/Code-Archaeology \
101
+ --prompt "Run one Code Archaeology expedition phase. Read .archaeology/session.json, execute current phase with verification, advance to next phase."
85
102
  ```
86
103
 
87
104
  See [`INSTALL.md`](INSTALL.md) for prerequisites, verification, updating, and troubleshooting.
88
105
 
89
106
  ## Quick Start
90
107
 
108
+ ### OpenCode
109
+
91
110
  Run the command family from inside the repository you want to inspect:
92
111
 
93
112
  ```text
94
113
  /code-archaeology
95
114
  ```
96
115
 
97
- Start non-destructively, review the reports, then choose whether to generate mock patches or apply approved changes:
116
+ `/code-archaeology` runs the full 10-phase survey chain without per-phase prompts. It writes reports under `.archaeology/` and makes no source-code changes. Review the reports, then choose whether to generate mock patches or apply approved changes:
98
117
 
99
118
  ```text
100
119
  /code-archaeology-survey
@@ -102,11 +121,33 @@ Start non-destructively, review the reports, then choose whether to generate moc
102
121
  /code-archaeology-restore
103
122
  ```
104
123
 
124
+ ### Hermes Agent
125
+
126
+ Each cron run executes exactly **one** phase. The runner reads `.archaeology/session.json`, runs the current phase with verification, and advances to the next phase:
127
+
128
+ ```bash
129
+ bash hooks/hermes/runner.sh
130
+ ```
131
+
132
+ Ten phases complete in ~2.5 hours minimum (15-minute intervals).
133
+
134
+ ## Runtime Surfaces
135
+
136
+ | Feature | OpenCode | Hermes Agent |
137
+ |---------|----------|--------------|
138
+ | Entry | `/code-archaeology` slash command | `cronjob` |
139
+ | Phases | All in one session | One per cron run |
140
+ | Verification | Between expeditions | Between every phase |
141
+ | Revert | Manual or automatic | Automatic on failure |
142
+ | State | `.archaeology/session.json` | Same file |
143
+ | Background | Plugin stays active | Cron resumes automatically |
144
+ | Real-time | Yes | Delayed (15-min intervals) |
145
+
105
146
  ## Expedition Flow
106
147
 
107
148
  ```mermaid
108
149
  flowchart TD
109
- A[Start /code-archaeology] --> B[Site Survey and Baseline]
150
+ A[Start] --> B[Site Survey and Baseline]
110
151
  B --> C[Dead Code Excavation]
111
152
  C --> D[Legacy Stratum Removal]
112
153
  D --> E[Circular Dependency Cartography]
@@ -141,24 +182,35 @@ flowchart LR
141
182
 
142
183
  ## Commands
143
184
 
185
+ ### OpenCode
186
+
144
187
  | Command | Purpose | File changes |
145
188
  | --- | --- | --- |
146
- | `/code-archaeology` | Start the full expedition in the configured mode. | Depends on mode; defaults to none. |
189
+ | `/code-archaeology` | Run the full 10-phase survey chain without per-phase prompts. | None outside `.archaeology/`. |
147
190
  | `/code-archaeology-survey` | Generate site reports for review. | None outside `.archaeology/`. |
148
191
  | `/code-archaeology-excavate` | Generate reports and mock patches. | None outside `.archaeology/patches/`. |
149
192
  | `/code-archaeology-restore` | Apply approved high-confidence changes. | Yes, test-gated. |
150
193
 
151
- ## Parameters
194
+ ### Hermes Agent
152
195
 
153
- | Parameter | Default | Description |
196
+ | OpenCode Equivalent | Hermes Mechanism | File changes |
154
197
  | --- | --- | --- |
155
- | `repo_path` | `.` | Target repository to excavate. |
156
- | `language` | `typescript` | Primary language for tooling selection. |
157
- | `mode` | `survey` | `survey`, `excavate`, or `restore`. |
158
- | `strict_mode` | `false` | When true, restore may also apply medium-confidence findings. |
159
- | `test_command` | `npm test` | Test command run by verification hooks. |
160
- | `typecheck_command` | `npx tsc --noEmit` | Type-check command run by verification hooks. |
161
- | `branch_name` | `refactor/archaeology` | Branch used for isolated restore work. |
198
+ | `/code-archaeology` | `cronjob` runs expedition loop | Depends on mode |
199
+ | `/code-archaeology-survey` | `mode = "survey"` in `session.json` | None outside `.archaeology/` |
200
+ | `/code-archaeology-excavate` | `mode = "excavate"` in `session.json` | None outside `.archaeology/patches/` |
201
+ | `/code-archaeology-restore` | `mode = "restore"` in `session.json` | Yes, test-gated |
202
+
203
+ ## Parameters
204
+
205
+ | Parameter | Default | Description | Hermes Notes |
206
+ | --- | --- | --- | --- |
207
+ | `repo_path` | `.` | Target repository to excavate. | Set in `session.json` before first cron run. |
208
+ | `language` | `typescript` | Primary language for tooling selection. | Same |
209
+ | `mode` | `survey` | `survey`, `excavate`, or `restore`. | Change in `session.json` to switch modes. |
210
+ | `strict_mode` | `false` | When true, restore may also apply medium-confidence findings. | Same |
211
+ | `test_command` | `npm test` | Recorded session default only; verification hooks do not execute repository-local command values. Use `CODE_ARCHAEOLOGY_TEST_COMMAND` to approve an override for the current process. | Same |
212
+ | `typecheck_command` | `npx tsc --noEmit` | Recorded session default only; verification hooks do not execute repository-local command values. Use `CODE_ARCHAEOLOGY_TYPECHECK_COMMAND` to approve an override for the current process. | Same |
213
+ | `branch_name` | `refactor/archaeology` | Branch used for isolated restore work. | Same |
162
214
 
163
215
  ## Expedition Order
164
216
 
@@ -198,12 +250,15 @@ Code-Archaeology/
198
250
  |-- dist/ # Built package output for GitHub-based installs
199
251
  |-- docs/ # Public docs and release notes
200
252
  |-- hooks/opencode/ # Init, verification, revert, and status hooks
201
- |-- plugins/ # OpenCode plugin entry point
253
+ |-- hooks/hermes/ # Setup and runner hooks for Hermes Agent
254
+ |-- plugins/ # Repo-local legacy plugin shim
202
255
  |-- prompts/ # Expedition prompts by phase
203
256
  |-- schema/ # JSON schemas for reports
204
- |-- skills/ # Code Archaeology skill definition
257
+ |-- skills/ # Code Archaeology skill definitions
258
+ | |-- code-archaeology/ # OpenCode skill
259
+ | `-- hermes/ # Hermes Agent skill and integration docs
205
260
  |-- src/ # TypeScript source
206
- |-- INSTALL.md # OpenCode install handoff
261
+ |-- INSTALL.md # Multi-runtime install handoff
207
262
  |-- README.md # Public project overview
208
263
  `-- AGENTS.md # Agent runtime guide
209
264
  ```
@@ -220,6 +275,7 @@ All expedition state is written to `.archaeology/` inside the target repository:
220
275
  | `FINAL_CATALOG.md` | Final excavation summary and recommendations. |
221
276
  | `excavation_log.txt` | `git diff --stat` for applied restoration work. |
222
277
  | `patches/` | Mock patches generated by `excavate` mode. |
278
+ | `hermes-runtime.json` | Hermes runtime configuration (Hermes only). |
223
279
 
224
280
  ## Local Testing
225
281
 
@@ -231,19 +287,24 @@ npm run build
231
287
  npm run typecheck
232
288
  npm pack --json --dry-run
233
289
  bash -n hooks/opencode/*.sh
290
+ bash -n hooks/hermes/*.sh
234
291
  ```
235
292
 
236
- For a restore expedition, run the configured test and type-check commands between phases. The bundled verification hook is:
293
+ For a restore expedition, run the configured test and type-check commands between phases. The bundled verification hooks are:
237
294
 
238
295
  ```bash
296
+ # OpenCode
239
297
  bash hooks/opencode/verify-phase.sh final_verify
298
+
299
+ # Hermes
300
+ bash hooks/hermes/runner.sh
240
301
  ```
241
302
 
242
303
  ## Release Docs
243
304
 
244
305
  - [`docs/README.md`](docs/README.md) is the documentation landing page.
245
306
  - [`docs/RELEASE.md`](docs/RELEASE.md) covers release preparation and publishing.
246
- - [`INSTALL.md`](INSTALL.md) is the raw handoff for OpenCode installation.
307
+ - [`INSTALL.md`](INSTALL.md) is the raw handoff for multi-runtime installation.
247
308
  - [GitHub Releases](https://github.com/Maleick/Code-Archaeology/releases) lists published versions.
248
309
 
249
310
  ## License
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.2
1
+ 2.2.0
@@ -1,66 +1,195 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="900" height="300" viewBox="0 0 900 300" role="img" aria-labelledby="title desc">
2
- <title id="title">Code Archaeology OpenCode Plugin</title>
3
- <desc id="desc">Dark archaeology themed banner for the Code Archaeology OpenCode plugin.</desc>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 460" width="1200" height="460" role="img" aria-labelledby="title desc">
2
+ <title id="title">Code Archaeology Multi-runtime Plugin</title>
3
+ <desc id="desc">Dark-themed archaeological excavation banner showing code strata layers, dual runtime badges for OpenCode and Hermes, and a 10-phase expedition indicator.</desc>
4
+
4
5
  <defs>
5
- <linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
6
- <stop offset="0" stop-color="#071018"/>
7
- <stop offset="0.48" stop-color="#111827"/>
8
- <stop offset="1" stop-color="#2a1809"/>
9
- </linearGradient>
10
- <linearGradient id="sand" x1="0" y1="0" x2="1" y2="0">
11
- <stop offset="0" stop-color="#c0843f"/>
12
- <stop offset="0.5" stop-color="#e0b15b"/>
13
- <stop offset="1" stop-color="#8b5a2b"/>
6
+ <!-- Background gradient -->
7
+ <linearGradient id="bgGrad" x1="0" y1="0" x2="0" y2="1">
8
+ <stop offset="0" stop-color="#0b1020"/>
9
+ <stop offset="1" stop-color="#1e293b"/>
14
10
  </linearGradient>
15
- <linearGradient id="tablet" x1="0" y1="0" x2="0" y2="1">
11
+
12
+ <!-- Strata gradients -->
13
+ <linearGradient id="surfaceGrad" x1="0" y1="0" x2="1" y2="0">
16
14
  <stop offset="0" stop-color="#334155"/>
17
- <stop offset="1" stop-color="#111827"/>
15
+ <stop offset="1" stop-color="#475569"/>
16
+ </linearGradient>
17
+ <linearGradient id="legacyGrad" x1="0" y1="0" x2="1" y2="0">
18
+ <stop offset="0" stop-color="#78350f"/>
19
+ <stop offset="1" stop-color="#92400e"/>
20
+ </linearGradient>
21
+ <linearGradient id="bedrockGrad" x1="0" y1="0" x2="1" y2="0">
22
+ <stop offset="0" stop-color="#1e1b4b"/>
23
+ <stop offset="1" stop-color="#312e81"/>
18
24
  </linearGradient>
25
+
26
+ <!-- Glow filter for accents -->
19
27
  <filter id="glow" x="-30%" y="-30%" width="160%" height="160%">
20
- <feGaussianBlur stdDeviation="4" result="blur"/>
28
+ <feGaussianBlur stdDeviation="3" result="blur"/>
21
29
  <feMerge>
22
30
  <feMergeNode in="blur"/>
23
31
  <feMergeNode in="SourceGraphic"/>
24
32
  </feMerge>
25
33
  </filter>
34
+
35
+ <!-- Subtle grid pattern -->
36
+ <pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">
37
+ <path d="M 40 0 L 0 0 0 40" fill="none" stroke="#1e293b" stroke-width="0.5" opacity="0.3"/>
38
+ </pattern>
26
39
  </defs>
27
40
 
28
- <rect width="900" height="300" fill="url(#bg)"/>
29
- <path d="M0 222 C120 198 214 236 322 213 C452 186 549 216 672 194 C764 178 827 190 900 171 L900 300 L0 300 Z" fill="#20140b" opacity="0.92"/>
30
- <path d="M0 244 C152 214 244 266 386 231 C505 202 626 242 744 210 C806 193 852 201 900 189 L900 300 L0 300 Z" fill="#2f1d0f"/>
31
- <path d="M0 268 C138 246 267 281 405 258 C523 238 650 270 770 244 C827 232 865 232 900 222 L900 300 L0 300 Z" fill="url(#sand)" opacity="0.82"/>
41
+ <!-- Background -->
42
+ <rect width="1200" height="460" fill="url(#bgGrad)"/>
43
+ <rect width="1200" height="460" fill="url(#grid)"/>
44
+
45
+ <!-- Geological strata layers (left side, showing code layers) -->
46
+ <g transform="translate(60, 80)">
47
+ <!-- Surface layer -->
48
+ <path d="M0 0 L280 0 L260 55 L20 55 Z" fill="url(#surfaceGrad)" stroke="#64748b" stroke-width="1.5"/>
49
+ <text x="140" y="35" text-anchor="middle" font-family="SFMono-Regular, Consolas, monospace" font-size="14" fill="#94a3b8">Surface // Active Code</text>
50
+
51
+ <!-- Legacy layer -->
52
+ <path d="M20 55 L260 55 L240 115 L40 115 Z" fill="url(#legacyGrad)" stroke="#f97316" stroke-width="1.5" opacity="0.85"/>
53
+ <text x="140" y="92" text-anchor="middle" font-family="SFMono-Regular, Consolas, monospace" font-size="14" fill="#fdba74">Legacy // Deprecated Shims</text>
32
54
 
33
- <g opacity="0.35" stroke="#e0b15b" stroke-width="1" fill="none">
34
- <path d="M41 96 H312"/>
35
- <path d="M586 66 H852"/>
36
- <path d="M640 103 H828"/>
37
- <path d="M68 128 H242"/>
55
+ <!-- Bedrock layer -->
56
+ <path d="M40 115 L240 115 L220 180 L60 180 Z" fill="url(#bedrockGrad)" stroke="#6366f1" stroke-width="1.5" opacity="0.9"/>
57
+ <text x="140" y="155" text-anchor="middle" font-family="SFMono-Regular, Consolas, monospace" font-size="14" fill="#a5b4fc">Bedrock // Core Types</text>
58
+
59
+ <!-- Stratum divider lines -->
60
+ <line x1="290" y1="27" x2="340" y2="27" stroke="#64748b" stroke-width="1" stroke-dasharray="4 3"/>
61
+ <line x1="270" y1="85" x2="340" y2="85" stroke="#f97316" stroke-width="1" stroke-dasharray="4 3"/>
62
+ <line x1="250" y1="147" x2="340" y2="147" stroke="#6366f1" stroke-width="1" stroke-dasharray="4 3"/>
63
+ </g>
64
+
65
+ <!-- Archaeologist / excavation tools (right side) -->
66
+ <g transform="translate(980, 70)">
67
+ <!-- Brush -->
68
+ <rect x="15" y="0" width="12" height="70" rx="3" fill="#78350f" opacity="0.9"/>
69
+ <rect x="10" y="65" width="22" height="35" rx="4" fill="#d97706" opacity="0.9"/>
70
+ <line x1="21" y1="100" x2="21" y2="130" stroke="#d97706" stroke-width="3" stroke-linecap="round"/>
71
+
72
+ <!-- Trowel -->
73
+ <path d="M60 20 L75 20 L85 80 L50 80 Z" fill="#475569" stroke="#94a3b8" stroke-width="1.5"/>
74
+ <line x1="67" y1="80" x2="67" y2="130" stroke="#64748b" stroke-width="4" stroke-linecap="round"/>
75
+
76
+ <!-- Small artifacts / code fragments -->
77
+ <text x="-30" y="160" font-family="SFMono-Regular, Consolas, monospace" font-size="11" fill="#fbbf24" opacity="0.7">{ }</text>
78
+ <text x="10" y="175" font-family="SFMono-Regular, Consolas, monospace" font-size="10" fill="#f97316" opacity="0.6">// TODO</text>
79
+ <text x="45" y="155" font-family="SFMono-Regular, Consolas, monospace" font-size="9" fill="#a5b4fc" opacity="0.5">fn main()</text>
80
+ </g>
81
+
82
+ <!-- Wordmark -->
83
+ <g transform="translate(420, 105)">
84
+ <text x="0" y="0" font-family="Inter, Segoe UI, Arial, sans-serif" font-size="56" font-weight="900" fill="#f8fafc" letter-spacing="-1">Code Archaeology</text>
85
+ <text x="2" y="42" font-family="Inter, Segoe UI, Arial, sans-serif" font-size="20" font-weight="600" fill="#fbbf24">Excavate technical debt. Restore with confidence.</text>
38
86
  </g>
39
87
 
40
- <g transform="translate(78 58)">
41
- <path d="M74 8 L141 34 L116 146 L22 146 L0 35 Z" fill="url(#tablet)" stroke="#64748b" stroke-width="3"/>
42
- <path d="M28 48 H103 M31 75 H111 M36 102 H91" stroke="#cbd5e1" stroke-width="6" stroke-linecap="round" opacity="0.72"/>
43
- <path d="M95 138 L136 179" stroke="#d6a23f" stroke-width="12" stroke-linecap="round"/>
44
- <path d="M126 169 L169 126" stroke="#d6a23f" stroke-width="12" stroke-linecap="round"/>
45
- <path d="M138 120 C154 103 182 104 198 120 L169 149 Z" fill="#111827" stroke="#f6c453" stroke-width="6"/>
46
- <circle cx="71" cy="31" r="9" fill="#f6c453" filter="url(#glow)"/>
88
+ <!-- Runtime badges -->
89
+ <g transform="translate(420, 185)">
90
+ <!-- OpenCode badge -->
91
+ <rect x="0" y="0" width="130" height="32" rx="8" fill="#0f172a" stroke="#38bdf8" stroke-width="1.5"/>
92
+ <circle cx="20" cy="16" r="5" fill="#38bdf8"/>
93
+ <text x="34" y="21" font-family="SFMono-Regular, Consolas, monospace" font-size="13" fill="#e0f2fe" font-weight="600">OpenCode</text>
94
+
95
+ <!-- Hermes badge -->
96
+ <rect x="150" y="0" width="120" height="32" rx="8" fill="#0f172a" stroke="#a78bfa" stroke-width="1.5"/>
97
+ <circle cx="170" cy="16" r="5" fill="#a78bfa"/>
98
+ <text x="184" y="21" font-family="SFMono-Regular, Consolas, monospace" font-size="13" fill="#ede9fe" font-weight="600">Hermes</text>
99
+
100
+ <!-- Multi-runtime label -->
101
+ <text x="290" y="21" font-family="Inter, Segoe UI, Arial, sans-serif" font-size="14" fill="#94a3b8" font-weight="500">Multi-runtime plugin</text>
47
102
  </g>
48
103
 
49
- <g transform="translate(300 70)">
50
- <text x="0" y="43" font-family="Inter, Segoe UI, Arial, sans-serif" font-size="46" font-weight="800" fill="#f8fafc" letter-spacing="1">Code Archaeology</text>
51
- <text x="2" y="83" font-family="Inter, Segoe UI, Arial, sans-serif" font-size="20" font-weight="600" fill="#f6c453">OpenCode plugin for systematic codebase excavation</text>
52
- <text x="2" y="122" font-family="SFMono-Regular, Consolas, Liberation Mono, monospace" font-size="15" fill="#cbd5e1">survey - excavate - restore - verify</text>
53
- <g transform="translate(0 145)" font-family="SFMono-Regular, Consolas, Liberation Mono, monospace" font-size="13" fill="#94a3b8">
54
- <rect x="0" y="0" width="455" height="42" rx="10" fill="#020617" opacity="0.72" stroke="#334155"/>
55
- <text x="18" y="26">dead code | legacy | cycles | types | DRY | errors</text>
104
+ <!-- 10-phase indicator -->
105
+ <g transform="translate(420, 255)">
106
+ <text x="0" y="-10" font-family="Inter, Segoe UI, Arial, sans-serif" font-size="12" fill="#64748b" font-weight="600" letter-spacing="2">10-PHASE EXPEDITION</text>
107
+
108
+ <!-- Phase boxes 1-10 -->
109
+ <g font-family="SFMono-Regular, Consolas, monospace" font-size="11" font-weight="700">
110
+ <!-- Phase 1 -->
111
+ <rect x="0" y="0" width="36" height="28" rx="5" fill="#0f172a" stroke="#38bdf8" stroke-width="1.5"/>
112
+ <text x="18" y="19" text-anchor="middle" fill="#e0f2fe">1</text>
113
+ <!-- Arrow -->
114
+ <text x="42" y="19" fill="#475569">→</text>
115
+
116
+ <!-- Phase 2 -->
117
+ <rect x="56" y="0" width="36" height="28" rx="5" fill="#0f172a" stroke="#38bdf8" stroke-width="1.5"/>
118
+ <text x="74" y="19" text-anchor="middle" fill="#e0f2fe">2</text>
119
+ <text x="98" y="19" fill="#475569">→</text>
120
+
121
+ <!-- Phase 3 -->
122
+ <rect x="112" y="0" width="36" height="28" rx="5" fill="#0f172a" stroke="#38bdf8" stroke-width="1.5"/>
123
+ <text x="130" y="19" text-anchor="middle" fill="#e0f2fe">3</text>
124
+ <text x="154" y="19" fill="#475569">→</text>
125
+
126
+ <!-- Phase 4 -->
127
+ <rect x="168" y="0" width="36" height="28" rx="5" fill="#0f172a" stroke="#38bdf8" stroke-width="1.5"/>
128
+ <text x="186" y="19" text-anchor="middle" fill="#e0f2fe">4</text>
129
+ <text x="210" y="19" fill="#475569">→</text>
130
+
131
+ <!-- Phase 5 -->
132
+ <rect x="224" y="0" width="36" height="28" rx="5" fill="#0f172a" stroke="#fbbf24" stroke-width="1.5"/>
133
+ <text x="242" y="19" text-anchor="middle" fill="#fef3c7">5</text>
134
+ <text x="266" y="19" fill="#475569">→</text>
135
+
136
+ <!-- Phase 6 -->
137
+ <rect x="280" y="0" width="36" height="28" rx="5" fill="#0f172a" stroke="#fbbf24" stroke-width="1.5"/>
138
+ <text x="298" y="19" text-anchor="middle" fill="#fef3c7">6</text>
139
+ <text x="322" y="19" fill="#475569">→</text>
140
+
141
+ <!-- Phase 7 -->
142
+ <rect x="336" y="0" width="36" height="28" rx="5" fill="#0f172a" stroke="#f97316" stroke-width="1.5"/>
143
+ <text x="354" y="19" text-anchor="middle" fill="#ffedd5">7</text>
144
+ <text x="378" y="19" fill="#475569">→</text>
145
+
146
+ <!-- Phase 8 -->
147
+ <rect x="392" y="0" width="36" height="28" rx="5" fill="#0f172a" stroke="#f97316" stroke-width="1.5"/>
148
+ <text x="410" y="19" text-anchor="middle" fill="#ffedd5">8</text>
149
+ <text x="434" y="19" fill="#475569">→</text>
150
+
151
+ <!-- Phase 9 -->
152
+ <rect x="448" y="0" width="36" height="28" rx="5" fill="#0f172a" stroke="#a78bfa" stroke-width="1.5"/>
153
+ <text x="466" y="19" text-anchor="middle" fill="#ede9fe">9</text>
154
+ <text x="490" y="19" fill="#475569">→</text>
155
+
156
+ <!-- Phase 10 -->
157
+ <rect x="504" y="0" width="42" height="28" rx="5" fill="#0f172a" stroke="#a78bfa" stroke-width="1.5"/>
158
+ <text x="525" y="19" text-anchor="middle" fill="#ede9fe">10</text>
56
159
  </g>
57
160
  </g>
58
161
 
59
- <g opacity="0.55" fill="#f6c453">
60
- <circle cx="807" cy="54" r="2"/>
61
- <circle cx="846" cy="93" r="1.8"/>
62
- <circle cx="758" cy="120" r="1.5"/>
63
- <circle cx="63" cy="39" r="1.5"/>
64
- <circle cx="219" cy="48" r="2"/>
162
+ <!-- Bottom info bar -->
163
+ <g transform="translate(420, 340)">
164
+ <rect x="0" y="0" width="560" height="42" rx="10" fill="#020617" opacity="0.72" stroke="#334155" stroke-width="1"/>
165
+ <text x="20" y="26" font-family="SFMono-Regular, Consolas, monospace" font-size="13" fill="#94a3b8">survey · excavate · restore · verify · dead code · legacy · cycles · types · DRY · errors</text>
166
+ </g>
167
+
168
+ <!-- Decorative particles / dust motes -->
169
+ <g opacity="0.4" fill="#fbbf24">
170
+ <circle cx="1100" cy="60" r="2"/>
171
+ <circle cx="1150" cy="120" r="1.5"/>
172
+ <circle cx="1080" cy="200" r="2.5"/>
173
+ <circle cx="1120" cy="280" r="1.8"/>
174
+ <circle cx="1160" cy="350" r="2"/>
175
+ <circle cx="1090" cy="400" r="1.5"/>
176
+ <circle cx="1140" cy="430" r="2"/>
177
+ </g>
178
+
179
+ <!-- Subtle excavation grid markers -->
180
+ <g opacity="0.15" stroke="#fbbf24" stroke-width="1" fill="none">
181
+ <rect x="50" y="70" width="300" height="200" rx="4"/>
182
+ <line x1="50" y1="130" x2="350" y2="130"/>
183
+ <line x1="50" y1="190" x2="350" y2="190"/>
184
+ <line x1="150" y1="70" x2="150" y2="270"/>
185
+ <line x1="250" y1="70" x2="250" y2="270"/>
186
+ </g>
187
+
188
+ <!-- Corner accent lines -->
189
+ <g opacity="0.3" stroke="#f97316" stroke-width="2" fill="none">
190
+ <path d="M0 0 L60 0 L0 60 Z" fill="#f97316" opacity="0.05"/>
191
+ <path d="M1140 0 L1200 0 L1200 60 Z" fill="#f97316" opacity="0.05"/>
192
+ <path d="M0 400 L0 460 L60 460 Z" fill="#f97316" opacity="0.05"/>
193
+ <path d="M1140 460 L1200 460 L1200 400 Z" fill="#f97316" opacity="0.05"/>
65
194
  </g>
66
195
  </svg>
@@ -13,6 +13,8 @@ trigger:
13
13
 
14
14
  Excavate, catalog, and restore a codebase by removing accumulated sediment: dead code, legacy fallbacks, circular dependencies, weak types, and defensive programming slop. Produces human-reviewable site reports before any artifacts are disturbed. Non-destructive by default.
15
15
 
16
+ By default, `/code-archaeology` runs the full 10-phase survey chain without stopping for a prompt between phases. It generates the complete report set in `.archaeology/` and makes zero source-code changes. To apply changes after review, use `/code-archaeology-restore` explicitly.
17
+
16
18
  ## Quick Start
17
19
 
18
20
  ```
@@ -36,7 +38,7 @@ Run: /code-archaeology
36
38
 
37
39
  | Command | Description |
38
40
  |---------|-------------|
39
- | `/code-archaeology` | Start full expedition (default: survey mode) |
41
+ | `/code-archaeology` | Run the full 10-phase survey chain without per-phase prompts |
40
42
  | `/code-archaeology-survey` | Site survey only — zero file changes |
41
43
  | `/code-archaeology-excavate` | Generate reports + mock patches for review |
42
44
  | `/code-archaeology-restore` | Execute approved changes after review |
@@ -49,8 +51,8 @@ Run: /code-archaeology
49
51
  | `language` | `typescript` | Primary language |
50
52
  | `mode` | `survey` | `survey`, `excavate`, or `restore` |
51
53
  | `strict_mode` | `false` | Auto-restore medium-confidence findings |
52
- | `test_command` | `npm test` | Test runner command |
53
- | `typecheck_command` | `npx tsc --noEmit` | Type check command |
54
+ | `test_command` | `npm test` | Recorded session default only; verification uses `CODE_ARCHAEOLOGY_TEST_COMMAND` for operator-approved overrides |
55
+ | `typecheck_command` | `npx tsc --noEmit` | Recorded session default only; verification uses `CODE_ARCHAEOLOGY_TYPECHECK_COMMAND` for operator-approved overrides |
54
56
  | `branch_name` | `refactor/archaeology` | Git branch to create |
55
57
 
56
58
  ## Requirements
@@ -62,9 +64,9 @@ Run: /code-archaeology
62
64
 
63
65
  ## Safety
64
66
 
65
- - **Survey mode (default)**: Zero file changes. Only reports generated.
67
+ - **Survey mode (default)**: Zero file changes. Runs every phase and generates the full report set.
66
68
  - **Excavate mode**: Mock patches for human review. No actual modifications.
67
- - **Restore mode**: Applies approved changes. Always runs tests between phases.
69
+ - **Restore mode**: Applies approved changes only when explicitly requested with `/code-archaeology-restore`. Always runs tests between phases.
68
70
  - **Branch isolation**: All work happens on `refactor/archaeology` (configurable).
69
71
  - **Test gating**: Any phase that breaks tests is automatically reverted.
70
72
 
package/dist/cli.js CHANGED
@@ -4,18 +4,35 @@ import { existsSync } from "node:fs";
4
4
  import { dirname, join } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import process from "node:process";
7
+ import { isWindows } from "./platform.js";
7
8
  const PLUGIN = "opencode-code-archaeology@git+https://github.com/Maleick/Code-Archaeology.git";
8
9
  const REQUIRED_FILES = [
9
10
  "commands/code-archaeology.md",
10
11
  "skills/code-archaeology/SKILL.md",
11
12
  "hooks/opencode/init.sh",
12
13
  "hooks/opencode/verify-phase.sh",
14
+ "hooks/hermes/setup.sh",
15
+ "hooks/hermes/runner.sh",
16
+ "skills/hermes/INTEGRATION.md",
17
+ "AGENTS.md",
18
+ "README.md",
19
+ "INSTALL.md",
20
+ ];
21
+ const REQUIRED_FILES_PS1 = [
22
+ "commands/code-archaeology.md",
23
+ "skills/code-archaeology/SKILL.md",
24
+ "hooks/opencode/init.ps1",
25
+ "hooks/opencode/verify-phase.ps1",
26
+ "hooks/hermes/setup.ps1",
27
+ "hooks/hermes/runner.ps1",
28
+ "skills/hermes/INTEGRATION.md",
13
29
  "AGENTS.md",
14
30
  "README.md",
15
31
  "INSTALL.md",
16
32
  ];
17
33
  const cliFile = fileURLToPath(import.meta.url);
18
34
  const root = dirname(dirname(cliFile));
35
+ const skillsPath = join(root, "skills");
19
36
  function configPath() {
20
37
  const configDir = process.env.OPENCODE_CONFIG_DIR || join(process.env.HOME || ".", ".config", "opencode");
21
38
  return join(configDir, "opencode.json");
@@ -59,6 +76,13 @@ async function install() {
59
76
  if (!plugins.includes(PLUGIN)) {
60
77
  config.plugin = [...plugins, PLUGIN];
61
78
  }
79
+ const skills = typeof config.skills === "object" && config.skills !== null ? config.skills : {};
80
+ const paths = Array.isArray(skills.paths)
81
+ ? skills.paths
82
+ : [];
83
+ if (!paths.includes(skillsPath)) {
84
+ config.skills = { ...skills, paths: [...paths, skillsPath] };
85
+ }
62
86
  await mkdir(dirname(target), { recursive: true });
63
87
  let backup;
64
88
  if (exists) {
@@ -73,9 +97,11 @@ async function install() {
73
97
  console.log("Next steps:");
74
98
  console.log("1. Restart OpenCode.");
75
99
  console.log("2. Run /code-archaeology-survey in your target repository.");
100
+ console.log("Cross-platform: uses .ps1 hooks on Windows, .sh hooks on Unix.");
76
101
  }
77
102
  function doctor() {
78
- const missing = REQUIRED_FILES.filter((file) => !existsSync(join(root, file)));
103
+ const files = isWindows() ? REQUIRED_FILES_PS1 : REQUIRED_FILES;
104
+ const missing = files.filter((file) => !existsSync(join(root, file)));
79
105
  if (missing.length > 0) {
80
106
  console.error("Missing Code Archaeology package files:");
81
107
  for (const file of missing) {
@@ -85,7 +111,7 @@ function doctor() {
85
111
  return;
86
112
  }
87
113
  console.log("Code Archaeology package files present:");
88
- for (const file of REQUIRED_FILES) {
114
+ for (const file of files) {
89
115
  console.log(`- ${file}`);
90
116
  }
91
117
  }
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,MAAM,MAAM,GAAG,+EAA+E,CAAC;AAC/F,MAAM,cAAc,GAAG;IACrB,8BAA8B;IAC9B,kCAAkC;IAClC,wBAAwB;IACxB,gCAAgC;IAChC,WAAW;IACX,WAAW;IACX,YAAY;CACb,CAAC;AAEF,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,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