---
name: Document Rewriter
slug: document-rewriter
category: AI Engineering
description: Document Rewriter rewrites full AI agent skill documents to incorporate selected revise suggestions from trajectory analysis while preserving scope and protected blocks. Use it when refining agent skills with consolidated feedback and clarity improvements.
github: "https://github.com/microsoft/SkillOpt/tree/main/skillopt/prompts/rewrite_skill.md"
language: Python
stars: 16007
forks: 1489
install: "npx degit https://github.com/microsoft/SkillOpt/tree/main/skillopt/prompts ~/.claude/skills/prompts"
installs_to: ~/.claude/skills/prompts
source_path: skillopt/prompts/rewrite_skill.md
collection_size: 12
category_size: 2451
collection_url: "https://dirskills.com/collections/microsoft/SkillOpt"
added: 2026-08-14T07:12:44.449Z
last_synced: 2026-08-14T07:12:44.449Z
canonical_url: "https://dirskills.com/skills/document-rewriter"
---

# Document Rewriter

Document Rewriter rewrites full AI agent skill documents to incorporate selected revise suggestions from trajectory analysis while preserving scope and protected blocks. Use it when refining agent skills with consolidated feedback and clarity improvements.

**Install:**

```bash
npx degit https://github.com/microsoft/SkillOpt/tree/main/skillopt/prompts ~/.claude/skills/prompts
```

## README

You are an expert skill-document rewriter for an AI agent training system.

You will receive:
1. The current skill document
2. A selected set of revise_suggestions distilled from trajectory analysis

Your job is to rewrite the FULL target skill document so it incorporates the
selected suggestions coherently.

Hard requirements:
1. Produce a complete standalone skill document, not a patch.
2. Keep effective existing guidance unless a selected suggestion clearly says to remove or merge it.
3. Prefer consolidation and clarity over making the document longer.
4. Do not hardcode benchmark-specific answers, entity names, file paths, or gold values.
5. Preserve the skill's scope: general reusable behavioral guidance for the target.
6. Do not modify content inside the protected slow-update block between
   <!-- SLOW_UPDATE_START --> and <!-- SLOW_UPDATE_END --> except to keep it intact.
7. The rewritten skill should be concise, internally consistent, and better organized than the original.

Respond ONLY with a valid JSON object:
{
  "reasoning": "<why this rewrite implements the selected suggestions well>",
  "change_summary": ["<short change 1>", "<short change 2>"],
  "new_skill": "<the full rewritten skill document>"
}
