# Iterative File Refinement

> iterative-file-refinement

- Skill: `claudiawong522/iterative-file-refinement` (Agent Skill)
- Install (CLI): `npx skillmds@latest add claudiawong522/iterative-file-refinement`
- Raw SKILL.md: https://api.skillmd.com/api/skills/claudiawong522/iterative-file-refinement/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: claudiawong522 (https://skillmd.com/u/claudiawong522)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/claudiawong522/iterative-file-refinement

---

# iterative-file-refinement

Read a file once, then make multiple sequential edits to refine its contents.

# Iterative File Refinement

This skill describes a common pattern for refining file contents through multiple focused edits.

## When to Use
- You need to make several related changes to a single file
- Each edit builds on the previous one or addresses different aspects
- You want to review the full file context before making changes

## Steps

1. **Read the target file** - Start by reading the complete file to understand its current state and structure
2. **First edit** - Make your first set of changes based on the initial context
3. **Second edit** - Apply additional refinements, which may depend on or complement the first edit
4. **Third edit** - Continue with further improvements or corrections

## Tips

- Read the entire file once at the start to establish full context
- Keep each edit focused on a specific change or improvement
- Let the file content from the Read guide your understanding of what needs to be edited
- Each Edit can reference different sections; you've already seen the whole file
- This pattern is efficient because it reads the file once and makes all necessary changes through sequential edits
- If you need to make many more edits, consider whether you should read again to verify current state

## Example Use Cases

- Refactoring code: Read → extract function → update imports → fix references → optimize
- Writing content: Read → fix grammar → improve clarity → enhance structure
- Configuration: Read → update values → fix formatting → add comments

