MCPInstall

rewriting-code-strictly

Rewrite existing Python, TypeScript/JavaScript, or Go code for strict static typing, boundary validation, and maintainable idioms while preserving behavior. Use when the user asks to harden code, remove unsafe escape hatches, add validation, or align with mypy, Pyright, tsc, go vet, or Staticcheck. Coordinates baseline mapping, strategy, approved implementation, and review through co-located subagents and just-in-time language references.

Installs
103
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/b-mendoza/agent-skills --skill rewriting-code-strictly
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads rewriting-code-strictly automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Rewriting Code Strictly

Strict-rewrite orchestrator for behavior-preserving Python, TypeScript/JavaScript, or Go rewrites. Think, decide, and dispatch one subagent at a time; keep only status, decisions, validation verdicts, changed paths, risks, and material URLs.

Inputs

InputRequiredExample
TARGET_CODEYessrc/api/users.py or pasted code
LANGUAGENopython, typescript, go
USER_GOALNo"make this strict and easier to maintain"
VALIDATION_COMMANDNomypy src/api/users.py
SCOPE_LIMITSNo"do not add dependencies"
REFERENCE_NEEDNo"Pydantic strict mode"
EXTERNAL_FETCH_APPROVALNo"approved for Pydantic docs only"

Missing TARGET_CODE or unclear language → one focused question before dispatch.

Output Contract

Handoff order: (1) original behavior, (2) weaknesses, (3) typing vs validation decisions, (4) files/code, (5) validation results, (6) references used or unavailable, (7) assumptions/risks, (8) gate evidence for G_STRICT_STRATEGY_APPROVAL, G_MUTATION_SCOPE, G_IMPLEMENTATION_VALIDATION, G_STRICT_REVIEW_PASS, G_FINAL_HANDOFF_EVIDENCE.

Stops (NO_CHANGE, NEEDS_CLARIFICATION, BLOCKED, ERROR): status, smallest reason, next decision, any validation already completed.

State Machine Overview

Mermaid: flow-diagram.md. Table: state-machine.md.

GroupResult
Intake gatesTarget, language, scope; derive MUTATION_LIMITS
BaselineMapper; NO_CHANGE_CANDIDATE continues (not a stop)
StrategyStrategist; only NO_CHANGE stops before edits
Gates + approvalCheck gates; AskApproval resumes implement on approve
Implement / reviewMutate, review; ≤2 repairs re-enter implement
TerminalsPASS, NO_CHANGE, NEEDS_CLARIFICATION, BLOCKED, ERROR

Pipeline Overview

PhaseStatesExecutionOutput
IntakeIntake…DeriveLimitsInline; personalityPacket + limits
BaselineDispatchBaseline/RouteBaselinestrict-baseline-mapperSTRICT_BASELINE
StrategyDispatchStrategy/RouteStrategyStrategist + one playbookSTRICT_STRATEGY
GatesCheckGates/GateExpansion/AskApprovalInlineProceed, block, or resume
ImplementDispatchImplement/RouteImplementstrict-rewrite-implementerSTRICT_IMPLEMENTATION
ReviewDispatchReview…GateFixCyclesReviewer; repair → implementSTRICT_REVIEW
HandoffHandoff→TerminalPassInlineFinal response

Subagent Registry

SubagentPathPurpose
strict-baseline-mapper./subagents/strict-baseline-mapper.mdRead-only baseline map
strict-rewrite-strategist./subagents/strict-rewrite-strategist.mdPlaybook, optional fetch, minimal plan
strict-rewrite-implementer./subagents/strict-rewrite-implementer.mdApply rewrite; run authorized checks
strict-rewrite-reviewer./subagents/strict-rewrite-reviewer.mdIndependent review verdict

Read a subagent only when dispatching it.

Progressive Loading Map

Load only what the current decision needs. Paths here are relative to this SKILL.md; later files use their own relative paths.

