Skip to content

docs: add issue & PR templates and document agent rules in CLAUDE.md#70

Merged
martinyde merged 2 commits into
developfrom
feature/issue-69-templates-and-claude-md
Jun 16, 2026
Merged

docs: add issue & PR templates and document agent rules in CLAUDE.md#70
martinyde merged 2 commits into
developfrom
feature/issue-69-templates-and-claude-md

Conversation

@martinydeAI

Copy link
Copy Markdown
Collaborator

Link to ticket

Closes #69.

Description

Standardises the agent-driven workflow by introducing GitHub issue and
pull-request templates and recording matching agent rules in CLAUDE.md.

  • .github/ISSUE_TEMPLATE/issue.md — short human-facing "Resume"
    section (Description + Tasks checklist) followed by an "AI
    specificities" detail block so other agents picking up the work have
    a structured brief instead of freeform paragraphs.
  • .github/PULL_REQUEST_TEMPLATE.md — mirrors that split for PRs:
    human checklist on top, AI brief at the bottom.
  • CLAUDE.md gains three rules:
    • require the issue template when creating issues via gh;
    • forbid edits under tests/ without explicit user approval, and
      require a written which-tests / what / why rationale before any
      test edit (the 100% coverage gate makes test churn weighty enough
      that the user, not the agent, should decide whether the production
      code or the test is wrong);
    • require PR descriptions to spell out the blocker and reason when
      a PR carries the do-not-merge label, kept current as blockers
      resolve.
  • ADR 002-project-license-mpl-2004-project-license-mpl-2
    renumber follow-up: the license ADR was moved aside in Decide on frontend tooling (CSS framework + asset pipeline) #38 to free
    ADR 002 for the frontend-tooling decision, but the README link
    and the changelog reference still pointed at the old number. Both
    updated, ADR heading + index renumbered to match.

PR-template usage is left implicit in CLAUDE.md because the
itkdev-pull-request skill already preserves repository templates
verbatim — adding a rule here would just duplicate that.

Screenshot of the result

N/A — documentation / repository-config only, no UI affected.

Checklist

  • My code is covered by test cases.
  • My code passes our test (all our tests).
  • My code passes our static analysis suite.
  • My code passes our continuous integration process.

If your code does not pass all the requirements on the checklist you have to add a comment explaining why this change
should be exempt from the list.

Additional comments or questions

The "covered by test cases" box is intentionally unchecked: this PR
only touches CLAUDE.md, two GitHub template files, README.md,
CHANGELOG.md, and docs/adr/. There is no PHP/JS to exercise, so
no PHPUnit cases are added. The 100% coverage gate is unaffected
because no src/ files changed.


Details - AI specificities

Goal and motivation

  • Agent-generated issues and PRs were drifting between freeform
    paragraphs and ad-hoc checklists. The two templates introduce a
    consistent two-part layout (human header + AI brief) so any agent
    continuing the work has structured context.
  • CLAUDE.md is the canonical contract for agent behaviour in this
    repo, so the new behavioural rules belong there rather than buried
    inside skill prompts.

Scope

  • New files: .github/ISSUE_TEMPLATE/issue.md,
    .github/PULL_REQUEST_TEMPLATE.md.
  • Edits to CLAUDE.md (three new rules).
  • Edits to CHANGELOG.md (Added + a new Changed section under
    [Unreleased]).
  • ADR rename 002-project-license-mpl-2.md
    004-project-license-mpl-2.md, with README link, ADR heading, and
    index entry updated.

Non-goals

  • No new issue-type taxonomy. The existing Bug / Feature / Task split
    in CLAUDE.md stays as is.
  • No multi-template PULL_REQUEST_TEMPLATE/ directory — a single
    default template is enough for now.
  • No source or test changes (src/, tests/, config/ untouched).
  • PR-template usage is not added to CLAUDE.md because the
    itkdev-pull-request skill already enforces it.

