Skip to content

Instantly share code, notes, and snippets.

@Ibochkarev
Created August 15, 2026 04:30
Show Gist options
  • Select an option

  • Save Ibochkarev/b5e73b29d66423f277a093ccc12f713c to your computer and use it in GitHub Desktop.

Select an option

Save Ibochkarev/b5e73b29d66423f277a093ccc12f713c to your computer and use it in GitHub Desktop.
name issue-to-pr
description End-to-end pipeline from a GitHub/GitLab issue URL to an opened PR: implement with clean-code, enforce quality gates (best practices, refactoring discipline, verification matrix), multi-agent review (thermo-nuclear, simplifier, security when needed), fix findings, add tests, then create the PR (stop-slop). Use when the user pastes an issue link and asks to implement/fix/ship it, or invokes /issue-to-pr, issue-to-pr, or "сделай по issue".

Issue → PR Pipeline

Orchestrator skill. Input: issue URL (or #N in the current repo). Output: PR URL.

Announce at start: Using issue-to-pr for <issue>.

Hard rules

  1. Do not skip phases. Order below is mandatory.
  2. Evidence before claims — run tests/lint; record exit codes. No "should pass".
  3. Commit / push / PR only inside this pipeline (user invoked the skill = explicit ask).
  4. Max 2 review-fix loops. If blockers remain — stop, report, ask user.
  5. Auth/payments/crypto/breaking API — escalate plan to user before coding if scope is unclear.
  6. Read linked skills before the phase that needs them (do not rely on memory).
  7. Quality gates are mandatory. See quality-gates.md. Any BLOCK item stops progress until fixed or user waives.

Required skills (read when needed)

Phase Skill / agent
Implement quality ~/.cursor/skills/skills/clean-code/SKILL.md
Verify claims ~/.cursor/skills/skills/verification-before-completion/SKILL.md
Simplify Task code-simplifier
Structural review Task thermo-nuclear-code-quality-review
Bug/security review Task code-reviewer (+ security-review when auth/pay)
Silent failures Task silent-failure-hunter when error paths change
PR prose ~/.cursor/skills/stop-slop/SKILL.md
Open PR ~/.cursor/skills/skills/create-pr/SKILL.md

Project overrides (if present, win over create-pr defaults):

  • .cursor/rules/pull-request-creation.mdc
  • .github/PULL_REQUEST_TEMPLATE.md
  • AGENTS.md

Progress checklist

Copy into TodoWrite and keep updated:

Issue→PR:
- [ ] 0. Parse issue + branch
- [ ] 1. Scope / thin plan
- [ ] 2. Implement (clean-code) + Gate B/C
- [ ] 2b. Simplify (code-simplifier if non-trivial)
- [ ] 3. Verification matrix (Gate E)
- [ ] 4. Review battery (Gate F) + fix
- [ ] 5. AC matrix + missing tests (Gate A)
- [ ] 5b. Diff hygiene (Gate G)
- [ ] 6. Create PR (stop-slop)
- [ ] 7. Hand off PR URL + gate report

Details: checklist.md · quality-gates.md · agents.md.


Phase 0 — Parse issue + branch

gh issue view <N|URL> --json number,title,body,labels,url,state,comments

Extract: goal, acceptance criteria, out-of-scope, labels, linked design/docs.

Seed Gate A rows from AC / repro steps (fill evidence later).

Branch from default base:

BASE=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')
git fetch origin "$BASE"
git checkout -b "fix/issue-<N>-<short-slug>" "origin/$BASE"  # or feat/…

If WIP already matches the issue — reuse the branch. Stop if issue is closed/duplicate/lacks criteria.


Phase 1 — Thin plan

Short plan only:

  • Files likely touched + canonical layer for new logic
  • Approach (3–7 bullets), including any code-judo / extraction
  • Test strategy (Gate E layers that apply)
  • Risks / security surface (auth? public API? migrations?)
  • Explicit out of scope (prevents drive-by)

If blocked on a product choice — ask one focused question, then continue.

No long docs/plans/… unless user asked or multi-day scope.


Phase 2 — Implement (clean-code) + Gates B/C

  1. Read clean-code.
  2. Implement only AC / issue need.
  3. Logic in canonical layer; small functions; searchable names.
  4. Apply Gate C while coding (no drive-by; extract when duplicated; no identity wrappers).
  5. i18n / lexicons per project; skip CHANGELOG unless required.
  6. After coding: run Gate B self-check on the diff. Fix BLOCK items now.

Optional: Task generalPurpose with agents.md § Implementer. Orchestrator owns gates.

Smoke: syntax check on every touched source file.

Phase 2b — Simplify (non-trivial diffs)

If diff ≳ 80 LOC or >3 files or new abstraction introduced:

  1. Task code-simplifier on recently changed code (agents.md § Simplifier).
  2. Re-run Gate B quickly.
  3. Do not expand scope during simplify.

Trivial one-liner / lexicon-only: skip 2b with a one-line note.


Phase 3 — Verification matrix (Gate E)

Discover repo commands (composer.json, package.json, CI, AGENTS.md).

Run every applicable layer from Gate E (syntax → focused tests → lint → build → smoke). For bug fixes: red-green once on the regression test.

Gate: any failure → fix → re-run. Do not enter Phase 4 with red applicable gates.

Apply verification-before-completion: no green claim without fresh output in this session.

Also run Gate D (security / best-practice scan) on the diff before review.


Phase 4 — Review battery (Gate F) + fix

Run reviews on branch diff ($BASE...HEAD + unstaged):

Pass Agent Focus
4a code-reviewer bugs, regressions, security, missing tests
4b thermo-nuclear-code-quality-review structure, code-judo, spaghetti, 1k-line
4c conditional see Gate F table (security-review, silent-failure-hunter, type-design-analyzer, …)

Prompts: agents.md. Prefer run_in_background: false for reviewers.

Fix loop

For each BLOCK / high:

  1. Fix (prefer deletion of complexity over new branches)
  2. Re-run Phase 3 applicable gates
  3. Spot re-review touched areas

Max 2 full loops. Then proceed (no blockers) or stop with remaining list.

Medium <15 min → fix. Low → PR notes only.


Phase 5 — AC matrix + missing tests (Gate A)

  1. Complete Gate A table: every AC has code + test evidence (or justified n/a).
  2. Add focused tests for gaps / review findings.
  3. Re-run Phase 3.
  4. Optional: Task pr-test-analyzer after PR exists if CI/tests look thin.

Phase 5b — Diff hygiene (Gate G)

Before commit/PR: status, full diff vs base, no secrets/debug/unrelated files/CHANGELOG drive-by.


Phase 6 — Create PR

  1. Commit intended changes (conventional English subject; body = why).
  2. Confirm Gate H pre-PR checklist all BLOCK clear.
  3. Read create-pr; honor project template / pull-request-creation rule.
  4. stop-slop on PR prose.
  5. Push + create:
git push -u origin HEAD
gh pr create --title "…" --body "$(cat <<'EOF'
…
EOF
)"

