mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-05 19:08:17 +00:00

This enables agents (namely Amp) to use `/gh-issue <number/url>` to begin diagnosing a GitHub issue, explaining the problem, and suggesting a plan of action. This action explicitly prompts the AI to not write code. I've used this manually for months with good results, so now I'm formalizing it in the repo for other contributors. Example diagnosing #8523: https://ampcode.com/threads/T-3e26e8cc-83d1-4e3c-9b5e-02d9111909a7
65 lines
2.3 KiB
Plaintext
Executable File
65 lines
2.3 KiB
Plaintext
Executable File
#!/usr/bin/env nu
|
|
|
|
# A command to generate an agent prompt to diagnose and formulate
|
|
# a plan for resolving a GitHub issue.
|
|
#
|
|
# IMPORTANT: This command is prompted to NOT write any code and to ONLY
|
|
# produce a plan. You should still be vigilant when running this but that
|
|
# is the expected behavior.
|
|
#
|
|
# The `<issue>` parameter can be either an issue number or a full GitHub
|
|
# issue URL.
|
|
def main [
|
|
issue: any, # Ghostty issue number or URL
|
|
--repo: string = "ghostty-org/ghostty" # GitHub repository in the format "owner/repo"
|
|
] {
|
|
# TODO: This whole script doesn't handle errors very well. I actually
|
|
# don't know Nu well enough to know the proper way to handle it all.
|
|
|
|
let issueData = gh issue view $issue --json author,title,number,body,comments | from json
|
|
let comments = $issueData.comments | each { |comment|
|
|
$"
|
|
### Comment by ($comment.author.login)
|
|
($comment.body)
|
|
" | str trim
|
|
} | str join "\n\n"
|
|
|
|
$"
|
|
Deep-dive on this GitHub issue. Find the problem and generate a plan.
|
|
Do not write code. Explain the problem clearly and propose a comprehensive plan
|
|
to solve it.
|
|
|
|
# ($issueData.title) \(($issueData.number)\)
|
|
|
|
## Description
|
|
($issueData.body)
|
|
|
|
## Comments
|
|
($comments)
|
|
|
|
## Your Tasks
|
|
|
|
You are an experienced software developer tasked with diagnosing issues.
|
|
|
|
1. Review the issue context and details.
|
|
2. Examine the relevant parts of the codebase. Analyze the code thoroughly
|
|
until you have a solid understanding of how it works.
|
|
3. Explain the issue in detail, including the problem and its root cause.
|
|
4. Create a comprehensive plan to solve the issue. The plan should include:
|
|
- Required code changes
|
|
- Potential impacts on other parts of the system
|
|
- Necessary tests to be written or updated
|
|
- Documentation updates
|
|
- Performance considerations
|
|
- Security implications
|
|
- Backwards compatibility \(if applicable\)
|
|
- Include the reference link to the source issue and any related discussions
|
|
4. Think deeply about all aspects of the task. Consider edge cases, potential
|
|
challenges, and best practices for addressing the issue. Review the plan
|
|
with the oracle and adjust it based on its feedback.
|
|
|
|
**ONLY CREATE A PLAN. DO NOT WRITE ANY CODE.** Your task is to create
|
|
a thorough, comprehensive strategy for understanding and resolving the issue.
|
|
" | str trim
|
|
}
|