mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
feat(cli): add # shortcut for task history in help trigger
This commit is contained in:
parent
c3c21c696d
commit
c194257dac
3 changed files with 56 additions and 1 deletions
53
.roo/commands/commit.md
Normal file
53
.roo/commands/commit.md
Normal file
|
|
@ -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
|
||||
|
|
@ -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" },
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue