Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/open-gsd/gsd-pi/code-optimizernpx skills add open-gsd/gsd-pi --skill code-optimizergit clone --depth 1 https://github.com/open-gsd/gsd-piWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00094 | $0.01734 |
| Opus 5 | $0.00047 | $0.00867 |
| Sonnet 5 | $0.00019 | $0.00347 |
| Haiku 4.5 | $0.00009 | $0.00173 |
Grade A, and why
code-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 156 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code Optimizer
Parallel multi-agent code optimization audit. Spawn 13 specialist agents simultaneously, each hunting for a different class of performance problem using pattern-based detection.
Critical Principle: No Code Reading Before Analysis
Agents MUST NOT read source files before searching for patterns. Reading the code first causes anchoring bias — the agent accepts the existing implementation as "reasonable" and misses better alternatives. Instead, each agent:
- Read its assigned reference file from
references/to load detection patterns - Use Grep/Glob to scan the codebase for anti-patterns
- For each finding, ONLY THEN read the surrounding context (5-10 lines) to confirm the issue
- Propose the optimal solution based on best practices, NOT based on the existing code
Workflow
Step 1: Detect Stack
Use Glob to identify the project's tech stack:
**/package.json→ Node.js/JS/TS (check for React, Next.js, Express, etc.)**/requirements.txt,**/pyproject.toml,**/setup.py→ Python**/go.mod→ Go**/Cargo.toml→ Rust**/pom.xml,**/build.gradle→ Java**/Gemfile→ Ruby**/Dockerfile→ Docker**/*.sql→ SQL**/webpack.config.*,**/vite.config.*,**/tsconfig.json→ Build tools
Step 2: Spawn 13 Parallel Agents
Launch ALL agents simultaneously using the Agent tool. Each agent receives:
- Its domain name and reference file path
- The detected tech stack (so it can focus on relevant patterns)
- The project root path
- Instructions to NOT read code files, only Grep/Glob for patterns
Agent definitions (spawn all 13 in a single message):
| # | Agent Name | Reference File | Focus |
|---|---|---|---|
| 1 | Database & Queries | references/database-queries.md |
N+1 queries, SELECT *, missing indexes, ORM misuse, connection pooling |
| 2 | Memory & Resources | references/memory-resources.md |
Memory leaks, unclosed resources, large allocations, string concat in loops |
| 3 | Algorithmic Complexity | references/algorithmic-complexity.md |
O(n^2) patterns, unnecessary iterations, wrong data structures for lookups |
| 4 | Concurrency & Async | references/concurrency-async.md |
Sequential awaits, blocking in async, race conditions, unbounded concurrency |
| 5 | Bundle & Dependencies | references/bundle-dependencies.md |
Heavy imports, unused deps, duplicate libs, missing lazy loading |
| 6 | Dead Code & Redundancy | references/dead-code-redundancy.md |
Unused exports, commented code, dead branches, duplicate logic |
| 7 | I/O & Network | references/io-network.md |
Sequential requests, missing batching, no dedup, missing compression |
| 8 | Rendering & UI | references/rendering-ui.md |
Re-renders, missing virtualization, layout thrashing, animation perf |
| 9 | Data Structures | references/data-structures.md |
Wrong structures, unnecessary copies, inefficient serialization |
| 10 | Error & Resilience | references/error-resilience.md |
Missing timeouts, swallowed errors, no retries, no circuit breakers |
| 11 | Caching & Memoization | references/caching-memoization.md |
Missing memoization, cache without invalidation, redundant API calls |
| 12 | Build & Compilation | references/build-compilation.md |
Dev code in prod, missing optimization flags, slow tests, Docker issues |
| 13 | Security-Performance | references/security-performance.md |
Crypto misuse, missing rate limiting, ReDoS, SQL injection vectors |
What ships with it
15 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/algorithmic-complexity.md 2.8 KB
- references/build-compilation.md 3.6 KB
- references/bundle-dependencies.md 2.9 KB
- references/caching-memoization.md 3.2 KB
- references/concurrency-async.md 3.0 KB
- references/config-infra.md 2.8 KB
- references/data-structures.md 3.3 KB
- references/database-queries.md 2.3 KB
- references/dead-code-redundancy.md 2.7 KB
- references/error-resilience.md 3.2 KB
- references/io-network.md 3.3 KB
- references/logging-observability.md 2.6 KB
- references/memory-resources.md 2.2 KB
- references/rendering-ui.md 3.9 KB
- references/security-performance.md 2.8 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 156 lines · 94 tokens per session scan A 32c7ad9351d0
code-optimizer is a skill published in the GitHub repository open-gsd/gsd-pi (1,179 stars, last pushed 2d ago), licensed MIT. It adds 94 tokens to every session and 1,734 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
gsd-complete-milestone
Archive completed milestone and prepare for next version.
gsd-discuss-phase
Gather phase context through adaptive questioning before planning.
gsd-debug
Systematic debugging with persistent state across context resets.
gsd-execute-phase
Execute all plans in a phase with wave-based parallelization.
gsd-autonomous
Run all remaining phases autonomously — discuss→plan→execute per phase.
gsd-capture
Capture ideas, tasks, notes, and seeds to their destination.