@dotdotgod/codex 0.1.14 → 0.1.16

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
@@ -1,13 +1,15 @@
1
1
  # @dotdotgod/codex
2
2
 
3
- Codex adapter for dotdotgod's context curation workflow. It packages reusable skills that help Codex load curated project memory, plan from docs before implementation, and initialize the shared agent documentation scaffold.
3
+ > **Change a file, know what else must be checked.**
4
+
5
+ Codex adapter for dotdotgod's context curation workflow. It packages reusable skills that help Codex load curated project memory, plan from docs before implementation, and initialize the shared agent documentation scaffold so changes start with the right specs, tests, plans, and archive map.
4
6
 
5
7
  ## What Gets Better?
6
8
 
7
- - Codex can start from `AGENTS.md` and the dotdotgod docs map instead of rebuilding context manually.
9
+ - Codex can start from `AGENTS.md` and the dotdotgod docs map.
8
10
  - Load guidance prefers `dotdotgod load-snapshot <root> --json` when the CLI is available, then falls back to README-index reads.
9
11
  - Codex can use docs structure as retrieval intent: specs for behavior, architecture for rationale, tests for verification, plans for current work, and archive indexes for past decisions.
10
- - Product intent, design rationale, and verification standards stay in durable docs instead of transient chat.
12
+ - Product intent, design rationale, and verification standards stay in durable docs.
11
13
  - Planning work captures current intent in `docs/plan/<task-slug>/README.md` before implementation.
12
14
  - Completed plans and temporary reports use the same archive structure as Pi and Claude Code, turning outcomes into future context.
13
15
  - `dd:load`, `dd:plan`, and `dd:init` can be used as command-like trigger phrases where direct slash commands are unavailable.
@@ -48,6 +50,6 @@ pnpm --filter @dotdotgod/codex run pack:dry-run
48
50
 
49
51
  ## Compared with Graphify-Style Memory
50
52
 
51
- This adapter packages reusable workflow skills rather than a repo-wide extraction engine. It guides Codex to prefer a bounded dotdotgod load snapshot when available, avoid broad archive scans, and follow README indexes before reading raw files.
53
+ This adapter packages reusable workflow skills. It guides Codex to prefer a bounded dotdotgod load snapshot when available, avoid broad archive scans, and follow README indexes before reading raw files.
52
54
 
53
55
  The strength is structured retrieval: project docs declare which files are rules, specs, architecture, verification, active intent, or historical memory. That keeps the memory layer portable across Codex runtimes and useful on small tasks where a large graph report would be overhead.
package/hooks/README.md CHANGED
@@ -13,11 +13,17 @@ Use hooks only when you want opt-in reminders, lightweight validation, or local
13
13
  ## Opt-In Levels
14
14
 
15
15
  - `advisory`: print reminders or read-only status only.
16
- - `validate`: run `dotdotgod validate` after docs work or at stop time.
16
+ - `validate`: run `dotdotgod validate . --include-local-memory --check-index` after docs work or at stop time.
17
17
  - `strict-plan-safety`: add local blocking scripts only when a reliable plan-only state signal exists.
18
18
 
19
19
  Start with advisory hooks. Do not enable blocking hooks until you have tested the hook payload, Codex trust state, and your local policy script.
20
20
 
21
+ ## Review Before First Run
22
+
23
+ Codex may detect a configured hook but keep it disabled until you review it. If Codex shows `1 hook needs review before it can run. Open /hooks to review it.`, open `/hooks`, inspect the command, and approve only commands you trust.
24
+
25
+ After approval, trigger a small supported edit such as an `apply_patch` documentation comment change and confirm the hook status message or command output appears. If the hook was added while a Codex session was already running, restart Codex before the smoke test so the current configuration is loaded.
26
+
21
27
  ## Advisory `hooks.json` Example
22
28
 
23
29
  This example reminds Codex to use dotdotgod intentionally at session start:
@@ -51,17 +57,38 @@ matcher = "Edit|Write|apply_patch"
51
57
 
52
58
  [[hooks.PostToolUse.hooks]]
