@theglitchking/hit-em-with-the-docs 2.7.1 → 2.8.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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +17 -0
- package/dist/action/core/enforce/guard.d.ts +54 -0
- package/dist/action/core/enforce/guard.d.ts.map +1 -0
- package/dist/action/index.d.ts +1 -0
- package/dist/action/index.d.ts.map +1 -1
- package/dist/action/index.js +1 -1
- package/dist/action/utils/config.d.ts +58 -11
- package/dist/action/utils/config.d.ts.map +1 -1
- package/dist/action/utils/glob.d.ts +15 -4
- package/dist/action/utils/glob.d.ts.map +1 -1
- package/dist/core/enforce/guard.d.ts +54 -0
- package/dist/core/enforce/guard.d.ts.map +1 -0
- package/dist/core/enforce/guard.js +201 -0
- package/dist/core/enforce/guard.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/config.d.ts +47 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +13 -0
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/glob.d.ts +15 -4
- package/dist/utils/glob.d.ts.map +1 -1
- package/dist/utils/glob.js +16 -4
- package/dist/utils/glob.js.map +1 -1
- package/hooks/hooks.json +16 -1
- package/hooks/pre-tool-use.js +98 -0
- package/hooks/session-brief.js +51 -0
- package/package.json +2 -1
- package/scripts/link-skills.js +5 -4
- package/skills/documentation-lifecycle/SKILL.md +130 -0
- package/templates/claude/CLAUDE.md +0 -208
package/dist/utils/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,KAAK,EA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-9,10 +9,21 @@ export interface GlobOptions {
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function glob(pattern: string, options?: GlobOptions): Promise<string[]>;
|
|
11
11
|
/**
|
|
12
|
-
* Reserved documentation subdirectory for DEPRECATED docs.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* Reserved documentation subdirectory for DEPRECATED docs.
|
|
13
|
+
*
|
|
14
|
+
* **Archived content is referenceable, never concrete.** A link *into* the
|
|
15
|
+
* archive still resolves — link-check validates targets by file existence, so
|
|
16
|
+
* history stays reachable. But nothing under an `archive/` folder is part of
|
|
17
|
+
* the active corpus: it is not indexed, not audited, not metadata-validated,
|
|
18
|
+
* not dup-checked, and never counted. It is what the docs *used* to say, and it
|
|
19
|
+
* is never evidence of what is true now.
|
|
20
|
+
*
|
|
21
|
+
* The exclusion applies at **any depth** — `<docs>/archive/` and
|
|
22
|
+
* `<docs>/features/archive/` alike. Before 2.8.0 the ignore glob was anchored
|
|
23
|
+
* at the docs root, so a nested `archive/` was still scanned and validated
|
|
24
|
+
* (while 2.7.1's indexer correctly skipped it) — archived docs could raise
|
|
25
|
+
* audit errors and stale-metadata warnings for content nobody was supposed to
|
|
26
|
+
* be reading.
|
|
16
27
|
*/
|
|
17
28
|
export declare const ARCHIVE_DIR = "archive";
|
|
18
29
|
/**
|
package/dist/utils/glob.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/utils/glob.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;GAEG;AACH,wBAAsB,IAAI,CACxB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,WAAgB,GACxB,OAA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e,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
package/dist/utils/glob.js
CHANGED
|
@@ -17,10 +17,21 @@ export async function glob(pattern, options = {}) {
|
|
|
17
17
|
return matches;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Reserved documentation subdirectory for DEPRECATED docs.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
20
|
+
* Reserved documentation subdirectory for DEPRECATED docs.
|
|
21
|
+
*
|
|
22
|
+
* **Archived content is referenceable, never concrete.** A link *into* the
|
|
23
|
+
* archive still resolves — link-check validates targets by file existence, so
|
|
24
|
+
* history stays reachable. But nothing under an `archive/` folder is part of
|
|
25
|
+
* the active corpus: it is not indexed, not audited, not metadata-validated,
|
|
26
|
+
* not dup-checked, and never counted. It is what the docs *used* to say, and it
|
|
27
|
+
* is never evidence of what is true now.
|
|
28
|
+
*
|
|
29
|
+
* The exclusion applies at **any depth** — `<docs>/archive/` and
|
|
30
|
+
* `<docs>/features/archive/` alike. Before 2.8.0 the ignore glob was anchored
|
|
31
|
+
* at the docs root, so a nested `archive/` was still scanned and validated
|
|
32
|
+
* (while 2.7.1's indexer correctly skipped it) — archived docs could raise
|
|
33
|
+
* audit errors and stale-metadata warnings for content nobody was supposed to
|
|
34
|
+
* be reading.
|
|
24
35
|
*/
|
|
25
36
|
export const ARCHIVE_DIR = 'archive';
|
|
26
37
|
/** Glob ignores always applied to documentation scans. */
|
|
@@ -29,6 +40,7 @@ const DOC_SCAN_IGNORE = [
|
|
|
29
40
|
'dist/**',
|
|
30
41
|
'.git/**',
|
|
31
42
|
`${ARCHIVE_DIR}/**`,
|
|
43
|
+
`**/${ARCHIVE_DIR}/**`,
|
|
32
44
|
];
|
|
33
45
|
/**
|
|
34
46
|
* Find all markdown files in a directory.
|
package/dist/utils/glob.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/utils/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAShC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,OAAe,EACf,UAAuB,EAAE;IAEzB,MAAM,EACJ,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EACnB,QAAQ,GAAG,KAAK,EAChB,MAAM,GAAG,CAAC,iBAAiB,EAAE,SAAS,EAAE,SAAS,CAAC,EAClD,GAAG,GAAG,KAAK,GACZ,GAAG,OAAO,CAAC;IAEZ,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE;QACrC,GAAG;QACH,QAAQ;QACR,MAAM;QACN,GAAG;QACH,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/utils/glob.ts"],"names":[],"mappings":"AAAA,OAAO,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EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,YAAoB;IAC5D,OAAO,OAAO,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,MAAc;IAC1D,OAAO,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC"}
|
package/hooks/hooks.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"description": "hit-em-with-the-docs SessionStart
|
|
2
|
+
"description": "hit-em-with-the-docs hooks — SessionStart (update check + lifecycle brief) and PreToolUse (lifecycle enforcement).",
|
|
3
3
|
"hooks": {
|
|
4
4
|
"SessionStart": [
|
|
5
5
|
{
|
|
@@ -7,6 +7,21 @@
|
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
9
9
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.js\""
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "command",
|
|
13
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session-brief.js\""
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"PreToolUse": [
|
|
19
|
+
{
|
|
20
|
+
"matcher": "Write|Edit|Bash",
|
|
21
|
+
"hooks": [
|
|
22
|
+
{
|
|
23
|
+
"type": "command",
|
|
24
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool-use.js\""
|
|
10
25
|
}
|
|
11
26
|
]
|
|
12
27
|
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// hit-em-with-the-docs PreToolUse hook — lifecycle enforcement.
|
|
3
|
+
//
|
|
4
|
+
// Denies the two irreversible policy violations (hand-editing a generated
|
|
5
|
+
// INDEX.md/REGISTRY.md, deleting a doc) and warns on the off-policy ones.
|
|
6
|
+
//
|
|
7
|
+
// This runs in EVERY session the plugin is installed in, including repos that
|
|
8
|
+
// have nothing to do with hewtd. Two invariants follow, and they matter more
|
|
9
|
+
// than any rule this file enforces:
|
|
10
|
+
//
|
|
11
|
+
// 1. No `.documentation/` tree (or whatever `docsDir` resolves to) → allow,
|
|
12
|
+
// immediately and silently.
|
|
13
|
+
// 2. ANY error → allow. A guard that blocks a user's unrelated work because
|
|
14
|
+
// it threw is far worse than no guard at all. Every path fails open.
|
|
15
|
+
|
|
16
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
17
|
+
import { join, resolve } from 'node:path';
|
|
18
|
+
|
|
19
|
+
/** Allow the call and exit. Never throws, never blocks. */
|
|
20
|
+
function allow() {
|
|
21
|
+
process.exit(0);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function respond(payload) {
|
|
25
|
+
process.stdout.write(
|
|
26
|
+
JSON.stringify({
|
|
27
|
+
hookSpecificOutput: { hookEventName: 'PreToolUse', ...payload },
|
|
28
|
+
})
|
|
29
|
+
);
|
|
30
|
+
process.exit(0);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function readStdin() {
|
|
34
|
+
const chunks = [];
|
|
35
|
+
for await (const chunk of process.stdin) chunks.push(chunk);
|
|
36
|
+
return Buffer.concat(chunks).toString('utf-8');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Resolve the docs root and the enforcement policy for this project.
|
|
41
|
+
* `.claude/hit-em-with-the-docs.json` may carry an `enforcement` block; a
|
|
42
|
+
* missing or malformed config just means defaults.
|
|
43
|
+
*/
|
|
44
|
+
function loadProject(cwd) {
|
|
45
|
+
let policy = { blockIndexEdits: true, blockDocDeletion: true };
|
|
46
|
+
try {
|
|
47
|
+
const raw = readFileSync(join(cwd, '.claude', 'hit-em-with-the-docs.json'), 'utf-8');
|
|
48
|
+
const cfg = JSON.parse(raw);
|
|
49
|
+
const e = cfg?.enforcement;
|
|
50
|
+
if (e && typeof e === 'object') {
|
|
51
|
+
if (e.block_index_edits === false) policy.blockIndexEdits = false;
|
|
52
|
+
if (e.block_doc_deletion === false) policy.blockDocDeletion = false;
|
|
53
|
+
}
|
|
54
|
+
} catch {
|
|
55
|
+
// No config, or unreadable — defaults apply.
|
|
56
|
+
}
|
|
57
|
+
return { docsDir: '.documentation', policy };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function main() {
|
|
61
|
+
const input = await readStdin();
|
|
62
|
+
if (!input.trim()) allow();
|
|
63
|
+
|
|
64
|
+
const payload = JSON.parse(input);
|
|
65
|
+
const cwd = payload.cwd || process.cwd();
|
|
66
|
+
|
|
67
|
+
// Invariant 1: not a hewtd project → this hook has no opinion.
|
|
68
|
+
if (!existsSync(resolve(cwd, '.documentation'))) allow();
|
|
69
|
+
|
|
70
|
+
const { docsDir, policy } = loadProject(cwd);
|
|
71
|
+
|
|
72
|
+
// The decision function ships compiled in dist/, so the hook stays a thin
|
|
73
|
+
// I/O shell and the rules themselves are unit-testable.
|
|
74
|
+
const { evaluate } = await import('../dist/core/enforce/guard.js');
|
|
75
|
+
|
|
76
|
+
const toolInput = payload.tool_input ?? {};
|
|
77
|
+
const decision = evaluate(
|
|
78
|
+
{
|
|
79
|
+
toolName: payload.tool_name,
|
|
80
|
+
filePath: toolInput.file_path,
|
|
81
|
+
command: toolInput.command,
|
|
82
|
+
text: toolInput.content ?? toolInput.new_string,
|
|
83
|
+
docsDir,
|
|
84
|
+
},
|
|
85
|
+
policy
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
if (decision.action === 'deny') {
|
|
89
|
+
respond({ permissionDecision: 'deny', permissionDecisionReason: decision.reason });
|
|
90
|
+
}
|
|
91
|
+
if (decision.action === 'warn') {
|
|
92
|
+
respond({ permissionDecision: 'allow', additionalContext: decision.context });
|
|
93
|
+
}
|
|
94
|
+
allow();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Invariant 2: fail open, unconditionally.
|
|
98
|
+
main().catch(() => allow());
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// hit-em-with-the-docs SessionStart hook — the lifecycle brief.
|
|
3
|
+
//
|
|
4
|
+
// A separate hook from session-start.js on purpose: the plugin runtime owns
|
|
5
|
+
// stdout for that one (it always emits exactly one SessionStart response for
|
|
6
|
+
// the update check, and offers no way to append to it). Claude Code runs every
|
|
7
|
+
// registered SessionStart hook and merges their context, so this stays
|
|
8
|
+
// decoupled from the runtime instead of monkey-patching it.
|
|
9
|
+
//
|
|
10
|
+
// Emits nothing at all outside a hewtd-managed project.
|
|
11
|
+
//
|
|
12
|
+
// This exists because the policy used to live only in the README and in an
|
|
13
|
+
// orphaned template that was never installed: an agent that had never heard of
|
|
14
|
+
// hewtd would `rm` a stale doc, hand-edit a generated INDEX.md, or invent its
|
|
15
|
+
// own `docs/` folder. The PreToolUse guard now denies the destructive half of
|
|
16
|
+
// that; this is what stops the agent walking into the guard in the first place.
|
|
17
|
+
|
|
18
|
+
import { existsSync } from 'node:fs';
|
|
19
|
+
import { resolve } from 'node:path';
|
|
20
|
+
|
|
21
|
+
const projectRoot = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
22
|
+
|
|
23
|
+
// Not a hewtd project → say nothing. This hook runs in every session the
|
|
24
|
+
// plugin is installed in, most of which have no documentation tree.
|
|
25
|
+
if (!existsSync(resolve(projectRoot, '.documentation'))) {
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Stated as facts, not instructions. Imperative text injected into context can
|
|
30
|
+
// trip Claude's prompt-injection defenses; a description of how the repo works
|
|
31
|
+
// does not.
|
|
32
|
+
const BRIEF = `This project's documentation is managed by hit-em-with-the-docs (hewtd), under \`.documentation/\`, organized into domains (security, api, database, …).
|
|
33
|
+
|
|
34
|
+
How the tree works:
|
|
35
|
+
- \`INDEX.md\` and \`REGISTRY.md\` are **generated artifacts**, rebuilt from the documents on disk. Hand-edits to them are overwritten by the next \`hewtd index\`. To change what an index lists, change the documents.
|
|
36
|
+
- New docs are registered with \`hewtd integrate <file>\`, which classifies them into a domain and adds the frontmatter. Markdown created outside \`.documentation/\` is not indexed, link-checked, or validated.
|
|
37
|
+
- Docs are **never deleted**. \`hewtd archive <file>\` retires one: it moves the file under \`archive/\` (keeping git history), stamps \`archived_from\` so \`hewtd unarchive\` restores it exactly, and refuses if active docs still link to it. hewtd's own source contains no delete calls anywhere.
|
|
38
|
+
- \`status: deprecated\` flags intent but leaves a doc live and indexed; \`hewtd archive\` is the step that actually retires it.
|
|
39
|
+
- **Anything under an \`archive/\` folder is historical, at any depth.** It is excluded from every scan — not indexed, not audited, not link-checked, not validated. It can be *referenced* (links into it still resolve), but it is **never evidence of current behavior**: it is what the docs used to say. Do not cite it as how the system works today, and do not edit it. \`hewtd unarchive <file>\` restores it to active first.
|
|
40
|
+
- \`hewtd maintain\` regenerates indexes, syncs metadata, and checks links. \`hewtd audit\` reports drift and policy violations.
|
|
41
|
+
|
|
42
|
+
A PreToolUse hook enforces the two destructive cases: editing a generated index, and deleting a doc under \`.documentation/\`. Both are denied. Run \`/hit-em-with-the-docs:help\` for the full command surface.`;
|
|
43
|
+
|
|
44
|
+
process.stdout.write(
|
|
45
|
+
JSON.stringify({
|
|
46
|
+
hookSpecificOutput: {
|
|
47
|
+
hookEventName: 'SessionStart',
|
|
48
|
+
additionalContext: BRIEF,
|
|
49
|
+
},
|
|
50
|
+
}) + '\n'
|
|
51
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theglitchking/hit-em-with-the-docs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Self-managing documentation system with hierarchical structure, intelligent automation, pattern discovery, and agent orchestration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cli/index.js",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"dist",
|
|
25
25
|
"templates",
|
|
26
26
|
".claude-plugin",
|
|
27
|
+
"skills",
|
|
27
28
|
"commands",
|
|
28
29
|
"hooks",
|
|
29
30
|
"scripts/link-skills.js",
|
package/scripts/link-skills.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Postinstall — delegates to @theglitchking/claude-plugin-runtime.
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// Links the bundled skill (skills/documentation-lifecycle) into
|
|
4
|
+
// .claude/skills/ for npm installs; plugin installs get it automatically via
|
|
5
|
+
// the plugin's skills/ dir. The runtime also writes the default update-policy
|
|
6
|
+
// config and registers the SessionStart hook in .claude/settings.json (with
|
|
6
7
|
// plugin-vs-npm dedup).
|
|
7
8
|
|
|
8
9
|
import { runPostinstall } from "@theglitchking/claude-plugin-runtime";
|
|
@@ -16,7 +17,7 @@ try {
|
|
|
16
17
|
packageName: "@theglitchking/hit-em-with-the-docs",
|
|
17
18
|
pluginName: "hit-em-with-the-docs",
|
|
18
19
|
configFile: "hit-em-with-the-docs.json",
|
|
19
|
-
skillsDir:
|
|
20
|
+
skillsDir: "skills",
|
|
20
21
|
packageRoot,
|
|
21
22
|
hookCommand:
|
|
22
23
|
"node ./node_modules/@theglitchking/hit-em-with-the-docs/hooks/session-start.js",
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: documentation-lifecycle
|
|
3
|
+
description: Create, update, retire, or reorganize documentation in a project managed by hit-em-with-the-docs (a `.documentation/` tree with domain folders). Use when writing a new doc, updating an existing one, deleting/deprecating/archiving a doc, fixing a broken docs link, wondering where a doc belongs, or when an INDEX.md/REGISTRY.md looks out of date. Also use when a tool call was denied by the hewtd lifecycle guard.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Documentation lifecycle (hit-em-with-the-docs)
|
|
7
|
+
|
|
8
|
+
This project's docs live in `.documentation/`, split into domain folders. hewtd
|
|
9
|
+
owns that tree: it classifies documents, maintains their frontmatter, generates
|
|
10
|
+
the indexes, checks the links, and retires docs without destroying them.
|
|
11
|
+
|
|
12
|
+
**The one thing to internalize:** `INDEX.md` and `REGISTRY.md` are *generated*.
|
|
13
|
+
They are rebuilt from the documents on disk on every `hewtd index` / `hewtd
|
|
14
|
+
maintain`. Editing them by hand accomplishes nothing — your rows are overwritten
|
|
15
|
+
on the next run. To change what an index says, change the documents, then
|
|
16
|
+
regenerate.
|
|
17
|
+
|
|
18
|
+
Run every command with `npx hit-em-with-the-docs …` (or `hewtd …`).
|
|
19
|
+
|
|
20
|
+
## Creating a doc
|
|
21
|
+
|
|
22
|
+
Write the markdown wherever is convenient, then:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
hewtd integrate path/to/new-doc.md # classifies + moves + registers it
|
|
26
|
+
hewtd integrate path/to/new-doc.md --dry-run # preview the chosen domain first
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`integrate` picks the domain by keyword-matching the content, moves the file
|
|
30
|
+
into `.documentation/<domain>/`, stamps frontmatter (`status: draft`, `tier:
|
|
31
|
+
guide`, `version: 1.0.0`, `last_updated`, `word_count`), and regenerates the
|
|
32
|
+
indexes. It never overwrites frontmatter you wrote yourself — it only fills what
|
|
33
|
+
is missing.
|
|
34
|
+
|
|
35
|
+
A markdown file left outside `.documentation/` is invisible to hewtd: not
|
|
36
|
+
indexed, not link-checked, not validated. Don't hand-create `docs/` folders.
|
|
37
|
+
|
|
38
|
+
## Updating a doc
|
|
39
|
+
|
|
40
|
+
Edit the document normally, then:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
hewtd maintain --quick # regenerate indexes + sync metadata
|
|
44
|
+
hewtd maintain --fix # also auto-fix what it can
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Never hand-edit `INDEX.md` or `REGISTRY.md` — a `PreToolUse` guard denies it.
|
|
48
|
+
|
|
49
|
+
## Retiring a doc
|
|
50
|
+
|
|
51
|
+
**Documents are never deleted.** hewtd's own source contains no `rm`/`unlink`
|
|
52
|
+
calls anywhere, and the guard denies shell deletion of anything under
|
|
53
|
+
`.documentation/`.
|
|
54
|
+
|
|
55
|
+
Two distinct steps, often confused:
|
|
56
|
+
|
|
57
|
+
| | What it does |
|
|
58
|
+
|---|---|
|
|
59
|
+
| `status: deprecated` | Flags *intent*. The doc stays in its domain folder, still indexed, still scanned. `audit` raises an INFO nudge toward archiving. |
|
|
60
|
+
| `hewtd archive <file>` | Actually retires it. |
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
hewtd archive .documentation/api/old-guide.md --dry-run
|
|
64
|
+
hewtd archive .documentation/api/old-guide.md -r "superseded by v2 guide"
|
|
65
|
+
hewtd unarchive .documentation/archive/api/old-guide.md # lossless restore
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`archive` moves the doc to `archive/<same-subpath>/` (preferring `git mv` to keep
|
|
69
|
+
history), stamps `status: archived`, `archived_on`, `archived_from`, and
|
|
70
|
+
`archived_reason`, and reindexes so it drops out of its domain INDEX. The
|
|
71
|
+
`archived_from` stamp is what makes `unarchive` exact — **a hand-rolled `mv`
|
|
72
|
+
loses it**, and there is then nothing to restore from.
|
|
73
|
+
|
|
74
|
+
**Link guard:** `archive` refuses if active docs still link to the target,
|
|
75
|
+
listing each offender so you can fix them first. `--force` overrides, and the
|
|
76
|
+
inbound links go dangling.
|
|
77
|
+
|
|
78
|
+
`hewtd archive-candidates` lists docs that may warrant retiring — advisory and
|
|
79
|
+
read-only, it never moves anything. Nothing is ever auto-archived.
|
|
80
|
+
|
|
81
|
+
Point a replacement at the old doc with `superseded_by: <path>` in frontmatter.
|
|
82
|
+
|
|
83
|
+
## Archived content: referenceable, never concrete
|
|
84
|
+
|
|
85
|
+
**Anything under an `archive/` folder — at any depth — is history, not truth.**
|
|
86
|
+
|
|
87
|
+
It is excluded from every hewtd scan: not indexed, not audited, not
|
|
88
|
+
link-checked, not metadata-validated, never counted. Links *into* it still
|
|
89
|
+
resolve, so history stays reachable and you may cite it as "what we used to do."
|
|
90
|
+
|
|
91
|
+
What it is **not** is evidence of how the system works now. Never quote an
|
|
92
|
+
archived doc as current behavior, never carry its claims into a new doc, and
|
|
93
|
+
never treat a `status:`/`version:` inside it as live. If it turns out an archived
|
|
94
|
+
doc is still correct and still needed, it should be restored, not read in place:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
hewtd unarchive .documentation/archive/api/old-guide.md
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Editing a file under `archive/` is not destructive, but it is almost always a
|
|
101
|
+
mistake — the edit lands in a subtree nothing reads, so it changes nothing anyone
|
|
102
|
+
will see. The guard warns when you try.
|
|
103
|
+
|
|
104
|
+
## Checking the tree
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
hewtd audit # policy + drift violations, health score
|
|
108
|
+
hewtd link-check # broken internal links
|
|
109
|
+
hewtd index --dry-run # what the indexes would become
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
`audit`'s `index-drift` rule reports any document on disk that its domain's
|
|
113
|
+
`INDEX.md` fails to list — the fix is always `hewtd index`.
|
|
114
|
+
|
|
115
|
+
## If the guard denied your tool call
|
|
116
|
+
|
|
117
|
+
It denies exactly two things, both destructive:
|
|
118
|
+
|
|
119
|
+
- **Editing a generated `INDEX.md`/`REGISTRY.md`** → change the documents and run
|
|
120
|
+
`hewtd index`.
|
|
121
|
+
- **Deleting a doc under `.documentation/`** → use `hewtd archive` instead.
|
|
122
|
+
|
|
123
|
+
Both rules are opt-out via `.claude/hit-em-with-the-docs.json`:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{ "enforcement": { "block_index_edits": true, "block_doc_deletion": true } }
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Turning one off is a deliberate choice by the human who owns the repo — not
|
|
130
|
+
something to do to get past a denial.
|