Skip to content

feat: PR lifecycle skill + readiness check expansion (9 → 11 checks)#870

Closed
diberry wants to merge 1 commit intodevfrom
squad/pr-lifecycle-skill
Closed

feat: PR lifecycle skill + readiness check expansion (9 → 11 checks)#870
diberry wants to merge 1 commit intodevfrom
squad/pr-lifecycle-skill

Conversation

@diberry
Copy link
Copy Markdown
Collaborator

@diberry diberry commented Apr 5, 2026

Summary

Adds a comprehensive PR lifecycle skill and expands the readiness check system from 9 to 11 checks.

New skill: .copilot/skills/pr-lifecycle/SKILL.md

Canonical Copilot-agent lifecycle covering 6 phases:

  1. Issue pickup (branch naming, capability check)
  2. Implementation (build/test/lint, staging safety, single commit)
  3. PR creation (target dev, title format, labels)
  4. PR readiness (all 11 checks documented with fix-it instructions)
  5. Post-creation maintenance (review feedback, rebasing, CI)
  6. Merge & cleanup (preconditions, branch deletion, issue close)

Includes gap analysis with 3 recommendations (2 implemented, 1 deferred).

New readiness checks in \scripts/pr-readiness.mjs\

Check Type Purpose
\checkIssueLinkage()\ Hard gate Requires \Closes #N\ (or equivalent) in PR body or commit message
\checkProtectedFiles()\ Informational Warns when zero-dependency bootstrap files are modified

Both use data already fetched by the orchestrator — zero new API calls.

Tests

90 tests passing (up from 88 before adjusting for new checks). New test coverage:

  • \checkIssueLinkage: 8 test cases
  • \checkProtectedFiles: 5 test cases
  • Run orchestrator tests updated from 9 → 11 check expectations

Deferred

\checkRequiredChecksPresent()\ — would verify expected CI check names ran. Needs team agreement on required check list. Documented in skill's gap analysis section.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Copilot AI review requested due to automatic review settings April 5, 2026 19:55
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

🟡 Impact Analysis — PR #870

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 6
Files added 2
Files modified 4
Files deleted 0
Modules touched 4

🎯 Risk Factors

  • 6 files changed (6-20 → MEDIUM)
  • 4 modules touched (2-4 → MEDIUM)

📦 Modules Affected

copilot-config (1 file)
  • .copilot/skills/pr-lifecycle/SKILL.md
scripts (2 files)
  • scripts/pr-readiness.mjs
  • scripts/security-review.mjs
squad-state (2 files)
  • .squad/agents/procedures/history.md
  • .squad/decisions/inbox/procedures-pr-lifecycle-skill.md
tests (1 file)
  • test/pr-readiness.test.ts

This report is generated automatically for every PR. See #733 for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 3eddbbe

PR Scope: 🔧 Infrastructure

⚠️ 3 item(s) to address before review

Status Check Details
Single commit 1 commit — clean history
Not in draft Ready for review
Branch up to date Up to date with dev
Copilot review No Copilot review yet — it may still be processing
Changeset present No source files changed — changeset not required
Scope clean ⚠️ PR includes 2 .squad/ file(s) — ensure these are intentional
No merge conflicts No merge conflicts
Copilot threads resolved 1 unresolved Copilot thread(s) — fix and resolve before merging
CI passing 16 check(s) still running

Files Changed (6 files, +756 −5)

File +/−
.copilot/skills/pr-lifecycle/SKILL.md +537 −0
.squad/agents/procedures/history.md +14 −0
.squad/decisions/inbox/procedures-pr-lifecycle-skill.md +37 −0
scripts/pr-readiness.mjs +57 −0
scripts/security-review.mjs +2 −0
test/pr-readiness.test.ts +109 −5

Total: +756 −5


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

⚠️ Squad File Leakage Detected

The following .squad/ files were modified in this PR:

  • .squad/agents/procedures/history.md
  • .squad/decisions/inbox/procedures-pr-lifecycle-skill.md

These files affect team routing, agent charters, and decisions.
If intentional, ensure approval from the team lead.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Copilot skill documenting the end-to-end PR lifecycle and extends the PR readiness orchestrator from 9 → 11 checks by introducing issue-linkage enforcement and a protected-bootstrap-files warning.

Changes:

  • Added checkIssueLinkage() (hard gate) and checkProtectedFiles() (informational) to scripts/pr-readiness.mjs, plus exported PROTECTED_FILES.
  • Updated run() orchestration and unit tests to expect and validate 11 readiness checks.
  • Introduced a new .copilot/skills/pr-lifecycle/SKILL.md skill and recorded the decision/history entries for the change.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scripts/pr-readiness.mjs Adds 2 new check functions and wires them into the readiness run (11 total checks).
