opencode-code-archaeology 2.0.2 → 2.2.1
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.
- package/AGENTS.md +42 -10
- package/CHANGELOG.md +66 -0
- package/CONTRIBUTING.md +2 -0
- package/INSTALL.md +90 -20
- package/README.md +90 -29
- package/VERSION +1 -1
- package/assets/code-archaeology-banner.svg +173 -44
- package/commands/code-archaeology.md +7 -5
- package/dist/cli.js +28 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -17
- package/dist/index.js.map +1 -1
- package/dist/platform.d.ts +4 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/platform.js +11 -0
- package/dist/platform.js.map +1 -0
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +2 -1
- package/dist/plugin.js.map +1 -1
- package/dist/runtime.d.ts +18 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +49 -0
- package/dist/runtime.js.map +1 -0
- package/dist/types.d.ts +1 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/docs/ARCHITECTURE.md +41 -10
- package/docs/INSTALL.md +50 -11
- package/docs/README.md +37 -9
- package/docs/RELEASE.md +20 -16
- package/docs/index.html +740 -0
- package/hooks/hermes/runner.ps1 +247 -0
- package/hooks/hermes/runner.sh +262 -0
- package/hooks/hermes/setup.ps1 +41 -0
- package/hooks/hermes/setup.sh +41 -0
- package/hooks/opencode/init.ps1 +83 -0
- package/hooks/opencode/revert-phase.ps1 +12 -0
- package/hooks/opencode/revert-phase.sh +3 -8
- package/hooks/opencode/update-expedition.ps1 +51 -0
- package/hooks/opencode/verify-package.sh +1 -0
- package/hooks/opencode/verify-phase.ps1 +35 -0
- package/hooks/opencode/verify-phase.sh +7 -7
- package/hooks/shared/command-utils.ps1 +100 -0
- package/package.json +16 -3
- package/skills/code-archaeology/SKILL.md +2 -2
- package/skills/hermes/INTEGRATION.md +120 -0
- package/skills/hermes/README.md +167 -0
- package/skills/hermes/code-archaeology-prompt.md +203 -0
- package/wiki/Expedition-Workflow.md +3 -1
- package/wiki/Home.md +2 -2
- package/wiki/Installation.md +2 -0
- package/wiki/Release-Process.md +6 -6
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -63
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -48
- package/.github/pull_request_template.md +0 -26
- package/.github/workflows/ci.yml +0 -45
- package/plugins/code-archaeology.ts +0 -8
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Code Archaeology Architecture
|
|
2
2
|
|
|
3
|
-
Code Archaeology is
|
|
3
|
+
Code Archaeology is a multi-runtime plugin that operates entirely inside the target repository. It coordinates slash commands (OpenCode), cron-based execution (Hermes), a domain skill, shell hooks, prompts, schemas, and local `.archaeology/` artifacts to run a fixed excavation workflow.
|
|
4
4
|
|
|
5
5
|
## Repository Layout
|
|
6
6
|
|
|
@@ -11,39 +11,56 @@ Code-Archaeology/
|
|
|
11
11
|
|-- dist/ # Built package output for GitHub-based installs
|
|
12
12
|
|-- docs/ # Public documentation and release notes
|
|
13
13
|
|-- hooks/opencode/ # Init, verification, revert, and status hooks
|
|
14
|
-
|--
|
|
14
|
+
|-- hooks/hermes/ # Setup and runner hooks for Hermes Agent
|
|
15
|
+
|-- plugins/ # Repo-local legacy plugin shim
|
|
15
16
|
|-- prompts/ # Expedition prompts by phase
|
|
16
17
|
|-- schema/ # JSON schemas for reports
|
|
17
|
-
|-- skills/ # Code Archaeology skill
|
|
18
|
+
|-- skills/ # Code Archaeology skill definitions
|
|
19
|
+
| |-- code-archaeology/ # OpenCode skill
|
|
20
|
+
| `-- hermes/ # Hermes Agent skill and integration docs
|
|
18
21
|
|-- src/ # TypeScript package and CLI source
|
|
19
22
|
|-- wiki/ # Source pages for GitHub Wiki publication
|
|
20
23
|
|-- INSTALL.md # Root install handoff
|
|
21
24
|
|-- README.md # Public project overview
|
|
22
|
-
|
|
25
|
+
|-- AGENTS.md # Agent runtime guide
|
|
23
26
|
```
|
|
24
27
|
|
|
25
|
-
##
|
|
28
|
+
## Runtime Surfaces
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- `
|
|
30
|
+
### OpenCode Plugin Surfaces
|
|
31
|
+
|
|
32
|
+
- `dist/index.js` and the `./plugin` package export expose the plugin entry point consumed by OpenCode. `plugins/` is a repo-local legacy shim and is not included in npm package contents.
|
|
33
|
+
- `commands/` defines the slash command family: `/code-archaeology`, `/code-archaeology-survey`, `/code-archaeology-excavate`, and `/code-archaeology-restore`. The default `/code-archaeology` command runs the full survey chain without per-phase prompts and remains non-destructive.
|
|
34
|
+
- `skills/code-archaeology/` contains the domain workflow instructions agents follow during an expedition.
|
|
30
35
|
- `hooks/opencode/` provides shell gates for session setup, verification, rollback, and status updates.
|
|
31
36
|
- `prompts/` and `schema/` provide phase-specific guidance and artifact structure.
|
|
32
37
|
- `src/` builds the npm package and CLI used by `opencode-code-archaeology install`, `doctor`, and `version`.
|
|
33
38
|
|
|
39
|
+
### Hermes Agent Surfaces
|
|
40
|
+
|
|
41
|
+
- `hooks/hermes/setup.sh` detects Hermes capabilities and writes `hermes-runtime.json`.
|
|
42
|
+
- `hooks/hermes/runner.sh` executes one expedition phase per cron run with built-in verification.
|
|
43
|
+
- `skills/hermes/` contains the Hermes-specific skill prompt, integration guide, and README.
|
|
44
|
+
- Hermes uses the same `.archaeology/session.json` state file as OpenCode.
|
|
45
|
+
|
|
34
46
|
## Commands, Skills, And Hooks
|
|
35
47
|
|
|
36
|
-
Commands are the user-facing entry points.
|
|
48
|
+
Commands are the user-facing entry points. `/code-archaeology` selects survey mode by default and runs all 10 phases to produce reports. The explicit restore command is required before source files are changed.
|
|
37
49
|
|
|
38
50
|
The Code Archaeology skill defines the expedition order, safety constraints, language-tool preferences, and reporting expectations. It is the agent-facing control layer that prevents phases from running out of order.
|
|
39
51
|
|
|
40
52
|
Hooks are the shell-level enforcement layer:
|
|
41
53
|
|
|
54
|
+
### OpenCode hooks
|
|
42
55
|
- `init.sh` initializes `.archaeology/` and session state.
|
|
43
56
|
- `verify-phase.sh <phase>` runs configured tests and type checks between phases.
|
|
44
57
|
- `revert-phase.sh <phase>` reverts changes when a restore phase fails verification.
|
|
45
58
|
- `update-expedition.sh <phase> <status> [findings]` updates session progress.
|
|
46
59
|
|
|
60
|
+
### Hermes hooks
|
|
61
|
+
- `setup.sh` detects Hermes CLI / active session and writes runtime config.
|
|
62
|
+
- `runner.sh` reads session state, executes one phase, verifies, and advances.
|
|
63
|
+
|
|
47
64
|
## Expedition Flow
|
|
48
65
|
|
|
49
66
|
The phase order is fixed because later cleanup depends on earlier evidence:
|
|
@@ -61,6 +78,18 @@ The phase order is fixed because later cleanup depends on earlier evidence:
|
|
|
61
78
|
|
|
62
79
|
`survey` mode writes reports only. `excavate` mode writes reports plus mock patches. `restore` mode applies approved changes and must pass verification between phases.
|
|
63
80
|
|
|
81
|
+
## Runtime Comparison
|
|
82
|
+
|
|
83
|
+
| Feature | OpenCode | Hermes |
|
|
84
|
+
|---------|----------|--------|
|
|
85
|
+
| Entry | `/code-archaeology` slash command | `cronjob` |
|
|
86
|
+
| Phases | All in one session | One per cron run |
|
|
87
|
+
| Verification | Between expeditions | Between every phase |
|
|
88
|
+
| Revert | Manual or automatic | Automatic on failure |
|
|
89
|
+
| State | `.archaeology/session.json` | Same file |
|
|
90
|
+
| Background | Plugin stays active | Cron resumes automatically |
|
|
91
|
+
| Real-time | Yes | Delayed (15-min intervals) |
|
|
92
|
+
|
|
64
93
|
## Artifact Lifecycle
|
|
65
94
|
|
|
66
95
|
Runtime artifacts live in `.archaeology/` inside the target repository:
|
|
@@ -73,6 +102,7 @@ Runtime artifacts live in `.archaeology/` inside the target repository:
|
|
|
73
102
|
| `FINAL_CATALOG.md` | Final excavation summary and recommendations. |
|
|
74
103
|
| `excavation_log.txt` | `git diff --stat` for applied restoration work. |
|
|
75
104
|
| `patches/` | Mock patches generated by `excavate` mode. |
|
|
105
|
+
| `hermes-runtime.json` | Hermes runtime configuration (Hermes only). |
|
|
76
106
|
|
|
77
107
|
`.archaeology/` is ignored local state and should not be committed.
|
|
78
108
|
|
|
@@ -83,7 +113,8 @@ Runtime artifacts live in `.archaeology/` inside the target repository:
|
|
|
83
113
|
- Never consolidate types before dead code and legacy removal.
|
|
84
114
|
- Never remove try/catch blocks from I/O or external input boundaries automatically.
|
|
85
115
|
- Flag uncertain type replacements for human review instead of guessing.
|
|
86
|
-
- Run `verify-phase.sh` between restore phases.
|
|
116
|
+
- Run `verify-phase.sh` between restore phases (OpenCode).
|
|
117
|
+
- Run built-in verification in `runner.sh` between phases (Hermes).
|
|
87
118
|
- Run `revert-phase.sh` and stop if a phase introduces test failures.
|
|
88
119
|
- Keep restore work isolated to the configured branch, `refactor/archaeology` by default.
|
|
89
120
|
|
package/docs/INSTALL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Install Code Archaeology
|
|
2
2
|
|
|
3
|
-
This guide mirrors the root [`INSTALL.md`](../INSTALL.md) and covers the recommended OpenCode plugin configuration
|
|
3
|
+
This guide mirrors the root [`INSTALL.md`](../INSTALL.md) and covers the recommended OpenCode plugin configuration, npm CLI install path, and Hermes Agent setup.
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
@@ -8,6 +8,7 @@ This guide mirrors the root [`INSTALL.md`](../INSTALL.md) and covers the recomme
|
|
|
8
8
|
- Node.js 18 or newer with npm.
|
|
9
9
|
- Git installed and available in your shell.
|
|
10
10
|
- A target repository with tests or type checks before running `restore` mode.
|
|
11
|
+
- For Hermes: Hermes Agent CLI or an active Hermes session.
|
|
11
12
|
|
|
12
13
|
## Recommended OpenCode Plugin Install
|
|
13
14
|
|
|
@@ -16,7 +17,7 @@ Add Code Archaeology to the top-level `plugin` array in `opencode.json`:
|
|
|
16
17
|
```json
|
|
17
18
|
{
|
|
18
19
|
"plugin": [
|
|
19
|
-
"opencode-code-archaeology@
|
|
20
|
+
"opencode-code-archaeology@2.2.0"
|
|
20
21
|
]
|
|
21
22
|
}
|
|
22
23
|
```
|
|
@@ -30,12 +31,14 @@ Restart OpenCode after editing the configuration. The command family should then
|
|
|
30
31
|
/code-archaeology-restore
|
|
31
32
|
```
|
|
32
33
|
|
|
34
|
+
`/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.
|
|
35
|
+
|
|
33
36
|
## npm Global Install
|
|
34
37
|
|
|
35
38
|
Use the npm package when you want the CLI installer and diagnostics:
|
|
36
39
|
|
|
37
40
|
```bash
|
|
38
|
-
npm install -g opencode-code-archaeology
|
|
41
|
+
npm install -g opencode-code-archaeology@2.2.0
|
|
39
42
|
opencode-code-archaeology install
|
|
40
43
|
opencode-code-archaeology doctor
|
|
41
44
|
opencode-code-archaeology version
|
|
@@ -44,9 +47,31 @@ opencode-code-archaeology version
|
|
|
44
47
|
Then restart OpenCode and run:
|
|
45
48
|
|
|
46
49
|
```text
|
|
47
|
-
/code-archaeology
|
|
50
|
+
/code-archaeology
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Hermes Setup
|
|
54
|
+
|
|
55
|
+
Install the CLI globally so Hermes can invoke Code Archaeology commands. To initialize Hermes runtime metadata, run the hook from a local clone or from the unpacked package contents:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm install -g opencode-code-archaeology@2.2.0
|
|
59
|
+
cd ~/projects/Code-Archaeology
|
|
60
|
+
bash hooks/hermes/setup.sh
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Create a cronjob that runs exactly one expedition phase per invocation:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
hermes cronjob create \
|
|
67
|
+
--name "code-archaeology-expedition" \
|
|
68
|
+
--schedule "every 15m" \
|
|
69
|
+
--workdir ~/projects/Code-Archaeology \
|
|
70
|
+
--prompt "Run one Code Archaeology expedition phase. Read .archaeology/session.json, execute current phase with verification, advance to next phase."
|
|
48
71
|
```
|
|
49
72
|
|
|
73
|
+
See [`skills/hermes/INTEGRATION.md`](../skills/hermes/INTEGRATION.md) for the full Hermes workflow.
|
|
74
|
+
|
|
50
75
|
## Verification
|
|
51
76
|
|
|
52
77
|
Confirm the published package and local CLI are visible:
|
|
@@ -65,24 +90,25 @@ npm install
|
|
|
65
90
|
npm run build
|
|
66
91
|
npm run typecheck
|
|
67
92
|
bash -n hooks/opencode/*.sh
|
|
93
|
+
bash -n hooks/hermes/*.sh
|
|
68
94
|
```
|
|
69
95
|
|
|
70
96
|
To verify plugin behavior, restart OpenCode in a Git repository and run:
|
|
71
97
|
|
|
72
98
|
```text
|
|
73
|
-
/code-archaeology
|
|
99
|
+
/code-archaeology
|
|
74
100
|
```
|
|
75
101
|
|
|
76
|
-
The survey should create `.archaeology/` reports without modifying source files.
|
|
102
|
+
The default survey chain should create `.archaeology/` reports without modifying source files or asking to proceed phase by phase.
|
|
77
103
|
|
|
78
104
|
## Updating
|
|
79
105
|
|
|
80
|
-
For plugin-array installs, update
|
|
106
|
+
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.
|
|
81
107
|
|
|
82
108
|
For npm global installs:
|
|
83
109
|
|
|
84
110
|
```bash
|
|
85
|
-
npm install -g opencode-code-archaeology@
|
|
111
|
+
npm install -g opencode-code-archaeology@2.2.0
|
|
86
112
|
npm list -g opencode-code-archaeology --depth=0
|
|
87
113
|
opencode-code-archaeology doctor
|
|
88
114
|
```
|
|
@@ -94,13 +120,26 @@ opencode-code-archaeology doctor
|
|
|
94
120
|
- Confirm `opencode.json` is valid JSON.
|
|
95
121
|
- Confirm the package entry is in the top-level `plugin` array, not `plugins`.
|
|
96
122
|
- Restart OpenCode after changing configuration.
|
|
97
|
-
- Confirm
|
|
123
|
+
- Confirm npm can resolve the pinned `opencode-code-archaeology` release.
|
|
98
124
|
|
|
99
125
|
### Commands Not Found
|
|
100
126
|
|
|
101
127
|
- Restart OpenCode so it reloads plugin commands.
|
|
102
128
|
- Confirm the npm package installed with `npm list -g opencode-code-archaeology --depth=0` if using the global path.
|
|
103
|
-
- Run `/code-archaeology
|
|
129
|
+
- Run `/code-archaeology` from inside a Git repository.
|
|
130
|
+
|
|
131
|
+
### Cron Not Running
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
hermes cronjob list
|
|
135
|
+
hermes cronjob log code-archaeology-expedition
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Phase Blocked
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
cat .archaeology/session.json | jq '.flags.blocked_reason'
|
|
142
|
+
```
|
|
104
143
|
|
|
105
144
|
### Stale Cache
|
|
106
145
|
|
|
@@ -110,7 +149,7 @@ opencode-code-archaeology doctor
|
|
|
110
149
|
|
|
111
150
|
### Restore Safety
|
|
112
151
|
|
|
113
|
-
- Start with `/code-archaeology
|
|
152
|
+
- Start with `/code-archaeology`; it writes reports only.
|
|
114
153
|
- Review `.archaeology/site_survey.md` and expedition reports before restore.
|
|
115
154
|
- Use `/code-archaeology-excavate` for mock patches if you want another review gate.
|
|
116
155
|
- Run `/code-archaeology-restore` only when the target repository has tests or type checks available.
|
package/docs/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Code Archaeology Documentation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Excavate technical debt. Restore with confidence.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Code Archaeology is a multi-runtime plugin for systematic codebase excavation, cataloging, and restoration. It supports both **OpenCode** (interactive slash commands) and **Hermes Agent** (cron-based background execution). It runs inside the target repository, writes local `.archaeology/` reports, and only modifies source files in `restore` mode after review and verification.
|
|
6
|
+
|
|
7
|
+
The public landing page is [`index.html`](index.html). These Markdown files remain the detailed documentation source.
|
|
6
8
|
|
|
7
9
|
## Quick Links
|
|
8
10
|
|
|
@@ -12,24 +14,33 @@ These Markdown files are ready to serve from GitHub Pages, but this repository d
|
|
|
12
14
|
- [Security Audit](SECURITY_AUDIT.md)
|
|
13
15
|
- [Repository README](../README.md)
|
|
14
16
|
- [Root Install Handoff](../INSTALL.md)
|
|
17
|
+
- [Hermes Integration](../skills/hermes/INTEGRATION.md)
|
|
18
|
+
- [Hermes Skill](../skills/hermes/README.md)
|
|
15
19
|
|
|
16
20
|
## Quick Start
|
|
17
21
|
|
|
22
|
+
### OpenCode
|
|
23
|
+
|
|
18
24
|
Install the package globally, register the plugin, then verify the CLI:
|
|
19
25
|
|
|
20
26
|
```bash
|
|
21
|
-
npm install -g opencode-code-archaeology
|
|
22
|
-
opencode-code-archaeology install
|
|
23
|
-
opencode-code-archaeology doctor
|
|
24
|
-
opencode-code-archaeology version
|
|
27
|
+
npm install -g opencode-code-archaeology@2.2.0 && opencode-code-archaeology install && opencode-code-archaeology doctor
|
|
25
28
|
```
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
Or tell OpenCode:
|
|
28
31
|
|
|
29
32
|
```text
|
|
30
|
-
/code-archaeology-
|
|
33
|
+
Fetch and follow the instructions in the installed package's INSTALL.md at $(npm root -g)/opencode-code-archaeology/INSTALL.md for opencode-code-archaeology@2.2.0
|
|
31
34
|
```
|
|
32
35
|
|
|
36
|
+
Restart OpenCode in the repository you want to inspect and start with the non-destructive default command:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
/code-archaeology
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This runs the full 10-phase survey chain without per-phase prompts, writes reports under `.archaeology/`, and makes no source-code changes.
|
|
43
|
+
|
|
33
44
|
Review `.archaeology/site_survey.md` and expedition reports before using:
|
|
34
45
|
|
|
35
46
|
```text
|
|
@@ -37,8 +48,25 @@ Review `.archaeology/site_survey.md` and expedition reports before using:
|
|
|
37
48
|
/code-archaeology-restore
|
|
38
49
|
```
|
|
39
50
|
|
|
51
|
+
### Hermes Agent
|
|
52
|
+
|
|
53
|
+
Setup the Hermes runtime and create a cronjob:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
cd ~/projects/Code-Archaeology
|
|
57
|
+
bash hooks/hermes/setup.sh
|
|
58
|
+
|
|
59
|
+
hermes cronjob create \
|
|
60
|
+
--name "code-archaeology-expedition" \
|
|
61
|
+
--schedule "every 15m" \
|
|
62
|
+
--workdir ~/projects/Code-Archaeology \
|
|
63
|
+
--prompt "Run one Code Archaeology expedition phase. Read .archaeology/session.json, execute current phase with test/typecheck verification, advance to next phase. STOP after one phase."
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Each cron run executes exactly **one** phase. Ten phases complete in ~2.5 hours minimum.
|
|
67
|
+
|
|
40
68
|
## Safety Warning
|
|
41
69
|
|
|
42
|
-
`survey
|
|
70
|
+
`/code-archaeology` defaults to survey mode and writes reports only. `excavate` mode writes reports and mock patches. `restore` mode can edit source files and should only run after report review, on an isolated branch, with tests or type checks available.
|
|
43
71
|
|
|
44
72
|
Do not commit `.archaeology/`; it is local runtime state.
|
package/docs/RELEASE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Release Process
|
|
2
2
|
|
|
3
|
-
This checklist is for future `opencode-code-archaeology` releases. `v2.0
|
|
3
|
+
This checklist is for future `opencode-code-archaeology` releases. `v2.2.0` is the current release example; replace it with the next version when preparing a new release.
|
|
4
4
|
|
|
5
5
|
## 1. Preflight
|
|
6
6
|
|
|
@@ -12,23 +12,23 @@ This checklist is for future `opencode-code-archaeology` releases. `v2.0.2` is t
|
|
|
12
12
|
|
|
13
13
|
## 2. Version Bump
|
|
14
14
|
|
|
15
|
-
For a future release, replace `2.0
|
|
15
|
+
For a future release, replace `2.2.0` with the target version:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npm version 2.0
|
|
18
|
+
npm version 2.2.0 --no-git-tag-version
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Update `VERSION` to the same value:
|
|
22
22
|
|
|
23
23
|
```text
|
|
24
|
-
2.0
|
|
24
|
+
2.2.0
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
Confirm `package.json`, `package-lock.json`, and `VERSION` agree.
|
|
28
28
|
|
|
29
29
|
## 3. Changelog
|
|
30
30
|
|
|
31
|
-
- Add a `v2.0
|
|
31
|
+
- Add a `v2.2.0` entry, or the future target version, to `CHANGELOG.md`.
|
|
32
32
|
- Include user-visible changes, safety notes, and any migration instructions.
|
|
33
33
|
- Keep the release notes factual and avoid claiming publication steps that have not happened yet.
|
|
34
34
|
|
|
@@ -43,6 +43,7 @@ npm run typecheck
|
|
|
43
43
|
npm audit --audit-level=moderate
|
|
44
44
|
npm outdated --json
|
|
45
45
|
bash -n hooks/opencode/*.sh
|
|
46
|
+
bash -n hooks/hermes/*.sh
|
|
46
47
|
npm pack --json --dry-run
|
|
47
48
|
```
|
|
48
49
|
|
|
@@ -51,7 +52,7 @@ Expected outcomes:
|
|
|
51
52
|
- Build and typecheck pass.
|
|
52
53
|
- npm audit reports no moderate-or-higher vulnerabilities.
|
|
53
54
|
- npm outdated reports `{}` or no actionable outdated dependencies.
|
|
54
|
-
- Shell hooks pass syntax checks.
|
|
55
|
+
- Shell hooks pass syntax checks (both OpenCode and Hermes).
|
|
55
56
|
- The package dry run includes required files.
|
|
56
57
|
|
|
57
58
|
## 5. npm Pack Required Files
|
|
@@ -63,7 +64,6 @@ Inspect `npm pack --json --dry-run` output for the package contents. Required fi
|
|
|
63
64
|
- `hooks/`
|
|
64
65
|
- `commands/`
|
|
65
66
|
- `skills/`
|
|
66
|
-
- `plugins/`
|
|
67
67
|
- `schema/`
|
|
68
68
|
- `prompts/`
|
|
69
69
|
- `docs/`
|
|
@@ -77,6 +77,8 @@ Inspect `npm pack --json --dry-run` output for the package contents. Required fi
|
|
|
77
77
|
- `SECURITY.md`
|
|
78
78
|
- `LICENSE`
|
|
79
79
|
|
|
80
|
+
`plugins/` is intentionally repo-local and should not appear in npm package contents.
|
|
81
|
+
|
|
80
82
|
If any required file is missing, update the `files` array in `package.json`, rerun `npm install` if the lockfile needs to change, and repeat the package dry run.
|
|
81
83
|
|
|
82
84
|
## 6. Commit, Tag, And Push
|
|
@@ -86,10 +88,10 @@ Only perform these steps after verification passes and after confirming the bran
|
|
|
86
88
|
```bash
|
|
87
89
|
git status --short
|
|
88
90
|
git add README.md INSTALL.md docs wiki assets .github SECURITY.md CONTRIBUTING.md CHANGELOG.md package.json package-lock.json VERSION .gitignore
|
|
89
|
-
git commit -m "chore: prepare v2.0
|
|
90
|
-
git tag v2.0
|
|
91
|
+
git commit -m "chore: prepare v2.2.0 release"
|
|
92
|
+
git tag v2.2.0
|
|
91
93
|
git push origin HEAD
|
|
92
|
-
git push origin v2.0
|
|
94
|
+
git push origin v2.2.0
|
|
93
95
|
```
|
|
94
96
|
|
|
95
97
|
For a future release, use the future version in the commit message and tag.
|
|
@@ -99,18 +101,20 @@ For a future release, use the future version in the commit message and tag.
|
|
|
99
101
|
Create the GitHub release from the matching tag:
|
|
100
102
|
|
|
101
103
|
```bash
|
|
102
|
-
gh release create v2.0
|
|
104
|
+
gh release create v2.2.0 --title "v2.2.0" --notes-file CHANGELOG.md
|
|
103
105
|
```
|
|
104
106
|
|
|
105
107
|
Before publishing, trim the notes to the specific version section if `CHANGELOG.md` contains multiple releases.
|
|
106
108
|
|
|
107
109
|
## 8. npm Publish
|
|
108
110
|
|
|
109
|
-
|
|
111
|
+
Publishing is performed by `.github/workflows/release.yml` through npm trusted publishing. Configure npm Trusted Publisher with:
|
|
110
112
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
- Publisher: `GitHub Actions`
|
|
114
|
+
- Organization or user: `Maleick`
|
|
115
|
+
- Repository: `Code-Archaeology`
|
|
116
|
+
- Workflow filename: `release.yml`
|
|
117
|
+
- Environment name: leave blank unless the workflow adds a GitHub Actions `environment`
|
|
114
118
|
|
|
115
119
|
If publishing fails, do not create a replacement tag unless the failure requires a new package version. Fix the issue, rerun verification, and follow npm versioning rules.
|
|
116
120
|
|
|
@@ -121,7 +125,7 @@ Confirm the public release surfaces report the expected version:
|
|
|
121
125
|
```bash
|
|
122
126
|
npm view opencode-code-archaeology version
|
|
123
127
|
npm view opencode-code-archaeology dist-tags
|
|
124
|
-
gh release view v2.0
|
|
128
|
+
gh release view v2.2.0
|
|
125
129
|
```
|
|
126
130
|
|
|
127
131
|
Optionally verify a fresh install path:
|