@dotdotgod/codex 0.1.13 → 0.1.14
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 +6 -0
- package/hooks/README.md +98 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -22,6 +22,12 @@ Codex adapter for dotdotgod's context curation workflow. It packages reusable sk
|
|
|
22
22
|
|
|
23
23
|
Codex may not expose the same slash-command model as Pi or Claude Code. Treat `dd:load`, `dd:plan`, and `dd:init` as command-like trigger phrases for these skills unless the active Codex plugin runtime provides direct command registration.
|
|
24
24
|
|
|
25
|
+
## Optional Hooks
|
|
26
|
+
|
|
27
|
+
Codex can run lifecycle hooks from trusted Codex configuration layers. dotdotgod does not require hooks: the bundled skills and `dd:load`, `dd:plan`, and `dd:init` trigger phrases work without them.
|
|
28
|
+
|
|
29
|
+
Use hooks only when you want opt-in reminders or validation around the same workflow. See [`hooks/README.md`](hooks/README.md) for advisory examples and stricter plan-safety patterns.
|
|
30
|
+
|
|
25
31
|
## Local Development
|
|
26
32
|
|
|
27
33
|
Run package checks:
|
package/hooks/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Optional Codex Hooks
|
|
2
|
+
|
|
3
|
+
Codex hooks can complement dotdotgod skills and `dd:*` trigger phrases, but they are not required. The `project-load`, `doc-first-planning`, and `project-initializer` skills work without hook configuration.
|
|
4
|
+
|
|
5
|
+
Use hooks only when you want opt-in reminders, lightweight validation, or local safety rails around the same doc-first workflow. Hooks run local commands with your user permissions. Project-local `.codex/` hooks should be reviewed and trusted before use.
|
|
6
|
+
|
|
7
|
+
## When To Use Hooks
|
|
8
|
+
|
|
9
|
+
- Use `dd:load` or the `project-load` skill when you intentionally want a curated project-memory load.
|
|
10
|
+
- Use `dd:plan` or the `doc-first-planning` skill before implementation, refactors, migrations, or multi-step work.
|
|
11
|
+
- Use hooks for small reminders at session start, prompt submission, supported tool boundaries, or stop time.
|
|
12
|
+
|
|
13
|
+
## Opt-In Levels
|
|
14
|
+
|
|
15
|
+
- `advisory`: print reminders or read-only status only.
|
|
16
|
+
- `validate`: run `dotdotgod validate` after docs work or at stop time.
|
|
17
|
+
- `strict-plan-safety`: add local blocking scripts only when a reliable plan-only state signal exists.
|
|
18
|
+
|
|
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
|
+
|
|
21
|
+
## Advisory `hooks.json` Example
|
|
22
|
+
|
|
23
|
+
This example reminds Codex to use dotdotgod intentionally at session start:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"hooks": {
|
|
28
|
+
"SessionStart": [
|
|
29
|
+
{
|
|
30
|
+
"matcher": "startup|resume",
|
|
31
|
+
"hooks": [
|
|
32
|
+
{
|
|
33
|
+
"type": "command",
|
|
34
|
+
"command": "printf '%s\\n' 'dotdotgod: use dd:load or dotdotgod load-snapshot when project memory is needed.'",
|
|
35
|
+
"timeout": 10
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Inline TOML Shape
|
|
45
|
+
|
|
46
|
+
Codex can also express hooks in `config.toml`:
|
|
47
|
+
|
|
48
|
+
```toml
|
|
49
|
+
[[hooks.PostToolUse]]
|
|
50
|
+
matcher = "Edit|Write|apply_patch"
|
|
51
|
+
|
|
52
|
+
[[hooks.PostToolUse.hooks]]
|
|
53
|
+
type = "command"
|
|
54
|
+
command = "sh .codex/hooks/validate-docs-if-needed.sh"
|
|
55
|
+
timeout = 120
|
|
56
|
+
statusMessage = "Checking dotdotgod docs when relevant"
|
|
57
|
+
```
|
|
58
|
+
|
|
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.
|
|
60
|
+
|
|
61
|
+
## Prompt Reminder Pattern
|
|
62
|
+
|
|
63
|
+
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
|
+
|
|
65
|
+
## Strict Plan Safety Pattern
|
|
66
|
+
|
|
67
|
+
Strict safety belongs in a local script, not a generic package default:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"hooks": {
|
|
72
|
+
"PreToolUse": [
|
|
73
|
+
{
|
|
74
|
+
"matcher": "Edit|Write|apply_patch",
|
|
75
|
+
"hooks": [
|
|
76
|
+
{
|
|
77
|
+
"type": "command",
|
|
78
|
+
"command": "python3 .codex/hooks/dotdotgod-plan-safety.py",
|
|
79
|
+
"timeout": 10
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
A strict script must read hook JSON from stdin, confirm the session is explicitly in plan-only mode, allow expected `docs/plan/**` and `docs/archive/**` plan/archive updates, and fail open or advisory unless the mode signal and path parsing are tested. Codex tool interception may not cover every command path, so do not treat this as complete Plan Mode parity.
|
|
89
|
+
|
|
90
|
+
## Avoid By Default
|
|
91
|
+
|
|
92
|
+
- Do not run `pnpm run verify` after every tool call.
|
|
93
|
+
- Do not run `dotdotgod index` as an automatic stop hook.
|
|
94
|
+
- Do not move active plans to `docs/archive/` automatically.
|
|
95
|
+
- Do not block all source writes without an explicit plan-only state signal.
|
|
96
|
+
- Do not imply Codex has Claude/Pi slash-command parity.
|
|
97
|
+
- Treat `dotdotgod load-snapshot` as a cache-aware opt-in, not as a side-effect-free strict hook; it may lazily refresh the ignored `.dotdotgod/` cache.
|
|
98
|
+
- Do not return raw `dotdotgod status` JSON from `Stop`; Codex stop hooks need Codex-compatible hook output. Use a tested wrapper if you want stop-time status reporting.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotdotgod/codex",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "Codex adapter for dotdotgod project memory workflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,11 +19,12 @@
|
|
|
19
19
|
"files": [
|
|
20
20
|
".codex-plugin",
|
|
21
21
|
"skills",
|
|
22
|
+
"hooks",
|
|
22
23
|
"README.md",
|
|
23
24
|
"LICENSE"
|
|
24
25
|
],
|
|
25
26
|
"scripts": {
|
|
26
|
-
"verify": "node -e \"const fs=require('fs'); const req=['.codex-plugin/plugin.json','skills/project-load/SKILL.md','skills/doc-first-planning/SKILL.md','skills/project-initializer/SKILL.md','skills/project-initializer/scripts/init_project.sh']; JSON.parse(fs.readFileSync('.codex-plugin/plugin.json','utf8')); for (const f of req) { if (!fs.existsSync(f)) throw new Error('missing '+f); } console.log('codex adapter ok')\"",
|
|
27
|
+
"verify": "node -e \"const fs=require('fs'); const req=['.codex-plugin/plugin.json','skills/project-load/SKILL.md','skills/doc-first-planning/SKILL.md','skills/project-initializer/SKILL.md','skills/project-initializer/scripts/init_project.sh','hooks/README.md']; JSON.parse(fs.readFileSync('.codex-plugin/plugin.json','utf8')); for (const f of req) { if (!fs.existsSync(f)) throw new Error('missing '+f); } console.log('codex adapter ok')\"",
|
|
27
28
|
"pack:dry-run": "pnpm pack --dry-run --json"
|
|
28
29
|
}
|
|
29
30
|
}
|