wogiflow 2.1.2 → 2.1.3

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.
@@ -297,4 +297,4 @@ flow queue advance
297
297
  3. **Commit after each task** - Progress saved even if interrupted
298
298
  4. **Stop on failure** - If quality gates fail, stop and report
299
299
  5. **Respect dependencies** - Tasks sorted by dependencies then priority
300
- 6. **Context management** - Consider `/wogi-compact` after 3+ tasks
300
+ 6. **Context management** - Consider `/wogi-pre-compact` after 3+ tasks
@@ -41,7 +41,7 @@ WORKFLOW
41
41
  /wogi-health Check all workflow files
42
42
  /wogi-standup Generate standup summary
43
43
  /wogi-session-end End session properly
44
- /wogi-compact Prepare for context compaction
44
+ /wogi-pre-compact Prepare for context compaction
45
45
  /wogi-roadmap Show phase-based roadmap (if enabled)
46
46
 
47
47
  ═══════════════════════════════════════════════════════════════
@@ -1,7 +1,11 @@
1
1
  ---
2
- description: "Compact conversation context using the recursive summary tree"
2
+ description: "Save workflow state before context compaction (pre-compact phase)"
3
3
  ---
4
- Compact the conversation to free up context space using the recursive summary tree.
4
+ Save workflow state (task progress, checkpoints, session context) before context compaction.
5
+
6
+ **Why "pre-compact"**: This skill saves state but cannot trigger `/compact` programmatically — `/compact` is a Claude Code native command that only the user or Claude Code's auto-compaction can invoke. Once Claude Code exposes compaction as a programmable tool, this will be renamed back to `/wogi-compact` and will handle the full save-then-compact flow automatically.
7
+
8
+ **After running this**: Run `/compact` to actually compact the context. The PostCompact hook will restore critical state automatically.
5
9
 
6
10
  ## Recursive Context Compaction
7
11
 
@@ -168,7 +168,7 @@ Skills with documentation are now ready for use.
168
168
 
169
169
  - **Context7 MCP not available**: Skills keep placeholder content. User can retry later.
170
170
  - **Single library fails**: Skip it and continue with remaining libraries.
171
- - **Context getting large**: Suggest `/wogi-compact` between fetches if needed.
171
+ - **Context getting large**: Suggest `/wogi-pre-compact` between fetches if needed.
172
172
 
173
173
  ### Alternative: Install from skills.sh
174
174
 
@@ -21,7 +21,7 @@ This command extracts learnings from recent work and updates relevant skills.
21
21
  This runs automatically on:
22
22
  - **Pre-commit hook** (if hooks enabled)
23
23
  - **Session end** (`/wogi-session-end`)
24
- - **Context compaction** (`/wogi-compact`)
24
+ - **Context compaction** (`/wogi-pre-compact`)
25
25
 
26
26
  Use this command manually when:
27
27
  - You want to extract learnings mid-session
