@dotdotgod/claude-code 0.2.27 → 0.3.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/README.md CHANGED
@@ -4,11 +4,19 @@
4
4
 
5
5
  Claude Code adapter for dotdotgod's docs-first project-memory workflow.
6
6
 
7
- Use this package when you want Claude Code to initialize shared project docs, load bounded repository context, plan from durable docs before implementation, and review changed files with graph-impact evidence before handoff.
7
+ Use this package when you want Claude Code to work from a shared project brain: maintained agent rules and docs, durable plans, focused context loading, and changed-file evidence before handoff.
8
+
9
+ ## What Changes
10
+
11
+ - **Claude starts from shared project knowledge.** `AGENTS.md` and the documentation map remain reusable across agents while Claude-specific commands provide a native entry point.
12
+ - **Plans become durable project artifacts.** `/dd:plan` records task intent under `docs/plan/` so it survives compaction, handoff, and new sessions.
13
+ - **Project evidence arrives when needed.** `/dd:load` and the local MCP runtime provide bounded documentation, command output, files, and fetched text.
14
+ - **Changed files retain their review context.** Packaged hooks track successful edits and require matching graph impact before broad verification or handoff commands.
15
+ - **The workflow stays inspectable.** A denied operation names the required MCP action, and Claude retries the original operation after the check succeeds.
8
16
 
9
17
  ## Start Here
10
18
 
11
- This package is a Claude Code plugin: a plugin manifest plus `/dd:*` commands and skills. Installing it from npm alone does not register the commands — Claude Code loads it through plugin registration or a local plugin directory.
19
+ This package is a Claude Code plugin containing a manifest, `/dd:*` commands, skills, MCP integration, and hooks. Claude Code registers these resources when it loads the package through plugin registration or a local plugin directory.
12
20
 
13
21
  Register the dotdotgod plugin marketplace inside Claude Code, then install the plugin:
14
22
 
