@cluesmith/codev 2.1.2 → 2.1.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.
@@ -1,98 +1,96 @@
1
1
  ---
2
2
  name: consult
3
- description: AI consultation CLI quick reference. Use when running consult commands to check syntax for general queries, protocol reviews, and stats across Gemini, Codex, and Claude.
4
- disable-model-invocation: false
3
+ description: AI consultation CLI query Gemini, Codex, or Claude for reviews and analysis. ALWAYS check this skill before running any `consult` command. Use when reviewing specs, plans, implementations, or PRs with external models, running parallel 3-way reviews (cmap), or checking consultation stats. The `-m` model flag is always required except for `consult stats`.
5
4
  ---
6
5
 
7
6
  # consult - AI Consultation CLI
8
7
 
8
+ Query external AI models for reviews and analysis. Supports Gemini, Codex, and Claude.
9
+
9
10
  ## Synopsis
10
11
 
11
- ```bash
12
+ ```
12
13
  consult -m <model> [options]
13
14
  consult stats [options]
14
15
  ```
15
16
 
16
- The `-m` / `--model` flag is **always required** (except for stats).
17
+ The `-m` / `--model` flag is **always required** except for `consult stats`.
17
18
 
18
19
  ## Models
19
20
 
20
- | Model | Alias | Speed | Approach |
21
- |-------|-------|-------|----------|
22
- | `gemini` | `pro` | ~120-150s | File access via --yolo, fast |
23
- | `codex` | `gpt` | ~200-250s | Shell command exploration, thorough |
24
- | `claude` | `opus` | ~60-120s | Agent SDK with tool use |
25
-
26
- ## Modes
27
-
28
- ### General Mode
29
- ```bash
30
- consult -m gemini --prompt "What's the best way to structure auth?"
31
- consult -m codex --prompt-file review-checklist.md
32
- ```
21
+ | Flag value | Alias | Notes |
22
+ |------------|-------|-------|
23
+ | `gemini` | `pro` | Fast (~120-150s), file access via --yolo |
24
+ | `codex` | `gpt` | Thorough (~200-250s), shell exploration |
25
+ | `claude` | `opus` | Agent SDK with tool use (~60-120s) |
33
26
 
34
- ### Protocol Mode
35
- ```bash
36
- consult -m gemini --protocol spir --type spec # Review a specification
37
- consult -m codex --protocol spir --type plan # Review a plan
38
- consult -m claude --protocol spir --type impl # Review implementation
39
- consult -m gemini --protocol spir --type pr # Review a PR
40
- consult -m codex --protocol spir --type phase # Phase-scoped review
41
- consult -m gemini --type integration # Integration review
42
- ```
27
+ ## All flags
43
28
 
44
- ### Stats Mode
45
- ```bash
46
- consult stats # 30-day summary
47
- consult stats --days 7 --json # Last 7 days as JSON
48
29
  ```
49
-
50
- ## Options
51
-
52
- ```bash
53
- -m, --model <model> # Model to use (required except stats)
54
- --prompt <text> # Inline prompt (general mode)
55
- --prompt-file <path> # Prompt from file (general mode)
56
- --protocol <name> # Protocol: spir, bugfix, tick, maintain
57
- -t, --type <type> # Review type: spec, plan, impl, pr, phase, integration
58
- --issue <number> # Issue number (architect context)
30
+ -m, --model <model> Model to use (required except stats)
31
+ --prompt <text> Inline prompt (general mode)
32
+ --prompt-file <path> Prompt file path (general mode)
33
+ --protocol <name> Protocol: spir, aspir, air, bugfix, tick, maintain
34
+ -t, --type <type> Review type (see below)
35
+ --issue <number> Issue number (required in architect context)
36
+ --output <path> Save result to file
37
+ --plan-phase <phase> Scope review to a plan phase (porch use)
38
+ --context <path> Context file with feedback (porch use)
39
+ --project-id <id> Project ID for metrics (porch use)
40
+ --days <n> Stats: limit to last N days (default: 30)
41
+ --project <id> Stats: filter by project ID
42
+ --last <n> Stats: show last N invocations
43
+ --json Stats: output as JSON
59
44
  ```
60
45
 
61
- ## Review Types (--type with --protocol)
46
+ ## Review types (`--type`)
62
47
 
63
- | Type | Use Case |
64
- |------|----------|
65
- | `spec` | Review specification completeness |
66
- | `plan` | Review implementation plan |
48
+ | Type | When to use |
49
+ |------|-------------|
50
+ | `spec` | Review a specification for completeness |
51
+ | `plan` | Review an implementation plan |
67
52
  | `impl` | Review code implementation |
68
- | `pr` | Review pull request before merge |
69
- | `phase` | Phase-scoped review (builder only) |
70
- | `integration` | Architect's integration review |
71
-
72
- Protocol-specific prompts live in `codev/protocols/<protocol>/consult-types/`.
53
+ | `pr` | Review a pull request before merge |
54
+ | `phase` | Phase-scoped review (builder context only) |
55
+ | `integration` | Architect's integration review of a PR |
73
56
 
74
- ## Context Resolution
57
+ ## Usage patterns
75
58
 
76
- - **Builder context** (cwd in `.builders/`): auto-detects project from porch state
77
- - **Architect context** (cwd outside `.builders/`): requires `--issue <N>`
59
+ **General query:**
60
+ ```bash
61
+ consult -m gemini --prompt "What's the best way to structure auth?"
62
+ consult -m codex --prompt-file review-checklist.md
63
+ ```
78
64
 
79
- ## Parallel Consultation (3-Way / cmap)
65
+ **Protocol review:**
66
+ ```bash
67
+ consult -m gemini --type spec --issue 42
68
+ consult -m codex --type plan --issue 42
69
+ consult -m claude --type integration --issue 42
70
+ ```
80
71
 
81
- Run all three models in parallel for thorough reviews:
72
+ **3-way parallel review (cmap):**
73
+ Always use `--output` for background runs — without it, results go to a temp file that may be garbage-collected.
82
74
 
83
75
  ```bash
