codexkit 1.0.2 → 1.0.4

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 (53) hide show
  1. package/.codex/.template-manifest.json +44 -35
  2. package/.codex/.version +1 -1
  3. package/.codex/agents/builder.toml +6 -1
  4. package/.codex/agents/debugger.toml +1 -0
  5. package/.codex/agents/general.toml +6 -1
  6. package/.codex/agents/painter.toml +1 -0
  7. package/.codex/agents/planner.toml +1 -0
  8. package/.codex/agents/refactorer.toml +1 -0
  9. package/.codex/agents/reviewer.toml +1 -0
  10. package/.codex/agents/runner.toml +1 -0
  11. package/.codex/agents/scout.toml +43 -1
  12. package/.codex/agents/shipper.toml +1 -0
  13. package/.codex/agents/vision.toml +1 -0
  14. package/.codex/config.toml +32 -8
  15. package/.codex/mcp/README.md +47 -4
  16. package/.codex/mcp/context7.toml.example +41 -9
  17. package/.codex/mcp/exa.toml.example +35 -2
  18. package/.codex/memory/_templates/project.md +8 -0
  19. package/.codex/memory/_templates/session-context.md +8 -0
  20. package/.codex/memory/_templates/state.md +10 -0
  21. package/.codex/memory/_templates/tech-stack.md +9 -0
  22. package/.codex/memory/_templates/user.md +6 -0
  23. package/.codex/prompts/create.md +63 -26
  24. package/.codex/prompts/init.md +24 -0
  25. package/.codex/prompts/resume.md +6 -0
  26. package/.codex/prompts/search.md +78 -0
  27. package/.codex/prompts/ship.md +36 -25
  28. package/.codex/prompts/start.md +2 -2
  29. package/.codex/prompts/ui-slop-check.md +119 -0
  30. package/.codex/scripts/audit_memory_hygiene.sh +65 -0
  31. package/.codex/scripts/build_startup_brief.sh +15 -0
  32. package/.codex/scripts/start_bead.sh +9 -5
  33. package/.codex/scripts/verify_bead.sh +18 -6
  34. package/.codex/skills/compaction/SKILL.md +76 -125
  35. package/.codex/skills/context-management/SKILL.md +65 -55
  36. package/.codex/skills/frontend-design/SKILL.md +137 -55
  37. package/.codex/skills/frontend-design/references/color-system.md +125 -0
  38. package/.codex/skills/frontend-design/references/interaction.md +115 -0
  39. package/.codex/skills/frontend-design/references/motion-core.md +102 -0
  40. package/.codex/skills/frontend-design/references/responsive-design.md +104 -0
  41. package/.codex/skills/frontend-design/references/spatial-design.md +103 -0
  42. package/.codex/skills/frontend-design/references/typography-rules.md +118 -0
  43. package/.codex/skills/frontend-design/references/ux-writing.md +105 -0
  44. package/.codex/skills/session-management/SKILL.md +12 -5
  45. package/.template-manifest.json +44 -35
  46. package/AGENTS.md +3 -3
  47. package/CHANGELOG.md +44 -0
  48. package/README.md +4 -1
  49. package/bin/codexkit +3 -3
  50. package/install/install-global.sh +93 -52
  51. package/install/install-project.sh +211 -117
  52. package/install/validate.sh +1 -1
  53. package/package.json +1 -1
@@ -3,9 +3,17 @@ set -euo pipefail
3
3
 
4
4
  # Script: audit_memory_hygiene
5
5
  # Audits context/memory health without mutating repository files.
6
+ # Use --auto-fix to auto-generate worklog archive drafts when budget is exceeded.
6
7
 
7
8
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
8
9
 
10
+ AUTO_FIX=false
11
+ for arg in "$@"; do
12
+ case "$arg" in
13
+ --auto-fix) AUTO_FIX=true ;;
14
+ esac
15
+ done
16
+
9
17
  WORKLOG="$SCRIPT_DIR/context/worklog.md"
10
18
  DECISION_LOG="$SCRIPT_DIR/context/decision-log.md"
11
19
  SESSION_CONTEXT="$SCRIPT_DIR/context/session-context.md"
