Standardize GitHub Issue/PR Metadata + Strong Code Review
Turn ad-hoc issues/PRs into a coherent, repeatable workflow. This skill covers
the seven standard assignment fields for both issues and PRs, ships
copy-paste issue forms and a PR template, and provides a strong,
organized code-review model (fixed comment structure, severity table,
per-category rubrics).
Use it when a repo has no templates, reviews are inconsistent, or the user asks
to "padronizar issue/PR", "atribuições em issue e PR", "melhorar o code review",
or "criar template de issue/PR".
When to Use
- Repo lacks
.github/ISSUE_TEMPLATE/*.yml or PULL_REQUEST_TEMPLATE.md.
- Issues/PRs opened with missing assignee, labels, project, or milestone.
- Code review is unstructured / freeform and hard to scan.
- User wants a reusable standard other agents can apply.
The Seven Standard Assignment Fields
Apply all seven to every issue and PR. API limits noted below.
| Field |
Issue |
PR |
| Assignee |
✅ (who owns it) |
✅ |
| Reviewer |
n/a on issue (set on PR) |
✅ |
| Labels |
✅ |
✅ (inherit issue + type) |
| Project |
✅ (Projects V2) |
✅ |
| Milestone |
✅ (Backlog or semver) |
✅ (same as issue) |
| Development |
n/a on issue |
✅ (branch↔issue link) |
| Relationship |
parent/child links |
Fecha # / Relaciona # |
API reality check (gh / REST)
gh issue create sets: --assignee, --label, --milestone, --project, --body, --title. No reviewer on issues.
gh pr create sets: --assignee, --label, --milestone, --project, --head, --base, --title, --body, --reviewer (or gh pr edit --add-reviewer).
- Projects V2 are NOT settable via REST
gh issue/pr create --project reliably when the project is V2 (REST targets legacy Projects v1 and 404s). Use the GraphQL mutation addProjectV2ItemById to attach a V2 project item after creation. See references/projects-v2.md.
- Self-review request: a single-owner private repo can't formally request review from the same account; document the reviewer in the PR template/body instead.
- Development link: opening a PR from a branch whose name references the issue (or
Fecha #N in body) auto-links; the GitHub UI shows it under "Development" on the issue.
Workflow (apply to a real repo)
- Branch from
main: feat/workflow-standard.
- Create issue forms in
.github/ISSUE_TEMPLATE/ — copy templates/bug.yml, templates/feature.yml, templates/task.yml. Each pre-sets assignees: [pedroiff0] (change to the real default owner) and documents the standard fields in a markdown block.
- Create PR template
.github/PULL_REQUEST_TEMPLATE.md — copy templates/PULL_REQUEST_TEMPLATE.md. It has the 7-field assignment checklist + self-review.
- Create the review model
docs/CODE_REVIEW.md — copy references/code-review-model.md.
- Update CONTRIBUTING.md with an "Atribuições padronizadas" section (see
references/contributing-section.md).
- (Optional) Milestone: create a
Backlog catch-all if none exists:
gh api repos/<owner>/<repo>/milestones -f title=Backlog -f state=open -f description="..."
- Commit only the new files (preserve any existing working tree):
git add .github/... docs/CODE_REVIEW.md CONTRIBUTING.md && git commit -m "docs(workflow): ..."
- Open PR with all assignments, post a review comment using the model, merge
--rebase, delete branches.
Strong Code-Review Model (summary)
Full version in references/code-review-model.md. Key pieces:
- Fixed comment structure: Resumo · Verificação automática (table) · Achados por severidade (table) · Itens obrigatórios (checklist) · Decisão.
- Severity table: 🔴 Blocker (no merge) · 🟠 Maior (must fix this PR or follow-up) · 🟡 Menor (style/naming) · 🔵 Nit (optional).
- Decision rule: any 🔴 → ⛔ Blocked; only 🟠/🟡/🔵 → 🔁 Changes requested; nits-only → ✅ Approved.
- Rubrics by category: Security (top priority), Architecture (layers), Data (cents/derived), Tests, UI/UX.
Conventions
- Milestone/Release: releases are semver tags; milestone = target tag.
Backlog = catch-all for unscheduled work. Don't open a milestone per issue.
- Project: point V2 project at the repo's roadmap board.
- Labels: at least one category (
bug/enhancement/documentation/testes/ux/seguranca/infra/backlog) + module (modulo:financas etc.) when applicable.
Verification
After writing the YAML forms, validate structure (not just parse) before committing:
python3 - <<'PY'
import glob, yaml, sys
VALID={"markdown","textarea","input","dropdown","checkboxes","radio","code","yaml_metadata"}
errs=[]
for f in sorted(glob.glob(".github/ISSUE_TEMPLATE/*.yml")):
d=yaml.safe_load(open(f))
for k in ("name","description","body","assignees","labels"):
if k not in d: errs.append(f"{f}: falta {k}")
for i,b in enumerate(d.get("body",[])):
t=b.get("type")
if t not in VALID: errs.append(f"{f}[{i}] type {t!r} invalido")
a=b.get("attributes",{})
if t in ("textarea","input","dropdown","radio","checkboxes") and "label" not in a:
errs.append(f"{f}[{i}] {t} sem label")
sys.exit(1 if errs else 0) if errs else print("SCHEMA_OK")
PY
Also confirm assignments landed via API after opening, e.g.:
gh pr view <N> --json assignees,labels,milestone,reviewRequests,projectCards
(Note: projectCards is null on REST for V2 — verify V2 membership via GraphQL, see references/projects-v2.md.)
Pitfalls
- Don't rely on
gh ... --project for Projects V2 (REST 404s) — use the GraphQL mutation.
- Single-owner private repo: can't self-request review; put reviewer in template/body.
- Issue forms support labels/assignees via YAML, but NOT milestone/project reviewer — set those at create time or post-hoc.
- Preserve any pre-existing working tree; commit only the new workflow files.
1---2name: github-issue-pr-attribs3description: Standardize GitHub ISSUE and PR metadata (Assignee, Reviewer, Labels, Project, Milestone, Development, Relationship) and ship a strong, well-structured code-review template. Includes ready-to-use issue forms, PR template, and a severity/rubric review model.4license: MIT5---67# Standardize GitHub Issue/PR Metadata + Strong Code Review89Turn ad-hoc issues/PRs into a coherent, repeatable workflow. This skill covers10the **seven standard assignment fields** for both issues and PRs, ships11copy-paste **issue forms** and a **PR template**, and provides a **strong,12organized code-review model** (fixed comment structure, severity table,13per-category rubrics).1415Use it when a repo has no templates, reviews are inconsistent, or the user asks16to "padronizar issue/PR", "atribuições em issue e PR", "melhorar o code review",17or "criar template de issue/PR".1819## When to Use2021- Repo lacks `.github/ISSUE_TEMPLATE/*.yml` or `PULL_REQUEST_TEMPLATE.md`.22- Issues/PRs opened with missing assignee, labels, project, or milestone.23- Code review is unstructured / freeform and hard to scan.24- User wants a reusable standard other agents can apply.2526## The Seven Standard Assignment Fields2728Apply all seven to every issue and PR. API limits noted below.2930| Field | Issue | PR |31|---|---|---|32| **Assignee** | ✅ (who owns it) | ✅ |33| **Reviewer** | n/a on issue (set on PR) | ✅ |34| **Labels** | ✅ | ✅ (inherit issue + type) |35| **Project** | ✅ (Projects V2) | ✅ |36| **Milestone** | ✅ (Backlog or semver) | ✅ (same as issue) |37| **Development** | n/a on issue | ✅ (branch↔issue link) |38| **Relationship** | parent/child links | `Fecha #` / `Relaciona #` |3940### API reality check (gh / REST)41- `gh issue create` sets: `--assignee`, `--label`, `--milestone`, `--project`, `--body`, `--title`. **No reviewer on issues.**42- `gh pr create` sets: `--assignee`, `--label`, `--milestone`, `--project`, `--head`, `--base`, `--title`, `--body`, `--reviewer` (or `gh pr edit --add-reviewer`).43- **Projects V2** are NOT settable via REST `gh issue/pr create --project` reliably when the project is V2 (REST targets legacy Projects v1 and 404s). Use the GraphQL mutation `addProjectV2ItemById` to attach a V2 project item after creation. See `references/projects-v2.md`.44- **Self-review request**: a single-owner private repo can't formally request review from the same account; document the reviewer in the PR template/body instead.45- **Development link**: opening a PR from a branch whose name references the issue (or `Fecha #N` in body) auto-links; the GitHub UI shows it under "Development" on the issue.4647## Workflow (apply to a real repo)48491. **Branch** from `main`: `feat/workflow-standard`.502. **Create issue forms** in `.github/ISSUE_TEMPLATE/` — copy `templates/bug.yml`, `templates/feature.yml`, `templates/task.yml`. Each pre-sets `assignees: [pedroiff0]` (change to the real default owner) and documents the standard fields in a `markdown` block.513. **Create PR template** `.github/PULL_REQUEST_TEMPLATE.md` — copy `templates/PULL_REQUEST_TEMPLATE.md`. It has the 7-field assignment checklist + self-review.524. **Create the review model** `docs/CODE_REVIEW.md` — copy `references/code-review-model.md`.535. **Update CONTRIBUTING.md** with an "Atribuições padronizadas" section (see `references/contributing-section.md`).546. **(Optional) Milestone**: create a `Backlog` catch-all if none exists:55 `gh api repos/<owner>/<repo>/milestones -f title=Backlog -f state=open -f description="..."`567. **Commit only the new files** (preserve any existing working tree):57 `git add .github/... docs/CODE_REVIEW.md CONTRIBUTING.md && git commit -m "docs(workflow): ..."`588. **Open PR** with all assignments, post a review comment using the model, merge `--rebase`, delete branches.5960## Strong Code-Review Model (summary)6162Full version in `references/code-review-model.md`. Key pieces:6364- **Fixed comment structure**: Resumo · Verificação automática (table) · Achados por severidade (table) · Itens obrigatórios (checklist) · Decisão.65- **Severity table**: 🔴 Blocker (no merge) · 🟠 Maior (must fix this PR or follow-up) · 🟡 Menor (style/naming) · 🔵 Nit (optional).66- **Decision rule**: any 🔴 → ⛔ Blocked; only 🟠/🟡/🔵 → 🔁 Changes requested; nits-only → ✅ Approved.67- **Rubrics by category**: Security (top priority), Architecture (layers), Data (cents/derived), Tests, UI/UX.6869## Conventions7071- **Milestone/Release**: releases are semver tags; milestone = target tag. `Backlog` = catch-all for unscheduled work. Don't open a milestone per issue.72- **Project**: point V2 project at the repo's roadmap board.73- **Labels**: at least one category (`bug`/`enhancement`/`documentation`/`testes`/`ux`/`seguranca`/`infra`/`backlog`) + module (`modulo:financas` etc.) when applicable.7475## Verification7677After writing the YAML forms, validate structure (not just parse) before committing:7879```bash80python3 - <<'PY'81import glob, yaml, sys82VALID={"markdown","textarea","input","dropdown","checkboxes","radio","code","yaml_metadata"}83errs=[]84for f in sorted(glob.glob(".github/ISSUE_TEMPLATE/*.yml")):85 d=yaml.safe_load(open(f))86 for k in ("name","description","body","assignees","labels"):87 if k not in d: errs.append(f"{f}: falta {k}")88 for i,b in enumerate(d.get("body",[])):89 t=b.get("type")90 if t not in VALID: errs.append(f"{f}[{i}] type {t!r} invalido")91 a=b.get("attributes",{})92 if t in ("textarea","input","dropdown","radio","checkboxes") and "label" not in a:93 errs.append(f"{f}[{i}] {t} sem label")94sys.exit(1 if errs else 0) if errs else print("SCHEMA_OK")95PY96```9798Also confirm assignments landed via API after opening, e.g.:99`gh pr view <N> --json assignees,labels,milestone,reviewRequests,projectCards`100(Note: `projectCards` is null on REST for V2 — verify V2 membership via GraphQL, see `references/projects-v2.md`.)101102## Pitfalls103104- Don't rely on `gh ... --project` for **Projects V2** (REST 404s) — use the GraphQL mutation.105- Single-owner private repo: can't self-request review; put reviewer in template/body.106- Issue forms support labels/assignees via YAML, but NOT milestone/project reviewer — set those at create time or post-hoc.107- Preserve any pre-existing working tree; commit only the new workflow files.