84
- consult -m gemini --protocol spir --type spec &
85
- consult -m codex --protocol spir --type spec &
86
- consult -m claude --protocol spir --type spec &
76
+ consult -m gemini --type integration --issue 42 --output /tmp/cmap-gemini-42.md &
77
+ consult -m codex --type integration --issue 42 --output /tmp/cmap-codex-42.md &
78
+ consult -m claude --type integration --issue 42 --output /tmp/cmap-claude-42.md &
87
79
  wait
88
80
  ```
89
81
 
90
- Or from Claude Code, use **cmap** pattern: three parallel background Bash calls.
82
+ **Stats:**
83
+ ```bash
84
+ consult stats # 30-day summary
85
+ consult stats --days 7 --json # Last 7 days as JSON
86
+ consult stats --project 42 # Filter by project
87
+ ```
91
88
 
92
- ## Common Mistakes
89
+ ## Rules
93
90
 
94
- - The `-m` flag is **required** `consult --type spec` will fail without it
95
- - Cannot combine `--prompt` with `--type` (mode conflict)
96
- - Cannot use `--prompt` and `--prompt-file` together
97
- - `--protocol` requires `--type` — cannot use alone
98
- - General mode: `--prompt` text is passed directly, not as a positional arg
91
+ - `-m` is required for all non-stats commands
92
+ - `--prompt` and `--type` are mutually exclusive (different modes)
93
+ - `--prompt` and `--prompt-file` are mutually exclusive
94
+ - `--protocol` requires `--type`
95
+ - From architect context (outside `.builders/`), `--issue` is required for protocol reviews
96
+ - From builder context (inside `.builders/`), project auto-detects from porch state
@@ -1,56 +1,45 @@
1
1
  ---
2
2
  name: generate-image
3
- description: AI image generation CLI using Gemini. Use when generating images, checking syntax for resolution, aspect ratio, and reference image options.
4
- disable-model-invocation: false
3
+ description: AI image generation via Gemini. Use when the user wants to generate, create, or make an image, or when you need to create visual assets like logos, diagrams, or illustrations. Requires GEMINI_API_KEY or GOOGLE_API_KEY.
5
4
  ---
6
5
 
7
6
  # generate-image - AI Image Generation
8
7
 
9
- Uses Google Gemini (gemini-3-pro-image-preview) to generate images from text prompts.
8
+ Uses Google Gemini to generate images from text prompts.
10
9
 
11
10
  ## Synopsis
12
11
 
13
- ```bash
12
+ ```
14
13
  codev generate-image "<prompt>" [options]
15
14
  ```
