Skip to content

feat(intake): add issue field validation workflow and structured issue templates#274

Merged
JustAGhosT merged 8 commits intodevfrom
feat/issue-field-validation
Mar 5, 2026
Merged

feat(intake): add issue field validation workflow and structured issue templates#274
JustAGhosT merged 8 commits intodevfrom
feat/issue-field-validation

Conversation

@JustAGhosT
Copy link
Collaborator

@JustAGhosT JustAGhosT commented Mar 5, 2026

Summary

  • Adds GitHub Actions workflow for automated issue field validation and label assignment on issue open/edit
  • Converts issue templates from Markdown to structured YAML forms with dropdown fields (area, priority, severity, phase, impact)
  • Extends engine with canonical field enums, area→team routing, escalation logic, and severity normalization
  • Adds issue template field validation to the sync pipeline

Supersedes #237 with review findings addressed.

Changes

Test Plan

  • All 770 tests pass (1 pre-existing timeout flake in sync-integration unrelated to changes)
  • Merge conflict with dev resolved (kept both buildTeamVars and buildAreaRoutingTable)
  • Copilot review findings addressed (4 of 5 — remaining item is a template repoName variable noted for future improvement)

Checklist

  • PR title follows Conventional Commits format
  • No secrets, tokens, or credentials in the diff
  • Tests pass locally
  • Review findings addressed

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added structured issue templates with dropdown fields for area, priority, severity, phase, and impact.
    • Implemented automatic team routing and escalation based on issue properties.
    • Added GitHub Actions workflow for issue field validation and label management.
    • Enhanced task management with area and severity classification support.
  • Bug Fixes

    • Standardized severity values to lowercase format across issue templates and systems.
  • Documentation

    • Updated backlog and review guidance with issue field routing and escalation rules.
    • Added new issue templates with enhanced form validation.
  • Tests

    • Expanded test coverage for team routing and escalation logic.
    • Added validation tests for issue template fields.

claude and others added 8 commits March 4, 2026 20:19
…y, phase, and impact fields

Convert issue templates from Markdown to GitHub YAML issue forms with
validated dropdown fields. Add feature request template alongside the
existing bug report. New fields (area, priority, severity, phase, impact)
use preset values derived from teams.yaml and project.yaml enums.

Changes:
- Replace .github/ISSUE_TEMPLATE/bug_report.md with bug_report.yml (YAML form)
- Add .github/ISSUE_TEMPLATE/feature_request.yml with matching fields
- Add .github/ISSUE_TEMPLATE/config.yml (disable blank issues, link security advisories)
- Add .github/workflows/issue-label-validation.yml (validates fields on issue open/edit,
  auto-applies area:/priority:/severity: labels)
- Update .agentkit/templates/github/ISSUE_TEMPLATE/ source templates
- Add issueArea, issuePriority, issueSeverity, issueImpact enums to spec-validator
- Add Phase 9 to validate.mjs: validates issue template dropdown values against enums

https://claude.ai/code/session_01Ue9aaiqqt1iHDx8KNwQ92m
… and task protocol

Wire the new issue area/priority/severity/impact fields into the agent
teams orchestration pipeline so issues flow through to the right teams
automatically.

Changes:
- task-protocol: add area, severity fields to task schema with validation,
  filtering, and display; extend TASK_PRIORITIES to include P4
- orchestrator: add resolveTeamByArea() for area→team routing using
  teams.yaml intake.routing; add computeEscalation() for dynamic
  escalation based on severity + impact + area
- review-runner: normalize severity values to canonical lowercase
  (critical/high/medium/low) matching issue templates; export
  normalizeSeverity() helper
- sync-backlog template: add area labels table, severity levels,
  escalation rules, source tracking, and P4 priority level
- sync-backlog prompt: add issue field routing table and escalation rules
  for Copilot prompt
- teams.yaml: add cli→backend and sync-engine→devops intake routing

https://claude.ai/code/session_01Ue9aaiqqt1iHDx8KNwQ92m
…s and flows

