optimization-phase

optimization-phase is a skill for Claude Code from marcusgoll/Spec-Flow. It costs 42 tokens per session (4,247 once invoked), scanned A, original, MIT.

A pre-deployment quality phase that checks performance, accessibility, security, and code quality, then writes review reports.

In plain words
What is it for?
It helps benchmark APIs and pages, audit accessibility, scan dependencies and security risks, review code quality, and produce reports.
Why use it?
It finds issues that could block a release before the feature is deployed.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit It helps benchmark APIs and pages, audit accessibility, scan dependencies and security risks, review code quality, and produce reports.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/marcusgoll/spec-flow/optimization-phase
Install

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.

Any agent
npx skills add marcusgoll/Spec-Flow --skill optimization-phase
Clone the repo
git clone --depth 1 https://github.com/marcusgoll/Spec-Flow

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for optimization-phase

README.md
[![agentmods](https://agentmods.dev/badge/skills/marcusgoll/spec-flow/optimization-phase/github.svg)](https://agentmods.dev/skills/marcusgoll/spec-flow/optimization-phase)
Your own site
<a href="https://agentmods.dev/skills/marcusgoll/spec-flow/optimization-phase"><img src="https://agentmods.dev/badge/skills/marcusgoll/spec-flow/optimization-phase/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for optimization-phase

Your own site · 80×15
<a href="https://agentmods.dev/skills/marcusgoll/spec-flow/optimization-phase"><img src="https://agentmods.dev/badge/skills/marcusgoll/spec-flow/optimization-phase.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,247 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.04247
Opus 5.5 $0.00017 $0.01699
Sonnet 5.5 $0.00008 $0.00849
Haiku 4.5 $0.00004 $0.00425

Measured 1mo ago against content hash c07d926f1b15, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

optimization-phase scanned grade A with 1 finding 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 1mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -w "%{time_total}\n" -o /dev/null -s "http://localhost:3000/api/endpoint"
.claude/skills/optimization-phase/SKILL.md · 642 lines

How it starts

The opening of the file, as written. The whole thing — 642 lines — stays where its author put it; the contents beside it link to each section on GitHub.

This skill orchestrates the /optimize phase, which runs after /implement and before /preview in the deployment workflow.

Inputs: Implemented code (from /implement), spec.md (success criteria) Outputs: optimization-report.md, code-review-report.md Expected duration: 1-2 hours

<quick_start> Execute optimization quality gates systematically:

  1. Performance Benchmarking - API p50 <200ms, p95 <500ms, page load <2s
  2. Accessibility Audit - WCAG 2.1 AA compliance (if UI feature)
  3. Security Review - npm audit, dependency scanning, OWASP top 10
  4. Code Quality Review - DRY violations <3, test coverage ≥80%
  5. Generate Reports - optimization-report.md + code-review-report.md

Key principle: All blocking quality gates must pass before deployment. </quick_start>

If prerequisites not met, return to /implement phase.

Validate API response times and page load performance against spec.md targets.

API Performance Testing:

# Measure API endpoint response times (10 requests)
for i in {1..10}; do
  curl -w "%{time_total}\n" -o /dev/null -s "http://localhost:3000/api/endpoint"
done | sort -n

# Calculate p50 (median): 5th value
# Calculate p95 (95th percentile): 10th value

Page Load Testing:

# Run Lighthouse CI for page load metrics
npm install -g @lhci/cli
lhci autorun --url=http://localhost:3000

# Check metrics:
# - First Contentful Paint (FCP): <1.8s
# - Largest Contentful Paint (LCP): <2.5s
# - Time to Interactive (TTI): <3.8s

Targets from spec.md:

  • API p50 (median): <200ms
  • API p95 (95th percentile): <500ms
  • Page load (initial): <2 seconds
  • Time to Interactive (TTI): <3 seconds

Blocking: If performance targets not met, optimization required before deployment.

See resources/performance-benchmarking.md for detailed testing procedures.

Validate WCAG 2.1 AA compliance for all UI changes.

Lighthouse CI Audit:

# Run Lighthouse accessibility audit
lhci autorun --collect.settings.onlyCategories=accessibility

# Target score: ≥95/100

axe-core Validation:

# Install axe-core DevTools extension
# Or use axe CLI:
npm install -g @axe-core/cli
axe http://localhost:3000 --tags wcag2aa

WCAG 2.1 AA Requirements:

  • Color contrast ≥4.5:1 (text), ≥3:1 (UI components)
  • Keyboard navigation (all interactive elements accessible)
  • Screen reader compatibility (ARIA labels, semantic HTML)
  • Focus indicators visible (outline, border, background change)

Blocking (if UI feature): All WCAG 2.1 AA violations must be fixed.

Skip if: No UI changes in this feature (backend/API only).

See resources/accessibility-audit.md for comprehensive checklist.

Scan for vulnerabilities in dependencies and code.

Dependency Vulnerability Scan:

# npm audit for Node.js projects
npm audit --audit-level=moderate

# Check for critical and high severity vulnerabilities
# Fix: npm audit fix (or manual upgrade)

OWASP Top 10 Checks:

  • SQL Injection: Parameterized queries, no string concatenation
  • XSS: Input sanitization, output encoding
  • CSRF: CSRF tokens on state-changing endpoints
  • Authentication: Secure password hashing (bcrypt), JWT validation
  • Sensitive Data Exposure: No secrets in code/logs, HTTPS enforced

Secret Scanning:

# Check for accidentally committed secrets
git secrets --scan

# Or use gitleaks:
gitleaks detect --source . --verbose

Read the full file on GitHub · 642 lines

Files

What ships with it

9 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.

Changes

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.

  1. 1mo ago First seen · 642 lines · 42 tokens per session scan A c07d926f1b15

Subscribe to this mod's changes

optimization-phase is a skill published in the GitHub repository marcusgoll/Spec-Flow (96 stars, last pushed 23d ago), licensed MIT. It adds 42 tokens to every session and 4,247 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.