NeedLoad
Posture./references/personality.md
Python / TS/JS / Go defaultsmatching ./references/*-playbook.md
External URL map./references/external-sources.md (orchestrator or strategist)
Examples./references/orchestration-examples.md
State machine./flow-diagram.md, ./state-machine.md
Subagent contract./subagents/<name>.md at dispatch

One playbook after language is known. Playbooks do not chain-load external-sources.md; the map and strategist own that hop. Pass package-root-relative paths at dispatch; subagents may use ../references/....

Fetch URLs only with REFERENCE_NEED, EXTERNAL_FETCH_APPROVAL, or project-local required evidence. Unavailable URL → local evidence + risk, or NEEDS_CLARIFICATION. Network is optional for normal runs.

Default Mutation Limits

Derive in DeriveLimits. Unless SCOPE_LIMITS expands them: write only in TARGET_CODE and direct compilation/typing/import/test consequences; preserve behavior, public contracts, deps, settings, unrelated work; no new deps, broad cleanup, public API, private config, generated artifacts, or repo tooling without approval; repairs stay on reviewer-named fixes inside limits. Out-of-limits need → clarify or expand before editing. Reports include mutation-boundary evidence.

Critical Output Gates

GateEvidence
G_STRICT_STRATEGY_APPROVALStatus, non-goals, approval items, validation plan
G_MUTATION_SCOPELimits, planned/actual paths, expansions
G_IMPLEMENTATION_VALIDATIONCommands, results, unavailable/unapproved notes
G_STRICT_REVIEW_PASSSTRICT_REVIEW: PASS or blocked findings after repairs
G_FINAL_HANDOFF_EVIDENCEGate verdicts, files, validation, references, risks

Core Decision Rule

Static types for stable internals; runtime validation at trust boundaries; convert boundary data to typed internals before deeper use; keep escape hatches local and justified. Project settings outrank playbook defaults when stricter.

Execution Steps

Advance state-machine.md:

  1. Intake → DeriveLimits. Load personality; derive limits. Ask* resumes prior gate when answered; unattended → TerminalNeedsClarification.
  2. DispatchBaseline. Route PASS | NO_CHANGE_CANDIDATE | NEEDS_CLARIFICATION | ERROR. PASS and NO_CHANGE_CANDIDATE both continue to strategy.
  3. DispatchStrategy. Route PASS | NO_CHANGE | NEEDS_CLARIFICATION | ERROR. NO_CHANGE → TerminalNoChange without edits.
  4. CheckGates → GateExpansion → optional AskApproval. On expansion need, ask once. Approve → DispatchImplement. Decline → TerminalBlocked. No reply → TerminalNeedsClarification. Missing validation command → continue with implementer warning evidence.
  5. DispatchImplement. Route PASS | PASS_WITH_WARNINGS | BLOCKED | ERROR; check scope and validation gates; then review or terminal.
  6. DispatchReview. PASS → handoff. FAIL with fixes and repair_counter under 2 → re-enter DispatchImplement. Else TerminalBlocked.
  7. Handoff → TerminalPass with Output Contract and final gate evidence.

Validation Loop Summary

map → plan → gate/approve → change/check → review → targeted fix → re-check. Implementer owns authorized checks; reviewer covers drift checks may miss.

Example

TARGET_CODE=src/payments/webhook.ts, remove unsafe any, validate webhook, REFERENCE_NEED for Zod. Mapper finds TS + untrusted body. Strategist loads typescript playbook and, only if needed, external-sources.md + approved Zod URL. No expansion → implement → review → handoff. See ./references/orchestration-examples.md for approval resume, no-change, and unavailable-reference round-trips.

FAQ

What does the rewriting-code-strictly skill do?

Rewrite existing Python, TypeScript/JavaScript, or Go code for strict static typing, boundary validation, and maintainable idioms while preserving behavior. Use when the user asks to harden code, remove unsafe escape hatches, add validation, or align with mypy, Pyright, tsc, go vet, or Staticcheck. Coordinates baseline mapping, strategy, approved implementation, and review through co-located subagents and just-in-time language references.

How do I install rewriting-code-strictly?

Run npx skills add https://github.com/b-mendoza/agent-skills --skill rewriting-code-strictly in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/rewriting-code-strictly/ (personal) or .claude/skills/rewriting-code-strictly/ (project).

Which AI agents can use rewriting-code-strictly?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is rewriting-code-strictly safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains rewriting-code-strictly?

It is published by b-mendoza in b-mendoza/agent-skills. It has 103 recorded installs.

More from b-mendoza/agent-skills

View all →

validate-implementation-plan

b-mendoza/agent-skills

Audits an implementation plan for requirements traceability, avoidable complexity, risky assumptions, and evidence gaps. Use when reviewing an AI-generated or human-authored plan, design proposal, implementation outline, task breakdown, or architecture plan and the user wants a standalone audit report without overwriting the source plan.

recency-guard

b-mendoza/agent-skills

Open the skill to read its SKILL.md instructions.

AI & Agents184 installs

pr-creator

b-mendoza/agent-skills

Open the skill to read its SKILL.md instructions.

review-pull-request

b-mendoza/agent-skills

Open the skill to read its SKILL.md instructions.

committing-scoped-changes

b-mendoza/agent-skills

Open the skill to read its SKILL.md instructions.

AI & Agents134 installs

responding-to-pr-review-comments

b-mendoza/agent-skills

Open the skill to read its SKILL.md instructions.

Popular ai & agents skills

View category →

google-agents-cli-publish

google/agents-cli

This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).

AI & Agents513.9K installs

google-agents-cli-eval

google/agents-cli

This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).

AI & Agents513.5K installs

skill-creator

anthropics/skills

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

OfficialAI & Agents416.4K installs

codex-pet

prime-skills/runcomfy-agent-skills

Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.

AI & Agents402.1K installs

full-output-enforcement

leonxlnx/taste-skill

Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.

AI & Agents401K installs

executing-plans

obra/superpowers

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

AI & Agents245.7K installs