Agent skill

Spectre Rewrite Subagent

by joenandez in joenandez/spectre

Rewrite Spectre subagent definitions into compact, contract-driven agents with clear routing, least-privilege tools, output schemas, and an auditable rewrite trail.

MITAuto-check passedAgent Workflows

Install Spectre Rewrite Subagent

skills CLI
$ npx skills add joenandez/spectre --skill spectre-rewrite-subagent -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install joenandez/spectre spectre-rewrite-subagent --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/joenandez/spectre.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/spectre-rewrite-subagent .claude/skills/spectre-rewrite-subagent && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
spectre-rewrite-subagent
GitHub stars
164
Token cost
~1.8k tokens
SKILL.md length
740 words
Files
2
Skills in repo
26
Repo updated
First seen
Licence
MIT

At a glance

Rewrite Spectre subagent definitions into compact, contract-driven agents with clear routing, least-privilege tools, output schemas, and an auditable rewrite trail.

  • Works in 6 steps: Inventory The Agent → Classify The Role → Block Triage → …
  • Rewriting plugins/spectre/agents/.md
  • SKILL.md covers Inputs, Grounding, Procedure and Self-Check, plus 1 more section
  • Calls npm

What it does

Spectre Rewrite Subagent is an agent skill from joenandez/spectre. Rewrite Spectre subagent definitions into compact, contract-driven agents with clear routing, least-privilege tools, output schemas, and an auditable rewrite trail. Use when reviewing or rewriting plugins/spectre/agents/.md, when the user asks to improve subagents/agent definitions, or when checking generated plugins/spectre-codex/agents/.toml. Do not use for rewriting workflow skills; use spectre-rewrite-skill for SKILL.md compression.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Agent Workflows, covering Subagents. The repository describes itself as: Spectre is a battle-tested 6 stage agentic engineering workflow for building complex, production-ready features. You stay in the loop for the decisions that matter. Your agents…. The licence is MIT.

When your agent uses it

  • Rewriting plugins/spectre/agents/.md
  • The user asks to improve subagents/agent definitions
  • Checking generated plugins/spectre-codex/agents/.toml
  • Rewriting workflow skills

Example prompts

  • “/spectre-rewrite-subagent”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Inventory The Agent
  2. Classify The Role
  3. Block Triage
  4. Draft The Agent Contract
  5. Write The Observability Trail
  6. Apply Only On Explicit Request

What it can do on your machine

Read from SKILL.md and the folder at commit 931c9e8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Spectre Rewrite Subagent loads about 1.8k tokens when it runs. Until then it costs about 119 tokens; SKILL.md has 740 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~119
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from joenandez/spectre at commit 931c9e8, republished under its MIT licence (© joenandez). 740 words, ~1,786 tokens.

Download SKILL.mdSave it as .claude/skills/spectre-rewrite-subagent/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
spectre-rewrite-subagent
description
Rewrite Spectre subagent definitions into compact, contract-driven agents with clear routing, least-privilege tools, output schemas, and an auditable rewrite trail. Use when reviewing or rewriting `plugins/spectre/agents/*.md`, when the user asks to improve subagents/agent definitions, or when checking generated `plugins/spectre-codex/agents/*.toml`. Do not use for rewriting workflow skills; use `spectre-rewrite-skill` for `SKILL.md` compression.

Spectre Subagent Rewrite

Rewrite one or more Spectre subagent definitions from broad persona prompts into focused worker contracts. Produce a reviewable proposal by default; apply changes to the live plugin only when the user explicitly asks.

Inputs

  • Target agent names from $ARGUMENTS (finder, analyst, patterns, reviewer, tester, dev, web-research) or explicit file paths.
  • Source path: plugins/spectre/agents/<agent>.md.
  • Generated Codex path: plugins/spectre-codex/agents/<agent>.toml.
  • Mode:
    • proposal by default: write review artifacts only.
    • apply only if the user explicitly asks to update live definitions.

Assume cwd is the Spectre repo root. If no target is provided, ask which subagent to rewrite.

Grounding

