[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C9QWHX6RCWPMX0YMRPJCHQ":3,"skill-same:01M7C9QWHX6RCWPMX0YMRPJCHQ":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":13,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7C9QWHX6RCWPMX0YMRPJCHQ","skill-rewrite",null,"Draft a rewritten SKILL.md for an Agent Skill based on a skill-audit report. Use when a skill has failed or weak audit dimensions and you need a concrete rewrite plan before editing. The skill does not apply changes without explicit approval.","Okja-Engineering\u002Fskill-architect","Okja-Engineering","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F126595173?v=4","01M7C9QPXDYB8K2DTR5PE4X9AC","01M7C9QPY7276ZV6PR7TKSMRJP",0,"MIT","https:\u002F\u002Fgithub.com\u002FOkja-Engineering\u002Fskill-architect\u002Fblob\u002Fmain\u002Fskills\u002Fskill-rewrite\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: skill-rewrite\ndescription: Draft a rewritten SKILL.md for an Agent Skill based on a skill-audit report. Use when a skill has failed or weak audit dimensions and you need a concrete rewrite plan before editing. The skill does not apply changes without explicit approval.\nlicense: MIT\ncompatibility: bash 3.2+.\nmetadata:\n  version: \"0.1.0\"\n---\n\n# skill-rewrite\n\nDraft a rewritten `SKILL.md` for an Agent Skill based on a `skill-audit` report. This skill turns audit findings into a concrete rewrite plan; it does not modify the audited skill without explicit approval.\n\n## When to use\n\nUse this skill when:\n\n- A skill has one or more failed or weak dimensions in a `skill-audit` report.\n- You are converting a prose workflow into a spec-compliant Agent Skill.\n- You need a structured rewrite plan before editing `SKILL.md`.\n- You want to preserve the skill's intent while fixing structural, trigger, or context-management issues.\n\nDo not use this skill to apply changes silently; the draft must be reviewed and approved first.\n\n## Deterministic actions (60%)\n\n### Stage 0: Orient\n\nInputs:\n\n- `skill_root`: the directory holding this `SKILL.md` — the `skill-rewrite` skill directory. Every command below is anchored on it, directly or through `audit_root`, so the commands run from any working directory rather than only from the skill's own.\n- `audit_root`: the sibling `skill-audit` skill directory, `\"$skill_root\u002F..\u002Fskill-audit\"`. `skill-rewrite` runs `skill-audit`'s check scripts and reads its evaluation matrix; it bundles neither.\n- `target_skill`: the skill directory to rewrite.\n- `audit_report`: optional path to an existing audit report. If omitted, run `skill-audit` first.\n- `output`: optional path to write the draft to. If omitted, the draft goes beside the target's `SKILL.md`. See \"Where the draft is written\" under Stage 2 for the four destinations it will not write to.\n\nPrerequisites:\n\nRequired tools: `awk`, `cat`, `grep`, `jq`, `mktemp`, `skill-validator`, `wc`.\n\nStage 1 and `draft-rewrite.sh` both run `skill-audit`'s `check-frontmatter.sh`, which validates the spec with `skill-validator`. Install it with `brew install agent-ecosystem\u002Ftap\u002Fskill-validator`, because without it neither path will draft for you:\n\nWithout `skill-validator`: `check-frontmatter.sh` exits `3`; `draft-rewrite.sh` exits `3`.\n\nStage 1 runs the check directly, so it exits 3 with `required tool not found: skill-validator` on stderr and reports no verdict rather than one it could not compute. `draft-rewrite.sh` is inside that same guard now: it reads each check's exit status instead of discarding it, captures each check's stdout on its own instead of merging the check's stderr into it, and a check that reached no verdict stops the draft rather than becoming its content. So it exits 3 too, with `required tool not found: skill-validator` on stderr, and it writes no `REWRITE-DRAFT.md` — the partial one it had opened is removed on the way out, so there is no half-draft in your skill directory either. **What earlier releases warned about here — a drafter that exited 0 and presented `required tool not found: skill-validator` as the draft's own `Current state` — is closed, not something to work around.** A draft you are handed is a draft built from an audit that ran.\n\nThe other six required tools refuse the same way, so this is the skill's behaviour and not one tool's special case. `awk`, `grep` and `cat` are what this skill computes with, and `mktemp` holds the audit when you do not hand it one with `-a`; `jq` and `wc` are preconditions of the two sibling checks. Mask any one of the seven and `draft-rewrite.sh` exits 3 naming that tool and leaves no draft. Nothing on this skill's path needs `skillscore`, which scores quality this skill does not run; add it if you extend the stages to use it.\n\nThis skill is not self-contained. It bundles `draft-rewrite.sh` and runs no check of its own: every check it runs comes from `$audit_root\u002Fscripts\u002F` — `check-frontmatter.sh` and `check-structure.sh`, which both load `verdict-guard.sh` and refuse to compute a verdict without it. `draft-rewrite.sh` loads that guard too, which is how it refuses in the guard's own words rather than in the shell's; it sources the guard rather than running it, which is why the guard is not one of the checks named above. A pruner who removes the guard as an unused file, or who installs this skill alone, gets no draft at all. Install or prune the two skills together.\n\n### Stage 1: Run audit if needed\n\nIf no audit report is provided, run the audit:\n\n```bash\nskill_root=\"\u003Cpath-to-skill-architect>\u002Fskills\u002Fskill-rewrite\"\naudit_root=\"$skill_root\u002F..\u002Fskill-audit\"\ntarget_skill=\"\u003Ctarget-skill-dir>\"\n\"$audit_root\u002Fscripts\u002Fcheck-frontmatter.sh\" \"$target_skill\"\n\"$audit_root\u002Fscripts\u002Fcheck-structure.sh\" \"$target_skill\"\n```\n\nCapture the output and score the 10 dimensions against `\"$audit_root\u002Freferences\u002Fevaluation-matrix.md\"`.\n\n### Stage 2: Generate rewrite draft\n\nRun the rewrite drafter. Without `-a` it runs the Stage 1 checks itself; with `-a` it reads the report you already have; with `-o` it writes the draft where you say instead of into the target skill's directory:\n\n```bash\nskill_root=\"\u003Cpath-to-skill-architect>\u002Fskills\u002Fskill-rewrite\"\ntarget_skill=\"\u003Ctarget-skill-dir>\"\n\"$skill_root\u002Fscripts\u002Fdraft-rewrite.sh\" -t \"$target_skill\"\n\"$skill_root\u002Fscripts\u002Fdraft-rewrite.sh\" -t \"$target_skill\" -a \"\u003Caudit-report-path>\"\n\"$skill_root\u002Fscripts\u002Fdraft-rewrite.sh\" -t \"$target_skill\" -o \"\u003Coutput-path>\"\n```\n\nBy default this writes a `REWRITE-DRAFT.md` next to the target skill's `SKILL.md`, and names it on stdout. The draft is a skeleton to work from, not a rewritten skill: the drafter reads the target's `SKILL.md` only to run three heading probes over it, and never writes to it.\n\n#### Where the draft is written\n\n`-o` makes the destination yours to name — a scratch directory, your notes, a review branch — and it writes there instead of into the skill you are auditing, not as well as.\n\nFour destinations it refuses, and it refuses them before it runs the audit, so a refusal leaves nothing behind anywhere:\n\n- **A directory.** Name the file to write, not the folder to write it in.\n- **A symbolic link.** A redirect follows the link and truncates what is on the other end, so where the draft would go is not where you named it. Give the path the link points at.\n- **A `SKILL.md`.** A rewrite draft is not a skill. This is the mechanism behind the Constraints section's \"do not overwrite the original `SKILL.md`\": until `-o` existed there was no way to reach that mistake, and now that there is, the drafter refuses it rather than trusting you not to make it.\n- **Anywhere inside a live agent configuration directory, or inside a directory an agent reads skills from.** An agent reads a skills directory as skills, so a draft left in one is not a stray file but a document that may be loaded as instructions. The list is every `$HOME`-relative directory this repository's README documents an agent reading skills from — including `$HOME\u002F.agents`, which belongs to no single harness and is read by more than one.\n\nProtected destinations: `$HOME\u002F.claude`, `$HOME\u002F.cursor`, `$HOME\u002F.codex`, `$HOME\u002F.devin`, `$HOME\u002F.config`, `$HOME\u002F.agents`.\n\nThe last of those is decided by **which directory the write lands in, not by how you spell it**, which is the part worth knowing if you are writing the destination in a script. `$HOME\u002Fdrafts\u002Fx.md` where `drafts` is a symlink into `~\u002F.claude\u002Fskills` is refused, though nothing in its spelling looks wrong; `$HOME\u002F.claude-notes\u002Fx.md` is accepted, though `$HOME\u002F.claude` is a prefix of it. On a case-insensitive volume `$HOME\u002F.CLAUDE\u002Fskills\u002Fx.md` is the same directory as `$HOME\u002F.claude\u002Fskills\u002Fx.md` and is refused too, as is a destination spelled in a different Unicode normalisation from the one on disk: the comparison is device and inode, so no spelling of a protected directory gets past it. And a destination whose landing place the drafter cannot determine — a directory it may not traverse, a symlink chain that does not end, or a protected directory that does not exist yet named in a spelling that is not the one this script holds — is refused as an execution error, exit 3, rather than being let through: \"I could not tell where this would land\" is not \"go ahead\".\n\nAnywhere else you can write, it will write. The refusals are a short list, not a sandbox.\n\n#### The sections the drafter writes\n\n```text\n## Current state\n## Proposed structure\n## Missing section templates\n### When to use\n### Examples\n#### Example 1: \u003Cscenario>\n### Validation checklist\n## Action items\n## Notes\n```\n\nAbove them, a `# Rewrite draft: \u003Ctarget>` title. What each holds:\n\n- `Current state` — the Stage 1 checks' stdout, captured one check at a time, or the contents of the report given with `-a`. Their stderr is not folded in: a check that could not compute a verdict stops the draft instead of appearing here as a finding about the skill, so nothing in this section is a diagnostic about the check itself; see Prerequisites.\n- `Proposed structure` — the spec and ICM section list. Fixed text, the same for every target.\n- `Missing section templates` — a blank template for each of `When to use`, `Examples` and `Validation checklist` the target has no heading for. The three probes read heading levels `##` to `######` and ignore case, and they are not all the same shape: `When to use` and `Example`\u002F`Examples` must be the whole heading, while `Validation` is matched as a prefix, so a target's own `### Validation` section suppresses the `Validation checklist` template. A target that already has all three gets the heading and nothing under it.\n- `Action items` and `Notes` — fixed text, the same for every target.\n\n**What the drafter does not do**, and what Stage 3 is therefore for. It does not copy or correct the target's frontmatter. It writes no template for `Deterministic actions`, `Orchestration`, `AI judgment` or `Constraints`. That is four of the six sections its own `Proposed structure` requires. `Action items` is a five-item review checklist, not a mapping of the audit's findings: it is the same text for a skill that audits clean and one that fails, and the drafter never reads the evaluation matrix. Scoring the dimensions and turning them into fixes is Stage 1 and Stage 3 work, done by the reader.\n\n`tests\u002Ftest_rewrite.sh` compares the list above against the headings a run actually writes, so neither side can change without the other, and it pins each of the four gaps above as an absence — so if the drafter ever learns to close one, the suite goes red rather than leaving this section describing a draft that no longer exists.\n\n### Stage 3: Produce rewrite plan\n\nRead the draft and produce a final rewrite plan that includes:\n\n1. What sections will be added, moved, or removed.\n2. What scripts or references need to be created, renamed, or deleted.\n3. What content is preserved unchanged.\n4. What requires human judgment (e.g., trigger phrasing, scope boundaries).\n\n## Orchestration (30%)\n\n### Rewrite process\n\n1. Confirm the target skill directory and locate or generate the audit report.\n2. Read the current `SKILL.md`, `scripts\u002F`, `references\u002F`, and `assets\u002F`.\n3. Identify the highest-impact fixes first:\n   - Spec compliance failures (frontmatter, layout).\n   - Trigger failures (description missing what\u002Fwhen\u002Fkeywords).\n   - Body structure failures (missing headings, >500 lines, no examples).\n   - Determinism failures (missing scripts, bad paths, no error handling).\n4. Generate the rewrite draft using `draft-rewrite.sh`.\n5. Present the draft to the maintainer and ask for approval.\n6. After approval, apply the rewrite. If approval is partial, apply only the approved changes.\n7. Re-run `skill-audit` and confirm the scores improved.\n\n### Content preservation rules\n\n- Keep the skill's original intent and domain knowledge.\n- Move mechanical work into `scripts\u002F`; do not delete useful scripts unless they are duplicated or broken.\n- Move deep reference material into `references\u002F` or `assets\u002F`.\n- Do not inflate `SKILL.md` beyond ~500 lines; split instead of grow.\n\n## AI judgment (10%)\n\nUse judgment for:\n\n- Deciding whether a missing `When to use` section should list three scenarios or five.\n- Rewriting the description to be \"pushy\" without being misleading.\n- Choosing whether a skill should be split rather than expanded.\n- Summarizing domain-specific content into the new structure without losing nuance.\n- Deciding which adjacent contexts belong in the description's trigger list.\n\nWhen in doubt, keep the draft conservative and flag the uncertainty for the maintainer.\n\n## Constraints\n\n- Do not overwrite the original `SKILL.md` without explicit approval.\n- Do not guess the maintainer's intent for ambiguous fixes.\n- Preserve all working scripts unless they are provably broken or duplicated.\n- Keep the skill focused on one job; prefer splitting over adding scope.\n- Every rewrite must be followed by a re-audit.\n\n## Examples\n\n### Generate a rewrite draft\n\n```bash\nskill_root=\"\u003Cpath-to-skill-architect>\u002Fskills\u002Fskill-rewrite\"\n\"$skill_root\u002Fscripts\u002Fdraft-rewrite.sh\" -t \u003Ctarget-skill-dir> -a \u003Caudit-report-path>\n```\n\nOutput: `\u003Ctarget-skill-dir>\u002FREWRITE-DRAFT.md`.\n\n### Rewrite plan outline\n\n```text\nskills\u002Frelease-check\u002FREWRITE-DRAFT.md\n- Preserve: frontmatter name, description intent, existing scripts.\n- Add: When to use, Examples, Validation checklist.\n- Move: deep reference content to references\u002Fvalidation-patterns.md.\n- Remove: duplicate Process section under Orchestration.\n- Rename: scripts\u002Fcheck.sh to scripts\u002Fvalidate.sh to match SKILL.md text.\n```\n","# skill-rewrite\n\nDraft a rewritten `SKILL.md` for an Agent Skill based on a `skill-audit` report. This skill turns audit findings into a concrete rewrite plan; it does not modify the audited skill without explicit approval.\n\n## When to use\n\nUse this skill when:\n\n- A skill has one or more failed or weak dimensions in a `skill-audit` report.\n- You are converting a prose workflow into a spec-compliant Agent Skill.\n- You need a structured rewrite plan before editing `SKILL.md`.\n- You want to preserve the skill's intent while fixing structural, trigger, or context-management issues.\n\nDo not use this skill to apply changes silently; the draft must be reviewed and approved first.\n\n## Deterministic actions (60%)\n\n### Stage 0: Orient\n\nInputs:\n\n- `skill_root`: the directory holding this `SKILL.md` — the `skill-rewrite` skill directory. Every command below is anchored on it, directly or through `audit_root`, so the commands run from any working directory rather than only from the skill's own.\n- `audit_root`: the sibling `skill-audit` skill directory, `\"$skill_root\u002F..\u002Fskill-audit\"`. `skill-rewrite` runs `skill-audit`'s check scripts and reads its evaluation matrix; it bundles neither.\n- `target_skill`: the skill directory to rewrite.\n- `audit_report`: optional path to an existing audit report. If omitted, run `skill-audit` first.\n- `output`: optional path to write the draft to. If omitted, the draft goes beside the target's `SKILL.md`. See \"Where the draft is written\" under Stage 2 for the four destinations it will not write to.\n\nPrerequisites:\n\nRequired tools: `awk`, `cat`, `grep`, `jq`, `mktemp`, `skill-validator`, `wc`.\n\nStage 1 and `draft-rewrite.sh` both run `skill-audit`'s `check-frontmatter.sh`, which validates the spec with `skill-validator`. Install it with `brew install agent-ecosystem\u002Ftap\u002Fskill-validator`, because without it neither path will draft for you:\n\nWithout `skill-validator`: `check-frontmatter.sh` exits `3`; `draft-rewrite.sh` exits `3`.\n\nStage 1 runs the check directly, so it exits 3 with `required tool not found: skill-validator` on stderr and reports no verdict rather than one it could not compute. `draft-rewrite.sh` is inside that same guard now: it reads each check's exit status instead of discarding it, captures each check's stdout on its own instead of merging the check's stderr into it, and a check that reached no verdict stops the draft rather than becoming its content. So it exits 3 too, with `required tool not found: skill-validator` on stderr, and it writes no `REWRITE-DRAFT.md` — the partial one it had opened is removed on the way out, so there is no half-draft in your skill directory either. **What earlier releases warned about here — a drafter that exited 0 and presented `required tool not found: skill-validator` as the draft's own `Current state` — is closed, not something to work around.** A draft you are handed is a draft built from an audit that ran.\n\nThe other six required tools refuse the same way, so this is the skill's behaviour and not one tool's special case. `awk`, `grep` and `cat` are what this skill computes with, and `mktemp` holds the audit when you do not hand it one with `-a`; `jq` and `wc` are preconditions of the two sibling checks. Mask any one of the seven and `draft-rewrite.sh` exits 3 naming that tool and leaves no draft. Nothing on this skill's path needs `skillscore`, which scores quality this skill does not run; add it if you extend the stages to use it.\n\nThis skill is not self-contained. It bundles `draft-rewrite.sh` and runs no check of its own: every check it runs comes from `$audit_root\u002Fscripts\u002F` — `check-frontmatter.sh` and `check-structure.sh`, which both load `verdict-guard.sh` and refuse to compute a verdict without it. `draft-rewrite.sh` loads that guard too, which is how it refuses in the guard's own words rather than in the shell's; it sources the guard rather than running it, which is why the guard is not one of the checks named above. A pruner who removes the guard as an unused file, or who installs this skill alone, gets no draft at all. Install or prune the two skills together.\n\n### Stage 1: Run audit if needed\n\nIf no audit report is provided, run the audit:\n\n```bash\nskill_root=\"\u003Cpath-to-skill-architect>\u002Fskills\u002Fskill-rewrite\"\naudit_root=\"$skill_root\u002F..\u002Fskill-audit\"\ntarget_skill=\"\u003Ctarget-skill-dir>\"\n\"$audit_root\u002Fscripts\u002Fcheck-frontmatter.sh\" \"$target_skill\"\n\"$audit_root\u002Fscripts\u002Fcheck-structure.sh\" \"$target_skill\"\n```\n\nCapture the output and score the 10 dimensions against `\"$audit_root\u002Freferences\u002Fevaluation-matrix.md\"`.\n\n### Stage 2: Generate rewrite draft\n\nRun the rewrite drafter. Without `-a` it runs the Stage 1 checks itself; with `-a` it reads the report you already have; with `-o` it writes the draft where you say instead of into the target skill's directory:\n\n```bash\nskill_root=\"\u003Cpath-to-skill-architect>\u002Fskills\u002Fskill-rewrite\"\ntarget_skill=\"\u003Ctarget-skill-dir>\"\n\"$skill_root\u002Fscripts\u002Fdraft-rewrite.sh\" -t \"$target_skill\"\n\"$skill_root\u002Fscripts\u002Fdraft-rewrite.sh\" -t \"$target_skill\" -a \"\u003Caudit-report-path>\"\n\"$skill_root\u002Fscripts\u002Fdraft-rewrite.sh\" -t \"$target_skill\" -o \"\u003Coutput-path>\"\n```\n\nBy default this writes a `REWRITE-DRAFT.md` next to the target skill's `SKILL.md`, and names it on stdout. The draft is a skeleton to work from, not a rewritten skill: the drafter reads the target's `SKILL.md` only to run three heading probes over it, and never writes to it.\n\n#### Where the draft is written\n\n`-o` makes the destination yours to name — a scratch directory, your notes, a review branch — and it writes there instead of into the skill you are auditing, not as well as.\n\nFour destinations it refuses, and it refuses them before it runs the audit, so a refusal leaves nothing behind anywhere:\n\n- **A directory.** Name the file to write, not the folder to write it in.\n- **A symbolic link.** A redirect follows the link and truncates what is on the other end, so where the draft would go is not where you named it. Give the path the link points at.\n- **A `SKILL.md`.** A rewrite draft is not a skill. This is the mechanism behind the Constraints section's \"do not overwrite the original `SKILL.md`\": until `-o` existed there was no way to reach that mistake, and now that there is, the drafter refuses it rather than trusting you not to make it.\n- **Anywhere inside a live agent configuration directory, or inside a directory an agent reads skills from.** An agent reads a skills directory as skills, so a draft left in one is not a stray file but a document that may be loaded as instructions. The list is every `$HOME`-relative directory this repository's README documents an agent reading skills from — including `$HOME\u002F.agents`, which belongs to no single harness and is read by more than one.\n\nProtected destinations: `$HOME\u002F.claude`, `$HOME\u002F.cursor`, `$HOME\u002F.codex`, `$HOME\u002F.devin`, `$HOME\u002F.config`, `$HOME\u002F.agents`.\n\nThe last of those is decided by **which directory the write lands in, not by how you spell it**, which is the part worth knowing if you are writing the destination in a script. `$HOME\u002Fdrafts\u002Fx.md` where `drafts` is a symlink into `~\u002F.claude\u002Fskills` is refused, though nothing in its spelling looks wrong; `$HOME\u002F.claude-notes\u002Fx.md` is accepted, though `$HOME\u002F.claude` is a prefix of it. On a case-insensitive volume `$HOME\u002F.CLAUDE\u002Fskills\u002Fx.md` is the same directory as `$HOME\u002F.claude\u002Fskills\u002Fx.md` and is refused too, as is a destination spelled in a different Unicode normalisation from the one on disk: the comparison is device and inode, so no spelling of a protected directory gets past it. And a destination whose landing place the drafter cannot determine — a directory it may not traverse, a symlink chain that does not end, or a protected directory that does not exist yet named in a spelling that is not the one this script holds — is refused as an execution error, exit 3, rather than being let through: \"I could not tell where this would land\" is not \"go ahead\".\n\nAnywhere else you can write, it will write. The refusals are a short list, not a sandbox.\n\n#### The sections the drafter writes\n\n```text\n## Current state\n## Proposed structure\n## Missing section templates\n### When to use\n### Examples\n#### Example 1: \u003Cscenario>\n### Validation checklist\n## Action items\n## Notes\n```\n\nAbove them, a `# Rewrite draft: \u003Ctarget>` title. What each holds:\n\n- `Current state` — the Stage 1 checks' stdout, captured one check at a time, or the contents of the report given with `-a`. Their stderr is not folded in: a check that could not compute a verdict stops the draft instead of appearing here as a finding about the skill, so nothing in this section is a diagnostic about the check itself; see Prerequisites.\n- `Proposed structure` — the spec and ICM section list. Fixed text, the same for every target.\n- `Missing section templates` — a blank template for each of `When to use`, `Examples` and `Validation checklist` the target has no heading for. The three probes read heading levels `##` to `######` and ignore case, and they are not all the same shape: `When to use` and `Example`\u002F`Examples` must be the whole heading, while `Validation` is matched as a prefix, so a target's own `### Validation` section suppresses the `Validation checklist` template. A target that already has all three gets the heading and nothing under it.\n- `Action items` and `Notes` — fixed text, the same for every target.\n\n**What the drafter does not do**, and what Stage 3 is therefore for. It does not copy or correct the target's frontmatter. It writes no template for `Deterministic actions`, `Orchestration`, `AI judgment` or `Constraints`. That is four of the six sections its own `Proposed structure` requires. `Action items` is a five-item review checklist, not a mapping of the audit's findings: it is the same text for a skill that audits clean and one that fails, and the drafter never reads the evaluation matrix. Scoring the dimensions and turning them into fixes is Stage 1 and Stage 3 work, done by the reader.\n\n`tests\u002Ftest_rewrite.sh` compares the list above against the headings a run actually writes, so neither side can change without the other, and it pins each of the four gaps above as an absence — so if the drafter ever learns to close one, the suite goes red rather than leaving this section describing a draft that no longer exists.\n\n### Stage 3: Produce rewrite plan\n\nRead the draft and produce a final rewrite plan that includes:\n\n1. What sections will be added, moved, or removed.\n2. What scripts or references need to be created, renamed, or deleted.\n3. What content is preserved unchanged.\n4. What requires human judgment (e.g., trigger phrasing, scope boundaries).\n\n## Orchestration (30%)\n\n### Rewrite process\n\n1. Confirm the target skill directory and locate or generate the audit report.\n2. Read the current `SKILL.md`, `scripts\u002F`, `references\u002F`, and `assets\u002F`.\n3. Identify the highest-impact fixes first:\n   - Spec compliance failures (frontmatter, layout).\n   - Trigger failures (description missing what\u002Fwhen\u002Fkeywords).\n   - Body structure failures (missing headings, >500 lines, no examples).\n   - Determinism failures (missing scripts, bad paths, no error handling).\n4. Generate the rewrite draft using `draft-rewrite.sh`.\n5. Present the draft to the maintainer and ask for approval.\n6. After approval, apply the rewrite. If approval is partial, apply only the approved changes.\n7. Re-run `skill-audit` and confirm the scores improved.\n\n### Content preservation rules\n\n- Keep the skill's original intent and domain knowledge.\n- Move mechanical work into `scripts\u002F`; do not delete useful scripts unless they are duplicated or broken.\n- Move deep reference material into `references\u002F` or `assets\u002F`.\n- Do not inflate `SKILL.md` beyond ~500 lines; split instead of grow.\n\n## AI judgment (10%)\n\nUse judgment for:\n\n- Deciding whether a missing `When to use` section should list three scenarios or five.\n- Rewriting the description to be \"pushy\" without being misleading.\n- Choosing whether a skill should be split rather than expanded.\n- Summarizing domain-specific content into the new structure without losing nuance.\n- Deciding which adjacent contexts belong in the description's trigger list.\n\nWhen in doubt, keep the draft conservative and flag the uncertainty for the maintainer.\n\n## Constraints\n\n- Do not overwrite the original `SKILL.md` without explicit approval.\n- Do not guess the maintainer's intent for ambiguous fixes.\n- Preserve all working scripts unless they are provably broken or duplicated.\n- Keep the skill focused on one job; prefer splitting over adding scope.\n- Every rewrite must be followed by a re-audit.\n\n## Examples\n\n### Generate a rewrite draft\n\n```bash\nskill_root=\"\u003Cpath-to-skill-architect>\u002Fskills\u002Fskill-rewrite\"\n\"$skill_root\u002Fscripts\u002Fdraft-rewrite.sh\" -t \u003Ctarget-skill-dir> -a \u003Caudit-report-path>\n```\n\nOutput: `\u003Ctarget-skill-dir>\u002FREWRITE-DRAFT.md`.\n\n### Rewrite plan outline\n\n```text\nskills\u002Frelease-check\u002FREWRITE-DRAFT.md\n- Preserve: frontmatter name, description intent, existing scripts.\n- Add: When to use, Examples, Validation checklist.\n- Move: deep reference content to references\u002Fvalidation-patterns.md.\n- Remove: duplicate Process section under Orchestration.\n- Rename: scripts\u002Fcheck.sh to scripts\u002Fvalidate.sh to match SKILL.md text.\n```\n",{"name":5,"license":14,"metadata":23,"description":7,"compatibility":25},{"version":24},"0.1.0","bash 3.2+.","main","8d2a89ed6019e92baec10b89b41d12212bdf876f","skills\u002Fskill-rewrite","https:\u002F\u002Fgithub.com\u002FOkja-Engineering\u002Fskill-architect","https:\u002F\u002Fgithub.com\u002FOkja-Engineering","okja.io","2026-09-23 12:46:47",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Okja-Engineering\u002Fskill-architect --skill skill-rewrite",{"tool":39,"command":40},"bunx","bunx skills add Okja-Engineering\u002Fskill-architect --skill skill-rewrite",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Okja-Engineering\u002Fskill-architect --skill skill-rewrite","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FOkja-Engineering\u002Fskill-architect\u002Fblob\u002Fmain\u002Fskills\u002Fskill-rewrite\u002FSKILL.md",true,[47],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"scripts\u002Fdraft-rewrite.sh","SCRIPT","脚本",44971,"https:\u002F\u002Fgithub.com\u002FOkja-Engineering\u002Fskill-architect\u002Fblob\u002Fmain\u002Fskills\u002Fskill-rewrite\u002Fscripts\u002Fdraft-rewrite.sh",[54,61,68,75,82,89],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M7C9SQ65HMR387X4E5QVQBVZ","all-sections","A skill that already carries every heading draft-rewrite.sh looks for. Use when a test needs a target for which no section template fires.","https:\u002F\u002Fgithub.com\u002FOkja-Engineering\u002Fskill-architect\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Frewrite\u002Fall-sections\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M7C9SNP529XZ0211RBRX5C1B","valid-minimal","A minimal skill that conforms to the Agent Skills spec without house policy extras.","https:\u002F\u002Fgithub.com\u002FOkja-Engineering\u002Fskill-architect\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Ff01\u002Fvalid-minimal\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M7C9SJK266D1PMC6YZ2EN286","valid-full","A skill with a quoted description, license, metadata, and house headings.","https:\u002F\u002Fgithub.com\u002FOkja-Engineering\u002Fskill-architect\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Ff01\u002Fvalid-full\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M7C9SE24PCZWAVBBA5AEQWK3","rule-before-refs","A skill whose broken references all sit after a markdown horizontal rule, so a frontmatter scan that re-enters on a third delimiter would stop reading before reaching any of them.","https:\u002F\u002Fgithub.com\u002FOkja-Engineering\u002Fskill-architect\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Ff01\u002Frule-before-refs\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M7C9SBRSCYG5NHXG8GCEXACX","path-fault-only","A skill that satisfies every house policy rule but references a script path that does not exist.","https:\u002F\u002Fgithub.com\u002FOkja-Engineering\u002Fskill-architect\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Ff01\u002Fpath-fault-only\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":18},"01M7C9S8ZBM68ZVFEQ8QYEPX87","no-rule-before-refs","https:\u002F\u002Fgithub.com\u002FOkja-Engineering\u002Fskill-architect\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Ff01\u002Fno-rule-before-refs\u002FSKILL.md",[],[]]