Areas needing extra scrutiny

  • The template files must keep their headings and HTML comment
    markers intact: the itkdev-pull-request skill copies the template
    verbatim and matches on those markers. Reformatting the headings
    would silently break PR generation.
  • The CHANGELOG Changed section is new for this [Unreleased]
    block — previous entries collapsed everything into Added (docs: ADRs drop Follow-up Actions; CHANGELOG consolidates to Added #57).
    We're opting back into a Changed section here because the ADR
    renumber is genuinely a change to existing material, not an
    addition. If the project prefers a single Added list, the
    renumber bullet can be folded back in.

Follow-up work intentionally out of scope

Related

martinydeAI and others added 2 commits June 16, 2026 11:29
Standardises agent-driven workflow with two new GitHub templates:
.github/ISSUE_TEMPLATE/issue.md and .github/PULL_REQUEST_TEMPLATE.md.
Each carries a short human-facing summary section followed by an
"AI specificities" detail block, so other agents picking up the work
have a structured brief rather than freeform paragraphs.

CLAUDE.md gains three rules:

- Require the issue template when creating issues via gh.
- Forbid edits under tests/ without explicit user approval, and
  require a written which-tests/what/why rationale before any test
  edit. Coverage is gated at 100%, so test churn has real weight
  and the user, not the agent, decides whether the production code
  or the test is wrong.
- Require PR descriptions to spell out the blocker and reason when
  a PR carries the do-not-merge label, kept current as blockers
  resolve.

PR-template usage is left implicit since the itkdev-pull-request
skill already preserves repository templates verbatim.

Also rolls in the ADR 002 -> 004 renumber follow-up: the license
ADR was moved aside to free 002 for the frontend-tooling decision
(#38), but the README link and the CHANGELOG reference still
pointed at the old number. Updates both, and renumbers the ADR
heading and index to match.

Closes #69.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Martin Yde Granath <yde001@gmail.com>
While the project has no tagged releases, every [Unreleased] entry
belongs under Added — there is no prior released version for a change
to be Changed/Fixed/Removed/Deprecated/Security relative to. Adds the
rule to CLAUDE.md and points at PR #57 (the prior consolidation that
established this convention).

Applies the rule to the bundled ADR 002 -> 004 renumber bullet in
CHANGELOG.md: folds it into Added and drops the now-empty Changed
section. Refreshes the CLAUDE.md bullet under [Unreleased] / Added
so it lists all four new agent-workflow rules (issue template,
tests-without-approval, do-not-merge description, and the pre-release
changelog rule).

Also rolls in small editorial fixes to the new files that landed with
this PR: PR template heading "Link to ticket" -> "Links to issues"
(plural — a PR can address multiple issues) and column-width tweaks
in docs/adr/README.md so the index table renders evenly.

Refs #69.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Martin Yde Granath <yde001@gmail.com>
@martinyde martinyde requested a review from yepzdk June 16, 2026 10:14

@yepzdk yepzdk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we align issue templates to the Bug / Feature / Task taxonomy that CLAUDE.md mandates?
This single catch-all issue.md formalizes layout but not the classification the repo actually requires. Splitting it into three templates (or YAML issue forms) aligned to that taxonomy would close the gap between the template and our own rules.

Should we add a checklist item for the test-edit rule?
The new "don't touch tests/ without approval" rule lives only in CLAUDE.md, so it's only enforceable by an agent that reads it. A checklist line in the PR template — e.g. "Test changes were approved / justified" — would surface it at review time where a human actually looks. Worth adding, or do we want to keep the PR checklist as the standard itk-dev one?

Have we considered disabling blank issues via config.yml? There's no .github/ISSUE_TEMPLATE/config.yml, so GitHub still offers the "blank issue" escape hatch — which undermines "require the issue template." Adding config.yml with blank_issues_enabled: false would actually enforce template usage. Does that add value here, or do we want to keep blank issues available?

@martinyde

martinyde commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Should we align issue templates to the Bug / Feature / Task taxonomy that CLAUDE.md mandates? This single catch-all issue.md formalizes layout but not the classification the repo actually requires. Splitting it into three templates (or YAML issue forms) aligned to that taxonomy would close the gap between the template and our own rules.

Should we add a checklist item for the test-edit rule? The new "don't touch tests/ without approval" rule lives only in CLAUDE.md, so it's only enforceable by an agent that reads it. A checklist line in the PR template — e.g. "Test changes were approved / justified" — would surface it at review time where a human actually looks. Worth adding, or do we want to keep the PR checklist as the standard itk-dev one?

Have we considered disabling blank issues via config.yml? There's no .github/ISSUE_TEMPLATE/config.yml, so GitHub still offers the "blank issue" escape hatch — which undermines "require the issue template." Adding config.yml with blank_issues_enabled: false would actually enforce template usage. Does that add value here, or do we want to keep blank issues available?

Should we align issue templates? :
I did consider this, i just don't see the need yet, maybe i'm missing some benefit, but i thought we could start with this setup and alter if other needs appear.

Should we add a checklist item for the test-edit rule? :
In my workflow the checklists generally seem a bit rudimentary, i rarely set them manually because i rarely see PRs, Issues or ADRs progress over time, and the AI seems to scrape it all into checked/unchecked in one PR. I think the "don't touch tests" rules belong in Claude.md, maybe even as a hook to ensure proper gatekeeping, because it clearly illuminates when something critical is about to be changed. Maybe both approaches are needed.

Have we considered disabling blank issues via config.yml?
That seems like an edge case not worth worrying about.

@martinyde martinyde requested a review from yepzdk June 16, 2026 12:05
@martinyde martinyde merged commit 7fd5c31 into develop Jun 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

task: add GitHub issue & PR templates and CLAUDE.md rules

3 participants