53
59
  type = "command"
54
- command = "sh .codex/hooks/validate-docs-if-needed.sh"
60
+ command = "dotdotgod validate . --include-local-memory --check-index"
55
61
  timeout = 120
56
- statusMessage = "Checking dotdotgod docs when relevant"
62
+ statusMessage = "Checking dotdotgod docs and index freshness"
57
63
  ```
58
64
 
59
- Use validation hooks only by explicit opt-in. They are useful for docs-heavy sessions but can be noisy if they run after every supported edit. Prefer a local wrapper that filters to docs-related edits or writes validation logs without returning invalid hook output.
65
+ Use validation hooks only by explicit opt-in. They are useful for docs-heavy sessions but can be noisy if they run after every supported edit. `--check-index` compares current markdown fingerprints with `.dotdotgod/manifest.json` without refreshing the cache; if the only failure is an index freshness error, run `dotdotgod index .` or `pnpm run verify:cache` intentionally.
60
66
 
61
67
  ## Prompt Reminder Pattern
62
68
 
63
69
  A `UserPromptSubmit` hook can add a reminder for implementation-like prompts. Keep the command fast and non-mutating. Prefer reminders over automatic planning because `dd:plan` and the planning skill are the explicit durable workflow.
64
70
 
71
+ For planning-like prompts, use an advisory reminder that asks Codex to resolve explicit `[[...]]` project-memory refs with `dotdotgod expand`, identify the complete target file list, and run graph impact checks for every target file before finalizing the plan:
72
+
73
+ ```json
74
+ {
75
+ "hooks": {
76
+ "UserPromptSubmit": [
77
+ {
78
+ "matcher": "plan|planning|플랜|계획",
79
+ "hooks": [
80
+ {
81
+ "type": "command",
82
+ "command": "printf '%s\\n' 'dotdotgod: advisory reminder only. If the prompt contains [[...]] refs, run dotdotgod expand . \"<prompt>\" --json before broad grep/find. For planning work, identify the complete target file list, run dotdotgod graph impact . --changed <path> --compact for every target file, and use impact output to strengthen related docs, risks, and verification steps.'",
83
+ "timeout": 10
84
+ }
85
+ ]
86
+ }
87
+ ]
88
+ }
89
+ }
90
+ ```
91
+
65
92
  ## Strict Plan Safety Pattern
66
93
 
67
94
  Strict safety belongs in a local script, not a generic package default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotdotgod/codex",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "Codex adapter for dotdotgod project memory workflows.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,10 +30,13 @@ Prefer live repository docs in this order:
30
30
  - Preserve user edits and unrelated dirty worktree changes.
31
31
  - If the session is long or noisy, suggest a user-initiated planning-focused compaction before writing or revising the plan; do not compact automatically because compaction is lossy.
32
32
  2. Gather evidence before planning.
33
+ - When the request contains explicit project-memory refs such as `[[PLAN_MODE]]`, run `dotdotgod expand <root> "<request>" --json` before broad `grep` or `find` scans, then read the resolved candidates selectively.
33
34
  - Search docs by domain terms from the user request.
34
35
  - Read nearest README indexes and relevant focused docs.
35
36
  - For behavior changes, prefer specs with CLI-enforced fenced `json dotdotgod` traceability blocks in the final section; use their source, test, related-doc, and verification-command mappings before editing code.
36
- - Read code only after docs identify likely module boundaries, or when docs are missing/stale.
37
+ - When the dotdotgod CLI is available and likely target files are known, run `dotdotgod graph impact <root> --changed <path> --compact --json` for a small bounded set of those files. Use the related specs, tests, docs, commands, scores, and reasons to strengthen target files, risks, and verification steps. If impact lookup fails or the CLI is unavailable, continue with README-index and traceability fallback evidence.
38
+ - Use `grep` or `find` after reference expansion, impact, and targeted reads when the task needs fallback discovery or raw source text search.
39
+ - Read code only after docs identify likely module boundaries, impact output points to relevant files, or docs are missing/stale.
37
40
  3. Create or update the active plan at:
38
41
 
39
42
  ```text
