Micro-Edit Orchestration Skill
Concept
Break large coding tasks into small, reviewable micro-edits that can be executed independently, preferably in parallel by subagents. The main agent should be the highest-capability planner but should stay token-efficient: inspect just enough code to identify boundaries, package narrow context for workers, validate results, and only implement directly when needed. This lets smaller or less capable models succeed because each task includes the exact files, examples, constraints, and validation needed.
When to Use
- User wants to split a large change into smaller pieces
- Multiple independent files need similar changes
- Code review would be more manageable with smaller diffs
- User says: "break it into tasks", "micro-edit", "parallel workers"
- Initial analysis reveals many independent opportunities
Non-Negotiable Rules
- Micro-tasks must be independently verifiable - each subagent's work can be validated separately
- Changes must be behavior-preserving - unless explicitly requested
- Validation happens BEFORE aggregation - don't aggregate untested changes
- Fail fast on validation errors - stop and fix before continuing
- Report clearly - user sees progress, not hidden work
- Degrade gracefully - if subagents are unavailable, run the same micro-tasks sequentially
- Package context, not ambiguity - each worker task must include the exact files to read, files to modify, examples to imitate, constraints, and validation command
Model Strategy
- Main agent: use the strongest available model as a token-efficient planner, context packer, validator, and aggregator. It should avoid reading the entire codebase or doing all edits unless fallback mode is required.
- Worker agents: may use smaller, cheaper, or less capable models because every task packet is narrow and self-contained.
- Token discipline: prefer targeted searches and 1-3 representative examples over broad codebase dumps. Give workers only the context needed to complete their micro-edit.
Workflow
Phase 1: Plan and Enqueue
Analyze the request with minimal context
- What is the end goal?
- What files/modules are affected?
- What are the dependencies between changes?
- What small set of examples will let a weaker worker imitate the existing pattern?
Break into micro-tasks
- Each task: one file, one feature, or one refactoring pattern
- Tasks should be understandable by a smaller model and completable in <5 minutes
- Prefer "read these examples, edit this file" over broad search/refactor instructions
- Label tasks with priority (H/M/L) and area (e.g., "rust-oauth", "ts-ui")
Discover verification commands
- Inspect project docs and configuration before delegating work
- Prefer repository-specific commands from
README, AGENTS.md, package.json, Cargo.toml, pyproject.toml, Package.swift, etc.
- Examples:
npm test, npm run build, npm run lint, cargo check, cargo test, swift test, xcodebuild test
Create context packets
- For each micro-task, include: task objective, files to read first, files to modify, pattern/example to follow, explicit non-goals, validation command, and report format
- Keep packets small; do not ask workers to rediscover architecture unless that is the task
Create task tracking
- [ ] Task 1: [description]
- [ ] Task 2: [description]
- [ ] ...
Launch parallel subagents when available
- Max 4-6 concurrent agents (avoid rate limits and merge conflicts)
- Each agent gets: task description, files to modify, verification command
- Use an available implementation/coding subagent. If no generic worker exists, use the closest available coder/developer subagent or run sequentially in the main agent
Phase 2: Execute Independently
Each subagent, or the main agent in fallback mode:
- Reads the target files
- Makes only the assigned micro-change
- Runs the agreed verification command when practical
- Reports: PASS/FAIL, files changed, lines affected, and any skipped verification
Phase 3: Validate
After execution completes:
- Check each result - confirm every micro-task reports PASS or a clear skipped-verification reason
- Validate the combined workspace - run the strongest practical project-level verification
- Fix failures - if validation fails, stop aggregation and fix immediately
- Aggregate only validated results - compile findings from agents or sequential steps
- Report status - clear summary for user
Fallback Mode
If parallel subagents are unavailable or unsafe for the repository state, execute the same plan sequentially in the main agent:
- Complete one micro-task
- Validate it
- Record the result
- Move to the next micro-task only after the current one passes
- Stop on the first unresolved failure
Phase 4: Present
Summary table
| Task | Status | Files | Lines |
|------|--------|-------|-------|
| OAuth dedup | ✅ PASS | 5 | -200 |
| Type unification | ✅ PASS | 3 | -50 |
Total impact
- Lines removed/added
- Files changed
- Tests added/passing
Next steps
- Options for the user: commit, continue, or abort
Output Format
## Micro-Edit Session: [Task Name]
### Tasks Executed
| # | Task | Status | Changes |
|---|------|--------|---------|
| 1 | [H] Extract helper | ✅ PASS | lib.rs +2, adapter.rs -15 |
| 2 | [M] Rename field | ✅ PASS | types.rs +1 |
| ... | ... | ... | ... |
### Validation
- [x] cargo check: PASS
- [x] cargo test: 412 PASS
### Impact
- Files: 8 changed
- Lines: -347 net
### Options
- [A) Commit changes]
- [B) Continue with more tasks]
- [C) Generate report]
Subagent Task Template
When launching subagents, include this structure:
TASK: [One sentence objective]
READ FIRST:
- path/to/example_or_pattern_file.ext
- path/to/relevant_type_or_helper.ext
FILES TO MODIFY:
- path/to/target_file.ext
PATTERN TO FOLLOW:
[Point to the exact function/component/test style to imitate. Explain the smallest relevant pattern.]
ACTION:
1. [Specific step]
2. [Specific step]
VERIFICATION:
Run the project-specific command discovered during planning, such as `cargo check`, `npm test`, `npm run build`, `swift test`, or explain why verification cannot be run
CONSTRAINTS:
- Do NOT change behavior
- Do NOT add new dependencies
- Keep changes minimal
- Do NOT modify files outside FILES TO MODIFY unless explicitly required
REPORT:
- Files changed
- Pattern/example followed
- Validation result
- Any uncertainty or skipped verification
Anti-Patterns to Avoid
- Don't batch too many changes - one subagent per logical unit
- Don't skip validation - always verify before aggregating
- Don't let failures propagate - fix immediately, don't aggregate errors
- Don't hide complexity - user should see what's being done
- Don't assume a specific agent name - use available subagents or fallback mode
- Don't give vague worker prompts - avoid "refactor this area"; provide concrete files, examples, actions, and validation
Example Usage
User: "Extract the duplicated code across these 4 adapters into a shared helper"
Agent:
1. Identifies 4 adapters with ~100 lines of duplicated logic
2. Breaks into:
- Task 1: Extract base64 parsing (H)
- Task 2: Extract system message extraction (H)
- Task 3: Extract role mapping (M)
3. Launches 3 parallel workers
4. Validates each change
5. Aggregates and presents summary
1---2name: micro-edit3description: Break large coding tasks into self-contained micro-edits with code examples, constraints, and validation so smaller subagents can execute them safely. Use when the user says "micro-edit", "small changes", "break into tasks", "parallel micro-tasks", or wants to split a large change into reviewable pieces.4---56# Micro-Edit Orchestration Skill78## Concept910Break large coding tasks into small, reviewable micro-edits that can be executed independently, preferably in parallel by subagents. The main agent should be the highest-capability planner but should stay token-efficient: inspect just enough code to identify boundaries, package narrow context for workers, validate results, and only implement directly when needed. This lets smaller or less capable models succeed because each task includes the exact files, examples, constraints, and validation needed.1112## When to Use1314- User wants to split a large change into smaller pieces15- Multiple independent files need similar changes16- Code review would be more manageable with smaller diffs17- User says: "break it into tasks", "micro-edit", "parallel workers"18- Initial analysis reveals many independent opportunities1920## Non-Negotiable Rules21221. **Micro-tasks must be independently verifiable** - each subagent's work can be validated separately232. **Changes must be behavior-preserving** - unless explicitly requested243. **Validation happens BEFORE aggregation** - don't aggregate untested changes254. **Fail fast on validation errors** - stop and fix before continuing265. **Report clearly** - user sees progress, not hidden work276. **Degrade gracefully** - if subagents are unavailable, run the same micro-tasks sequentially287. **Package context, not ambiguity** - each worker task must include the exact files to read, files to modify, examples to imitate, constraints, and validation command2930## Model Strategy3132- **Main agent**: use the strongest available model as a token-efficient planner, context packer, validator, and aggregator. It should avoid reading the entire codebase or doing all edits unless fallback mode is required.33- **Worker agents**: may use smaller, cheaper, or less capable models because every task packet is narrow and self-contained.34- **Token discipline**: prefer targeted searches and 1-3 representative examples over broad codebase dumps. Give workers only the context needed to complete their micro-edit.3536## Workflow3738### Phase 1: Plan and Enqueue39401. **Analyze the request with minimal context**41 - What is the end goal?42 - What files/modules are affected?43 - What are the dependencies between changes?44 - What small set of examples will let a weaker worker imitate the existing pattern?45462. **Break into micro-tasks**47 - Each task: one file, one feature, or one refactoring pattern48 - Tasks should be understandable by a smaller model and completable in <5 minutes49 - Prefer "read these examples, edit this file" over broad search/refactor instructions50 - Label tasks with priority (H/M/L) and area (e.g., "rust-oauth", "ts-ui")51523. **Discover verification commands**53 - Inspect project docs and configuration before delegating work54 - Prefer repository-specific commands from `README`, `AGENTS.md`, `package.json`, `Cargo.toml`, `pyproject.toml`, `Package.swift`, etc.55 - Examples: `npm test`, `npm run build`, `npm run lint`, `cargo check`, `cargo test`, `swift test`, `xcodebuild test`56574. **Create context packets**58 - For each micro-task, include: task objective, files to read first, files to modify, pattern/example to follow, explicit non-goals, validation command, and report format59 - Keep packets small; do not ask workers to rediscover architecture unless that is the task60615. **Create task tracking**62 ```63 - [ ] Task 1: [description]64 - [ ] Task 2: [description]65 - [ ] ...66 ```67686. **Launch parallel subagents when available**69 - Max 4-6 concurrent agents (avoid rate limits and merge conflicts)70 - Each agent gets: task description, files to modify, verification command71 - Use an available implementation/coding subagent. If no generic worker exists, use the closest available coder/developer subagent or run sequentially in the main agent7273### Phase 2: Execute Independently7475Each subagent, or the main agent in fallback mode:761. Reads the target files772. Makes only the assigned micro-change783. Runs the agreed verification command when practical794. Reports: PASS/FAIL, files changed, lines affected, and any skipped verification8081### Phase 3: Validate8283After execution completes:841. **Check each result** - confirm every micro-task reports PASS or a clear skipped-verification reason852. **Validate the combined workspace** - run the strongest practical project-level verification863. **Fix failures** - if validation fails, stop aggregation and fix immediately874. **Aggregate only validated results** - compile findings from agents or sequential steps885. **Report status** - clear summary for user8990### Fallback Mode9192If parallel subagents are unavailable or unsafe for the repository state, execute the same plan sequentially in the main agent:931. Complete one micro-task942. Validate it953. Record the result964. Move to the next micro-task only after the current one passes975. Stop on the first unresolved failure9899### Phase 4: Present1001011. **Summary table**102 ```103 | Task | Status | Files | Lines |104 |------|--------|-------|-------|105 | OAuth dedup | ✅ PASS | 5 | -200 |106 | Type unification | ✅ PASS | 3 | -50 |107 ```1081092. **Total impact**110 - Lines removed/added111 - Files changed112 - Tests added/passing1131143. **Next steps**115 - Options for the user: commit, continue, or abort116117## Output Format118119```120## Micro-Edit Session: [Task Name]121122### Tasks Executed123124| # | Task | Status | Changes |125|---|------|--------|---------|126| 1 | [H] Extract helper | ✅ PASS | lib.rs +2, adapter.rs -15 |127| 2 | [M] Rename field | ✅ PASS | types.rs +1 |128| ... | ... | ... | ... |129130### Validation131- [x] cargo check: PASS132- [x] cargo test: 412 PASS133134### Impact135- Files: 8 changed136- Lines: -347 net137138### Options139- [A) Commit changes]140- [B) Continue with more tasks]141- [C) Generate report]142```143144## Subagent Task Template145146When launching subagents, include this structure:147148```149TASK: [One sentence objective]150151READ FIRST:152- path/to/example_or_pattern_file.ext153- path/to/relevant_type_or_helper.ext154155FILES TO MODIFY:156- path/to/target_file.ext157158PATTERN TO FOLLOW:159[Point to the exact function/component/test style to imitate. Explain the smallest relevant pattern.]160161ACTION:1621. [Specific step]1632. [Specific step]164165VERIFICATION:166Run the project-specific command discovered during planning, such as `cargo check`, `npm test`, `npm run build`, `swift test`, or explain why verification cannot be run167168CONSTRAINTS:169- Do NOT change behavior170- Do NOT add new dependencies171- Keep changes minimal172- Do NOT modify files outside FILES TO MODIFY unless explicitly required173174REPORT:175- Files changed176- Pattern/example followed177- Validation result178- Any uncertainty or skipped verification179```180181## Anti-Patterns to Avoid182183- **Don't batch too many changes** - one subagent per logical unit184- **Don't skip validation** - always verify before aggregating185- **Don't let failures propagate** - fix immediately, don't aggregate errors186- **Don't hide complexity** - user should see what's being done187- **Don't assume a specific agent name** - use available subagents or fallback mode188- **Don't give vague worker prompts** - avoid "refactor this area"; provide concrete files, examples, actions, and validation189190## Example Usage191192```193User: "Extract the duplicated code across these 4 adapters into a shared helper"194195Agent:1961. Identifies 4 adapters with ~100 lines of duplicated logic1972. Breaks into:198 - Task 1: Extract base64 parsing (H)199 - Task 2: Extract system message extraction (H)200 - Task 3: Extract role mapping (M)2013. Launches 3 parallel workers2024. Validates each change2035. Aggregates and presents summary204```