@theglitchking/hit-em-with-the-docs 2.5.0 → 2.7.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 (107) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +180 -0
  4. package/commands/archive.md +43 -0
  5. package/commands/domain.md +48 -0
  6. package/commands/help.md +10 -1
  7. package/dist/action/core/archive/candidates.d.ts +38 -0
  8. package/dist/action/core/archive/candidates.d.ts.map +1 -0
  9. package/dist/action/core/archive/links.d.ts +22 -0
  10. package/dist/action/core/archive/links.d.ts.map +1 -0
  11. package/dist/action/core/archive/manage.d.ts +50 -0
  12. package/dist/action/core/archive/manage.d.ts.map +1 -0
  13. package/dist/action/core/audit/auditor.d.ts.map +1 -1
  14. package/dist/action/core/audit/rules.d.ts.map +1 -1
  15. package/dist/action/core/domains/constants.d.ts +28 -23
  16. package/dist/action/core/domains/constants.d.ts.map +1 -1
  17. package/dist/action/core/domains/detector.d.ts +1 -1
  18. package/dist/action/core/domains/detector.d.ts.map +1 -1
  19. package/dist/action/core/domains/manage.d.ts +76 -0
  20. package/dist/action/core/domains/manage.d.ts.map +1 -0
  21. package/dist/action/core/domains/registry.d.ts +54 -0
  22. package/dist/action/core/domains/registry.d.ts.map +1 -0
  23. package/dist/action/core/links/tracker.d.ts.map +1 -1
  24. package/dist/action/core/metadata/schema.d.ts +73 -0
  25. package/dist/action/core/metadata/schema.d.ts.map +1 -1
  26. package/dist/action/generators/index-generator.d.ts.map +1 -1
  27. package/dist/action/generators/regenerate.d.ts.map +1 -1
  28. package/dist/action/generators/registry-generator.d.ts.map +1 -1
  29. package/dist/action/generators/scaffold.d.ts.map +1 -1
  30. package/dist/action/index.d.ts +4 -0
  31. package/dist/action/index.d.ts.map +1 -1
  32. package/dist/action/index.js +4 -4
  33. package/dist/action/utils/config.d.ts +211 -0
  34. package/dist/action/utils/config.d.ts.map +1 -1
  35. package/dist/action/utils/glob.d.ts +13 -1
  36. package/dist/action/utils/glob.d.ts.map +1 -1
  37. package/dist/cli/index.js +235 -5
  38. package/dist/cli/index.js.map +1 -1
  39. package/dist/core/archive/candidates.d.ts +38 -0
  40. package/dist/core/archive/candidates.d.ts.map +1 -0
  41. package/dist/core/archive/candidates.js +113 -0
  42. package/dist/core/archive/candidates.js.map +1 -0
  43. package/dist/core/archive/links.d.ts +22 -0
  44. package/dist/core/archive/links.d.ts.map +1 -0
  45. package/dist/core/archive/links.js +33 -0
  46. package/dist/core/archive/links.js.map +1 -0
  47. package/dist/core/archive/manage.d.ts +50 -0
  48. package/dist/core/archive/manage.d.ts.map +1 -0
  49. package/dist/core/archive/manage.js +163 -0
  50. package/dist/core/archive/manage.js.map +1 -0
  51. package/dist/core/audit/auditor.d.ts.map +1 -1
  52. package/dist/core/audit/auditor.js +16 -2
  53. package/dist/core/audit/auditor.js.map +1 -1
  54. package/dist/core/audit/rules.d.ts.map +1 -1
  55. package/dist/core/audit/rules.js +3 -2
  56. package/dist/core/audit/rules.js.map +1 -1
  57. package/dist/core/domains/constants.d.ts +28 -23
  58. package/dist/core/domains/constants.d.ts.map +1 -1
  59. package/dist/core/domains/constants.js +11 -41
  60. package/dist/core/domains/constants.js.map +1 -1
  61. package/dist/core/domains/detector.d.ts +1 -1
  62. package/dist/core/domains/detector.d.ts.map +1 -1
  63. package/dist/core/domains/detector.js +5 -5
  64. package/dist/core/domains/detector.js.map +1 -1
  65. package/dist/core/domains/manage.d.ts +76 -0
  66. package/dist/core/domains/manage.d.ts.map +1 -0
  67. package/dist/core/domains/manage.js +171 -0
  68. package/dist/core/domains/manage.js.map +1 -0
  69. package/dist/core/domains/registry.d.ts +54 -0
  70. package/dist/core/domains/registry.d.ts.map +1 -0
  71. package/dist/core/domains/registry.js +116 -0
  72. package/dist/core/domains/registry.js.map +1 -0
  73. package/dist/core/links/tracker.d.ts.map +1 -1
  74. package/dist/core/links/tracker.js +8 -5
  75. package/dist/core/links/tracker.js.map +1 -1
  76. package/dist/core/maintain/orchestrator.js +2 -2
  77. package/dist/core/maintain/orchestrator.js.map +1 -1
  78. package/dist/core/metadata/schema.d.ts +121 -48
  79. package/dist/core/metadata/schema.d.ts.map +1 -1
  80. package/dist/core/metadata/schema.js +14 -1
  81. package/dist/core/metadata/schema.js.map +1 -1
  82. package/dist/generators/index-generator.d.ts.map +1 -1
  83. package/dist/generators/index-generator.js +10 -10
  84. package/dist/generators/index-generator.js.map +1 -1
  85. package/dist/generators/regenerate.d.ts.map +1 -1
  86. package/dist/generators/regenerate.js +5 -4
  87. package/dist/generators/regenerate.js.map +1 -1
  88. package/dist/generators/registry-generator.d.ts.map +1 -1
  89. package/dist/generators/registry-generator.js +6 -6
  90. package/dist/generators/registry-generator.js.map +1 -1
  91. package/dist/generators/scaffold.d.ts.map +1 -1
  92. package/dist/generators/scaffold.js +66 -9
  93. package/dist/generators/scaffold.js.map +1 -1
  94. package/dist/index.d.ts +4 -0
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.js +5 -0
  97. package/dist/index.js.map +1 -1
  98. package/dist/utils/config.d.ts +211 -0
  99. package/dist/utils/config.d.ts.map +1 -1
  100. package/dist/utils/config.js +102 -5
  101. package/dist/utils/config.js.map +1 -1
  102. package/dist/utils/glob.d.ts +13 -1
  103. package/dist/utils/glob.d.ts.map +1 -1
  104. package/dist/utils/glob.js +23 -2
  105. package/dist/utils/glob.js.map +1 -1
  106. package/package.json +1 -1
  107. package/templates/claude/CLAUDE.md +5 -1
