Repository navigation
feat(shortcuts): Add GitHub issue listing to SCM shortcuts - #282
Conversation
Implement `/scm issues` and `/scm issues <number>` shortcuts to provide deterministic GitHub issue fetching without using LLM tokens. Changes: - Add executeListIssues() to list all repository issues via gh CLI - Add executeShowIssue() to fetch specific issue details with comments - Return structured JSON data for LLM consumption - Add comprehensive test coverage for new functionality - Update README.md with SCM shortcuts documentation The shortcuts use GitHub CLI (gh) to fetch issue data directly, providing context for the LLM without consuming tokens on API calls. Fixes #280 Co-authored-by: Eden Reich <[email protected]>
|
@claude I thought we can simply create a .infer/shortcuts/scm.yaml when running It's a better approach than using code for this simple task. |
|
Claude finished @edenreich's task —— View job Analysis Complete ✅Todo List
AnalysisYou're absolutely right! The codebase already has a YAML-based custom shortcuts system that would be perfect for SCM shortcuts. Let me explain why your suggestion makes excellent sense: Current State
Why YAML-Based Approach is Better✅ Advantages of YAML Configuration
❌ Disadvantages of Current Go Implementation
Recommended ApproachI recommend refactoring this PR to:
shortcuts:
- name: "scm-issues"
description: "List all GitHub issues for the repository"
command: "gh"
args: ["issue", "list", "--json", "number,title,state,author,labels,createdAt,updatedAt", "--limit", "20"]
- name: "scm-issue"
description: "Show details for a specific GitHub issue (usage: /scm-issue <number>)"
command: "gh"
args: ["issue", "view"]
# Additional args passed by user will be appended (e.g., the issue number)
Implementation NotesThe current custom shortcut system in
However, there's one limitation: The current implementation doesn't support placeholder-based argument insertion (e.g., cmdArgs := append(c.config.Args, args...)This appends user args to the end, which works perfectly for Next StepsWould you like me to:
This would result in a simpler, more maintainable, and more educational implementation! 🎯 Branch | |
|
@claude I think we can think of shortcuts that create a snippets, not only execute binaries - then we can migrate also the /scm create. But for right now please just migrate the /scm-issue and /scm-issues |
|
Claude finished @edenreich's task —— View job Migration Complete ✅Todo List
SummarySuccessfully migrated What Changed✅ Created YAML-based shortcuts:
✅ Updated
✅ Simplified Go code:
✅ Enhanced documentation:
Benefits of This Approach
Testing
Branch | |
- Move /scm-issues and /scm-issue from Go code to YAML-based shortcuts - Update infer init to create .infer/shortcuts/scm.yaml with example shortcuts - Remove executeListIssues, executeShowIssue, and related formatting functions - Update tests to reflect simplified SCM shortcut implementation - Update README.md to document YAML-based approach with customization examples - Keep /scm pr create as built-in shortcut (requires LLM interaction) Benefits of YAML approach: - Users can easily customize shortcuts (change filters, limits, format) - Provides educational examples for creating custom shortcuts - Simpler codebase with less hardcoded logic - Consistent with existing custom shortcuts infrastructure Co-authored-by: Eden Reich <[email protected]>
|
🎉 This PR is included in version 0.70.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Implements
/scm issuesand/scm issues <number>shortcuts to provide deterministic GitHub issue fetching without using LLM tokens.Changes
executeListIssues()to list all repository issues via gh CLIexecuteShowIssue()to fetch specific issue details with commentsTesting
All tests pass:
Closes #280