// engine/universal-rules/rules/planu-modes.ts — SPEC-779
// Universal rule: Claude Code Mode Hints per spec phase (SPEC-494)
function buildBody(host) {
    if (host === 'claude-code') {
        return `# Claude Code Mode Hints (MANDATORY — Planu SDD)

Auto-generated by \`init_project\`. Do not edit manually.

## Mode per Spec Phase

When the user moves a spec to a new status, suggest the matching Claude Code permission mode.
Never suggest bypassPermissions — it disables all safety checks.

| Spec Status | Suggested Mode | When to use |
|-------------|---------------|-------------|
| \`draft\` | \`default\` | Spec not yet approved — always ask before changes |
| \`review\` | \`default\` | Under review — user must confirm before edits |
| \`approved\` | \`plan\` | Spec is the contract — use plan mode to review before coding |
| \`implementing\` | \`acceptEdits\` | Spec is the contract — auto-accept file edits, bash still asks |
| \`done\` | \`default\` | Implementation complete — back to safe default |

## How to apply

- After \`update_status\` returns \`suggestedClaudeMode\`, relay it to the user: "I recommend switching to \`/mode <mode>\`"
- NEVER switch modes automatically — always tell the user and let them decide
- Critical bash actions (git push, npm publish, rm -rf) require approval regardless of mode
`;
    }
    // Generic fallback for codex / gemini
    return `# Planu Mode Hints

Auto-generated by \`init_project\`.

## Mode per Spec Phase

| Spec Status | Suggested Behavior |
|-------------|-------------------|
| \`draft\` | Ask before making changes |
| \`review\` | Confirm with user before edits |
| \`approved\` | Review changes with user before applying |
| \`implementing\` | Apply file edits automatically, confirm bash commands |
| \`done\` | Back to default cautious mode |

## How to apply

- After \`update_status\` completes, suggest the appropriate mode to the user
- NEVER switch modes automatically — always inform the user first
`;
}
export const planuModesRule = {
    id: 'planu-modes',
    name: 'Planu Mode Hints',
    description: 'Per-spec-phase mode suggestions for Claude Code and other LLM clients.',
    category: 'workflow',
    applicableHosts: ['all'],
    defaultEnabled: true,
    buildContent: buildBody,
};
//# sourceMappingURL=planu-modes.js.map