Ensure consistent area/priority/severity values in GitHub issue filing,
Linear issue filing, and all platform command templates (Copilot, Cursor,
Windsurf, Codex).

Changes:
- review.md: normalize severity from CRITICAL/HIGH/MEDIUM/LOW to canonical
  lowercase (critical/high/medium/low); add area field to issue filing with
  file-path→area mapping; use structured labels (severity:X, area:X, priority:X)
  for both GitHub and Linear
- project-review.md: same severity normalization and structured label format;
  add area field to Phase 1c findings; add canonical field reference section
- Copilot TEMPLATE.prompt.md: add issue field routing section with area→team
  mapping, priority/severity enums, and escalation rules
- Cursor TEMPLATE.md: same routing section added
- Windsurf command.md: same routing section added
- Codex SKILL.md: same routing section added

All platforms now reference identical:
  - Area values (12 canonical values from teams.yaml)
  - Priority levels (P0–P4)
  - Severity levels (critical/high/medium/low)
  - Escalation rules (severity+area→security teams, impact+P0→product)

https://claude.ai/code/session_01Ue9aaiqqt1iHDx8KNwQ92m
…robustness

Required fixes:
- review.md: fix uppercase "CRITICAL→P0, HIGH→P1" to lowercase "critical→P0, high→P1"
- validate.mjs Phase 9: make area parsing consistent with severity — extract
  bare value before " — " separator so "backend — Server-side" validates correctly
- (PROJECT_ENUMS export verified as already present on line 1086)

Tests:
- orchestrator.test.mjs: add tests for resolveTeamByArea() (default routing,
  unknown areas, config overrides, team- prefix handling) and computeEscalation()
  (security escalation, blocked cross-team, operations team from config, edge cases)
- review-runner.test.mjs: add tests for normalizeSeverity() (uppercase, lowercase,
  mixed case, unknown values)
- validate.test.mjs: add Phase 9 tests (valid dropdowns, invalid area, invalid
  severity, malformed template, area options with description separators)

DRY improvements:
- synchronize.mjs: add buildAreaRoutingTable() to generate routing from teams.yaml
  and expose as {{intakeAreaRoutingTable}} template variable
- All 4 platform templates (Copilot, Cursor, Windsurf, Codex) now use
  {{intakeAreaRoutingTable}} instead of hardcoded routing strings

Performance:
- orchestrator.mjs: add loadTeamsSpec() cache (Map keyed by agentkitRoot) so
  resolveTeamByArea() and computeEscalation() read teams.yaml at most once per
  process. Export clearTeamsSpecCache() for test isolation.

Robustness:
- computeEscalation(): read operationsTeam from teams.yaml config instead of
  hardcoding 'team-quality'
- issue-label-validation.yml: add workflow_dispatch trigger with optional
  issue_number input for manual dry-run testing

All 597 tests pass.

https://claude.ai/code/session_01Ue9aaiqqt1iHDx8KNwQ92m
The Copilot prompt template now uses {{intakeAreaRoutingTable}} which
renders the area→team routing as a compact inline string instead of a
full markdown table.

https://claude.ai/code/session_01Ue9aaiqqt1iHDx8KNwQ92m
Merge PR #237 changes into fresh branch from dev.
Resolve merge conflict in synchronize.mjs by keeping both
buildTeamVars and buildAreaRoutingTable functions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Handle workflow_dispatch event by fetching issue via REST API
- Add required field validation for Area and Priority (error on missing)
- Remove stale area/priority/severity/invalid-fields labels before reapplying
- Escape user-controlled values in validation comments to prevent @mention spam

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

AgentKit Forge Source Change Detected

This PR modifies files in the AgentKit Forge source directories:

  • .agentkit/templates/ — output templates
  • .agentkit/spec/ — YAML specifications
  • .agentkit/engines/ — sync engine code
  • .agentkit/overlays/ — per-repo customizations
  • .agentkit/bin/ — CLI scripts

These are the upstream source-of-truth for all generated AI tool configs.

