@anthropologies/claudestory 0.1.58 → 0.1.60
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/cli.js +309 -106
- package/dist/mcp.js +240 -50
- package/package.json +1 -1
- package/src/skill/SKILL.md +20 -1
- package/src/skill/review-lenses/references/judge.md +18 -0
- package/src/skill/review-lenses/references/lens-accessibility.md +17 -0
- package/src/skill/review-lenses/references/lens-api-design.md +14 -0
- package/src/skill/review-lenses/references/lens-clean-code.md +15 -0
- package/src/skill/review-lenses/references/lens-concurrency.md +16 -0
- package/src/skill/review-lenses/references/lens-error-handling.md +15 -0
- package/src/skill/review-lenses/references/lens-performance.md +16 -0
- package/src/skill/review-lenses/references/lens-security.md +17 -0
- package/src/skill/review-lenses/references/lens-test-quality.md +16 -0
- package/src/skill/review-lenses/references/merger.md +13 -0
- package/src/skill/review-lenses/references/shared-preamble.md +10 -0
- package/src/skill/review-lenses/review-lenses.md +59 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: clean-code
|
|
3
|
+
version: v1
|
|
4
|
+
model: sonnet
|
|
5
|
+
type: core
|
|
6
|
+
maxSeverity: major
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Clean Code Lens
|
|
10
|
+
|
|
11
|
+
Focuses on structural quality, readability, and maintainability. Checks: long functions (>50 lines), SRP violations, naming problems, code duplication (3+ repeats), deep nesting (>3 levels), god classes (>10 public methods or >300 lines), dead code, file organization.
|
|
12
|
+
|
|
13
|
+
Does NOT flag: stylistic preferences, language idioms, out-of-scope refactoring, test code, generated code.
|
|
14
|
+
|
|
15
|
+
See `src/autonomous/review-lenses/lenses/clean-code.ts` for the full prompt.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: concurrency
|
|
3
|
+
version: v1
|
|
4
|
+
model: opus
|
|
5
|
+
type: surface-activated
|
|
6
|
+
maxSeverity: critical
|
|
7
|
+
activation: ".swift, .go, .rs, shared mutable state, worker/thread imports, queue/lock/mutex primitives"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Concurrency Lens
|
|
11
|
+
|
|
12
|
+
Finds race conditions, deadlocks, data races, and incorrect concurrent access patterns. Uses Opus for multi-step reasoning about interleaved execution paths. Checks: race conditions, missing locks, deadlock patterns, actor isolation violations, unsafe shared mutable state (including Node.js module-level state), missing atomics, thread-unsafe lazy init, missing cancellation, channel misuse, concurrent collection mutation.
|
|
13
|
+
|
|
14
|
+
For each finding, describes the specific interleaving that triggers the bug.
|
|
15
|
+
|
|
16
|
+
See `src/autonomous/review-lenses/lenses/concurrency.ts` for the full prompt.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: error-handling
|
|
3
|
+
version: v1
|
|
4
|
+
model: sonnet
|
|
5
|
+
type: core
|
|
6
|
+
maxSeverity: critical
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Error Handling Lens
|
|
10
|
+
|
|
11
|
+
Ensures failures are anticipated, caught, communicated, and recovered from. Checks: missing try/catch on I/O, unhandled promise rejections, swallowed errors, missing null checks, no graceful degradation, leaking internals, missing cleanup, unchecked array access, missing error propagation, inconsistent error types.
|
|
12
|
+
|
|
13
|
+
Verifies TypeScript strict mode before flagging type-guaranteed values. Checks RULES.md for established error patterns.
|
|
14
|
+
|
|
15
|
+
See `src/autonomous/review-lenses/lenses/error-handling.ts` for the full prompt.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: performance
|
|
3
|
+
version: v1
|
|
4
|
+
model: sonnet
|
|
5
|
+
type: surface-activated
|
|
6
|
+
maxSeverity: critical
|
|
7
|
+
activation: ORM imports, nested loops >= 2, files > 300 lines, hotPaths config
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Performance Lens
|
|
11
|
+
|
|
12
|
+
Finds patterns causing measurable performance degradation at realistic scale. Checks: N+1 queries, missing indexes, unbounded result sets, sync I/O in hot paths, memory leaks, unnecessary re-renders, large bundle imports, missing memoization, O(n^2+) algorithms, missing pagination.
|
|
13
|
+
|
|
14
|
+
Does NOT flag: micro-optimizations, test code performance, premature optimization for infrequent code.
|
|
15
|
+
|
|
16
|
+
See `src/autonomous/review-lenses/lenses/performance.ts` for the full prompt.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security
|
|
3
|
+
version: v1
|
|
4
|
+
model: opus
|
|
5
|
+
type: core
|
|
6
|
+
maxSeverity: critical
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Security Lens
|
|
10
|
+
|
|
11
|
+
Thinks like an attacker -- traces data flow from untrusted input to sensitive operations. Checks: injection (SQL/NoSQL/XSS), CSRF, SSRF, mass assignment, prototype pollution, path traversal, JWT confusion, TOCTOU, hardcoded secrets, insecure deserialization, auth bypass, missing rate limiting, open redirects, prompt injection.
|
|
12
|
+
|
|
13
|
+
Uses Opus model for deeper reasoning on subtle auth bypass, TOCTOU, and logic-level vulnerabilities.
|
|
14
|
+
|
|
15
|
+
Requires inputSource/sink fields on every finding. Sets requiresMoreContext when data flow crosses file boundaries.
|
|
16
|
+
|
|
17
|
+
See `src/autonomous/review-lenses/lenses/security.ts` for the full prompt.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-quality
|
|
3
|
+
version: v1
|
|
4
|
+
model: sonnet
|
|
5
|
+
type: surface-activated
|
|
6
|
+
maxSeverity: major
|
|
7
|
+
activation: "test files changed, or source files changed without corresponding test changes"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Test Quality Lens
|
|
11
|
+
|
|
12
|
+
Finds patterns that reduce test reliability, coverage, and signal. Checks: missing assertions, testing implementation not behavior, flaky patterns, missing edge cases, over-mocking, no error path tests, missing integration tests, snapshot abuse, test data coupling, missing cleanup, missing test coverage for changed source files.
|
|
13
|
+
|
|
14
|
+
When activated by "source-changed-no-tests", primary focus shifts to identifying untested source files.
|
|
15
|
+
|
|
16
|
+
See `src/autonomous/review-lenses/lenses/test-quality.ts` for the full prompt.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: merger
|
|
3
|
+
version: v1
|
|
4
|
+
model: sonnet
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Merger
|
|
8
|
+
|
|
9
|
+
Synthesis step 1. Receives all validated findings from all lenses. Performs semantic deduplication (using issueKey for deterministic matches + description similarity for cross-lens matches) and conflict identification (preserving tensions without auto-resolving).
|
|
10
|
+
|
|
11
|
+
Output: deduplicated findings + tensions + merge log.
|
|
12
|
+
|
|
13
|
+
See `src/autonomous/review-lenses/merger.ts` for the full prompt.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: shared-preamble
|
|
3
|
+
version: v1
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Shared Preamble
|
|
7
|
+
|
|
8
|
+
Prepended to every lens prompt by the orchestrator. Contains safety rules, output format, identity, tools, context, and false positive suppression.
|
|
9
|
+
|
|
10
|
+
See the TypeScript implementation at `src/autonomous/review-lenses/shared-preamble.ts` for the canonical template with variable injection.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Multi-Lens Review
|
|
2
|
+
|
|
3
|
+
The multi-lens review orchestrator runs 8 specialized review agents in parallel, each analyzing the same diff or plan through a focused perspective. Findings are deduplicated semantically by a merger, then calibrated and judged for a final verdict.
|
|
4
|
+
|
|
5
|
+
## When This Runs
|
|
6
|
+
|
|
7
|
+
The autonomous guide invokes lenses automatically when `reviewBackends` includes `"lenses"` during CODE_REVIEW or PLAN_REVIEW stages. You don't need to invoke this manually.
|
|
8
|
+
|
|
9
|
+
## Manual Invocation
|
|
10
|
+
|
|
11
|
+
For debugging or standalone use:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
/story review-lenses
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This reads the current diff and runs the full lens pipeline outside the autonomous guide.
|
|
18
|
+
|
|
19
|
+
## The 8 Lenses
|
|
20
|
+
|
|
21
|
+
**Core (always run):**
|
|
22
|
+
1. Clean Code -- structural quality, SRP, naming, duplication
|
|
23
|
+
2. Security -- OWASP top 10, injection, auth, secrets (Opus model)
|
|
24
|
+
3. Error Handling -- failure modes, missing catches, null safety
|
|
25
|
+
|
|
26
|
+
**Surface-activated (based on changed files):**
|
|
27
|
+
4. Performance -- N+1 queries, memory leaks, algorithmic complexity
|
|
28
|
+
5. API Design -- backward compat, REST conventions, error responses
|
|
29
|
+
6. Concurrency -- race conditions, deadlocks, actor isolation (Opus model)
|
|
30
|
+
7. Test Quality -- coverage gaps, flaky patterns, missing assertions
|
|
31
|
+
8. Accessibility -- WCAG, keyboard nav, screen reader support
|
|
32
|
+
|
|
33
|
+
## Synthesis Pipeline
|
|
34
|
+
|
|
35
|
+
1. **Merger** -- semantic dedup + conflict identification
|
|
36
|
+
2. **Judge** -- severity calibration + stage-aware verdict
|
|
37
|
+
|
|
38
|
+
## Configuration
|
|
39
|
+
|
|
40
|
+
In `.story/config.json` under `recipeOverrides`:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"reviewBackends": ["lenses", "codex"],
|
|
45
|
+
"lensConfig": {
|
|
46
|
+
"lenses": "auto",
|
|
47
|
+
"maxLenses": 8,
|
|
48
|
+
"hotPaths": ["src/engine/**"],
|
|
49
|
+
"lensModels": {
|
|
50
|
+
"default": "sonnet",
|
|
51
|
+
"security": "opus"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Prompt Files
|
|
58
|
+
|
|
59
|
+
Individual lens prompts are in `references/` in this directory. Each has a version in its filename (e.g., `lens-security-v1.md`). The orchestrator reads these and injects context variables.
|