Work On Github Issue work-on-github-issue
Fetch a GitHub issue by link, build its full context, produce an implementation plan and optionally implement it.
- Our test
- —
- not tested yet
- GitHub stars
- 24k
- comet-ml/opik
- Added by
- 0
- members
- Updated
- Dec 6
- commit 316de6f
- Content
- 2 files
- no scripts · 10 KB
- License
- Apache 2.0
- free to use
What our test found
Not tested yet. Our model tries every skill on a realistic request and scores the result, the most popular skills first. Until then, the safety checks on the right still apply.
name: work-on-github-issue description: "Fetch a GitHub issue by link, build its full context, produce an implementation plan and optionally implement it." disable-model-invocation: true
Work on GitHub Issue
Overview
Fetch a GitHub issue by link, build full context (title, description, comments, labels, assignees, milestone), and generate an actionable implementation plan. This workflow will:
- Verify the GitHub CLI is authenticated (or explain how to log in).
- Fetch and parse the issue details.
- If not found, list your assigned open issues.
- Check local git status in the Opik repository and propose a branch if on
main. - Suggest moving the issue to In Progress if it's currently open.
- Validate all operations and provide clear success/failure feedback.
Inputs
- GitHub issue link (required): e.g.,
https://github.com/comet-ml/opik/issues/1234
Steps
1. Preflight & Environment Check
- Check GitHub CLI: Run
gh auth status. > Ifghis missing or not logged in, respond with: "This command needs the GitHub CLI: installghand rungh auth login, then retry." > Stop here. - Check development environment: Verify project dependencies, build tools, and project structure are ready.
- Check local git branch in the Opik repository:
- If on
main, propose a new branch following Opik naming convention:
{USERNAME}/issue-{ISSUE-NUMBER}-{ISSUE-SUMMARY}Example:
- Issue:
https://github.com/comet-ml/opik/issues/1234 - Title: "Add cursor git workflow rule"
- Branch:
andrescrz/issue-1234-add-cursor-git-workflow-rule
2. Fetch Issue
- Extract issue number from link.
- Fetch with
gh issue view <number> -R comet-ml/opik --json title,body,state,labels,assignees,milestone,comments,createdAt,updatedAt. - If fetch fails: Show error message and suggest troubleshooting steps.
- If not found: Search for open issues assigned to current user:
is:open assignee:@me(max 10). - Show list:
#1234 — Title (State)and stop if issue not found.
3. Build GitHub Context
- Number, Title, State, Labels, Assignees, Milestone
- Description: verbatim if short, otherwise concise summary + key quotes.
- If no description: Note this and suggest adding context for better implementation planning.
- Comments: newest → oldest,
[author @ date] summarywith important snippets. - Linked PRs: Include any linked pull requests if available.
- Project context: Include project board information if available.
4. Determine Implementation Scope
- Analyze issue scope: Determine which Opik components are affected:
- Backend only: Java API changes, database migrations, services
- Frontend only: React components, UI changes, state management
- SDK only: Python or TypeScript SDK changes
- Cross-component: Changes affecting multiple layers
- Infrastructure: Docker, deployment, configuration changes
- Identify affected areas: Map issue requirements to specific Opik modules and files
- Estimate complexity: Consider if changes require database migrations, API versioning, or breaking changes
5. Task Plan
- Bugfix: repro steps, root cause hypothesis, affected files, fix approach, risks, tests, verification.
- Feature: user story recap, acceptance criteria, implementation plan, tests, rollout notes.
- Always reference shared and domain guidance in the right place:
- Global policy: the root
AGENTS.md(git workflow, security, code style) - Backend guidance:
.agents/skills/opik-backend/* - Frontend guidance:
.agents/skills/opik-frontend/* - SDK guidance:
.agents/skills/python-sdk/*and.agents/skills/typescript-sdk/* - Component-specific guidance: Use the appropriate rule set based on the implementation scope identified in step 4
6. Git & Branch Setup
- Repo: Opik repository (current workspace)
- CRITICAL: Handle working directory state BEFORE branching:
- If working directory has changes:
- Option 1: Stash changes:
git stash push -m "WIP: before issue-{ISSUE-NUMBER}" - Option 2: Ask user what to do with uncommitted changes
- NEVER commit directly to main (following Opik git workflow)
- If on
main, create branch following Opik conventions:
# Ensure you're on main and pull latest
git checkout main
git pull origin main
# Create task-specific branch
git checkout -b {USERNAME}/issue-{ISSUE-NUMBER}-{ISSUE-SUMMARY}- After branch creation: Apply stashed changes if any:
git stash pop - Verify branch creation: Confirm new branch is active and clean.
7. Status Management (Optional)
- Move issue to "In Progress" if currently open:
- Add the label with
gh issue edit <number> -R comet-ml/opik --add-label work-in-progress - Verify label addition: Confirm labels were added successfully
- Handle label failures: Provide error details and retry options
8. Implementation Suggestion
- Based on GitHub context and Opik agent guidance, suggest implementing the feature/bugfix:
- Reference global policy in the root
AGENTS.mdand domain guidance in.agents/skills/* - Provide specific implementation steps based on the task plan
- Include code examples or file paths where appropriate
- Suggest testing approaches and quality checks
- Follow Opik architecture patterns (Resources → Services → DAOs → Models for backend)
- Commit Message Format: Follow shared conventions from the root
AGENTS.md(Commit & Pull Request Guidelines).
First Commit (PR-title source, required):
[<TICKET-KEY>] [BE/FE/SDK/DOCS] <type>: <description>where <TICKET-KEY> is OPIK-####, issue-####, or NA.
Follow-up Commits (preferred):
<type>(<scope>): <description>where <type> is one of: feat, fix, refactor, test, docs, chore.
Last-resort fallback (discouraged):
Revision N: <description>Component Types:
[BE]- Backend changes (Java, API endpoints, services)[FE]- Frontend changes (React, TypeScript, UI components)[SDK]- SDK changes (Python, TypeScript SDKs)[DOCS]- Documentation updates, README changes, comments, swagger/OpenAPI documentation
Examples:
[OPIK-1234] [BE] feat: add create trace endpoint
[issue-1234] [FE] fix: guard project custom metrics empty state
[OPIK-1234] [DOCS] docs: update API documentation
[NA] [SDK] chore: align SDK lint configuration
feat(experiments): add run-level metadata capture9. User Confirmation
- Ask for user approval before proceeding with implementation:
- Present the implementation plan clearly
- Ask: "Would you like me to proceed with implementing this feature/fix now?"
- Wait for explicit user confirmation before making any code changes
- If user declines: Stop here and provide guidance for manual implementation
- If user confirms: Proceed to implementation phase
10. Implementation Phase (Optional)
- Only proceed if user confirmed in previous step
- Execute the implementation plan:
- Create/modify necessary files following Opik patterns
- Apply code changes according to the plan
- Run quality checks and tests
- Commit changes with proper issue number prefix
- If user declined: Provide manual implementation guidance and stop
11. Completion Summary & Validation
- Confirm all steps completed:
- ✅ GitHub CLI authenticated
- ✅ Issue fetched and analyzed successfully
- ✅ Labels updated (if applicable)
- ✅ Feature branch created and active following Opik naming convention
- ✅ Development environment ready
- ✅ Implementation suggestion provided
- Next steps: Provide clear guidance on what to do next
- Error summary: If any steps failed, provide troubleshooting guidance
Error Handling
GitHub CLI Failures
- Connection issues: Check network and authentication
- Permission errors: Verify user access to the repository
- Rate limiting: Wait and retry
- API errors: Check GitHub API status and retry
Git Operation Failures
- Branch creation fails: Check for conflicts, verify permissions
- Pull fails: Resolve merge conflicts, check remote status
- Working directory dirty: NEVER commit to main - stash changes first
- CRITICAL SAFETY: Always verify current branch before any commits
- Uncommitted changes: Stash before branching, pop after branch creation
Label Management Failures
- Invalid label: Check available labels in the repository
- Permission denied: Verify user can modify issue labels
- Label doesn't exist: Create the label or use existing ones
Success Criteria
The command is successful when:
- ✅ GitHub issue is successfully fetched and analyzed
- ✅ Feature branch is created and active following Opik naming convention
- ✅ Issue labels are updated (if requested)
- ✅ Implementation suggestion provided based on context and Opik rules
- ✅ User confirmation received (proceed or decline)
- ✅ Implementation executed (if confirmed) or manual guidance provided (if declined)
- ✅ All operations complete without errors
- ✅ Clear next steps are provided to the user
Troubleshooting
Common Issues
- GitHub CLI not available: install
ghand rungh auth login - Git branch conflicts: Resolve conflicts before proceeding
- Permission errors: Check user access and repository settings
- Network issues: Verify connectivity to GitHub services
Fallback Options
- If issue fetch fails: List user's assigned open issues
- If branch creation fails: Provide manual git commands
- If label update fails: Continue with development setup
End Command