@@ -44,6 +47,7 @@ Prefer live repository docs in this order:
44
47
  5. Include:
45
48
  - scope and current status
46
49
  - target files and rationale
50
+ - impact-derived related files/checks when available
47
51
  - implementation steps
48
52
  - risks and edge cases when useful
49
53
  - verification method
@@ -20,6 +20,6 @@ Put durable, project-wide instructions in `AGENTS.md`:
20
20
  - coding and review expectations
21
21
  - environment constraints
22
22
 
23
- For projects using the dotdotgod CLI, `dotdotgod validate` is the enforcement point for machine-readable docs rules such as fenced `json dotdotgod` traceability blocks in behavior specs. Keep the detailed schema in the CLI and its validation errors rather than duplicating it across agent memory files.
23
+ For projects using the dotdotgod CLI, `dotdotgod validate` is the enforcement point for machine-readable docs rules such as fenced `json dotdotgod` traceability blocks in behavior specs. Keep the detailed schema in the CLI and its validation errors.
24
24
 
25
25
  Do not duplicate the same body in `CLAUDE.md` and `CODEX.md`; duplication causes drift.
@@ -17,10 +17,12 @@ Do not modify files during the load pass unless the user explicitly asks for edi
17
17
  - Check current directory, git root, branch, and dirty worktree status.
18
18
  - Mention user changes and avoid reverting or cleaning them.
19
19
  2. Prefer the bounded CLI snapshot when available.
20
+ - If the user prompt contains explicit project-memory refs such as `[[PLAN_MODE]]`, run `dotdotgod expand <root> "<prompt>" --json` before broad `grep` or `find` scans, then read the resolved candidates selectively.
20
21
  - If `dotdotgod` is installed or available in the repository, run `dotdotgod load-snapshot <root> --json`.
21
22
  - If the local environment allows package execution but no `dotdotgod` binary is available, optionally run `npx @dotdotgod/cli load-snapshot <root> --json`.
22
23
  - Treat the snapshot as the first-pass project-memory map for cache status, graph size, memory areas, related communities, and archive inclusion policy.
23
24
  - Use `dotdotgod graph impact <root> --changed <path> --compact --json` as a task-focused impact map when the user identifies a likely source/config/doc file.
25
+ - Use `grep` or `find` after `expand`, impact, and targeted reads when the task needs fallback discovery or raw source text search.
24
26
  - Fall back to raw `dotdotgod graph impact <root> --changed <path> --json` only when diagnostics need the full payload.
25
27
  - When graph impact surfaces traceability relations, inspect the related specs, tests, and docs before editing source.
26
28
  - Related behavior docs: [load project](../../../docs/spec/LOAD_PROJECT.md), [cross-agent support](../../../docs/spec/CROSS_AGENT_SUPPORT.md), and [cross-agent architecture](../../../docs/arch/CROSS_AGENT_ARCHITECTURE.md).
@@ -34,7 +36,7 @@ Do not modify files during the load pass unless the user explicitly asks for edi
34
36
  - `docs/plan/README.md`
35
37
  - `docs/archive/README.md`
36
38
  4. Start with `AGENTS.md`, `README.md`, and `docs/README.md` when they are not already clear from the CLI snapshot or loaded context.
37
- 5. Follow README indexes. Read relevant docs under `docs/spec`, `docs/test`, and `docs/arch` selectively instead of re-scanning every listed file unless the task needs a full refresh.
39
+ 5. Follow README indexes. Read relevant docs under `docs/spec`, `docs/test`, and `docs/arch` selectively unless the task needs a full refresh.
38
40
  6. List `docs/plan` entries first, then selectively read only relevant active plans.
39
41
  7. Use `docs/archive/README.md` as the archive history map. Do not scan archive bodies by default; read targeted completed plans under `docs/archive/plan/` or reports under `docs/archive/report/` only when directly relevant.
40
42
  8. Avoid broad reads of generated outputs, dependencies, databases, caches, secrets, and `.env*` contents.