agentsys 5.3.0 → 5.3.2
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-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.cursor/commands/audit-project-agents.md +454 -0
- package/.cursor/commands/audit-project-github.md +141 -0
- package/.cursor/commands/audit-project.md +330 -0
- package/.cursor/commands/consult.md +417 -0
- package/.cursor/commands/debate.md +381 -0
- package/.cursor/commands/delivery-approval.md +334 -0
- package/.cursor/commands/deslop.md +142 -0
- package/.cursor/commands/drift-detect.md +259 -0
- package/.cursor/commands/enhance.md +172 -0
- package/.cursor/commands/learn.md +165 -0
- package/.cursor/commands/next-task.md +519 -0
- package/.cursor/commands/perf.md +464 -0
- package/.cursor/commands/repo-map.md +124 -0
- package/.cursor/commands/ship-ci-review-loop.md +468 -0
- package/.cursor/commands/ship-deployment.md +348 -0
- package/.cursor/commands/ship-error-handling.md +265 -0
- package/.cursor/commands/ship.md +517 -0
- package/.cursor/commands/sync-docs.md +171 -0
- package/.cursor/commands/web-ctl.md +101 -0
- package/.cursor/skills/consult/SKILL.md +425 -0
- package/.cursor/skills/debate/SKILL.md +316 -0
- package/.cursor/skills/deslop/SKILL.md +204 -0
- package/.cursor/skills/discover-tasks/SKILL.md +297 -0
- package/.cursor/skills/drift-analysis/SKILL.md +324 -0
- package/.cursor/skills/enhance-agent-prompts/SKILL.md +277 -0
- package/.cursor/skills/enhance-claude-memory/SKILL.md +387 -0
- package/.cursor/skills/enhance-cross-file/SKILL.md +110 -0
- package/.cursor/skills/enhance-docs/SKILL.md +298 -0
- package/.cursor/skills/enhance-hooks/SKILL.md +554 -0
- package/.cursor/skills/enhance-orchestrator/SKILL.md +255 -0
- package/.cursor/skills/enhance-plugins/SKILL.md +319 -0
- package/.cursor/skills/enhance-prompts/SKILL.md +340 -0
- package/.cursor/skills/enhance-skills/SKILL.md +436 -0
- package/.cursor/skills/learn/SKILL.md +349 -0
- package/.cursor/skills/orchestrate-review/SKILL.md +260 -0
- package/.cursor/skills/perf-analyzer/SKILL.md +37 -0
- package/.cursor/skills/perf-baseline-manager/SKILL.md +30 -0
- package/.cursor/skills/perf-benchmarker/SKILL.md +52 -0
- package/.cursor/skills/perf-code-paths/SKILL.md +32 -0
- package/.cursor/skills/perf-investigation-logger/SKILL.md +41 -0
- package/.cursor/skills/perf-profiler/SKILL.md +42 -0
- package/.cursor/skills/perf-theory-gatherer/SKILL.md +35 -0
- package/.cursor/skills/perf-theory-tester/SKILL.md +36 -0
- package/.cursor/skills/repo-mapping/SKILL.md +83 -0
- package/.cursor/skills/sync-docs/SKILL.md +351 -0
- package/.cursor/skills/validate-delivery/SKILL.md +186 -0
- package/.cursor/skills/web-auth/SKILL.md +177 -0
- package/.cursor/skills/web-browse/SKILL.md +516 -0
- package/.kiro/agents/agent-enhancer.json +12 -0
- package/.kiro/agents/ci-fixer.json +13 -0
- package/.kiro/agents/ci-monitor.json +12 -0
- package/.kiro/agents/claudemd-enhancer.json +12 -0
- package/.kiro/agents/consult-agent.json +13 -0
- package/.kiro/agents/cross-file-enhancer.json +12 -0
- package/.kiro/agents/debate-orchestrator.json +13 -0
- package/.kiro/agents/delivery-validator.json +12 -0
- package/.kiro/agents/deslop-agent.json +12 -0
- package/.kiro/agents/docs-enhancer.json +12 -0
- package/.kiro/agents/exploration-agent.json +12 -0
- package/.kiro/agents/hooks-enhancer.json +11 -0
- package/.kiro/agents/implementation-agent.json +13 -0
- package/.kiro/agents/learn-agent.json +12 -0
- package/.kiro/agents/map-validator.json +11 -0
- package/.kiro/agents/perf-analyzer.json +12 -0
- package/.kiro/agents/perf-code-paths.json +11 -0
- package/.kiro/agents/perf-investigation-logger.json +12 -0
- package/.kiro/agents/perf-orchestrator.json +13 -0
- package/.kiro/agents/perf-theory-gatherer.json +12 -0
- package/.kiro/agents/perf-theory-tester.json +13 -0
- package/.kiro/agents/plan-synthesizer.json +12 -0
- package/.kiro/agents/planning-agent.json +12 -0
- package/.kiro/agents/plugin-enhancer.json +12 -0
- package/.kiro/agents/prompt-enhancer.json +12 -0
- package/.kiro/agents/reviewer-perf-test.json +11 -0
- package/.kiro/agents/reviewer-quality-security.json +11 -0
- package/.kiro/agents/simple-fixer.json +13 -0
- package/.kiro/agents/skills-enhancer.json +11 -0
- package/.kiro/agents/sync-docs-agent.json +13 -0
- package/.kiro/agents/task-discoverer.json +12 -0
- package/.kiro/agents/test-coverage-checker.json +12 -0
- package/.kiro/agents/web-session.json +12 -0
- package/.kiro/agents/worktree-manager.json +13 -0
- package/.kiro/skills/consult/SKILL.md +425 -0
- package/.kiro/skills/debate/SKILL.md +316 -0
- package/.kiro/skills/deslop/SKILL.md +204 -0
- package/.kiro/skills/discover-tasks/SKILL.md +297 -0
- package/.kiro/skills/drift-analysis/SKILL.md +324 -0
- package/.kiro/skills/enhance-agent-prompts/SKILL.md +277 -0
- package/.kiro/skills/enhance-claude-memory/SKILL.md +387 -0
- package/.kiro/skills/enhance-cross-file/SKILL.md +110 -0
- package/.kiro/skills/enhance-docs/SKILL.md +298 -0
- package/.kiro/skills/enhance-hooks/SKILL.md +554 -0
- package/.kiro/skills/enhance-orchestrator/SKILL.md +255 -0
- package/.kiro/skills/enhance-plugins/SKILL.md +319 -0
- package/.kiro/skills/enhance-prompts/SKILL.md +340 -0
- package/.kiro/skills/enhance-skills/SKILL.md +436 -0
- package/.kiro/skills/learn/SKILL.md +349 -0
- package/.kiro/skills/orchestrate-review/SKILL.md +260 -0
- package/.kiro/skills/perf-analyzer/SKILL.md +37 -0
- package/.kiro/skills/perf-baseline-manager/SKILL.md +30 -0
- package/.kiro/skills/perf-benchmarker/SKILL.md +52 -0
- package/.kiro/skills/perf-code-paths/SKILL.md +32 -0
- package/.kiro/skills/perf-investigation-logger/SKILL.md +41 -0
- package/.kiro/skills/perf-profiler/SKILL.md +42 -0
- package/.kiro/skills/perf-theory-gatherer/SKILL.md +35 -0
- package/.kiro/skills/perf-theory-tester/SKILL.md +36 -0
- package/.kiro/skills/repo-mapping/SKILL.md +83 -0
- package/.kiro/skills/sync-docs/SKILL.md +351 -0
- package/.kiro/skills/validate-delivery/SKILL.md +186 -0
- package/.kiro/skills/web-auth/SKILL.md +177 -0
- package/.kiro/skills/web-browse/SKILL.md +516 -0
- package/.kiro/steering/audit-project-agents.md +459 -0
- package/.kiro/steering/audit-project-github.md +146 -0
- package/.kiro/steering/audit-project.md +330 -0
- package/.kiro/steering/consult.md +422 -0
- package/.kiro/steering/debate.md +386 -0
- package/.kiro/steering/delivery-approval.md +339 -0
- package/.kiro/steering/deslop.md +149 -0
- package/.kiro/steering/drift-detect.md +264 -0
- package/.kiro/steering/enhance.md +177 -0
- package/.kiro/steering/learn.md +166 -0
- package/.kiro/steering/next-task.md +481 -0
- package/.kiro/steering/perf.md +469 -0
- package/.kiro/steering/repo-map.md +126 -0
- package/.kiro/steering/ship-ci-review-loop.md +473 -0
- package/.kiro/steering/ship-deployment.md +353 -0
- package/.kiro/steering/ship-error-handling.md +270 -0
- package/.kiro/steering/ship.md +522 -0
- package/.kiro/steering/sync-docs.md +178 -0
- package/.kiro/steering/web-ctl.md +106 -0
- package/CHANGELOG.md +15 -0
- package/bin/cli.js +2 -2
- package/lib/adapter-transforms.js +34 -2
- package/package.json +1 -1
- package/site/content.json +1 -1
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
---
|
|
2
|
+
inclusion: manual
|
|
3
|
+
name: "delivery-approval"
|
|
4
|
+
description: "Use when user asks to \"validate delivery\", \"approve for shipping\", \"check if ready to ship\", \"verify task completion\". Autonomous validation that tests pass, build succeeds, and requirements are met."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /delivery-approval - Delivery Validation
|
|
8
|
+
|
|
9
|
+
Validate that the current work is complete and ready to ship.
|
|
10
|
+
This command runs the same validation as the workflow's delivery-validator agent.
|
|
11
|
+
|
|
12
|
+
## Arguments
|
|
13
|
+
|
|
14
|
+
- `--task-id ID`: Specify task ID to validate against (default: from workflow state)
|
|
15
|
+
- `--verbose`: Show detailed output for each check
|
|
16
|
+
|
|
17
|
+
## Parse Arguments
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
const args = $ARGUMENTS.split(' ').filter(Boolean);
|
|
21
|
+
const verbose = args.includes('--verbose');
|
|
22
|
+
const taskIdArg = args.find(a => a.startsWith('--task-id'));
|
|
23
|
+
const taskId = taskIdArg ? args[args.indexOf(taskIdArg) + 1] : null;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Phase 1: Get Context
|
|
27
|
+
|
|
28
|
+
```javascript
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const pluginRoot = getPluginRoot('next-task');
|
|
33
|
+
if (!pluginRoot) {
|
|
34
|
+
console.error('Error: Could not locate next-task plugin installation');
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
let task;
|
|
41
|
+
let changedFiles;
|
|
42
|
+
|
|
43
|
+
// Try to get from workflow state first
|
|
44
|
+
const state = workflowState.readState();
|
|
45
|
+
if (state?.task) {
|
|
46
|
+
task = state.task;
|
|
47
|
+
} else if (taskId) {
|
|
48
|
+
// Fetch task from GitHub
|
|
49
|
+
task = await fetchGitHubIssue(taskId);
|
|
50
|
+
} else {
|
|
51
|
+
// Get from recent commit message
|
|
52
|
+
task = await inferTaskFromCommits();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Get changed files
|
|
56
|
+
changedFiles = (await exec('git diff --name-only origin/main..HEAD')).split('\n').filter(Boolean);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Phase 2: Run Validation Checks
|
|
60
|
+
|
|
61
|
+
### Check 1: Git State
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Check for uncommitted changes
|
|
65
|
+
UNCOMMITTED=$(git status --porcelain)
|
|
66
|
+
if [ -n "$UNCOMMITTED" ]; then
|
|
67
|
+
echo "UNCOMMITTED_CHANGES=true"
|
|
68
|
+
echo "$UNCOMMITTED"
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
# Check if ahead of remote
|
|
72
|
+
AHEAD=$(git rev-list --count origin/main..HEAD)
|
|
73
|
+
echo "COMMITS_AHEAD=$AHEAD"
|
|
74
|
+
|
|
75
|
+
# Check branch name
|
|
76
|
+
BRANCH=$(git branch --show-current)
|
|
77
|
+
echo "BRANCH=$BRANCH"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Check 2: Tests Pass
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Detect and run tests
|
|
84
|
+
if [ -f "package.json" ]; then
|
|
85
|
+
if grep -q '"test"' package.json; then
|
|
86
|
+
echo "Running npm test..."
|
|
87
|
+
npm test 2>&1
|
|
88
|
+
TEST_RESULT=$?
|
|
89
|
+
echo "TEST_RESULT=$TEST_RESULT"
|
|
90
|
+
else
|
|
91
|
+
echo "NO_TEST_SCRIPT=true"
|
|
92
|
+
fi
|
|
93
|
+
elif [ -f "pytest.ini" ] || [ -f "pyproject.toml" ]; then
|
|
94
|
+
echo "Running pytest..."
|
|
95
|
+
pytest -v 2>&1
|
|
96
|
+
TEST_RESULT=$?
|
|
97
|
+
echo "TEST_RESULT=$TEST_RESULT"
|
|
98
|
+
elif [ -f "Cargo.toml" ]; then
|
|
99
|
+
echo "Running cargo test..."
|
|
100
|
+
cargo test 2>&1
|
|
101
|
+
TEST_RESULT=$?
|
|
102
|
+
echo "TEST_RESULT=$TEST_RESULT"
|
|
103
|
+
elif [ -f "go.mod" ]; then
|
|
104
|
+
echo "Running go test..."
|
|
105
|
+
go test ./... -v 2>&1
|
|
106
|
+
TEST_RESULT=$?
|
|
107
|
+
echo "TEST_RESULT=$TEST_RESULT"
|
|
108
|
+
fi
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Check 3: Build Passes
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Detect and run build
|
|
115
|
+
if [ -f "package.json" ] && grep -q '"build"' package.json; then
|
|
116
|
+
echo "Running npm run build..."
|
|
117
|
+
npm run build 2>&1
|
|
118
|
+
BUILD_RESULT=$?
|
|
119
|
+
echo "BUILD_RESULT=$BUILD_RESULT"
|
|
120
|
+
elif [ -f "Cargo.toml" ]; then
|
|
121
|
+
echo "Running cargo build..."
|
|
122
|
+
cargo build --release 2>&1
|
|
123
|
+
BUILD_RESULT=$?
|
|
124
|
+
echo "BUILD_RESULT=$BUILD_RESULT"
|
|
125
|
+
elif [ -f "go.mod" ]; then
|
|
126
|
+
echo "Running go build..."
|
|
127
|
+
go build ./... 2>&1
|
|
128
|
+
BUILD_RESULT=$?
|
|
129
|
+
echo "BUILD_RESULT=$BUILD_RESULT"
|
|
130
|
+
else
|
|
131
|
+
echo "NO_BUILD_SCRIPT=true"
|
|
132
|
+
BUILD_RESULT=0
|
|
133
|
+
fi
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Check 4: Lint Passes
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Run linter if available
|
|
140
|
+
if [ -f "package.json" ] && grep -q '"lint"' package.json; then
|
|
141
|
+
echo "Running npm run lint..."
|
|
142
|
+
npm run lint 2>&1
|
|
143
|
+
LINT_RESULT=$?
|
|
144
|
+
echo "LINT_RESULT=$LINT_RESULT"
|
|
145
|
+
elif [ -f ".eslintrc.js" ] || [ -f ".eslintrc.json" ]; then
|
|
146
|
+
echo "Running eslint..."
|
|
147
|
+
npx eslint . 2>&1
|
|
148
|
+
LINT_RESULT=$?
|
|
149
|
+
echo "LINT_RESULT=$LINT_RESULT"
|
|
150
|
+
else
|
|
151
|
+
echo "NO_LINTER=true"
|
|
152
|
+
LINT_RESULT=0
|
|
153
|
+
fi
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Check 5: Type Check (TypeScript)
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
if [ -f "tsconfig.json" ]; then
|
|
160
|
+
echo "Running tsc --noEmit..."
|
|
161
|
+
npx tsc --noEmit 2>&1
|
|
162
|
+
TYPE_RESULT=$?
|
|
163
|
+
echo "TYPE_RESULT=$TYPE_RESULT"
|
|
164
|
+
else
|
|
165
|
+
echo "NO_TYPESCRIPT=true"
|
|
166
|
+
TYPE_RESULT=0
|
|
167
|
+
fi
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Phase 3: Check Task Requirements
|
|
171
|
+
|
|
172
|
+
```javascript
|
|
173
|
+
async function checkRequirements(task, changedFiles) {
|
|
174
|
+
if (!task) {
|
|
175
|
+
return { passed: true, reason: 'No task specified, skipping requirements check' };
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const requirements = extractRequirements(task.description || task.body || '');
|
|
179
|
+
|
|
180
|
+
if (requirements.length === 0) {
|
|
181
|
+
return { passed: true, reason: 'No specific requirements found in task' };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Analyze changed files for each requirement
|
|
185
|
+
const results = [];
|
|
186
|
+
for (const req of requirements) {
|
|
187
|
+
const evidence = await findEvidence(req, changedFiles);
|
|
188
|
+
results.push({
|
|
189
|
+
requirement: req,
|
|
190
|
+
implemented: evidence.found,
|
|
191
|
+
evidence: evidence.details
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const allMet = results.every(r => r.implemented);
|
|
196
|
+
return {
|
|
197
|
+
passed: allMet,
|
|
198
|
+
results,
|
|
199
|
+
reason: allMet ? 'All requirements met' : 'Some requirements not implemented'
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Phase 4: Aggregate Results
|
|
205
|
+
|
|
206
|
+
```javascript
|
|
207
|
+
const checks = {
|
|
208
|
+
gitState: {
|
|
209
|
+
passed: !UNCOMMITTED_CHANGES,
|
|
210
|
+
uncommitted: UNCOMMITTED_CHANGES,
|
|
211
|
+
commitsAhead: COMMITS_AHEAD,
|
|
212
|
+
branch: BRANCH
|
|
213
|
+
},
|
|
214
|
+
tests: {
|
|
215
|
+
passed: TEST_RESULT === 0,
|
|
216
|
+
exitCode: TEST_RESULT
|
|
217
|
+
},
|
|
218
|
+
build: {
|
|
219
|
+
passed: BUILD_RESULT === 0,
|
|
220
|
+
exitCode: BUILD_RESULT
|
|
221
|
+
},
|
|
222
|
+
lint: {
|
|
223
|
+
passed: LINT_RESULT === 0,
|
|
224
|
+
exitCode: LINT_RESULT
|
|
225
|
+
},
|
|
226
|
+
typeCheck: {
|
|
227
|
+
passed: TYPE_RESULT === 0,
|
|
228
|
+
exitCode: TYPE_RESULT
|
|
229
|
+
},
|
|
230
|
+
requirements: await checkRequirements(task, changedFiles)
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
const allPassed = Object.values(checks).every(c => c.passed);
|
|
234
|
+
const failedChecks = Object.entries(checks)
|
|
235
|
+
.filter(([_, v]) => !v.passed)
|
|
236
|
+
.map(([k, _]) => k);
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Phase 5: Output Results
|
|
240
|
+
|
|
241
|
+
### Summary Report
|
|
242
|
+
|
|
243
|
+
```markdown
|
|
244
|
+
## Delivery Validation Report
|
|
245
|
+
|
|
246
|
+
**Task**: ${task?.title || 'N/A'}
|
|
247
|
+
**Branch**: ${BRANCH}
|
|
248
|
+
**Commits ahead of main**: ${COMMITS_AHEAD}
|
|
249
|
+
|
|
250
|
+
### Validation Results
|
|
251
|
+
|
|
252
|
+
| Check | Status | Details |
|
|
253
|
+
|-------|--------|---------|
|
|
254
|
+
| Git State | ${checks.gitState.passed ? '[OK]' : '[FAIL]'} | ${checks.gitState.uncommitted ? 'Uncommitted changes' : 'Clean'} |
|
|
255
|
+
| Tests | ${checks.tests.passed ? '[OK]' : '[FAIL]'} | Exit code: ${checks.tests.exitCode} |
|
|
256
|
+
| Build | ${checks.build.passed ? '[OK]' : '[FAIL]'} | Exit code: ${checks.build.exitCode} |
|
|
257
|
+
| Lint | ${checks.lint.passed ? '[OK]' : '[FAIL]'} | Exit code: ${checks.lint.exitCode} |
|
|
258
|
+
| Type Check | ${checks.typeCheck.passed ? '[OK]' : '[FAIL]'} | Exit code: ${checks.typeCheck.exitCode} |
|
|
259
|
+
| Requirements | ${checks.requirements.passed ? '[OK]' : '[FAIL]'} | ${checks.requirements.reason} |
|
|
260
|
+
|
|
261
|
+
### Overall Status
|
|
262
|
+
|
|
263
|
+
${allPassed ?
|
|
264
|
+
'## [OK] APPROVED\nAll validation checks passed. Ready to ship!' :
|
|
265
|
+
`## [FAIL] NOT APPROVED\nFailed checks: ${failedChecks.join(', ')}`}
|
|
266
|
+
|
|
267
|
+
${!allPassed ? `
|
|
268
|
+
### Fix Required
|
|
269
|
+
|
|
270
|
+
${failedChecks.map(check => {
|
|
271
|
+
switch(check) {
|
|
272
|
+
case 'gitState': return '- Commit or stash uncommitted changes';
|
|
273
|
+
case 'tests': return '- Fix failing tests';
|
|
274
|
+
case 'build': return '- Fix build errors';
|
|
275
|
+
case 'lint': return '- Fix linting errors';
|
|
276
|
+
case 'typeCheck': return '- Fix TypeScript errors';
|
|
277
|
+
case 'requirements': return '- Implement missing requirements';
|
|
278
|
+
}
|
|
279
|
+
}).join('\n')}
|
|
280
|
+
` : ''}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### JSON Output (for scripting)
|
|
284
|
+
|
|
285
|
+
```json
|
|
286
|
+
{
|
|
287
|
+
"approved": ${allPassed},
|
|
288
|
+
"task": {
|
|
289
|
+
"id": "${task?.id || 'N/A'}",
|
|
290
|
+
"title": "${task?.title || 'N/A'}"
|
|
291
|
+
},
|
|
292
|
+
"checks": {
|
|
293
|
+
"gitState": ${JSON.stringify(checks.gitState)},
|
|
294
|
+
"tests": ${JSON.stringify(checks.tests)},
|
|
295
|
+
"build": ${JSON.stringify(checks.build)},
|
|
296
|
+
"lint": ${JSON.stringify(checks.lint)},
|
|
297
|
+
"typeCheck": ${JSON.stringify(checks.typeCheck)},
|
|
298
|
+
"requirements": ${JSON.stringify(checks.requirements)}
|
|
299
|
+
},
|
|
300
|
+
"failedChecks": ${JSON.stringify(failedChecks)},
|
|
301
|
+
"summary": "${allPassed ? 'All checks passed' : `Failed: ${failedChecks.join(', ')}`}"
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## Examples
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# Basic validation
|
|
309
|
+
/delivery-approval
|
|
310
|
+
|
|
311
|
+
# With verbose output
|
|
312
|
+
/delivery-approval --verbose
|
|
313
|
+
|
|
314
|
+
# For specific task
|
|
315
|
+
/delivery-approval --task-id 142
|
|
316
|
+
|
|
317
|
+
# Combined
|
|
318
|
+
/delivery-approval --task-id 142 --verbose
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## Integration with Workflow
|
|
322
|
+
|
|
323
|
+
When called from the next-task workflow:
|
|
324
|
+
1. Task context is read from workflow state
|
|
325
|
+
2. Results are written back to workflow state
|
|
326
|
+
3. Workflow continues to ship phase if approved
|
|
327
|
+
|
|
328
|
+
When called standalone:
|
|
329
|
+
1. Attempts to infer task from commits
|
|
330
|
+
2. Runs all validation checks
|
|
331
|
+
3. Reports results but doesn't modify workflow state
|
|
332
|
+
|
|
333
|
+
## Success Criteria
|
|
334
|
+
|
|
335
|
+
- Runs all validation checks (tests, build, lint, types)
|
|
336
|
+
- Checks task requirements if available
|
|
337
|
+
- Provides clear pass/fail determination
|
|
338
|
+
- Shows actionable fixes for failures
|
|
339
|
+
- Works both standalone and in workflow context
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
inclusion: manual
|
|
3
|
+
name: "deslop"
|
|
4
|
+
description: "Use when user asks to \"clean up slop\", \"remove AI artifacts\", \"deslop the codebase\", \"find debug statements\", \"remove console.logs\", \"repo hygiene\". Detects and removes AI-generated slop patterns."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /deslop - AI Slop Cleanup
|
|
8
|
+
|
|
9
|
+
Senior maintainer performing periodic repo hygiene. Mission: remove AI-generated slop while preserving behavior and minimizing diffs.
|
|
10
|
+
|
|
11
|
+
## Constraints (Priority Order)
|
|
12
|
+
|
|
13
|
+
When constraints conflict, follow this priority:
|
|
14
|
+
|
|
15
|
+
1. **Preserve behavior and public APIs** (highest priority)
|
|
16
|
+
2. **Minimal diffs** - do not reformat unrelated code
|
|
17
|
+
3. **Prefer deletion over invention**
|
|
18
|
+
4. **No new dependencies or abstractions**
|
|
19
|
+
5. **Respect repo conventions** (check CLAUDE.md/AGENTS.md)
|
|
20
|
+
|
|
21
|
+
## Arguments
|
|
22
|
+
|
|
23
|
+
Parse from $ARGUMENTS or use defaults:
|
|
24
|
+
|
|
25
|
+
- **Mode**: `report` (default) or `apply`
|
|
26
|
+
- **Scope**: `all` (default), `diff`, or path
|
|
27
|
+
- **Thoroughness**: `quick`, `normal` (default), or `deep`
|
|
28
|
+
|
|
29
|
+
## Execution
|
|
30
|
+
|
|
31
|
+
### Phase 1: Spawn Deslop Agent
|
|
32
|
+
|
|
33
|
+
```javascript
|
|
34
|
+
// Parse arguments
|
|
35
|
+
const args = '$ARGUMENTS'.split(' ').filter(Boolean);
|
|
36
|
+
const mode = args.includes('apply') ? 'apply' : 'report';
|
|
37
|
+
const thoroughness = args.find(a => a.startsWith('--thoroughness='))?.split('=')[1] || 'normal';
|
|
38
|
+
const scope = args.find(a => a.startsWith('--scope='))?.split('=')[1] ||
|
|
39
|
+
args.find(a => !a.startsWith('-') && a !== 'report' && a !== 'apply') || 'all';
|
|
40
|
+
|
|
41
|
+
// Spawn agent to get findings
|
|
42
|
+
const result = Delegate to the `deslop-agent` subagent:
|
|
43
|
+
> Scan for AI slop patterns.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Phase 2: Parse Agent Results
|
|
47
|
+
|
|
48
|
+
Extract structured JSON from agent output:
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
function parseDeslop(output) {
|
|
52
|
+
const match = output.match(/=== DESLOP_RESULT ===[\s\S]*?({[\s\S]*?})[\s\S]*?=== END_RESULT ===/);
|
|
53
|
+
return match ? JSON.parse(match[1]) : { fixes: [] };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const findings = parseDeslop(result);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Phase 3: Handle Mode
|
|
60
|
+
|
|
61
|
+
#### Report Mode (Default)
|
|
62
|
+
|
|
63
|
+
Present findings as markdown table:
|
|
64
|
+
|
|
65
|
+
```markdown
|
|
66
|
+
## Slop Hotspots
|
|
67
|
+
|
|
68
|
+
| Priority | File | Issue | Certainty | Fix |
|
|
69
|
+
|----------|------|-------|-----------|-----|
|
|
70
|
+
| 1 | src/api.js:42 | console.log | HIGH | auto |
|
|
71
|
+
| 2 | src/auth.js:15 | empty catch | HIGH | auto |
|
|
72
|
+
| 3 | lib/utils.js:88 | excessive comments | MEDIUM | review |
|
|
73
|
+
|
|
74
|
+
## Summary
|
|
75
|
+
|
|
76
|
+
- **HIGH certainty**: N (auto-fixable)
|
|
77
|
+
- **MEDIUM certainty**: N (review required)
|
|
78
|
+
- **LOW certainty**: N (flagged only)
|
|
79
|
+
|
|
80
|
+
## Do Next
|
|
81
|
+
|
|
82
|
+
- [ ] Run `/deslop apply` to auto-fix HIGH certainty items
|
|
83
|
+
- [ ] Review MEDIUM certainty items manually
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
#### Apply Mode
|
|
87
|
+
|
|
88
|
+
If fixes array is non-empty, spawn simple-fixer:
|
|
89
|
+
|
|
90
|
+
```javascript
|
|
91
|
+
if (mode === 'apply' && findings?.fixes?.length > 0) {
|
|
92
|
+
Delegate to the `simple-fixer` subagent:
|
|
93
|
+
> Apply these slop fixes:
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Present results:
|
|
98
|
+
|
|
99
|
+
```markdown
|
|
100
|
+
## Applied Fixes
|
|
101
|
+
|
|
102
|
+
| File | Line | Fix |
|
|
103
|
+
|------|------|-----|
|
|
104
|
+
| src/api.js | 42 | remove-line (console.log) |
|
|
105
|
+
| src/auth.js | 15 | add-comment (empty catch) |
|
|
106
|
+
|
|
107
|
+
**Total**: N fixes applied
|
|
108
|
+
|
|
109
|
+
## Remaining (manual review needed)
|
|
110
|
+
|
|
111
|
+
| File | Line | Issue | Certainty |
|
|
112
|
+
|------|------|-------|-----------|
|
|
113
|
+
| lib/utils.js | 88 | excessive comments | MEDIUM |
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Verification Strategy
|
|
117
|
+
|
|
118
|
+
After fixes are applied, run project's test command:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
npm test
|
|
122
|
+
# or pytest, cargo test, go test ./...
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
On failure: `git restore .` and report which change failed.
|
|
126
|
+
|
|
127
|
+
## Ignore Zones
|
|
128
|
+
|
|
129
|
+
Skip these paths (handled by detection script):
|
|
130
|
+
- Build artifacts: `dist/`, `build/`, `target/`, `out/`, `.next/`
|
|
131
|
+
- Vendored: `vendor/`, `node_modules/`, `**/*.min.*`
|
|
132
|
+
- Generated: `**/*.gen.*`, lockfiles
|
|
133
|
+
|
|
134
|
+
## Error Handling
|
|
135
|
+
|
|
136
|
+
- Git not available: Exit with "Git required for rollback safety"
|
|
137
|
+
- Invalid scope path: Exit with "Path not found: <path>"
|
|
138
|
+
- Verification fails: Rollback with `git restore .`, report failure
|
|
139
|
+
|
|
140
|
+
## Additional Resources
|
|
141
|
+
|
|
142
|
+
### Reference Files
|
|
143
|
+
|
|
144
|
+
For detailed pattern documentation, consult:
|
|
145
|
+
- **`references/slop-categories.md`** - All pattern categories, severity levels, certainty thresholds, auto-fix strategies
|
|
146
|
+
|
|
147
|
+
### Scripts
|
|
148
|
+
|
|
149
|
+
- **`scripts/detect.js`** - Detection pipeline CLI (run with `--help` for options)
|