agentsys 5.3.0 → 5.3.1

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 (136) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.cursor/commands/audit-project-agents.md +454 -0
  4. package/.cursor/commands/audit-project-github.md +141 -0
  5. package/.cursor/commands/audit-project.md +330 -0
  6. package/.cursor/commands/consult.md +417 -0
  7. package/.cursor/commands/debate.md +381 -0
  8. package/.cursor/commands/delivery-approval.md +334 -0
  9. package/.cursor/commands/deslop.md +142 -0
  10. package/.cursor/commands/drift-detect.md +259 -0
  11. package/.cursor/commands/enhance.md +172 -0
  12. package/.cursor/commands/learn.md +165 -0
  13. package/.cursor/commands/next-task.md +519 -0
  14. package/.cursor/commands/perf.md +464 -0
  15. package/.cursor/commands/repo-map.md +124 -0
  16. package/.cursor/commands/ship-ci-review-loop.md +468 -0
  17. package/.cursor/commands/ship-deployment.md +348 -0
  18. package/.cursor/commands/ship-error-handling.md +265 -0
  19. package/.cursor/commands/ship.md +517 -0
  20. package/.cursor/commands/sync-docs.md +171 -0
  21. package/.cursor/commands/web-ctl.md +101 -0
  22. package/.cursor/skills/consult/SKILL.md +425 -0
  23. package/.cursor/skills/debate/SKILL.md +316 -0
  24. package/.cursor/skills/deslop/SKILL.md +204 -0
  25. package/.cursor/skills/discover-tasks/SKILL.md +297 -0
  26. package/.cursor/skills/drift-analysis/SKILL.md +324 -0
  27. package/.cursor/skills/enhance-agent-prompts/SKILL.md +277 -0
  28. package/.cursor/skills/enhance-claude-memory/SKILL.md +387 -0
  29. package/.cursor/skills/enhance-cross-file/SKILL.md +110 -0
  30. package/.cursor/skills/enhance-docs/SKILL.md +298 -0
  31. package/.cursor/skills/enhance-hooks/SKILL.md +554 -0
  32. package/.cursor/skills/enhance-orchestrator/SKILL.md +255 -0
  33. package/.cursor/skills/enhance-plugins/SKILL.md +319 -0
  34. package/.cursor/skills/enhance-prompts/SKILL.md +340 -0
  35. package/.cursor/skills/enhance-skills/SKILL.md +436 -0
  36. package/.cursor/skills/learn/SKILL.md +349 -0
  37. package/.cursor/skills/orchestrate-review/SKILL.md +260 -0
  38. package/.cursor/skills/perf-analyzer/SKILL.md +37 -0
  39. package/.cursor/skills/perf-baseline-manager/SKILL.md +30 -0
  40. package/.cursor/skills/perf-benchmarker/SKILL.md +52 -0
  41. package/.cursor/skills/perf-code-paths/SKILL.md +32 -0
  42. package/.cursor/skills/perf-investigation-logger/SKILL.md +41 -0
  43. package/.cursor/skills/perf-profiler/SKILL.md +42 -0
  44. package/.cursor/skills/perf-theory-gatherer/SKILL.md +35 -0
  45. package/.cursor/skills/perf-theory-tester/SKILL.md +36 -0
  46. package/.cursor/skills/repo-mapping/SKILL.md +83 -0
  47. package/.cursor/skills/sync-docs/SKILL.md +351 -0
  48. package/.cursor/skills/validate-delivery/SKILL.md +186 -0
  49. package/.cursor/skills/web-auth/SKILL.md +177 -0
  50. package/.cursor/skills/web-browse/SKILL.md +516 -0
  51. package/.kiro/agents/agent-enhancer.json +12 -0
  52. package/.kiro/agents/ci-fixer.json +13 -0
  53. package/.kiro/agents/ci-monitor.json +12 -0
  54. package/.kiro/agents/claudemd-enhancer.json +12 -0
  55. package/.kiro/agents/consult-agent.json +13 -0
  56. package/.kiro/agents/cross-file-enhancer.json +12 -0
  57. package/.kiro/agents/debate-orchestrator.json +13 -0
  58. package/.kiro/agents/delivery-validator.json +12 -0
  59. package/.kiro/agents/deslop-agent.json +12 -0
  60. package/.kiro/agents/docs-enhancer.json +12 -0
  61. package/.kiro/agents/exploration-agent.json +12 -0
  62. package/.kiro/agents/hooks-enhancer.json +11 -0
  63. package/.kiro/agents/implementation-agent.json +13 -0
  64. package/.kiro/agents/learn-agent.json +12 -0
  65. package/.kiro/agents/map-validator.json +11 -0
  66. package/.kiro/agents/perf-analyzer.json +12 -0
  67. package/.kiro/agents/perf-code-paths.json +11 -0
  68. package/.kiro/agents/perf-investigation-logger.json +12 -0
  69. package/.kiro/agents/perf-orchestrator.json +13 -0
  70. package/.kiro/agents/perf-theory-gatherer.json +12 -0
  71. package/.kiro/agents/perf-theory-tester.json +13 -0
  72. package/.kiro/agents/plan-synthesizer.json +12 -0
  73. package/.kiro/agents/planning-agent.json +12 -0
  74. package/.kiro/agents/plugin-enhancer.json +12 -0
  75. package/.kiro/agents/prompt-enhancer.json +12 -0
  76. package/.kiro/agents/reviewer-perf-test.json +11 -0
  77. package/.kiro/agents/reviewer-quality-security.json +11 -0
  78. package/.kiro/agents/simple-fixer.json +13 -0
  79. package/.kiro/agents/skills-enhancer.json +11 -0
  80. package/.kiro/agents/sync-docs-agent.json +13 -0
  81. package/.kiro/agents/task-discoverer.json +12 -0
  82. package/.kiro/agents/test-coverage-checker.json +12 -0
  83. package/.kiro/agents/web-session.json +12 -0
  84. package/.kiro/agents/worktree-manager.json +13 -0
  85. package/.kiro/skills/consult/SKILL.md +425 -0
  86. package/.kiro/skills/debate/SKILL.md +316 -0
  87. package/.kiro/skills/deslop/SKILL.md +204 -0
  88. package/.kiro/skills/discover-tasks/SKILL.md +297 -0
  89. package/.kiro/skills/drift-analysis/SKILL.md +324 -0
  90. package/.kiro/skills/enhance-agent-prompts/SKILL.md +277 -0
  91. package/.kiro/skills/enhance-claude-memory/SKILL.md +387 -0
  92. package/.kiro/skills/enhance-cross-file/SKILL.md +110 -0
  93. package/.kiro/skills/enhance-docs/SKILL.md +298 -0
  94. package/.kiro/skills/enhance-hooks/SKILL.md +554 -0
  95. package/.kiro/skills/enhance-orchestrator/SKILL.md +255 -0
  96. package/.kiro/skills/enhance-plugins/SKILL.md +319 -0
  97. package/.kiro/skills/enhance-prompts/SKILL.md +340 -0
  98. package/.kiro/skills/enhance-skills/SKILL.md +436 -0
  99. package/.kiro/skills/learn/SKILL.md +349 -0
  100. package/.kiro/skills/orchestrate-review/SKILL.md +260 -0
  101. package/.kiro/skills/perf-analyzer/SKILL.md +37 -0
  102. package/.kiro/skills/perf-baseline-manager/SKILL.md +30 -0
  103. package/.kiro/skills/perf-benchmarker/SKILL.md +52 -0
  104. package/.kiro/skills/perf-code-paths/SKILL.md +32 -0
  105. package/.kiro/skills/perf-investigation-logger/SKILL.md +41 -0
  106. package/.kiro/skills/perf-profiler/SKILL.md +42 -0
  107. package/.kiro/skills/perf-theory-gatherer/SKILL.md +35 -0
  108. package/.kiro/skills/perf-theory-tester/SKILL.md +36 -0
  109. package/.kiro/skills/repo-mapping/SKILL.md +83 -0
  110. package/.kiro/skills/sync-docs/SKILL.md +351 -0
  111. package/.kiro/skills/validate-delivery/SKILL.md +186 -0
  112. package/.kiro/skills/web-auth/SKILL.md +177 -0
  113. package/.kiro/skills/web-browse/SKILL.md +516 -0
  114. package/.kiro/steering/audit-project-agents.md +459 -0
  115. package/.kiro/steering/audit-project-github.md +146 -0
  116. package/.kiro/steering/audit-project.md +330 -0
  117. package/.kiro/steering/consult.md +422 -0
  118. package/.kiro/steering/debate.md +386 -0
  119. package/.kiro/steering/delivery-approval.md +339 -0
  120. package/.kiro/steering/deslop.md +149 -0
  121. package/.kiro/steering/drift-detect.md +264 -0
  122. package/.kiro/steering/enhance.md +177 -0
  123. package/.kiro/steering/learn.md +166 -0
  124. package/.kiro/steering/next-task.md +481 -0
  125. package/.kiro/steering/perf.md +469 -0
  126. package/.kiro/steering/repo-map.md +126 -0
  127. package/.kiro/steering/ship-ci-review-loop.md +473 -0
  128. package/.kiro/steering/ship-deployment.md +353 -0
  129. package/.kiro/steering/ship-error-handling.md +270 -0
  130. package/.kiro/steering/ship.md +522 -0
  131. package/.kiro/steering/sync-docs.md +178 -0
  132. package/.kiro/steering/web-ctl.md +106 -0
  133. package/CHANGELOG.md +6 -0
  134. package/lib/adapter-transforms.js +28 -0
  135. package/package.json +1 -1
  136. package/site/content.json +1 -1
@@ -0,0 +1,316 @@
1
+ ---
2
+ name: debate
3
+ description: "Structured AI debate templates and synthesis. Use when orchestrating multi-round debates between AI tools, 'debate topic', 'argue about', 'stress test idea', 'devil advocate'."
4
+ version: 5.1.0
5
+ argument-hint: "[topic] [--proposer=tool] [--challenger=tool] [--rounds=N] [--effort=level]"
6
+ ---
7
+
8
+ # debate
9
+
10
+ Prompt templates, context assembly rules, and synthesis format for structured multi-round debates between AI tools.
11
+
12
+ ## Arguments
13
+
14
+ Parse from `$ARGUMENTS`:
15
+ - **topic**: The debate question/topic (required)
16
+ - **--proposer**: Tool for the proposer role (claude, gemini, codex, opencode, copilot)
17
+ - **--challenger**: Tool for the challenger role (must differ from proposer)
18
+ - **--rounds**: Number of back-and-forth rounds (1-5, default: 2)
19
+ - **--effort**: Thinking effort applied to all tool invocations (low, medium, high, max)
20
+ - **--model-proposer**: Specific model for proposer (optional)
21
+ - **--model-challenger**: Specific model for challenger (optional)
22
+
23
+ ## Universal Rules
24
+
25
+ ALL participants (proposer AND challenger) MUST support claims with specific evidence (file path, code pattern, benchmark, or documented behavior). Unsupported claims from either side will be flagged by the other participant and noted in the verdict. This applies to every round.
26
+
27
+ ## Prompt Templates
28
+
29
+ ### Round 1: Proposer Opening
30
+
31
+ ```
32
+ You are participating in a structured debate as the PROPOSER.
33
+
34
+ Topic: {topic}
35
+
36
+ Your job: Analyze this topic thoroughly and present your position. Take a clear stance. Do not hedge excessively.
37
+
38
+ You MUST support each claim with specific evidence (file path, code pattern, benchmark, or documented behavior). Unsupported claims will be challenged. "I think" or "generally speaking" without evidence is not acceptable.
39
+
40
+ Provide your analysis:
41
+ ```
42
+
43
+ ### Round 1: Challenger Response
44
+
45
+ ```
46
+ You are participating in a structured debate as the CHALLENGER.
47
+
48
+ Topic: {topic}
49
+
50
+ The PROPOSER ({proposer_tool}) argued:
51
+
52
+ ---
53
+ {proposer_round1_response}
54
+ ---
55
+
56
+ Your job: Find weaknesses, blind spots, and flaws in the proposer's argument. You MUST identify at least one genuine flaw or overlooked consideration before agreeing on anything. Propose concrete alternatives where you disagree.
57
+
58
+ Rules:
59
+ - Do NOT say "great point" or validate the proposer's reasoning before critiquing it
60
+ - Lead with what's WRONG or MISSING, then acknowledge what's right
61
+ - If you genuinely agree on a point, explain what RISK remains despite the agreement
62
+ - Propose at least one concrete alternative approach
63
+ - You MUST address at least these categories: correctness, security implications, and developer experience
64
+ - Do NOT agree with ANY claim unless you can cite specific evidence (file path, code pattern, or documented behavior) that supports the agreement. Unsupported agreement is not allowed.
65
+ - If the proposer makes a claim without evidence, call it out: "This claim is unsupported."
66
+
67
+ Provide your challenge:
68
+ ```
69
+
70
+ ### Round 2+: Proposer Defense
71
+
72
+ ```
73
+ You are the PROPOSER in round {round} of a structured debate.
74
+
75
+ Topic: {topic}
76
+
77
+ {context_summary}
78
+
79
+ The CHALLENGER ({challenger_tool}) raised these points in round {previous_round}:
80
+
81
+ ---
82
+ {challenger_previous_response}
83
+ ---
84
+
85
+ Your job: Address each challenge directly. For each point:
86
+ - If they're right, concede explicitly and explain how your position evolves
87
+ - If they're wrong, explain why with specific evidence (file path, code pattern, benchmark, or documented behavior)
88
+ - If it's a tradeoff, acknowledge the tradeoff and explain why you still favor your approach with evidence
89
+
90
+ Every claim you make -- whether concession, rebuttal, or new argument -- MUST cite specific evidence. The challenger will reject unsupported claims.
91
+
92
+ Do NOT simply restate your original position. Your response must show you engaged with the specific challenges raised.
93
+
94
+ Provide your defense:
95
+ ```
96
+
97
+ ### Round 2+: Challenger Follow-up
98
+
99
+ ```
100
+ You are the CHALLENGER in round {round} of a structured debate.
101
+
102
+ Topic: {topic}
103
+
104
+ {context_summary}
105
+
106
+ The PROPOSER ({proposer_tool}) responded to your challenges:
107
+
108
+ ---
109
+ {proposer_previous_response}
110
+ ---
111
+
112
+ IMPORTANT: Do NOT let the proposer reframe your challenges as agreements. If they say "we actually agree" but haven't addressed the substance, reject it. Default to suspicion, not acceptance.
113
+
114
+ Your job: Evaluate the proposer's defense. For each point they addressed:
115
+ - Did they dodge, superficially address, or respond without evidence? Call it out: "This defense is unsupported" or "This dodges the original concern"
116
+ - Did they concede any point? Hold them to it -- they cannot walk it back later without new evidence
117
+ - Are there NEW weaknesses in their revised position?
118
+ - Did they adequately address your concern with specific evidence? Only then acknowledge it, and cite what convinced you
119
+
120
+ You MUST either identify at least one new weakness or unresolved concern, OR explicitly certify a previous concern as genuinely resolved with specific evidence for why you're now satisfied. "I'm convinced because [evidence]" is acceptable. "I agree now" without evidence is not.
121
+ If you see new problems, raise them.
122
+
123
+ Provide your follow-up:
124
+ ```
125
+
126
+ ## Context Assembly
127
+
128
+ ### Rounds 1-2: Full context
129
+
130
+ Include the full text of all prior exchanges in the prompt. Context is small enough (typically under 5000 tokens total).
131
+
132
+ Format for context block:
133
+ ```
134
+ Previous exchanges:
135
+
136
+ Round 1 - Proposer ({proposer_tool}):
137
+ {full response}
138
+
139
+ Round 1 - Challenger ({challenger_tool}):
140
+ {full response}
141
+ ```
142
+
143
+ ### Round 3+: Summarized context
144
+
145
+ For rounds 3 and beyond, replace full exchange text from rounds 1 through N-2 with a summary. Only include the most recent round's responses in full.
146
+
147
+ Format:
148
+ ```
149
+ Summary of rounds 1-{N-2}:
150
+ {summary of key positions, agreements, and open disagreements}
151
+
152
+ Round {N-1} - Proposer ({proposer_tool}):
153
+ {full response}
154
+
155
+ Round {N-1} - Challenger ({challenger_tool}):
156
+ {full response}
157
+ ```
158
+
159
+ The orchestrator agent (opus) generates the summary. Target: 500-800 tokens. MUST preserve:
160
+ - Each side's core position
161
+ - All concessions (verbatim quotes, not paraphrased)
162
+ - All evidence citations that support agreements
163
+ - Points of disagreement (unresolved)
164
+ - Any contradictions between rounds (e.g., proposer concedes in round 1 but walks it back in round 2 -- note both explicitly)
165
+
166
+ ## Synthesis Format
167
+
168
+ After all rounds complete, the orchestrator produces this structured output:
169
+
170
+ ```
171
+ ## Debate Summary
172
+
173
+ **Topic**: {topic}
174
+ **Proposer**: {proposer_tool} ({proposer_model})
175
+ **Challenger**: {challenger_tool} ({challenger_model})
176
+ **Rounds**: {rounds_completed}
177
+ **Rigor**: Structured perspective comparison (prompt-enforced adversarial rules, no deterministic verification)
178
+
179
+ ### Verdict
180
+
181
+ {winner_tool} had the stronger argument because: {specific reasoning citing debate evidence}
182
+
183
+ ### Debate Quality
184
+
185
+ Rate the debate on these dimensions:
186
+ - **Genuine disagreement**: Did the challenger maintain independent positions, or converge toward the proposer? (high/medium/low)
187
+ - **Evidence quality**: Did both sides cite specific examples, or argue from generalities? (high/medium/low)
188
+ - **Challenge depth**: Were the challenges substantive, or surface-level? (high/medium/low)
189
+
190
+ ### Key Agreements
191
+ - {agreed point 1} (evidence: {what supports this agreement})
192
+ - {agreed point 2} (evidence: {what supports this agreement})
193
+
194
+ ### Key Disagreements
195
+ - {point}: {proposer_tool} argues {X}, {challenger_tool} argues {Y}
196
+
197
+ ### Unresolved Questions
198
+ - {question that neither side adequately addressed}
199
+
200
+ ### Recommendation
201
+ {Orchestrator's recommendation - must pick a direction, not "both have merit"}
202
+ ```
203
+
204
+ **Synthesis rules:**
205
+ - The verdict MUST pick a side. "Both approaches have merit" is NOT acceptable.
206
+ - Cite specific arguments from the debate as evidence for the verdict.
207
+ - The recommendation must be actionable - what should the user DO based on this debate.
208
+ - Unresolved questions highlight where the debate fell short, not where both sides are "equally valid."
209
+
210
+ ## State File Schema
211
+
212
+ Save to `{AI_STATE_DIR}/debate/last-debate.json`:
213
+
214
+ ```json
215
+ {
216
+ "id": "debate-{ISO timestamp}-{4 char random hex}",
217
+ "topic": "original topic text",
218
+ "proposer": {"tool": "claude", "model": "opus"},
219
+ "challenger": {"tool": "gemini", "model": "gemini-3.1-pro-preview"},
220
+ "effort": "high",
221
+ "rounds_completed": 2,
222
+ "max_rounds": 2,
223
+ "status": "completed",
224
+ "exchanges": [
225
+ {"round": 1, "role": "proposer", "tool": "claude", "response": "...", "duration_ms": 8500},
226
+ {"round": 1, "role": "challenger", "tool": "gemini", "response": "...", "duration_ms": 12000},
227
+ {"round": 2, "role": "proposer", "tool": "claude", "response": "...", "duration_ms": 9200},
228
+ {"round": 2, "role": "challenger", "tool": "gemini", "response": "...", "duration_ms": 11000}
229
+ ],
230
+ "verdict": {
231
+ "winner": "claude",
232
+ "reasoning": "...",
233
+ "agreements": ["..."],
234
+ "disagreements": ["..."],
235
+ "recommendation": "..."
236
+ },
237
+ "timestamp": "{ISO 8601 timestamp}"
238
+ }
239
+ ```
240
+
241
+ Platform state directory:
242
+ - Claude Code: `.claude/`
243
+ - OpenCode: `.opencode/`
244
+ - Codex CLI: `.codex/`
245
+
246
+ ## Error Handling
247
+
248
+ | Error | Action |
249
+ |-------|--------|
250
+ | Proposer fails round 1 | Abort debate. Cannot proceed without opening position. |
251
+ | Challenger fails round 1 | Show proposer's position with note: "[WARN] Challenger failed. Showing proposer's uncontested position." |
252
+ | Any tool fails mid-debate | Synthesize from completed rounds. Note incomplete round in output. |
253
+ | Tool invocation timeout (>240s) | Round 1 proposer: abort. Round 1 challenger: proceed with uncontested. Round 2+: synthesize from completed rounds with timeout note. |
254
+ | Consult result envelope indicates failure (status/exit/error/empty output) | Treat as tool failure for that role/round and apply the same role+round policy above. |
255
+ | Structured parse fails after successful envelope | Treat as tool failure for that role/round, include only sanitized parse metadata (`PARSE_ERROR:<type>:<code>`, redact secrets, strip control chars, max 200 chars), then apply the same role+round policy above. |
256
+ | All rounds timeout | "[ERROR] Debate failed: all tool invocations timed out." |
257
+ | No successful exchanges recorded (non-timeout) | "[ERROR] Debate failed: no successful exchanges were recorded." |
258
+
259
+ ## External Tool Quick Reference
260
+
261
+ > Canonical source: `plugins/consult/skills/consult/SKILL.md`. Build and execute CLI commands directly using these templates. Do NOT invoke via `Skill: consult` - in Claude Code that loads the interactive command wrapper and causes a recursive loop. Write the question to `{AI_STATE_DIR}/consult/question.tmp` first, then execute the command via Bash.
262
+
263
+ ### Safe Command Patterns
264
+
265
+ | Provider | Safe Command Pattern |
266
+ |----------|---------------------|
267
+ | Claude | `claude -p - --output-format json --model "MODEL" --max-turns TURNS --allowedTools "Read,Glob,Grep" < "{AI_STATE_DIR}/consult/question.tmp"` |
268
+ | Gemini | `gemini -p - --output-format json -m "MODEL" < "{AI_STATE_DIR}/consult/question.tmp"` |
269
+ | Codex | `codex exec "$(cat "{AI_STATE_DIR}/consult/question.tmp")" --json -m "MODEL" -c model_reasoning_effort="LEVEL"` |
270
+ | OpenCode | `opencode run - --format json --model "MODEL" --variant "VARIANT" < "{AI_STATE_DIR}/consult/question.tmp"` |
271
+ | Copilot | `copilot -p - < "{AI_STATE_DIR}/consult/question.tmp"` |
272
+
273
+ ### Effort-to-Model Mapping
274
+
275
+ | Effort | Claude | Gemini | Codex | OpenCode | Copilot |
276
+ |--------|--------|--------|-------|----------|---------|
277
+ | low | claude-haiku-4-5 (1 turn) | gemini-3-flash-preview | gpt-5.3-codex (low) | default (low) | no control |
278
+ | medium | claude-sonnet-4-6 (3 turns) | gemini-3-flash-preview | gpt-5.3-codex (medium) | default (medium) | no control |
279
+ | high | claude-opus-4-6 (5 turns) | gemini-3.1-pro-preview | gpt-5.3-codex (high) | default (high) | no control |
280
+ | max | claude-opus-4-6 (10 turns) | gemini-3.1-pro-preview | gpt-5.3-codex (high) | default + --thinking | no control |
281
+
282
+ ### Output Parsing
283
+
284
+ | Provider | Parse Expression |
285
+ |----------|-----------------|
286
+ | Claude | `JSON.parse(stdout).result` |
287
+ | Gemini | `JSON.parse(stdout).response` |
288
+ | Codex | `JSON.parse(stdout).message` or raw text |
289
+ | OpenCode | Newline-delimited JSON. Concatenate `part.text` from events where `type === "text"`. Session ID from `event.sessionID`. |
290
+ | Copilot | Raw stdout text |
291
+
292
+ Parse discipline:
293
+ 1. Evaluate execution status first (timeout/non-zero/error/empty output) before any parsing.
294
+ 2. Parse only when execution status is successful.
295
+ 3. If parse fails, surface only sanitized parse metadata (never raw stdout/stderr snippets) and apply role/round failure policy instead of hanging or continuing silently.
296
+
297
+ ### ACP Transport Commands
298
+
299
+ > ACP is an alternative transport available when providers support it. Build and execute CLI commands directly - do NOT use `Skill: consult` (recursive loop in Claude Code).
300
+
301
+ | Provider | ACP Command Pattern |
302
+ |----------|-------------------|
303
+ | Claude | `node acp/run.js --provider="claude" --question-file="{AI_STATE_DIR}/consult/question.tmp" --timeout=240000 --model="MODEL"` |
304
+ | Gemini | `node acp/run.js --provider="gemini" --question-file="{AI_STATE_DIR}/consult/question.tmp" --timeout=240000 --model="MODEL"` |
305
+ | Codex | `node acp/run.js --provider="codex" --question-file="{AI_STATE_DIR}/consult/question.tmp" --timeout=240000 --model="MODEL"` |
306
+ | OpenCode | `node acp/run.js --provider="opencode" --question-file="{AI_STATE_DIR}/consult/question.tmp" --timeout=240000 --model="MODEL"` |
307
+ | Copilot | `node acp/run.js --provider="copilot" --question-file="{AI_STATE_DIR}/consult/question.tmp" --timeout=240000` |
308
+ | Kiro | `node acp/run.js --provider="kiro" --question-file="{AI_STATE_DIR}/consult/question.tmp" --timeout=240000` |
309
+
310
+ Note the 240000ms timeout (240s) for debate rounds vs 120000ms (120s) for consult.
311
+
312
+ **Kiro**: ACP-only provider. No CLI mode. Available when `kiro-cli` is on PATH.
313
+
314
+ ### ACP Output Parsing
315
+
316
+ ACP transport output is parsed identically to CLI transport - the ACP runner (`acp/run.js`) normalizes responses into the same JSON envelope format. The `transport` field in the envelope indicates `"acp"` or `"cli"`.
@@ -0,0 +1,204 @@
1
+ ---
2
+ name: deslop
3
+ description: "Use when user wants to clean AI slop from code. Use for cleanup, remove debug statements, find ghost code, repo hygiene."
4
+ version: 5.1.0
5
+ argument-hint: "[report|apply] [--scope=all|diff|path] [--thoroughness=quick|normal|deep]"
6
+ ---
7
+
8
+ # deslop
9
+
10
+ Clean AI slop from code with certainty-based findings and auto-fixes.
11
+
12
+ ## Parse Arguments
13
+
14
+ ```javascript
15
+ const args = '$ARGUMENTS'.split(' ').filter(Boolean);
16
+ const mode = args.find(a => ['report', 'apply'].includes(a)) || 'report';
17
+ const scope = args.find(a => a.startsWith('--scope='))?.split('=')[1] || 'all';
18
+ const thoroughness = args.find(a => a.startsWith('--thoroughness='))?.split('=')[1] || 'normal';
19
+ ```
20
+
21
+ ## Input
22
+
23
+ Arguments: `[report|apply] [--scope=<path>|all|diff] [--thoroughness=quick|normal|deep]`
24
+
25
+ - **Mode**: `report` (default) or `apply`
26
+ - **Scope**: What to scan
27
+ - `all` (default): Entire codebase
28
+ - `diff`: Only files changed in current branch
29
+ - `<path>`: Specific directory or file
30
+ - **Thoroughness**: Analysis depth (default: `normal`)
31
+ - `quick`: Regex patterns only
32
+ - `normal`: + multi-pass analyzers
33
+ - `deep`: + CLI tools (jscpd, madge) if available
34
+
35
+ ## Detection Pipeline
36
+
37
+ ### Phase 1: Run Detection Script
38
+
39
+ The detection script is at `../../scripts/detect.js` relative to this skill.
40
+
41
+ **Run detection** (use relative path from skill directory):
42
+ ```bash
43
+ # Scripts are at plugin root: ../../scripts/ from skills/deslop/
44
+ node ../../scripts/detect.js . --thoroughness normal --compact --max 50
45
+ ```
46
+
47
+ **For diff scope** (only changed files):
48
+ ```bash
49
+ BASE=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@' || echo "main")
50
+ # Use newline-separated list to safely handle filenames with special chars
51
+ git diff --name-only origin/${BASE}..HEAD | \
52
+ xargs -d '\n' node ../../scripts/detect.js --thoroughness normal --compact
53
+ ```
54
+
55
+ **Note**: The relative path `../../scripts/detect.js` navigates from `skills/deslop/` up to the plugin root where `scripts/` lives.
56
+
57
+ ### Phase 2: Repo-Map Enhancement (Optional)
58
+
59
+ If repo-map exists, enhance detection with AST-based analysis:
60
+
61
+ ```javascript
62
+ // Use relative path from skill directory to plugin lib
63
+ // Path: skills/deslop/ -> ../../lib/repo-map
64
+ const repoMap = require('../../lib/repo-map');
65
+
66
+ if (repoMap.exists(basePath)) {
67
+ const map = repoMap.load(basePath);
68
+ const usageIndex = repoMap.buildUsageIndex(map);
69
+
70
+ // Find orphaned infrastructure with HIGH certainty
71
+ const orphaned = repoMap.findOrphanedInfrastructure(map, usageIndex);
72
+ for (const item of orphaned) {
73
+ findings.push({
74
+ file: item.file,
75
+ line: item.line,
76
+ pattern: 'orphaned-infrastructure',
77
+ message: `${item.name} (${item.type}) is never used`,
78
+ certainty: 'HIGH',
79
+ severity: 'high',
80
+ autoFix: false
81
+ });
82
+ }
83
+
84
+ // Find unused exports
85
+ const unusedExports = repoMap.findUnusedExports(map, usageIndex);
86
+ for (const item of unusedExports) {
87
+ findings.push({
88
+ file: item.file,
89
+ line: item.line,
90
+ pattern: 'unused-export',
91
+ message: `Export '${item.name}' is never imported`,
92
+ certainty: item.certainty,
93
+ severity: 'medium',
94
+ autoFix: false
95
+ });
96
+ }
97
+ }
98
+ ```
99
+
100
+ ### Phase 3: Aggregate and Prioritize
101
+
102
+ Sort findings by:
103
+ 1. **Certainty**: HIGH before MEDIUM before LOW
104
+ 2. **Severity**: high before medium before low
105
+ 3. **Fix complexity**: auto-fixable before manual
106
+
107
+ ### Phase 4: Return Structured Results
108
+
109
+ Skill returns structured JSON - does NOT apply fixes (orchestrator handles that).
110
+
111
+ ## Output Format
112
+
113
+ JSON structure between markers:
114
+
115
+ ```
116
+ === DESLOP_RESULT ===
117
+ {
118
+ "mode": "report|apply",
119
+ "scope": "all|diff|path",
120
+ "filesScanned": N,
121
+ "findings": [
122
+ {
123
+ "file": "src/api.js",
124
+ "line": 42,
125
+ "pattern": "debug-statement",
126
+ "message": "console.log found",
127
+ "certainty": "HIGH",
128
+ "severity": "medium",
129
+ "autoFix": true,
130
+ "fixType": "remove-line"
131
+ }
132
+ ],
133
+ "fixes": [
134
+ {
135
+ "file": "src/api.js",
136
+ "line": 42,
137
+ "fixType": "remove-line",
138
+ "pattern": "debug-statement"
139
+ }
140
+ ],
141
+ "summary": {
142
+ "high": N,
143
+ "medium": N,
144
+ "low": N,
145
+ "autoFixable": N
146
+ }
147
+ }
148
+ === END_RESULT ===
149
+ ```
150
+
151
+ ## Certainty Levels
152
+
153
+ | Level | Meaning | Action |
154
+ |-------|---------|--------|
155
+ | **HIGH** | Definitely slop, safe to auto-fix | Auto-fix via simple-fixer |
156
+ | **MEDIUM** | Likely slop, needs verification | Review first |
157
+ | **LOW** | Possible slop, context-dependent | Flag only |
158
+
159
+ ## Pattern Categories
160
+
161
+ ### HIGH Certainty (Auto-Fixable)
162
+
163
+ - `debug-statement`: console.log, console.debug, print, println!
164
+ - `debug-import`: Unused debug/logging imports
165
+ - `placeholder-text`: "Lorem ipsum", "TODO: implement"
166
+ - `empty-catch`: Empty catch blocks without comment
167
+ - `trailing-whitespace`: Trailing whitespace
168
+ - `mixed-indentation`: Mixed tabs/spaces
169
+
170
+ ### MEDIUM Certainty (Review Required)
171
+
172
+ - `excessive-comments`: Comment/code ratio > 2:1
173
+ - `doc-code-ratio`: JSDoc > 3x function body
174
+ - `stub-function`: Returns placeholder value only
175
+ - `dead-code`: Unreachable after return/throw
176
+ - `infrastructure-without-impl`: DB clients created but never used
177
+
178
+ ### LOW Certainty (Flag Only)
179
+
180
+ - `over-engineering`: File/export ratio > 20x
181
+ - `buzzword-inflation`: Claims without evidence
182
+ - `shotgun-surgery`: Files frequently change together
183
+
184
+ ## Fix Types
185
+
186
+ | Fix Type | Action | Patterns |
187
+ |----------|--------|----------|
188
+ | `remove-line` | Delete line | debug-statement, debug-import |
189
+ | `add-comment` | Add explanation | empty-catch |
190
+ | `remove-block` | Delete code block | stub-function with TODO |
191
+
192
+ ## Error Handling
193
+
194
+ - **Git not available**: Skip git-dependent checks
195
+ - **Invalid scope**: Return error in JSON
196
+ - **Parse errors**: Skip file, continue scan
197
+
198
+ ## Integration
199
+
200
+ This skill is invoked by:
201
+ - `deslop-agent` for `/deslop` command
202
+ - `/next-task` Phase 8 (pre-review gates) with `scope=diff`
203
+
204
+ The orchestrator spawns `simple-fixer` to apply HIGH certainty fixes.