@@ -70,7 +78,7 @@ The plugin starts a local stdio MCP server. It exposes `execute`, `batch_execute
70
78
 
71
79
  Dotdotgod execution tools share a 10 MiB stdout/stderr capture ceiling per command. Crossing that ceiling terminates the child process and reports `captureLimitExceeded`; direct stdout and stderr excerpts are each capped at 1 MiB. Their child environments preserve compatibility-oriented inheritance after filtering runtime injection variables; this reports filtered names without values but does not isolate ordinary inherited credentials. Large output is indexed before retrieval in the ignored project-local `.dotdotgod/context/context.sqlite` FTS5 store, and searches return bounded excerpts. The store uses WAL, a bounded busy timeout, and transactional source replacement, expiry, and purge. Structural Markdown/JSON chunks, bounded typo-tolerant trigram candidates, reciprocal-rank fusion, and title/path/proximity signals improve retrieval while provenance and `instructionAuthority: "none"` identify retrieved text as non-authoritative data.
72
80
 
73
- The MCP `index` tool accepts project-contained files or bounded directories with deterministic traversal, configurable resource limits, explicit extension/path exclusions, and symlinks skipped by default; it does not apply `.gitignore` semantics automatically. These capture and retrieval rules apply only when Claude calls the dotdotgod MCP tools. The plugin does not transparently intercept or rewrite Claude Code's built-in Bash tool. URL indexing performs application-level HTTP(S), DNS/address, connected-peer, redirect, and byte-limit validation. Accepted HTML is normalized as bounded untrusted text without browser rendering, JavaScript, subresource loading, or link following by default. The server bundles no browser renderer, so browser opt-in fails unless a host injects that capability. These controls are not a network sandbox or complete prompt-injection prevention. See the [`@dotdotgod/context` npm package](https://www.npmjs.com/package/@dotdotgod/context), its [GitHub README](https://github.com/dotdotgod/dotdotgod-kit/tree/main/packages/context), and the [maintained execution contract](https://github.com/dotdotgod/dotdotgod-kit/blob/main/docs/spec/CONTEXT_EXECUTION.md) for the complete runtime behavior.
81
+ The MCP `index` tool accepts project-contained files or bounded directories with deterministic traversal, configurable resource limits, explicit extension/path exclusions, and symlinks skipped by default. These capture and retrieval rules apply when Claude calls the dotdotgod MCP tools; Claude Code's built-in Bash tool keeps its native behavior. URL indexing performs application-level HTTP(S), DNS/address, connected-peer, redirect, and byte-limit validation. Accepted HTML is normalized as bounded untrusted text without browser rendering, JavaScript, subresource loading, or link following by default. The server bundles no browser renderer, so browser opt-in fails unless a host injects that capability. These controls are not a network sandbox or complete prompt-injection prevention. See the [`@dotdotgod/context` npm package](https://www.npmjs.com/package/@dotdotgod/context), its [GitHub README](https://github.com/dotdotgod/dotdotgod-kit/tree/main/packages/context), and the [maintained execution contract](https://github.com/dotdotgod/dotdotgod-kit/blob/main/docs/spec/CONTEXT_EXECUTION.md) for the complete runtime behavior.
74
82
 
75
83
  Bundled hooks mark project load as required at session start, record successful source/config edits, and deny broad verification or handoff commands until matching graph impact succeeds. Denial asks Claude to call the required MCP tool and retry; hooks do not silently change one tool type into another. See [`hooks/README.md`](https://github.com/dotdotgod/dotdotgod-kit/blob/main/packages/claude-code/hooks/README.md) for lifecycle and trust boundaries.
76
84
 
@@ -85,6 +93,6 @@ pnpm --filter @dotdotgod/claude-code run pack:dry-run
85
93
 
86
94
  See the [root README](https://github.com/dotdotgod/dotdotgod-kit#readme), [Context curation](https://github.com/dotdotgod/dotdotgod-kit/blob/main/docs/concept/CONTEXT_CURATION.md), [Context mechanics](https://github.com/dotdotgod/dotdotgod-kit/blob/main/docs/concept/CONTEXT_MECHANICS.md), [Memory area config](https://github.com/dotdotgod/dotdotgod-kit/blob/main/docs/spec/MEMORY_AREA_CONFIG.md), and [Traceability config](https://github.com/dotdotgod/dotdotgod-kit/blob/main/docs/spec/TRACEABILITY_CONFIG.md).
87
95
 
88
- ## Compared with Graphify-Style Memory
96
+ ## Workflow Model
89
97
 
90
- This adapter is guidance-oriented. It asks Claude Code to prefer a depth-bounded documentation map with optional focused local query, avoid broad archive scans, and follow README indexes before reading raw files. The strength is structured retrieval from maintained project docs, not a giant graph report.
98
+ The adapter connects Claude Code's commands, skills, MCP tools, and hooks to the same maintained project memory used by other agents. README indexes route focused reads, durable plans preserve intent, and graph impact supplies related evidence for review.
@@ -34,7 +34,7 @@ Create a non-destructive dotdotgod baseline with canonical agent instructions, t
34
34
  ## Workflow
35
35
 
36
36
  1. Preserve existing files and unrelated user work.
37
- 2. Run `dotdotgod init <project-root> --template <name>` when available; otherwise run `sh "${CLAUDE_PLUGIN_ROOT}/skills/project-initializer/scripts/init_project.sh" <project-root> --template <name>`. Existing files must be skipped, not replaced.
37
+ 2. Run `dotdotgod init <project-root> [--documentation-root PATH] --template <name>` when available; otherwise run `sh "${CLAUDE_PLUGIN_ROOT}/skills/project-initializer/scripts/init_project.sh" <project-root> --template <name>`. Existing files must be skipped, not replaced.
38
38
  3. The POSIX fallback supports bundled templates only. If a custom template was selected and the CLI is unavailable, stop and explain that custom templates require the CLI; do not silently substitute another template.
39
39
  4. Validate the initialized project with `dotdotgod validate <project-root>` when available.
40
40
  5. Report created and skipped files, the selected template, validation failures, and unresolved instruction conflicts.
package/hooks/README.md CHANGED
@@ -25,7 +25,7 @@ Claude Code currently does not document dedicated plan-mode transition hooks suc
25
25
 
26
26
  Hook handlers may be `command`, `http`, `mcp_tool`, `prompt`, or `agent`, with event-specific support limits. `SessionStart` and `Setup` support only `command` and `mcp_tool`. For project or plugin scripts, prefer command exec form with `args` so `${CLAUDE_PROJECT_DIR}`, `${CLAUDE_PLUGIN_ROOT}`, and `${CLAUDE_PLUGIN_DATA}` paths are passed without shell quoting. Hooks should not write directly to `/dev/tty`; use JSON `systemMessage` for user-visible messages or Claude Code's `terminalSequence` field for terminal notifications.
27
27
 
28
- Claude Code plugins can package hook config at `hooks/hooks.json` or through the plugin manifest. Dotdotgod intentionally does not ship a default hook config today: `/dd:impact` and the `impact-review` skill provide the Pi-like changed-file review path without adding automatic local command execution. If a future release adds packaged hooks, they should be advisory, fast, and clearly documented as opt-in or safe defaults.
28
+ Claude Code plugins can package hook config at `hooks/hooks.json` or through the plugin manifest. Dotdotgod ships `hooks/hooks.json` with bounded load-required and impact-pending routing. The hooks run local commands with user permissions, so users should review the packaged resources through Claude Code's plugin trust flow. `/dd:impact` and the `impact-review` skill remain explicit ways to request the same changed-file review workflow.
29
29
 
30
30
  ## SDLC Guardrail Framing
31
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotdotgod/claude-code",
3
- "version": "0.2.27",
3
+ "version": "0.3.0",
4
4
  "description": "Claude Code adapter for dotdotgod project memory workflows.",
5
5
  "type": "module",
6
6
  "license": "Elastic-2.0",
@@ -21,7 +21,7 @@
21
21
  "traceability"
22
22
  ],
23
23
  "dependencies": {
24
- "@dotdotgod/context": "0.2.27"
24
+ "@dotdotgod/context": "0.3.0"
25
25
  },
26
26
  "files": [
27
27
  ".claude-plugin",
@@ -30,7 +30,7 @@ Create a non-destructive dotdotgod baseline with canonical agent instructions, t
30
30
  ## Workflow
31
31
 
32
32
  1. Preserve existing files and unrelated user work.
33
- 2. Run `dotdotgod init <project-root> --template <name>` when available; otherwise run `sh "${CLAUDE_PLUGIN_ROOT}/skills/project-initializer/scripts/init_project.sh" <project-root> --template <name>`. Existing files must be skipped, not replaced.
33
+ 2. Run `dotdotgod init <project-root> [--documentation-root PATH] --template <name>` when available; otherwise run `sh "${CLAUDE_PLUGIN_ROOT}/skills/project-initializer/scripts/init_project.sh" <project-root> --template <name>`. Existing files must be skipped, not replaced.
34
34
  3. The POSIX fallback supports bundled templates only. If a custom template was selected and the CLI is unavailable, stop and explain that custom templates require the CLI; do not silently substitute another template.
35
35
  4. Validate the initialized project with `dotdotgod validate <project-root>` when available.
36
36
  5. Report created and skipped files, the selected template, validation failures, and unresolved instruction conflicts.
@@ -6,7 +6,7 @@ TEMPLATES_DIR="$SCRIPT_DIR/../templates"
6
6
 
7
7
  usage() {
8
8
  cat <<'EOF'
9
- Usage: init_project.sh <project-root> [--project-name NAME] [--template NAME] [--dotdot-setting] [--dry-run]
9
+ Usage: init_project.sh <project-root> [--project-name NAME] [--template NAME] [--documentation-root PATH] [--dotdot-setting] [--dry-run]
10
10
 
11
11
  Initializes:
12
12
  AGENTS.md, CLAUDE.md, CODEX.md
@@ -26,6 +26,7 @@ PROJECT_NAME=""
26
26
  DRY_RUN=0
27
27
  DOTDOT_SETTING=0
28
28
  TEMPLATE_NAME="software"
29
+ DOCUMENTATION_ROOT="docs"
29
30
 
30
31
  while [ "$#" -gt 0 ]; do
31
32
  case "$1" in
@@ -45,6 +46,11 @@ while [ "$#" -gt 0 ]; do
45
46
  TEMPLATE_NAME=$2
46
47
  shift 2
47
48
  ;;
49
+ --documentation-root)
50
+ [ "$#" -ge 2 ] || { echo "error: --documentation-root requires a value" >&2; exit 2; }
51
+ DOCUMENTATION_ROOT=$2
52
+ shift 2
53
+ ;;
48
54
  --dotdot-setting)
49
55
  DOTDOT_SETTING=1
50
56
  shift
@@ -84,6 +90,14 @@ case "$PROJECT_ROOT" in
84
90
  *) PROJECT_ROOT="$(pwd)/$PROJECT_ROOT" ;;
85
91
  esac
86
92
 
93
+ case "$DOCUMENTATION_ROOT" in
94
+ ''|/*|*\\*|*'..'*|*'*'*|*'?'*|*'['*|*']'*|*'{'*|*'}'*|.dotdotgod*|dotdotgod.config.json*)
95
+ echo "error: invalid documentation root: $DOCUMENTATION_ROOT" >&2
96
+ exit 2
97
+ ;;
98
+ esac
99
+ DOCUMENTATION_ROOT=$(printf '%s' "$DOCUMENTATION_ROOT" | sed 's#^\./##; s#//*#/#g; s#/$##')
100
+
87
101
  if [ -z "$PROJECT_NAME" ]; then
88
102
  PROJECT_NAME=$(basename "$PROJECT_ROOT")
89
103
  fi
@@ -184,7 +198,7 @@ fi
184
198
  DOTDOT_AGENT_RULE=""
185
199
  if [ "$DOTDOT_SETTING" -eq 1 ]; then
186
200
  DOTDOT_AGENT_RULE='
187
- - Follow the project documentation structure in `docs/arch/DOCS_STRUCTURE.md` and code conventions in `docs/arch/CODE_CONVENTIONS.md`.'
201
+ - Follow the project documentation structure in `$DOCUMENTATION_ROOT/arch/DOCS_STRUCTURE.md` and code conventions in `$DOCUMENTATION_ROOT/arch/CODE_CONVENTIONS.md`.'
188
202
  fi
189
203
 
190
204
  ARCH_README_EXTRA=""
@@ -239,17 +253,17 @@ TODO
239
253
 
240
254
  ## Documentation Map
241
255
 
242
- - \`docs/spec/\`: product behavior, API contracts, user-facing requirements.
243
- - \`docs/test/\`: test strategy, regression cases, manual verification notes.
244
- - \`docs/arch/\`: architecture decisions, code conventions, module boundaries, data flow, infrastructure/runtime dependencies, integration boundaries, and migration design.
245
- - \`docs/\`: all directories use kebab-case; all markdown file names use UPPER_SNAKE_CASE, including \`README.md\`.
246
- - \`docs/\`: prefer keeping individual markdown files under 200 lines and under 10,000 characters; split larger docs into focused UPPER_SNAKE_CASE files and keep \`README.md\` as the index/overview.
247
- - \`docs/\`: when adding, renaming, splitting, moving, or archiving docs, update the nearest relevant \`README.md\` index/table of contents in the same change.
248
- - \`docs/\`: each docs subdirectory \`README.md\` acts as the local table of contents; list important files, task directories, status, and a one-line purpose for each entry.
249
- - \`docs/\`: start small with a single focused markdown file; when one domain grows into multiple docs, promote it to \`docs/<area>/<domain>/README.md\` plus related UPPER_SNAKE_CASE files in that directory.
250
- - \`docs/arch/\`: code conventions may start as \`CODE_CONVENTIONS.md\`; when they grow across multiple topics, use \`docs/arch/conventions/README.md\` as the index with supporting UPPER_SNAKE_CASE files.
251
- - \`docs/plan/\`: local active implementation plans. Create one kebab-case directory per task (\`docs/plan/<task-slug>/\`), keep the task overview/index in that directory's \`README.md\`, and add supporting UPPER_SNAKE_CASE plan files alongside it. Ignored by git by default.
252
- - \`docs/archive/\`: local completed plans, temporary reports, historical notes, payload captures. Move completed plan task directories to \`docs/archive/plan/<task-slug>/\`; put temporary reports and investigations under \`docs/archive/report/<report-slug>/\`. Ignored by git by default.
256
+ - \`$DOCUMENTATION_ROOT/spec/\`: product behavior, API contracts, user-facing requirements.
257
+ - \`$DOCUMENTATION_ROOT/test/\`: test strategy, regression cases, manual verification notes.
258
+ - \`$DOCUMENTATION_ROOT/arch/\`: architecture decisions, code conventions, module boundaries, data flow, infrastructure/runtime dependencies, integration boundaries, and migration design.
259
+ - \`$DOCUMENTATION_ROOT/\`: all directories use kebab-case; all markdown file names use UPPER_SNAKE_CASE, including \`README.md\`.
260
+ - \`$DOCUMENTATION_ROOT/\`: prefer keeping individual markdown files under 200 lines and under 10,000 characters; split larger docs into focused UPPER_SNAKE_CASE files and keep \`README.md\` as the index/overview.
261
+ - \`$DOCUMENTATION_ROOT/\`: when adding, renaming, splitting, moving, or archiving docs, update the nearest relevant \`README.md\` index/table of contents in the same change.
262
+ - \`$DOCUMENTATION_ROOT/\`: each docs subdirectory \`README.md\` acts as the local table of contents; list important files, task directories, status, and a one-line purpose for each entry.
263
+ - \`$DOCUMENTATION_ROOT/\`: start small with a single focused markdown file; when one domain grows into multiple docs, promote it to \`$DOCUMENTATION_ROOT/<area>/<domain>/README.md\` plus related UPPER_SNAKE_CASE files in that directory.
264
+ - \`$DOCUMENTATION_ROOT/arch/\`: code conventions may start as \`CODE_CONVENTIONS.md\`; when they grow across multiple topics, use \`$DOCUMENTATION_ROOT/arch/conventions/README.md\` as the index with supporting UPPER_SNAKE_CASE files.
265
+ - \`$DOCUMENTATION_ROOT/plan/\`: local active implementation plans. Create one kebab-case directory per task (\`$DOCUMENTATION_ROOT/plan/<task-slug>/\`), keep the task overview/index in that directory's \`README.md\`, and add supporting UPPER_SNAKE_CASE plan files alongside it. Ignored by git by default.
266
+ - \`$DOCUMENTATION_ROOT/archive/\`: local completed plans, temporary reports, historical notes, payload captures. Move completed plan task directories to \`$DOCUMENTATION_ROOT/archive/plan/<task-slug>/\`; put temporary reports and investigations under \`$DOCUMENTATION_ROOT/archive/report/<report-slug>/\`. Ignored by git by default.
253
267
 
254
268
  ## Agent-Specific Entrypoints
255
269
 
@@ -266,21 +280,21 @@ write_file "$PROJECT_ROOT/CODEX.md" "# CODEX.md
266
280
 
267
281
  See [AGENTS.md](./AGENTS.md)."
268
282
 
269
- write_file "$PROJECT_ROOT/docs/README.md" "# Docs
283
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/README.md" "# Docs
270
284
 
271
285
  This directory keeps project knowledge close to the code.
272
286
 
273
287
  ## Naming
274
288
 
275
- - All directories under \`docs/\` use kebab-case.
276
- - All markdown file names under \`docs/\` use UPPER_SNAKE_CASE, including \`README.md\`.
289
+ - All directories under \`$DOCUMENTATION_ROOT/\` use kebab-case.
290
+ - All markdown file names under \`$DOCUMENTATION_ROOT/\` use UPPER_SNAKE_CASE, including \`README.md\`.
277
291
  - Prefer keeping individual markdown files under 200 lines and under 10,000 characters; split larger docs into focused UPPER_SNAKE_CASE files and keep \`README.md\` as the index/overview.
278
292
 
279
293
  ## Indexing
280
294
 
281
295
  - When adding, renaming, splitting, moving, or archiving docs, update the nearest relevant \`README.md\` index/table of contents in the same change.
282
296
  - Each docs subdirectory \`README.md\` acts as the local table of contents; list important files, task directories, status, and a one-line purpose for each entry.
283
- - Start small with a single focused markdown file; when one domain grows into multiple docs, promote it to \`docs/<area>/<domain>/README.md\` plus related UPPER_SNAKE_CASE files in that directory.
297
+ - Start small with a single focused markdown file; when one domain grows into multiple docs, promote it to \`$DOCUMENTATION_ROOT/<area>/<domain>/README.md\` plus related UPPER_SNAKE_CASE files in that directory.
284
298
 
285
299
  ## Map
286
300
 
@@ -290,37 +304,37 @@ This directory keeps project knowledge close to the code.
290
304
  - \`plan/\`: local active implementation plans. Create one kebab-case directory per task (\`plan/<task-slug>/\`), keep the task overview/index in that directory's \`README.md\`, and add supporting UPPER_SNAKE_CASE plan files alongside it. Ignored by git by default.
291
305
  - \`archive/\`: local completed plans, temporary reports, historical notes, payload captures. Move completed plan task directories to \`archive/plan/<task-slug>/\`; put temporary reports and investigations under \`archive/report/<report-slug>/\`. Ignored by git by default."
292
306
 
293
- write_file "$PROJECT_ROOT/docs/spec/README.md" "# Specs
307
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/spec/README.md" "# Specs
294
308
 
295
309
  Use this area for behavior specs, API contracts, and product requirements.
296
310
 
297
311
  For projects using the dotdotgod CLI, behavior specs may be required by \`dotdotgod validate\` to include fenced \`json dotdotgod\` traceability blocks as the final section. The CLI owns the schema and prints property-level repair guidance when validation fails."
298
312
 
299
- write_file "$PROJECT_ROOT/docs/test/README.md" "# Tests
313
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/test/README.md" "# Tests
300
314
 
301
315
  Use this area for test strategy, coverage notes, regression cases, and manual verification records."
302
316
 
303
- write_file "$PROJECT_ROOT/docs/arch/README.md" "# Architecture
317
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/arch/README.md" "# Architecture
304
318
 
305
319
  Use this area for architecture decisions, code conventions, module boundaries, data flow notes, infrastructure/runtime dependencies, integration boundaries, and migration design.$ARCH_README_EXTRA"
306
320
 
307
321
  if [ "$DOTDOT_SETTING" -eq 1 ]; then
308
- write_file "$PROJECT_ROOT/docs/arch/DOCS_STRUCTURE.md" "# Docs Structure
322
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/arch/DOCS_STRUCTURE.md" "# Docs Structure
309
323
 
310
324
  Long-term documentation structure for this project.
311
325
 
312
326
  ## Top-Level Areas
313
327
 
314
- - \`docs/spec/\`: product behavior, API contracts, user-facing requirements, and feature contracts.
315
- - \`docs/test/\`: test strategy, coverage notes, regression cases, and manual verification records.
316
- - \`docs/arch/\`: architecture decisions, code conventions, module boundaries, data flow, infrastructure/runtime dependencies, integration boundaries, and migration design.
317
- - \`docs/plan/\`: local active implementation plans.
318
- - \`docs/archive/\`: local completed plans, historical notes, payload captures, and investigation notes.
328
+ - \`$DOCUMENTATION_ROOT/spec/\`: product behavior, API contracts, user-facing requirements, and feature contracts.
329
+ - \`$DOCUMENTATION_ROOT/test/\`: test strategy, coverage notes, regression cases, and manual verification records.
330
+ - \`$DOCUMENTATION_ROOT/arch/\`: architecture decisions, code conventions, module boundaries, data flow, infrastructure/runtime dependencies, integration boundaries, and migration design.
331
+ - \`$DOCUMENTATION_ROOT/plan/\`: local active implementation plans.
332
+ - \`$DOCUMENTATION_ROOT/archive/\`: local completed plans, historical notes, payload captures, and investigation notes.
319
333
 
320
334
  ## Naming
321
335
 
322
- - Directories under \`docs/\` use kebab-case.
323
- - Markdown files under \`docs/\` use UPPER_SNAKE_CASE.
336
+ - Directories under \`$DOCUMENTATION_ROOT/\` use kebab-case.
337
+ - Markdown files under \`$DOCUMENTATION_ROOT/\` use UPPER_SNAKE_CASE.
324
338
  - \`README.md\` is the only mixed-case markdown filename exception and is required for index/overview files.
325
339
 
326
340
  ## File Size Guideline
@@ -335,13 +349,13 @@ When adding, renaming, splitting, moving, or archiving docs, update the nearest
335
349
 
336
350
  ## Domain Directory Promotion
337
351
 
338
- Start small with one focused markdown file. When one domain grows into multiple docs, promote it to \`docs/<area>/<domain>/README.md\` and place related UPPER_SNAKE_CASE markdown files in that directory.
352
+ Start small with one focused markdown file. When one domain grows into multiple docs, promote it to \`$DOCUMENTATION_ROOT/<area>/<domain>/README.md\` and place related UPPER_SNAKE_CASE markdown files in that directory.
339
353
 
340
354
  ## Spec Writing Contract
341
355
 
342
356
  Behavior specs describe the current product contract: supported commands, API shapes, user-visible behavior, defaults, constraints, and validation outcomes.
343
357
 
344
- Specs should not describe how behavior changed over time. Rewrite historical-change wording into direct current-state rules. Historical context, migration rationale, future extension ideas, and completed-plan notes belong in \`docs/arch/\`, \`docs/test/\`, \`docs/archive/\`, or active \`docs/plan/\` files rather than behavior specs. If compatibility behavior is still user-visible, keep it in the spec but phrase it as a current supported or unsupported rule.
358
+ Specs should not describe how behavior changed over time. Rewrite historical-change wording into direct current-state rules. Historical context, migration rationale, future extension ideas, and completed-plan notes belong in \`$DOCUMENTATION_ROOT/arch/\`, \`$DOCUMENTATION_ROOT/test/\`, \`$DOCUMENTATION_ROOT/archive/\`, or active \`$DOCUMENTATION_ROOT/plan/\` files rather than behavior specs. If compatibility behavior is still user-visible, keep it in the spec but phrase it as a current supported or unsupported rule.
345
359
 
346
360
  Config/action terms such as \`remove\`, \`exclude\`, \`fallback\`, and \`replacement semantics\` are allowed when they name current behavior precisely.
347
361
 
@@ -351,12 +365,12 @@ Behavior specs may include fenced \`json dotdotgod\` traceability blocks as the
351
365
 
352
366
  ## Plan and Archive Directories
353
367
 
354
- Active task plans use \`docs/plan/<task-slug>/README.md\`. Completed or superseded plan task directories move to \`docs/archive/plan/<task-slug>/\`. Temporary investigations, reports, payload captures, and historical notes move to \`docs/archive/report/<report-slug>/\`.
368
+ Active task plans use \`$DOCUMENTATION_ROOT/plan/<task-slug>/README.md\`. Completed or superseded plan task directories move to \`$DOCUMENTATION_ROOT/archive/plan/<task-slug>/\`. Temporary investigations, reports, payload captures, and historical notes move to \`$DOCUMENTATION_ROOT/archive/report/<report-slug>/\`.
355
369
 
356
- \`docs/plan\` and \`docs/archive\` are ignored by git by default.
370
+ \`$DOCUMENTATION_ROOT/plan\` and \`$DOCUMENTATION_ROOT/archive\` are ignored by git by default.
357
371
  "
358
372
 
359
- write_file "$PROJECT_ROOT/docs/arch/CODE_CONVENTIONS.md" "# Code Conventions
373
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/arch/CODE_CONVENTIONS.md" "# Code Conventions
360
374
 
361
375
  Dotdot code conventions for keeping implementation simple and maintainable.
362
376
 
@@ -389,25 +403,25 @@ Dotdot code conventions for keeping implementation simple and maintainable.
389
403
  "
390
404
  fi
391
405
 
392
- write_file "$PROJECT_ROOT/docs/plan/README.md" "# Plans
406
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/plan/README.md" "# Plans
393
407
 
394
408
  Use this area for active implementation plans.
395
409
 
396
410
  ## Naming
397
411
 
398
- - Task directories use kebab-case: \`docs/plan/<task-slug>/\`.
412
+ - Task directories use kebab-case: \`$DOCUMENTATION_ROOT/plan/<task-slug>/\`.
399
413
  - Markdown file names use UPPER_SNAKE_CASE: \`README.md\`, \`RESEARCH_NOTES.md\`, \`VERIFICATION.md\`.
400
414
 
401
415
  ## Structure
402
416
 
403
- - Create one directory per task: \`docs/plan/<task-slug>/\`.
404
- - Put the task overview, index, scope, status, and main plan in \`docs/plan/<task-slug>/README.md\`.
417
+ - Create one directory per task: \`$DOCUMENTATION_ROOT/plan/<task-slug>/\`.
418
+ - Put the task overview, index, scope, status, and main plan in \`$DOCUMENTATION_ROOT/plan/<task-slug>/README.md\`.
405
419
  - Add supporting research, checklists, payload captures, or verification notes as additional UPPER_SNAKE_CASE markdown files in the same task directory.
406
- - Move completed or superseded task directories to \`docs/archive/plan/<task-slug>/\`.
420
+ - Move completed or superseded task directories to \`$DOCUMENTATION_ROOT/archive/plan/<task-slug>/\`.
407
421
 
408
422
  This directory is local-only and ignored by git by default."
409
423
 
410
- write_file "$PROJECT_ROOT/docs/archive/README.md" "# Archive
424
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/archive/README.md" "# Archive
411
425
 
412
426
  Use this area for local completed plans, temporary reports, historical notes, payload captures, and investigation notes.
413
427
 
@@ -419,8 +433,8 @@ Use this area for local completed plans, temporary reports, historical notes, pa
419
433
 
420
434
  ## Structure
421
435
 
422
- - Move completed plan task directories from \`docs/plan/<task-slug>/\` to \`docs/archive/plan/<task-slug>/\`.
423
- - Put temporary investigations, reports, payload captures, and historical notes under \`docs/archive/report/<report-slug>/\`.
436
+ - Move completed plan task directories from \`$DOCUMENTATION_ROOT/plan/<task-slug>/\` to \`$DOCUMENTATION_ROOT/archive/plan/<task-slug>/\`.
437
+ - Put temporary investigations, reports, payload captures, and historical notes under \`$DOCUMENTATION_ROOT/archive/report/<report-slug>/\`.
424
438
  - Preserve each archive directory's \`README.md\` overview/index and supporting UPPER_SNAKE_CASE markdown files.
425
439
  - Additional archive categories can be added later as focused kebab-case subdirectories when needed.
426
440
 
@@ -431,69 +445,69 @@ case "$TEMPLATE_NAME" in
431
445
  software)
432
446
  ;;
433
447
  research)
434
- write_file "$PROJECT_ROOT/docs/research/README.md" "# Research
448
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/research/README.md" "# Research
435
449
 
436
450
  Use this area for research notes, sources, and findings."
437
- write_file "$PROJECT_ROOT/docs/record/README.md" "# Research Records
451
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/record/README.md" "# Research Records
438
452
 
439
453
  Use this area for dated measurements, experiments, and execution records."
440
- write_file "$PROJECT_ROOT/docs/report/README.md" "# Reports
454
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/report/README.md" "# Reports
441
455
 
442
456
  Use this area for research diagnoses, analyses, results, and performance reports."
443
457
  ensure_directory "$PROJECT_ROOT/outputs"
444
458
  ;;
445
459
  case-and-evidence)
446
- write_file "$PROJECT_ROOT/docs/case/README.md" "# Case Records
460
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/case/README.md" "# Case Records
447
461
 
448
462
  Use this area for canonical case facts, questions, and decisions."
449
- write_file "$PROJECT_ROOT/docs/evidence/README.md" "# Evidence
463
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/evidence/README.md" "# Evidence
450
464
 
451
465
  Use this area for factual, legal, and other supporting evidence."
452
- write_file "$PROJECT_ROOT/docs/outputs/README.md" "# Case Outputs
466
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/outputs/README.md" "# Case Outputs
453
467
 
454
468
  Use this area for maintained case outputs."
455
469
  ;;
456
470
  publication)
457
- write_file "$PROJECT_ROOT/docs/outline/README.md" "# Publication Outline
471
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/outline/README.md" "# Publication Outline
458
472
 
459
473
  Use this area for publication structure and outlines."
460
- write_file "$PROJECT_ROOT/docs/chapters/README.md" "# Chapter Plans
474
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/chapters/README.md" "# Chapter Plans
461
475
 
462
476
  Use this area for chapter plans and direction."
463
- write_file "$PROJECT_ROOT/docs/claims/README.md" "# Claims
477
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/claims/README.md" "# Claims
464
478
 
465
479
  Use this area for maintained claims and their support."
466
- write_file "$PROJECT_ROOT/docs/research/README.md" "# Research Sources
480
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/research/README.md" "# Research Sources
467
481
 
468
482
  Use this area for research sources and supporting notes."
469
483
  ensure_directory "$PROJECT_ROOT/book"
470
484
  ;;
471
485
  portfolio)
472
- write_file "$PROJECT_ROOT/docs/strategy/README.md" "# Portfolio Strategy
486
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/strategy/README.md" "# Portfolio Strategy
473
487
 
474
488
  Use this area for portfolio strategy and risk rules."
475
- write_file "$PROJECT_ROOT/docs/positions/README.md" "# Position Theses
489
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/positions/README.md" "# Position Theses
476
490
 
477
491
  Use this area for position theses and investment conclusions."
478
- write_file "$PROJECT_ROOT/docs/journal/README.md" "# Decision Journal
492
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/journal/README.md" "# Decision Journal
479
493
 
480
494
  Use this area for dated investment decisions and reviews."
481
- write_file "$PROJECT_ROOT/docs/report/README.md" "# Market Research
495
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/report/README.md" "# Market Research
482
496
 
483
497
  Use this area for maintained market research and analysis."
484
498
  ensure_directory "$PROJECT_ROOT/data"
485
499
  ;;
486
500
  policy)
487
- write_file "$PROJECT_ROOT/docs/policy/README.md" "# Policy Documents
501
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/policy/README.md" "# Policy Documents
488
502
 
489
503
  Use this area for integrated policy proposals and outputs."
490
- write_file "$PROJECT_ROOT/docs/sections/README.md" "# Policy Sections
504
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/sections/README.md" "# Policy Sections
491
505
 
492
506
  Use this area for source policy sections."
493
- write_file "$PROJECT_ROOT/docs/evidence/README.md" "# Policy Evidence
507
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/evidence/README.md" "# Policy Evidence
494
508
 
495
509
  Use this area for evidence supporting policy proposals."
496
- write_file "$PROJECT_ROOT/docs/outputs/README.md" "# Submission Outputs
510
+ write_file "$PROJECT_ROOT/$DOCUMENTATION_ROOT/outputs/README.md" "# Submission Outputs
497
511
 
498
512
  Use this area for maintained policy submission outputs."
499
513
  ;;
@@ -503,9 +517,9 @@ fi
503
517
  if [ -e "$CONFIG_PATH" ]; then
504
518
  print_result "skipped" "$CONFIG_PATH"
505
519
  else
506
- write_file "$CONFIG_PATH" "$(cat "$CONFIG_TEMPLATE")"
520
+ write_file "$CONFIG_PATH" "$(sed 's#"root": "docs"#"root": "'$DOCUMENTATION_ROOT'"#; s#"docs/#"'$DOCUMENTATION_ROOT'/#g' "$CONFIG_TEMPLATE")"
507
521
  fi
508
522
 
509
- ensure_gitignore_entry "docs/plan"
510
- ensure_gitignore_entry "docs/archive"
523
+ ensure_gitignore_entry "$DOCUMENTATION_ROOT/plan"
524
+ ensure_gitignore_entry "$DOCUMENTATION_ROOT/archive"
511
525
  ensure_gitignore_entry ".dotdotgod"
@@ -1,4 +1,7 @@
1
1
  {
2
+ "documentation": {
3
+ "root": "docs"
4
+ },
2
5
  "memory": {
3
6
  "areas": [
4
7
  {
@@ -1,4 +1,7 @@
1
1
  {
2
+ "documentation": {
3
+ "root": "docs"
4
+ },
2
5
  "memory": {
3
6
  "areas": [
4
7
  {
@@ -1,4 +1,7 @@
1
1
  {
2
+ "documentation": {
3
+ "root": "docs"
4
+ },
2
5
  "memory": {
3
6
  "areas": [
4
7
  {
@@ -1,4 +1,7 @@
1
1
  {
2
+ "documentation": {
3
+ "root": "docs"
4
+ },
2
5
  "memory": {
3
6
  "areas": [
4
7
  {
@@ -1,4 +1,7 @@
1
1
  {
2
+ "documentation": {
3
+ "root": "docs"
4
+ },
2
5
  "memory": {
3
6
  "areas": [
4
7
  {
@@ -1,4 +1,7 @@
1
1
  {
2
+ "documentation": {
3
+ "root": "docs"
4
+ },
2
5
  "memory": {
3
6
  "areas": [
4
7
  {
@@ -1,4 +1,7 @@
1
1
  {
2
+ "documentation": {
3
+ "root": "docs"
4
+ },
2
5
  "memory": {
3
6
  "areas": [
4
7
  {