prompt-structurer
Convert prose prompts into compact, structured XML prompts through staged subagent passes. Use when a user asks to structure, harden, formalize, debug, or convert a prompt; mentions XML tags, agent drift, ambiguity, hidden assumptions, success criteria, anti-patterns, autonomous prompts, or prompt suites; or provides natural-language instructions that need to become a reliable agent contract.
What this skill does
# Prompt Structurer Prompt Structurer is a portable orchestration skill for turning prose prompts into executable XML prompt contracts. The orchestrator preserves intent, selects the smallest deterministic analysis flow, dispatches specialized passes, and returns a final prompt with concise assembly notes. The package is self-contained: bundled subagents and references are enough to run without network access. External URLs are optional just-in-time background sources that replace long static explanations in the skill files. ## Inputs | Input | Required | Example | | ----- | -------- | ------- | | `PROMPT_TEXT` | Yes | Prose prompt, instruction block, or prompt-suite entry to structure | | `RUN_STYLE` | No | `interactive`, `autonomous`, or unknown | | `SUITE_CONTEXT` | No | Existing structured prompts or shared suite conventions | | `TERMINOLOGY` | No | Terms to preserve exactly, such as `issue key`, `subagent`, or `ledger` | | `CHANGE_REQUEST` | No | Specific revision requested for an existing structured prompt | Ask one targeted clarifying question only when the missing answer would change the final prompt contract. ## Output Contract Return the final XML prompt first, then assembly notes with assumptions, sections omitted, resources fetched, `LOCAL_ONLY` or `RATIONALE_OMITTED` when no URL was fetched, and suggested follow-ups. Preserve user terminology unless the user requested renaming. ## Subagent Registry | Pass | Subagent | Path | Produces | | ---- | -------- | ---- | -------- | | 1 | `semantic-decomposer` | `./subagents/semantic-decomposer.md` | Sentence-to-category map and source-preservation notes | | 2 | `philosophy-constraints-classifier` | `./subagents/philosophy-constraints-classifier.md` | Philosophy, constraints, hard rules, and ambiguities | | 3 | `implicit-behavior-surfacer` | `./subagents/implicit-behavior-surfacer.md` | Ambiguity, autonomy, gate, empty-output, and traceability gaps | | 4 | `anti-pattern-synthesizer` | `./subagents/anti-pattern-synthesizer.md` | Plausible wrong paths and matching negative criteria | | 5 | `success-criteria-builder` | `./subagents/success-criteria-builder.md` | Observable post-run checklist and coverage gaps | | 6 | `xml-prompt-assembler` | `./subagents/xml-prompt-assembler.md` | Routeable result status, final XML prompt, and assembly notes | Read a subagent file only when dispatching that pass. ## Pass Status Contract Every dispatched pass returns a first-line status: ```markdown RESULT: PASS | BLOCKED | FAIL | ERROR ``` Route on that line only. `PASS` means the pass completed and its named output sections are safe for downstream use. `BLOCKED` means required input is missing. `FAIL` means the pass completed but found contradictions or unauditable content that prevents reliable assembly. `ERROR` means an unexpected tool, filesystem, or runtime failure occurred. When `xml-prompt-assembler` returns `RESULT: PASS`, strip that internal status from the user-facing response and return the XML prompt first. For `light` or `revision` flows, pass an `OMITTED_PASS_REASON` for every skipped upstream pass so the assembler can distinguish intentional omission from missing input. ## Flow Selection Evaluate flows in this order and choose the first matching flow. | Precedence | Flow | Use When | Dispatches | | ---------- | ---- | -------- | ---------- | | 1 | `revision` | `CHANGE_REQUEST` targets an existing structured prompt | Affected analysis pass(es), required prerequisites, then pass 6 | | 2 | `suite` | `SUITE_CONTEXT` must govern conventions | `full`, with shared suite blocks passed into every pass | | 3 | `full` | Prompt is multi-phase, autonomous, safety-sensitive, or repeatedly failing | All passes in order | | 4 | `light` | None of the higher-precedence triggers apply and the prompt is a short one-shot with low autonomy risk | Passes 1 and 6 | In `suite` flow, include `SUITE_CONTEXT` in every pass payload. Each pass preserves suite-level terminology, tag conventions, shared constraints, tone, and output conventions unless they conflict with the user's prompt-specific request. Surface conflicts as `BLOCKED` when a missing user choice is needed or `FAIL` when the suite and prompt cannot both be honored. ## Progressive Loading Map | Need | Load | | ---- | ---- | | Tag selection or tag naming | `./references/tag-taxonomy.md` | | Edge cases, agent drift, autonomy, gates, or wrong-path risks | `./references/failure-modes.md` | | Final XML section order and removal test | `./references/template-skeleton.md` | | Source-backed rationale, current vendor guidance, or progressive-disclosure background | `./references/web-resource-index.md`, then fetch at most one targeted URL when needed and permitted | Use local references first. Fetch a web resource only when the local package is insufficient for the current decision, the user asks for source-backed rationale, or model/platform guidance may have changed, and network access is available and permitted. Record `LOCAL_ONLY` when bundled references are sufficient or no external rationale is needed; record `RATIONALE_OMITTED` when current external rationale is needed but cannot be fetched. ## How This Skill Works The orchestrator does exactly three things: - Coordinate: capture inputs, choose a flow, and route passes. - Dispatch: send each pass the original prompt, selected flow, resource status, suite context when present, relevant prior outputs, and any intentional omission reasons. - Synthesize: hand compact findings to the assembler and return the final prompt. Subagents perform analysis and return structured findings. The orchestrator keeps summaries, statuses, fetched URLs, and user-facing decisions, not raw analysis transcripts. ## Execution 1. Capture `PROMPT_TEXT`, explicit constraints, run style, suite context, and change request. 2. Reject contradictions that change task meaning with `FAIL` and the smallest targeted clarification. 3. Resolve source needs with the local-first policy above before flow selection. 4. Choose `revision`, `suite`, `full`, or `light` using the precedence table. 5. For `revision`, confirm the existing XML prompt and baseline content are sufficient, confirm `CHANGE_REQUEST` stays in scope and preserves task meaning, identify the affected pass range, and rerun any required upstream prerequisites before affected passes. 6. Dispatch passes in pipeline order, loading only the current subagent file. 7. Read the first `RESULT:` line from each pass. If a subagent returns `BLOCKED`, `FAIL`, or `ERROR`, surface the matching status and ask the smallest useful question or recovery action. 8. Dispatch `xml-prompt-assembler` with the completed pass outputs, selected `FLOW`, source/resource status, and any `OMITTED_PASS_REASON` values. 9. Check the result against the run-level success criteria below. 10. When criteria fail, map each failure to the earliest affected pass, rerun that pass and downstream dependent passes, and preserve unaffected sections. Stop after three fix cycles with `REPAIR_NEEDED`. ## Run-Level Success Criteria - Meaningful source content and governing suite conventions are represented, intentionally split, or explicitly omitted with justification. - Each emitted XML tag changes agent behavior if removed. - Constraints, anti-patterns, and success criteria audit the same behaviors. - Any status, gate, retry, or escalation behavior in the source prompt is represented as routeable contract language. - Assembly notes list assumptions, omitted sections, fetched resources or `LOCAL_ONLY`/`RATIONALE_OMITTED`, and follow-up options. - Progressive disclosure was preserved: no subagent, reference, or URL was loaded before it was needed. - Terminal status is one of `PASS`, `BLOCKED`, `FAIL`, `ERROR`, or `REPAIR_NEEDED`. ## Example Input: `Structure this prompt so an agent audits Jira tickets, records findings, and does not change code.` Round trip: 1. The orchestrator selects `full` because report-
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.