(Internal) Return to the previous hat in the AI-DLC workflow (e.g., reviewer finds issues)
Reverts to the previous workflow stage when issues are found during AI-driven construction.
/plugin marketplace add https://www.claudepluginhub.com/api/plugins/thebushidocollective-ai-dlc/marketplace.json/plugin install thebushidocollective-ai-dlc@cpd-thebushidocollective-ai-dlcjutsu-ai-dlc:fail - Return to the previous hat in the AI-DLC workflow.
/fail
Internal command - Called by the AI during /construct, not directly by users.
Goes back to the previous hat in the workflow. Typically used when:
If already at the first hat (elaborator by default), this command is blocked.
// Intent-level state is stored on current branch (intent branch)
const state = JSON.parse(han_keep_load({ scope: "branch", key: "iteration.json" }));
const workflow = state.workflow || ["elaborator", "planner", "builder", "reviewer"];
const currentIndex = workflow.indexOf(state.hat);
const prevIndex = currentIndex - 1;
if (prevIndex < 0) {
// Already at first hat - cannot go back
return "Cannot fail before the first hat (elaborator).";
}
const prevHat = workflow[prevIndex];
Before updating state, save the reason for failing:
// Append to blockers (unit-level state - saved to current branch)
const reason = "Reviewer found issues: [describe issues]";
han_keep_save({
scope: "branch",
key: "blockers.md",
content: reason
});
state.hat = prevHat;
// Intent-level state saved to current branch (intent branch)
han_keep_save({
scope: "branch",
key: "iteration.json",
content: JSON.stringify(state)
});
Output:
Returning to **{prevHat}** hat.
**Reason:** {reason}
Continuing construction with the previous hat...
If already at the first hat (elaborator by default), output:
You are at the first hat (elaborator).
Cannot go back further. Continue elaboration or use `/reset` to start over.