16
15
 
17
- ## Options
16
+ Note: this is a `codev` subcommand, not standalone.
18
17
 
19
- ```bash
20
- -o, --output <file> # Output file path (default: output.png)
21
- -r, --resolution <res> # Resolution: 1K, 2K, 4K (default: 1K)
22
- -a, --aspect <ratio> # Aspect ratio (default: 1:1)
23
- --ref <image> # Reference image (repeatable, max 14)
18
+ ## All flags
19
+
20
+ ```
21
+ -o, --output <file> Output file path (default: output.png)
22
+ -r, --resolution <res> Resolution: 1K, 2K, 4K (default: 1K)
23
+ -a, --aspect <ratio> Aspect ratio (default: 1:1)
24
+ --ref <image> Reference image (repeatable, max 14)
24
25
  ```
25
26
 
26
- ## Aspect Ratios
27
+ ## Aspect ratios
27
28
 
28
29
  `1:1` | `16:9` | `9:16` | `3:4` | `4:3` | `3:2` | `2:3`
29
30
 
30
31
  ## Examples
31
32
 
32
33
  ```bash
33
- # Basic generation
34
34
  codev generate-image "A sunset over mountains"
35
-
36
- # High-res widescreen
37
35
  codev generate-image "A futuristic city" -r 4K -a 16:9 -o city.png
38
-
39
- # With reference images (style transfer)
40
36
  codev generate-image "Same style but with cats" --ref style.png --ref layout.png
41
-
42
- # Prompt from file
43
- codev generate-image prompt.txt -o result.png
37
+ codev generate-image prompt.txt -o result.png # Prompt from .txt file
44
38
  ```
45
39
 
46
- ## Prerequisites
47
-
48
- Requires `GEMINI_API_KEY` or `GOOGLE_API_KEY` environment variable.
49
- Get a key at https://aistudio.google.com/apikey
50
-
51
- ## Common Mistakes
40
+ ## Notes
52
41
 
53
- - Prompt must be **quoted** if it contains spaces
54
- - Prompt can also be a `.txt` file path (auto-detected by extension)
55
- - Reference images must exist on disk — max 14 images
56
- - Output defaults to `output.png` in current directory — use `-o` to change
42
+ - Prompt must be quoted if it contains spaces
43
+ - Prompt can be a `.txt` file path (auto-detected by extension)
44
+ - Reference images must exist on disk
45
+ - Requires `GEMINI_API_KEY` or `GOOGLE_API_KEY` environment variable
@@ -1,53 +1,60 @@
1
1
  ---
2
2
  name: porch
3
- description: Protocol orchestrator CLI quick reference. Use when running porch commands to check correct syntax for status, run, done, approve, next, and pending.
4
- disable-model-invocation: false
3
+ description: Protocol orchestrator CLI drives SPIR, ASPIR, AIR, TICK, and BUGFIX protocols via a state machine. ALWAYS check this skill before running any `porch` command. Use when you need to check project status, approve gates, signal phase completion, or manage protocol state. Also use when a builder asks about gate approvals or phase transitions.
5
4
  ---
6
5
 
7
6
  # porch - Protocol Orchestrator
8
7
 
9
- ## Synopsis
10
-
11
- ```bash
12
- porch <command> [project-id]
13
- ```
14
-
15
- Porch drives SPIR, TICK, and BUGFIX protocols via a state machine with phase transitions, gates, and multi-agent consultations.
8
+ Porch manages the state machine behind development protocols. It tracks phases, gates, consultations, and transitions.
16
9
 
17
10
  ## Commands
18
11
 
19
- ```bash
20
- porch status [id] # Show project status (auto-detects in worktree)
21
- porch run [id] # Run the protocol loop (strict mode)
22
- porch next [id] # Get next tasks for a project
23
- porch done [id] # Signal current phase work is complete
24
- porch approve <id> <gate> # Approve a gate (human only)
25
- porch pending # List all pending gates across projects
12
+ ```
13
+ porch status [id] Show current project state and phase
14
+ porch run [id] Run the protocol loop (strict mode)
15
+ porch next [id] Get next tasks as JSON
16
+ porch done [id] Signal current phase is complete
17
+ porch check [id] Run checks for current phase
18
+ porch gate [id] Request human approval at a gate
19
+ porch approve <id> <gate> --a-human-explicitly-approved-this
20
+ porch rollback <id> <phase> Rewind to an earlier phase
21
+ porch init <protocol> <id> <name> Initialize a new project
26
22
  ```
