From haiku
Discovers hats and workflows from plugin and project files via YAML parsing and bash, displays options with recommendations, and selects workflow for H·AI·K·U coding intent.
npx claudepluginhub gigsmart/haiku-method --plugin haikuThis skill uses the workspace's default tool permissions.
Composable sub-skill for discovering available hats, presenting workflow options, and selecting the workflow for an intent. Used by single-stage and stage-elaborate mode sub-skills.
Starts new H·AI·K·U intents via /haiku:new with studio detection, workspace init, git repo checks, and --template support for parameter-substituted unit creation.
Composes valid looplia v0.7.0 workflow YAML/Markdown files from skill recommendations and user preferences. Final step for /build commands, workflow creation, or automation pipelines.
Routes HF workflows by deciding direct leaf skill invocation versus route-first to hf-workflow-router for new sessions, /hf-* commands, and uncertain entry points.
Share bugs, ideas, or general feedback.
Composable sub-skill for discovering available hats, presenting workflow options, and selecting the workflow for an intent. Used by single-stage and stage-elaborate mode sub-skills.
This sub-skill runs inline — it has access to AskUserQuestion and the full conversation context.
INTENT_SLUG — the intent slugAUTONOMOUS_MODE — true or falseSTAGE_CONSTRAINT (optional) — if set, constrains available workflows to those listed in the active stage's available_workflows field. Empty for single-stage mode.Read all available hat definitions dynamically by parsing YAML frontmatter from hat files:
# List all hats from plugin directory
for hat_file in "${CLAUDE_PLUGIN_ROOT}/hats/"*.md; do
[ -f "$hat_file" ] || continue
slug=$(basename "$hat_file" .md)
name=$(sed -n '/^---$/,/^---$/{ /^name:/s/^name: *//p }' "$hat_file" 2>/dev/null)
desc=$(sed -n '/^---$/,/^---$/{ /^description:/s/^description: *//p }' "$hat_file" 2>/dev/null)
echo "- **${name:-$slug}** (\`$slug\`): $desc"
done
# Also check for project-local hat overrides
for hat_file in .haiku/hats/*.md; do
[ -f "$hat_file" ] || continue
slug=$(basename "$hat_file" .md)
name=$(sed -n '/^---$/,/^---$/{ /^name:/s/^name: *//p }' "$hat_file" 2>/dev/null)
desc=$(sed -n '/^---$/,/^---$/{ /^description:/s/^description: *//p }' "$hat_file" 2>/dev/null)
echo "- **${name:-$slug}** (\`$slug\`): $desc [project override]"
done
Display the available hats to the user so they can see what's available for workflow composition.
Read workflows from plugin defaults and project overrides:
# Plugin workflows (defaults)
cat "${CLAUDE_PLUGIN_ROOT}/workflows.yml"
# Project workflow overrides (if any)
[ -f ".haiku/workflows.yml" ] && cat ".haiku/workflows.yml"
If STAGE_CONSTRAINT is set: filter the discovered workflows to only those whose names appear in the STAGE_CONSTRAINT list. This ensures stage-specific elaboration only offers workflows appropriate for the active stage's discipline.
Show the user all predefined workflows and available hats:
## Available Workflows
{List each predefined workflow with its hat sequence, from Step 2}
## Available Hats
{List each hat with its slug and one-line description, from Step 1}
Analyze the intent against the available options. Consider:
Present your recommendation with reasoning:
## Recommendation
**{workflow name or "Custom"}**: {hats as arrows}
{1-2 sentences explaining why this fits the intent. Reference specific aspects of what the user described.}
Autonomous mode: Use the recommended workflow directly. Run the recommendation logic, then apply it without asking. Skip to output.
Interactive mode: Use AskUserQuestion with the predefined workflows as options. Do NOT hardcode options — use the workflows discovered in Step 2:
{
"questions": [{
"question": "Which workflow would you like to use?",
"header": "Workflow",
"options": [
{"label": "{recommended} (Recommended)", "description": "{hats as arrows}"},
{"label": "{workflow2}", "description": "{hats as arrows}"},
{"label": "{workflow3}", "description": "{hats as arrows}"},
{"label": "Custom", "description": "Tell me which hats to use and in what order"}
],
"multiSelect": false
}]
}
If your recommendation is a custom composition, include it as the first option with "(Recommended)". The predefined workflows still appear as alternatives.
If the user selects "Custom", ask them to specify which hats to include and in what order.
The selected workflow name and hat sequence are carried forward to the calling mode sub-skill for writing into intent.md frontmatter.