# rewriting-code-strictly

rewriting-code-strictly is a Claude Code skill that rewrites Python, TypeScript/JavaScript, or Go with stricter typing and boundary checks. It runs on requests to harden code or align it with static analysis tools.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 122 installs · ★ 3 repo stars
- Author: b-mendoza
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/b-mendoza/agent-skills/tree/HEAD/skills/rewriting-code-strictly/SKILL.md
- Updated: 2026-10-25
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/rewriting-code-strictly

## What it does

The skill coordinates a staged rewrite while preserving the program’s behavior. It maps the existing code, develops a plan, waits for approval before edits, then sends the result for a separate review. Subagents handle the stages, and the matching language guide loads once the language is known.

A target file or pasted code is required. If the language is unclear, the skill asks one focused question before dispatching subagents. By default, changes stay within the target and direct compilation, typing, import, or test consequences. Work beyond that scope requires clarification or expanded approval.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add b-mendoza/agent-skills --skill rewriting-code-strictly -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/rewriting-code-strictly/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/rewriting-code-strictly/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add b-mendoza/agent-skills --skill rewriting-code-strictly -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/rewriting-code-strictly/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add b-mendoza/agent-skills --skill rewriting-code-strictly -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/rewriting-code-strictly/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install b-mendoza/agent-skills skills/rewriting-code-strictly
```

2. **Manually: put the files in place**
- File: `.github/skills/rewriting-code-strictly/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add b-mendoza/agent-skills --skill rewriting-code-strictly -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/b-mendoza/agent-skills --path skills/rewriting-code-strictly
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/rewriting-code-strictly/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add b-mendoza/agent-skills --skill rewriting-code-strictly -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/b-mendoza/agent-skills/tree/HEAD/skills/rewriting-code-strictly/SKILL.md

## When to use it
- Add strict typing to existing code
- Validate data at program boundaries
- Align code with mypy, Pyright, tsc, go vet, or Staticcheck
- Remove unsafe escapes from the type system

## Example prompts
- Rewrite `src/api/users.py` with strict typing while preserving its behavior.
- Add input validation to this TypeScript code and align it with `tsc`.
- Harden this Go code and check it with `go vet`.

## Similar
- [no-debug-statements](https://affpapa.org/en/nevibecode/rules/no-debug-statements.md) — rule · ★ 2966 repo stars
- [principle-type-system-discipline](https://affpapa.org/en/nevibecode/skills/principle-type-system-discipline.md) — skill · 10300 installs
- [openai-security-best-practices](https://affpapa.org/en/nevibecode/plugins/openai-security-best-practices.md) — plugin · ★ 540 repo stars
- [error-handling](https://affpapa.org/en/nevibecode/skills/error-handling.md) — skill · 6600 installs
- [code-craft](https://affpapa.org/en/nevibecode/skills/code-craft.md) — skill · 1700 installs
- [best-practices](https://affpapa.org/en/nevibecode/skills/fradser-best-practices.md) — skill · 115 installs

From the same set: [b-mendoza/agent-skills](https://affpapa.org/en/nevibecode/by/b-mendoza/agent-skills.md) — 12 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