27
23
 
28
- ## Gates
24
+ Project ID auto-detects from worktree path when inside a builder worktree.
29
25
 
30
- Gates are human approval checkpoints. Builders STOP at gates and wait.
26
+ ## Gate approvals
27
+
28
+ Gates are human-only approval checkpoints. The `--a-human-explicitly-approved-this` flag is **required** — it exists to prevent AI agents from auto-approving.
31
29
 
32
30
  | Gate | Protocol | When |
33
31
  |------|----------|------|
34
32
  | `spec-approval` | SPIR | After spec is written |
35
33
  | `plan-approval` | SPIR | After plan is written |
36
- | `pr` | SPIR, TICK | After PR is created |
34
+ | `pr` | SPIR, TICK, AIR | After PR is created |
35
+
36
+ ```bash
37
+ porch approve 42 spec-approval --a-human-explicitly-approved-this
38
+ porch approve 42 plan-approval --a-human-explicitly-approved-this
39
+ porch approve 42 pr --a-human-explicitly-approved-this
40
+ ```
41
+
42
+ **ASPIR and BUGFIX have no spec/plan gates** — they run autonomously through those phases.
43
+
44
+ ## Checking pending gates
37
45
 
38
46
  ```bash
39
- porch approve 42 spec-approval # Approve spec gate
40
- porch approve 42 plan-approval # Approve plan gate
41
- porch approve 42 pr # Approve PR gate
47
+ porch pending # List all gates waiting for approval
42
48
  ```
43
49
 
44
- ## Project State
50
+ ## Critical rules
45
51
 
46
- State is stored in `codev/projects/<id>/status.yaml`, managed automatically by porch. **Never edit status.yaml directly.**
52
+ - **Builders must NEVER call `porch approve`** only humans approve gates
53
+ - **Never edit `status.yaml` directly** — porch manages all state
54
+ - Builders signal completion with `porch done`, not `porch approve`
55
+ - `porch run` is for strict mode only — soft mode builders follow the protocol document manually
56
+ - When running `porch approve` from the architect, use a subshell if you need worktree context: `(cd /path/to/worktree && porch approve ...)`
47
57
 
48
- ## Common Mistakes
58
+ ## State storage
49
59
 
50
- - **Never call `porch approve` as a builder** - Only humans approve gates
51
- - **Never edit status.yaml directly** - Only porch modifies state
52
- - Builders should use `porch done` to signal phase completion, not `porch approve`
53
- - `porch run` is for strict mode only - soft mode builders follow the protocol manually
60
+ Project state lives in `codev/projects/<id>-<name>/status.yaml`, managed automatically by porch. The status file tracks current phase, gate states, consultation results, and timestamps.
@@ -1026,6 +1026,17 @@
1026
1026
  }
1027
1027
  }
1028
1028
 
1029
+ // Abort SSE connection on page unload to free connection slots.
1030
+ // fetch+ReadableStream SSE doesn't auto-close like EventSource,
1031
+ // so without this, reloads leak connections until Chrome's 6-per-origin
1032
+ // limit is exhausted and all subsequent fetches queue forever.
1033
+ window.addEventListener('beforeunload', () => {
1034
+ if (sseController) {
1035
+ sseController.abort();
1036
+ sseController = null;
1037
+ }
1038
+ });
1039
+
1029
1040
  // Subscribe to SSE for push notifications
1030
1041
  subscribeToEvents();
1031
1042