--- name: ase-meta-workflow argument-hint: "[--help|-h] [--scope|-s local|user] [--force|-f] " description: > Generate a new agent tool skill, written in the style of ASE skills, which orchestrates a workflow of sequential actions, parallel actions, sub-agent calls, and skill calls. Use when the user wants to "generate a skill", create a "workflow", "orchestrate" or "chain" multiple ASE skills, or automate a recurring multi-step procedure. user-invocable: true disable-model-invocation: false effort: xhigh allowed-tools: - "Read" - "Write" --- @${CLAUDE_SKILL_DIR}/../../meta/ase-control.md @${CLAUDE_SKILL_DIR}/../../meta/ase-skill.md @${CLAUDE_SKILL_DIR}/../../meta/ase-getopt.md Generate a Workflow Skill $ARGUMENTS *Generate* a new skill for the current *agent tool* , written in the style of *ASE* skills, which orchestrates the workflow described by: References ---------- - The following is a *reference skill* demonstrating the usual *layout* of a generated workflow skill -- its frontmatter, its `ase util meta` preamble, and the indentation of its ``: @${CLAUDE_SKILL_DIR}/sample.md *IMPORTANT*: is authoritative for the usual *layout* only. The *syntax* of every control construct is defined *exclusively* by the `Control Flow Constructs` section above, and its frontmatter and preamble show the `claude` flavor only -- the actual frontmatter fields and the actual preamble are dispatched on as defined by the `Generated Skill Contract` below. - The following is the *ASE workflow graph*, carrying one ` -> ` transition per line, where each side is either an `ase-xxx-xxx` skill or an upper-case logical state (`START`, `SKETCH`, `APPROACHES`, `TASK`, `ARTIFACT`, `END`): @${CLAUDE_SKILL_DIR}/workflow.txt The tells which ASE skill sequences are *usually meaningful*. It *guides* the workflow, but it does *not* restrict it: a workflow may contain arbitrary *non-ASE* actions, and it may contain ASE transitions the does not list. - The following is the *accumulated help* of all ASE skills -- the concatenation of every skill's `help.md` file -- and is the *sole* source for the options and arguments of every `` invocation (for an `ase-xxx-xxx` skill) you emit: @${CLAUDE_SKILL_DIR}/../ase-help-intent/data.md Generated Skill Contract ------------------------ A generated skill is a *regular* skill of the current agent tool which is *independent* of the *ASE plugin* installation path. It therefore *MUST* strictly follow this contract: - **Frontmatter**: `name: ` and a `description` of one to three sentences summarizing the workflow and its trigger phrases. The *remaining* frontmatter fields are *tool-specific*, because every agent tool accepts its own field set and its own `allowed-tools` grammar, and hence have to be dispatched on : Emit *only* an `allowed-tools` field, carrying the space-separated string `Bash(ase util meta *)`, because *OpenAI Codex* accepts *no* frontmatter fields besides `name`, `description`, `license`, `allowed-tools`, and `metadata`. Emit an `argument-hint` derived from the declared options and arguments, plus `user-invocable: true`, `disable-model-invocation: false`, and an `allowed-tools` list which *always* contains `"shell(ase:*)"` plus any further tool the workflow actually uses. *IMPORTANT*: *GitHub Copilot* uses the permission pattern grammar `shell(:*)`, `write()`, and `()` -- a `Bash(...)` entry would be misread as an unknown MCP server, and plain tool names like `Skill` or `Agent` are *no* permission patterns at all and hence *MUST NOT* be emitted. Emit an `argument-hint` derived from the declared options and arguments, plus `user-invocable: true`, `disable-model-invocation: false`, and an `allowed-tools` list which *always* contains `"Bash(ase util meta *)"` plus `"Skill"` and/or `"Agent"` whenever the workflow emits `` and/or `` invocations, plus any further tool the workflow actually uses. - **Preamble**: the generated skill has to pull in the ASE meta definitions through the `ase util meta` command, because it resolves them from the bundled tool package, whereas the `@${CLAUDE_SKILL_DIR}/../../meta/` includes used *inside* the ASE plugin have *no* resolvable path from outside of it. Append further meta names only when the workflow needs them (`dialog` for a `custom-dialog`, `tenets`, `format-task`, ...). *How* the command is pulled in is *tool-specific*, because only *Anthropic Claude Code* expands the ``!`` `` construct before the skill content reaches the model, hence dispatch on : Emit the following as the first body element, because the ``!`` `` construct would otherwise reach the model *verbatim* and silently stay unexpanded: *IMPORTANT*: *Before* anything else, run the shell command... `ase util meta control skill getopt` ...and treat its *entire* output as if it were written here. It defines the control flow constructs, the skill conventions, and the option parsing used below. Do *not* proceed before you have done this. Emit the *single* line ``!`ase util meta control skill getopt` `` as the first body line. - **Identification**: a `` block carrying a short title-case purpose. - **Argument Parsing**: an `$ARGUMENTS` block -- but *only* when the workflow wants to declare options. - **Objective**: an optional `` block declaring the official objective of the workflow skill. - **Body**: usually the `` derived in `STEP 3` below. But everything is allowed here. Procedure --------- 1. 1. Set to the *first* whitespace-separated token of and to the *entire remainder*. Do not output anything. 2. Ask the user interactively, without a special tool, for the skill name with a single question: `**No valid skill name given. What should the generated skill be named?**` Then set to the response of the user and set to the *entire* original . Repeat this question until the response matches the regexp `^[a-z][a-z0-9-]*$`, so that no path separator or traversal segment can ever reach . 3. Ask the user interactively, without a special tool, for the workflow with a single question: `**No workflow description yet. Which workflow should the skill perform?**` Then set to the response of the user. 4. Determine the *skill locations* of the current agent tool, because every agent tool discovers its skills in its *own* directories: ~/.claude/skills .claude/skills ~/.copilot/skills .github/skills ~/.codex/skills .agents/skills Set . Set . Expand a leading `~` in into the absolute home directory of the user, resp. resolve a relative against the root directory of the current project, as the file tools accept absolute paths only. Then set //SKILL.md. Do not output anything. 5. Check whether already exists. Only output the following