opencode-code-archaeology 2.0.0 → 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 (76) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.yml +63 -0
  2. package/.github/ISSUE_TEMPLATE/feature_request.yml +48 -0
  3. package/.github/pull_request_template.md +27 -0
  4. package/.github/workflows/ci.yml +45 -0
  5. package/.github/workflows/release.yml +46 -0
  6. package/AGENTS.md +42 -10
  7. package/CHANGELOG.md +79 -0
  8. package/CONTRIBUTING.md +50 -0
  9. package/INSTALL.md +211 -0
  10. package/README.md +255 -71
  11. package/SECURITY.md +20 -0
  12. package/VERSION +1 -1
  13. package/assets/code-archaeology-banner.svg +195 -0
  14. package/commands/code-archaeology.md +7 -5
  15. package/dist/cli.d.ts +3 -0
  16. package/dist/cli.d.ts.map +1 -0
  17. package/dist/cli.js +137 -0
  18. package/dist/cli.js.map +1 -0
  19. package/dist/index.d.ts +1 -5
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +1 -17
  22. package/dist/index.js.map +1 -1
  23. package/dist/platform.d.ts +4 -0
  24. package/dist/platform.d.ts.map +1 -0
  25. package/dist/platform.js +11 -0
  26. package/dist/platform.js.map +1 -0
  27. package/dist/plugin.d.ts +3 -0
  28. package/dist/plugin.d.ts.map +1 -0
  29. package/dist/plugin.js +3 -0
  30. package/dist/plugin.js.map +1 -0
  31. package/dist/runtime.d.ts +18 -0
  32. package/dist/runtime.d.ts.map +1 -0
  33. package/dist/runtime.js +49 -0
  34. package/dist/runtime.js.map +1 -0
  35. package/dist/types.d.ts +1 -6
  36. package/dist/types.d.ts.map +1 -1
  37. package/dist/types.js.map +1 -1
  38. package/docs/ARCHITECTURE.md +123 -0
  39. package/docs/INSTALL.md +156 -0
  40. package/docs/README.md +72 -0
  41. package/docs/RELEASE.md +139 -0
  42. package/docs/SECURITY_AUDIT.md +38 -0
  43. package/docs/index.html +740 -0
  44. package/hooks/hermes/runner.ps1 +247 -0
  45. package/hooks/hermes/runner.sh +262 -0
  46. package/hooks/hermes/setup.ps1 +41 -0
  47. package/hooks/hermes/setup.sh +41 -0
  48. package/hooks/opencode/init.ps1 +83 -0
  49. package/hooks/opencode/revert-phase.ps1 +12 -0
  50. package/hooks/opencode/revert-phase.sh +3 -8
  51. package/hooks/opencode/update-expedition.ps1 +51 -0
  52. package/hooks/opencode/verify-package.sh +47 -0
  53. package/hooks/opencode/verify-phase.ps1 +35 -0
  54. package/hooks/opencode/verify-phase.sh +7 -7
  55. package/hooks/shared/command-utils.ps1 +100 -0
  56. package/package.json +41 -6
  57. package/prompts/dead_code.md +45 -0
  58. package/prompts/dependencies.md +49 -0
  59. package/prompts/discovery.md +47 -0
  60. package/prompts/dry.md +49 -0
  61. package/prompts/errors.md +52 -0
  62. package/prompts/final_verify.md +58 -0
  63. package/prompts/legacy.md +49 -0
  64. package/prompts/polish.md +48 -0
  65. package/prompts/types_consolidate.md +48 -0
  66. package/prompts/types_harden.md +51 -0
  67. package/skills/code-archaeology/SKILL.md +2 -2
  68. package/skills/hermes/INTEGRATION.md +120 -0
  69. package/skills/hermes/README.md +167 -0
  70. package/skills/hermes/code-archaeology-prompt.md +203 -0
  71. package/wiki/Expedition-Workflow.md +34 -0
  72. package/wiki/Home.md +27 -0
  73. package/wiki/Installation.md +44 -0
  74. package/wiki/Release-Process.md +31 -0
  75. package/wiki/Security-and-Safety.md +21 -0
  76. package/plugins/code-archaeology.ts +0 -8
