Read repo-specific issue guidelines to improve AI-enhanced issue creation

#4 · closed · 1 comments

View on GitHub ↗

Serhioromano

## Use case / Motivation Every repository has its own guidelines for how to report issues — what diagnostics to gather, what information is required, which templates to follow. Currently, `/ri` always gathers the same generic diagnostics (branch, commits, changes) regardless of the target repo's preferences. The `/ri` command should: 1. **Detect the target repo's issue guidelines** — look for: - `.github/ISSUE_TEMPLATE` directory (GitHub issue templates in YAML/markdown) - `.github/ISSUE_TEMPLATE.md` (legacy single template) - `CONTRIBUTING.md` (often contains issue reporting instructions) - The repo's default `issue_template` from GitHub API 2. **Parse the required diagnostics** — extract what information the maintainers expect (e.g., "Steps to reproduce", "Expected behavior", "Environment details", "Screenshots", specific logs, etc.) 3. **Inject these requirements into the AI enhancement prompt** — so the LLM can tailor the issue body and suggest what additional diagnostics the user should provide, rather than always using the same generic format. This would make `/ri` far more useful across different projects, since the generated issues would actually match what each repo's maintainers expect.

Comments

Serhioromano

Implemented in the current commit. **What was done:** 1. **New file `src/guidelines.ts`** — fetches repo-specific issue templates and guidelines from the target GitHub repository via `gh api`: - Checks `.github/ISSUE_TEMPLATE/` directory (fetches all `.yml`/`.yaml`/`.md` files) - Checks `.github/ISSUE_TEMPLATE.md` (legacy single template) - Checks `CONTRIBUTING.md` - All API calls are non-fatal — if any fail, guidelines are silently omitted and `/ri` proceeds normally 2. **Modified `src/index.ts`** — after collecting diagnostics, calls `fetchIssueGuidelines()` and injects the result into the subagent task: - Templates appear in a `## Repository Issue Guidelines` block before the task steps - A new step `3b` instructs the LLM to follow the template structure when present 3. **Updated docs** — README.md and CHANGELOG.md reflect the new repo-aware behavior.