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;…
Detects time and space complexity hotspots via AST scan. Use when code feels slow, before performance-sensitive merges, or to find O(n²) regressions.
Claude Code
$ npx -y skills add athola/claude-night-market --skill performance-review --agent claude-code
Codex
$ npx skills add athola/claude-night-market --skill performance-review -a codex -y
Cursor
$ npx skills add athola/claude-night-market --skill performance-review -a cursor -y
Gemini CLI
$ npx skills add athola/claude-night-market --skill performance-review -a gemini-cli -y
GitHub Copilot
$ npx skills add athola/claude-night-market --skill performance-review -a github-copilot -y
OpenCode
$ npx skills add athola/claude-night-market --skill performance-review -a opencode -y
Windsurf
$ npx skills add athola/claude-night-market --skill performance-review -a windsurf -y
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 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 tree-sitter to extend detection to JS/TS, Go, Rust, Java, and C/C++ when the `tiers` extra is installed. Tier 3 walks the gauntlet call graph forward from each finding and raises its severity one step when a callee holds a hotspot, and runs when the gauntlet plugin is importable and a `.gauntlet/graph.db` exists. Without them, Tiers 2 and 3 no-op and Tier 1 still produces 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 the `tiers` extra 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 `tree_sitter_language_pack` is importable, run Tier 2 on non-Python files that were skipped at Step 2. If gauntlet is importable and a `.gauntlet/graph.db` exists in the scanned file's directory or any parent, run Tier 3 to upgrade severities based on hotspots in transitive callees.
Without the extra, this step is a no-op and the report notes "Tier 2/3 not available: install pensive with the `tiers` extra for multi-language and call-chain coverage." A file that tree-sitter cannot parse adds a warning and yields no Tier 2 findings.
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 | stdlib `ast` | Always (Python source only) | T1-T6, S1-S3 | | 2 | `tree_sitter_language_pack` | When importable,
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;…
States load-bearing decisions, invariants, and weak points. Use when judging a design change. Do not use for gating; use…
Rebuild the dev environment: uv, Python tiers, pins, traps. Use when onboarding or toolchain breaks. Do not use for daily…
Classify, gate, and review changes. Use when landing a PR, releasing, or amending rules. Do not use for failure triage; use…
Search and record project memory (Discussions, journal, ADRs). Use before re-investigating anything. Do not use for settled…
Bind loop 'done' to unfakeable gates. Use to harden egregore/herald loops or promote completion_integrity. Not for QA gates; use…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.