@@ -0,0 +1,34 @@
1
+ # Expedition Workflow
2
+
3
+ [Home](Home) | [Installation](Installation) | [Security](Security-and-Safety) | [Release](Release-Process)
4
+
5
+ Code Archaeology runs phases in a fixed order so later changes are based on earlier evidence. In OpenCode, `/code-archaeology` runs the full 10-phase survey chain by default without per-phase prompts.
6
+
7
+ 1. Site Survey & Baseline
8
+ 2. Dead Code Excavation
9
+ 3. Legacy Stratum Removal
10
+ 4. Circular Dependency Cartography
11
+ 5. Type Catalog Consolidation
12
+ 6. Type Restoration & Hardening
13
+ 7. DRY Stratification
14
+ 8. Error Handling Stratigraphy
15
+ 9. Artifact Cleaning & Documentation
16
+ 10. Site Preservation & Final Catalog
17
+
18
+ ## Modes
19
+
20
+ | Mode | Behavior |
21
+ | --- | --- |
22
+ | `survey` | Reports only; no source edits. |
23
+ | `excavate` | Reports plus mock patches in `.archaeology/patches/`. |
24
+ | `restore` | Applies approved changes with verification gates. |
25
+
26
+ Use `/code-archaeology-restore` explicitly when you are ready to apply changes. The default `/code-archaeology` command remains survey-only and writes reports under `.archaeology/`.
27
+
28
+ ## Local Artifacts
29
+
30
+ `.archaeology/` contains `session.json`, `site_survey.md`, expedition reports, `FINAL_CATALOG.md`, `excavation_log.txt`, and optional mock patches. It is local runtime state and should not be committed.
31
+
32
+ ## Gates
33
+
34
+ `hooks/opencode/init.sh` initializes the session. `verify-phase.sh` runs tests and type checks between restore phases. `revert-phase.sh` reverts a failed restore phase. `update-expedition.sh` records progress.
package/wiki/Home.md ADDED
@@ -0,0 +1,27 @@
1
+ # Code Archaeology Wiki
2
+
3
+ Code Archaeology is an OpenCode plugin for systematic codebase excavation, cataloging, and restoration. It runs a fixed, report-first workflow and keeps runtime artifacts local in `.archaeology/`.
4
+
5
+ ## Navigation
6
+
7
+ - [Installation](Installation)
8
+ - [Expedition Workflow](Expedition-Workflow)
9
+ - [Security and Safety](Security-and-Safety)
10
+ - [Release Process](Release-Process)
11
+
12
+ ## Quick Start
13
+
14
+ ```bash
15
+ npm install -g opencode-code-archaeology
16
+ opencode-code-archaeology install
17
+ opencode-code-archaeology doctor
18
+ opencode-code-archaeology version
19
+ ```
20
+
21
+ Restart OpenCode inside a Git repository and run:
22
+
23
+ ```text
24
+ /code-archaeology
25
+ ```
26
+
27
+ `/code-archaeology` runs the full 10-phase survey chain without per-phase prompts, writes `.archaeology/` reports only, and makes no source-code changes. Review reports, then choose `excavate` for mock patches or `restore` for approved, test-gated changes.
@@ -0,0 +1,44 @@
1
+ # Installation
2
+
3
+ [Home](Home) | [Workflow](Expedition-Workflow) | [Security](Security-and-Safety) | [Release](Release-Process)
4
+
5
+ ## OpenCode Plugin Install
6
+
7
+ Add the package to the top-level `plugin` array in `opencode.json`:
8
+
9
+ ```json
10
+ {
11
+ "plugin": [
12
+ "opencode-code-archaeology@git+https://github.com/Maleick/Code-Archaeology.git"
13
+ ]
14
+ }
15
+ ```
16
+
17
+ Restart OpenCode. Commands should be available inside a Git repository:
18
+
19
+ ```text
20
+ /code-archaeology
21
+ /code-archaeology-survey
22
+ /code-archaeology-excavate
23
+ /code-archaeology-restore
24
+ ```
25
+
26
+ `/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.
27
+
28
+ ## npm CLI Path
29
+
30
+ ```bash
31
+ npm install -g opencode-code-archaeology
32
+ opencode-code-archaeology install
33
+ opencode-code-archaeology doctor
34
+ opencode-code-archaeology version
35
+ ```
36
+
37
+ For updates:
38
+
39
+ ```bash
40
+ npm install -g opencode-code-archaeology@latest
41
+ npm list -g opencode-code-archaeology --depth=0
42
+ ```
43
+
44
+ If commands do not appear, restart OpenCode, verify `opencode.json` uses `plugin` singular, and clear any stale OpenCode plugin cache.
@@ -0,0 +1,31 @@
1
+ # Release Process
2
+
3
+ [Home](Home) | [Installation](Installation) | [Workflow](Expedition-Workflow) | [Security](Security-and-Safety)
4
+
5
+ Use this checklist for future `opencode-code-archaeology` releases. `v2.1.0` is the current example version; replace it with the target version.
6
+
7
+ ## Checklist
8
+
9
+ 1. Review the worktree for unrelated changes and local state.
10
+ 2. Bump package files with `npm version 2.1.0 --no-git-tag-version`.
11
+ 3. Update `VERSION` to `2.1.0`.
12
+ 4. Update `CHANGELOG.md` with release notes.
13
+ 5. Run verification:
14
+
15
+ ```bash
16
+ npm install
17
+ npm run build
18
+ npm run typecheck
19
+ npm audit --audit-level=moderate
20
+ npm outdated --json
21
+ bash -n hooks/opencode/*.sh
22
+ npm pack --json --dry-run
23
+ ```
24
+
25
+ 6. Confirm the package dry run includes `dist`, `assets`, `hooks`, `commands`, `skills`, `plugins`, `schema`, `prompts`, `docs`, `wiki`, `README.md`, `INSTALL.md`, `CHANGELOG.md`, `SECURITY.md`, `CONTRIBUTING.md`, `VERSION`, `AGENTS.md`, and `LICENSE`.
26
+ 7. Commit release files, tag `v2.1.0`, push the branch, and push the tag.
27
+ 8. Create the GitHub release from the tag.
28
+ 9. Publish npm with `npm publish --access public`.
29
+ 10. Confirm `npm view opencode-code-archaeology version` and `gh release view v2.1.0` show the expected release.
30
+
31
+ Do not claim GitHub Pages is enabled unless repository settings confirm it.
@@ -0,0 +1,21 @@
1
+ # Security And Safety
2
+
3
+ [Home](Home) | [Installation](Installation) | [Workflow](Expedition-Workflow) | [Release](Release-Process)
4
+
5
+ ## Current Audit Notes
6
+
7
+ - `npm audit --audit-level=moderate` is expected to be clean.
8
+ - `npm outdated --json` is expected to be clean.
9
+ - No hardcoded secrets are expected in source, docs, hooks, commands, prompts, schemas, or metadata.
10
+ - `.archaeology/` and `.superpowers/` are ignored local state.
11
+ - Shell hooks can be syntax checked with `bash -n hooks/opencode/*.sh`.
12
+
13
+ ## Restore Caveat
14
+
15
+ `restore` mode can edit source files. Run it only after reviewing `survey` reports, preferably after reviewing `excavate` mock patches, and only when tests or type checks are available.
16
+
17
+ Failed restore phases should be reverted before continuing. The workflow must not remove try/catch blocks around I/O or external input boundaries automatically, and uncertain type replacements should be flagged for review.
18
+
19
+ ## Before Publishing
20
+
21
+ Run build, typecheck, npm audit, npm outdated, shell syntax checks, and `npm pack --json --dry-run`. Inspect the package contents for accidental local state or secrets before publishing.
@@ -1,8 +0,0 @@
1
- export {
2
- id,
3
- repoRoot,
4
- version,
5
- server,
6
- } from "../src/index.ts";
7
-
8
- export type * from "../src/types";