@@ -135,7 +135,7 @@ This is advisory — Claude Code 2.1.72 simplified effort to low/medium/high (re
135
135
 
136
136
  ### Task Checkpoints (when `config.proactiveCompaction.enabled`)
137
137
 
138
- At each phase boundary: save checkpoint to `.workflow/state/task-checkpoint.json` (task ID, phase, completed scenarios, changed files, verification results). If context >= `triggerThreshold` (75%), run `/wogi-compact` before proceeding.
138
+ At each phase boundary: save checkpoint to `.workflow/state/task-checkpoint.json` (task ID, phase, completed scenarios, changed files, verification results). If context >= `triggerThreshold` (75%), run `/wogi-pre-compact` before proceeding.
139
139
 
140
140
  On session resume: check for active checkpoint, reload state, continue from next pending scenario.
141
141
 
@@ -452,7 +452,7 @@ Reflection: "Have I introduced any bugs or regressions?"
452
452
 
453
453
  **Quality gate keeps failing**: Report, attempt fix, after 3 failures suggest `/wogi-debug-hypothesis`.
454
454
 
455
- **Context too large**: When `config.autoCompact.betweenTasks` is true (default), compact AUTOMATICALLY between tasks — do NOT ask the user. Just do it. Mid-task: commit progress, invoke `/wogi-compact` directly (don't suggest — execute).
455
+ **Context too large**: When `config.autoCompact.betweenTasks` is true (default), compact AUTOMATICALLY between tasks — do NOT ask the user. Just do it. Mid-task: commit progress, invoke `/wogi-pre-compact` directly (don't suggest — execute).
456
456
 
457
457
  ## Progress Tracking (MANDATORY for L1+ tasks)
458
458
 
@@ -44,7 +44,7 @@ When user types these commands, execute the corresponding action immediately.
44
44
  | `/wogi-onboard` | Analyze existing project with deep temporal analysis, pattern extraction, and state file generation. |
45
45
  | `/wogi-rescan` | Re-scan project after external changes. Smart diff: auto-adds new items, auto-removes deleted items, presents conflicts one-by-one. Options: `--dry-run`, `--auto-resolve`, `--category`, `--since`. |
46
46
  | `/wogi-morning` | Morning briefing - where you left off, pending tasks, key context, recommended starting task. |
47
- | `/wogi-compact` | Run memory compaction to free context space. Preview with `--preview`. |
47
+ | `/wogi-pre-compact` | Run memory compaction to free context space. Preview with `--preview`. |
48
48
  | `/wogi-debt` | View and manage technical debt across sessions. |
49
49
  | `/wogi-roadmap` | View and manage deferred work items. Add, archive, promote to stories. |
50
50
 
@@ -257,7 +257,7 @@ Context Health:
257
257
  # Or if high:
258
258
  Context Health:
259
259
  Usage: 165,000 / 200,000 tokens (82.5%)
260
- Status: Consider running /wogi-compact
260
+ Status: Consider running /wogi-pre-compact
261
261
  ```
262
262
 
263
263
  ---
@@ -66,7 +66,7 @@ Recommendation: Run /compact before continuing
66
66
  ### Compact When Needed
67
67
 
68
68
  ```bash
69
- /wogi-compact
69
+ /wogi-pre-compact
70
70
  ```
71
71
 
72
72
  ---
@@ -165,7 +165,7 @@ When context is high:
165
165
 
166
166
  | Command | Purpose |
167
167
  |---------|---------|
168
- | `/wogi-compact` | Compact conversation context |
168
+ | `/wogi-pre-compact` | Compact conversation context |
169
169
  | `/wogi-standup` | Morning briefing with context |
170
170
  | `flow session status` | Check session state |
171
171
  | `flow session restore` | Restore previous session |
@@ -92,7 +92,7 @@ Compaction summarizes the conversation to free context space while preserving es
92
92
  ### How to Compact
93
93
 
94
94
  ```bash
95
- /wogi-compact
95
+ /wogi-pre-compact
96
96
  ```
97
97
 
98
98
  ### What's Preserved
@@ -266,7 +266,7 @@ Check \`config.json → commits\` before committing:
266
266
  sections.push(`
267
267
  ## Context Management
268
268
 
269
- Use \`/wogi-compact\` when:
269
+ Use \`/wogi-pre-compact\` when:
270
270
  - After completing 2-3 tasks
271
271
  - After 15-20 messages
272
272
  - Before starting large tasks
@@ -143,7 +143,7 @@ See `.claude/docs/commands.md` for complete command reference.
143
143
  | "project status", "show status", "where are we" | `/wogi-status` |
144
144
  | "check health", "workflow health", "is everything ok" | `/wogi-health` |
145
145
  | "wrap up", "end session", "that's all" | `/wogi-session-end` |
146
- | "compact context", "save context", "running low on context" | `/wogi-compact` |
146
+ | "compact context", "save context", "running low on context" | `/wogi-pre-compact` |
147
147
  | "show roadmap", "what's planned", "future work", "deferred items" | `/wogi-roadmap` |
148
148
  | "debug this", "investigate hypotheses", "competing theories", "parallel debug" | `/wogi-debug-hypothesis` |
149
149
  | "triage findings", "walk through review", "review findings" | `/wogi-triage` |
@@ -274,7 +274,7 @@ Before closing any task, ensure all required gates pass (per `config.json → qu
274
274
 
275
275
  ## Context Management
276
276
 
277
- Use `/wogi-compact` when context is getting large. Before compacting: update progress.md, ensure request-log is current, commit work.
277
+ Use `/wogi-pre-compact` when context is getting large. Before compacting: update progress.md, ensure request-log is current, commit work.
278
278
 
279
279
  ## Continuous Learning
280
280
 
package/README.md CHANGED
@@ -61,7 +61,7 @@ See the [Knowledge Base](.claude/docs/knowledge-base/) for detailed documentatio
61
61
  | **Registries** | `/wogi-map`, `/wogi-map-add`, `/wogi-map-scan`, `/wogi-map-sync`, `/wogi-map-check`, `/wogi-map-index` | Component registry management |
62
62
  | **Rules** | `/wogi-decide`, `/wogi-learn`, `/wogi-rules`, `/wogi-retrospective` | Create rules, promote patterns, session retros |
63
63
  | **Research** | `/wogi-research`, `/wogi-correction` | Zero-trust verification, correction reports |
64
- | **Context** | `/wogi-compact`, `/wogi-context`, `/wogi-suspend`, `/wogi-resume` | Memory management, task context, suspend/resume |
64
+ | **Context** | `/wogi-pre-compact`, `/wogi-context`, `/wogi-suspend`, `/wogi-resume` | Memory management, task context, suspend/resume |
65
65
  | **Capture** | `/wogi-capture`, `/wogi-extract-review`, `/wogi-changelog` | Quick capture, transcript extraction, changelogs |
66
66
  | **Hybrid** | `/wogi-hybrid`, `/wogi-hybrid-setup`, `/wogi-hybrid-edit`, `/wogi-hybrid-off`, `/wogi-hybrid-status` | Local LLM integration |
67
67
  | **Skills** | `/wogi-skills`, `/wogi-skill-learn`, `/wogi-setup-stack` | Skill packages, learning extraction, stack detection |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wogiflow",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "AI-powered development workflow management system with multi-model support",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -291,7 +291,7 @@ function clearAll() {
291
291
  function getSerializedTree(level = 1) {
292
292
  const tree = summaryTree.loadTree();
293
293
  if (!tree) {
294
- return '# No Context Saved\n\nRun /wogi-compact to save session context.';
294
+ return '# No Context Saved\n\nRun /wogi-pre-compact to save session context.';
295
295
  }
296
296
 
297
297
  return summaryTree.serializeTree(tree, level);
@@ -271,10 +271,10 @@ function checkContextHealth() {
271
271
 
272
272
  if (usage >= config.criticalAt) {
273
273
  status = 'critical';
274
- recommendation = 'Run /wogi-compact NOW to avoid context overflow';
274
+ recommendation = 'Run /wogi-pre-compact NOW to avoid context overflow';
275
275
  } else if (usage >= config.warnAt) {
276
276
  status = 'warning';
277
- recommendation = 'Consider running /wogi-compact soon';
277
+ recommendation = 'Consider running /wogi-pre-compact soon';
278
278
  } else {
279
279
  status = 'healthy';
280
280
  recommendation = null;
@@ -99,7 +99,7 @@ const ROOT_CAUSE_CATEGORIES = {
99
99
  },
100
100
  CONTEXT_OVERFLOW: {
101
101
  ...FailureCategory.CONTEXT_OVERFLOW,
102
- suggestion: 'Use /wogi-compact before large tasks',
102
+ suggestion: 'Use /wogi-pre-compact before large tasks',
103
103
  targetFile: 'config.json'
104
104
  },
105
105
  CAPABILITY_MISMATCH: {
@@ -68,7 +68,7 @@ function getProactiveCompactionConfig() {
68
68
  * Check whether proactive compaction should trigger at a phase boundary.
69
69
  *
70
70
  * This is called by /wogi-start at each phase transition.
71
- * The actual compaction is performed by the AI agent using /wogi-compact.
71
+ * The actual compaction is performed by the AI agent using /wogi-pre-compact.
72
72
  *
73
73
  * @param {Object} params - Check parameters
74
74
  * @param {string} params.phase - The phase that just completed
@@ -161,7 +161,7 @@ async function handlePhaseBoundary(params) {
161
161
 
162
162
  /**
163
163
  * Generate a compaction summary for the current task state.
164
- * Used by /wogi-compact when proactive compaction triggers.
164
+ * Used by /wogi-pre-compact when proactive compaction triggers.
165
165
  *
166
166
  * @param {Object} checkpoint - Current checkpoint data
167
167
  * @returns {string} Formatted compaction summary
@@ -253,7 +253,7 @@ function formatCompactionMessage(result, contextPercent) {
253
253
  lines.push(`Context at ${pct}%. Compacting before next phase...`);
254
254
  lines.push(`Reason: ${result.reason}`);
255
255
  lines.push('');
256
- lines.push('Task state has been checkpointed. Run /wogi-compact to compact now.');
256
+ lines.push('Task state has been checkpointed. Run /wogi-pre-compact to compact now.');
257
257
  lines.push('After compaction, read task-checkpoint.json to restore context.');
258
258
 
259
259
  return lines.join('\n');
@@ -112,6 +112,38 @@ function handlePostCompact() {
112
112
  }
113
113
  }
114
114
 
115
+ // 5. Check for auto-compaction circuit breaker state (Claude Code 2.1.76+)
116
+ // Claude Code stops auto-compaction after 3 consecutive failures.
117
+ // If we detect repeated compactions in quick succession, warn about potential issues.
118
+ try {
119
+ const path = require('node:path');
120
+ const fs = require('node:fs');
121
+ const { PATHS, safeJsonParse } = require('../../flow-utils');
122
+ const compactStatePath = path.join(PATHS.state, '.compact-tracker.json');
123
+ const tracker = safeJsonParse(compactStatePath, { count: 0, lastAt: null });
124
+ const now = Date.now();
125
+ const lastAt = tracker.lastAt ? new Date(tracker.lastAt).getTime() : 0;
126
+ const timeSinceLast = now - lastAt;
127
+
128
+ // If compaction happened less than 2 minutes ago, increment counter
129
+ if (timeSinceLast < 2 * 60 * 1000 && lastAt > 0) {
130
+ tracker.count = (tracker.count || 0) + 1;
131
+ } else {
132
+ tracker.count = 1;
133
+ }
134
+ tracker.lastAt = new Date().toISOString();
135
+
136
+ fs.writeFileSync(compactStatePath, JSON.stringify(tracker, null, 2));
137
+
138
+ if (tracker.count >= 3) {
139
+ contextParts.push('**WARNING**: Multiple compactions detected in quick succession. Claude Code 2.1.76+ stops auto-compaction after 3 consecutive failures. If context keeps growing, consider starting a new session or committing progress and using `/wogi-pre-compact`.');
140
+ }
141
+ } catch (err) {
142
+ if (process.env.DEBUG) {
143
+ console.error(`[post-compact] Compact tracker failed: ${err.message}`);
144
+ }
145
+ }
146
+
115
147
  // Build the result
116
148
  if (contextParts.length === 0) {
117
149
  return {