GitHub Config File Updater
Update config files in GitHub repos without cloning. Read, modify, branch, commit, and open a PR in one step.
The Challenge
Updating a single config file in a GitHub repo shouldn't require cloning the entire repository, creating a branch locally, editing the file, committing, pushing, and then opening a PR in the browser. For a one-line change to a package.json or .env.example, that's fifteen minutes of context-switching for something that should take thirty seconds.
What This Prompt Does
Read Config
Fetches the current file contents from the repo so you can see exactly what needs to change
Apply Changes
Modifies the file based on your instructions while preserving formatting and structure
Branch & Commit
Creates a new branch and commits the updated file with a descriptive commit message
Open PR
Opens a pull request with a clear title and description ready for review
The Prompt
The Prompt
Task
Use @GitHub/Read FileName it "GitHub/Read File" and call it with @GitHub/Read File to fetch a config file from a repo, modify it based on user instructions, then use @GitHub/Get Branch SHAName it "GitHub/Get Branch SHA" and call it with @GitHub/Get Branch SHA, @GitHub/Create BranchName it "GitHub/Create Branch" and call it with @GitHub/Create Branch, @GitHub/Update FileName it "GitHub/Update File" and call it with @GitHub/Update File, and @GitHub/Create Pull RequestName it "GitHub/Create Pull Request" and call it with @GitHub/Create Pull Request to commit the change on a new branch and open a PR. Automates routine config updates without cloning the repo.
Input
The user provides:
- The repository owner and name (e.g., "acme/web-app")
- The file path to update (e.g., "package.json", ".env.example", "terraform/variables.tf")
- The specific change to make (e.g., "bump Node version to 20", "add a new env var called API_TIMEOUT with default 30s")
- The target branch to base the PR on (optional, defaults to "main")
Example: "In acme/web-app, update package.json to set the engines.node field to >=20.0.0"
Context
Read the Current File
- Use @GitHub/Read FileName it "GitHub/Read File" and call it with @GitHub/Read File to fetch the current contents of the target file from the specified branch
- Parse the file content to understand its structure (JSON, YAML, HCL, etc.)
- Identify the specific section or field that needs to change
Apply the Modification
- Make the requested change to the file content
- Preserve formatting, indentation, and comments where possible
- Validate the modified content is syntactically correct for its file type
- Show the user a diff of what changed before proceeding
Create Branch and Commit
- Use @GitHub/Get Branch SHAName it "GitHub/Get Branch SHA" and call it with @GitHub/Get Branch SHA to get the current SHA of the base branch
- Use @GitHub/Create BranchName it "GitHub/Create Branch" and call it with @GitHub/Create Branch to create a new branch (e.g., "update/package-json-node-version")
- Use @GitHub/Update FileName it "GitHub/Update File" and call it with @GitHub/Update File to commit the modified file to the new branch
- Use a descriptive commit message that explains the change
Open a Pull Request
- Use @GitHub/Create Pull RequestName it "GitHub/Create Pull Request" and call it with @GitHub/Create Pull Request to open a PR from the new branch to the base branch
- Include a clear title describing the config change
- Add a description explaining what was changed and why
Output
Config Update Summary:
Repository: [owner/repo] File: [file path] Branch: [new branch name] -> [base branch]
Change Made:
- [Description of the specific modification]
Diff:
[before/after comparison]
Pull Request: [PR URL] Status: Ready for review
Example Usage
Try asking:
- →"In acme/web-app, update package.json to set engines.node to >=20.0.0"
- →"Add a new env var DATABASE_POOL_SIZE=10 to the .env.example in our backend repo"
- →"Bump the Terraform AWS provider version to 5.40.0 in infra/main.tf"