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
@@ -4,6 +4,7 @@
4
4
 
5
5
  ## Verification
6
6
 
7
+ - [ ] Polish pass completed before commit, push, and PR.
7
8
  - [ ] `npm run build`
8
9
  - [ ] `npm run typecheck`
9
10
  - [ ] `npm test`
@@ -0,0 +1,46 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+ issues: write
14
+ pull-requests: write
15
+ id-token: write
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ with:
19
+ fetch-depth: 0
20
+ persist-credentials: false
21
+
22
+ - uses: actions/setup-node@v4
23
+ with:
24
+ node-version: '22'
25
+ registry-url: 'https://registry.npmjs.org'
26
+
27
+ - name: Install dependencies
28
+ run: npm ci
29
+
30
+ - name: Build
31
+ run: npm run build
32
+
33
+ - name: Type check
34
+ run: npm run typecheck
35
+
36
+ - name: Verify package
37
+ run: npm run verify:pack
38
+
39
+ - name: Test
40
+ run: npm test
41
+
42
+ - name: Release
43
+ env:
44
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45
+ NPM_CONFIG_PROVENANCE: true
46
+ run: npx semantic-release
package/AGENTS.md CHANGED
@@ -1,27 +1,35 @@
1
1
  # Code Archaeology Agent Guide
2
2
 
3
- Code Archaeology is an OpenCode plugin for systematic codebase excavation, cataloging, and restoration.
3
+ Code Archaeology is a multi-runtime plugin for systematic codebase excavation, cataloging, and restoration. It supports both **OpenCode** and **Hermes Agent** runtimes.
4
4
 
5
5
  ## Runtime Policy
6
6
 
7
- - OpenCode is the only supported worker runtime.
7
+ - **OpenCode** is the primary interactive runtime (slash commands).
8
+ - **Hermes Agent** is the cron-based background runtime (one phase per 15-minute run).
8
9
  - The plugin operates entirely within the target repository.
9
10
  - All changes are isolated to a configurable branch (`refactor/archaeology` by default).
10
11
 
11
12
  ## Available Hooks
12
13
 
13
- Core hooks in `hooks/opencode/`:
14
- - `init.sh` — Initialize `.archaeology/` directory and session state
15
- - `verify-phase.sh` — Run tests and typecheck between phases
16
- - `revert-phase.sh` — Revert changes if a phase fails verification
17
- - `update-expedition.sh` — Update expedition status in session.json
14
+ ### OpenCode hooks (`hooks/opencode/`)
15
+ - `init.sh` / `init.ps1` — Initialize `.archaeology/` directory and session state
16
+ - `verify-phase.sh` / `verify-phase.ps1` — Run tests and typecheck between phases
17
+ - `revert-phase.sh` / `revert-phase.ps1` — Revert changes if a phase fails verification
18
+ - `update-expedition.sh` / `update-expedition.ps1` — Update expedition status in session.json
19
+
20
+ ### Hermes hooks (`hooks/hermes/`)
21
+ - `setup.sh` / `setup.ps1` — Detect Hermes capabilities and write `hermes-runtime.json`
22
+ - `runner.sh` / `runner.ps1` — Execute one expedition phase per cron run with test gates
23
+
24
+ **Platform support:** `.sh` scripts run on macOS/Linux; `.ps1` scripts run on Windows (PowerShell).
18
25
 
19
26
  ## Safety Hooks
20
27
 
21
- - `verify-phase.sh` — Mandatory test/typecheck gate between expeditions
22
- - `revert-phase.sh` — Automatic rollback on failure
28
+ - `verify-phase.sh` — Mandatory test/typecheck gate between expeditions (OpenCode)
29
+ - `revert-phase.sh` — Automatic rollback on failure (OpenCode)
30
+ - `runner.sh` — Built-in pre/post verification and auto-revert (Hermes)
23
31
 
24
- ## Workflow
32
+ ## OpenCode Workflow
25
33
 
26
34
  1. Run `hooks/opencode/init.sh` to initialize the session
27
35
  2. For each expedition:
@@ -31,6 +39,19 @@ Core hooks in `hooks/opencode/`:
31
39
  d. Run `hooks/opencode/update-expedition.sh <phase> <status> [findings]`
32
40
  3. Final verification runs all checks and generates `FINAL_CATALOG.md`
33
41
 
42
+ ## Hermes Workflow
43
+
44
+ 1. Run `hooks/hermes/setup.sh` to detect Hermes capabilities
45
+ 2. Create a Hermes cronjob (see `skills/hermes/INTEGRATION.md`)
46
+ 3. Each cron run executes **exactly ONE** phase:
47
+ a. Read `.archaeology/session.json` for current phase and mode
48
+ b. Run the phase (survey, excavate, or restore)
49
+ c. Run test/typecheck verification
50
+ d. Keep or revert changes automatically
51
+ e. Advance to next phase in `session.json`
52
+ f. **STOP** — next cron run continues
53
+ 4. After 10 phases, `FINAL_CATALOG.md` is generated
54
+
34
55
  ## Local State
35
56
 
36
57
  `.archaeology/` is runtime state and must not be committed.
@@ -42,6 +63,7 @@ Key files:
42
63
  - `FINAL_CATALOG.md` — Completed excavation summary
43
64
  - `excavation_log.txt` — `git diff --stat`
44
65
  - `patches/` — Mock patches (excavate mode)
66
+ - `hermes-runtime.json` — Hermes runtime configuration (Hermes only)
45
67
 
46
68
  ## Modes
47
69
 
@@ -63,6 +85,8 @@ Key files:
63
85
 
64
86
  ## Verification
65
87
 
88
+ ### OpenCode
89
+
66
90
  Before claiming work is complete:
67
91
 
68
92
  ```bash
@@ -70,6 +94,14 @@ bash hooks/opencode/verify-phase.sh final_verify
70
94
  bash -n hooks/opencode/*.sh
71
95
  ```
72
96
 
97
+ ### Hermes
98
+
99
+ Verification is built into `runner.sh`:
100
+
101
+ ```bash
102
+ bash hooks/hermes/runner.sh
103
+ ```
104
+
73
105
  ## Language Support
74
106
 
75
107
  | Language | Dead Code | Dependencies | Types | DRY |