@@ -94,9 +102,66 @@ echo "Counts:"
94
102
  printf "INFO %-28s %s\n" "worklog entries" "$worklog_entries"
95
103
  printf "INFO %-28s %s\n" "decision-log entries" "$decision_count"
96
104
 
105
+ echo
106
+ echo "Token budget (context docs, target <4000 tokens):"
107
+ CONTEXT_DIR="$SCRIPT_DIR/context"
108
+ total_tokens=0
109
+ # Only count top-level .md files; context/archive/ is intentionally excluded by the non-recursive glob.
110
+ if [[ -d "$CONTEXT_DIR" ]]; then
111
+ for ctx_file in "$CONTEXT_DIR"/*.md; do
112
+ [[ -f "$ctx_file" ]] || continue
113
+ word_count=$(wc -w < "$ctx_file" 2>/dev/null | tr -d ' ')
114
+ est_tokens=$(( (word_count * 13 + 9) / 10 ))
115
+ total_tokens=$((total_tokens + est_tokens))
116
+ done
117
+ fi
118
+ if [[ "$total_tokens" -le 4000 ]]; then
119
+ printf "OK %-28s ~%s tokens (budget: 4000)\n" "context/ total" "$total_tokens"
120
+ else
121
+ printf "WARN %-28s ~%s tokens (budget: 4000)\n" "context/ total" "$total_tokens"
122
+ fi
123
+
124
+ echo
125
+ echo "Staleness checks:"
126
+ STALE_DAYS=30
127
+ now_epoch=$(date +%s)
128
+ for stale_file in "$SESSION_CONTEXT" "$STATE_FILE"; do
129
+ if [[ -f "$stale_file" ]]; then
130
+ file_label="${stale_file#$SCRIPT_DIR/}"
131
+ file_mtime=$(stat -f '%m' "$stale_file" 2>/dev/null || stat -c '%Y' "$stale_file" 2>/dev/null || echo "0")
132
+ age_days=$(( (now_epoch - file_mtime) / 86400 ))
133
+ if [[ "$age_days" -ge "$STALE_DAYS" ]]; then
134
+ printf "WARN %-28s %s days old (threshold: %s)\n" "$file_label" "$age_days" "$STALE_DAYS"
135
+ else
136
+ printf "OK %-28s %s days old\n" "$file_label" "$age_days"
137
+ fi
138
+ fi
139
+ done
140
+
97
141
  echo
98
142
  echo "Recommended next actions:"
99
143
  echo "- Run .codex/scripts/prepare_worklog_archive.sh <archive-path> if worklog needs pruning."
100
144
  echo "- After reviewing both drafts, run .codex/scripts/apply_worklog_archive.sh <archive-draft> <retained-draft> to update worklog.md and save an archive copy."
101
145
  echo "- Trim duplicate next-action bullets so session-context.md stays the precise restart cue."
102
146
  echo "- Keep only still-relevant durable decisions in decision-log.md."
147
+ echo "- Review stale files (>$STALE_DAYS days) and update or clear outdated content."
148
+
149
+ # Auto-fix: generate worklog archive drafts if budget is exceeded
150
+ if $AUTO_FIX; then
151
+ worklog_lines=$(wc -l < "$WORKLOG" 2>/dev/null | tr -d ' ')
152
+ worklog_lines="${worklog_lines:-0}"
153
+ if [[ "$worklog_lines" -gt 200 ]]; then
154
+ archive_draft="/tmp/codexkit-worklog-archive-draft.md"
155
+ retained_draft="/tmp/codexkit-worklog-retained-draft.md"
156
+ echo
157
+ echo "Auto-fix: worklog exceeds 200 lines ($worklog_lines). Generating archive drafts..."
158
+ "$SCRIPT_DIR/scripts/prepare_worklog_archive.sh" "$archive_draft" 20 --retained-output "$retained_draft"
159
+ echo " Archive draft: $archive_draft"
160
+ echo " Retained draft: $retained_draft"
161
+ echo " Review both, then run:"
162
+ echo " bash .codex/scripts/apply_worklog_archive.sh $archive_draft $retained_draft"
163
+ else
164
+ echo
165
+ echo "Auto-fix: worklog is within budget ($worklog_lines/200 lines). No action needed."
166
+ fi
167
+ fi
@@ -2,9 +2,24 @@
2
2
  set -euo pipefail
3
3
  # Script: build_startup_brief
4
4
  # Generates session startup context and prints to stdout.
5
+ # Also rebuilds the derived memory index if source files have changed.
5
6
 
6
7
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
7
8
 
9
+ # Rebuild derived memory index if source files are newer
10
+ INDEX_DB="$SCRIPT_DIR/memory/.index/memory-index.db"
11
+ if [[ -f "$SCRIPT_DIR/scripts/build_memory_index.sh" ]]; then
12
+ SOURCE_CHANGED=false
13
+ if [[ ! -f "$INDEX_DB" ]]; then
14
+ SOURCE_CHANGED=true
15
+ elif find "$SCRIPT_DIR/context" "$SCRIPT_DIR/memory/project" "$SCRIPT_DIR/memory/research" -type f -name '*.md' -newer "$INDEX_DB" -print -quit 2>/dev/null | grep -q .; then
16
+ SOURCE_CHANGED=true
17
+ fi
18
+ if $SOURCE_CHANGED; then
19
+ "$SCRIPT_DIR/scripts/build_memory_index.sh" >/dev/null 2>&1 || true
20
+ fi
21
+ fi
22
+
8
23
  echo "━━━ Startup Brief ━━━"
9
24
 
10
25
  # Current git branch and status
@@ -6,9 +6,10 @@ set -euo pipefail
6
6
  PROJECT_ROOT="${CODEXKIT_PROJECT_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)}"
7
7
  BEAD_ID="${1:-}"
8
8
  USE_CURRENT_BRANCH=false
9
+ WORKTREE=false
9
10
 
10
11
  if [[ -z "$BEAD_ID" ]]; then
11
- echo "Usage: $0 <bead-id> [--use-current-branch]" >&2
12
+ echo "Usage: $0 <bead-id> [--use-current-branch] [--worktree]" >&2
12
13
  exit 1
13
14
  fi
14
15
  shift || true
@@ -18,9 +19,12 @@ while [[ $# -gt 0 ]]; do
18
19
  --use-current-branch)
19
20
  USE_CURRENT_BRANCH=true
20
21
  ;;
22
+ --worktree)
23
+ WORKTREE=true
24
+ ;;
21
25
  *)
22
26
  echo "Unknown option: $1" >&2
23
- echo "Usage: $0 <bead-id> [--use-current-branch]" >&2
27
+ echo "Usage: $0 <bead-id> [--use-current-branch] [--worktree]" >&2
24
28
  exit 1
25
29
  ;;
26
30
  esac
@@ -95,13 +99,13 @@ print(f"BEAD_SLUG={shlex.quote(slug)}")
95
99
  PY
96
100
  )"
97
101
 
98
- if [[ "$BEAD_STATUS" != "in_progress" ]]; then
99
- (cd "$PROJECT_ROOT" && br update "$BEAD_ID" --status in_progress >/dev/null)
102
+ if [[ "$BEAD_STATUS" == "open" ]]; then
103
+ (cd "$PROJECT_ROOT" && br update "$BEAD_ID" --claim >/dev/null)
100
104
  fi
101
105
 
102
106
  BRANCH_NAME="$(git -C "$PROJECT_ROOT" branch --show-current)"
103
107
  TARGET_BRANCH="$BRANCH_NAME"
104
- if ! $USE_CURRENT_BRANCH; then
108
+ if ! $USE_CURRENT_BRANCH && ! $WORKTREE; then
105
109
  case "$BEAD_TYPE" in
106
110
  feature) prefix="feat" ;;
107
111
  bug) prefix="fix" ;;
@@ -7,6 +7,8 @@ PROJECT_ROOT="${CODEXKIT_PROJECT_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../.
7
7
  BEAD_ID="${1:-}"
8
8
  FULL=false
9
9
  NO_CACHE=false
10
+ QUICK=false
11
+ FIX=false
10
12
 
11
13
  if [[ -z "$BEAD_ID" ]]; then
12
14
  echo "Usage: $0 <bead-id> [--full] [--no-cache]" >&2
@@ -23,8 +25,10 @@ while [[ $# -gt 0 ]]; do
23
25
  NO_CACHE=true
24
26
  ;;
25
27
  --quick)
28
+ QUICK=true
26
29
  ;;
27
30
  --fix)
31
+ FIX=true
28
32
  ;;
29
33
  *)
30
34
  echo "Unknown option: $1" >&2
@@ -81,13 +85,14 @@ fi
81
85
 
82
86
  CURRENT_STAMP="$(
83
87
  cd "$PROJECT_ROOT" &&
84
- printf '%s\n%s\n%s' \
88
+ printf '%s\n%s\n%s\n%s' \
89
+ "$BEAD_ID" \
85
90
  "$(git rev-parse HEAD)" \
86
91
  "$(git diff HEAD -- '*.ts' '*.tsx' '*.js' '*.jsx')" \
87
92
  "$(git ls-files --others --exclude-standard -- '*.ts' '*.tsx' '*.js' '*.jsx' | xargs cat 2>/dev/null)" \
88
93
  | shasum -a 256 | cut -d' ' -f1
89
94
  )"
90
- LAST_STAMP="$(tail -1 "$VERIFY_LOG" 2>/dev/null | awk '{print $1}' || true)"
95
+ LAST_STAMP="$(grep -F "$CURRENT_STAMP" "$VERIFY_LOG" 2>/dev/null | tail -1 | awk '{print $1}' || true)"
91
96
 
92
97
  if ! $NO_CACHE && ! $FULL && [[ -n "$LAST_STAMP" && "$CURRENT_STAMP" = "$LAST_STAMP" ]]; then
93
98
  echo "cached-pass=$CURRENT_STAMP"
@@ -135,15 +140,22 @@ for raw_line in text.splitlines():
135
140
  PY
136
141
  }
137
142
 
143
+ if $FIX; then
144
+ run_npm_script_if_present "lint:fix"
145
+ run_npm_script_if_present "format"
146
+ fi
147
+
138
148
  run_npm_script_if_present typecheck
139
149
  run_npm_script_if_present lint
140
150
  run_npm_script_if_present test
141
151
  run_npm_script_if_present build
142
152
 
143
- while IFS= read -r verify_cmd; do
144
- [[ -z "$verify_cmd" ]] && continue
145
- (cd "$PROJECT_ROOT" && bash -lc "$verify_cmd" >/dev/null)
146
- done < <(run_verify_commands)
153
+ if ! $QUICK; then
154
+ while IFS= read -r verify_cmd; do
155
+ [[ -z "$verify_cmd" ]] && continue
156
+ (cd "$PROJECT_ROOT" && bash -lc "$verify_cmd" >/dev/null)
157
+ done < <(run_verify_commands)
158
+ fi
147
159
 
148
160
  mkdir -p "$(dirname "$VERIFY_LOG")"
149
161
  echo "$CURRENT_STAMP $(date -u +%Y-%m-%dT%H:%M:%SZ) PASS" >> "$VERIFY_LOG"
@@ -1,10 +1,11 @@
1
1
  ---
2
2
  name: compaction
3
3
  description: >
4
- Use when context is growing large during long-running tasks and needs server-side or client-side
5
- summarization to continue effectively. Covers compaction triggers, custom summarization patterns,
6
- session handoff, and context preservation strategies.
7
- version: 1.0.0
4
+ Use when context is growing large during long-running tasks and needs
5
+ summarization to continue effectively. Covers compaction triggers, custom
6
+ summarization patterns, session handoff, and context preservation strategies.
7
+ Uses Codex-native /compact command.
8
+ version: 2.0.0
8
9
  tags: [context, workflow]
9
10
  dependencies: []
10
11
  ---
@@ -19,7 +20,6 @@ dependencies: []
19
20
 
20
21
  - Short sessions with low context usage where no compaction is needed.
21
22
 
22
-
23
23
  ## Overview
24
24
 
25
25
  **Compaction = Summarization + Preservation + Continuity**
@@ -32,54 +32,53 @@ Long-running sessions accumulate context (tool outputs, code reads, exploration
32
32
 
33
33
  | Context Usage | Status | Action |
34
34
  | ------------- | ----------- | --------------------------------------------- |
35
- | 0-50% | 🟢 Normal | Work freely |
36
- | 50-70% | 🟡 Watch | Start compressing completed explorations |
37
- | 70-85% | 🟠 Compact | Actively compress and sweep stale noise |
38
- | 85-95% | 🔴 Critical | Emergency compaction, prepare session handoff |
39
- | 95%+ | Limit | Session handoff required |
35
+ | 0-50% | Normal | Work freely |
36
+ | 50-70% | Watch | Start compressing completed explorations |
37
+ | 70-85% | Compact | Actively compress; write summaries to durable files |
38
+ | 85-95% | Critical | Emergency compaction, prepare session handoff |
39
+ | 95%+ | Limit | Session handoff required |
40
40
 
41
41
  ### Monitoring
42
42
 
43
43
  Pay attention to these signals:
44
44
 
45
- - Completed phases accumulating without being compressed
45
+ - Completed phases accumulating without being summarized
46
46
  - Repeated file reads of the same content
47
47
  - Large bash outputs from builds/tests
48
48
  - Multiple exploration rounds without synthesis
49
49
 
50
50
  ## Compaction Strategies
51
51
 
52
- ### Strategy 1: Phase Compression (Preferred)
53
-
54
- Compress completed conversation phases into dense summaries. This is the primary DCP instrument in the installed beta.
52
+ ### Strategy 1: Codex-Native `/compact` (Preferred)
55
53
 
56
-
57
- Compress completed conversation phases into dense summaries.
54
+ Use the built-in `/compact` command to summarize conversation history while preserving key context.
58
55
 
59
56
  ```
60
- WHEN: A research phase is complete and findings are clear
61
- DO: compress({
62
- topic: "Auth Research Complete",
63
- content: {
64
- startString: "unique text at phase start",
65
- endString: "unique text at phase end",
66
- summary: "Complete technical summary of findings..."
67
- }
68
- })
57
+ WHEN: A research or implementation phase is complete
58
+ DO: /compact focus on [completed phase topic]
69
59
  ```
70
60
 
71
- **Key principle**: Only compress CLOSED chapters. Never compress active work.
61
+ The `/compact` command:
62
+ - Summarizes conversation history server-side
63
+ - Preserves key decisions and findings
64
+ - Frees context budget for new work
65
+ - Accepts an optional focus instruction to guide what it preserves
72
66
 
73
- ### Strategy 2: Sweep Stale Noise
67
+ **Key principle**: Only compact CLOSED chapters. Never compact active work.
74
68
 
75
- Use `/dcp sweep` after a phase is complete to remove stale/noisy content automatically.
69
+ ### Strategy 2: Manual Phase Summarization
70
+
71
+ When `/compact` is too broad, manually write a dense summary to a durable file before the context is lost.
76
72
 
77
73
  ```
78
- WHEN: Wrong-target searches or superseded outputs are no longer needed
79
- DO: /dcp sweep
74
+ WHEN: A research phase is complete and findings are clear
75
+ DO:
76
+ 1. Write summary to `.codex/context/worklog.md` or `.codex/memory/research/`
77
+ 2. Record key decisions in `.codex/context/decision-log.md`
78
+ 3. The summarized content can now be safely forgotten by the session
80
79
  ```
81
80
 
82
- **Key principle**: Sweep only after the relevant phase is closed. If in doubt, keep it.
81
+ **Key principle**: Persist durable findings to repo files before they leave the context window.
83
82
 
84
83
  ### Strategy 3: Session Handoff
85
84
 
@@ -88,10 +87,10 @@ When context is too large to compact further, hand off to a new session.
88
87
  ```
89
88
  WHEN: Context > 85% and significant work remains
90
89
  DO:
91
- 1. Create handoff document with memory-update
92
- 2. Save all decisions with observation tool
93
- 3. Document current state and remaining work
94
- 4. Start new session with handoff reference
90
+ 1. Update `.codex/context/session-context.md` with exact stop point
91
+ 2. Update `.codex/memory/project/state.md` with durable state
92
+ 3. Append milestone to `.codex/context/worklog.md`
93
+ 4. Start new session with `/prompts:resume`
95
94
  ```
96
95
 
97
96
  ## Compaction Decision Tree
@@ -100,8 +99,8 @@ DO:
100
99
  Is context growing large?
101
100
  ├── NO → Continue working normally
102
101
  └── YES → What type of content is consuming space?
103
- ├── Completed conversation phases → COMPRESS
104
- ├── Stale/noisy closed-phase outputsSWEEP
102
+ ├── Completed conversation phases → /compact
103
+ ├── Research findings not yet persisted Write to memory/research/, then /compact
105
104
  └── Everything is still relevant → SESSION HANDOFF
106
105
  ```
107
106
 
@@ -150,9 +149,9 @@ Is context growing large?
150
149
 
151
150
  ### Verification
152
151
 
153
- - TypeScript: passing
154
- - Tests: 12/12 passing
155
- - Lint: no issues
152
+ - TypeScript: passing
153
+ - Tests: 12/12 passing
154
+ - Lint: no issues
156
155
 
157
156
  ### Remaining
158
157
 
@@ -187,131 +186,83 @@ Is context growing large?
187
186
 
188
187
  - Added null check in middleware (src/auth/middleware.ts:42)
189
188
  - Added token refresh attempt before rejecting (src/auth/refresh.ts)
190
- - Added test for expired token scenario (src/auth/**tests**/middleware.test.ts)
189
+ - Added test for expired token scenario (src/auth/tests/middleware.test.ts)
191
190
 
