From c194257dac37393ed22224114bf9f2e7dc050e2a Mon Sep 17 00:00:00 2001 From: cte Date: Thu, 8 Jan 2026 00:35:09 -0800 Subject: [PATCH] feat(cli): add # shortcut for task history in help trigger --- .roo/commands/commit.md | 53 +++++++++++++++++++ .../autocomplete/triggers/HelpTrigger.tsx | 1 + .../triggers/__tests__/HelpTrigger.test.tsx | 3 +- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .roo/commands/commit.md diff --git a/.roo/commands/commit.md b/.roo/commands/commit.md new file mode 100644 index 0000000000..64bc115854 --- /dev/null +++ b/.roo/commands/commit.md @@ -0,0 +1,53 @@ +--- +description: "Commit current changes with a descriptive message" +argument-hint: "[optional-context]" +mode: code +--- + +1. Analyze the current changes to understand what needs to be committed: + + ```bash + # Check for staged and unstaged changes + git status --short + + # View the diff of all changes (staged and unstaged) + git diff HEAD + ``` + +2. Based on the diff output, formulate a commit message following conventional commit format: + + - **feat**: New feature or functionality + - **fix**: Bug fix + - **refactor**: Code restructuring without behavior change + - **docs**: Documentation changes + - **test**: Adding or updating tests + - **chore**: Maintenance tasks, dependencies, configs + - **style**: Formatting, whitespace, no logic changes + + Format: `type(scope): brief description` + + Examples: + + - `feat(api): add user authentication endpoint` + - `fix(ui): resolve button alignment on mobile` + - `refactor(core): simplify error handling logic` + - `docs(readme): update installation instructions` + +3. Stage all unstaged changes: + + ```bash + git add -A + ``` + +4. Commit with the generated message: + + ```bash + git commit -m "type(scope): brief description" + ``` + +**Tips for good commit messages:** + +- Keep the first line under 72 characters +- Use imperative mood ("add", "fix", "update", not "added", "fixes", "updated") +- Be specific but concise +- If multiple unrelated changes exist, consider splitting into separate commits diff --git a/apps/cli/src/ui/components/autocomplete/triggers/HelpTrigger.tsx b/apps/cli/src/ui/components/autocomplete/triggers/HelpTrigger.tsx index c029bc8031..fe6b25ceb1 100644 --- a/apps/cli/src/ui/components/autocomplete/triggers/HelpTrigger.tsx +++ b/apps/cli/src/ui/components/autocomplete/triggers/HelpTrigger.tsx @@ -20,6 +20,7 @@ const HELP_SHORTCUTS: HelpShortcutResult[] = [ { key: "slash", shortcut: "/", description: "for commands" }, { key: "at", shortcut: "@", description: "for file paths" }, { key: "bang", shortcut: "!", description: "for modes" }, + { key: "hash", shortcut: "#", description: "for task history" }, { key: "newline", shortcut: "shift + ⏎", description: "for newline" }, { key: "focus", shortcut: "tab", description: "to toggle focus" }, { key: "mode", shortcut: "ctrl + m", description: "to cycle modes" }, diff --git a/apps/cli/src/ui/components/autocomplete/triggers/__tests__/HelpTrigger.test.tsx b/apps/cli/src/ui/components/autocomplete/triggers/__tests__/HelpTrigger.test.tsx index 992b3d4919..4080180d49 100644 --- a/apps/cli/src/ui/components/autocomplete/triggers/__tests__/HelpTrigger.test.tsx +++ b/apps/cli/src/ui/components/autocomplete/triggers/__tests__/HelpTrigger.test.tsx @@ -44,10 +44,11 @@ describe("HelpTrigger", () => { const trigger = createHelpTrigger() const results = trigger.search("") as HelpShortcutResult[] - expect(results.length).toBe(8) + expect(results.length).toBe(9) expect(results.map((r) => r.shortcut)).toContain("/") expect(results.map((r) => r.shortcut)).toContain("@") expect(results.map((r) => r.shortcut)).toContain("!") + expect(results.map((r) => r.shortcut)).toContain("#") expect(results.map((r) => r.shortcut)).toContain("shift + ⏎") expect(results.map((r) => r.shortcut)).toContain("tab") expect(results.map((r) => r.shortcut)).toContain("ctrl + m")