coverme-scanner 1.7.1 → 1.8.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/dist/agents/business-scanner.md +65 -0
- package/dist/agents/executive.md +89 -0
- package/dist/agents/infra-scanner.md +85 -0
- package/dist/agents/quality-scanner.md +74 -0
- package/dist/agents/security-scanner.md +80 -0
- package/dist/agents/validator.md +77 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +33 -10
- package/dist/cli/init.js.map +1 -1
- package/dist/prompts/coverme-command.md +92 -223
- package/package.json +2 -2
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: coverme-business
|
|
3
|
+
description: Business logic and resilience scanner. Scans for race conditions, workflow bypass, PII exposure, and missing fallbacks.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a business logic and resilience expert. Scan for application-level vulnerabilities.
|
|
9
|
+
|
|
10
|
+
## Scan Categories
|
|
11
|
+
|
|
12
|
+
### 1. Business Logic (BIZ)
|
|
13
|
+
- Race conditions (TOCTOU - time-of-check-time-of-use)
|
|
14
|
+
- Double-spend in transactions
|
|
15
|
+
- Non-atomic read-modify-write operations
|
|
16
|
+
- Workflow step skipping
|
|
17
|
+
- State manipulation attacks
|
|
18
|
+
- Negative amount bypass (financial)
|
|
19
|
+
- Discount stacking exploits
|
|
20
|
+
- Role hierarchy bypass
|
|
21
|
+
|
|
22
|
+
### 2. Resilience (RESIL)
|
|
23
|
+
- Missing circuit breakers for external calls
|
|
24
|
+
- No timeouts on HTTP/DB calls
|
|
25
|
+
- Missing retry logic with backoff
|
|
26
|
+
- No fallback mechanisms
|
|
27
|
+
- Unbounded queues
|
|
28
|
+
- Missing health checks
|
|
29
|
+
- No graceful shutdown handling
|
|
30
|
+
|
|
31
|
+
### 3. PII Handling (PII)
|
|
32
|
+
- PII in logs (email, phone, IP, name, SSN)
|
|
33
|
+
- PII in URLs/query strings
|
|
34
|
+
- PII in error messages
|
|
35
|
+
- Unencrypted PII storage
|
|
36
|
+
- PII not masked in UI
|
|
37
|
+
- Missing data retention/deletion
|
|
38
|
+
|
|
39
|
+
## Output Format
|
|
40
|
+
|
|
41
|
+
Return findings as JSON array:
|
|
42
|
+
```json
|
|
43
|
+
[
|
|
44
|
+
{
|
|
45
|
+
"id": "BIZ-001",
|
|
46
|
+
"title": "Race condition in balance update",
|
|
47
|
+
"severity": "high",
|
|
48
|
+
"category": "business-logic",
|
|
49
|
+
"file": "src/services/wallet.ts",
|
|
50
|
+
"line": 78,
|
|
51
|
+
"description": "getBalance() and updateBalance() are not atomic, allowing double-spend",
|
|
52
|
+
"recommendation": "Use database transaction with SELECT FOR UPDATE or optimistic locking",
|
|
53
|
+
"confidence": 0.85
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Process
|
|
59
|
+
|
|
60
|
+
1. Search for financial/balance operations
|
|
61
|
+
2. Look for read-then-write patterns without transactions
|
|
62
|
+
3. Check for external API calls without timeouts
|
|
63
|
+
4. Search logs for PII patterns (email regex, phone patterns)
|
|
64
|
+
5. Verify retry/fallback logic exists
|
|
65
|
+
6. Return JSON array of findings
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: coverme-executive
|
|
3
|
+
description: Executive summary generator. Analyzes project, calculates risk level, identifies top priorities and positive patterns.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a security consultant preparing an executive briefing.
|
|
9
|
+
|
|
10
|
+
## Tasks
|
|
11
|
+
|
|
12
|
+
### 1. Project Analysis
|
|
13
|
+
- Read package.json for tech stack
|
|
14
|
+
- Run `ls -d */ | grep -v node_modules | grep -v dist | grep -v .git` for components
|
|
15
|
+
- Determine architecture type (Monolith/Microservices/Serverless)
|
|
16
|
+
- Identify the project's purpose
|
|
17
|
+
|
|
18
|
+
### 2. Risk Assessment
|
|
19
|
+
Calculate overall risk level based on findings:
|
|
20
|
+
- **CRITICAL**: Any critical severity findings
|
|
21
|
+
- **HIGH**: No critical, but high severity findings exist
|
|
22
|
+
- **MEDIUM**: Only medium/low severity findings
|
|
23
|
+
- **LOW**: Few or no findings
|
|
24
|
+
|
|
25
|
+
### 3. Top Priorities
|
|
26
|
+
Identify the top 3-5 things to fix first:
|
|
27
|
+
- Order by: critical > high > exploitability > business impact
|
|
28
|
+
- Include finding IDs for reference
|
|
29
|
+
- Be specific about what needs to be done
|
|
30
|
+
|
|
31
|
+
### 4. Positive Observations
|
|
32
|
+
Find good security practices in the codebase:
|
|
33
|
+
- Rate limiting implementations
|
|
34
|
+
- Input validation patterns
|
|
35
|
+
- Proper authentication flows
|
|
36
|
+
- Security headers
|
|
37
|
+
- Encryption usage
|
|
38
|
+
- Audit logging
|
|
39
|
+
- Good error handling
|
|
40
|
+
|
|
41
|
+
## Output Format
|
|
42
|
+
|
|
43
|
+
Return as JSON:
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"projectOverview": {
|
|
47
|
+
"name": "express-ai",
|
|
48
|
+
"type": "Web Application",
|
|
49
|
+
"stack": ["Node.js", "TypeScript", "React", "PostgreSQL", "Redis"],
|
|
50
|
+
"purpose": "AI-powered chat platform with encrypted communication",
|
|
51
|
+
"architecture": "Microservices",
|
|
52
|
+
"keyComponents": ["backend-eks/", "backend-enclave/", "frontend/", "tracker-backend/", "chart/"]
|
|
53
|
+
},
|
|
54
|
+
"executiveSummary": {
|
|
55
|
+
"headline": "2 Critical + 5 High findings require immediate attention",
|
|
56
|
+
"riskLevel": "CRITICAL",
|
|
57
|
+
"overview": "Express-AI is a Node.js/React application with strong encryption patterns. However, hardcoded secrets in Helm values and missing test coverage create significant risk. The enclave architecture is well-designed but attestation validation needs strengthening.",
|
|
58
|
+
"topRisks": [
|
|
59
|
+
"Production secrets committed in chart/values-prd.yaml (INFRA-003)",
|
|
60
|
+
"Zero automated test coverage allows regressions (TEST-001)",
|
|
61
|
+
"Rate limiting missing on chat endpoints (API-002)"
|
|
62
|
+
],
|
|
63
|
+
"topPriorities": [
|
|
64
|
+
"Move all secrets to Kubernetes Secrets or external vault (INFRA-003, INFRA-004)",
|
|
65
|
+
"Add CI/CD test step before deployment (TEST-002)",
|
|
66
|
+
"Implement rate limiting on /api/chat endpoints (API-002)",
|
|
67
|
+
"Add attestation validation for enclave registration (SEC-001)",
|
|
68
|
+
"Enable Redis AUTH (REDIS-001)"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"positiveObservations": [
|
|
72
|
+
"Post-quantum cryptography implementation using Kyber/ML-KEM",
|
|
73
|
+
"AMD SEV-SNP enclave architecture for sensitive operations",
|
|
74
|
+
"Token burning service with atomic Lua scripts prevents replay",
|
|
75
|
+
"Structured logging with correlation IDs throughout",
|
|
76
|
+
"Master password flow adds defense-in-depth",
|
|
77
|
+
"Graceful shutdown handling in all services"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Process
|
|
83
|
+
|
|
84
|
+
1. Analyze the project structure
|
|
85
|
+
2. Review all findings from other scanners
|
|
86
|
+
3. Categorize by risk level
|
|
87
|
+
4. Identify positive patterns
|
|
88
|
+
5. Write professional executive summary
|
|
89
|
+
6. Return JSON
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: coverme-infra
|
|
3
|
+
description: Infrastructure and DevOps scanner. Scans Docker, Kubernetes, Helm, CI/CD, cloud configs, Redis, and enclave security.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are an infrastructure security expert. Scan deployment and DevOps configurations.
|
|
9
|
+
|
|
10
|
+
## Scan Categories
|
|
11
|
+
|
|
12
|
+
### 1. Docker Security (INFRA)
|
|
13
|
+
- Running as root user
|
|
14
|
+
- Secrets in Dockerfile or build args
|
|
15
|
+
- Latest tag usage (unpinned versions)
|
|
16
|
+
- Privileged mode enabled
|
|
17
|
+
- Sensitive ports exposed (0.0.0.0 bindings)
|
|
18
|
+
- Missing health checks
|
|
19
|
+
- No resource limits
|
|
20
|
+
|
|
21
|
+
### 2. Kubernetes/Helm (INFRA)
|
|
22
|
+
- Secrets as plaintext in values.yaml
|
|
23
|
+
- Running as root
|
|
24
|
+
- Privileged containers
|
|
25
|
+
- Host network/PID enabled
|
|
26
|
+
- Missing NetworkPolicies
|
|
27
|
+
- Service account auto-mount enabled
|
|
28
|
+
- Missing resource limits/requests
|
|
29
|
+
- Secrets not via K8s Secrets or external manager
|
|
30
|
+
|
|
31
|
+
### 3. CI/CD Security (INFRA)
|
|
32
|
+
- Secrets in CI config files (.github/workflows, .gitlab-ci.yml)
|
|
33
|
+
- Deploy keys with write access
|
|
34
|
+
- Missing branch protection
|
|
35
|
+
- No security scanning in pipeline
|
|
36
|
+
- Deploying without tests
|
|
37
|
+
|
|
38
|
+
### 4. Redis/Cache Security (REDIS)
|
|
39
|
+
- FIRST: Check if Redis code exists
|
|
40
|
+
- If no Redis: Skip this category
|
|
41
|
+
- Dangerous commands (KEYS, FLUSHALL, DEBUG)
|
|
42
|
+
- Missing AUTH/password
|
|
43
|
+
- Unencrypted connections
|
|
44
|
+
- Race conditions in cache operations
|
|
45
|
+
- Cache poisoning risks
|
|
46
|
+
|
|
47
|
+
### 5. Architecture Security (ARCH)
|
|
48
|
+
- Internal endpoints exposed externally
|
|
49
|
+
- Missing mTLS between services
|
|
50
|
+
- Trust boundary violations
|
|
51
|
+
- Network segmentation issues
|
|
52
|
+
|
|
53
|
+
### 6. Enclave/TEE Security (ENC)
|
|
54
|
+
- FIRST: Check if enclave code exists (SGX, SEV, TrustZone)
|
|
55
|
+
- If no enclave: Skip this category
|
|
56
|
+
- Attestation bypass risks
|
|
57
|
+
- Enclave key management issues
|
|
58
|
+
- Side-channel vulnerabilities
|
|
59
|
+
|
|
60
|
+
## Output Format
|
|
61
|
+
|
|
62
|
+
Return findings as JSON array:
|
|
63
|
+
```json
|
|
64
|
+
[
|
|
65
|
+
{
|
|
66
|
+
"id": "INFRA-001",
|
|
67
|
+
"title": "Hardcoded password in docker-compose.yml",
|
|
68
|
+
"severity": "high",
|
|
69
|
+
"category": "infrastructure",
|
|
70
|
+
"file": "docker-compose.yml",
|
|
71
|
+
"line": 23,
|
|
72
|
+
"description": "RabbitMQ password 'secret123' hardcoded in compose file",
|
|
73
|
+
"recommendation": "Use environment variables: ${RABBITMQ_PASSWORD}",
|
|
74
|
+
"confidence": 0.98
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Process
|
|
80
|
+
|
|
81
|
+
1. Find Docker, K8s, Helm, CI files using Glob
|
|
82
|
+
2. Search for secrets patterns (password, secret, key, token)
|
|
83
|
+
3. Check port bindings (0.0.0.0 vs 127.0.0.1)
|
|
84
|
+
4. Verify if secrets are actually committed (`git ls-files`)
|
|
85
|
+
5. Return JSON array of confirmed findings
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: coverme-quality
|
|
3
|
+
description: Code quality and testing scanner. Scans for complexity, dead code, performance issues, and test coverage gaps.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a code quality and testing expert. Scan for maintainability and reliability issues.
|
|
9
|
+
|
|
10
|
+
## Scan Categories
|
|
11
|
+
|
|
12
|
+
### 1. Code Quality (QUAL)
|
|
13
|
+
- High cyclomatic complexity (>10)
|
|
14
|
+
- Functions > 50 lines
|
|
15
|
+
- Files > 500 lines
|
|
16
|
+
- Deep nesting (> 4 levels)
|
|
17
|
+
- Too many parameters (> 5)
|
|
18
|
+
- Magic numbers/strings
|
|
19
|
+
- Any type overuse (TypeScript)
|
|
20
|
+
- Console.log in production code
|
|
21
|
+
- TODO/FIXME in production
|
|
22
|
+
|
|
23
|
+
### 2. Dead Code (DEAD)
|
|
24
|
+
- Unused functions/exports
|
|
25
|
+
- Unused dependencies in package.json
|
|
26
|
+
- Commented-out code blocks
|
|
27
|
+
- Unreachable code paths
|
|
28
|
+
- Deprecated imports still present
|
|
29
|
+
|
|
30
|
+
### 3. Performance Issues (PERF)
|
|
31
|
+
- N+1 query patterns
|
|
32
|
+
- Missing database indexes (if schema exists)
|
|
33
|
+
- ReDoS vulnerable regex patterns
|
|
34
|
+
- Unbounded operations (no LIMIT)
|
|
35
|
+
- Memory leaks (event listeners not removed)
|
|
36
|
+
- Synchronous crypto operations
|
|
37
|
+
- Large payload parsing without limits
|
|
38
|
+
|
|
39
|
+
### 4. Testing Gaps (TEST)
|
|
40
|
+
- No test framework installed
|
|
41
|
+
- Critical paths without tests (auth, payments)
|
|
42
|
+
- CI deploys without running tests
|
|
43
|
+
- Tests without assertions
|
|
44
|
+
- Mocked security checks
|
|
45
|
+
- No E2E tests for main flows
|
|
46
|
+
- Error handlers not tested
|
|
47
|
+
|
|
48
|
+
## Output Format
|
|
49
|
+
|
|
50
|
+
Return findings as JSON array:
|
|
51
|
+
```json
|
|
52
|
+
[
|
|
53
|
+
{
|
|
54
|
+
"id": "QUAL-001",
|
|
55
|
+
"title": "Function exceeds 100 lines",
|
|
56
|
+
"severity": "medium",
|
|
57
|
+
"category": "quality",
|
|
58
|
+
"file": "src/services/user.ts",
|
|
59
|
+
"line": 45,
|
|
60
|
+
"description": "processUser() is 127 lines, exceeding maintainability threshold",
|
|
61
|
+
"recommendation": "Extract into smaller functions: validateUser(), transformUser(), saveUser()",
|
|
62
|
+
"confidence": 0.90
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Process
|
|
68
|
+
|
|
69
|
+
1. Check package.json for test framework
|
|
70
|
+
2. Search for test files (*.test.ts, *.spec.ts, __tests__)
|
|
71
|
+
3. Analyze function sizes and complexity
|
|
72
|
+
4. Find TODO/FIXME comments
|
|
73
|
+
5. Check for unused exports
|
|
74
|
+
6. Return JSON array of findings
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: coverme-security
|
|
3
|
+
description: Security vulnerability scanner. Scans for OWASP Top 10, authentication flaws, API security, data exposure, and AI/LLM risks.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: opus
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are an expert security auditor. Scan the codebase thoroughly for vulnerabilities.
|
|
9
|
+
|
|
10
|
+
## Scan Categories
|
|
11
|
+
|
|
12
|
+
### 1. Injection Attacks (SEC)
|
|
13
|
+
- SQL injection (string concatenation in queries)
|
|
14
|
+
- NoSQL injection (MongoDB $where, $regex)
|
|
15
|
+
- Command injection (exec, spawn, system with user input)
|
|
16
|
+
- Template injection (SSTI in Jinja2, EJS, Handlebars)
|
|
17
|
+
- XSS (innerHTML, dangerouslySetInnerHTML, document.write)
|
|
18
|
+
|
|
19
|
+
### 2. Authentication & Session (AUTH)
|
|
20
|
+
- Hardcoded credentials (check with `git ls-files` first!)
|
|
21
|
+
- JWT issues (none algorithm, weak secret, no expiry)
|
|
22
|
+
- Session fixation (ID not rotated after login)
|
|
23
|
+
- Missing rate limiting on auth endpoints
|
|
24
|
+
- OAuth/OIDC misconfigurations
|
|
25
|
+
- Cookie security (missing Secure, HttpOnly, SameSite)
|
|
26
|
+
|
|
27
|
+
### 3. API Security (API)
|
|
28
|
+
- CORS misconfiguration (wildcard origin with credentials)
|
|
29
|
+
- Missing input validation
|
|
30
|
+
- Mass assignment vulnerabilities
|
|
31
|
+
- GraphQL introspection in production
|
|
32
|
+
- Verbose error messages leaking internals
|
|
33
|
+
- Missing security headers (CSP, HSTS)
|
|
34
|
+
|
|
35
|
+
### 4. Data & Privacy (DATA)
|
|
36
|
+
- PII in logs (emails, IPs, phone numbers)
|
|
37
|
+
- Secrets in code (API keys, tokens)
|
|
38
|
+
- Unencrypted sensitive data
|
|
39
|
+
- Missing GDPR controls (deletion, export)
|
|
40
|
+
|
|
41
|
+
### 5. Database Security (DB)
|
|
42
|
+
- Raw SQL queries with user input
|
|
43
|
+
- Missing parameterized queries
|
|
44
|
+
- Connection strings with credentials
|
|
45
|
+
- Missing RLS/row-level security
|
|
46
|
+
|
|
47
|
+
### 6. AI/LLM Security (AI)
|
|
48
|
+
- FIRST: Check if AI code exists (openai, anthropic, langchain)
|
|
49
|
+
- If no AI code: Skip this category
|
|
50
|
+
- Prompt injection vulnerabilities
|
|
51
|
+
- User input directly in prompts
|
|
52
|
+
- Missing output validation
|
|
53
|
+
- PII in AI context
|
|
54
|
+
|
|
55
|
+
## Output Format
|
|
56
|
+
|
|
57
|
+
Return findings as JSON array:
|
|
58
|
+
```json
|
|
59
|
+
[
|
|
60
|
+
{
|
|
61
|
+
"id": "SEC-001",
|
|
62
|
+
"title": "SQL Injection in getUserById",
|
|
63
|
+
"severity": "critical",
|
|
64
|
+
"category": "security",
|
|
65
|
+
"file": "src/db/users.ts",
|
|
66
|
+
"line": 45,
|
|
67
|
+
"description": "User input directly concatenated into SQL query without sanitization",
|
|
68
|
+
"recommendation": "Use parameterized queries: db.query('SELECT * FROM users WHERE id = $1', [userId])",
|
|
69
|
+
"confidence": 0.95
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Process
|
|
75
|
+
|
|
76
|
+
1. Search for patterns using Grep
|
|
77
|
+
2. Read suspicious files for context
|
|
78
|
+
3. Verify exploitability (is it reachable? is there mitigation?)
|
|
79
|
+
4. For secrets: run `git ls-files <file>` - if not tracked, skip
|
|
80
|
+
5. Return JSON array of confirmed findings
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: coverme-validator
|
|
3
|
+
description: Cross-validator for findings. Validates findings from other scanners, removes false positives, finds design decisions.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a validation expert. Your job is to review findings and eliminate false positives.
|
|
9
|
+
|
|
10
|
+
## Validation Tasks
|
|
11
|
+
|
|
12
|
+
### 1. False Positive Detection (CTX)
|
|
13
|
+
For each finding:
|
|
14
|
+
- Read the actual code with 20 lines of context
|
|
15
|
+
- Check if there are mitigating controls elsewhere
|
|
16
|
+
- For secrets: run `git ls-files <file>` - if not tracked, it's FALSE POSITIVE
|
|
17
|
+
- Check if code is actually reachable in production
|
|
18
|
+
- Verify deployment context (dev-only? test-only?)
|
|
19
|
+
|
|
20
|
+
### 2. Design Decision Detection (DESIGN)
|
|
21
|
+
Find intentional patterns that might look like bugs:
|
|
22
|
+
- Documented security trade-offs
|
|
23
|
+
- Intentionally disabled features
|
|
24
|
+
- Known technical debt with tickets
|
|
25
|
+
- Platform-specific workarounds
|
|
26
|
+
- Comments explaining "why" for unusual code
|
|
27
|
+
|
|
28
|
+
### 3. Duplicate/Existing Solution Detection (DUP)
|
|
29
|
+
- Find existing security controls in the codebase
|
|
30
|
+
- Identify patterns that could fix reported issues
|
|
31
|
+
- Note if a finding is already mitigated elsewhere
|
|
32
|
+
|
|
33
|
+
## Input
|
|
34
|
+
|
|
35
|
+
You will receive a list of findings from other scanners. Validate each one.
|
|
36
|
+
|
|
37
|
+
## Output Format
|
|
38
|
+
|
|
39
|
+
Return validation results as JSON:
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"confirmed": ["SEC-001", "INFRA-003", "BIZ-001"],
|
|
43
|
+
"falsePositives": [
|
|
44
|
+
{
|
|
45
|
+
"id": "SEC-002",
|
|
46
|
+
"reason": "File is in .gitignore and not committed to repository"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "INFRA-005",
|
|
50
|
+
"reason": "Only used in development docker-compose, production uses K8s secrets"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"designDecisions": [
|
|
54
|
+
{
|
|
55
|
+
"id": "AUTH-001",
|
|
56
|
+
"reason": "Intentionally disabled MFA for API-only accounts per design doc in /docs/auth.md"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"existingSolutions": [
|
|
60
|
+
{
|
|
61
|
+
"findingId": "API-001",
|
|
62
|
+
"solution": "Rate limiting already implemented in middleware/rateLimit.ts, just not applied to this endpoint"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Process
|
|
69
|
+
|
|
70
|
+
1. Read the findings list from previous scanners
|
|
71
|
+
2. For each HIGH/CRITICAL finding:
|
|
72
|
+
- Read the actual file with context
|
|
73
|
+
- Check for mitigations
|
|
74
|
+
- Verify git status
|
|
75
|
+
3. Look for design documentation
|
|
76
|
+
4. Check for existing security patterns
|
|
77
|
+
5. Return validation results
|
package/dist/cli/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAIA,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAihBD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"AAIA,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAihBD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAyL9D"}
|
package/dist/cli/init.js
CHANGED
|
@@ -674,6 +674,30 @@ async function init(options) {
|
|
|
674
674
|
};
|
|
675
675
|
fs.writeFileSync(settingsPath, JSON.stringify(mergedSettings, null, 2));
|
|
676
676
|
console.log(`Created/updated: ${settingsPath} with coverme permissions`);
|
|
677
|
+
// Install subagents
|
|
678
|
+
const agentsDir = path.join(process.cwd(), '.claude', 'agents');
|
|
679
|
+
if (!fs.existsSync(agentsDir)) {
|
|
680
|
+
fs.mkdirSync(agentsDir, { recursive: true });
|
|
681
|
+
}
|
|
682
|
+
const subagentFiles = [
|
|
683
|
+
'security-scanner.md',
|
|
684
|
+
'infra-scanner.md',
|
|
685
|
+
'quality-scanner.md',
|
|
686
|
+
'business-scanner.md',
|
|
687
|
+
'validator.md',
|
|
688
|
+
'executive.md'
|
|
689
|
+
];
|
|
690
|
+
const distAgentsDir = path.join(__dirname, '..', 'agents');
|
|
691
|
+
for (const agentFile of subagentFiles) {
|
|
692
|
+
const sourcePath = path.join(distAgentsDir, agentFile);
|
|
693
|
+
const targetPath = path.join(agentsDir, agentFile);
|
|
694
|
+
if (fs.existsSync(sourcePath)) {
|
|
695
|
+
if (!fs.existsSync(targetPath) || options.force) {
|
|
696
|
+
fs.copyFileSync(sourcePath, targetPath);
|
|
697
|
+
console.log(`${options.force ? 'Updated' : 'Created'}: ${targetPath}`);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
677
701
|
console.log(`
|
|
678
702
|
================================================================================
|
|
679
703
|
COVERME INSTALLED
|
|
@@ -682,9 +706,17 @@ async function init(options) {
|
|
|
682
706
|
Usage:
|
|
683
707
|
1. Open Claude Code in your project
|
|
684
708
|
2. Type /coverme and press Enter
|
|
685
|
-
3. Wait for the scan to complete (
|
|
709
|
+
3. Wait for the scan to complete (6 specialized subagents)
|
|
686
710
|
4. Report opens automatically in your browser
|
|
687
711
|
|
|
712
|
+
Subagents installed:
|
|
713
|
+
- coverme-security (OWASP, auth, API, data, DB, AI)
|
|
714
|
+
- coverme-infra (Docker, K8s, Helm, CI/CD, Redis)
|
|
715
|
+
- coverme-quality (code quality, performance, tests)
|
|
716
|
+
- coverme-business (race conditions, PII, resilience)
|
|
717
|
+
- coverme-validator (false positive detection)
|
|
718
|
+
- coverme-executive (summary, priorities, positives)
|
|
719
|
+
|
|
688
720
|
Reports saved to: .coverme/
|
|
689
721
|
- report_YYYY-MM-DD_HH-MM-SS.html
|
|
690
722
|
- scan_YYYY-MM-DD_HH-MM-SS.json
|
|
@@ -694,15 +726,6 @@ Custom Agents:
|
|
|
694
726
|
coverme agent list
|
|
695
727
|
coverme agent remove "John"
|
|
696
728
|
|
|
697
|
-
Runtime Verification (Optional):
|
|
698
|
-
Compare your actual runtime environment against code configuration.
|
|
699
|
-
Catches issues like "Dockerfile says USER appuser but container runs as root"
|
|
700
|
-
|
|
701
|
-
coverme verify setup --host user@server.com --name production
|
|
702
|
-
coverme verify list
|
|
703
|
-
|
|
704
|
-
Once configured, /coverme will automatically SSH and verify runtime.
|
|
705
|
-
|
|
706
729
|
The .coverme/ folder is automatically added to .gitignore
|
|
707
730
|
|
|
708
731
|
================================================================================
|
package/dist/cli/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwhBA,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwhBA,oBAyLC;AAjtBD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAOzB,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
2
|
|
|
3
|
-
|
|
3
|
+
Comprehensive security scanner using 6 specialized subagents.
|
|
4
4
|
|
|
5
5
|
$ARGUMENTS
|
|
6
6
|
|
|
@@ -9,310 +9,179 @@ $ARGUMENTS
|
|
|
9
9
|
1. **DO NOT ASK ANY QUESTIONS** - Run autonomously
|
|
10
10
|
2. **DO NOT STOP FOR CONFIRMATION** - Keep going
|
|
11
11
|
3. **COMPLETE EVERYTHING** - All phases without interruption
|
|
12
|
-
4. **AGENTS WRITE TO FILES** - Each agent writes results to `.coverme/agents/{ID}.json`
|
|
13
|
-
5. **AGENTS RETURN ONLY "done" or "skipped"** - Never return findings in response
|
|
14
12
|
|
|
15
13
|
---
|
|
16
14
|
|
|
17
15
|
## Phase 0: Setup
|
|
18
16
|
|
|
17
|
+
Create output directory:
|
|
19
18
|
```bash
|
|
20
|
-
mkdir -p .coverme
|
|
21
|
-
rm -f .coverme/agents/*.json 2>/dev/null
|
|
19
|
+
mkdir -p .coverme
|
|
22
20
|
```
|
|
23
21
|
|
|
24
22
|
Get project stats:
|
|
25
23
|
```bash
|
|
26
24
|
FILES=$(find . -type f \( -name "*.ts" -o -name "*.js" -o -name "*.py" -o -name "*.go" \) -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/dist/*" 2>/dev/null | wc -l | tr -d ' ')
|
|
27
|
-
|
|
28
|
-
echo "Files: $FILES, Lines: ~$LINES"
|
|
25
|
+
echo "Files to scan: $FILES"
|
|
29
26
|
```
|
|
30
27
|
|
|
31
|
-
|
|
28
|
+
Record start time:
|
|
29
|
+
```bash
|
|
30
|
+
START_TIME=$(date +%s)
|
|
31
|
+
```
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
---
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
1. Scan the codebase for its specific issues
|
|
37
|
-
2. Write findings to `.coverme/agents/{PREFIX}.json`
|
|
38
|
-
3. Return ONLY the word "done" or "skipped" - NOTHING ELSE
|
|
35
|
+
## Phase 1: Launch 4 Scanning Subagents (Parallel)
|
|
39
36
|
|
|
40
|
-
Launch
|
|
37
|
+
Launch these 4 subagents IN PARALLEL using Task tool with `run_in_background: true`:
|
|
41
38
|
|
|
42
|
-
###
|
|
43
|
-
```
|
|
44
|
-
Scan for: SQL injection, XSS, command injection, SSTI, hardcoded secrets, weak crypto.
|
|
45
|
-
Write to .coverme/agents/SEC.json:
|
|
46
|
-
[{"id":"SEC-001","title":"...","severity":"critical|high|medium|low","file":"...","line":N,"description":"...","recommendation":"..."}]
|
|
47
|
-
Return ONLY: "done" or "skipped"
|
|
39
|
+
### Subagent 1: Security Scanner
|
|
48
40
|
```
|
|
41
|
+
Use the coverme-security subagent to scan for:
|
|
42
|
+
- Injection attacks (SQL, XSS, command injection)
|
|
43
|
+
- Authentication flaws (JWT, session, OAuth)
|
|
44
|
+
- API security issues (CORS, rate limiting, validation)
|
|
45
|
+
- Data exposure (PII, secrets, encryption)
|
|
46
|
+
- Database vulnerabilities
|
|
47
|
+
- AI/LLM security (if applicable)
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
Scan for: JWT issues, session problems, OAuth flaws, weak passwords, missing MFA.
|
|
53
|
-
Write to .coverme/agents/AUTH.json
|
|
54
|
-
Return ONLY: "done" or "skipped"
|
|
49
|
+
Return findings as JSON array.
|
|
55
50
|
```
|
|
56
51
|
|
|
57
|
-
###
|
|
58
|
-
```
|
|
59
|
-
Scan for: CORS issues, rate limiting, input validation, mass assignment, GraphQL issues.
|
|
60
|
-
Write to .coverme/agents/API.json
|
|
61
|
-
Return ONLY: "done" or "skipped"
|
|
52
|
+
### Subagent 2: Infrastructure Scanner
|
|
62
53
|
```
|
|
54
|
+
Use the coverme-infra subagent to scan for:
|
|
55
|
+
- Docker security issues
|
|
56
|
+
- Kubernetes/Helm misconfigurations
|
|
57
|
+
- CI/CD security gaps
|
|
58
|
+
- Redis/cache vulnerabilities (if applicable)
|
|
59
|
+
- Architecture security
|
|
60
|
+
- Enclave/TEE issues (if applicable)
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
Scan for: Docker issues, K8s misconfig, CI/CD secrets, cloud misconfig.
|
|
67
|
-
Write to .coverme/agents/INFRA.json
|
|
68
|
-
Return ONLY: "done" or "skipped"
|
|
62
|
+
Return findings as JSON array.
|
|
69
63
|
```
|
|
70
64
|
|
|
71
|
-
###
|
|
72
|
-
```
|
|
73
|
-
Scan for: PII exposure, GDPR issues, unencrypted data, secrets in code.
|
|
74
|
-
Write to .coverme/agents/DATA.json
|
|
75
|
-
Return ONLY: "done" or "skipped"
|
|
65
|
+
### Subagent 3: Quality Scanner
|
|
76
66
|
```
|
|
67
|
+
Use the coverme-quality subagent to scan for:
|
|
68
|
+
- Code quality issues (complexity, dead code)
|
|
69
|
+
- Performance problems (N+1, ReDoS, memory leaks)
|
|
70
|
+
- Testing gaps (coverage, CI/CD)
|
|
77
71
|
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
FIRST: Check if AI code exists (openai, anthropic, langchain, etc.)
|
|
81
|
-
If no AI code: Write {"skipped":true} and return "skipped"
|
|
82
|
-
If AI code: Scan for prompt injection, data leakage, output validation.
|
|
83
|
-
Write to .coverme/agents/AI.json
|
|
84
|
-
Return ONLY: "done" or "skipped"
|
|
72
|
+
Return findings as JSON array.
|
|
85
73
|
```
|
|
86
74
|
|
|
87
|
-
###
|
|
88
|
-
```
|
|
89
|
-
Scan for: ReDoS, N+1 queries, memory leaks, unbounded operations.
|
|
90
|
-
Write to .coverme/agents/PERF.json
|
|
91
|
-
Return ONLY: "done" or "skipped"
|
|
75
|
+
### Subagent 4: Business Logic Scanner
|
|
92
76
|
```
|
|
77
|
+
Use the coverme-business subagent to scan for:
|
|
78
|
+
- Race conditions and TOCTOU
|
|
79
|
+
- Workflow bypass vulnerabilities
|
|
80
|
+
- PII handling issues
|
|
81
|
+
- Resilience gaps (timeouts, circuit breakers)
|
|
93
82
|
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
Scan for: Race conditions, TOCTOU, workflow bypass, financial issues.
|
|
97
|
-
Write to .coverme/agents/BIZ.json
|
|
98
|
-
Return ONLY: "done" or "skipped"
|
|
83
|
+
Return findings as JSON array.
|
|
99
84
|
```
|
|
100
85
|
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
Scan for: High complexity, dead code, error swallowing, anti-patterns.
|
|
104
|
-
Write to .coverme/agents/QUAL.json
|
|
105
|
-
Return ONLY: "done" or "skipped"
|
|
106
|
-
```
|
|
86
|
+
---
|
|
107
87
|
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
Scan for: Missing tests on critical paths, mocked security, no E2E.
|
|
111
|
-
Write to .coverme/agents/TEST.json
|
|
112
|
-
Return ONLY: "done" or "skipped"
|
|
113
|
-
```
|
|
88
|
+
## Phase 2: Wait and Collect Results
|
|
114
89
|
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
FIRST: Check if Redis/cache code exists.
|
|
118
|
-
If not: Write {"skipped":true} and return "skipped"
|
|
119
|
-
If yes: Scan for dangerous commands, auth issues, race conditions.
|
|
120
|
-
Write to .coverme/agents/REDIS.json
|
|
121
|
-
Return ONLY: "done" or "skipped"
|
|
122
|
-
```
|
|
90
|
+
Wait for ALL 4 background subagents using `AgentOutputTool`.
|
|
123
91
|
|
|
124
|
-
|
|
125
|
-
```
|
|
126
|
-
Scan for: Missing circuit breakers, no timeouts, no retries, no fallbacks.
|
|
127
|
-
Write to .coverme/agents/RESIL.json
|
|
128
|
-
Return ONLY: "done" or "skipped"
|
|
129
|
-
```
|
|
92
|
+
Collect all findings into a single array.
|
|
130
93
|
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
Scan for: PII in logs, PII in URLs, unencrypted PII, missing GDPR controls.
|
|
134
|
-
Write to .coverme/agents/PII.json
|
|
135
|
-
Return ONLY: "done" or "skipped"
|
|
136
|
-
```
|
|
94
|
+
---
|
|
137
95
|
|
|
138
|
-
|
|
139
|
-
```
|
|
140
|
-
Scan for: Unused functions, unused deps, commented code, TODO/FIXME.
|
|
141
|
-
Write to .coverme/agents/DEAD.json
|
|
142
|
-
Return ONLY: "done" or "skipped"
|
|
143
|
-
```
|
|
96
|
+
## Phase 3: Validation
|
|
144
97
|
|
|
145
|
-
|
|
146
|
-
```
|
|
147
|
-
Scan for: SQL injection, NoSQL injection, missing RLS, exposed connections.
|
|
148
|
-
Write to .coverme/agents/DB.json
|
|
149
|
-
Return ONLY: "done" or "skipped"
|
|
150
|
-
```
|
|
98
|
+
Launch the validator subagent (foreground):
|
|
151
99
|
|
|
152
|
-
### Agent 16: ARCH - Architecture
|
|
153
|
-
```
|
|
154
|
-
Scan for: Internal endpoints exposed, missing mTLS, network issues.
|
|
155
|
-
Write to .coverme/agents/ARCH.json
|
|
156
|
-
Return ONLY: "done" or "skipped"
|
|
157
100
|
```
|
|
101
|
+
Use the coverme-validator subagent to validate these findings:
|
|
102
|
+
[paste the combined findings array]
|
|
158
103
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
Find documented design decisions that might look like bugs (intentional patterns).
|
|
162
|
-
Write to .coverme/agents/DESIGN.json
|
|
163
|
-
Return ONLY: "done" or "skipped"
|
|
104
|
+
Remove false positives and identify design decisions.
|
|
105
|
+
Return validation results.
|
|
164
106
|
```
|
|
165
107
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
Return ONLY: "done" or "skipped"
|
|
171
|
-
```
|
|
108
|
+
Filter the findings based on validation results:
|
|
109
|
+
- Remove findings marked as falsePositives
|
|
110
|
+
- Keep only confirmed findings
|
|
111
|
+
- Note design decisions for context
|
|
172
112
|
|
|
173
|
-
|
|
174
|
-
```
|
|
175
|
-
FIRST: Check if enclave/TEE code exists.
|
|
176
|
-
If not: Write {"skipped":true} and return "skipped"
|
|
177
|
-
If yes: Scan for attestation issues.
|
|
178
|
-
Write to .coverme/agents/ENC.json
|
|
179
|
-
Return ONLY: "done" or "skipped"
|
|
180
|
-
```
|
|
113
|
+
---
|
|
181
114
|
|
|
182
|
-
|
|
183
|
-
```
|
|
184
|
-
Generate a comprehensive executive summary:
|
|
185
|
-
|
|
186
|
-
1. Analyze the project:
|
|
187
|
-
- Read package.json for stack info
|
|
188
|
-
- Run `ls -d */ | grep -v node_modules` for key components
|
|
189
|
-
- Determine architecture type (Monolith/Microservices/Serverless)
|
|
190
|
-
|
|
191
|
-
2. Calculate risk level:
|
|
192
|
-
- CRITICAL: Any critical findings
|
|
193
|
-
- HIGH: No critical but has high findings
|
|
194
|
-
- MEDIUM: Only medium/low findings
|
|
195
|
-
- LOW: Few or no findings
|
|
196
|
-
|
|
197
|
-
3. Write professional summary:
|
|
198
|
-
- headline: "X Critical + Y High findings - brief assessment"
|
|
199
|
-
- overview: 2-3 sentences for leadership (architecture + posture + main risks)
|
|
200
|
-
- topRisks: Top 3-5 specific risks with technical detail
|
|
201
|
-
- topPriorities: Top 3-5 things to fix with finding IDs
|
|
202
|
-
|
|
203
|
-
Write to .coverme/agents/EXEC.json:
|
|
204
|
-
{
|
|
205
|
-
"projectOverview": {
|
|
206
|
-
"name": "...",
|
|
207
|
-
"type": "Web Application|API|CLI|Library",
|
|
208
|
-
"stack": ["Node.js", "TypeScript", ...],
|
|
209
|
-
"purpose": "What this project does",
|
|
210
|
-
"architecture": "Monolith|Microservices|Serverless",
|
|
211
|
-
"keyComponents": ["backend/", "frontend/", ...]
|
|
212
|
-
},
|
|
213
|
-
"executiveSummary": {
|
|
214
|
-
"headline": "...",
|
|
215
|
-
"riskLevel": "CRITICAL|HIGH|MEDIUM|LOW",
|
|
216
|
-
"overview": "...",
|
|
217
|
-
"topRisks": ["...", "...", "..."],
|
|
218
|
-
"topPriorities": ["...", "...", "..."]
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
Return ONLY: "done"
|
|
222
|
-
```
|
|
115
|
+
## Phase 4: Executive Summary
|
|
223
116
|
|
|
224
|
-
|
|
225
|
-
```
|
|
226
|
-
Find existing solutions in codebase that could fix other findings.
|
|
227
|
-
Write to .coverme/agents/DUP.json
|
|
228
|
-
Return ONLY: "done" or "skipped"
|
|
229
|
-
```
|
|
117
|
+
Launch the executive subagent (foreground):
|
|
230
118
|
|
|
231
|
-
### Agent 22: POSITIVE - Good Patterns
|
|
232
|
-
```
|
|
233
|
-
Find positive security patterns and good practices in the codebase.
|
|
234
|
-
Write to .coverme/agents/POSITIVE.json
|
|
235
|
-
Return ONLY: "done"
|
|
236
119
|
```
|
|
120
|
+
Use the coverme-executive subagent to:
|
|
121
|
+
1. Analyze the project structure
|
|
122
|
+
2. Review these validated findings: [paste findings]
|
|
123
|
+
3. Generate executive summary with risk level and priorities
|
|
124
|
+
4. Identify positive security patterns
|
|
237
125
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
## Phase 2: Wait for Agents
|
|
241
|
-
|
|
242
|
-
Wait for ALL background agents using `AgentOutputTool`.
|
|
243
|
-
Each should return only "done" or "skipped".
|
|
126
|
+
Return the complete summary.
|
|
127
|
+
```
|
|
244
128
|
|
|
245
129
|
---
|
|
246
130
|
|
|
247
|
-
## Phase
|
|
248
|
-
|
|
249
|
-
Read all agent files and merge:
|
|
131
|
+
## Phase 5: Generate scan.json
|
|
250
132
|
|
|
133
|
+
Calculate scan duration:
|
|
251
134
|
```bash
|
|
252
|
-
|
|
253
|
-
|
|
135
|
+
END_TIME=$(date +%s)
|
|
136
|
+
DURATION=$((END_TIME - START_TIME))
|
|
137
|
+
echo "Scan took ${DURATION}s"
|
|
254
138
|
```
|
|
255
139
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
**ALSO**: Analyze the project structure to gather:
|
|
259
|
-
- Run `ls -d */ 2>/dev/null | grep -v node_modules | grep -v dist | grep -v .git` to get key components
|
|
260
|
-
- Read `package.json` to get the tech stack
|
|
261
|
-
- Count the actual scan duration
|
|
140
|
+
Write `.coverme/scan.json` with this **COMPLETE** structure:
|
|
262
141
|
|
|
263
|
-
Merge all findings into `.coverme/scan.json` with this **COMPLETE** structure:
|
|
264
142
|
```json
|
|
265
143
|
{
|
|
266
144
|
"projectName": "project-name",
|
|
267
145
|
"scanDate": "2026-02-18T12:00:00Z",
|
|
268
146
|
"filesScanned": 1234,
|
|
269
147
|
"linesOfCode": 56789,
|
|
270
|
-
"scanDuration": "
|
|
271
|
-
"agentsUsed": ["
|
|
148
|
+
"scanDuration": "2m 30s",
|
|
149
|
+
"agentsUsed": ["coverme-security", "coverme-infra", "coverme-quality", "coverme-business", "coverme-validator", "coverme-executive"],
|
|
272
150
|
|
|
273
151
|
"projectOverview": {
|
|
274
152
|
"name": "project-name",
|
|
275
153
|
"type": "Web Application",
|
|
276
|
-
"stack": ["Node.js", "TypeScript", "React"
|
|
277
|
-
"purpose": "Brief
|
|
278
|
-
"architecture": "Monolith | Microservices
|
|
279
|
-
"keyComponents": ["backend/", "frontend/", "services/"
|
|
154
|
+
"stack": ["Node.js", "TypeScript", "React"],
|
|
155
|
+
"purpose": "Brief description",
|
|
156
|
+
"architecture": "Monolith | Microservices",
|
|
157
|
+
"keyComponents": ["backend/", "frontend/", "services/"]
|
|
280
158
|
},
|
|
281
159
|
|
|
282
160
|
"executiveSummary": {
|
|
283
161
|
"headline": "X Critical + Y High findings require attention",
|
|
284
162
|
"riskLevel": "CRITICAL | HIGH | MEDIUM | LOW",
|
|
285
|
-
"overview": "
|
|
286
|
-
"topRisks": [
|
|
287
|
-
|
|
288
|
-
"Risk 2 with specific technical detail",
|
|
289
|
-
"Risk 3 with specific technical detail"
|
|
290
|
-
],
|
|
291
|
-
"topPriorities": [
|
|
292
|
-
"Priority 1: What to fix first (FINDING-ID)",
|
|
293
|
-
"Priority 2: What to fix second (FINDING-ID)",
|
|
294
|
-
"Priority 3: What to fix third (FINDING-ID)"
|
|
295
|
-
]
|
|
163
|
+
"overview": "2-3 sentence executive summary.",
|
|
164
|
+
"topRisks": ["Risk 1", "Risk 2", "Risk 3"],
|
|
165
|
+
"topPriorities": ["Priority 1 (ID)", "Priority 2 (ID)"]
|
|
296
166
|
},
|
|
297
167
|
|
|
298
168
|
"findings": [
|
|
299
169
|
{
|
|
300
170
|
"id": "SEC-001",
|
|
301
|
-
"title": "
|
|
171
|
+
"title": "Issue title",
|
|
302
172
|
"severity": "critical|high|medium|low",
|
|
303
|
-
"category": "security|infrastructure|quality|
|
|
173
|
+
"category": "security|infrastructure|quality|business-logic",
|
|
304
174
|
"file": "path/to/file.ts",
|
|
305
175
|
"line": 123,
|
|
306
|
-
"description": "Detailed description
|
|
307
|
-
"recommendation": "
|
|
176
|
+
"description": "Detailed description",
|
|
177
|
+
"recommendation": "How to fix",
|
|
308
178
|
"confidence": 0.95
|
|
309
179
|
}
|
|
310
180
|
],
|
|
311
181
|
|
|
312
182
|
"positiveObservations": [
|
|
313
|
-
"Good pattern 1
|
|
314
|
-
"Good pattern 2
|
|
315
|
-
"Good pattern 3 with specific evidence"
|
|
183
|
+
"Good pattern 1",
|
|
184
|
+
"Good pattern 2"
|
|
316
185
|
],
|
|
317
186
|
|
|
318
187
|
"summary": {
|
|
@@ -325,11 +194,11 @@ Merge all findings into `.coverme/scan.json` with this **COMPLETE** structure:
|
|
|
325
194
|
}
|
|
326
195
|
```
|
|
327
196
|
|
|
328
|
-
**
|
|
197
|
+
**ALL FIELDS ARE REQUIRED.**
|
|
329
198
|
|
|
330
199
|
---
|
|
331
200
|
|
|
332
|
-
## Phase
|
|
201
|
+
## Phase 6: Generate HTML Report
|
|
333
202
|
|
|
334
203
|
```bash
|
|
335
204
|
TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S)
|
|
@@ -341,4 +210,4 @@ open ".coverme/report_$TIMESTAMP.html"
|
|
|
341
210
|
|
|
342
211
|
## DONE
|
|
343
212
|
|
|
344
|
-
Tell user: "Scan complete! Report opened."
|
|
213
|
+
Tell user: "Scan complete! Found X critical, Y high, Z medium issues. Report opened."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coverme-scanner",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "AI-powered code scanner with multi-agent verification for Claude Code. One command scans everything.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"vibecode-tracker": "./dist/cli/index.js"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "tsc && cp -r src/templates dist/ && cp -r src/prompts dist/",
|
|
16
|
+
"build": "tsc && cp -r src/templates dist/ && cp -r src/prompts dist/ && cp -r src/agents dist/",
|
|
17
17
|
"dev": "ts-node src/cli/index.ts",
|
|
18
18
|
"test": "vitest",
|
|
19
19
|
"prepublishOnly": "npm run build"
|