Review checklist

  • Changes are intentional and not accidental AI agent modifications
  • Spec schema validation passes (pnpm -C .agentkit agentkit:spec-validate)
  • Sync produces expected output (pnpm -C .agentkit agentkit:sync)
  • No secrets or credentials in template variables
  • Breaking changes documented in an ADR

AI agents: Do not modify these files directly. Propose changes in a dedicated PR.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

This PR introduces team routing and escalation infrastructure for issues via new orchestrator functions, extends validation to check issue template dropdowns against canonical enums, adds area and severity fields to task management, converts GitHub issue templates to YAML form format with structured fields, normalizes severity values from uppercase to lowercase, and updates documentation and templates to reflect the new routing and validation semantics.

Changes

Cohort / File(s) Summary
Orchestrator & Routing
orchestrator.mjs, orchestrator.test.mjs, synchronize.mjs, .agentkit/spec/teams.yaml
Adds resolveTeamByArea(), computeEscalation(), and clearTeamsSpecCache() functions with teams.yaml config loading; introduces area-to-team routing with caching and escalation logic based on priority/severity/impact; adds route building for sync templates.
Validation & Schema
spec-validator.mjs, validate.mjs, validate.test.mjs
Extends PROJECT_ENUMS with issueArea, issuePriority, issueSeverity, issueImpact constants; adds Phase 9 issue template validation that parses and validates dropdown fields against enums; includes tests for valid/invalid options and malformed templates.
Severity Normalization
review-runner.mjs, review-runner.test.mjs
Exports new normalizeSeverity() function to standardize severity inputs to lowercase (critical/high/medium/low); updates internal severity values and high-severity detection logic to use canonical lowercase format.
Task Protocol Enhancement
task-protocol.mjs
Adds TASK_AREAS and TASK_SEVERITIES constants; extends createTask() and listTasks() to validate/filter by area and severity; updates formatTaskSummary() to display area and severity; adds P4 priority level.
GitHub Issue Templates
.agentkit/templates/github/ISSUE_TEMPLATE/bug_report.yml, feature_request.yml, config.yml, .github/ISSUE_TEMPLATE/bug_report.yml, feature_request.yml, config.yml
Converts bug_report from markdown to YAML form template with dropdowns for area, priority, severity, phase, impact; adds new feature_request.yml with structured form fields; adds config.yml disabling blank issues and linking security advisories.
GitHub Actions Automation
.github/workflows/issue-label-validation.yml
Introduces workflow that validates issue field values on open/edit events; extracts area/priority/severity/phase/impact from issue body; applies normalized labels (area:*, priority:*, severity:*); comments with validation errors and removes stale labels.
Documentation & Templates
.agentkit/templates/claude/commands/..., .agentkit/templates/codex/skills/..., .agentkit/templates/copilot/prompts/..., .agentkit/templates/cursor/commands/..., .agentkit/templates/windsurf/templates/..., .github/prompts/...
Updates multiple prompt/template files to reflect lowercase severity taxonomy (critical/high/medium/low), adds "Canonical Field Values" and "Area Labels" sections, introduces "Issue Field Routing" blocks with area-to-team mappings and escalation rules, updates issue filing and backlog sync guidance.
Deleted Files
.agentkit/templates/github/ISSUE_TEMPLATE/bug_report.md, .github/ISSUE_TEMPLATE/bug_report.md
Removes markdown-based bug report templates (36 + 40 lines), replaced by YAML form templates.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

forge-source-change, needs-maintainer-review

Poem

🐰 Hops through routing rules with glee,
Areas mapped to teams with plea,
Severity lowercase, oh what a sight,
Escalations bubble up just right!
YAML forms replace old markdown ways,
Teams get their issues in organized trays!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main changes: adding issue field validation workflow and structured issue templates, which are the primary objectives evident in the raw summary.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/issue-field-validation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@JustAGhosT JustAGhosT merged commit 39e77cd into dev Mar 5, 2026
15 of 16 checks passed
@JustAGhosT JustAGhosT deleted the feat/issue-field-validation branch March 5, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants