agentsys 5.2.1 → 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 (149) 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/AGENTS.md +5 -3
  134. package/CHANGELOG.md +25 -1
  135. package/README.md +6 -5
  136. package/agent-knowledge/AGENTS.md +32 -2
  137. package/agent-knowledge/acp-with-codex-gemini-copilot-claude.md +504 -0
  138. package/agent-knowledge/kiro-supervised-autopilot.md +400 -0
  139. package/agent-knowledge/resources/acp-with-codex-gemini-copilot-claude-sources.json +408 -0
  140. package/agent-knowledge/resources/kiro-supervised-autopilot-sources.json +135 -0
  141. package/bin/cli.js +176 -9
  142. package/lib/adapter-transforms.js +224 -1
  143. package/lib/cross-platform/index.js +9 -3
  144. package/lib/discovery/index.js +22 -0
  145. package/lib/platform/state-dir.js +16 -2
  146. package/package.json +1 -1
  147. package/scripts/dev-install.js +137 -1
  148. package/scripts/gen-adapters.js +66 -4
  149. package/site/content.json +1 -1
@@ -0,0 +1,330 @@
1
+ ---
2
+ inclusion: manual
3
+ name: "audit-project"
4
+ description: "Use when user asks to \"review my code\", \"check for issues\", \"run code review\", \"analyze PR quality\". Multi-agent iterative review that loops until all critical/high issues are resolved."
5
+ ---
6
+
7
+ # /audit-project - Multi-Agent Code Review
8
+
9
+ Comprehensive code review using specialized AI agents with iterative improvement.
10
+
11
+ ## Quick Reference
12
+
13
+ | Phase | Description | Details |
14
+ |-------|-------------|---------|
15
+ | 1 | Context & Agent Selection | This file |
16
+ | 2 | Multi-Agent Review | See `audit-project-agents.md` |
17
+ | 3-4 | Tech Debt & Fixes | This file |
18
+ | 5-6 | Verification & Iteration | This file |
19
+ | 7 | Completion Report | This file |
20
+ | 8 | GitHub Issues | See `audit-project-github.md` |
21
+
22
+ ## Arguments
23
+
24
+ Parse from $ARGUMENTS:
25
+ - **Scope**: Path to review (default: `.`) or `--recent` (last 5 commits only)
26
+ - **--domain AGENT**: Review with specific agent only (e.g., `--domain security`)
27
+ - **--quick**: Single pass, no iteration (fast feedback)
28
+ - **--create-tech-debt**: Force create/update TECHNICAL_DEBT.md
29
+ - **--resume**: Resume from existing review queue file
30
+
31
+ ### Resume Mode
32
+
33
+ If `--resume` is provided, reuse the most recent review queue in the platform state dir.
34
+ Otherwise create a new queue file. See `audit-project-agents.md` for queue handling.
35
+
36
+ ## Phase 1: Context Gathering
37
+
38
+ ### Platform Detection
39
+
40
+ ```bash
41
+ # Get plugin root using Node.js helper
42
+ PLUGIN_ROOT=$(node -e " const root = getPluginRoot('audit-project'); if (!root) { console.error('Error: Could not locate audit-project plugin root'); process.exit(1); } console.log(root);")
43
+ PLATFORM=$(node "/Users/avifen/.agentsys/plugins/audit-project/lib/platform/detect-platform.js")
44
+ TOOLS=$(node "/Users/avifen/.agentsys/plugins/audit-project/lib/platform/verify-tools.js")
45
+
46
+ PROJECT_TYPE=$(echo $PLATFORM | jq -r '.projectType')
47
+ PACKAGE_MGR=$(echo $PLATFORM | jq -r '.packageManager')
48
+
49
+ # Detect framework
50
+ FRAMEWORK="unknown"
51
+ if [ "$PROJECT_TYPE" = "nodejs" ]; then
52
+ [ -n "$(jq -e '.dependencies.react' package.json 2>/dev/null)" ] && FRAMEWORK="react"
53
+ [ -n "$(jq -e '.dependencies.express' package.json 2>/dev/null)" ] && FRAMEWORK="express"
54
+ elif [ "$PROJECT_TYPE" = "python" ]; then
55
+ grep -q "django" requirements.txt 2>/dev/null && FRAMEWORK="django"
56
+ grep -q "fastapi" requirements.txt 2>/dev/null && FRAMEWORK="fastapi"
57
+ fi
58
+
59
+ RESUME_MODE=$([ "${ARGUMENTS}" != "${ARGUMENTS%--resume*}" ] && echo "true" || echo "false")
60
+ ```
61
+
62
+ ### Project Analysis
63
+
64
+ ```bash
65
+ FILE_COUNT=$(git ls-files | wc -l)
66
+ TEST_FILES=$(git ls-files | grep -E '(test|spec)\.' | wc -l)
67
+ HAS_TESTS=$( [ "$TEST_FILES" -gt 0 ] && echo "true" || echo "false" )
68
+ HAS_DB=$(grep -rq -E "(Sequelize|Prisma|TypeORM)" . 2>/dev/null && echo "true" || echo "false")
69
+ HAS_API=$(grep -rq -E "(express|fastify|@nestjs)" . 2>/dev/null && echo "true" || echo "false")
70
+ HAS_FRONTEND=$( [ "$(git ls-files | grep -E '\.(tsx|jsx|vue|svelte)$' | wc -l)" -gt 0 ] && echo "true" || echo "false" )
71
+ HAS_BACKEND=$(grep -rq -E "(express|fastify|@nestjs|koa|hapi)" . 2>/dev/null && echo "true" || echo "false")
72
+ if [ -d ".github/workflows" ] || [ -f ".gitlab-ci.yml" ] || [ -f ".circleci/config.yml" ] || \
73
+ [ -f "Jenkinsfile" ] || [ -f ".travis.yml" ] || [ -f "azure-pipelines.yml" ] || \
74
+ [ -f "bitbucket-pipelines.yml" ]; then
75
+ HAS_CICD="true"
76
+ else
77
+ HAS_CICD="false"
78
+ fi
79
+ ```
80
+
81
+ ### Agent Selection
82
+
83
+ **Always Active:**
84
+ - `code-quality-reviewer`: Code quality, error handling, maintainability
85
+ - `security-expert`: Security vulnerabilities, auth, input validation
86
+ - `performance-engineer`: Performance bottlenecks, algorithms, memory
87
+ - `test-quality-guardian`: Test coverage and quality (reports missing tests)
88
+
89
+ **Conditional:**
90
+ - `architecture-reviewer`: Design patterns (if `FILE_COUNT > 50`)
91
+ - `database-specialist`: Query optimization (if `HAS_DB=true`)
92
+ - `api-designer`: REST best practices (if `HAS_API=true`)
93
+ - `frontend-specialist`: Component design (if `HAS_FRONTEND=true`)
94
+ - `backend-specialist`: Service and domain logic (if `HAS_BACKEND=true`)
95
+ - `devops-reviewer`: CI/CD config (if `HAS_CICD=true`)
96
+
97
+ ## Phase 2: Multi-Agent Review
98
+
99
+ See `audit-project-agents.md` for detailed agent coordination.
100
+
101
+ **Review queue:** Write findings to a temporary queue file in the platform state dir and keep it updated until all issues are resolved. Remove the file when the queue is empty.
102
+
103
+ ### Finding Format (Required)
104
+
105
+ Every finding MUST include:
106
+ - **File:Line**: Exact location (e.g., `src/auth/session.ts:42`)
107
+ - **Severity**: critical | high | medium | low
108
+ - **Category**: From agent domain
109
+ - **Description**: What's wrong and why
110
+ - **Code Quote**: 1-3 lines showing issue
111
+ - **Suggested Fix**: Specific remediation
112
+ - **Effort**: small | medium | large
113
+
114
+ ### Example Finding
115
+
116
+ ```markdown
117
+ ### Finding: Unsafe SQL Query
118
+ **Agent**: security-expert
119
+ **File**: src/api/users.ts:87
120
+ **Severity**: critical
121
+ **Code**:
122
+ ```typescript
123
+ const query = `SELECT * FROM users WHERE id = ${userId}`;
124
+ ```
125
+ **Fix**: Use parameterized queries.
126
+ **Effort**: small
127
+ ```
128
+
129
+ ## Phase 3: Tech Debt Documentation
130
+
131
+ If TECHNICAL_DEBT.md exists or `--create-tech-debt`:
132
+
133
+ ```markdown
134
+ # Technical Debt
135
+
136
+ Last updated: $(date -I)
137
+
138
+ ## Summary
139
+ **Total Issues**: X | Critical: Y | High: Z | Medium: A | Low: B
140
+
141
+ ## Critical Issues
142
+ [Grouped by severity with file:line, description, fix, effort]
143
+
144
+ ## Progress Tracking
145
+ - [ ] Issue 1
146
+ - [ ] Issue 2
147
+ ```
148
+
149
+ ## Phase 4: Automated Fixes
150
+
151
+ ### Fix Strategy
152
+
153
+ 1. **Auto-fixable** (lint, formatting): Apply directly
154
+ 2. **Manual fix** (code logic): Implement suggested fix
155
+ 3. **Design decision required**: Flag as blocked and report to user
156
+ 4. **False positive**: Mark and remove from review queue
157
+
158
+ ### Fix Order
159
+
160
+ 1. Critical severity first
161
+ 2. Then high → medium → low
162
+ 3. Then by effort (small → large)
163
+ 4. Then batch by file
164
+
165
+ ## Phase 5: Verification
166
+
167
+ ```bash
168
+ # Run tests
169
+ [ -n "$TEST_CMD" ] && $TEST_CMD
170
+ TEST_STATUS=$?
171
+
172
+ # Run linter
173
+ [ -n "$LINT_CMD" ] && $LINT_CMD
174
+ LINT_STATUS=$?
175
+
176
+ # Run build
177
+ [ -n "$BUILD_CMD" ] && $BUILD_CMD
178
+ BUILD_STATUS=$?
179
+
180
+ # Overall status
181
+ VERIFICATION_PASSED=$([ $TEST_STATUS -eq 0 ] && [ $LINT_STATUS -eq 0 ] && [ $BUILD_STATUS -eq 0 ] && echo "true" || echo "false")
182
+ ```
183
+
184
+ ### Handle Failures
185
+
186
+ If verification fails:
187
+ 1. Review recent changes (`git diff`)
188
+ 2. Identify breaking fix
189
+ 3. Rollback: `git restore <file>`
190
+ 4. Document as "fix caused regression"
191
+
192
+ ## Phase 6: Iteration
193
+
194
+ ```javascript
195
+ const initialReview = /* results from Phase 2 review */;
196
+ const initialIssues = Array.isArray(initialReview?.issues) ? initialReview.issues : [];
197
+ let iteration = 1;
198
+ let remainingIssues = initialIssues;
199
+
200
+ while (remainingIssues.length > 0) {
201
+ const fixResult = applyFixes(remainingIssues);
202
+
203
+ const verifyResult = runVerification();
204
+ if (!verifyResult.passed) {
205
+ rollbackFailed(fixResult);
206
+ }
207
+
208
+ const reReviewResult = reReview(fixResult.changedFiles);
209
+ remainingIssues = reReviewResult.issues;
210
+
211
+ if (remainingIssues.length === 0) {
212
+ console.log("[OK] Zero issues remaining!");
213
+ break;
214
+ }
215
+
216
+ iteration++;
217
+ }
218
+ ```
219
+
220
+ ### Quick Mode
221
+
222
+ If `--quick` flag: Single pass, findings only, no fixes.
223
+
224
+ ## Phase 6.5: Decision Gate (User)
225
+
226
+ After each iteration (or after re-review if issues remain), report the queue state and ask the user what to do next.
227
+
228
+ ```javascript
229
+ const openCount = remainingIssues.length;
230
+ console.log(`Open issues: ${openCount}`);
231
+ console.log(`Queue file: ${reviewQueuePath}`); // set in Phase 2 (audit-project-agents)
232
+
233
+ const decision = **Review queue still open. What next?**
234
+
235
+ 1. **Continue review** - Run another iteration
236
+ 2. **Create issues** - Stop and create issues
237
+ 3. **Update tech debt** - Stop and update TECHNICAL_DEBT.md
238
+ 4. **Leave queue** - Stop and keep queue for resume
239
+
240
+ Reply with the number or name of your choice.
241
+
242
+ const choice = decision[0];
243
+ if (choice === 'Continue review') {
244
+ // continue loop
245
+ } else if (choice === 'Create issues') {
246
+ // Create issues and remove queue file
247
+ } else if (choice === 'Update tech debt') {
248
+ // Update TECHNICAL_DEBT.md and remove queue file
249
+ } else if (choice === 'Leave queue') {
250
+ // Leave queue file for --resume
251
+ break;
252
+ }
253
+ ```
254
+
255
+ ## Phase 7: Completion Report
256
+
257
+ ```markdown
258
+ # Project Review Complete
259
+
260
+ **Scope**: ${SCOPE} | **Framework**: ${FRAMEWORK}
261
+ **Iterations**: ${iteration} | **Duration**: ${duration}
262
+
263
+ ## Summary
264
+ **Issues Found**: ${initialCount}
265
+ **Issues Fixed**: ${fixedCount}
266
+ **Remaining**: ${remainingCount}
267
+
268
+ ## By Severity
269
+ - Critical: ${criticalFound} → ${criticalRemaining}
270
+ - High: ${highFound} → ${highRemaining}
271
+ - Medium: ${mediumFound} → ${mediumRemaining}
272
+ - Low: ${lowFound} → ${lowRemaining}
273
+
274
+ ## Verification
275
+ - Tests: [OK]/[FAIL]
276
+ - Linter: [OK]/[FAIL]
277
+ - Build: [OK]/[FAIL]
278
+
279
+ ## Files Changed
280
+ ${FILE_COUNT} files modified
281
+
282
+ ## Remaining Issues
283
+ [List of issues needing attention]
284
+ ```
285
+
286
+ ## Phase 8: GitHub Issue Creation
287
+
288
+ See `audit-project-github.md` for:
289
+ - Creating GitHub issues for deferred items
290
+ - Security issue handling (no public issues)
291
+ - TECHNICAL_DEBT.md cleanup
292
+
293
+ ## Error Handling
294
+
295
+ ### No Framework Detected
296
+ ```
297
+ Framework detection failed, using generic patterns.
298
+ ```
299
+
300
+ ### No Tests Available
301
+ ```
302
+ No test suite detected. Skipping test-quality-guardian.
303
+ ```
304
+
305
+ ### All Agents Failed
306
+ ```
307
+ ERROR: All review agents failed.
308
+ Try: --recent or specific path for smaller scope.
309
+ ```
310
+
311
+ ## Usage Examples
312
+
313
+ ```bash
314
+ /audit-project # Full review
315
+ /audit-project --recent # Last 5 commits only
316
+ /audit-project src/api # Specific path
317
+ /audit-project --domain security # Security audit only
318
+ /audit-project --quick # Fast feedback, no fixes
319
+ /audit-project --create-tech-debt # Force tech debt file
320
+ ```
321
+
322
+ ## Success Criteria
323
+
324
+ - [OK] All agents completed review
325
+ - [OK] Evidence-based findings (file:line provided)
326
+ - [OK] Critical issues fixed or documented
327
+ - [OK] Verification passes
328
+ - [OK] TECHNICAL_DEBT.md updated (if enabled)
329
+
330
+ Begin Phase 1 now.