@anthropologies/claudestory 0.1.57 → 0.1.59
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 +346 -133
- package/dist/mcp.js +286 -84
- 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anthropologies/claudestory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.59",
|
|
4
4
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
5
5
|
"description": "An agentic development framework. Track tickets, issues, and progress for your project so every session builds on the last.",
|
|
6
6
|
"homepage": "https://claudestory.com",
|
package/src/skill/SKILL.md
CHANGED
|
@@ -23,6 +23,7 @@ claudestory tracks tickets, issues, roadmap, and handovers in a `.story/` direct
|
|
|
23
23
|
- `/story settings` -> manage project settings (see Settings section below)
|
|
24
24
|
- `/story design` -> evaluate frontend design (read `design/design.md` in the same directory as this skill file; if not found, tell user to run `claudestory setup-skill`)
|
|
25
25
|
- `/story design <platform>` -> evaluate for specific platform: web, ios, macos, android (read `design/design.md` in the same directory as this skill file)
|
|
26
|
+
- `/story review-lenses` -> run multi-lens review on current diff (read `review-lenses/review-lenses.md` in the same directory as this skill file; if not found, tell user to run `claudestory setup-skill`). Note: the autonomous guide invokes lenses automatically when `reviewBackends` includes `"lenses"` -- this command is for manual/debug use.
|
|
26
27
|
- `/story help` -> show all capabilities (read `reference.md` in the same directory as this skill file; if not found, tell user to run `claudestory setup-skill`)
|
|
27
28
|
|
|
28
29
|
If the user's intent doesn't match any of these, use the full context load.
|
|
@@ -354,7 +355,24 @@ Do NOT search source code for this. The full config.json schema is shown below.
|
|
|
354
355
|
},
|
|
355
356
|
"LESSON_CAPTURE": { "enabled": "boolean" },
|
|
356
357
|
"ISSUE_SWEEP": { "enabled": "boolean" }
|
|
357
|
-
}
|
|
358
|
+
},
|
|
359
|
+
"lensConfig": {
|
|
360
|
+
"lenses": "\"auto\" | string[] (default: \"auto\")",
|
|
361
|
+
"maxLenses": "number (1-8, default: 8)",
|
|
362
|
+
"lensTimeout": "number | { default: number, opus: number } (default: { default: 60, opus: 120 })",
|
|
363
|
+
"findingBudget": "number (default: 10)",
|
|
364
|
+
"confidenceFloor": "number 0-1 (default: 0.6)",
|
|
365
|
+
"tokenBudgetPerLens": "number (default: 32000)",
|
|
366
|
+
"hotPaths": "string[] (glob patterns for Performance lens, default: [])",
|
|
367
|
+
"lensModels": "Record<string, string> (default: { default: sonnet, security: opus, concurrency: opus })"
|
|
368
|
+
},
|
|
369
|
+
"blockingPolicy": {
|
|
370
|
+
"neverBlock": "string[] (lens names that never produce blocking findings, default: [])",
|
|
371
|
+
"alwaysBlock": "string[] (categories that always block, default: [injection, auth-bypass, hardcoded-secrets])",
|
|
372
|
+
"planReviewBlockingLenses": "string[] (default: [security, error-handling])"
|
|
373
|
+
},
|
|
374
|
+
"requireSecretsGate": "boolean (default: false, require detect-secrets for lens reviews)",
|
|
375
|
+
"requireAccessibility": "boolean (default: false, make accessibility findings blocking)"
|
|
358
376
|
}
|
|
359
377
|
}
|
|
360
378
|
```
|
|
@@ -367,3 +385,4 @@ Additional skill documentation, loaded on demand:
|
|
|
367
385
|
- **`autonomous-mode.md`** -- Autonomous mode, review, plan, and guided execution tiers
|
|
368
386
|
- **`reference.md`** -- Full CLI command and MCP tool reference
|
|
369
387
|
- **`design/design.md`** -- Frontend design evaluation and implementation guidance, with platform references in `design/references/`
|
|
388
|
+
- **`review-lenses/review-lenses.md`** -- Multi-lens review orchestrator (8 specialized parallel reviewers), with lens prompts in `review-lenses/references/`
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: judge
|
|
3
|
+
version: v1
|
|
4
|
+
model: sonnet
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Judge
|
|
8
|
+
|
|
9
|
+
Synthesis step 2. Receives deduplicated findings and tensions from the Merger. Performs severity calibration, stage-aware verdict generation, and completeness assessment.
|
|
10
|
+
|
|
11
|
+
Verdict rules:
|
|
12
|
+
- reject: critical + confidence >= 0.8 + blocking (plan review: only security/integrity)
|
|
13
|
+
- revise: major + blocking, or any blocking tension
|
|
14
|
+
- approve: only minor/suggestion/non-blocking remain
|
|
15
|
+
|
|
16
|
+
Partial review (required lens failed): never approves, maximum is revise.
|
|
17
|
+
|
|
18
|
+
See `src/autonomous/review-lenses/judge.ts` for the full prompt.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: accessibility
|
|
3
|
+
version: v1
|
|
4
|
+
model: sonnet
|
|
5
|
+
type: surface-activated
|
|
6
|
+
maxSeverity: major
|
|
7
|
+
scope: web-first
|
|
8
|
+
activation: ".tsx, .jsx, .html, .vue, .svelte, .css, .scss"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Accessibility Lens
|
|
12
|
+
|
|
13
|
+
Finds WCAG compliance issues preventing users with disabilities from using the application. Web-first scope. Checks: missing alt text, non-semantic HTML, missing ARIA labels, no keyboard navigation, color contrast, missing focus management, skip-to-content, form labels, ARIA landmarks, auto-playing media, missing live regions, CSS focus removal, hidden-but-focusable elements.
|
|
14
|
+
|
|
15
|
+
Native mobile/desktop accessibility is out of scope for v1.
|
|
16
|
+
|
|
17
|
+
See `src/autonomous/review-lenses/lenses/accessibility.ts` for the full prompt.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-design
|
|
3
|
+
version: v1
|
|
4
|
+
model: sonnet
|
|
5
|
+
type: surface-activated
|
|
6
|
+
maxSeverity: critical
|
|
7
|
+
activation: "**/api/**", route handlers, controllers, GraphQL resolvers
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# API Design Lens
|
|
11
|
+
|
|
12
|
+
Focuses on REST/GraphQL API quality -- consistency, correctness, backward compatibility, consumer experience. Checks: breaking changes, inconsistent error format, wrong HTTP status codes, non-RESTful patterns, missing pagination, naming inconsistency, missing Content-Type, overfetching/underfetching, missing idempotency, auth inconsistency.
|
|
13
|
+
|
|
14
|
+
See `src/autonomous/review-lenses/lenses/api-design.ts` for the full prompt.
|
|
@@ -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.
|