@@ -6,13 +6,13 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Official marketplace for hit-em-with-the-docs - Self-managing documentation system",
9
- "version": "2.5.0"
9
+ "version": "2.7.0"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "hit-em-with-the-docs",
14
14
  "description": "Self-managing documentation system with hierarchical structure, intelligent automation, pattern discovery, and agent orchestration",
15
- "version": "2.5.0",
15
+ "version": "2.7.0",
16
16
  "author": {
17
17
  "name": "TheGlitchKing"
18
18
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hit-em-with-the-docs",
3
3
  "description": "Self-managing documentation system with hierarchical structure, intelligent automation, pattern discovery, and agent orchestration",
4
- "version": "2.5.0",
4
+ "version": "2.7.0",
5
5
  "author": {
6
6
  "name": "TheGlitchKing",
7
7
  "email": "theglitchking@users.noreply.github.com"
package/README.md CHANGED
@@ -249,12 +249,16 @@ These commands run in your terminal and manage your documentation.
249
249
  | `hewtd maintain` | Run full health check and fix problems |
250
250
  | `hewtd integrate <file>` | Add a document to the system |
251
251
  | `hewtd list` | Show all 15 documentation categories |
252
+ | `hewtd domain list\|add\|remove` | Manage custom domains beyond the built-in 15 |
252
253
  | `hewtd search <query>` | Search for content in your docs |
253
254
  | `hewtd metadata-sync` | Update document information tags |
254
255
  | `hewtd link-check` | Find broken links between documents |
255
256
  | `hewtd audit` | Check documentation quality and compliance |
256
257
  | `hewtd report <type>` | Generate health, audit, or link reports |
257
258
  | `hewtd discover` | Scan code for patterns and create docs |
259
+ | `hewtd archive <file>` | Retire a doc into `archive/` (reversible, link-safe) |
260
+ | `hewtd unarchive <file>` | Restore an archived doc to where it came from |
261
+ | `hewtd archive-candidates` | List docs that may warrant archiving (advisory) |
258
262
 
259
263
  ##### Command Examples and Details
260
264
 
@@ -908,12 +912,128 @@ When you run `hewtd init`, it creates this structure:
908
912
  ├── backups/ # Backup/recovery (priority: 4)
909
913
  ├── plans/ # Planning docs (priority: 3)
910
914
 
915
+ ├── archive/ # Deprecated docs — EXCLUDED from all scans
916
+ ├── drafts/ # Work-in-progress
911
917
  └── reports/ # Generated reports
912
918
  ├── maintenance-YYYYMMDD-HHMMSS.md
913
919
  ├── audit-YYYYMMDD-HHMMSS.md
914
920
  └── links-YYYYMMDD-HHMMSS.md
915
921
  ```
916
922
 
923
+ #### Archived / deprecated docs (`archive/`)
924
+
925
+ `.documentation/archive/` is the parking lot for retired documentation. hewtd
926
+ **excludes the entire `archive/` subtree from every scan** — `audit`,
927
+ `link-check`, `metadata-sync`, `integrate` duplicate-detection, the link graph,
928
+ and `search`. Archived docs are never validated against the frontmatter schema,
929
+ never appear in any INDEX.md/REGISTRY.md, and won't break audit/link-check with
930
+ stale frontmatter. `init` scaffolds the folder with a README explaining the
931
+ convention. `archive` is a reserved name and cannot be registered as a domain.
932
+
933
+ ##### The archival process (2.7.0+)
934
+
935
+ The `archive/` folder shipped in 2.6.0 as a passive convention — you moved files
936
+ into it by hand. **2.7.0** turns it into an actual workflow: three commands, a
937
+ config block, and an audit nudge, all built around two principles. First,
938
+ **propose, don't impose** — detection is advisory, a human always executes the
939
+ move, and nothing is ever auto-archived. Second, **reversible and link-safe** —
940
+ archiving records where a doc came from so restore is lossless, and a link guard
941
+ keeps you from silently breaking the active corpus.
942
+
943
+ There's a deliberate stance baked into how candidates are detected, too. hewtd
944
+ **does not** use access-recency (it has no read telemetry) and **does not** treat
945
+ age alone as an archive signal. Docs aren't code: an unchanged foundational doc is
946
+ often the most important one in the tree, not the most disposable. The only
947
+ objective recency signal available is git-last-touched, and even that is advisory
948
+ and gated behind "this doc is also orphaned."
949
+
950
+ **`hewtd archive <file>`** retires a doc. It moves the file into
951
+ `archive/<same-domain-subpath>/` (so `api/old.md` lands at `archive/api/old.md`),
952
+ stamps lifecycle frontmatter (`status: archived`, `archived_on`, `archived_from`,
953
+ and `archived_reason` when you pass a reason), and regenerates the indexes so the
954
+ doc cleanly leaves its domain INDEX. It prefers `git mv` to preserve history and
955
+ falls back to a plain move when you're not in a git repo.
956
+
957
+ ```bash
958
+ # Preview first — moves nothing
959
+ hewtd archive api/old-endpoints.md --dry-run
960
+
961
+ # Retire it, recording why
962
+ hewtd archive api/old-endpoints.md -r "Replaced by the v2 endpoint reference"
963
+ ```
964
+
965
+ The **link guard** is on by default: if active docs still link to the target,
966
+ `archive` refuses and lists each offending link so you can fix them first. Pass
967
+ `--force` to archive anyway (those inbound links become dangling):
968
+
969
+ ```bash
970
+ hewtd archive api/old-endpoints.md --force
971
+ ```
972
+
973
+ **`hewtd unarchive <file>`** is the lossless reverse. It restores the doc to the
974
+ path recorded in `archived_from`, sets `status: active`, and strips the
975
+ `archived_*` fields. It refuses if the restore target already exists, so it never
976
+ clobbers a doc you've since recreated.
977
+
978
+ ```bash
979
+ hewtd unarchive archive/api/old-endpoints.md --dry-run
980
+ hewtd unarchive archive/api/old-endpoints.md
981
+ ```
982
+
983
+ **`hewtd archive-candidates`** is advisory and **read-only** — it never moves
984
+ anything. It lists docs that may warrant archiving, each with a score and the
985
+ reasons behind it:
986
+
987
+ ```bash
988
+ hewtd archive-candidates
989
+ hewtd archive-candidates --json
990
+ ```
991
+
992
+ The candidate signals, ranked:
993
+
994
+ 1. **`status: deprecated`** — a strong, explicit signal. Qualifies a doc on its
995
+ own.
996
+ 2. **`superseded_by:` frontmatter** — also strong and explicit. Qualifies alone.
997
+ 3. **Orphaned** (zero inbound links) — a weaker signal on its own.
998
+ 4. **Stale** — git-last-touched (or `last_updated` as a fallback when git is
999
+ unavailable) older than `candidate_after_days`. Age **only** contributes when
1000
+ the doc is *also* orphaned; it never qualifies a doc by itself.
1001
+
1002
+ ##### `archive` config block
1003
+
1004
+ Tune detection in `.claude/hit-em-with-the-docs.json` under an `archive` key. All
1005
+ four keys are optional; the defaults are conservative on purpose:
1006
+
1007
+ ```json
1008
+ {
1009
+ "archive": {
1010
+ "honor_status_deprecated": true,
1011
+ "candidate_after_days": 365,
1012
+ "require_orphaned": true,
1013
+ "auto": false
1014
+ }
1015
+ }
1016
+ ```
1017
+
1018
+ - `honor_status_deprecated` (default `true`) — treat `status: deprecated` as a
1019
+ qualifying candidate signal.
1020
+ - `candidate_after_days` (default `365`) — the staleness threshold in days.
1021
+ - `require_orphaned` (default `true`) — gate the age signal behind "also
1022
+ orphaned." Set it `false` to let age qualify a doc on its own (not
1023
+ recommended).
1024
+ - `auto` (default `false`) — nothing is ever auto-archived. This is the
1025
+ propose-don't-impose default; archiving is always a human decision.
1026
+
1027
+ ##### Audit nudge: `deprecated-not-archived`
1028
+
1029
+ `status: deprecated` and archiving are different steps. Marking a doc
1030
+ `deprecated` flags intent while keeping it live, indexed, and linkable; archiving
1031
+ physically retires it. To keep `deprecated` from being a dead-end label, the
1032
+ auditor now raises an **INFO** issue (`deprecated-not-archived`) for any doc left
1033
+ at `status: deprecated` in an active domain folder, suggesting
1034
+ `hewtd archive <file>`. That's what finally makes `status: deprecated`
1035
+ actionable.
1036
+
917
1037
  ### Domain System
918
1038
 
919
1039
  The system organizes documentation into 15 specialized domains with different priorities (1-10 scale, higher = more important):
@@ -944,6 +1064,66 @@ The system organizes documentation into 15 specialized domains with different pr
944
1064
  - **features**: Feature-specific documentation (features, procedures, workflows, quickstart)
945
1065
  - **advanced**: Specialized content (troubleshooting, agents, backups, plans)
946
1066
 
1067
+ #### Custom Domains (2.6.0+)
1068
+
1069
+ The 15 domains above are **built-in** — they're part of the compiled contract and are always present. Beyond those, you can register your own **custom domains** at runtime (no recompile) via the `hewtd domain` command. Custom domains are stored in your project's `.claude/hit-em-with-the-docs.json` under a `domains: []` array:
1070
+
1071
+ ```json
1072
+ {
1073
+ "domains": [
1074
+ {
1075
+ "id": "ml-pipeline",
1076
+ "name": "ML Pipeline",
1077
+ "description": "Model training and inference pipeline docs",
1078
+ "keywords": ["ml", "model", "training", "inference", "pipeline"],
1079
+ "loadPriority": 6,
1080
+ "category": "features"
1081
+ }
1082
+ ]
1083
+ }
1084
+ ```
1085
+
1086
+ Entry fields: `id` (kebab-case; can't collide with a built-in), `name`, `description`, `keywords` (at least one — they drive auto-classification in `hewtd integrate`), `loadPriority` (1-10), and `category` (one of `core`, `development`, `features`, `advanced`). You normally don't hand-edit this file — use the commands below.
1087
+
1088
+ **`hewtd domain list`** — list built-in + custom domains, marked by kind:
1089
+
1090
+ ```bash
1091
+ hewtd domain list
1092
+ hewtd domain list --json
1093
+ ```
1094
+
1095
+ **`hewtd domain add <id>`** — validate, write the config entry, scaffold `.documentation/<id>/` (with INDEX.md/REGISTRY.md), and refresh the root indexes. Keywords are required.
1096
+
1097
+ ```bash
1098
+ # Preview first (writes nothing) — shows the proposed config entry + folder
1099
+ hewtd domain add ml-pipeline -k "ml,model,training,inference,pipeline" --dry-run
1100
+
1101
+ # Apply it
1102
+ hewtd domain add ml-pipeline \
1103
+ -n "ML Pipeline" \
1104
+ -d "Model training and inference pipeline docs" \
1105
+ -k "ml,model,training,inference,pipeline" \
1106
+ -c features \
1107
+ --load-priority 6
1108
+
1109
+ # Then refresh indexes everywhere
1110
+ hewtd maintain
1111
+ ```
1112
+
1113
+ Guardrails: a built-in id is rejected, duplicate custom ids are rejected, non-kebab-case ids are rejected, empty keywords are rejected, and a bad `category` is rejected.
1114
+
1115
+ **`hewtd domain remove <id>`** (alias `rm`) — remove a custom domain from config. This is **non-destructive**: it never deletes the folder or the docs inside it. Any docs in `.documentation/<id>/` simply become *orphaned* (left on disk, no longer a recognized domain), and the command reports how many. Built-in domains cannot be removed.
1116
+
1117
+ ```bash
1118
+ # Preview — reports how many docs would be orphaned
1119
+ hewtd domain remove ml-pipeline --dry-run
1120
+
1121
+ # Apply
1122
+ hewtd domain remove ml-pipeline
1123
+ ```
1124
+
1125
+ In Claude Code, the `/hit-em-with-the-docs:domain` slash command wraps these and adds a confirm step before `add` (dry-run preview) and `remove` (orphaned-doc count) apply.
1126
+
947
1127
  ### Metadata Schema
948
1128
 
949
1129
  Every document includes YAML frontmatter with up to 22 fields:
@@ -0,0 +1,43 @@
1
+ ---
2
+ description: Deprecate/retire a doc — move it into archive/ (reversible, link-safe), or list archival candidates
3
+ allowed-tools: Bash(npx:*), Read
4
+ argument-hint: "candidates | archive <file> [--reason ...] | unarchive <file>"
5
+ ---
6
+
7
+ Arguments: $ARGUMENTS
8
+
9
+ This command wraps `npx --no @theglitchking/hit-em-with-the-docs <archive|unarchive|archive-candidates>`. It retires deprecated docs into `.documentation/archive/` (which hewtd excludes from all scans) — properly: history-preserving move, metadata stamp, reindex, and a link-safety guard. Dispatch on the first word of `$ARGUMENTS`:
10
+
11
+ ## `candidates` (or empty arguments)
12
+
13
+ - Run `npx --no @theglitchking/hit-em-with-the-docs archive-candidates` and report the suggestions with their reasons/scores. This is **advisory and read-only** — nothing moves. Offer to archive any the user confirms.
14
+
15
+ ## `archive <file>`
16
+
17
+ Moves the doc into `archive/<same-domain-path>/`, stamps `status: archived` + `archived_on` + `archived_from` (+ `archived_reason` if given), and reindexes.
18
+
19
+ - **Preview first** (always): run with `--dry-run`:
20
+ ```bash
21
+ npx --no @theglitchking/hit-em-with-the-docs archive <file> [--reason "..."] --dry-run
22
+ ```
23
+ - The dry-run reports any **active docs that link to this doc**. If there are inbound links:
24
+ - Surface them to the user (file:line). Archiving will leave them dangling.
25
+ - Recommend fixing those links first. Only proceed with `--force` on **explicit** user confirmation.
26
+ - If the user did not give a reason, ask for one (it's recorded in `archived_reason`).
27
+ - On confirmation, re-run without `--dry-run` (add `--force` only if the user accepted the dangling-link tradeoff). Suggest `hewtd maintain` afterward.
28
+
29
+ ## `unarchive <file>`
30
+
31
+ Restores an archived doc back to its original path (`archived_from`), `status: active`.
32
+
33
+ - Run with `--dry-run` to show where it will land, then re-run for real on confirmation:
34
+ ```bash
35
+ npx --no @theglitchking/hit-em-with-the-docs unarchive <file> --dry-run
36
+ ```
37
+ - If it reports the restore target already exists, relay that and don't force it.
38
+
39
+ ## Notes
40
+
41
+ - Criteria for archiving (what `candidates` ranks on): `status: deprecated` (strongest) → `superseded_by:` → orphaned (no inbound links) → age (only when also orphaned). **Age alone never qualifies a doc** — an unchanged doc is often the most important one.
42
+ - Don't hand-move files into `archive/`; the command does the metadata + reindex + link check that a bare `mv` skips.
43
+ - If the first word isn't `candidates`, `archive`, or `unarchive`, tell the user those are the valid subcommands.
@@ -0,0 +1,48 @@
1
+ ---
2
+ description: Manage custom documentation domains (list | add | remove) beyond the built-in 15
3
+ allowed-tools: Bash(npx:*)
4
+ argument-hint: "list | add <id> -k <keywords> | remove <id>"
5
+ ---
6
+
7
+ Arguments: $ARGUMENTS
8
+
9
+ This command wraps `npx --no @theglitchking/hit-em-with-the-docs domain ...`. The plugin ships 15 built-in domains; this lets the user add/remove their own at runtime without recompiling. Dispatch on the first word of `$ARGUMENTS`:
10
+
11
+ ## `list` (or empty arguments)
12
+
13
+ - Run `npx --no @theglitchking/hit-em-with-the-docs domain list` and report the built-in vs custom domains, their category, load priority, and description. Nothing to confirm — this is read-only.
14
+
15
+ ## `add <id>`
16
+
17
+ Adds a custom domain: writes the entry to `.claude/hit-em-with-the-docs.json` (under `domains: []`), scaffolds `.documentation/<id>/` with INDEX.md/REGISTRY.md, and refreshes the root indexes.
18
+
19
+ - Required fields the user must supply:
20
+ - `<id>` — kebab-case (e.g. `mobile`, `ml-pipeline`). A built-in id (e.g. `security`, `api`) is rejected.
21
+ - `-k <comma,separated,keywords>` — **REQUIRED**. These drive auto-classification in `integrate`. If the user did not provide keywords, **ask for them** before running.
22
+ - Optional fields (ask only if relevant): `-n <name>` (defaults to a title-cased id), `-d <description>`, `-c <category>` (one of `core | development | features | advanced`, default `features`), `--load-priority <n>` (1-10, default 5).
23
+ - **Preview first:** run with `--dry-run` to show the user the proposed config entry and the folder that will be scaffolded:
24
+ ```bash
25
+ npx --no @theglitchking/hit-em-with-the-docs domain add <id> -k "<keywords>" [-n "<name>"] [-d "<desc>"] [-c <category>] [--load-priority <n>] --dry-run
26
+ ```
27
+ - Show the user the proposed config entry and folder path. On their confirmation, re-run the **exact same command without `--dry-run`** to apply.
28
+ - After it applies, suggest the user run `hewtd maintain` to fully refresh the indexes and pick the new domain up everywhere.
29
+
30
+ ## `remove <id>` (alias `rm`) — DESTRUCTIVE INTENT, confirm before applying
31
+
32
+ Removes a custom domain from config. It is NON-DESTRUCTIVE on disk — it never deletes the folder or docs — but any docs in `.documentation/<id>/` become **orphaned** (no longer a recognized domain). Built-in domains cannot be removed.
33
+
34
+ - **Always run the dry-run first** to get the orphaned-doc count:
35
+ ```bash
36
+ npx --no @theglitchking/hit-em-with-the-docs domain remove <id> --dry-run
37
+ ```
38
+ - Show the user exactly what will happen, e.g.:
39
+ > Will remove custom domain `<id>`. N document(s) in `.documentation/<id>/` will be ORPHANED (left on disk, NOT deleted).
40
+ - **Only on EXPLICIT confirmation** from the user, re-run for real:
41
+ ```bash
42
+ npx --no @theglitchking/hit-em-with-the-docs domain remove <id>
43
+ ```
44
+ - If the dry-run reports a rejection (e.g. the id is a built-in domain, or no such custom domain exists), relay the error and do not re-run.
45
+
46
+ ## Notes
47
+
48
+ - If the first word is anything other than `list`, `add`, `remove`, or `rm`, tell the user the valid subcommands are `list`, `add <id>`, and `remove <id>`.
package/commands/help.md CHANGED
@@ -19,6 +19,8 @@ If `$ARGUMENTS` matches one of the topics below, focus the orientation on that t
19
19
  - `audit` — explain `hewtd audit` + `--strict`; explain when to use each
20
20
  - `integrate` — explain `hewtd integrate <file>` and when to use it
21
21
  - `templates` — list available templates with paths
22
+ - `domains` — explain the 15 built-in domains + custom domains (`hewtd domain add/remove/list`, 2.6.0+)
23
+ - `archive` / `deprecation` — explain the archival workflow (`hewtd archive/unarchive/archive-candidates`, 2.7.0+)
22
24
 
23
25
  ## What hewtd does (the one-paragraph brief)
24
26
 
@@ -31,6 +33,7 @@ If `$ARGUMENTS` matches one of the topics below, focus the orientation on that t
31
33
  3. **Creating a fact in the knowledge base (2.3.0+)** — copy `templates/knowledge-base/fact.template.md` into `<vault-root>/facts/<kebab-id>.md`, fill in required fields (`id`, `confidence`, `last_verified`, `provenance`).
32
34
  4. **Documenting an incident (2.3.0+)** — create `<vault-root>/incidents/YYYY-MM-DD-slug/` with both `narrative.md` and `facts.md` from the templates.
33
35
  5. **Enriching a playbook (2.3.0+)** — add a `symptoms:` block to a playbook's frontmatter; cite the facts the playbook depends on.
36
+ 6. **Deprecating / retiring a doc (2.7.0+)** — `hewtd archive <file>` moves a stale doc into `.documentation/archive/` (excluded from all scans), reversibly and link-safely. Run `hewtd archive-candidates` to see what's worth retiring; `hewtd unarchive <file>` to bring one back.
34
37
 
35
38
  ## Commands available
36
39
 
@@ -44,10 +47,16 @@ CLI (via `npx --no @theglitchking/hit-em-with-the-docs <cmd>` or `hewtd <cmd>` i
44
47
  - `integrate <file>` — auto-classify and place a raw markdown file
45
48
  - `discover patterns|anti-patterns|standards|dependencies` — extract conventions from source code
46
49
  - `report health|audit|links` — generate detailed reports
47
- - `list` — list all 15 domains
50
+ - `list` — list the built-in domains
51
+ - `domain list|add|remove` — manage custom domains (2.6.0+); `add <id> -k <keywords>` registers + scaffolds a project-specific domain
52
+ - `archive <file>` — deprecate a doc into `archive/` (reversible, link-safe, reindexes) (2.7.0+)
53
+ - `unarchive <file>` — restore an archived doc to its domain folder (2.7.0+)
54
+ - `archive-candidates` — advisory list of docs worth retiring (2.7.0+)
48
55
  - `search <query>` — search documentation
49
56
 
50
57
  Slash commands (Claude Code):
58
+ - `/hit-em-with-the-docs:domain` — add/remove/list custom domains (2.6.0+)
59
+ - `/hit-em-with-the-docs:archive` — deprecate/restore docs, or list candidates (2.7.0+)
51
60
  - `/hit-em-with-the-docs:status` — installed version, update policy, hook state
52
61
  - `/hit-em-with-the-docs:policy [auto|nudge|off]` — get/set update policy
53
62
  - `/hit-em-with-the-docs:update` — pull the latest version
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Archival candidate DETECTION — advisory and read-only.
3
+ *
4
+ * Surfaces docs that *might* warrant archiving, scored on ranked signals.
5
+ * It never moves anything (the executor does that). Philosophy: a strong
6
+ * explicit signal (`status: deprecated`, `superseded_by`) qualifies on its
7
+ * own; age qualifies only in combination with orphaned (`require_orphaned`),
8
+ * because age alone conflates "unchanged" with "obsolete".
9
+ */
10
+ import type { ArchiveConfig } from '../../utils/config.js';
11
+ export interface ArchiveCandidate {
12
+ file: string;
13
+ score: number;
14
+ reasons: string[];
15
+ signals: {
16
+ deprecated: boolean;
17
+ superseded: boolean;
18
+ orphaned: boolean;
19
+ stale: boolean;
20
+ staleSignalDegraded: boolean;
21
+ };
22
+ }
23
+ /**
24
+ * Days since the file was last modified, via git (`%cs` = committer date).
25
+ * Returns null when not in a git repo or the file is untracked (no history).
26
+ */
27
+ export declare function gitLastTouchedDays(projectRoot: string, fileAbs: string, today: Date): number | null;
28
+ export interface FindCandidatesInput {
29
+ docsPath: string;
30
+ projectRoot: string;
31
+ config: ArchiveConfig;
32
+ /** Override "today" for deterministic tests. */
33
+ today?: Date;
34
+ }
35
+ export declare function findArchiveCandidates(input: FindCandidatesInput): Promise<ArchiveCandidate[]>;
36
+ /** Convenience: resolve absolute docs path for a candidate (test/CLI helper). */
37
+ export declare function candidateAbsPath(docsPath: string, candidate: ArchiveCandidate): string;
38
+ //# sourceMappingURL=candidates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"candidates.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/archive/candidates.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE;QACP,UAAU,EAAE,OAAO,CAAC;QACpB,UAAU,EAAE,OAAO,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;QAClB,KAAK,EAAE,OAAO,CAAC;QACf,mBAAmB,EAAE,OAAO,CAAC;KAC9B,CAAC;CACH;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,IAAI,GACV,MAAM,GAAG,IAAI,CAgBf;AAUD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,gDAAgD;IAChD,KAAK,CAAC,EAAE,IAAI,CAAC;CACd;AAED,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA4E7B;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,GAAG,MAAM,CAEtF"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Inbound-link detection for the archival process.
3
+ *
4
+ * Archiving a doc that active docs still link to would turn live references
5
+ * into dead ones — exactly the failure archival must prevent. This reuses the
6
+ * existing link graph (which already excludes `archive/`, since it scans via
7
+ * `findMarkdownFiles`) to find every active doc that links to a target.
8
+ */
9
+ export interface InboundLink {
10
+ /** docs-relative path of the doc that links to the target. */
11
+ source: string;
12
+ lineNumber: number;
13
+ linkText: string;
14
+ }
15
+ /**
16
+ * Find all active (non-archived) docs that link to `targetRelPath`
17
+ * (a path relative to `docsPath`). Returns one entry per inbound link.
18
+ */
19
+ export declare function findInboundLinks(docsPath: string, targetRelPath: string): Promise<InboundLink[]>;
20
+ /** Normalize an absolute-or-relative file arg to a docs-relative POSIX path. */
21
+ export declare function toDocsRelative(docsPath: string, file: string): string;
22
+ //# sourceMappingURL=links.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/archive/links.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,MAAM,WAAW,WAAW;IAC1B,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,WAAW,EAAE,CAAC,CAUxB;AAED,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKrE"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Archival executor: the deterministic WRITER behind `hewtd archive` /
3
+ * `hewtd unarchive`.
4
+ *
5
+ * Moves a doc into `archive/<domain-subpath>/…` (and back), preserving git
6
+ * history via `git mv` where possible, stamping reversible lifecycle metadata,
7
+ * and regenerating indexes so the doc cleanly leaves (or rejoins) the active
8
+ * corpus. Non-destructive and reversible by design: `archived_from` records the
9
+ * exact restore path.
10
+ */
11
+ import { type InboundLink } from './links.js';
12
+ export interface ArchiveDocInput {
13
+ projectRoot: string;
14
+ docsPath: string;
15
+ /** Doc to archive — docs-relative (e.g. `api/old.md`) or absolute. */
16
+ file: string;
17
+ reason?: string;
18
+ force?: boolean;
19
+ dryRun?: boolean;
20
+ /** Override "today" (YYYY-MM-DD) for deterministic tests. */
21
+ today?: string;
22
+ }
23
+ export interface ArchiveDocResult {
24
+ ok: boolean;
25
+ errors: string[];
26
+ action: 'archived' | 'dry_run' | 'blocked' | 'rejected';
27
+ from?: string;
28
+ to?: string;
29
+ moveMethod?: 'git' | 'fs';
30
+ /** Active docs that link to the target (the link guard). */
31
+ inboundLinks: InboundLink[];
32
+ }
33
+ export declare function archiveDoc(input: ArchiveDocInput): Promise<ArchiveDocResult>;
34
+ export interface UnarchiveDocInput {
35
+ projectRoot: string;
36
+ docsPath: string;
37
+ /** Archived doc — docs-relative (e.g. `archive/api/old.md`) or absolute. */
38
+ file: string;
39
+ dryRun?: boolean;
40
+ }
41
+ export interface UnarchiveDocResult {
42
+ ok: boolean;
43
+ errors: string[];
44
+ action: 'unarchived' | 'dry_run' | 'rejected';
45
+ from?: string;
46
+ to?: string;
47
+ moveMethod?: 'git' | 'fs';
48
+ }
49
+ export declare function unarchiveDoc(input: UnarchiveDocInput): Promise<UnarchiveDocResult>;
50
+ //# sourceMappingURL=manage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manage.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/archive/manage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,OAAO,EAAoC,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAsDhF,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAC1B,4DAA4D;IAC5D,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B;AAED,wBAAsB,UAAU,CAC9B,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,gBAAgB,CAAC,CAgE3B;AAMD,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,YAAY,GAAG,SAAS,GAAG,UAAU,CAAC;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CAC3B;AAED,wBAAsB,YAAY,CAChC,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,kBAAkB,CAAC,CAsD7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"auditor.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/audit/auditor.ts"],"names":[],"mappings":"AAYA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAM5E,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAqJpF;AA0ND;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,CAAC,CAQ3B"}
1
+ {"version":3,"file":"auditor.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/audit/auditor.ts"],"names":[],"mappings":"AAYA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAM5E,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAqJpF;AAyOD;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,CAAC,CAQ3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/audit/rules.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACvC,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,eAAe,CAAC;CAChE;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CA+CvE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,cAAc,CAAC,EAAE,MAAM,GACtB,eAAe,CAkDjB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,MAAM,GACZ,eAAe,CA+BjB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,GACZ,eAAe,CAuCjB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,eAAe,CAqCjB;AASD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,EAelC,CAAC"}
1
+ {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/audit/rules.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACvC,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,eAAe,CAAC;CAChE;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CA+CvE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,cAAc,CAAC,EAAE,MAAM,GACtB,eAAe,CAkDjB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,MAAM,GACZ,eAAe,CA+BjB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,GACZ,eAAe,CAuCjB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,eAAe,CAqCjB;AASD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,EAelC,CAAC"}
@@ -3,38 +3,43 @@
3
3
  * The system organizes documentation into 15 specialized domains.
4
4
  */
5
5
  export declare const DOMAINS: readonly ["agents", "api", "architecture", "backups", "database", "devops", "features", "plans", "procedures", "quickstart", "security", "standards", "testing", "troubleshooting", "workflows"];
6
- export type Domain = (typeof DOMAINS)[number];
6
+ /**
7
+ * The 15 compiled-in domains. These are guaranteed present in every project.
8
+ */
9
+ export type BuiltinDomain = (typeof DOMAINS)[number];
10
+ /**
11
+ * A domain id. Widened from the built-in union to also accept arbitrary
12
+ * (config-supplied) custom domain ids, while preserving autocomplete and
13
+ * compile-time safety for references to the built-ins (e.g. `'security'`).
14
+ *
15
+ * The active set at runtime — built-ins plus any custom domains from
16
+ * `.claude/hit-em-with-the-docs.json` — is resolved by the registry
17
+ * (`./registry.ts`). Use the registry's accessors (`getAllDomains`,
18
+ * `isValidDomain`, `getDomainDefinition`, …) for the live set; the `DOMAINS`
19
+ * and `DOMAIN_DEFINITIONS` exports below are the BUILT-INS ONLY.
20
+ */
21
+ export type Domain = BuiltinDomain | (string & {});
22
+ export type DomainCategory = 'core' | 'development' | 'features' | 'advanced';
7
23
  export interface DomainDefinition {
8
24
  id: Domain;
9
25
  name: string;
10
26
  description: string;
11
27
  keywords: string[];
12
28
  loadPriority: number;
13
- category: 'core' | 'development' | 'features' | 'advanced';
29
+ category: DomainCategory;
14
30
  }
15
- export declare const DOMAIN_DEFINITIONS: Record<Domain, DomainDefinition>;
16
- /**
17
- * Get domain definition by ID
18
- */
19
- export declare function getDomainDefinition(domain: Domain): DomainDefinition;
20
- /**
21
- * Get all domain IDs
22
- */
23
- export declare function getAllDomains(): readonly Domain[];
24
- /**
25
- * Get domains by category
26
- */
27
- export declare function getDomainsByCategory(category: DomainDefinition['category']): Domain[];
28
- /**
29
- * Get domains sorted by load priority (highest first)
30
- */
31
- export declare function getDomainsByPriority(): Domain[];
32
31
  /**
33
- * Check if a string is a valid domain
32
+ * Built-in domain definitions ONLY. The runtime-active set (built-ins +
33
+ * custom) lives in the registry — do not iterate this directly in feature
34
+ * code; call `getAllDomains()` / `getDomainDefinition()` from `./registry.ts`.
34
35
  */
35
- export declare function isValidDomain(value: string): value is Domain;
36
+ export declare const DOMAIN_DEFINITIONS: Record<BuiltinDomain, DomainDefinition>;
36
37
  /**
37
- * Get all keywords across all domains
38
+ * Check whether a string is one of the 15 BUILT-IN domains. This is a pure,
39
+ * registry-independent check used where built-in-ness specifically matters
40
+ * (e.g. `hewtd domain remove` refusing to remove a built-in). For "is this a
41
+ * valid domain in the active set (built-in OR custom)", use `isValidDomain()`
42
+ * from `./registry.ts`.
38
43
  */
39
- export declare function getAllKeywords(): Map<string, Domain[]>;
44
+ export declare function isBuiltinDomain(value: string): value is BuiltinDomain;
40
45
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/domains/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,OAAO,kMAgBV,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9C,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,UAAU,CAAC;CAC5D;AAED,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAwL/D,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAEpE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,SAAS,MAAM,EAAE,CAEjD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,GACrC,MAAM,EAAE,CAEV;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAI/C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,MAAM,CAE5D;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAatD"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/domains/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,OAAO,kMAgBV,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,MAAM,GAAG,aAAa,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEnD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9E,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAwLtE,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa,CAErE"}
@@ -1,4 +1,4 @@
1
- import { Domain } from './constants.js';
1
+ import { type Domain } from './constants.js';
2
2
  export interface DomainDetectionResult {
3
3
  domain: Domain | null;
4
4
  confidence: number;
@@ -1 +1 @@
1
- {"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/domains/detector.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EAKP,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IACjD,kBAAkB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC9D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAyB,GAClC,qBAAqB,CA8BvB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAyB,GAClC,qBAAqB,CA8CvB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAyD9E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAyBhE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAyB,GAClC;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAWtF"}
1
+ {"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["file:///home/tmarlette/workspace/the-glitch-kingdom/hit-em-with-the-docs/src/core/domains/detector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAQ7C,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IACjD,kBAAkB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC9D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAyB,GAClC,qBAAqB,CA8BvB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAyB,GAClC,qBAAqB,CA8CvB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAyD9E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAyBhE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAyB,GAClC;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAWtF"}