claude-code-orchestrator-kit 1.0.0
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/agents/database/workers/api-builder.md +155 -0
- package/.claude/agents/database/workers/database-architect.md +193 -0
- package/.claude/agents/database/workers/supabase-auditor.md +1070 -0
- package/.claude/agents/development/workers/code-reviewer.md +968 -0
- package/.claude/agents/development/workers/cost-calculator-specialist.md +683 -0
- package/.claude/agents/development/workers/llm-service-specialist.md +999 -0
- package/.claude/agents/development/workers/skill-builder-v2.md +480 -0
- package/.claude/agents/development/workers/typescript-types-specialist.md +649 -0
- package/.claude/agents/development/workers/utility-builder.md +582 -0
- package/.claude/agents/documentation/workers/technical-writer.md +152 -0
- package/.claude/agents/frontend/workers/fullstack-nextjs-specialist.md +206 -0
- package/.claude/agents/frontend/workers/visual-effects-creator.md +159 -0
- package/.claude/agents/health/orchestrators/bug-orchestrator.md +1045 -0
- package/.claude/agents/health/orchestrators/dead-code-orchestrator.md +1045 -0
- package/.claude/agents/health/orchestrators/dependency-orchestrator.md +1045 -0
- package/.claude/agents/health/orchestrators/security-orchestrator.md +1045 -0
- package/.claude/agents/health/workers/bug-fixer.md +525 -0
- package/.claude/agents/health/workers/bug-hunter.md +649 -0
- package/.claude/agents/health/workers/dead-code-hunter.md +446 -0
- package/.claude/agents/health/workers/dead-code-remover.md +437 -0
- package/.claude/agents/health/workers/dependency-auditor.md +379 -0
- package/.claude/agents/health/workers/dependency-updater.md +436 -0
- package/.claude/agents/health/workers/security-scanner.md +700 -0
- package/.claude/agents/health/workers/vulnerability-fixer.md +524 -0
- package/.claude/agents/infrastructure/workers/infrastructure-specialist.md +156 -0
- package/.claude/agents/infrastructure/workers/orchestration-logic-specialist.md +1260 -0
- package/.claude/agents/infrastructure/workers/qdrant-specialist.md +503 -0
- package/.claude/agents/infrastructure/workers/quality-validator-specialist.md +984 -0
- package/.claude/agents/meta/workers/meta-agent-v3.md +503 -0
- package/.claude/agents/research/workers/problem-investigator.md +507 -0
- package/.claude/agents/research/workers/research-specialist.md +423 -0
- package/.claude/agents/testing/workers/accessibility-tester.md +813 -0
- package/.claude/agents/testing/workers/integration-tester.md +188 -0
- package/.claude/agents/testing/workers/mobile-fixes-implementer.md +252 -0
- package/.claude/agents/testing/workers/mobile-responsiveness-tester.md +180 -0
- package/.claude/agents/testing/workers/performance-optimizer.md +262 -0
- package/.claude/agents/testing/workers/test-writer.md +800 -0
- package/.claude/commands/health-bugs.md +297 -0
- package/.claude/commands/health-cleanup.md +297 -0
- package/.claude/commands/health-deps.md +297 -0
- package/.claude/commands/health-metrics.md +747 -0
- package/.claude/commands/health-security.md +297 -0
- package/.claude/commands/push.md +21 -0
- package/.claude/commands/speckit.analyze.md +184 -0
- package/.claude/commands/speckit.checklist.md +294 -0
- package/.claude/commands/speckit.clarify.md +178 -0
- package/.claude/commands/speckit.constitution.md +78 -0
- package/.claude/commands/speckit.implement.md +182 -0
- package/.claude/commands/speckit.plan.md +87 -0
- package/.claude/commands/speckit.specify.md +250 -0
- package/.claude/commands/speckit.tasks.md +137 -0
- package/.claude/commands/translate-doc.md +95 -0
- package/.claude/commands/worktree-cleanup.md +382 -0
- package/.claude/commands/worktree-create.md +287 -0
- package/.claude/commands/worktree-list.md +239 -0
- package/.claude/commands/worktree-remove.md +339 -0
- package/.claude/schemas/base-plan.schema.json +82 -0
- package/.claude/schemas/bug-plan.schema.json +71 -0
- package/.claude/schemas/dead-code-plan.schema.json +71 -0
- package/.claude/schemas/dependency-plan.schema.json +74 -0
- package/.claude/schemas/security-plan.schema.json +71 -0
- package/.claude/scripts/gates/check-bundle-size.sh +47 -0
- package/.claude/scripts/gates/check-coverage.sh +67 -0
- package/.claude/scripts/gates/check-security.sh +46 -0
- package/.claude/scripts/release.sh +740 -0
- package/.claude/settings.local.json +21 -0
- package/.claude/settings.local.json.example +20 -0
- package/.claude/skills/calculate-priority-score/SKILL.md +229 -0
- package/.claude/skills/calculate-priority-score/scoring-matrix.json +83 -0
- package/.claude/skills/extract-version/SKILL.md +228 -0
- package/.claude/skills/format-commit-message/SKILL.md +189 -0
- package/.claude/skills/format-commit-message/template.md +64 -0
- package/.claude/skills/format-markdown-table/SKILL.md +202 -0
- package/.claude/skills/format-markdown-table/examples.md +84 -0
- package/.claude/skills/format-todo-list/SKILL.md +222 -0
- package/.claude/skills/format-todo-list/template.json +30 -0
- package/.claude/skills/generate-changelog/SKILL.md +258 -0
- package/.claude/skills/generate-changelog/commit-mapping.json +47 -0
- package/.claude/skills/generate-report-header/SKILL.md +228 -0
- package/.claude/skills/generate-report-header/template.md +66 -0
- package/.claude/skills/parse-error-logs/SKILL.md +286 -0
- package/.claude/skills/parse-error-logs/patterns.json +26 -0
- package/.claude/skills/parse-git-status/SKILL.md +164 -0
- package/.claude/skills/parse-package-json/SKILL.md +151 -0
- package/.claude/skills/parse-package-json/schema.json +43 -0
- package/.claude/skills/render-template/SKILL.md +245 -0
- package/.claude/skills/rollback-changes/SKILL.md +582 -0
- package/.claude/skills/rollback-changes/changes-log-schema.json +101 -0
- package/.claude/skills/run-quality-gate/SKILL.md +404 -0
- package/.claude/skills/run-quality-gate/gate-mappings.json +97 -0
- package/.claude/skills/validate-plan-file/SKILL.md +327 -0
- package/.claude/skills/validate-plan-file/schema.json +35 -0
- package/.claude/skills/validate-report-file/SKILL.md +256 -0
- package/.claude/skills/validate-report-file/schema.json +67 -0
- package/.env.example +49 -0
- package/.github/BRANCH_PROTECTION.md +137 -0
- package/.github/workflows/build.yml +70 -0
- package/.github/workflows/claude-code-review.yml +255 -0
- package/.github/workflows/claude.yml +79 -0
- package/.github/workflows/deploy-staging.yml +90 -0
- package/.github/workflows/test.yml +104 -0
- package/.gitignore +116 -0
- package/CLAUDE.md +137 -0
- package/LICENSE +72 -0
- package/README.md +1098 -0
- package/docs/ARCHITECTURE.md +746 -0
- package/docs/Agents Ecosystem/AGENT-ORCHESTRATION.md +568 -0
- package/docs/Agents Ecosystem/AI-AGENT-ECOSYSTEM-README.md +658 -0
- package/docs/Agents Ecosystem/ARCHITECTURE.md +606 -0
- package/docs/Agents Ecosystem/QUALITY-GATES-SPECIFICATION.md +1315 -0
- package/docs/Agents Ecosystem/REPORT-TEMPLATE-STANDARD.md +1324 -0
- package/docs/Agents Ecosystem/spec-kit-comprehensive-updates.md +478 -0
- package/docs/FAQ.md +572 -0
- package/docs/MIGRATION-GUIDE.md +542 -0
- package/docs/PERFORMANCE-OPTIMIZATION.md +494 -0
- package/docs/ROADMAP.md +439 -0
- package/docs/TUTORIAL-CUSTOM-AGENTS.md +2041 -0
- package/docs/USE-CASES.md +706 -0
- package/index.js +96 -0
- package/mcp/.mcp.base.json +21 -0
- package/mcp/.mcp.frontend.json +29 -0
- package/mcp/.mcp.full.json +67 -0
- package/mcp/.mcp.local.example.json +7 -0
- package/mcp/.mcp.local.json +7 -0
- package/mcp/.mcp.n8n.json +45 -0
- package/mcp/.mcp.supabase-full.json +35 -0
- package/mcp/.mcp.supabase-only.json +28 -0
- package/package.json +78 -0
- package/postinstall.js +71 -0
- package/switch-mcp.sh +101 -0
|
@@ -0,0 +1,1324 @@
|
|
|
1
|
+
# Standardized Report Template
|
|
2
|
+
|
|
3
|
+
**Date Created**: 2025-10-17
|
|
4
|
+
**Date Updated**: 2025-10-18
|
|
5
|
+
**Phase**: 4 - Task 4.2
|
|
6
|
+
**Status**: Standard Template for All Worker Reports (v2.0)
|
|
7
|
+
**Purpose**: Define consistent structure, metadata format, and validation sections for all agent-generated reports
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Table of Contents
|
|
12
|
+
|
|
13
|
+
1. [Overview](#overview)
|
|
14
|
+
2. [Standard Metrics](#standard-metrics)
|
|
15
|
+
3. [File Organization Rules](#file-organization-rules)
|
|
16
|
+
4. [Report Structure](#report-structure)
|
|
17
|
+
5. [Metadata Format](#metadata-format)
|
|
18
|
+
6. [Required Sections](#required-sections)
|
|
19
|
+
7. [Validation Section Format](#validation-section-format)
|
|
20
|
+
8. [Report Types](#report-types)
|
|
21
|
+
9. [Examples](#examples)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Overview
|
|
26
|
+
|
|
27
|
+
### Purpose
|
|
28
|
+
|
|
29
|
+
All worker agents must generate reports following this standardized template to ensure:
|
|
30
|
+
- **Consistency**: Predictable structure across all report types
|
|
31
|
+
- **Parsability**: Machines can validate and extract data
|
|
32
|
+
- **Completeness**: All required information is present
|
|
33
|
+
- **Traceability**: Metadata enables tracking and auditing
|
|
34
|
+
|
|
35
|
+
### Usage
|
|
36
|
+
|
|
37
|
+
Workers should:
|
|
38
|
+
1. Use `generate-report-header` Skill for header generation
|
|
39
|
+
2. Follow required section structure
|
|
40
|
+
3. Include all validation results
|
|
41
|
+
4. Use consistent status indicators
|
|
42
|
+
5. Save reports with standard naming
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Standard Metrics
|
|
47
|
+
|
|
48
|
+
### All Reports Must Include
|
|
49
|
+
|
|
50
|
+
Every report, regardless of type, must include these standard metrics for consistency and traceability:
|
|
51
|
+
|
|
52
|
+
#### Core Metrics (Required)
|
|
53
|
+
|
|
54
|
+
| Metric | Format | Description | Example |
|
|
55
|
+
|--------|--------|-------------|---------|
|
|
56
|
+
| **Timestamp** | ISO-8601 | When report was generated | `2025-10-18T14:30:00Z` |
|
|
57
|
+
| **Duration** | Human-readable | Execution time | `3m 45s`, `1h 12m`, `45s` |
|
|
58
|
+
| **Workflow** | Domain name | Which domain workflow | `bugs`, `security`, `dead-code`, `dependencies` |
|
|
59
|
+
| **Phase** | Phase type | Workflow phase | `detection`, `fixing`, `verification` |
|
|
60
|
+
| **Validation Status** | Emoji + Text | Overall validation result | `✅ PASSED`, `⛔ FAILED`, `⚠️ PARTIAL` |
|
|
61
|
+
|
|
62
|
+
#### Optional Metrics
|
|
63
|
+
|
|
64
|
+
| Metric | Format | Description | Example |
|
|
65
|
+
|--------|--------|-------------|---------|
|
|
66
|
+
| **Priority/Severity** | Level | Issue priority/severity | `critical`, `high`, `medium`, `low` |
|
|
67
|
+
| **Files Processed** | Number | Files analyzed/modified | `42 files` |
|
|
68
|
+
| **Issues Found** | Number | Total issues discovered | `15 bugs`, `3 critical CVEs` |
|
|
69
|
+
| **Changes Made** | Boolean | Whether modifications occurred | `true`, `false` |
|
|
70
|
+
| **Changes Log** | File path | Path to changes log | `.bug-changes.json` |
|
|
71
|
+
|
|
72
|
+
### Domain-Specific Metrics
|
|
73
|
+
|
|
74
|
+
Each domain adds specific metrics beyond the standard set:
|
|
75
|
+
|
|
76
|
+
#### Bug Domain
|
|
77
|
+
- **Bugs by Priority**: Breakdown of bugs (critical: 2, high: 5, etc.)
|
|
78
|
+
- **Bugs Fixed**: Number of bugs resolved
|
|
79
|
+
- **Bugs Remaining**: Outstanding bugs after fixes
|
|
80
|
+
|
|
81
|
+
#### Security Domain
|
|
82
|
+
- **CVEs by Severity**: Breakdown of vulnerabilities
|
|
83
|
+
- **RLS Policies**: Count of policies analyzed/fixed
|
|
84
|
+
- **Auth Issues**: Authentication/authorization problems
|
|
85
|
+
|
|
86
|
+
#### Dead-Code Domain
|
|
87
|
+
- **Lines Removed**: Total lines of dead code removed
|
|
88
|
+
- **Files Modified**: Files cleaned up
|
|
89
|
+
- **Cleanup Categories**: Unused imports, debug code, etc.
|
|
90
|
+
|
|
91
|
+
#### Dependencies Domain
|
|
92
|
+
- **Packages Updated**: Number of dependencies updated
|
|
93
|
+
- **Security Fixes**: Vulnerabilities patched
|
|
94
|
+
- **Version Changes**: Major/minor/patch breakdown
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## File Organization Rules
|
|
99
|
+
|
|
100
|
+
### File Location Strategy
|
|
101
|
+
|
|
102
|
+
Clear rules for where to save different types of files to prevent root directory clutter:
|
|
103
|
+
|
|
104
|
+
#### Temporary Files (Auto-cleanup)
|
|
105
|
+
|
|
106
|
+
**Location**: Project root
|
|
107
|
+
**Lifetime**: Auto-cleanup after 7 days or workflow completion
|
|
108
|
+
**Pattern**: `.{workflow}-*` or `{temp-name}-report.md`
|
|
109
|
+
|
|
110
|
+
| File Type | Pattern | Cleanup Trigger | Example |
|
|
111
|
+
|-----------|---------|-----------------|---------|
|
|
112
|
+
| Plan Files | `.{domain}-{phase}-plan.json` | After worker completion | `.bug-detection-plan.json` |
|
|
113
|
+
| Temp Reports | `{task}-report.md` | After 7 days | `bug-hunting-report.md` |
|
|
114
|
+
| Changes Logs | `.{domain}-changes.json` | After successful validation | `.bug-changes.json` |
|
|
115
|
+
| Lock Files | `.locks/*.lock` | After 30min or completion | `.locks/active-fixer.lock` |
|
|
116
|
+
| Backup Directory | `.rollback/` | After successful validation | `.rollback/src-file.ts.backup` |
|
|
117
|
+
|
|
118
|
+
**Cleanup Policy**:
|
|
119
|
+
```bash
|
|
120
|
+
# Workers should cleanup temp files after success
|
|
121
|
+
rm -f .{domain}-changes.json
|
|
122
|
+
rm -rf .rollback/
|
|
123
|
+
|
|
124
|
+
# Orchestrators should cleanup plan files
|
|
125
|
+
rm -f .{domain}-{phase}-plan.json
|
|
126
|
+
|
|
127
|
+
# Lock files auto-expire after 30 minutes
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
#### Permanent Files
|
|
131
|
+
|
|
132
|
+
**Location**: `docs/reports/{domain}/{date}/`
|
|
133
|
+
**Lifetime**: Permanent (manual archive)
|
|
134
|
+
**Pattern**: `{date}-{domain}-{type}.md`
|
|
135
|
+
|
|
136
|
+
| Report Type | Location | Naming | Example |
|
|
137
|
+
|-------------|----------|--------|---------|
|
|
138
|
+
| Bug Reports | `docs/reports/bugs/{YYYY-MM}/` | `{date}-bug-hunting-report.md` | `docs/reports/bugs/2025-10/2025-10-18-bug-hunting-report.md` |
|
|
139
|
+
| Security Audits | `docs/reports/security/{YYYY-MM}/` | `{date}-security-audit.md` | `docs/reports/security/2025-10/2025-10-18-security-audit.md` |
|
|
140
|
+
| Dead Code | `docs/reports/cleanup/{YYYY-MM}/` | `{date}-dead-code-report.md` | `docs/reports/cleanup/2025-10/2025-10-18-dead-code-report.md` |
|
|
141
|
+
| Dependencies | `docs/reports/deps/{YYYY-MM}/` | `{date}-dependency-audit.md` | `docs/reports/deps/2025-10/2025-10-18-dependency-audit.md` |
|
|
142
|
+
| Summaries | `docs/reports/summaries/` | `{date}-health-summary.md` | `docs/reports/summaries/2025-10-18-health-summary.md` |
|
|
143
|
+
|
|
144
|
+
**Archive Policy**:
|
|
145
|
+
```bash
|
|
146
|
+
# Archive reports older than 90 days
|
|
147
|
+
mv docs/reports/{domain}/{old-month}/ docs/reports/archive/{domain}/{year}/
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
#### Special Directories
|
|
151
|
+
|
|
152
|
+
| Directory | Purpose | Cleanup | Example Files |
|
|
153
|
+
|-----------|---------|---------|---------------|
|
|
154
|
+
| `.locks/` | Active workflow locks | Auto (30min) | `active-fixer.lock` |
|
|
155
|
+
| `.rollback/` | Backup files for rollback | After success | `src-file.ts.backup` |
|
|
156
|
+
| `.claude/schemas/` | JSON schemas (permanent) | Manual | `bug-plan.schema.json` |
|
|
157
|
+
| `.claude/skills/` | Skills (permanent) | Manual | `rollback-changes/SKILL.md` |
|
|
158
|
+
| `docs/reports/archive/` | Old reports | Manual | `archive/bugs/2025/` |
|
|
159
|
+
|
|
160
|
+
### Implementation in Workers
|
|
161
|
+
|
|
162
|
+
Workers must follow these rules:
|
|
163
|
+
|
|
164
|
+
**Before generating report**:
|
|
165
|
+
```markdown
|
|
166
|
+
1. Determine report type (temporary vs permanent)
|
|
167
|
+
2. If temporary: Save to root with cleanup note
|
|
168
|
+
3. If permanent: Create dated directory structure
|
|
169
|
+
4. Add cleanup instructions in "Next Steps" section
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**After successful execution**:
|
|
173
|
+
```markdown
|
|
174
|
+
1. Cleanup temporary files (.{domain}-changes.json, .rollback/)
|
|
175
|
+
2. Remove plan files (.{domain}-{phase}-plan.json)
|
|
176
|
+
3. Move temp report to permanent location (if archival needed)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**In report "Next Steps" section**:
|
|
180
|
+
```markdown
|
|
181
|
+
### Cleanup
|
|
182
|
+
- [ ] Review report and confirm results
|
|
183
|
+
- [ ] Run: `rm -f .bug-changes.json .bug-detection-plan.json`
|
|
184
|
+
- [ ] Run: `rm -rf .rollback/`
|
|
185
|
+
- [ ] Archive report: `mv bug-hunting-report.md docs/reports/bugs/2025-10/2025-10-18-bug-hunting-report.md`
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Report Structure
|
|
191
|
+
|
|
192
|
+
### High-Level Structure
|
|
193
|
+
|
|
194
|
+
```markdown
|
|
195
|
+
# {ReportType} Report: {Version/Identifier}
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
[Metadata in YAML frontmatter]
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
[Header with Generated timestamp, Status, Version]
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Executive Summary
|
|
206
|
+
|
|
207
|
+
[Key findings and metrics]
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Detailed Findings
|
|
212
|
+
|
|
213
|
+
[Domain-specific findings]
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Validation Results
|
|
218
|
+
|
|
219
|
+
[Validation status and details]
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Next Steps
|
|
224
|
+
|
|
225
|
+
[Actionable recommendations]
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
[Optional: Appendices, raw data, logs]
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Metadata Format
|
|
235
|
+
|
|
236
|
+
### YAML Frontmatter
|
|
237
|
+
|
|
238
|
+
Place at the **very beginning** of the report, before the title.
|
|
239
|
+
|
|
240
|
+
```yaml
|
|
241
|
+
---
|
|
242
|
+
report_type: bug-hunting | security-audit | dead-code | dependency-audit | version-update | code-health | verification
|
|
243
|
+
generated: ISO-8601 timestamp (YYYY-MM-DDTHH:mm:ssZ)
|
|
244
|
+
version: semantic version or date identifier
|
|
245
|
+
status: success | partial | failed | in_progress
|
|
246
|
+
agent: worker-agent-name
|
|
247
|
+
duration: execution time (e.g., "3m 45s", "1h 12m")
|
|
248
|
+
files_processed: number (optional)
|
|
249
|
+
issues_found: number (optional)
|
|
250
|
+
---
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Metadata Fields
|
|
254
|
+
|
|
255
|
+
#### Required Fields
|
|
256
|
+
|
|
257
|
+
- **report_type**: One of the valid report types (see Report Types section)
|
|
258
|
+
- **generated**: ISO-8601 timestamp
|
|
259
|
+
- **version**: Version identifier or date (YYYY-MM-DD format)
|
|
260
|
+
- **status**: Overall report status
|
|
261
|
+
|
|
262
|
+
#### Optional Fields
|
|
263
|
+
|
|
264
|
+
- **agent**: Worker agent that generated report
|
|
265
|
+
- **duration**: How long the operation took
|
|
266
|
+
- **files_processed**: Number of files analyzed
|
|
267
|
+
- **issues_found**: Total issues discovered
|
|
268
|
+
- **custom_field**: Domain-specific fields as needed
|
|
269
|
+
|
|
270
|
+
### Status Values
|
|
271
|
+
|
|
272
|
+
| Status | Emoji | Description |
|
|
273
|
+
|--------|-------|-------------|
|
|
274
|
+
| `success` | ✅ | Operation completed successfully |
|
|
275
|
+
| `partial` | ⚠️ | Completed with warnings or partial failures |
|
|
276
|
+
| `failed` | ❌ | Operation failed critically |
|
|
277
|
+
| `in_progress` | 🔄 | Operation is currently running |
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Required Sections
|
|
282
|
+
|
|
283
|
+
### 1. Title and Header
|
|
284
|
+
|
|
285
|
+
**Format**:
|
|
286
|
+
```markdown
|
|
287
|
+
# {ReportType} Report: {Version}
|
|
288
|
+
|
|
289
|
+
**Generated**: {Timestamp}
|
|
290
|
+
**Status**: {Emoji} {Status}
|
|
291
|
+
**Version**: {Version}
|
|
292
|
+
**Agent**: {AgentName} (optional)
|
|
293
|
+
**Duration**: {Duration} (optional)
|
|
294
|
+
**Files Processed**: {Count} (optional)
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
**Rules**:
|
|
300
|
+
- Title must be H1 (single #)
|
|
301
|
+
- Use standardized report type names
|
|
302
|
+
- Include status emoji
|
|
303
|
+
- Use `generate-report-header` Skill
|
|
304
|
+
|
|
305
|
+
### 2. Executive Summary
|
|
306
|
+
|
|
307
|
+
**Format**:
|
|
308
|
+
```markdown
|
|
309
|
+
## Executive Summary
|
|
310
|
+
|
|
311
|
+
[Brief overview of the operation and key findings]
|
|
312
|
+
|
|
313
|
+
### Key Metrics
|
|
314
|
+
|
|
315
|
+
- **Metric 1**: Value
|
|
316
|
+
- **Metric 2**: Value
|
|
317
|
+
- **Metric 3**: Value
|
|
318
|
+
|
|
319
|
+
### Highlights
|
|
320
|
+
|
|
321
|
+
- ✅ Major success/completion
|
|
322
|
+
- ⚠️ Warning or concern
|
|
323
|
+
- ❌ Critical issue (if any)
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
**Requirements**:
|
|
327
|
+
- Start with H2 heading
|
|
328
|
+
- Include 3-5 key metrics
|
|
329
|
+
- Highlight most important findings
|
|
330
|
+
- Use emojis for visual clarity
|
|
331
|
+
|
|
332
|
+
### 3. Detailed Findings
|
|
333
|
+
|
|
334
|
+
**Format**: Varies by report type (see Report Types section)
|
|
335
|
+
|
|
336
|
+
**General Requirements**:
|
|
337
|
+
- Start with H2 heading
|
|
338
|
+
- Organize by severity/priority/category
|
|
339
|
+
- Include actionable descriptions
|
|
340
|
+
- Use lists for multiple items
|
|
341
|
+
- Include code snippets if relevant
|
|
342
|
+
|
|
343
|
+
### 4. Validation Results
|
|
344
|
+
|
|
345
|
+
**Format**:
|
|
346
|
+
```markdown
|
|
347
|
+
## Validation Results
|
|
348
|
+
|
|
349
|
+
### Build Validation
|
|
350
|
+
|
|
351
|
+
- **Type Check**: ✅ PASSED / ❌ FAILED
|
|
352
|
+
```bash
|
|
353
|
+
pnpm type-check
|
|
354
|
+
# Exit code: 0
|
|
355
|
+
# Output: No errors found
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
- **Build**: ✅ PASSED / ❌ FAILED
|
|
359
|
+
```bash
|
|
360
|
+
pnpm build
|
|
361
|
+
# Exit code: 0
|
|
362
|
+
# Output: Build successful
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Test Validation (Optional)
|
|
366
|
+
|
|
367
|
+
- **Tests**: ✅ PASSED / ⚠️ PARTIAL / ❌ FAILED
|
|
368
|
+
```bash
|
|
369
|
+
pnpm test
|
|
370
|
+
# Exit code: 0
|
|
371
|
+
# Output: 42/42 tests passed
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Overall Status
|
|
375
|
+
|
|
376
|
+
**Validation**: ✅ PASSED / ⚠️ PARTIAL / ❌ FAILED
|
|
377
|
+
|
|
378
|
+
[Explanation if not fully passed]
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
**Requirements**:
|
|
382
|
+
- Include type-check and build results
|
|
383
|
+
- Show actual commands run
|
|
384
|
+
- Include exit codes
|
|
385
|
+
- Show relevant output excerpts
|
|
386
|
+
- Overall status at the end
|
|
387
|
+
|
|
388
|
+
### 5. Next Steps
|
|
389
|
+
|
|
390
|
+
**Format**:
|
|
391
|
+
```markdown
|
|
392
|
+
## Next Steps
|
|
393
|
+
|
|
394
|
+
### Immediate Actions (Required)
|
|
395
|
+
|
|
396
|
+
1. [Action item with specific steps]
|
|
397
|
+
2. [Action item with specific steps]
|
|
398
|
+
|
|
399
|
+
### Recommended Actions (Optional)
|
|
400
|
+
|
|
401
|
+
- [Recommendation 1]
|
|
402
|
+
- [Recommendation 2]
|
|
403
|
+
|
|
404
|
+
### Follow-Up
|
|
405
|
+
|
|
406
|
+
- [Long-term action or monitoring]
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
**Requirements**:
|
|
410
|
+
- Start with H2 heading
|
|
411
|
+
- Separate required vs optional actions
|
|
412
|
+
- Be specific and actionable
|
|
413
|
+
- Include responsible parties if known
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
## Validation Section Format
|
|
418
|
+
|
|
419
|
+
### Standard Validation Checks
|
|
420
|
+
|
|
421
|
+
All reports must validate:
|
|
422
|
+
|
|
423
|
+
#### 1. Type Check
|
|
424
|
+
|
|
425
|
+
```markdown
|
|
426
|
+
### Type Check
|
|
427
|
+
|
|
428
|
+
**Command**: `pnpm type-check`
|
|
429
|
+
|
|
430
|
+
**Status**: ✅ PASSED
|
|
431
|
+
|
|
432
|
+
**Output**:
|
|
433
|
+
\```
|
|
434
|
+
tsc --noEmit
|
|
435
|
+
No errors found.
|
|
436
|
+
\```
|
|
437
|
+
|
|
438
|
+
**Exit Code**: 0
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
#### 2. Build
|
|
442
|
+
|
|
443
|
+
```markdown
|
|
444
|
+
### Build
|
|
445
|
+
|
|
446
|
+
**Command**: `pnpm build`
|
|
447
|
+
|
|
448
|
+
**Status**: ✅ PASSED
|
|
449
|
+
|
|
450
|
+
**Output**:
|
|
451
|
+
\```
|
|
452
|
+
vite build
|
|
453
|
+
✓ built in 3.45s
|
|
454
|
+
dist/index.js 125.3 kB
|
|
455
|
+
\```
|
|
456
|
+
|
|
457
|
+
**Exit Code**: 0
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
#### 3. Tests (Optional)
|
|
461
|
+
|
|
462
|
+
```markdown
|
|
463
|
+
### Tests
|
|
464
|
+
|
|
465
|
+
**Command**: `pnpm test`
|
|
466
|
+
|
|
467
|
+
**Status**: ✅ PASSED (42/42)
|
|
468
|
+
|
|
469
|
+
**Output**:
|
|
470
|
+
\```
|
|
471
|
+
jest
|
|
472
|
+
PASS src/utils.test.ts
|
|
473
|
+
PASS src/types.test.ts
|
|
474
|
+
...
|
|
475
|
+
Tests: 42 passed, 42 total
|
|
476
|
+
\```
|
|
477
|
+
|
|
478
|
+
**Exit Code**: 0
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### Overall Validation Status
|
|
482
|
+
|
|
483
|
+
```markdown
|
|
484
|
+
### Overall Status
|
|
485
|
+
|
|
486
|
+
**Validation**: ✅ PASSED
|
|
487
|
+
|
|
488
|
+
All validation checks completed successfully. No blocking issues detected.
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
---
|
|
492
|
+
|
|
493
|
+
## Report Types
|
|
494
|
+
|
|
495
|
+
### 1. Bug Hunting Report
|
|
496
|
+
|
|
497
|
+
**report_type**: `bug-hunting`
|
|
498
|
+
|
|
499
|
+
**Required Metadata**:
|
|
500
|
+
- files_processed
|
|
501
|
+
- issues_found
|
|
502
|
+
- critical_count, high_count, medium_count, low_count
|
|
503
|
+
|
|
504
|
+
**Detailed Findings Structure**:
|
|
505
|
+
```markdown
|
|
506
|
+
## Detailed Findings
|
|
507
|
+
|
|
508
|
+
### Critical (3)
|
|
509
|
+
|
|
510
|
+
1. **[File:Line] Issue Title**
|
|
511
|
+
- **Severity**: Critical
|
|
512
|
+
- **Description**: [What's wrong]
|
|
513
|
+
- **Impact**: [What happens]
|
|
514
|
+
- **Location**: `path/to/file.ts:123`
|
|
515
|
+
- **Fix**: [How to fix]
|
|
516
|
+
|
|
517
|
+
### High (8)
|
|
518
|
+
|
|
519
|
+
[Same structure]
|
|
520
|
+
|
|
521
|
+
### Medium (12)
|
|
522
|
+
|
|
523
|
+
[Same structure]
|
|
524
|
+
|
|
525
|
+
### Low (5)
|
|
526
|
+
|
|
527
|
+
[Same structure]
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
**Example**: See Examples section
|
|
531
|
+
|
|
532
|
+
---
|
|
533
|
+
|
|
534
|
+
### 2. Security Audit Report
|
|
535
|
+
|
|
536
|
+
**report_type**: `security-audit`
|
|
537
|
+
|
|
538
|
+
**Required Metadata**:
|
|
539
|
+
- vulnerabilities_found
|
|
540
|
+
- critical_vulns, high_vulns, medium_vulns, low_vulns
|
|
541
|
+
- rls_policies_checked (if Supabase)
|
|
542
|
+
|
|
543
|
+
**Detailed Findings Structure**:
|
|
544
|
+
```markdown
|
|
545
|
+
## Detailed Findings
|
|
546
|
+
|
|
547
|
+
### OWASP Top 10 Scan
|
|
548
|
+
|
|
549
|
+
#### A01:2021 - Broken Access Control
|
|
550
|
+
|
|
551
|
+
- ✅ No issues found
|
|
552
|
+
- Checked: Authentication middleware, authorization logic
|
|
553
|
+
|
|
554
|
+
#### A02:2021 - Cryptographic Failures
|
|
555
|
+
|
|
556
|
+
- ⚠️ 1 issue found
|
|
557
|
+
- **Issue**: Hardcoded secret in configuration
|
|
558
|
+
- **Location**: `config/secrets.ts:15`
|
|
559
|
+
- **Severity**: High
|
|
560
|
+
- **Remediation**: Move to environment variables
|
|
561
|
+
|
|
562
|
+
### SQL Injection Scan
|
|
563
|
+
|
|
564
|
+
[Results]
|
|
565
|
+
|
|
566
|
+
### Cross-Site Scripting (XSS)
|
|
567
|
+
|
|
568
|
+
[Results]
|
|
569
|
+
|
|
570
|
+
### RLS Policy Validation (if Supabase)
|
|
571
|
+
|
|
572
|
+
[Results]
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
**Example**: See Examples section
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
579
|
+
### 3. Dead Code Report
|
|
580
|
+
|
|
581
|
+
**report_type**: `dead-code`
|
|
582
|
+
|
|
583
|
+
**Required Metadata**:
|
|
584
|
+
- files_scanned
|
|
585
|
+
- dead_code_items
|
|
586
|
+
- commented_code_lines
|
|
587
|
+
- debug_artifacts
|
|
588
|
+
|
|
589
|
+
**Detailed Findings Structure**:
|
|
590
|
+
```markdown
|
|
591
|
+
## Detailed Findings
|
|
592
|
+
|
|
593
|
+
### Critical Dead Code (5)
|
|
594
|
+
|
|
595
|
+
1. **Unused Export: `oldFunction`**
|
|
596
|
+
- **File**: `src/utils.ts:45-67`
|
|
597
|
+
- **Type**: Exported function never imported
|
|
598
|
+
- **Lines**: 23 lines
|
|
599
|
+
- **Safe to Remove**: ✅ Yes
|
|
600
|
+
|
|
601
|
+
### Commented Code (12)
|
|
602
|
+
|
|
603
|
+
1. **Large Comment Block**
|
|
604
|
+
- **File**: `src/legacy.ts:100-250`
|
|
605
|
+
- **Lines**: 151 lines commented
|
|
606
|
+
- **Safe to Remove**: ⚠️ Review recommended
|
|
607
|
+
|
|
608
|
+
### Debug Artifacts (8)
|
|
609
|
+
|
|
610
|
+
1. **Console.log statements**
|
|
611
|
+
- **File**: `src/api.ts:34, 67, 89`
|
|
612
|
+
- **Count**: 3 occurrences
|
|
613
|
+
- **Safe to Remove**: ✅ Yes
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
**Example**: See Examples section
|
|
617
|
+
|
|
618
|
+
---
|
|
619
|
+
|
|
620
|
+
### 4. Dependency Audit Report
|
|
621
|
+
|
|
622
|
+
**report_type**: `dependency-audit`
|
|
623
|
+
|
|
624
|
+
**Required Metadata**:
|
|
625
|
+
- dependencies_checked
|
|
626
|
+
- outdated_count
|
|
627
|
+
- vulnerable_count
|
|
628
|
+
- unused_count
|
|
629
|
+
|
|
630
|
+
**Detailed Findings Structure**:
|
|
631
|
+
```markdown
|
|
632
|
+
## Detailed Findings
|
|
633
|
+
|
|
634
|
+
### Security Vulnerabilities (5)
|
|
635
|
+
|
|
636
|
+
#### Critical CVEs (2)
|
|
637
|
+
|
|
638
|
+
1. **lodash@4.17.20**
|
|
639
|
+
- **CVE**: CVE-2021-23337
|
|
640
|
+
- **Severity**: Critical (CVSS 9.1)
|
|
641
|
+
- **Fix**: Update to lodash@4.17.21
|
|
642
|
+
- **Command**: `npm install lodash@4.17.21`
|
|
643
|
+
|
|
644
|
+
### Outdated Packages (23)
|
|
645
|
+
|
|
646
|
+
#### Major Updates Available (5)
|
|
647
|
+
|
|
648
|
+
1. **react: 17.0.2 → 18.2.0**
|
|
649
|
+
- **Type**: Major (Breaking)
|
|
650
|
+
- **Release Date**: 2022-03-29
|
|
651
|
+
- **Migration**: [Link to migration guide]
|
|
652
|
+
|
|
653
|
+
### Unused Dependencies (3)
|
|
654
|
+
|
|
655
|
+
1. **moment**
|
|
656
|
+
- **Reason**: Not imported anywhere
|
|
657
|
+
- **Action**: Remove from package.json
|
|
658
|
+
- **Savings**: 2.3 MB
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
**Example**: See Examples section
|
|
662
|
+
|
|
663
|
+
---
|
|
664
|
+
|
|
665
|
+
### 5. Version Update Report
|
|
666
|
+
|
|
667
|
+
**report_type**: `version-update`
|
|
668
|
+
|
|
669
|
+
**Required Metadata**:
|
|
670
|
+
- old_version
|
|
671
|
+
- new_version
|
|
672
|
+
- files_updated
|
|
673
|
+
- references_updated
|
|
674
|
+
|
|
675
|
+
**Detailed Findings Structure**:
|
|
676
|
+
```markdown
|
|
677
|
+
## Detailed Findings
|
|
678
|
+
|
|
679
|
+
### Version Changes
|
|
680
|
+
|
|
681
|
+
- **Old Version**: 0.7.0
|
|
682
|
+
- **New Version**: 0.8.0
|
|
683
|
+
- **Change Type**: Minor
|
|
684
|
+
|
|
685
|
+
### Files Updated (15)
|
|
686
|
+
|
|
687
|
+
#### Package Files (2)
|
|
688
|
+
|
|
689
|
+
1. **package.json**
|
|
690
|
+
- **Line 3**: `"version": "0.7.0"` → `"version": "0.8.0"`
|
|
691
|
+
|
|
692
|
+
2. **packages/client/package.json**
|
|
693
|
+
- **Line 3**: `"version": "0.7.0"` → `"version": "0.8.0"`
|
|
694
|
+
|
|
695
|
+
#### Documentation Files (8)
|
|
696
|
+
|
|
697
|
+
1. **README.md**
|
|
698
|
+
- **Line 10**: Version badge updated
|
|
699
|
+
- **Line 45**: Installation version updated
|
|
700
|
+
|
|
701
|
+
### Historical References Preserved (12)
|
|
702
|
+
|
|
703
|
+
- CHANGELOG.md entries for 0.7.0 preserved
|
|
704
|
+
- Release notes for previous versions unchanged
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
**Example**: See Examples section
|
|
708
|
+
|
|
709
|
+
---
|
|
710
|
+
|
|
711
|
+
### 6. Code Health Report
|
|
712
|
+
|
|
713
|
+
**report_type**: `code-health`
|
|
714
|
+
|
|
715
|
+
**Required Metadata**:
|
|
716
|
+
- overall_score
|
|
717
|
+
- bugs_found
|
|
718
|
+
- security_issues
|
|
719
|
+
- dead_code_items
|
|
720
|
+
- dependency_issues
|
|
721
|
+
|
|
722
|
+
**Detailed Findings Structure**:
|
|
723
|
+
```markdown
|
|
724
|
+
## Detailed Findings
|
|
725
|
+
|
|
726
|
+
### Overall Health Score: 72/100 (Good)
|
|
727
|
+
|
|
728
|
+
### Domain Results
|
|
729
|
+
|
|
730
|
+
#### Bugs (Bug Orchestrator)
|
|
731
|
+
|
|
732
|
+
- **Status**: ✅ Completed
|
|
733
|
+
- **Issues Found**: 23
|
|
734
|
+
- **Critical**: 3
|
|
735
|
+
- **Report**: `bug-hunting-report.md`
|
|
736
|
+
|
|
737
|
+
#### Security (Security Orchestrator)
|
|
738
|
+
|
|
739
|
+
- **Status**: ⚠️ Partial
|
|
740
|
+
- **Vulnerabilities**: 7
|
|
741
|
+
- **Critical**: 2 unfixed
|
|
742
|
+
- **Report**: `security-audit-report.md`
|
|
743
|
+
|
|
744
|
+
#### Dead Code (Dead Code Orchestrator)
|
|
745
|
+
|
|
746
|
+
- **Status**: ✅ Completed
|
|
747
|
+
- **Items Removed**: 45
|
|
748
|
+
- **Lines Deleted**: 1,234
|
|
749
|
+
- **Report**: `dead-code-report.md`
|
|
750
|
+
|
|
751
|
+
#### Dependencies (Dependency Orchestrator)
|
|
752
|
+
|
|
753
|
+
- **Status**: ✅ Completed
|
|
754
|
+
- **Outdated**: 0 critical
|
|
755
|
+
- **Vulnerable**: 1 low
|
|
756
|
+
- **Report**: `dependency-audit-report.md`
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
**Example**: See Examples section
|
|
760
|
+
|
|
761
|
+
---
|
|
762
|
+
|
|
763
|
+
### 7. Verification Report
|
|
764
|
+
|
|
765
|
+
**report_type**: `verification`
|
|
766
|
+
|
|
767
|
+
**Required Metadata**:
|
|
768
|
+
- original_report
|
|
769
|
+
- verification_type (final|retry|followup)
|
|
770
|
+
- comparison_performed
|
|
771
|
+
|
|
772
|
+
**Detailed Findings Structure**:
|
|
773
|
+
```markdown
|
|
774
|
+
## Detailed Findings
|
|
775
|
+
|
|
776
|
+
### Verification Type: Final Scan
|
|
777
|
+
|
|
778
|
+
### Original Report Comparison
|
|
779
|
+
|
|
780
|
+
- **Original Issues**: 23
|
|
781
|
+
- **Current Issues**: 2
|
|
782
|
+
- **Resolved**: 21
|
|
783
|
+
- **New Issues**: 0
|
|
784
|
+
- **Regression**: ❌ None
|
|
785
|
+
|
|
786
|
+
### Remaining Issues (2)
|
|
787
|
+
|
|
788
|
+
1. **Medium Priority: Type inference issue**
|
|
789
|
+
- **Status**: Known limitation
|
|
790
|
+
- **Documented**: Yes
|
|
791
|
+
- **Blocking**: No
|
|
792
|
+
|
|
793
|
+
### Validation
|
|
794
|
+
|
|
795
|
+
- Type Check: ✅ PASSED
|
|
796
|
+
- Build: ✅ PASSED
|
|
797
|
+
- Tests: ✅ PASSED (42/42)
|
|
798
|
+
```
|
|
799
|
+
|
|
800
|
+
**Example**: See Examples section
|
|
801
|
+
|
|
802
|
+
---
|
|
803
|
+
|
|
804
|
+
## Examples
|
|
805
|
+
|
|
806
|
+
### Example 1: Bug Hunting Report
|
|
807
|
+
|
|
808
|
+
```markdown
|
|
809
|
+
---
|
|
810
|
+
report_type: bug-hunting
|
|
811
|
+
generated: 2025-10-17T14:30:00Z
|
|
812
|
+
version: 2025-10-17
|
|
813
|
+
status: success
|
|
814
|
+
agent: bug-hunter
|
|
815
|
+
duration: 3m 45s
|
|
816
|
+
files_processed: 147
|
|
817
|
+
issues_found: 23
|
|
818
|
+
critical_count: 3
|
|
819
|
+
high_count: 8
|
|
820
|
+
medium_count: 12
|
|
821
|
+
low_count: 0
|
|
822
|
+
---
|
|
823
|
+
|
|
824
|
+
# Bug Hunting Report: 2025-10-17
|
|
825
|
+
|
|
826
|
+
**Generated**: 2025-10-17 14:30:00 UTC
|
|
827
|
+
**Status**: ✅ success
|
|
828
|
+
**Version**: 2025-10-17
|
|
829
|
+
**Agent**: bug-hunter
|
|
830
|
+
**Duration**: 3m 45s
|
|
831
|
+
**Files Processed**: 147
|
|
832
|
+
|
|
833
|
+
---
|
|
834
|
+
|
|
835
|
+
## Executive Summary
|
|
836
|
+
|
|
837
|
+
Comprehensive bug scan completed successfully. Found 23 bugs across 147 TypeScript files.
|
|
838
|
+
|
|
839
|
+
### Key Metrics
|
|
840
|
+
|
|
841
|
+
- **Critical Bugs**: 3 (require immediate attention)
|
|
842
|
+
- **High-Priority Bugs**: 8 (fix this sprint)
|
|
843
|
+
- **Medium-Priority Bugs**: 12 (schedule next sprint)
|
|
844
|
+
- **Files Scanned**: 147
|
|
845
|
+
- **Scan Duration**: 3m 45s
|
|
846
|
+
|
|
847
|
+
### Highlights
|
|
848
|
+
|
|
849
|
+
- ✅ Scan completed without errors
|
|
850
|
+
- ❌ 3 critical bugs require immediate attention
|
|
851
|
+
- ⚠️ Memory leak detected in connection pool (Critical)
|
|
852
|
+
- ✅ No security vulnerabilities in bug patterns
|
|
853
|
+
|
|
854
|
+
---
|
|
855
|
+
|
|
856
|
+
## Detailed Findings
|
|
857
|
+
|
|
858
|
+
### Critical (3)
|
|
859
|
+
|
|
860
|
+
1. **[src/api/database.ts:45] Memory Leak in Connection Pool**
|
|
861
|
+
- **Severity**: Critical
|
|
862
|
+
- **Priority**: P0
|
|
863
|
+
- **Description**: Connection pool not releasing connections after timeout
|
|
864
|
+
- **Impact**: Memory exhaustion after ~2 hours of operation
|
|
865
|
+
- **Location**: `src/api/database.ts:45-67`
|
|
866
|
+
- **Fix**: Implement automatic connection cleanup and recycling
|
|
867
|
+
- **Estimated Time**: 2 hours
|
|
868
|
+
|
|
869
|
+
2. **[src/auth/session.ts:123] Race Condition in Session Management**
|
|
870
|
+
- **Severity**: Critical
|
|
871
|
+
- **Priority**: P0
|
|
872
|
+
- **Description**: Concurrent requests can create duplicate sessions
|
|
873
|
+
- **Impact**: Data inconsistency, potential security issue
|
|
874
|
+
- **Location**: `src/auth/session.ts:123-145`
|
|
875
|
+
- **Fix**: Add mutex lock or atomic transaction
|
|
876
|
+
- **Estimated Time**: 1.5 hours
|
|
877
|
+
|
|
878
|
+
3. **[src/utils/parser.ts:89] Unhandled Promise Rejection**
|
|
879
|
+
- **Severity**: Critical
|
|
880
|
+
- **Priority**: P0
|
|
881
|
+
- **Description**: Promise rejection in parser crashes the process
|
|
882
|
+
- **Impact**: Service crashes on malformed input
|
|
883
|
+
- **Location**: `src/utils/parser.ts:89-102`
|
|
884
|
+
- **Fix**: Add try-catch around async parser calls
|
|
885
|
+
- **Estimated Time**: 30 minutes
|
|
886
|
+
|
|
887
|
+
### High (8)
|
|
888
|
+
|
|
889
|
+
1. **[src/components/Form.tsx:234] Type Error in Props**
|
|
890
|
+
- **Severity**: High
|
|
891
|
+
- **Priority**: P1
|
|
892
|
+
- **Description**: Missing required prop `onSubmit` not caught by types
|
|
893
|
+
- **Impact**: Runtime errors when form is submitted
|
|
894
|
+
- **Location**: `src/components/Form.tsx:234`
|
|
895
|
+
- **Fix**: Add proper TypeScript interface for props
|
|
896
|
+
- **Estimated Time**: 20 minutes
|
|
897
|
+
|
|
898
|
+
[... additional high-priority bugs ...]
|
|
899
|
+
|
|
900
|
+
### Medium (12)
|
|
901
|
+
|
|
902
|
+
1. **[src/hooks/useData.ts:56] Inefficient Re-rendering**
|
|
903
|
+
- **Severity**: Medium
|
|
904
|
+
- **Priority**: P2
|
|
905
|
+
- **Description**: Hook causes unnecessary re-renders on every state change
|
|
906
|
+
- **Impact**: Performance degradation with large lists
|
|
907
|
+
- **Location**: `src/hooks/useData.ts:56-78`
|
|
908
|
+
- **Fix**: Add useMemo to expensive calculations
|
|
909
|
+
- **Estimated Time**: 15 minutes
|
|
910
|
+
|
|
911
|
+
[... additional medium-priority bugs ...]
|
|
912
|
+
|
|
913
|
+
---
|
|
914
|
+
|
|
915
|
+
## Validation Results
|
|
916
|
+
|
|
917
|
+
### Type Check
|
|
918
|
+
|
|
919
|
+
**Command**: `pnpm type-check`
|
|
920
|
+
|
|
921
|
+
**Status**: ✅ PASSED
|
|
922
|
+
|
|
923
|
+
**Output**:
|
|
924
|
+
\```
|
|
925
|
+
tsc --noEmit
|
|
926
|
+
No type errors found.
|
|
927
|
+
Checked 147 files in 2.34s
|
|
928
|
+
\```
|
|
929
|
+
|
|
930
|
+
**Exit Code**: 0
|
|
931
|
+
|
|
932
|
+
### Build
|
|
933
|
+
|
|
934
|
+
**Command**: `pnpm build`
|
|
935
|
+
|
|
936
|
+
**Status**: ✅ PASSED
|
|
937
|
+
|
|
938
|
+
**Output**:
|
|
939
|
+
\```
|
|
940
|
+
vite build
|
|
941
|
+
✓ 147 modules transformed
|
|
942
|
+
✓ built in 3.45s
|
|
943
|
+
dist/index.js 125.3 kB
|
|
944
|
+
dist/styles.css 45.2 kB
|
|
945
|
+
\```
|
|
946
|
+
|
|
947
|
+
**Exit Code**: 0
|
|
948
|
+
|
|
949
|
+
### Tests (Optional)
|
|
950
|
+
|
|
951
|
+
**Command**: `pnpm test`
|
|
952
|
+
|
|
953
|
+
**Status**: ✅ PASSED (42/42)
|
|
954
|
+
|
|
955
|
+
**Output**:
|
|
956
|
+
\```
|
|
957
|
+
jest
|
|
958
|
+
PASS src/api/database.test.ts
|
|
959
|
+
PASS src/auth/session.test.ts
|
|
960
|
+
PASS src/utils/parser.test.ts
|
|
961
|
+
...
|
|
962
|
+
Tests: 42 passed, 42 total
|
|
963
|
+
Time: 4.567s
|
|
964
|
+
\```
|
|
965
|
+
|
|
966
|
+
**Exit Code**: 0
|
|
967
|
+
|
|
968
|
+
### Overall Status
|
|
969
|
+
|
|
970
|
+
**Validation**: ✅ PASSED
|
|
971
|
+
|
|
972
|
+
All validation checks completed successfully. Codebase is stable and buildable despite bugs found.
|
|
973
|
+
|
|
974
|
+
---
|
|
975
|
+
|
|
976
|
+
## Next Steps
|
|
977
|
+
|
|
978
|
+
### Immediate Actions (Required)
|
|
979
|
+
|
|
980
|
+
1. **Fix Critical Bugs** (P0)
|
|
981
|
+
- Start with memory leak in connection pool (highest impact)
|
|
982
|
+
- Then race condition in session management
|
|
983
|
+
- Finally unhandled promise rejection
|
|
984
|
+
|
|
985
|
+
2. **Run Regression Tests**
|
|
986
|
+
- After each critical fix, run full test suite
|
|
987
|
+
- Verify no new issues introduced
|
|
988
|
+
|
|
989
|
+
3. **Deploy Fixes**
|
|
990
|
+
- Critical fixes should be deployed immediately
|
|
991
|
+
- Consider hotfix release
|
|
992
|
+
|
|
993
|
+
### Recommended Actions (Optional)
|
|
994
|
+
|
|
995
|
+
- Schedule high-priority bugs for current sprint
|
|
996
|
+
- Create tickets for medium-priority bugs
|
|
997
|
+
- Consider adding integration tests for race conditions
|
|
998
|
+
|
|
999
|
+
### Follow-Up
|
|
1000
|
+
|
|
1001
|
+
- Re-run bug scan after fixes to verify resolution
|
|
1002
|
+
- Monitor production for memory usage after connection pool fix
|
|
1003
|
+
- Update documentation with lessons learned
|
|
1004
|
+
|
|
1005
|
+
---
|
|
1006
|
+
|
|
1007
|
+
## Appendix A: Files Scanned
|
|
1008
|
+
|
|
1009
|
+
Total: 147 files
|
|
1010
|
+
|
|
1011
|
+
- TypeScript files: 125
|
|
1012
|
+
- React components: 45
|
|
1013
|
+
- Test files: 42
|
|
1014
|
+
- Configuration: 5
|
|
1015
|
+
|
|
1016
|
+
---
|
|
1017
|
+
|
|
1018
|
+
## Appendix B: Scan Configuration
|
|
1019
|
+
|
|
1020
|
+
- **Mode**: Thorough
|
|
1021
|
+
- **Patterns**: TypeScript, React
|
|
1022
|
+
- **Excluded**: node_modules, dist, .git
|
|
1023
|
+
- **Timeout**: None
|
|
1024
|
+
- **Max Depth**: Unlimited
|
|
1025
|
+
```
|
|
1026
|
+
|
|
1027
|
+
---
|
|
1028
|
+
|
|
1029
|
+
### Example 2: Security Audit Report
|
|
1030
|
+
|
|
1031
|
+
```markdown
|
|
1032
|
+
---
|
|
1033
|
+
report_type: security-audit
|
|
1034
|
+
generated: 2025-10-17T15:45:00Z
|
|
1035
|
+
version: final
|
|
1036
|
+
status: partial
|
|
1037
|
+
agent: security-scanner
|
|
1038
|
+
duration: 5m 12s
|
|
1039
|
+
vulnerabilities_found: 7
|
|
1040
|
+
critical_vulns: 2
|
|
1041
|
+
high_vulns: 3
|
|
1042
|
+
medium_vulns: 2
|
|
1043
|
+
low_vulns: 0
|
|
1044
|
+
rls_policies_checked: 15
|
|
1045
|
+
---
|
|
1046
|
+
|
|
1047
|
+
# Security Audit Report: final
|
|
1048
|
+
|
|
1049
|
+
**Generated**: 2025-10-17 15:45:00 UTC
|
|
1050
|
+
**Status**: ⚠️ partial
|
|
1051
|
+
**Version**: final
|
|
1052
|
+
**Agent**: security-scanner
|
|
1053
|
+
**Duration**: 5m 12s
|
|
1054
|
+
**Vulnerabilities Found**: 7
|
|
1055
|
+
|
|
1056
|
+
---
|
|
1057
|
+
|
|
1058
|
+
## Executive Summary
|
|
1059
|
+
|
|
1060
|
+
Security audit completed with **2 critical vulnerabilities** requiring immediate attention.
|
|
1061
|
+
|
|
1062
|
+
### Key Metrics
|
|
1063
|
+
|
|
1064
|
+
- **Security Score**: 65/100 (Needs Improvement)
|
|
1065
|
+
- **Critical Vulnerabilities**: 2 (URGENT)
|
|
1066
|
+
- **High Vulnerabilities**: 3 (This Sprint)
|
|
1067
|
+
- **RLS Policies Checked**: 15 (3 missing)
|
|
1068
|
+
- **OWASP Top 10 Coverage**: 80%
|
|
1069
|
+
|
|
1070
|
+
### Highlights
|
|
1071
|
+
|
|
1072
|
+
- ❌ 2 critical vulnerabilities require immediate patching
|
|
1073
|
+
- ❌ Hardcoded credentials found in configuration files
|
|
1074
|
+
- ⚠️ 3 missing RLS policies on Supabase tables
|
|
1075
|
+
- ✅ No SQL injection vulnerabilities detected
|
|
1076
|
+
- ✅ Authentication middleware properly configured
|
|
1077
|
+
|
|
1078
|
+
---
|
|
1079
|
+
|
|
1080
|
+
## Detailed Findings
|
|
1081
|
+
|
|
1082
|
+
### OWASP Top 10 Scan
|
|
1083
|
+
|
|
1084
|
+
#### A01:2021 - Broken Access Control
|
|
1085
|
+
|
|
1086
|
+
- ⚠️ **3 issues found**
|
|
1087
|
+
|
|
1088
|
+
1. **Missing RLS Policy on `users` table**
|
|
1089
|
+
- **Severity**: Critical
|
|
1090
|
+
- **Location**: Supabase `users` table
|
|
1091
|
+
- **Issue**: No Row-Level Security policy defined
|
|
1092
|
+
- **Impact**: All authenticated users can read all user data
|
|
1093
|
+
- **Remediation**: Add RLS policy:
|
|
1094
|
+
\```sql
|
|
1095
|
+
ALTER TABLE users ENABLE ROW LEVEL SECURITY;
|
|
1096
|
+
|
|
1097
|
+
CREATE POLICY "Users can only see own data"
|
|
1098
|
+
ON users FOR SELECT
|
|
1099
|
+
USING (auth.uid() = id);
|
|
1100
|
+
\```
|
|
1101
|
+
|
|
1102
|
+
2. **Missing Authorization Check in Admin Endpoint**
|
|
1103
|
+
- **Severity**: High
|
|
1104
|
+
- **Location**: `src/api/admin.ts:45`
|
|
1105
|
+
- **Issue**: Admin endpoint doesn't verify admin role
|
|
1106
|
+
- **Impact**: Any authenticated user can access admin functions
|
|
1107
|
+
- **Remediation**: Add role check middleware
|
|
1108
|
+
|
|
1109
|
+
#### A02:2021 - Cryptographic Failures
|
|
1110
|
+
|
|
1111
|
+
- ❌ **1 critical issue found**
|
|
1112
|
+
|
|
1113
|
+
1. **Hardcoded Secret in Configuration**
|
|
1114
|
+
- **Severity**: Critical
|
|
1115
|
+
- **Location**: `config/secrets.ts:15`
|
|
1116
|
+
- **Issue**: JWT secret hardcoded in source
|
|
1117
|
+
- **Impact**: Anyone with access to code can forge tokens
|
|
1118
|
+
- **Remediation**:
|
|
1119
|
+
1. Rotate the exposed secret immediately
|
|
1120
|
+
2. Move to environment variable
|
|
1121
|
+
3. Add to .gitignore
|
|
1122
|
+
|
|
1123
|
+
#### A03:2021 - Injection
|
|
1124
|
+
|
|
1125
|
+
- ✅ **No issues found**
|
|
1126
|
+
- All database queries use parameterized statements
|
|
1127
|
+
- No raw SQL concatenation detected
|
|
1128
|
+
|
|
1129
|
+
#### A04:2021 - Insecure Design
|
|
1130
|
+
|
|
1131
|
+
- ⚠️ **1 issue found**
|
|
1132
|
+
|
|
1133
|
+
1. **Password Reset Token Not Expiring**
|
|
1134
|
+
- **Severity**: Medium
|
|
1135
|
+
- **Location**: `src/auth/reset.ts:67`
|
|
1136
|
+
- **Issue**: Reset tokens never expire
|
|
1137
|
+
- **Impact**: Old reset links remain valid indefinitely
|
|
1138
|
+
- **Remediation**: Add 1-hour expiration to tokens
|
|
1139
|
+
|
|
1140
|
+
[... additional OWASP categories ...]
|
|
1141
|
+
|
|
1142
|
+
---
|
|
1143
|
+
|
|
1144
|
+
## Validation Results
|
|
1145
|
+
|
|
1146
|
+
### Type Check
|
|
1147
|
+
|
|
1148
|
+
**Command**: `pnpm type-check`
|
|
1149
|
+
|
|
1150
|
+
**Status**: ✅ PASSED
|
|
1151
|
+
|
|
1152
|
+
### Build
|
|
1153
|
+
|
|
1154
|
+
**Command**: `pnpm build`
|
|
1155
|
+
|
|
1156
|
+
**Status**: ✅ PASSED
|
|
1157
|
+
|
|
1158
|
+
### Security Tests
|
|
1159
|
+
|
|
1160
|
+
**Command**: `pnpm test:security`
|
|
1161
|
+
|
|
1162
|
+
**Status**: ⚠️ PARTIAL (2/5 failed)
|
|
1163
|
+
|
|
1164
|
+
**Output**:
|
|
1165
|
+
\```
|
|
1166
|
+
FAIL src/api/admin.test.ts
|
|
1167
|
+
● Admin API › should require admin role
|
|
1168
|
+
Expected 403, received 200
|
|
1169
|
+
|
|
1170
|
+
FAIL src/auth/reset.test.ts
|
|
1171
|
+
● Password Reset › tokens should expire
|
|
1172
|
+
Token still valid after 2 hours
|
|
1173
|
+
\```
|
|
1174
|
+
|
|
1175
|
+
### Overall Status
|
|
1176
|
+
|
|
1177
|
+
**Validation**: ⚠️ PARTIAL
|
|
1178
|
+
|
|
1179
|
+
Critical vulnerabilities found. System is functional but security posture needs improvement.
|
|
1180
|
+
|
|
1181
|
+
---
|
|
1182
|
+
|
|
1183
|
+
## Next Steps
|
|
1184
|
+
|
|
1185
|
+
### Immediate Actions (URGENT)
|
|
1186
|
+
|
|
1187
|
+
1. **Rotate Exposed JWT Secret**
|
|
1188
|
+
- Generate new secret
|
|
1189
|
+
- Update environment variables
|
|
1190
|
+
- Invalidate all existing tokens
|
|
1191
|
+
- Deploy immediately
|
|
1192
|
+
|
|
1193
|
+
2. **Add Missing RLS Policies**
|
|
1194
|
+
- `users` table (Critical)
|
|
1195
|
+
- `posts` table (High)
|
|
1196
|
+
- `comments` table (High)
|
|
1197
|
+
|
|
1198
|
+
3. **Fix Admin Authorization**
|
|
1199
|
+
- Add role check to admin endpoints
|
|
1200
|
+
- Test with non-admin users
|
|
1201
|
+
- Deploy with secret rotation
|
|
1202
|
+
|
|
1203
|
+
### Recommended Actions (This Sprint)
|
|
1204
|
+
|
|
1205
|
+
- Add token expiration to password resets
|
|
1206
|
+
- Implement rate limiting on auth endpoints
|
|
1207
|
+
- Review and update security documentation
|
|
1208
|
+
|
|
1209
|
+
### Follow-Up
|
|
1210
|
+
|
|
1211
|
+
- Schedule monthly security audits
|
|
1212
|
+
- Set up automated vulnerability scanning
|
|
1213
|
+
- Train team on secure coding practices
|
|
1214
|
+
|
|
1215
|
+
---
|
|
1216
|
+
|
|
1217
|
+
## Appendix: RLS Policy Templates
|
|
1218
|
+
|
|
1219
|
+
\```sql
|
|
1220
|
+
-- Users table
|
|
1221
|
+
ALTER TABLE users ENABLE ROW LEVEL SECURITY;
|
|
1222
|
+
|
|
1223
|
+
CREATE POLICY "Users can see own data"
|
|
1224
|
+
ON users FOR SELECT
|
|
1225
|
+
USING (auth.uid() = id);
|
|
1226
|
+
|
|
1227
|
+
-- Posts table
|
|
1228
|
+
ALTER TABLE posts ENABLE ROW LEVEL SECURITY;
|
|
1229
|
+
|
|
1230
|
+
CREATE POLICY "Public posts readable"
|
|
1231
|
+
ON posts FOR SELECT
|
|
1232
|
+
USING (is_public = true OR auth.uid() = user_id);
|
|
1233
|
+
\```
|
|
1234
|
+
```
|
|
1235
|
+
|
|
1236
|
+
---
|
|
1237
|
+
|
|
1238
|
+
## Validation Checklist
|
|
1239
|
+
|
|
1240
|
+
Use this checklist when reviewing reports:
|
|
1241
|
+
|
|
1242
|
+
### Report Structure
|
|
1243
|
+
- [ ] YAML frontmatter present and valid
|
|
1244
|
+
- [ ] Title follows format: `# {Type} Report: {Version}`
|
|
1245
|
+
- [ ] Header includes all required metadata
|
|
1246
|
+
- [ ] All 5 required sections present
|
|
1247
|
+
|
|
1248
|
+
### Content Quality
|
|
1249
|
+
- [ ] Executive Summary is concise and clear
|
|
1250
|
+
- [ ] Key metrics are quantified
|
|
1251
|
+
- [ ] Detailed findings are specific and actionable
|
|
1252
|
+
- [ ] Validation results show actual commands run
|
|
1253
|
+
- [ ] Next steps are concrete and prioritized
|
|
1254
|
+
|
|
1255
|
+
### Status Consistency
|
|
1256
|
+
- [ ] Header status matches YAML frontmatter
|
|
1257
|
+
- [ ] Status emoji matches status text
|
|
1258
|
+
- [ ] Validation status matches overall status
|
|
1259
|
+
- [ ] If failed, explanation is provided
|
|
1260
|
+
|
|
1261
|
+
### Format Compliance
|
|
1262
|
+
- [ ] Markdown formatting is correct
|
|
1263
|
+
- [ ] Code blocks use proper syntax highlighting
|
|
1264
|
+
- [ ] Lists are properly formatted
|
|
1265
|
+
- [ ] Headers use correct levels (H1, H2, H3)
|
|
1266
|
+
|
|
1267
|
+
---
|
|
1268
|
+
|
|
1269
|
+
## Usage by Workers
|
|
1270
|
+
|
|
1271
|
+
### Step 1: Create Report File
|
|
1272
|
+
|
|
1273
|
+
```markdown
|
|
1274
|
+
Use the generate-report-header Skill to create the header.
|
|
1275
|
+
```
|
|
1276
|
+
|
|
1277
|
+
### Step 2: Add YAML Frontmatter
|
|
1278
|
+
|
|
1279
|
+
```markdown
|
|
1280
|
+
Add YAML frontmatter at the very beginning with all required metadata.
|
|
1281
|
+
```
|
|
1282
|
+
|
|
1283
|
+
### Step 3: Fill Executive Summary
|
|
1284
|
+
|
|
1285
|
+
```markdown
|
|
1286
|
+
Summarize key findings with 3-5 metrics.
|
|
1287
|
+
```
|
|
1288
|
+
|
|
1289
|
+
### Step 4: Add Detailed Findings
|
|
1290
|
+
|
|
1291
|
+
```markdown
|
|
1292
|
+
Follow report-type-specific structure for detailed findings.
|
|
1293
|
+
```
|
|
1294
|
+
|
|
1295
|
+
### Step 5: Run Validations
|
|
1296
|
+
|
|
1297
|
+
```markdown
|
|
1298
|
+
Run type-check, build, and optional tests. Document results.
|
|
1299
|
+
```
|
|
1300
|
+
|
|
1301
|
+
### Step 6: Add Next Steps
|
|
1302
|
+
|
|
1303
|
+
```markdown
|
|
1304
|
+
Provide specific, actionable next steps separated by priority.
|
|
1305
|
+
```
|
|
1306
|
+
|
|
1307
|
+
### Step 7: Self-Validate
|
|
1308
|
+
|
|
1309
|
+
```markdown
|
|
1310
|
+
Use validate-report-file Skill to check report completeness.
|
|
1311
|
+
```
|
|
1312
|
+
|
|
1313
|
+
### Step 8: Save Report
|
|
1314
|
+
|
|
1315
|
+
```markdown
|
|
1316
|
+
Save with standard naming: {report-type}-report-{version}.md
|
|
1317
|
+
```
|
|
1318
|
+
|
|
1319
|
+
---
|
|
1320
|
+
|
|
1321
|
+
**Template Version**: 1.0
|
|
1322
|
+
**Last Updated**: 2025-10-17
|
|
1323
|
+
**Status**: ✅ COMPLETE - Standard Template for All Reports
|
|
1324
|
+
**Next Task**: Task 3.4 - Create Verification Agent Spec (optional)
|