claude-code-plugin-ref…
Explain plugin, skill, command, agent, and hook mechanics used here. Use when authoring or debugging plugins. Do not use for ops; use night-market-operations.
Detects time and space complexity hotspots via AST scan. Use when code feels slow, before performance-sensitive merges, or to find O(n²) regressions.
$ npx -y skills add athola/claude-night-market --skill performance-review --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/performance-reviewContext preview
The summary Claude sees to decide when to auto-load this skill.
Detects time and space complexity hotspots via AST scan. Use when code feels slow, before performance-sensitive merges, or to find O(n²) regressions.
name: performance-review description: Detects time and space complexity hotspots via AST scan. Use when code feels slow, before performance-sensitive merges, or to find O(n²) regressions. alwaysApply: false category: code-quality tags: - performance - complexity - algorithms - ast - static-analysis tools: [] usage_patterns: - hotspot-detection - complexity-review - pre-merge-performance-check complexity: advanced model_hint: deep estimated_tokens: 280 progressive_loading: true dependencies: - imbue:proof-of-work - imbue:review-core - imbue:structured-output modules: - modules/time-complexity.md - modules/space-complexity.md - modules/gauntlet-integration.md - modules/kuva-visualization.md - modules/memory-allocation-lenses.md
Static-analysis review of time and space complexity hotspots.
The skill runs in three escalating tiers. Tier 1 uses Python's stdlib `ast` and always runs. Tier 2 uses gauntlet's tree-sitter parser to extend detection across languages when gauntlet is installed. Tier 3 uses the gauntlet code graph to upgrade severity when hotspots reach other hotspots transitively. If gauntlet is missing, Tiers 2 and 3 no-op and Tier 1 still produces useful findings on Python source.
/performance-review # scan changed files /performance-review path/to/file.py # scan one file /performance-review --tier 1 # force Tier 1 only
Programmatic use:
from pensive.skills.performance_review import PerformanceReviewSkill
skill = PerformanceReviewSkill()
result = skill.analyze(context, "src/module.py")
for f in result.issues:
print(f"[{f.severity}] {f.file}:{f.line} {f.message}")profiler.
are common.
time on real data). Use `Skill(parseltongue:python-performance)` instead: that skill drives `cProfile`, `py-spy`, and benchmarks.
`Skill(pensive:code-refinement)` whose `algorithm-efficiency` module covers broader optimization patterns. This skill detects; that skill teaches.
SIMD, strength reduction) is worth keeping: use `Skill(leyline:loop-optimization)` for the hand-vs-compiler rule. This skill flags hotspot shapes, not transformation choices.
queue placement): use `Skill(pensive:architecture-review)`.
1. `perf-review:context-established` 2. `perf-review:scan-complete` 3. `perf-review:findings-categorized` 4. `perf-review:integration-checked` 5. `perf-review:report-generated` 6. `perf-review:findings-verified`
`git diff --name-only`. If invoked with a path, scope to that.
files need gauntlet for Tier 2 coverage.
Load `modules/time-complexity.md` for the time-side patterns and `modules/space-complexity.md` for space-side. Each module documents the AST shape of every detector.
Alongside the automated scan, load `modules/memory-allocation-lenses.md` and apply its three manual lenses (unbounded external-source collections, hot-path recompute, serial blocking I/O) by reading the target files.
For each Python target file, call:
from pensive.skills.performance_review import PerformanceReviewSkill result = PerformanceReviewSkill().analyze(context, path)
The visitor walks the AST once and emits `ReviewFinding` records.
Group findings by severity:
(T3, T4, S1, S3).
Within a severity, sort by file then line. Suppress findings the user has explicitly marked acceptable (TODO/comment markers) at module-load time of the target.
Load `modules/gauntlet-integration.md` for the contract.
If gauntlet is installed, run Tier 2 on non-Python files that were skipped at Step 2. If a `.gauntlet/graph.db` exists in the working tree, run Tier 3 to upgrade severities based on transitive hotspot reachability.
If gauntlet is missing, this step is a no-op and the report notes "Tier 2/3 not available: install gauntlet for multi-language and call-chain coverage."
Emit a markdown report:
## Performance Review: <target> ### HIGH (<count>) - src/foo.py:42: Nested loop over the same iterable 'items'. Suggestion: sort + two pointers, or hash-set membership. ### MEDIUM (<count>) - ... ### LOW (<count>) - ... Tier coverage: 1 (always) | 2 (gauntlet ✓/✗) | 3 (graph ✓/✗)
The report is informational. Apply fixes via `Skill(pensive:code-refinement)` or hand-merge.
| Tier | Source | When it runs | What it covers | |------|--------|--------------|----------------| | 1
A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.
Explain plugin, skill, command, agent, and hook mechanics used here. Use when authoring or debugging plugins. Do not use for ops; use night-market-operations.
States load-bearing decisions, invariants, and weak points. Use when judging a design change. Do not use for gating; use night-market-change-control.
Rebuild the dev environment: uv, Python tiers, pins, traps. Use when onboarding or toolchain breaks. Do not use for daily commands; use night-market-operations.
Classify, gate, and review changes. Use when landing a PR, releasing, or amending rules. Do not use for failure triage; use night-market-debugging-playbook.
Search and record project memory (Discussions, journal, ADRs). Use before re-investigating anything. Do not use for settled battles; see failure-archaeology.
Bind loop 'done' to unfakeable gates. Use to harden egregore/herald loops or promote completion_integrity. Not for QA gates; use night-market-validation-and-qa.