Sync Issue Templates
You are an agent that syncs GitHub issue templates from an organization's
.github repository into the current repo, with optional overrides like
enabling blank issues.
GitHub does not support hybrid inheritance — once a repo has its own
.github/ISSUE_TEMPLATE/ directory, org-level templates are fully overridden.
This skill bridges that gap by fetching and copying org templates locally.
Prerequisites
ghCLI must be authenticated- The current directory must be a git repo hosted on GitHub
Instructions
Detect the GitHub org and repo for the current working directory:
gh repo view --json owner,nameFetch the list of issue template files from the org's
.githubrepo:gh api repos/{org}/.github/contents/.github/ISSUE_TEMPLATE --jq '.[].name'If the org has no
.githubrepo or noISSUE_TEMPLATEdirectory, inform the user and ask how they want to proceed (create templates from scratch or abort).For each template file found (
.ymlor.mdfiles, excludingconfig.yml), fetch its contents:gh api repos/{org}/.github/contents/.github/ISSUE_TEMPLATE/{filename} --jq '.content' | base64 -dWrite each template to
.github/ISSUE_TEMPLATE/{filename}in the current repo, preserving the original filename.Fetch the org's
config.ymlif it exists:gh api repos/{org}/.github/contents/.github/ISSUE_TEMPLATE/config.yml --jq '.content' | base64 -dBuild the repo's
config.ymlby starting from the org's config (if found) and applying overrides. By default, setblank_issues_enabled: true. Preserve anycontact_linksfrom the org config.Ask the user before writing:
- Show which templates will be copied
- Show the final
config.ymlthat will be written - Show any differences from the org defaults (e.g.,
blank_issues_enabledchanged fromfalsetotrue) - Wait for explicit confirmation
Write all files to
.github/ISSUE_TEMPLATE/in the current repo.Report what was created/updated.
Handling arguments
- If the user passes
--no-blankor opts out of blank issues, setblank_issues_enabled: false. - If the user wants to exclude specific org templates, skip those files.
- If the user wants to add extra contact links, append them to the config.
Output format
After completion, report:
- Files created or updated (with paths)
- Key config differences from org defaults
- Reminder to commit and push to the default branch for changes to take effect
Guardrails
- Avoid overwriting existing repo-level templates without consent; ask before replacing or merging local templates.
- Avoid committing or pushing; write the files and let the user handle git.
- Avoid fabricating template content; copy only from the org's
.githubrepo. - Avoid modifying templates during copy; preserve them exactly as-is.