192
191
  ### Verification
193
192
 
194
- - Tests: all passing including new test
195
- - Manual: expired token now triggers refresh
193
+ - Tests: all passing including new test
194
+ - Manual: expired token now triggers refresh
196
195
  ```
197
196
 
198
197
  ## Session Handoff Protocol
199
198
 
200
199
  When you must hand off to a new session:
201
200
 
202
- ### 1. Create Handoff Document
201
+ ### 1. Persist Durable Findings
203
202
 
204
- ```typescript
205
- memory -
206
- update({
207
- file: "handoffs/YYYY-MM-DD-feature-name",
208
- content: `# Session Handoff: [Feature Name]
203
+ Write key findings and decisions to the appropriate repo files:
209
204
 
210
- ## Context
211
- [Why this session started, what was the goal]
205
+ - `.codex/context/session-context.md` — exact stop point and first next action
206
+ - `.codex/memory/project/state.md` durable current state and blockers
207
+ - `.codex/context/worklog.md` — milestone summary
208
+ - `.codex/context/decision-log.md` — architecture/workflow decisions with rationale
209
+ - `.codex/memory/research/*.md` — deep investigation notes
212
210
 
213
- ## Completed Work
214
- [What was done, files changed, decisions made]
211
+ ### 2. Create Handoff Summary
215
212
 
216
- ## Current State
217
- [Where things stand right now]
213
+ Use `/prompts:handoff` or write directly to `session-context.md`:
218
214
 
219
- ## Remaining Work
220
- [What still needs to be done]
221
-
222
- ## Key Decisions
223
- [Important choices made and why]
224
-
225
- ## Files Modified
226
- [List of all files changed with brief description]
227
-
228
- ## Gotchas
229
- [Things the next session should know]
230
- `,
231
- mode: "replace",
232
- });
233
- ```
215
+ ```markdown
216
+ ## Resume: [task-id]
234
217
 
235
- ### 2. Save Key Observations
236
-
237
- ```typescript
238
- observation({
239
- type: "decision",
240
- title: "Auth implementation approach",
241
- narrative: "Chose JWT with Redis sessions because...",
242
- facts: "JWT 15min expiry, Redis 24h TTL, bcrypt 12 rounds",
243
- concepts: "authentication, sessions, tokens",
244
- confidence: "high",
245
- });
218
+ - Branch: [branch]
219
+ - Commit: [short hash]
220
+ - Stop point: [exact step in progress]
221
+ - First next action: [single best next action]
222
+ - Blockers: [none or short list]
246
223
  ```
247
224
 
248
225
  ### 3. Resume in New Session
249
226
 
250
- ```typescript
251
- // In new session:
252
- memory - read({ file: "handoffs/YYYY-MM-DD-feature-name" });
253
- memory - search({ query: "auth implementation" });
254
- ```
227
+ ```bash
228
+ # Native Codex resume (thread-based):
229
+ codex resume
255
230
 
256
- ## Integration with DCP Plugin
257
-
258
- This project uses DCP-style context management for always-on context discipline:
259
-
260
- - **compress**: Phase-level conversation compression (primary DCP tool in the installed beta)
261
- - **/dcp sweep**: Cleanup command for stale/noisy content after a phase is complete
262
- - **Prunable-tools list**: Auto-injected into messages with token estimates
263
- - **Nudge system**: Reminders every N tool calls + critical limit warnings
264
-
265
- **Division of responsibility:**
266
-
267
- - **DCP plugin**: Context budget rules, tool guidance, prunable-tools list, nudges (always present via system prompt)
268
- - **Compaction workflow** (`.codex/context/session-context.md` + handoff/resume prompts): Session continuity, beads state, handoff recovery, post-compaction protocol
231
+ # Or file-based resume via Codexkit:
232
+ /prompts:resume [task-id]
233
+ ```
269
234
 
270
235
  ## Anti-Patterns
271
236
 
272
- ### Premature Compaction
273
-
274
- ```
275
- // DON'T compress a file you're about to edit
276
- compress({ ... }) // Loses exact line numbers you need
277
- edit({ ... }) // Now you can't find the right location
278
- ```
237
+ ### Premature Compaction
279
238
 
280
- **Fix**: Keep raw content while actively editing. Compress AFTER the edit phase.
239
+ Don't compact a file you're about to edit — you'll lose exact line numbers. Keep raw content while actively editing. Compact AFTER the edit phase.
281
240
 
282
- ### Compressing Active Work
241
+ ### Compacting Active Work
283
242
 
284
- ```
285
- // DON'T compress a conversation phase you might return to
286
- compress({ summary: "Explored auth options" })
287
- // Later: "Wait, which options did we consider?"
288
- ```
243
+ Don't compact a conversation phase you might return to. Only compact CLOSED chapters where findings are crystallized.
289
244
 
290
- **Fix**: Only compress CLOSED chapters where findings are crystallized.
245
+ ### Ignoring Context Growth
291
246
 
292
- ### Ignoring Context Growth
247
+ Don't let context grow unchecked until hitting limits. By the time you notice, emergency compaction loses information. Monitor regularly and compact at natural breakpoints.
293
248
 
294
- ```
295
- // DON'T let context grow unchecked until hitting limits
296
- // By the time you notice, emergency compaction loses information
297
- ```
249
+ ### Persisting Only to Session Memory
298
250
 
299
- **Fix**: Monitor regularly. Compress at natural breakpoints and use `/dcp sweep` after closed phases.
251
+ Don't rely on session history for durable findings. Write important decisions and state to repo-visible files before compacting, so they survive session boundaries.
300
252
 
301
253
  ## Checklist
302
254
 
303
255
  Before compacting:
304
256
 
305
257
  - [ ] Identified what type of content is consuming context
306
- - [ ] Chosen appropriate strategy (compress/sweep/handoff)
258
+ - [ ] Chosen appropriate strategy (/compact, manual summary, or handoff)
307
259
  - [ ] Verified raw content is no longer needed for active work
308
- - [ ] Captured all key details in the compression summary or handoff
309
- - [ ] Saved important decisions as observations
260
+ - [ ] Persisted key findings to durable repo files
310
261
  - [ ] Created handoff document if switching sessions
311
262
 
312
263
  During long sessions:
313
264
 
314
- - [ ] Compressing completed phases at natural breakpoints
315
- - [ ] Sweeping stale/noisy outputs after phase completion
265
+ - [ ] Running `/compact` at natural phase boundaries
266
+ - [ ] Writing durable findings to context/memory files before they leave the window
316
267
  - [ ] Monitoring context usage trends
317
268
  - [ ] Planning session handoff if approaching limits