Closes #N if fully resolved, else Refs #N. Copy issue labels when the repo uses them. No issue number in title if project forbids (MiniShop3).

Include in PR testing section: Gate E commands + exit codes.

After open: if CI fails, Task ci-investigator → fix → push (counts toward review-fix budget if still open).


Phase 7 — Hand off

Return (user language):

  • PR URL
  • What changed (2–5 bullets)
  • Gate E commands + results
  • Gate A summary (AC covered?)
  • Review loops / deferred non-blockers
  • Explicit list of any user-waived BLOCKs

Subagent routing

Role subagent_type When
Explore explore unfamiliar area
Implement generalPurpose large multi-file
Simplify code-simplifier Phase 2b
Bug review code-reviewer Phase 4a always
Structure thermo-nuclear-code-quality-review Phase 4b always
Security security-review auth/tokens/pay/crypto
Silent fail silent-failure-hunter error/API status paths
Types type-design-analyzer new contracts / nullability
Comments comment-analyzer heavy comment/docs churn
Tests pr-test-analyzer thin tests vs AC
CI ci-investigator / ci-watcher CI red / watch

Orchestrator must not mark Phase 4/5 done while BLOCK gates remain.


Anti-patterns

  • Skipping Gate F because "small change" (minimum 4a+4b still required)
  • Skipping simplify on a large messy diff
  • Opening PR with red Gate E or incomplete Gate A
  • Approving own diff without review agents
  • Drive-by refactors / unrelated file churn
  • New wrappers that add indirection without deleting complexity
  • Force-push / amend unless user rules allow
  • CHANGELOG on every issue (usually release-time)

MiniShop3 defaults

  • PHP 8.2+, MiniShop3\…, logic in Services/
  • Routes: config/routes/web.php / manager.php + matching controllers
  • Lexicons ru+en; no CHANGELOG.md unless asked
  • PR: Russian body + .github/PULL_REQUEST_TEMPLATE.md + .cursor/rules/pull-request-creation.mdc
  • Gate E smoke: php -l touched PHP; phpunit under core/components/minishop3/tests when present; vueManager ESLint if Vue touched
  • Auth/token issues → always include security-review + silent-failure-hunter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment