/ .opencode / index.js
index.js
 1  // WARNING: GENERATED -- DO NOT EDIT DIRECTLY
 2  // Source: .agents/
 3  // Regenerate: ./scripts/generate-agents.sh
 4  
 5  // Commands registered from .agents/commands/
 6  const COMMANDS = {
 7    "brainstorm": "@planner: Requirements are unclear. Run a brainstorm.\n\nFollow .cursor/rules/dotfiles-brainstorm.mdc: explore context (etc/, nvim/, wezterm/, tasks/, scripts/); ask clarifying questions one at a time; propose 1-2 approaches with trade-offs; get user approval; then transition to writing the implementation plan (.cursor/rules/dotfiles-plan.mdc). Do not edit config or taskfiles until the approach is approved and the plan exists.",
 8    "execute-plan": "@planner: Execute the current plan in .agents/plans/.\n\nFollow .cursor/rules/dotfiles-core.mdc (execute flow): read the plan; for each task delegate to @config or @taskfile with the full task text; after each task confirm work matches the plan, then @code-reviewer (what implemented, plan ref, BASE_SHA, HEAD_SHA). After all tasks: run @pre-commit-run (e.g. task precommit), then follow .cursor/rules/dotfiles-git.mdc for finish-branch options.",
 9    "finish-branch": "@planner: Finish the current branch.\n\nFollow .cursor/rules/dotfiles-git.mdc: (1) Run @pre-commit-run (e.g. `task precommit` or scripts/hooks/pre-commit); if it fails, show failures and fix first. (2) Determine base branch. (3) Present exactly four options: merge locally, push and create PR, keep branch as-is, discard (require explicit confirmation for discard). (4) Execute the user's choice; clean up worktree if merging or discarding. Rule reference: dotfiles-git.mdc. Skill: pre-commit-run.",
10    "kickoff": "@planner: Task: [Describe your change, e.g. \"Add wezterm keybinding for X\" or \"Add new task to Taskfile\"]\n\nFollow dotfiles workflow from .cursor/rules/dotfiles-core.mdc. Plan with bite-sized tasks → implement (config or taskfile) → @code-reviewer after each task. At completion: run `task precommit` then finish-branch options.",
11    "request-code-review": "@code-reviewer: Review the current changes.\n\nProvide: **What was implemented** (brief description), **Plan reference** (e.g. .agents/plans/YYYY-MM-DD_user_slug.plan.md Task N), **BASE_SHA**, **HEAD_SHA**. Code Reviewer will check style and plan adherence; may suggest @pre-commit-run (e.g. task precommit). See .agents/agents/code-reviewer.md for request template.",
12    "systematic-debugging": "@planner: We have a bug or broken behavior. Run systematic debugging.\n\nFollow .cursor/rules/dotfiles-debug.mdc: Phase 1 (root cause) - read errors/logs; reproduce; check recent changes (git diff, config in etc/nvim/wezterm/tasks, env); narrow where it fails. Phase 2 (pattern) - compare with working examples. Phase 3 (hypothesis) - one clear hypothesis; test minimally. Phase 4 (fix) - only after root cause: minimal fix; verify. Do not suggest fixes before Phase 1 is complete. Rule reference: dotfiles-debug.mdc.",
13    "write-plan": "@planner: Write the implementation plan for the current task/request.\n\nFollow .cursor/rules/dotfiles-plan.mdc: break work into small tasks (2-5 min each) with exact paths (etc/, nvim/, wezterm/, tasks/, scripts/) and commands. Save plan to .agents/plans/ with naming YYYY-MM-DD_<username>_<slug>.plan.md. Do not implement yet; next step is execute-plan or delegate per task. Rule reference: dotfiles-plan.mdc.",
14  };
15  
16  export default async (_ctx) => ({
17    "command.execute.before": async (input, output) => {
18      const content = COMMANDS[input.command];
19      if (content) {
20        output.parts.push({ type: "text", text: content });
21      }
22    },
23    "experimental.session.compacting": async (_input, output) => {
24      output.context.push(
25        "Gate check: before continuing, validate all work against the active plan in .agents/plans/ or .cursor/plans/. " +
26          "Every implementation task must be plan-aligned. Invoke @planner to validate if unsure."
27      );
28    },
29  });