test/pr-readiness.test.ts Adds/updates tests for the 2 new checks and updates run expectations from 9 → 11.
.copilot/skills/pr-lifecycle/SKILL.md New “PR lifecycle” skill/runbook intended to be canonical for agents.
.squad/decisions/inbox/procedures-pr-lifecycle-skill.md New decision record capturing the skill + readiness expansion.
.squad/agents/procedures/history.md Adds an agent history entry describing the work and rationale.

Comment thread .copilot/skills/pr-lifecycle/SKILL.md Outdated
Comment on lines +171 to +175
### Phase 4 — PR Readiness

An automated readiness check runs on every push and posts a checklist comment on the PR. All 9 checks must pass before review.

#### Check 1: Single Commit
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

Phase 4 still says “All 9 checks must pass” and the checklist only documents checks 1–9. Since pr-readiness.mjs now emits 11 checks, add documentation for the new checks (Issue linked + Protected files) and update the wording/count throughout this section.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

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.

This was already addressed in commit de965d0. Phase 4 now says "All 11 checks must pass before review" and includes full documentation tables for Check 10 (Issue Linked) and Check 11 (Protected Files informational).

Comment thread .copilot/skills/pr-lifecycle/SKILL.md Outdated
Comment thread .copilot/skills/pr-lifecycle/SKILL.md
@diberry diberry force-pushed the squad/pr-lifecycle-skill branch 2 times, most recently from 4682699 to de965d0 Compare April 6, 2026 01:27
diberry added a commit that referenced this pull request Apr 6, 2026
…s expansion, spam protection (PRD #872)

Implements PRD #872 — CI/GitHub Actions Performance Optimization.

Phase 0+1: Consolidation
- Repo Health: 5 jobs → 1 job with sequential steps + GITHUB_STEP_SUMMARY
- Policy Gates: 4 jobs → 1 consolidated job (publish-policy kept separate)
- PR Readiness: Remove synchronize/reopened from pull_request_target (fix double-trigger)
- Concurrency groups added to 10 workflows (true for validation, false for publish)

Phase 2: Path Filters
- Added code path filter with fail-open semantics to squad-ci.yml
- Docs-only PRs skip test, policy-gates, exports-map, samples-build, export-smoke

Phase 4: Publish Pipeline
- Removed redundant build job from insider-publish (test already builds)

PR Readiness Expansion (from #870):
- Added checkIssueLinkage() and checkProtectedFiles() checks (9 → 11)
- Added PR lifecycle skill (.copilot/skills/pr-lifecycle/SKILL.md)
- 13 new tests for readiness checks

Comment Spam Protection (from #800):
- Added scripts/lock-stale.mjs and scripts/moderate-spam.mjs
- Added squad-comment-moderation.yml workflow
- Added lock-stale and moderate-spam test suites

All safety gates preserved. No product template files modified.
Target: ~19 runners per PR push → ~11.

Closes #872

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry added a commit that referenced this pull request Apr 6, 2026
… 0-2, 4-5)

Phase 0+1: Consolidation
- Repo Health: 5 jobs to 1 job with sequential steps + GITHUB_STEP_SUMMARY
- Policy Gates: 4 jobs to 1 consolidated job (publish-policy kept separate)
- PR Readiness: Remove synchronize/reopened from pull_request_target (fix double-trigger)
- Concurrency groups added to 10 workflows (true for validation, false for publish)

Phase 2: Path Filters
- Added code path filter with fail-open semantics to squad-ci.yml
- Docs-only PRs skip test, policy-gates, exports-map, samples-build, export-smoke

Phase 4: Publish Pipeline
- Removed redundant build job from insider-publish (test already builds)

PR Readiness Expansion (from #870):
- Added checkIssueLinkage() and checkProtectedFiles() checks (9 to 11)
- Added PR lifecycle skill (.copilot/skills/pr-lifecycle/SKILL.md)
- 13 new tests for readiness checks

Security fixes:
- Fix script injection in repo-health comment steps (env: block instead of inline interpolation)
- Gate policy-gates job to pull_request events only (prevents undefined PR context on push)

All safety gates preserved. No product template files modified.

Closes #872

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Create comprehensive .copilot/skills/pr-lifecycle/SKILL.md covering the
full issue-to-merge lifecycle with all readiness checks documented.

Add two new checks to scripts/pr-readiness.mjs:
- checkIssueLinkage(): hard gate requiring issue reference in PR body/commits
- checkProtectedFiles(): informational warning for zero-dependency bootstrap files

Tests updated: 90 passing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry diberry force-pushed the squad/pr-lifecycle-skill branch from 4d30cd3 to 3eddbbe Compare April 6, 2026 12:50
@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Apr 6, 2026

Closing — content (readiness checks + PR lifecycle skill) already absorbed into #873. The security-review.mjs skip for SKILL.md is also in #873. Follow-up issue will track adopting waza's ComplianceChecker for proper markdown-aware skill scanning.

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.

3 participants