package/CHANGELOG.md CHANGED
@@ -1,5 +1,64 @@
1
+ # [2.2.0](https://github.com/Maleick/Code-Archaeology/compare/v2.1.0...v2.2.0) (2026-05-07)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * avoid session-sourced verification commands ([#10](https://github.com/Maleick/Code-Archaeology/issues/10)) ([9d3296d](https://github.com/Maleick/Code-Archaeology/commit/9d3296d1551ed7c97b90aca5c4be932bad5042e6))
7
+ * harden PowerShell verification hooks ([#6](https://github.com/Maleick/Code-Archaeology/issues/6)) ([ae1c1fa](https://github.com/Maleick/Code-Archaeology/commit/ae1c1fab3b1ce84872ad8217959d321e8e42266b))
8
+ * harden trusted publishing safety ([c78ee2e](https://github.com/Maleick/Code-Archaeology/commit/c78ee2e9bc75ff6554e75f848f64a3054a74344e))
9
+ * **hermes:** require operator approval for restore mode ([#8](https://github.com/Maleick/Code-Archaeology/issues/8)) ([772cd67](https://github.com/Maleick/Code-Archaeology/commit/772cd67df32f853c562fe8ed46f6d1528b477fda))
10
+ * only set completed_at when status is completed ([ebf1040](https://github.com/Maleick/Code-Archaeology/commit/ebf1040fb8a4a9ff23a40d6fa6042313e590b363))
11
+ * pass model router args safely ([#11](https://github.com/Maleick/Code-Archaeology/issues/11)) ([a7379fc](https://github.com/Maleick/Code-Archaeology/commit/a7379fcf425eab70f2906de75f0a158e7d418e85))
12
+ * secure Hermes session rewrites ([#7](https://github.com/Maleick/Code-Archaeology/issues/7)) ([55d5694](https://github.com/Maleick/Code-Archaeology/commit/55d5694684158d1ae471fed25b4f8de0706c7810))
13
+
14
+
15
+ ### Features
16
+
17
+ * Add Windows/PowerShell support ([a6b74ea](https://github.com/Maleick/Code-Archaeology/commit/a6b74ea75c1eb60263e939df3dc27fa4cc8b7a72)), closes [#4](https://github.com/Maleick/Code-Archaeology/issues/4)
18
+
19
+ # [2.1.0](https://github.com/Maleick/Code-Archaeology/compare/v2.0.2...v2.1.0) (2026-05-05)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * align analysis tool types ([65b19b2](https://github.com/Maleick/Code-Archaeology/commit/65b19b2b581c2e3f196f3d53886fd8dfdab23ea2))
25
+ * block invalid Hermes sessions ([aaafd4f](https://github.com/Maleick/Code-Archaeology/commit/aaafd4f0a0d6652ae92b5513caa13b2fabcab06e))
26
+ * harden Hermes install checks ([bc034cc](https://github.com/Maleick/Code-Archaeology/commit/bc034cca6cb8af88287cc3656cd72adf8a4246c1))
27
+ * remove embedded worktree and ignore .autoship/ ([400b554](https://github.com/Maleick/Code-Archaeology/commit/400b55452f96f604074d73f6eea79cf996a91aad))
28
+ * remove stale PluginServer stub ([#3](https://github.com/Maleick/Code-Archaeology/issues/3)) ([f8b15a3](https://github.com/Maleick/Code-Archaeology/commit/f8b15a306f55cfa6e036cc05e115357ec68df023)), closes [#2](https://github.com/Maleick/Code-Archaeology/issues/2)
29
+
30
+
31
+ ### Features
32
+
33
+ * **hermes:** add full Hermes Agent runtime support ([2f4ad41](https://github.com/Maleick/Code-Archaeology/commit/2f4ad41060994802c1fb3c5a480e88728838130b)), closes [#hermes-support](https://github.com/Maleick/Code-Archaeology/issues/hermes-support) [#multi-runtime](https://github.com/Maleick/Code-Archaeology/issues/multi-runtime)
34
+ * prepare v2.1.0 release ([54507d4](https://github.com/Maleick/Code-Archaeology/commit/54507d423b421535116363be86fbcba30b161d9e))
35
+ * **routing:** add intelligent model routing for free-tier priority ([a456556](https://github.com/Maleick/Code-Archaeology/commit/a45655602106933de64a0af5b63e18e6378847d7))
36
+
1
37
  # Changelog
2
38
 
39
+ ## Unreleased
40
+
41
+ - Switched release publishing to npm trusted publishing with GitHub Actions OIDC.
42
+ - Hardened Hermes restore mode so it blocks explicitly until implemented instead of reporting a successful no-op restore.
43
+ - Changed OpenCode revert handling to preserve failed phase changes in a named git stash instead of dropping them.
44
+ - Exposed public type definitions through package exports and excluded the repo-local legacy plugin shim from npm package contents.
45
+
46
+ ## v2.1.0
47
+
48
+ - Changed `/code-archaeology` to run the full 10-phase survey chain by default without per-phase prompts.
49
+ - Kept the default OpenCode flow non-destructive: survey mode writes report artifacts under `.archaeology/` only.
50
+ - Clarified that `/code-archaeology-restore` remains the explicit command for applying source changes.
51
+ - Updated command, CLI, plugin, and release tests for the new default survey-chain behavior.
52
+
53
+ ## v2.0.3
54
+
55
+ - Hardened Hermes runner startup so clean repositories initialize `.archaeology/session.json` without requiring prior setup.
56
+ - Added clear blocked-state handling for malformed Hermes session phases instead of allowing low-level `jq` failures.
57
+ - Added invalid JSON protection for Hermes session files so corrupted state is reported without being overwritten.
58
+ - Expanded CLI `doctor` checks and tests to verify Hermes hooks and integration docs are packaged alongside OpenCode assets.
59
+ - Aligned the exported analysis-tool type contract with the documented TypeScript, JavaScript, Python, Go, and Rust tool matrix.
60
+ - Updated install documentation to cover Hermes verification and troubleshooting parity with OpenCode.
61
+
3
62
  ## v2.0.2
4
63
 
5
64
  - Added release-ready repository parity files: CI workflow, issue templates, PR template, security policy, contribution guide, and changelog.
package/CONTRIBUTING.md CHANGED
@@ -34,6 +34,8 @@ npm pack --json --dry-run
34
34
 
35
35
  If a restore-mode change modifies behavior, verify it against a disposable repository or fixture and document the result.
36
36
 
37
+ Before committing, pushing, or opening a PR, run a polish pass over the changed surface. Check wording, links, visuals, accessibility, package contents, and whether the repository presentation still looks complete.
38
+
37
39
  ## Documentation Expectations
38
40
 
39
41
  - Update `README.md`, `INSTALL.md`, `docs/`, or `wiki/` when installation, commands, workflow, safety, or release behavior changes.
package/INSTALL.md CHANGED
@@ -1,21 +1,27 @@
1
1
  # Install Code Archaeology
2
2
 
3
- Code Archaeology is an OpenCode plugin for systematic codebase excavation. It is non-destructive by default: `survey` mode writes reports only, while `restore` mode modifies code after review and verification.
3
+ Code Archaeology is a multi-runtime plugin for systematic codebase excavation. It is non-destructive by default: `survey` mode writes reports only, while `restore` mode modifies code after review and verification.
4
+
5
+ ## Runtimes
6
+
7
+ - **OpenCode** — Interactive slash-command runtime (`/code-archaeology`)
8
+ - **Hermes Agent** — Cron-based background runtime (one phase per 15-minute run)
4
9
 
5
10
  ## OpenCode Handoff
6
11
 
7
12
  Paste this into OpenCode if you want the agent to install and verify the plugin for you:
8
13
 
9
14
  ```text
10
- Fetch and follow instructions from https://raw.githubusercontent.com/Maleick/Code-Archaeology/refs/heads/main/INSTALL.md
15
+ Run `npm pack opencode-code-archaeology@2.2.0`, extract the resulting tarball, then open and follow `package/INSTALL.md` from that tarball. If you need a concrete command sequence: `npm pack opencode-code-archaeology@2.2.0 && tar -xof opencode-code-archaeology-2.2.0.tgz && cat package/INSTALL.md`.
11
16
  ```
12
17
 
13
18
  ## Prerequisites
14
19
 
15
- - OpenCode installed and available in your shell.
16
- - Node.js with npm, or Bun if your OpenCode setup uses Bun package resolution.
20
+ - Node.js with npm, or Bun if your setup uses Bun package resolution.
17
21
  - Git installed and available in your shell.
18
22
  - A target repository with tests or type checks available before you run `restore` mode.
23
+ - For Hermes: Hermes Agent CLI or an active Hermes session.
24
+ - **Windows**: PowerShell 5.1 or later (hooks use `.ps1` scripts on Windows).
19
25
 
20
26
  ## Recommended OpenCode Plugin Install
21
27
 
@@ -24,7 +30,7 @@ Add Code Archaeology to your `opencode.json` plugin array:
24
30
  ```json
25
31
  {
26
32
  "plugin": [
27
- "opencode-code-archaeology@git+https://github.com/Maleick/Code-Archaeology.git"
33
+ "opencode-code-archaeology@2.2.0"
28
34
  ]
29
35
  }
30
36
  ```
@@ -38,12 +44,48 @@ Restart OpenCode after editing the configuration. The command family should then
38
44
  /code-archaeology-restore
39
45
  ```
40
46
 
47
+ `/code-archaeology` runs the full 10-phase survey chain by default without per-phase prompts. It writes reports under `.archaeology/` and makes no source-code changes. Use `/code-archaeology-restore` only after reviewing the reports and deciding to apply changes.
48
+
49
+ ## Hermes Setup
50
+
51
+ ### 1. Install Code Archaeology CLI
52
+
53
+ ```bash
54
+ npm install -g opencode-code-archaeology@2.2.0
55
+ ```
56
+
57
+ ### 2. Setup Hermes Runtime
58
+
59
+ **macOS/Linux:**
60
+ ```bash
61
+ cd ~/projects/Code-Archaeology
62
+ bash hooks/hermes/setup.sh
63
+ ```
64
+
65
+ **Windows:**
66
+ ```powershell
67
+ cd ~/projects/Code-Archaeology
68
+ .\hooks\hermes\setup.ps1
69
+ ```
70
+
71
+ ### 3. Create Hermes Cronjob
72
+
73
+ ```bash
74
+ hermes cronjob create \
75
+ --name "code-archaeology-expedition" \
76
+ --schedule "every 15m" \
77
+ --workdir ~/projects/Code-Archaeology \
78
+ --prompt "Run one Code Archaeology expedition phase. Read .archaeology/session.json, execute current phase with verification, advance to next phase."
79
+ ```
80
+
81
+ See `skills/hermes/INTEGRATION.md` for full Hermes integration details.
82
+
41
83
  ## npm Global Install
42
84
 
43
85
  If you prefer a global package install:
44
86
 
45
87
  ```bash
46
- npm install -g opencode-code-archaeology
88
+ npm install -g opencode-code-archaeology@2.2.0
47
89
  opencode-code-archaeology install
48
90
  opencode-code-archaeology doctor
49
91
  opencode-code-archaeology version
@@ -52,7 +94,7 @@ opencode-code-archaeology version
52
94
  Then restart OpenCode and run:
53
95
 
54
96
  ```text
55
- /code-archaeology-survey
97
+ /code-archaeology
56
98
  ```
57
99
 
58
100
  ## One-Time Bun Path
@@ -60,8 +102,8 @@ Then restart OpenCode and run:
60
102
  If your environment supports one-time package execution through Bun:
61
103
 
62
104
  ```bash
63
- bunx opencode-code-archaeology install
64
- bunx opencode-code-archaeology doctor
105
+ bunx opencode-code-archaeology@2.2.0 install
106
+ bunx opencode-code-archaeology@2.2.0 doctor
65
107
  ```
66
108
 
67
109
  Use the plugin-array install for normal OpenCode usage.
@@ -83,41 +125,68 @@ npm install
83
125
  npm run build
84
126
  npm run typecheck
85
127
  bash -n hooks/opencode/*.sh
128
+ bash -n hooks/hermes/*.sh
129
+ ```
130
+
131
+ **Windows:**
132
+ ```powershell
133
+ npm install
134
+ npm run build
135
+ npm run typecheck
136
+ Get-ChildItem hooks/opencode/*.ps1 | ForEach-Object { Get-Command $_.FullName }
137
+ Get-ChildItem hooks/hermes/*.ps1 | ForEach-Object { Get-Command $_.FullName }
86
138
  ```
87
139
 
88
140
  To verify command availability, restart OpenCode in a Git repository and run:
89
141
 
90
142
  ```text
91
- /code-archaeology-survey
143
+ /code-archaeology
92
144
  ```
93
145
 
94
- The survey should create `.archaeology/` reports without modifying source files.
146
+ The default survey chain should create `.archaeology/` reports without modifying source files or asking to proceed phase by phase.
95
147
 
96
148
  ## Updating
97
149
 
98
- For plugin-array installs, update through your OpenCode package manager flow, then restart OpenCode. If your setup caches git plugins, clear the cached plugin package and let OpenCode reinstall it.
150
+ For plugin-array installs, update by changing the package version to a reviewed npm release, then restart OpenCode. Do not point OpenCode at a mutable Git branch such as `main` for automatic updates.
99
151
 
100
152
  For npm global installs:
101
153
 
102
154
  ```bash
103
- npm install -g opencode-code-archaeology@latest
155
+ npm install -g opencode-code-archaeology@2.2.0
104
156
  npm list -g opencode-code-archaeology --depth=0
105
157
  ```
106
158
 
107
159
  ## Troubleshooting
108
160
 
109
- ### Plugin Not Loading
161
+ ### Plugin Not Loading (OpenCode)
110
162
 
111
163
  - Confirm `opencode.json` is valid JSON.
112
164
  - Confirm the plugin entry is in the top-level `plugin` array.
113
165
  - Restart OpenCode after changing the config.
114
- - Check that Git can reach `https://github.com/Maleick/Code-Archaeology.git`.
166
+ - Check that npm can resolve the pinned `opencode-code-archaeology` release.
115
167
 
116
- ### Commands Not Found
168
+ ### Commands Not Found (OpenCode)
117
169
 
118
170
  - Restart OpenCode so it reloads plugin commands.
119
171
  - Confirm the package installed successfully with `npm list -g opencode-code-archaeology --depth=0` if using the global path.
120
- - Run `/code-archaeology-survey` from inside a Git repository, not from an empty directory.
172
+ - Run `/code-archaeology` from inside a Git repository, not from an empty directory.
173
+
174
+ ### Cron Not Running (Hermes)
175
+
176
+ ```bash
177
+ hermes cronjob list
178
+ hermes cronjob log code-archaeology-expedition
179
+ ```
180
+
181
+ ### Phase Blocked (Hermes)
182
+
183
+ ```bash
184
+ # Check blocker
185
+ cat .archaeology/session.json | jq '.flags.blocked_reason'
186
+
187
+ # Reset and retry
188
+ jq '.status = "running" | del(.flags.blocked_reason)' .archaeology/session.json > tmp.json && mv tmp.json .archaeology/session.json
189
+ ```
121
190
 
122
191
  ### Stale Cache
123
192
 
@@ -127,10 +196,10 @@ npm list -g opencode-code-archaeology --depth=0
127
196
 
128
197
  ### Restore Safety
129
198
 
130
- - Start with `/code-archaeology-survey`; it writes reports only.
199
+ - Start with `/code-archaeology` (OpenCode) or `mode = "survey"` (Hermes); it writes reports only.
131
200
  - Review `.archaeology/site_survey.md` and expedition reports before restore.
132
- - Use `/code-archaeology-excavate` for mock patches if you want another review gate.
133
- - Run `/code-archaeology-restore` only when the target repository has tests or type checks available.
201
+ - Use `/code-archaeology-excavate` (OpenCode) or `mode = "excavate"` (Hermes) for mock patches if you want another review gate.
202
+ - Run `/code-archaeology-restore` (OpenCode) or `mode = "restore"` (Hermes) only when the target repository has tests or type checks available.
134
203
  - Do not commit `.archaeology/`; it is local runtime state.
135
204
 
136
205
  ## Links
@@ -139,3 +208,4 @@ npm list -g opencode-code-archaeology --depth=0
139
208
  - Wiki: https://github.com/Maleick/Code-Archaeology/wiki
140
209
  - Releases: https://github.com/Maleick/Code-Archaeology/releases
141
210
  - Issues: https://github.com/Maleick/Code-Archaeology/issues
211
+ - Hermes docs: https://hermes-agent.nousresearch.com/docs