@touchskyer/opc 0.2.2 → 0.2.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 (3) hide show
  1. package/bin/opc.mjs +13 -3
  2. package/package.json +1 -1
  3. package/skill.md +113 -8
package/bin/opc.mjs CHANGED
@@ -45,6 +45,13 @@ switch (command) {
45
45
  break;
46
46
  }
47
47
 
48
+ // If skillsDir is a symlink, just remove the link itself — don't follow it
49
+ if (lstatSync(skillsDir).isSymbolicLink()) {
50
+ rmSync(skillsDir);
51
+ console.log(`✓ OPC symlink removed: ${skillsDir}`);
52
+ break;
53
+ }
54
+
48
55
  // Only remove OPC-managed files, preserve custom roles
49
56
  const rolesDir = join(skillsDir, "roles");
50
57
  const managedRoles = readdirSync(join(srcDir, "roles"));
@@ -55,12 +62,13 @@ switch (command) {
55
62
  const rolePath = join(rolesDir, role);
56
63
  if (existsSync(rolePath)) rmSync(rolePath);
57
64
  }
58
- // Remove roles dir only if empty
59
65
  try {
60
66
  const remaining = readdirSync(rolesDir);
61
67
  if (remaining.length === 0) rmSync(rolesDir);
62
68
  else console.log(` Kept ${remaining.length} custom role(s) in ${rolesDir}`);
63
- } catch {}
69
+ } catch (err) {
70
+ console.warn(` ⚠ Could not clean roles dir: ${err.message}`);
71
+ }
64
72
  }
65
73
 
66
74
  // Remove skill.md
@@ -71,7 +79,9 @@ switch (command) {
71
79
  try {
72
80
  const remaining = readdirSync(skillsDir);
73
81
  if (remaining.length === 0) rmSync(skillsDir);
74
- } catch {}
82
+ } catch (err) {
83
+ console.warn(` ⚠ Could not remove skill dir: ${err.message}`);
84
+ }
75
85
 
76
86
  console.log(`✓ OPC removed from ${skillsDir}`);
77
87
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@touchskyer/opc",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "OPC — One Person Company. A full team in a single Claude Code skill.",
5
5
  "type": "module",
6
6
  "bin": {
package/skill.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: opc
3
- version: 0.2.2
3
+ version: 0.2.4
4
4
  description: "OPC — One Person Company. A full team in a single skill: 11 specialist agents for review, analysis, execution, and brainstorming. /opc review, /opc -i, or /opc <role>."
5
5
  ---
6
6
 
@@ -293,6 +293,10 @@ Output not ending with a VERDICT line will be REJECTED.
293
293
 
294
294
  ## Step 6: Verification Gate
295
295
 
296
+ **⛔ CHECKPOINT — DO NOT SKIP TO STEP 7.**
297
+
298
+ You MUST show verification work for EVERY agent before writing the final report. "I reviewed it mentally" is NOT acceptable — show the log.
299
+
296
300
  CRITICAL: Do Not Trust the Agent Reports.
297
301
 
298
302
  **Re-dispatch limit: max 1 retry per agent.** If an agent fails checks twice, accept its best output and note the quality issue in the report. Do not loop.
@@ -306,12 +310,18 @@ For EVERY agent output, reject if:
306
310
  4. **Hedging without evidence** — finding uses "might", "could potentially", "consider" without a concrete scenario → REJECT finding
307
311
  5. **Mode C: No verification output** — agent claims IMPLEMENTED but shows no test run or verification results → REJECT, re-dispatch
308
312
 
309
- ### Spot-Check (Mode A/B — coordinator reads code to verify)
313
+ ### Spot-Check (Mode A/B)
314
+
315
+ Two verification methods — use the RIGHT one:
316
+
317
+ **Quick verify (coordinator reads code):** When fact is binary — "does function X exist?", "is line 42 really an `any` type?" → Open the file yourself, confirm, done.
318
+
319
+ **Independent verify (re-dispatch agent):** When finding involves JUDGMENT — "is this really a security risk?", "does the error handling actually cover this case?", "is this test gap critical?" → Re-dispatch a focused agent with the specific question. Your own opinion is not sufficient for judgment calls.
320
+
321
+ Rule of thumb: If you need to trace more than 2 files to verify, or if two agents disagree, re-dispatch.
310
322
 
311
- For findings that pass mechanical checks:
312
- 1. **Verify facts** — if agent claims "function X doesn't exist", open the file and check
313
- 2. **Challenge severity** — "Is this really 🔴? What's the concrete exploit path?"
314
- 3. **Deduplicate** — multiple agents reporting same issue → keep best-articulated one
323
+ Also always:
324
+ - **Deduplicate** — multiple agents reporting same issue keep best-articulated one
315
325
 
316
326
  ### Effort Check
317
327
 
@@ -324,9 +334,9 @@ For findings that pass mechanical checks:
324
334
  For each questionable finding:
325
335
  - **Dismiss** with one-line reason (clearly wrong or contradicts Design Context Brief)
326
336
  - **Downgrade** severity with explanation
327
- - **Re-dispatch** for defense (only if genuinely uncertain use the re-dispatch prompt from below)
337
+ - **Re-dispatch** for defense (targeted expect 1-3 per review session, not rare)
328
338
 
329
- Re-dispatch prompt (rare):
339
+ Re-dispatch prompt:
330
340
  ```
331
341
  A finding has been challenged. Review independently.
332
342
 
@@ -339,6 +349,21 @@ Do NOT default to agreeing with the challenger.
339
349
 
340
350
  **Transparency:** If coordinator dismisses > 80% of findings, note it in the report.
341
351
 
352
+ ### Step 6 Output (MUST appear before Step 7)
353
+
354
+ Show the verification log as a table:
355
+
356
+ ```
357
+ ## Verification Log
358
+
359
+ | Agent | Mechanical | Effort | Spot-Checks | Re-dispatched? | Action |
360
+ |-------|-----------|--------|-------------|----------------|--------|
361
+ | {role} | ✅/❌ which check | N/M files | What you verified + evidence | Yes/No — reason | N dismissed, M downgraded |
362
+
363
+ Re-dispatch results (if any):
364
+ - {role}: Finding: {X}. Challenge: {Y}. Agent response: DEFEND/RETRACT/DOWNGRADE. Decision: {Z}.
365
+ ```
366
+
342
367
  ---
343
368
 
344
369
  ## Step 7: Present Results
@@ -387,6 +412,86 @@ Recommendation: {coordinator's pick with rationale}
387
412
 
388
413
  ---
389
414
 
415
+ ## Step 8: Save Report
416
+
417
+ After presenting results, save a structured JSON report for the OPC Viewer.
418
+
419
+ **Directory:** `~/.opc/reports/` (create if it doesn't exist)
420
+ **Filename:** `{YYYY-MM-DD}T{HH-mm-ss}_{mode}_{sanitized-task-summary}.json`
421
+
422
+ Use the Bash tool to create the directory, then the Write tool to save the JSON file.
423
+
424
+ ### JSON Schema
425
+
426
+ ```json
427
+ {
428
+ "version": "1.0",
429
+ "timestamp": "<ISO 8601>",
430
+ "mode": "<review|analysis|execute|brainstorm>",
431
+ "task": "<original task description>",
432
+ "agents": [
433
+ {
434
+ "role": "<role name>",
435
+ "scope": ["<file paths>"],
436
+ "verdict": "<VERDICT string>",
437
+ "findings": [
438
+ {
439
+ "severity": "<critical|warning|suggestion>",
440
+ "file": "<file path>",
441
+ "line": <line number or null>,
442
+ "issue": "<issue description>",
443
+ "fix": "<suggested fix>",
444
+ "reasoning": "<why this matters>",
445
+ "status": "<accepted|dismissed|downgraded>",
446
+ "dismissReason": "<reason if dismissed/downgraded, null otherwise>"
447
+ }
448
+ ]
449
+ }
450
+ ],
451
+ "coordinator": {
452
+ "challenged": <number>,
453
+ "dismissed": <number>,
454
+ "downgraded": <number>
455
+ },
456
+ "summary": {
457
+ "critical": <count of accepted critical findings>,
458
+ "warning": <count of accepted warning findings>,
459
+ "suggestion": <count of accepted suggestion findings>
460
+ },
461
+ "timeline": [
462
+ {
463
+ "type": "<triage|roles|context|dispatch|agent-output|verification|report>",
464
+ "role": "<coordinator or agent role name>",
465
+ "content": "<message content — what happened at this step>"
466
+ }
467
+ ]
468
+ }
469
+ ```
470
+
471
+ ### Timeline
472
+
473
+ The `timeline` array records each step of the OPC process as a chat-like message for the Replay view. Build it as you go:
474
+
475
+ 1. **triage** (coordinator): "Mode: REVIEW\nTask: {task}"
476
+ 2. **roles** (coordinator): "Dispatching N agents: {role1}, {role2}..."
477
+ 3. **context** (coordinator): Brief summary of the Design Context Brief (Mode A only)
478
+ 4. **dispatch** (coordinator): "Agents running in parallel..."
479
+ 5. **agent-output** (each agent's role): Include their verdict + each finding as "🔴/🟡/🔵 file:line — issue"
480
+ 6. **verification** (coordinator): "Verification gate: N challenged, M dismissed..." with details on dismissed/downgraded findings
481
+ 7. **report** (coordinator): "Final report: N 🔴 Critical, N 🟡 Warning, N 🔵 Suggestion"
482
+
483
+ Use `**bold**` for emphasis in content. Each entry is one message in the Replay channel view.
484
+
485
+ **Rules:**
486
+ - Sanitize the task summary for filename: lowercase, replace spaces with hyphens, remove special chars, truncate to 50 chars
487
+ - Only include agents that were dispatched (not all 11)
488
+ - `summary` counts only `status: "accepted"` findings
489
+ - For Mode B (Analysis), findings may not have severity — use `"suggestion"` as default
490
+ - For Mode C (Execute), there are no findings — save an empty agents array with just the verdict
491
+ - For Mode D (Brainstorm), save the approaches as findings with severity "suggestion"
492
+
493
+ ---
494
+
390
495
  ## Notes
391
496
 
392
497
  - Agents run via the Agent tool with `subagent_type: "general-purpose"`.