Read these before drafting:

  1. docs/tasks/main/research/subagent_definition_best_practices_053126.md - subagent best practices and practitioner findings.
  2. The source agent file(s) in full.
  3. scripts/translators/agents.cjs only when applying or checking Codex TOML generation.
  4. docs/spectre-design-research.md only if deciding whether a block is load-bearing or generic bloat.

Source of truth is plugins/spectre/agents/*.md; generated TOML is derived output.

Procedure

1. Inventory The Agent

Record:

  • name, description, tools, codex_sandbox_mode, model, and body line/token size.
  • Whether the role is read-only, write-capable, or ambiguous.
  • Current generated Codex name, description, sandbox_mode, and developer_instructions if present.
  • Known risks from the research doc: chatty description, write access on read-only role, generic capability catalog, mandatory artifact writes, missing return contract, or context-sharing assumptions.
2. Classify The Role

Choose one primary role and make the rewrite fit it:

  • locator: finds files/areas; returns grouped paths only.
  • analyst: explains how code works; returns cited implementation facts.
  • pattern-miner: finds reusable examples; returns 2-5 examples and recommendation.
  • reviewer: identifies risks/findings; returns severity-ranked findings first.
  • tester: writes or verifies tests; decide whether it is write-capable or read-only.
  • implementer: writes code; may edit files and run commands.
  • web-briefer: verifies current/third-party facts; returns sourced findings.

If a source agent mixes roles, flag the split decision instead of silently broadening it.

3. Block Triage

Walk the source top to bottom. For each block, assign one verdict:

  • KEEP: changes behavior measurably.
  • CUT: persona filler, generic expertise, tutorials, marketing, jokes, or capability catalogs the model already knows.
  • CONTRACT: restate as mission, inputs, boundaries, method, or return contract.
  • PERMISSION: move to tools/sandbox/model decision.
  • REFERENCE: preserve only by linking to an existing reference doc.

Keep specifics that define behavior: routing triggers, scope boundaries, least-privilege tools, citations, exact output schema, empty-result behavior, verification commands, artifact paths, and "do not write" constraints.

4. Draft The Agent Contract

Use this shape unless the existing agent has a stronger local convention:

markdown
---
name: <agent>
description: <one or two sentences: trigger, boundary, return type>
tools: <least-privilege tool list>
codex_sandbox_mode: <read-only|workspace-write>
model: <model if intentionally set>
---

You are a focused <role>. <One sentence mission.>

## Mission
<What this agent produces, not a broad capability list.>

## Inputs Expected
- <files/diff/range/task/error/source constraints expected from parent>

## Boundaries
- <what to do>
- <what not to do, especially write/no-write and no nested delegation>

## Method
- <only role-specific heuristics and failure-mode guards>

## Return Contract
<compact schema; include citations, uncertainty, empty-result behavior, and max summary size if useful>

Description rules:

  • Put all trigger and "do not use when" information in the frontmatter description.
  • Be specific, not long.
  • Remove jokes, sales language, and second-person coaching.

Tool rules:

  • Read-only roles default to Read, Grep, Glob, LS and codex_sandbox_mode: read-only.
  • Web research adds web tools only.
  • Implementers/test authors may use write/edit/bash and workspace-write.
  • If a role sometimes writes and sometimes verifies, flag whether to split it.

Return rules:

  • Require compact, structured output.
  • Require file:line for code claims.
  • Require links/version/date notes for web claims.
  • State what to return when no findings or no matches are found.
Show full SKILL.md (248 more words)Show less
5. Write The Observability Trail

In proposal mode, write one artifact per agent:

docs/tasks/spectre-light/proposals/agents/<agent>.rewrite.md

Create the directory if needed. The artifact must contain:

  1. # Subagent Rewrite Proposal: <agent>
  2. ## Inventory
  3. ## Role Classification
  4. ## Block Triage with | source block | verdict | reason |
  5. ## Permission Decision
  6. ## Proposed Agent Definition as a fenced Markdown block
  7. ## Stripped Block Ledger with | stripped block | this prevented/claimed | replacement |
  8. ## Load-Bearing Coverage with | item | where it lives now |
  9. ## Self-Check
  10. ## Open Questions

Do not overwrite live agent files in proposal mode.

6. Apply Only On Explicit Request

When applying:

  1. Edit only plugins/spectre/agents/<agent>.md source files.
  2. Regenerate Codex output with npm run sync-codex.
  3. Verify generated output with npm run sync-codex -- --check --quiet.
  4. Run targeted tests if translator/config behavior changed; otherwise run the smallest relevant verification.
  5. Do not hand-edit plugins/spectre-codex/agents/*.toml except to inspect diffs.

Self-Check

For each rewritten agent, report pass/fail:

  • Description names trigger, boundary, and return type.
  • Body has Mission, Inputs Expected, Boundaries, Method, Return Contract.
  • Read-only roles have no Write, Edit, or Bash, and use codex_sandbox_mode: read-only.
  • Write-capable roles justify write access.
  • No generic capability catalog remains.
  • No casual/promotional language remains.
  • No nested subagent delegation is requested.
  • Claims require citations or source links as appropriate.
  • Empty-result behavior is specified.
  • Generated Codex TOML matches source when apply mode was used.

Output To User

Return:

  1. Files written or changed.
  2. Key rewrite decisions, especially permissions and role splits.
  3. Self-check result.
  4. Open questions that need human review before applying.

© joenandez, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/spectre-rewrite-subagent of joenandez/spectre.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit 931c9e8

Compare with similar skills

Spectre Rewrite Subagent next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Spectre Rewrite Subagent compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Spectre Rewrite Subagent this skilljoenandez/spectre164—~1.8kAutomated safety check: PassMIT
Claude Code Agent Developmentanthropics/claude-plugins-official38k7 repos~2.8kAutomated safety check: PassApache-2.0
Subagent Driven DevelopmentAsvarox/allkaraoke26137 repos~1.2kAutomated safety check: PassNone
Dispatching Parallel Agentsultralisp/ultralisp25840 repos~1.5kAutomated safety check: PassNone
Paseo Advisor Second Opiniongetpaseo/paseo20k1 repos~756Automated safety check: PassCustom licence
Task Observerrebelytics/one-skill-to-rule-them-all3.2k1 repos~11kAutomated safety check: PassCC-BY-4.0

Similar skills

  • Claude Code Agent Development

    anthropics/claude-plugins-official

    Official

    Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.

    38k GitHub starsUsed in 7 repos~2.8k tokens
    Agent WorkflowsAuto-check passed
  • Subagent Driven Development

    Asvarox/allkaraoke

    A skill your agent uses when executing implementation plans with independent tasks in the current session

    261 GitHub starsUsed in 37 repos~1.2k tokens
    Agent WorkflowsAuto-check passed
  • Dispatching Parallel Agents

    ultralisp/ultralisp

    A skill your agent uses when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

    258 GitHub starsUsed in 40 repos~1.5k tokens
    Agent WorkflowsAuto-check passed
  • Launches one separate agent through Paseo to give a second opinion on the current task, with a self-contained briefing and no permission to edit files.

    20k GitHub starsUsed in 1 repo~756 tokens
    Agent WorkflowsAuto-check passed
  • Task Observer

    rebelytics/one-skill-to-rule-them-all

    Monitors task execution for skill improvement opportunities.

    3.2k GitHub starsUsed in 1 repo~11k tokens
    Agent WorkflowsAuto-check passed
  • O2 Review Loop

    openobserve/openobserve

    Splits a change into planner, coder and independent reviewer roles: you confirm a spec, a subagent implements it, and a separate reviewer checks each round's local WIP commit.

    22k GitHub stars~3.7k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from joenandez/spectre

All 26 skills in this repo
  • Verify Spectre

    joenandez/spectre

    A skill your agent uses when validating that the Spectre plugin itself still works after ANY change to this repo — skills, prompts, agents, hooks, the CLI, the Codex mirror, or a release.

    164 GitHub stars~1.5k tokensUpdated 8 days ago
    Auto-check passed
  • A skill your agent uses when modifying the Codex SPECTRE install flow, SessionStart continuity, project skill syncing, registry injection, or Codex-specific runtime files.

    164 GitHub stars~2.2k tokensUpdated 8 days ago
    Auto-check passed
  • Spectre Handoff

    joenandez/spectre

    Save a quiet, branch-keyed session snapshot with continuity, active work, and optional task/todo state for automatic resume.

    164 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Spectre Learn

    joenandez/spectre

    User-invoked front door for durable capture. An agent skill from joenandez/spectre.

    164 GitHub stars~1k tokensUpdated 8 days ago
    Auto-check passed
  • Spectre Rewrite Skill

    joenandez/spectre

    Rewrite a verbose SPECTRE skill into a compact, contract-form Spectre skill proposal — clear on WHAT, silent on HOW — grounded in the spectre-light distillation and freedom-tier budget.

    164 GitHub stars~3k tokensUpdated 8 days ago
    Auto-check passed
  • Spectre Capture

    joenandez/spectre

    Capture durable project decisions, accepted corrections, verified reusable patterns or gotchas, disproved guidance, and changed persistent blockers as soon as they matter.

    164 GitHub stars~1.2k tokensUpdated 8 days ago
    Auto-check passed

Categories

Questions about Spectre Rewrite Subagent

What does Spectre Rewrite Subagent do?

Rewrite Spectre subagent definitions into compact, contract-driven agents with clear routing, least-privilege tools, output schemas, and an auditable rewrite trail. Spectre Rewrite Subagent is an agent skill from joenandez/spectre. Rewrite Spectre subagent definitions into compact, contract-driven agents with clear routing, least-privilege tools, output schemas, and an auditable rewrite trail.

When should I use Spectre Rewrite Subagent?

Spectre Rewrite Subagent fits situations like: rewriting plugins/spectre/agents/.md; the user asks to improve subagents/agent definitions; checking generated plugins/spectre-codex/agents/.toml; rewriting workflow skills.

How do I install Spectre Rewrite Subagent in Claude Code?

Run `npx skills add joenandez/spectre --skill spectre-rewrite-subagent -a claude-code`. Or copy the skill folder (.agents/skills/spectre-rewrite-subagent in joenandez/spectre) into .claude/skills/spectre-rewrite-subagent in your project. Claude Code loads it when a task matches its description.

How do I install Spectre Rewrite Subagent in Codex?

Run `npx skills add joenandez/spectre --skill spectre-rewrite-subagent -a codex`. Or copy the skill folder (.agents/skills/spectre-rewrite-subagent in joenandez/spectre) into .agents/skills/spectre-rewrite-subagent in your project. Codex loads it when a task matches its description.

Can I use Spectre Rewrite Subagent in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add joenandez/spectre --skill spectre-rewrite-subagent -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/spectre-rewrite-subagent, .gemini/skills/spectre-rewrite-subagent, .github/skills/spectre-rewrite-subagent and .opencode/skills/spectre-rewrite-subagent in your project.

What does Spectre Rewrite Subagent need to run?

Going by SKILL.md and its folder, Spectre Rewrite Subagent needs the command-line tools its instructions call (npm).

Does Spectre Rewrite Subagent access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Spectre Rewrite Subagent safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Spectre Rewrite Subagent use?

Spectre Rewrite Subagent is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Spectre Rewrite Subagent use?

About 1.8k tokens (SKILL.md is roughly 7.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Spectre Rewrite Subagent?

Skills that share tags, products or a category with Spectre Rewrite Subagent: Claude Code Agent Development (anthropics/claude-plugins-official, 38k stars), Subagent Driven Development (Asvarox/allkaraoke, 261 stars), Dispatching Parallel Agents (ultralisp/ultralisp, 258 stars) and Paseo Advisor Second Opinion (getpaseo/paseo, 20k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Spectre Rewrite Subagent?

joenandez (a GitHub user) maintains it in joenandez/spectre, which has 164 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on October 2, 2026.

Source: joenandez/spectre on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.