wogiflow 2.1.2 → 2.2.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/.claude/commands/wogi-audit.md +189 -3
- package/.claude/commands/wogi-bulk.md +1 -1
- package/.claude/commands/wogi-help.md +1 -1
- package/.claude/commands/{wogi-compact.md → wogi-pre-compact.md} +6 -2
- package/.claude/commands/wogi-review.md +86 -13
- package/.claude/commands/wogi-setup-stack.md +1 -1
- package/.claude/commands/wogi-skill-learn.md +1 -1
- package/.claude/commands/wogi-start.md +65 -20
- package/.claude/docs/claude-code-compatibility.md +28 -0
- package/.claude/docs/commands.md +1 -1
- package/.claude/docs/knowledge-base/02-task-execution/04-completion.md +1 -1
- package/.claude/docs/knowledge-base/04-memory-context/README.md +2 -2
- package/.claude/docs/knowledge-base/04-memory-context/context-management.md +1 -1
- package/.claude/rules/_internal/README.md +64 -0
- package/.claude/rules/_internal/document-structure.md +77 -0
- package/.claude/rules/_internal/dual-repo-management.md +174 -0
- package/.claude/rules/_internal/feature-refactoring-cleanup.md +87 -0
- package/.claude/rules/_internal/github-releases.md +71 -0
- package/.claude/rules/_internal/model-management.md +35 -0
- package/.claude/rules/_internal/self-maintenance.md +87 -0
- package/.claude/rules/architecture/component-reuse.md +38 -0
- package/.claude/rules/code-style/naming-conventions.md +52 -0
- package/.claude/rules/operations/git-workflows.md +92 -0
- package/.claude/rules/operations/scratch-directory.md +54 -0
- package/.claude/rules/security/security-patterns.md +176 -0
- package/.claude/skills/figma-analyzer/knowledge/learnings.md +11 -0
- package/.workflow/bridges/claude-bridge.js +1 -1
- package/.workflow/models/registry.json +1 -1
- package/.workflow/specs/architecture.md.template +24 -0
- package/.workflow/specs/stack.md.template +33 -0
- package/.workflow/specs/testing.md.template +36 -0
- package/.workflow/templates/claude-md.hbs +33 -3
- package/README.md +1 -1
- package/package.json +1 -1
- package/scripts/flow-audit.js +158 -1
- package/scripts/flow-context-compact/index.js +1 -1
- package/scripts/flow-context-monitor.js +2 -2
- package/scripts/flow-loop-retry-learning.js +1 -1
- package/scripts/flow-proactive-compact.js +3 -3
- package/scripts/flow-progress-tracker.js +289 -0
- package/scripts/flow-prompt-capture.js +263 -170
- package/scripts/flow-standards-learner.js +167 -3
- package/scripts/flow-task-checkpoint.js +2 -0
- package/scripts/flow-version-check.js +1 -0
- package/scripts/hooks/core/commit-log-gate.js +146 -0
- package/scripts/hooks/core/post-compact.js +109 -4
- package/scripts/hooks/core/task-completed.js +19 -0
- package/scripts/hooks/entry/claude-code/post-tool-use.js +60 -0
- package/scripts/hooks/entry/claude-code/pre-tool-use.js +27 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
alwaysApply: true
|
|
3
|
+
description: "Git workflow rules for merge conflicts, conventional commits, and branch management"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git Workflow Rules
|
|
7
|
+
|
|
8
|
+
## Merge Conflict Resolution
|
|
9
|
+
|
|
10
|
+
When encountering merge conflicts:
|
|
11
|
+
|
|
12
|
+
1. **Understand both sides** before resolving. Read the full context of both changes.
|
|
13
|
+
2. **Prefer the newer implementation** when both sides modify the same logic, unless the older version has test coverage the newer lacks.
|
|
14
|
+
3. **Never silently discard changes** — if unsure, ask the user which side to keep.
|
|
15
|
+
4. **After resolving**: Run lint and typecheck on resolved files before committing.
|
|
16
|
+
5. **Conflict markers**: If you see `<<<<<<<`, `=======`, `>>>>>>>` in any file, resolve them before any other work.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Check for unresolved conflicts
|
|
20
|
+
git diff --check
|
|
21
|
+
|
|
22
|
+
# After resolving
|
|
23
|
+
git add <resolved-files>
|
|
24
|
+
git commit -m "fix: resolve merge conflicts in <description>"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Conventional Commit Format
|
|
28
|
+
|
|
29
|
+
All commits MUST use conventional commit format:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
<type>(<scope>): <description>
|
|
33
|
+
|
|
34
|
+
[optional body]
|
|
35
|
+
|
|
36
|
+
[optional footer]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Types
|
|
40
|
+
|
|
41
|
+
| Type | When to use |
|
|
42
|
+
|------|------------|
|
|
43
|
+
| `feat` | New feature or capability |
|
|
44
|
+
| `fix` | Bug fix |
|
|
45
|
+
| `docs` | Documentation only |
|
|
46
|
+
| `style` | Formatting, whitespace (no logic change) |
|
|
47
|
+
| `refactor` | Code change that neither fixes a bug nor adds a feature |
|
|
48
|
+
| `perf` | Performance improvement |
|
|
49
|
+
| `test` | Adding or updating tests |
|
|
50
|
+
| `chore` | Build process, tooling, dependencies |
|
|
51
|
+
|
|
52
|
+
### Examples
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
feat(hooks): add InstructionsLoaded hook for rule conflict detection
|
|
56
|
+
fix(routing): clear routing flag when user invokes /wogi-* commands
|
|
57
|
+
docs(readme): update installation instructions for v1.8
|
|
58
|
+
refactor(bridge): extract hash comparison to shared utility
|
|
59
|
+
chore(deps): bump eslint to v9.x
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Scope
|
|
63
|
+
|
|
64
|
+
Use the module or feature area: `hooks`, `bridge`, `routing`, `skills`, `plugins`, `config`, `cli`, `docs`.
|
|
65
|
+
|
|
66
|
+
## Pre-Commit Review
|
|
67
|
+
|
|
68
|
+
Before committing, always:
|
|
69
|
+
1. Run `git diff --staged` to review what you're about to commit
|
|
70
|
+
2. Verify no secrets, credentials, or `.env` files are staged
|
|
71
|
+
3. Verify no debug/console.log statements left in production code
|
|
72
|
+
4. Run validation (lint, typecheck) on changed files
|
|
73
|
+
|
|
74
|
+
## Stash Usage
|
|
75
|
+
|
|
76
|
+
Use `git stash` when:
|
|
77
|
+
- Switching context to a different task mid-work
|
|
78
|
+
- Pulling changes that might conflict with local work
|
|
79
|
+
- Testing something on a clean working tree
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
git stash push -m "WIP: description of work" # Save with message
|
|
83
|
+
git stash pop # Restore and remove
|
|
84
|
+
git stash list # See all stashes
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Branch Naming
|
|
88
|
+
|
|
89
|
+
When creating branches (outside worktrees):
|
|
90
|
+
- Feature: `feat/<short-description>`
|
|
91
|
+
- Bugfix: `fix/<short-description>`
|
|
92
|
+
- WogiFlow worktrees use `wogi-task-<taskId>` automatically
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
alwaysApply: true
|
|
3
|
+
description: "Temp files, prompts, instructions, and scratch content must go in .workflow/scratch/"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Scratch Directory for Temporary Files
|
|
7
|
+
|
|
8
|
+
## Rule
|
|
9
|
+
|
|
10
|
+
When creating temporary, scratch, or ephemeral files — such as prompts for other projects, instructions, notes, drafts, exported configs, or any content that is NOT a permanent part of the codebase — **always write them to `.workflow/scratch/`**.
|
|
11
|
+
|
|
12
|
+
## Why
|
|
13
|
+
|
|
14
|
+
Without this rule, Claude creates .md files, .txt files, and other scratch content in random locations (project root, src/, docs/, etc.). This pollutes the project with files that:
|
|
15
|
+
- Have no designated location, so users don't know where to find them
|
|
16
|
+
- Don't get cleaned up, accumulating over time
|
|
17
|
+
- May accidentally get committed to version control
|
|
18
|
+
- Make `git status` noisy with untracked files
|
|
19
|
+
|
|
20
|
+
## How
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
// Use PATHS.scratch for temp file locations
|
|
24
|
+
const { PATHS } = require('./flow-paths');
|
|
25
|
+
const outputPath = path.join(PATHS.scratch, 'my-temp-file.md');
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or in natural language: "Save this to `.workflow/scratch/filename.md`"
|
|
29
|
+
|
|
30
|
+
## Auto-Cleanup
|
|
31
|
+
|
|
32
|
+
The `.workflow/scratch/` directory is **automatically cleaned at session end** by the session-end hook. Files in this directory are ephemeral — they survive the current session but are removed when the session ends.
|
|
33
|
+
|
|
34
|
+
If a file needs to persist beyond a session, it belongs somewhere else:
|
|
35
|
+
- Specs → `.workflow/specs/`
|
|
36
|
+
- Changes → `.workflow/changes/`
|
|
37
|
+
- Documentation → project docs directory
|
|
38
|
+
- Configuration → `.workflow/` root
|
|
39
|
+
|
|
40
|
+
## What Goes in Scratch
|
|
41
|
+
|
|
42
|
+
- Prompts or instructions generated for other projects
|
|
43
|
+
- Draft content being reviewed before placement
|
|
44
|
+
- Temporary analysis output
|
|
45
|
+
- Export/import staging files
|
|
46
|
+
- Any file the user explicitly asks to "save somewhere" without specifying a location
|
|
47
|
+
|
|
48
|
+
## What Does NOT Go in Scratch
|
|
49
|
+
|
|
50
|
+
- Task specs (use `.workflow/specs/` or `.workflow/changes/`)
|
|
51
|
+
- Configuration files (use `.workflow/`)
|
|
52
|
+
- Source code (use the project's source directories)
|
|
53
|
+
- Documentation (use the project's docs directory)
|
|
54
|
+
- State files (use `.workflow/state/`)
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
alwaysApply: true
|
|
3
|
+
description: "Security patterns for file operations, JSON parsing, and path handling"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Security Patterns
|
|
7
|
+
|
|
8
|
+
Critical security patterns for this project.
|
|
9
|
+
|
|
10
|
+
## 1. File Read Safety
|
|
11
|
+
|
|
12
|
+
Always wrap `fs.readFileSync()` in try-catch, even after `fileExists()` check.
|
|
13
|
+
|
|
14
|
+
**Reason**: Race conditions, permission changes, symlink issues can still cause failures.
|
|
15
|
+
|
|
16
|
+
```javascript
|
|
17
|
+
// Good
|
|
18
|
+
try {
|
|
19
|
+
const content = fs.readFileSync(path, 'utf-8');
|
|
20
|
+
} catch (err) {
|
|
21
|
+
// Handle gracefully
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Bad - can still throw even if file existed
|
|
25
|
+
if (fs.existsSync(path)) {
|
|
26
|
+
const content = fs.readFileSync(path, 'utf-8');
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 2. JSON Parsing Safety
|
|
31
|
+
|
|
32
|
+
Use `safeJsonParse()` from flow-utils.js instead of raw `JSON.parse()`.
|
|
33
|
+
|
|
34
|
+
- Check for `__proto__`, `constructor`, `prototype` injection
|
|
35
|
+
- Validate parsed structure has expected fields before use
|
|
36
|
+
- Located in: `scripts/flow-utils.js`
|
|
37
|
+
|
|
38
|
+
```javascript
|
|
39
|
+
// Good
|
|
40
|
+
const config = safeJsonParse(filePath, {});
|
|
41
|
+
|
|
42
|
+
// Bad - vulnerable to prototype pollution
|
|
43
|
+
const config = JSON.parse(fs.readFileSync(filePath));
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 3. Template Substitution Safety
|
|
47
|
+
|
|
48
|
+
When implementing template substitution:
|
|
49
|
+
- Block access to `__proto__`, `constructor`, `prototype` keys
|
|
50
|
+
- Use `Object.prototype.hasOwnProperty.call()` for property access
|
|
51
|
+
- Example: See `applyTemplate()` in flow-prompt-composer.js
|
|
52
|
+
|
|
53
|
+
## 4. Path Safety
|
|
54
|
+
|
|
55
|
+
- Validate patterns before `path.join()` with user/config data
|
|
56
|
+
- Use `isPathWithinProject()` for defense-in-depth
|
|
57
|
+
- Glob-to-regex: Use `[^/]*` not `.*` to prevent path separator matching
|
|
58
|
+
|
|
59
|
+
```javascript
|
|
60
|
+
// Good
|
|
61
|
+
if (!isPathWithinProject(targetPath)) {
|
|
62
|
+
throw new Error('Path outside project');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Bad - allows path traversal
|
|
66
|
+
const fullPath = path.join(baseDir, userInput);
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## 5. Module Dependencies
|
|
70
|
+
|
|
71
|
+
- Check for circular dependencies when refactoring shared functions
|
|
72
|
+
- Node.js handles circular deps but can cause undefined exports during load
|
|
73
|
+
|
|
74
|
+
## 6. Claude Code Permission Patterns (2.1.7+)
|
|
75
|
+
|
|
76
|
+
When configuring permission rules in Claude Code, avoid overly permissive wildcards.
|
|
77
|
+
|
|
78
|
+
**Vulnerability fixed in 2.1.7**: Wildcard permission rules could match compound commands containing shell operators (`;`, `&&`, `||`, `|`).
|
|
79
|
+
|
|
80
|
+
**Destructive git commands** must NOT be auto-allowed. WogiFlow's `generateSettings()` scopes these to safe variants:
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
// DANGEROUS - auto-allows destructive operations
|
|
84
|
+
"allow": "Bash(git reset *)" // matches git reset --hard
|
|
85
|
+
"allow": "Bash(git restore *)" // matches git restore . (discard all)
|
|
86
|
+
"allow": "Bash(git clean *)" // matches git clean -f
|
|
87
|
+
|
|
88
|
+
// SAFE - only non-destructive variants auto-allowed
|
|
89
|
+
"allow": "Bash(git reset HEAD *)" // unstage files only
|
|
90
|
+
"allow": "Bash(git reset --soft *)" // soft reset, preserves changes
|
|
91
|
+
"allow": "Bash(git restore --staged *)" // unstage files only
|
|
92
|
+
// git reset --hard, git restore ., git clean -f require manual approval
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Best practices:**
|
|
96
|
+
- Scope destructive commands to safe variants instead of blanket wildcards
|
|
97
|
+
- `git reset --hard`, `git restore .`, `git clean -f` should always require user approval
|
|
98
|
+
- Prefer semantic permission prompts over literal command matching
|
|
99
|
+
- Never allow broad patterns like `rm *` or `git *`
|
|
100
|
+
- Review permission rules after Claude Code updates
|
|
101
|
+
|
|
102
|
+
## 7. Windows Path Safety
|
|
103
|
+
|
|
104
|
+
On Windows, be aware of path-related issues:
|
|
105
|
+
|
|
106
|
+
- Temp directory paths may contain characters like `\t` or `\n` that could be misinterpreted as escape sequences
|
|
107
|
+
- Use raw strings or proper escaping when constructing paths
|
|
108
|
+
- Cloud sync tools (OneDrive, Dropbox) and antivirus may touch file timestamps without changing content
|
|
109
|
+
|
|
110
|
+
```javascript
|
|
111
|
+
// Good - use path.join() which handles platform differences
|
|
112
|
+
const tempPath = path.join(os.tmpdir(), 'myfile.txt');
|
|
113
|
+
|
|
114
|
+
// Bad - manual concatenation can break on Windows
|
|
115
|
+
const tempPath = os.tmpdir() + '/myfile.txt';
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## 8. Shell Command Parameter Validation
|
|
119
|
+
|
|
120
|
+
When executing shell commands with dynamic parameters, always validate inputs.
|
|
121
|
+
|
|
122
|
+
**Risk**: Command injection via unvalidated parameters passed to execSync/spawn.
|
|
123
|
+
|
|
124
|
+
```javascript
|
|
125
|
+
// DANGEROUS - lang parameter not validated
|
|
126
|
+
execSync(`sg --pattern "${pattern}" --lang ${lang} --json "${path}"`);
|
|
127
|
+
|
|
128
|
+
// SAFER - validate against whitelist
|
|
129
|
+
const ALLOWED_LANGUAGES = new Set(['typescript', 'javascript', 'python', 'go']);
|
|
130
|
+
if (!ALLOWED_LANGUAGES.has(lang)) {
|
|
131
|
+
throw new Error(`Unsupported language: ${lang}`);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// BEST - use execFile with array arguments (no shell interpretation)
|
|
135
|
+
const { execFileSync } = require('child_process');
|
|
136
|
+
execFileSync('sg', ['--pattern', pattern, '--lang', lang, '--json', path]);
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Best practices:**
|
|
140
|
+
- Validate all dynamic parameters against allowlists
|
|
141
|
+
- Prefer `execFile`/`execFileSync` with array arguments over `exec`/`execSync` with template strings
|
|
142
|
+
- When using template strings, escape all user-controlled values
|
|
143
|
+
- Never interpolate user input directly into shell commands
|
|
144
|
+
|
|
145
|
+
## 9. Temp Directory Isolation (Claude Code 2.1.23+)
|
|
146
|
+
|
|
147
|
+
On shared systems (CI servers, multi-user machines), use per-user temp directories to prevent permission conflicts.
|
|
148
|
+
|
|
149
|
+
**Fixed in Claude Code 2.1.23**: Per-user temp directory isolation prevents permission conflicts.
|
|
150
|
+
|
|
151
|
+
```javascript
|
|
152
|
+
// Good - per-user isolation
|
|
153
|
+
const userId = process.getuid?.() ?? process.env.USER ?? process.env.USERNAME ?? 'default';
|
|
154
|
+
const tempDir = path.join(os.tmpdir(), `myapp-${userId}`);
|
|
155
|
+
|
|
156
|
+
// Bad - global temp path on shared systems
|
|
157
|
+
const tempDir = path.join(os.tmpdir(), 'myapp');
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Best practices:**
|
|
161
|
+
- Use UID on Unix systems (`process.getuid()`)
|
|
162
|
+
- Fall back to username environment variables on Windows
|
|
163
|
+
- Always provide a 'default' fallback for edge cases
|
|
164
|
+
- This pattern is used in `flow-worktree.js` for worktree isolation
|
|
165
|
+
|
|
166
|
+
## 10. Search/Grep Timeout Handling (Claude Code 2.1.23+)
|
|
167
|
+
|
|
168
|
+
**Fixed in Claude Code 2.1.23**: Ripgrep search timeouts now report errors instead of silently returning empty results.
|
|
169
|
+
|
|
170
|
+
**Impact on WogiFlow:** Component detection, auto-context loading, and pattern matching rely on search operations. Before 2.1.23, search timeouts could cause false negatives.
|
|
171
|
+
|
|
172
|
+
**Best practices:**
|
|
173
|
+
- Handle empty search results gracefully - they may indicate timeout
|
|
174
|
+
- Add retry logic for search-dependent operations
|
|
175
|
+
- Log warnings when searches return unexpectedly empty
|
|
176
|
+
- Consider fallback strategies (glob-based search if grep fails)
|
|
@@ -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
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
## Pattern
|
|
4
|
+
|
|
5
|
+
<!-- Detected during onboarding -->
|
|
6
|
+
<!-- Examples: MVC, Clean Architecture, DDD, Microservices, Monolith -->
|
|
7
|
+
|
|
8
|
+
## Structure
|
|
9
|
+
|
|
10
|
+
<!-- Project structure overview -->
|
|
11
|
+
<!-- Key directories and their purposes -->
|
|
12
|
+
|
|
13
|
+
## Key Decisions
|
|
14
|
+
|
|
15
|
+
<!-- Architecture decisions made for this project -->
|
|
16
|
+
<!-- Trade-offs and rationale -->
|
|
17
|
+
|
|
18
|
+
## Dependencies
|
|
19
|
+
|
|
20
|
+
<!-- Major dependencies and their purposes -->
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
*This file is auto-populated during `flow onboard`. Update manually as architecture evolves.*
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Tech Stack
|
|
2
|
+
|
|
3
|
+
## Framework
|
|
4
|
+
|
|
5
|
+
<!-- Primary framework (e.g., Next.js, NestJS, FastAPI) -->
|
|
6
|
+
|
|
7
|
+
## Language
|
|
8
|
+
|
|
9
|
+
<!-- Primary language (e.g., TypeScript, Python, Go) -->
|
|
10
|
+
|
|
11
|
+
## Database
|
|
12
|
+
|
|
13
|
+
<!-- Database system if applicable (e.g., PostgreSQL, MongoDB) -->
|
|
14
|
+
|
|
15
|
+
## Package Manager
|
|
16
|
+
|
|
17
|
+
<!-- npm, yarn, pnpm, pip, etc. -->
|
|
18
|
+
|
|
19
|
+
## Build Tools
|
|
20
|
+
|
|
21
|
+
<!-- Build and bundling tools (e.g., Vite, Webpack, esbuild) -->
|
|
22
|
+
|
|
23
|
+
## Testing
|
|
24
|
+
|
|
25
|
+
<!-- Test frameworks (e.g., Jest, Vitest, pytest) -->
|
|
26
|
+
|
|
27
|
+
## Other Tools
|
|
28
|
+
|
|
29
|
+
<!-- Linters, formatters, CI/CD tools -->
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
*This file is auto-populated during `flow onboard`. Update manually as stack evolves.*
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Testing
|
|
2
|
+
|
|
3
|
+
## Test Framework
|
|
4
|
+
|
|
5
|
+
<!-- Primary test framework (e.g., Jest, Vitest, pytest) -->
|
|
6
|
+
|
|
7
|
+
## Test Commands
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Run all tests
|
|
11
|
+
npm test
|
|
12
|
+
|
|
13
|
+
# Run tests in watch mode
|
|
14
|
+
npm run test:watch
|
|
15
|
+
|
|
16
|
+
# Run specific test file
|
|
17
|
+
npm test -- path/to/test.ts
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Test Structure
|
|
21
|
+
|
|
22
|
+
<!-- Where tests are located -->
|
|
23
|
+
<!-- Naming conventions -->
|
|
24
|
+
|
|
25
|
+
## Coverage
|
|
26
|
+
|
|
27
|
+
<!-- Coverage requirements if any -->
|
|
28
|
+
<!-- Coverage commands -->
|
|
29
|
+
|
|
30
|
+
## E2E Testing
|
|
31
|
+
|
|
32
|
+
<!-- E2E framework if used (e.g., Playwright, Cypress) -->
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
*This file is auto-populated during `flow onboard`. Update manually as testing strategy evolves.*
|
|
@@ -142,8 +142,8 @@ See `.claude/docs/commands.md` for complete command reference.
|
|
|
142
142
|
| "show tasks", "what's ready", "available tasks" | `/wogi-ready` |
|
|
143
143
|
| "project status", "show status", "where are we" | `/wogi-status` |
|
|
144
144
|
| "check health", "workflow health", "is everything ok" | `/wogi-health` |
|
|
145
|
-
| "wrap up", "end session", "that's all" | `/wogi-session-end` |
|
|
146
|
-
| "compact context", "save context", "running low on context" | `/wogi-compact` |
|
|
145
|
+
| "wrap up", "end session", "that's all" | `/wogi-session-end` (**intent-check required** — see note below) |
|
|
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` |
|
|
@@ -162,6 +162,14 @@ See `.claude/docs/commands.md` for complete command reference.
|
|
|
162
162
|
|
|
163
163
|
**IMPORTANT**: When a user's message matches one of these patterns, immediately invoke the Skill tool with the corresponding command. Do not ask for confirmation. These `/wogi-*` commands satisfy the mandatory routing requirement — you do NOT also need to invoke `/wogi-start` when a detection match exists. `/wogi-start` is the fallback for messages that don't match this table.
|
|
164
164
|
|
|
165
|
+
**Session-end intent check**: `/wogi-session-end` requires extra care. Phrases like "wrap up", "that's all", "let's finish with this" often mean "finish this topic" not "end the entire session." Only invoke `/wogi-session-end` when the user clearly intends to **stop working entirely** — not when they're concluding one topic before moving to another. Examples:
|
|
166
|
+
- "that's all for today, thanks" → session-end (clear finality)
|
|
167
|
+
- "let's wrap up this task and move on to the auth bug" → NOT session-end (continuing work)
|
|
168
|
+
- "I'm done" → session-end (if no follow-up topic mentioned)
|
|
169
|
+
- "let's finish with that and then do X" → NOT session-end (next topic follows)
|
|
170
|
+
|
|
171
|
+
When in doubt, route through `/wogi-start` which will classify correctly.
|
|
172
|
+
|
|
165
173
|
## CRITICAL: Universal Entry Point — ALL Requests
|
|
166
174
|
|
|
167
175
|
**ALL user messages MUST go through a `/wogi-*` command. No direct handling. No self-classification.**
|
|
@@ -274,7 +282,29 @@ Before closing any task, ensure all required gates pass (per `config.json → qu
|
|
|
274
282
|
|
|
275
283
|
## Context Management
|
|
276
284
|
|
|
277
|
-
|
|
285
|
+
Context compaction happens automatically — WogiFlow persists all critical state to disk continuously, and the PostCompact hook restores it after compaction. You do NOT need to manually run `/wogi-pre-compact` before compaction.
|
|
286
|
+
|
|
287
|
+
**What survives compaction automatically** (via PostCompact hook + state files):
|
|
288
|
+
- Active task ID, title, type, and acceptance criteria
|
|
289
|
+
- Which criteria are completed vs pending (from durable-session.json)
|
|
290
|
+
- Current workflow phase
|
|
291
|
+
- Changed files list (from task-checkpoint.json)
|
|
292
|
+
- Last request-log entry number
|
|
293
|
+
- Routing enforcement (re-armed automatically)
|
|
294
|
+
|
|
295
|
+
**`/wogi-pre-compact` is optional** — use it only when you want a detailed summary for a very long session. It is NOT required for state safety.
|
|
296
|
+
|
|
297
|
+
**For L1+ tasks**: The pre-task context estimator (Step 0.25) checks if the task fits in remaining context. If it doesn't → compact BEFORE starting to avoid mid-task compaction.
|
|
298
|
+
|
|
299
|
+
## Compact Instructions
|
|
300
|
+
|
|
301
|
+
When compacting this conversation, preserve the following WogiFlow state:
|
|
302
|
+
- The current task ID and title from `.workflow/state/ready.json` inProgress array
|
|
303
|
+
- Which acceptance criteria are done vs pending
|
|
304
|
+
- The current workflow phase (routing, exploring, coding, validating, completing)
|
|
305
|
+
- The list of files changed in this session
|
|
306
|
+
- Any spec decisions or architectural choices made during this session
|
|
307
|
+
- Read `.workflow/state/task-checkpoint.json` after compaction for full state recovery
|
|
278
308
|
|
|
279
309
|
## Continuous Learning
|
|
280
310
|
|
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 |
|