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
+ # /audit-project - Multi-Agent Code Review
3
+
4
+ Comprehensive code review using specialized AI agents with iterative improvement.
5
+
6
+ ## Quick Reference
7
+
8
+ | Phase | Description | Details |
9
+ |-------|-------------|---------|
10
+ | 1 | Context & Agent Selection | This file |
11
+ | 2 | Multi-Agent Review | See `audit-project-agents.md` |
12
+ | 3-4 | Tech Debt & Fixes | This file |
13
+ | 5-6 | Verification & Iteration | This file |
14
+ | 7 | Completion Report | This file |
15
+ | 8 | GitHub Issues | See `audit-project-github.md` |
16
+
17
+ ## Arguments
18
+
19
+ Parse from $ARGUMENTS:
20
+ - **Scope**: Path to review (default: `.`) or `--recent` (last 5 commits only)
21
+ - **--domain AGENT**: Review with specific agent only (e.g., `--domain security`)
22
+ - **--quick**: Single pass, no iteration (fast feedback)
23
+ - **--create-tech-debt**: Force create/update TECHNICAL_DEBT.md
24
+ - **--resume**: Resume from existing review queue file
25
+
26
+ ### Resume Mode
27
+
28
+ If `--resume` is provided, reuse the most recent review queue in the platform state dir.
29
+ Otherwise create a new queue file. See `audit-project-agents.md` for queue handling.
30
+
31
+ ## Phase 1: Context Gathering
32
+
33
+ ### Platform Detection
34
+
35
+ ```bash
36
+ # Get plugin root using Node.js helper
37
+ 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);")
38
+ PLATFORM=$(node "/Users/avifen/.agentsys/plugins/audit-project/lib/platform/detect-platform.js")
39
+ TOOLS=$(node "/Users/avifen/.agentsys/plugins/audit-project/lib/platform/verify-tools.js")
40
+
41
+ PROJECT_TYPE=$(echo $PLATFORM | jq -r '.projectType')
42
+ PACKAGE_MGR=$(echo $PLATFORM | jq -r '.packageManager')
43
+
44
+ # Detect framework
45
+ FRAMEWORK="unknown"
46
+ if [ "$PROJECT_TYPE" = "nodejs" ]; then
47
+ [ -n "$(jq -e '.dependencies.react' package.json 2>/dev/null)" ] && FRAMEWORK="react"
48
+ [ -n "$(jq -e '.dependencies.express' package.json 2>/dev/null)" ] && FRAMEWORK="express"
49
+ elif [ "$PROJECT_TYPE" = "python" ]; then
50
+ grep -q "django" requirements.txt 2>/dev/null && FRAMEWORK="django"
51
+ grep -q "fastapi" requirements.txt 2>/dev/null && FRAMEWORK="fastapi"
52
+ fi
53
+
54
+ RESUME_MODE=$([ "${ARGUMENTS}" != "${ARGUMENTS%--resume*}" ] && echo "true" || echo "false")
55
+ ```
56
+
57
+ ### Project Analysis
58
+
59
+ ```bash
60
+ FILE_COUNT=$(git ls-files | wc -l)
61
+ TEST_FILES=$(git ls-files | grep -E '(test|spec)\.' | wc -l)
62
+ HAS_TESTS=$( [ "$TEST_FILES" -gt 0 ] && echo "true" || echo "false" )
63
+ HAS_DB=$(grep -rq -E "(Sequelize|Prisma|TypeORM)" . 2>/dev/null && echo "true" || echo "false")
64
+ HAS_API=$(grep -rq -E "(express|fastify|@nestjs)" . 2>/dev/null && echo "true" || echo "false")
65
+ HAS_FRONTEND=$( [ "$(git ls-files | grep -E '\.(tsx|jsx|vue|svelte)$' | wc -l)" -gt 0 ] && echo "true" || echo "false" )
66
+ HAS_BACKEND=$(grep -rq -E "(express|fastify|@nestjs|koa|hapi)" . 2>/dev/null && echo "true" || echo "false")
67
+ if [ -d ".github/workflows" ] || [ -f ".gitlab-ci.yml" ] || [ -f ".circleci/config.yml" ] || \
68
+ [ -f "Jenkinsfile" ] || [ -f ".travis.yml" ] || [ -f "azure-pipelines.yml" ] || \
69
+ [ -f "bitbucket-pipelines.yml" ]; then
70
+ HAS_CICD="true"
71
+ else
72
+ HAS_CICD="false"
73
+ fi
74
+ ```
75
+
76
+ ### Agent Selection
77
+
78
+ **Always Active:**
79
+ - `code-quality-reviewer`: Code quality, error handling, maintainability
80
+ - `security-expert`: Security vulnerabilities, auth, input validation
81
+ - `performance-engineer`: Performance bottlenecks, algorithms, memory
82
+ - `test-quality-guardian`: Test coverage and quality (reports missing tests)
83
+
84
+ **Conditional:**
85
+ - `architecture-reviewer`: Design patterns (if `FILE_COUNT > 50`)
86
+ - `database-specialist`: Query optimization (if `HAS_DB=true`)
87
+ - `api-designer`: REST best practices (if `HAS_API=true`)
88
+ - `frontend-specialist`: Component design (if `HAS_FRONTEND=true`)
89
+ - `backend-specialist`: Service and domain logic (if `HAS_BACKEND=true`)
90
+ - `devops-reviewer`: CI/CD config (if `HAS_CICD=true`)
91
+
92
+ ## Phase 2: Multi-Agent Review
93
+
94
+ See `audit-project-agents.md` for detailed agent coordination.
95
+
96
+ **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.
97
+
98
+ ### Finding Format (Required)
99
+
100
+ Every finding MUST include:
101
+ - **File:Line**: Exact location (e.g., `src/auth/session.ts:42`)
102
+ - **Severity**: critical | high | medium | low
103
+ - **Category**: From agent domain
104
+ - **Description**: What's wrong and why
105
+ - **Code Quote**: 1-3 lines showing issue
106
+ - **Suggested Fix**: Specific remediation
107
+ - **Effort**: small | medium | large
108
+
109
+ ### Example Finding
110
+
111
+ ```markdown
112
+ ### Finding: Unsafe SQL Query
113
+ **Agent**: security-expert
114
+ **File**: src/api/users.ts:87
115
+ **Severity**: critical
116
+ **Code**:
117
+ ```typescript
118
+ const query = `SELECT * FROM users WHERE id = ${userId}`;
119
+ ```
120
+ **Fix**: Use parameterized queries.
121
+ **Effort**: small
122
+ ```
123
+
124
+ ## Phase 3: Tech Debt Documentation
125
+
126
+ If TECHNICAL_DEBT.md exists or `--create-tech-debt`:
127
+
128
+ ```markdown
129
+ # Technical Debt
130
+
131
+ Last updated: $(date -I)
132
+
133
+ ## Summary
134
+ **Total Issues**: X | Critical: Y | High: Z | Medium: A | Low: B
135
+
136
+ ## Critical Issues
137
+ [Grouped by severity with file:line, description, fix, effort]
138
+
139
+ ## Progress Tracking
140
+ - [ ] Issue 1
141
+ - [ ] Issue 2
142
+ ```
143
+
144
+ ## Phase 4: Automated Fixes
145
+
146
+ ### Fix Strategy
147
+
148
+ 1. **Auto-fixable** (lint, formatting): Apply directly
149
+ 2. **Manual fix** (code logic): Implement suggested fix
150
+ 3. **Design decision required**: Flag as blocked and report to user
151
+ 4. **False positive**: Mark and remove from review queue
152
+
153
+ ### Fix Order
154
+
155
+ 1. Critical severity first
156
+ 2. Then high → medium → low
157
+ 3. Then by effort (small → large)
158
+ 4. Then batch by file
159
+
160
+ ## Phase 5: Verification
161
+
162
+ ```bash
163
+ # Run tests
164
+ [ -n "$TEST_CMD" ] && $TEST_CMD
165
+ TEST_STATUS=$?
166
+
167
+ # Run linter
168
+ [ -n "$LINT_CMD" ] && $LINT_CMD
169
+ LINT_STATUS=$?
170
+
171
+ # Run build
172
+ [ -n "$BUILD_CMD" ] && $BUILD_CMD
173
+ BUILD_STATUS=$?
174
+
175
+ # Overall status
176
+ VERIFICATION_PASSED=$([ $TEST_STATUS -eq 0 ] && [ $LINT_STATUS -eq 0 ] && [ $BUILD_STATUS -eq 0 ] && echo "true" || echo "false")
177
+ ```
178
+
179
+ ### Handle Failures
180
+
181
+ If verification fails:
182
+ 1. Review recent changes (`git diff`)
183
+ 2. Identify breaking fix
184
+ 3. Rollback: `git restore <file>`
185
+ 4. Document as "fix caused regression"
186
+
187
+ ## Phase 6: Iteration
188
+
189
+ ```javascript
190
+ const initialReview = /* results from Phase 2 review */;
191
+ const initialIssues = Array.isArray(initialReview?.issues) ? initialReview.issues : [];
192
+ let iteration = 1;
193
+ let remainingIssues = initialIssues;
194
+
195
+ while (remainingIssues.length > 0) {
196
+ const fixResult = applyFixes(remainingIssues);
197
+
198
+ const verifyResult = runVerification();
199
+ if (!verifyResult.passed) {
200
+ rollbackFailed(fixResult);
201
+ }
202
+
203
+ const reReviewResult = reReview(fixResult.changedFiles);
204
+ remainingIssues = reReviewResult.issues;
205
+
206
+ if (remainingIssues.length === 0) {
207
+ console.log("[OK] Zero issues remaining!");
208
+ break;
209
+ }
210
+
211
+ iteration++;
212
+ }
213
+ ```
214
+
215
+ ### Quick Mode
216
+
217
+ If `--quick` flag: Single pass, findings only, no fixes.
218
+
219
+ ## Phase 6.5: Decision Gate (User)
220
+
221
+ After each iteration (or after re-review if issues remain), report the queue state and ask the user what to do next.
222
+
223
+ ```javascript
224
+ const openCount = remainingIssues.length;
225
+ console.log(`Open issues: ${openCount}`);
226
+ console.log(`Queue file: ${reviewQueuePath}`); // set in Phase 2 (audit-project-agents)
227
+
228
+ const decision = await AskUserQuestion({
229
+ questions: [{
230
+ header: "Audit Decision",
231
+ question: "Review queue still open. What next?",
232
+ options: [
233
+ { label: "Continue review", description: "Run another iteration" },
234
+ { label: "Create issues", description: "Stop and create issues" },
235
+ { label: "Update tech debt", description: "Stop and update TECHNICAL_DEBT.md" },
236
+ { label: "Leave queue", description: "Stop and keep queue for resume" }
237
+ ],
238
+ multiSelect: false
239
+ }]
240
+ });
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.