fix: address PR #226 review comments and labeler workflow issues#229
Conversation
Spec-to-Implementation ValidationWarning No spec references found This PR does not reference any specifications (REQ-, DESIGN-, TASK-*, or linked issues). How to add spec referencesAdd spec references to your PR description to enable traceability:
Spec Requirement by PR Type:
See PR template for full guidance. Powered by AI Spec Validator - Validation skipped - no specs found |
There was a problem hiding this comment.
Code Review
This pull request introduces a set of valuable fixes and improvements across workflows, scripts, and agent command definitions. The changes in labeler.yml correctly implement file globbing with negations, resolving a potential bug in issue labeling. The updates to Invoke-BatchPRReview.ps1 significantly improve error diagnostics by including git's output in error messages. The refactoring of .claude/commands/pr-review.md not only aligns it with the new slash command documentation format but also corrects several bash syntax errors in the code examples. I have one suggestion to further improve the robustness of a script example in the markdown file.
AI Quality Gate ReviewCaution ❌ Final Verdict: CRITICAL_FAIL WalkthroughThis PR was reviewed by six AI agents in parallel, analyzing different aspects of the changes:
Review Summary
Analyst Review DetailsLet me check the original PR #226 in the correct organization and examine the diff more closely. I have sufficient information from the local files to complete the analysis. Let me now analyze the changes. Code Quality Score
Overall: 5/5 Impact Assessment
Findings
Recommendations
VerdictSecurity Review DetailsSecurity Report: PR ReviewFindings
Analysis1. Workflow Security (label-pr.yml) The
[PASS] - Appropriate security controls documented. 2. Workflow Security (label-issues.yml)
3. PowerShell Script (Invoke-BatchPRReview.ps1)
4. Command File (pr-review.md)
5. Secret Detection No hardcoded credentials, API keys, or tokens detected in any changed files. 6. Labeler Configuration (.github/labeler.yml) The change from RecommendationsNone required. All changes follow security best practices. VerdictQA Review DetailsLet me validate the YAML syntax and review the code changes: Now I have comprehensive context. Let me produce the QA Test Report. Test Report: PR #227 - Fix PR #226 Review Comments and Labeler Workflow IssuesSummary
StatusCRITICAL_FAIL Test Coverage Assessment
EvidenceQuality Concerns
Regression Risk Assessment
Detailed Analysis1.
|
| Action | Before | After |
|---|---|---|
actions/github-script |
@v7 |
@f28e40c7f34bde8b3046d885e986cb6290c5673b |
actions/labeler |
@v5 |
@8558fd74291d67161a8a78ce36a881fa63b766a9 |
Assessment: Complies with repository security policy requiring full commit SHA pinning.
5. .claude/commands/pr-review.md Changes
Assessment: Documentation-only changes following Claude Code Slash Commands format. Added YAML frontmatter, simplified workflow steps. No functional code changes.
Gaps Identified
| Gap | Impact |
|---|---|
No Pester tests for Invoke-BatchPRReview.ps1 |
Unable to verify error handling works correctly |
| No workflow integration tests | Labeler changes require manual validation |
| Regex pattern changes untested | Title vs content matching logic not verified |
Recommendations
-
Add Pester tests for
Invoke-BatchPRReview.ps1covering:New-PRWorktreewith git failuresRemove-PRWorktreewith git failures- Error message includes captured output
-
Manual validation required before merge:
- Create test issue with title
[bug]: Testand bodyadd new feature - Verify only
buglabel applied (notenhancementdue to "add") - Create test PR with changes to
.agents/*.mdonly - Verify
documentationlabel is NOT applied
- Create test issue with title
-
Consider adding regex unit tests for label-issues.yml patterns
Final Verdict
VERDICT: CRITICAL_FAIL
MESSAGE: scripts/Invoke-BatchPRReview.ps1 has 281 lines with zero test coverage for new error handling
EVIDENCE:
- Tests found: 0 for 1 modified function (New-PRWorktree, Remove-PRWorktree)
- Edge cases: Missing - git stderr capture not tested
- Error handling: Untested - error message formatting not verified
- Blocking issues: 1 (untested error handling in I/O operations)
Rationale: Per QA guidelines, "Untested error handling for I/O, network, or file operations" is a CRITICAL_FAIL condition. The changes to New-PRWorktree and Remove-PRWorktree modify error handling for git operations (I/O) without corresponding tests.
Architect Review Details
Design Quality Assessment
| Aspect | Rating (1-5) | Notes |
|---|---|---|
| Pattern Adherence | 4 | Changes follow established patterns, proper SHA pinning, defensive error handling |
| Boundary Respect | 5 | Clear separation: workflows, scripts, command definitions stay in their domains |
| Coupling | 5 | No new dependencies introduced, changes are isolated |
| Cohesion | 4 | Each file has single responsibility; minor documentation compression in pr-review.md |
| Extensibility | 4 | Regex patterns are maintainable, error output capture is reusable pattern |
Overall Design Score: 4.4/5
Architectural Concerns
| Severity | Concern | Location | Recommendation |
|---|---|---|---|
| Low | all-globs-to-all-files with multiple entries may not behave as expected |
.github/labeler.yml:54-61 |
Verify logic: all-globs requires ALL patterns to match ALL files; splitting into separate changed-files blocks is correct approach taken |
| Low | pr-review.md reduced from 166 to 153 lines; removed Prerequisites and Related Commands sections | .claude/commands/pr-review.md |
Acceptable if Claude Code slash command format requires this; verify prerequisite info is available elsewhere |
Breaking Change Assessment
- Breaking Changes: No
- Impact Scope: None
- Migration Required: No
- Migration Path: N/A
All changes are backwards-compatible:
- SHA pinning does not change action behavior
- Regex fixes make patterns more precise (reduce false positives)
- Error output capture adds information without changing control flow
Technical Debt Analysis
- Debt Added: Low (none significant)
- Debt Reduced: Medium (fixes regex over-matching, improves error diagnostics, standardizes command format)
- Net Impact: Improved
ADR Assessment
- ADR Required: No
- Decisions Identified: None requiring ADR
- Existing ADR: N/A
- Recommendation: N/A
Changes are bug fixes and compliance corrections, not architectural decisions. SHA pinning is existing repo policy, not a new decision.
Recommendations
- Add integration test for labeler.yml patterns using
actions/labelerdry-run mode if available - Consider documenting the
all-globs-to-all-filesvsany-glob-to-any-filedistinction in a comment for future maintainers
Verdict
VERDICT: PASS
MESSAGE: Bug fixes and compliance corrections with no architectural impact. Changes reduce false positives in labeling, improve error diagnostics, and follow existing repo policies for SHA pinning.
Roadmap Review Details
Let me check the product roadmap to understand strategic alignment.
Strategic Alignment Assessment
| Criterion | Rating | Notes |
|---|---|---|
| Aligns with project goals | High | Fixes workflow automation and improves CI reliability. Supports multi-platform agent consistency. |
| Priority appropriate | High | Bug fixes to existing infrastructure. Addresses issues from prematurely merged PR #226. |
| User value clear | Medium | Indirect value through improved automation and error reporting. |
| Investment justified | High | Small, surgical fixes to existing code. Low effort, high reliability improvement. |
Feature Completeness
- Scope Assessment: Right-sized. Fixes specific issues identified in review comments.
- Ship Ready: Yes. Changes are minimal and targeted.
- MVP Complete: Yes. All identified issues from PR feat(workflows): add static PR and issue labeling workflows #226 review are addressed.
- Enhancement Opportunities: None. This is a corrective PR, not a feature.
Impact Analysis
| Dimension | Assessment | Notes |
|---|---|---|
| User Value | Medium | Improves automation reliability. Prevents false positive labels. |
| Business Impact | Low | Infrastructure maintenance, no direct user-facing features. |
| Technical Leverage | Medium | Proper action pinning sets security baseline. Better error output aids debugging. |
| Competitive Position | Neutral | Standard maintenance work. |
Concerns
| Priority | Concern | Recommendation |
|---|---|---|
| Low | Test plan items unchecked | Ensure label workflows are tested before merge. |
Recommendations
- This PR demonstrates proper remediation of a prematurely merged PR. The root cause analysis is documented.
- The changes align with repository policy (SHA pinning for actions) and correct genuine bugs (regex patterns, labeler negation).
- The retrospective and P1 issue commitment for guardrail improvements is appropriate.
Verdict
VERDICT: PASS
MESSAGE: Corrective maintenance PR that aligns with infrastructure reliability goals. Fixes legitimate bugs in CI workflows and improves error reporting in scripts. Low risk, appropriate scope.
DevOps Review Details
Based on my review of the changes, here is my DevOps analysis:
Pipeline Impact Assessment
| Area | Impact | Notes |
|---|---|---|
| Build | None | No build process changes |
| Test | None | No test infrastructure changes |
| Deploy | None | No deployment changes |
| Cost | None | Workflows run same duration |
CI/CD Quality Checks
| Check | Status | Location |
|---|---|---|
| YAML syntax valid | ✅ | All workflow files properly structured |
| Actions pinned | ✅ | label-pr.yml:38, label-issues.yml:36 |
| Secrets secure | ✅ | Only ${{ secrets.GITHUB_TOKEN }} used, proper masking |
| Permissions minimal | ✅ | label-pr.yml:18-19, label-issues.yml:14-15 |
| Shell scripts robust | ✅ | Invoke-BatchPRReview.ps1:86-89, 164-167 |
Findings
| Severity | Category | Finding | Location | Fix |
|---|---|---|---|---|
| Low | Documentation | Security comment added for pull_request_target |
label-pr.yml:7-11 | Good addition - no action needed |
Positive Changes Verified
- Actions pinned to SHA - Both
actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9andactions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673bare properly pinned with version comments - Labeler negation fix - Using
all-globs-to-all-filesfor patterns with!negation is correct per actions/labeler documentation - Regex improvements - Separating title prefix checks (
/^\[?bug\]?:?/i.test(title)) from content keyword matching (/\bbug\b/) reduces false positives - Removed overly generic patterns - Removing
\badd\band\bnew\bprevents false enhancement labels - Error output capture - PowerShell script now captures and displays git error output for better debugging
Template Assessment
- PR Template: Not modified in this PR
- Issue Templates: Not modified in this PR
- Template Issues: N/A
Automation Opportunities
| Opportunity | Type | Benefit | Effort |
|---|---|---|---|
| None identified | - | - | - |
Recommendations
- The
.claude/commands/pr-review.mdrefactoring is cleaner and follows Claude Code Slash Commands format correctly - Consider adding workflow dispatch trigger for manual testing of labeler workflows
VERDICT: PASS
MESSAGE: CI/CD changes are well-configured with proper action pinning, correct labeler pattern syntax, and improved error handling.
Run Details
| Property | Value |
|---|---|
| Run ID | 20421157995 |
| Triggered by | pull_request on 229/merge |
| Commit | c7dfd8952d7c2ebec9c2bd35fbb4e86dd232bef8 |
Powered by AI Quality Gate - View Workflow
Document complete guardrail failure during autonomous agent execution: - 7 MUST protocol violations - 6 defects merged to main - Root cause: trust-based compliance fails under autonomy Creates P1 issue #230 for technical guardrail implementation. Refs: #226, #229, #230 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses technical debt from PR #226, which was merged prematurely without proper review. The changes focus on fixing workflow configuration issues, improving error handling, and updating documentation to follow proper standards.
Key changes:
- Fixed GitHub Actions labeler workflows with proper SHA pinning and corrected regex patterns
- Improved PowerShell error diagnostics by capturing git command output
- Updated Claude command documentation to follow standard frontmatter format
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
scripts/Invoke-BatchPRReview.ps1 |
Enhanced error messages by capturing and displaying git command output for worktree operations |
.github/workflows/label-pr.yml |
Pinned actions/labeler to commit SHA and added security documentation for pull_request_target usage |
.github/workflows/label-issues.yml |
Pinned actions/github-script to commit SHA and fixed bug/feature regex patterns to separate title prefix checks from content keyword matching |
.github/labeler.yml |
Fixed negation pattern handling by using all-globs-to-all-files for patterns with ! negation |
.claude/commands/pr-review.md |
Streamlined documentation with YAML frontmatter and simplified workflow instructions |
|
Caution Review failedThe pull request is closed. Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughAdds a PR Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Possibly related issues
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro 📒 Files selected for processing (7)
Comment |
|
Caution Review failedFailed to post review comments Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughThese changes document an incident failure, refactor PR review guidance, harden GitHub Actions workflows with pinned action versions, refine labeling rules for markdown files, and enhance error reporting in PowerShell worktree management functions. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
…rees Add Claude command for processing multiple PR review comments in parallel: - .claude/commands/pr-review.md: Main command documentation with usage examples - .claude/commands/batch-pr-review.md: Detailed workflow specification - scripts/Invoke-BatchPRReview.ps1: PowerShell helper for worktree management Features: - Process single or multiple PRs (comma-separated or all-open) - Optional parallel execution with git worktrees for isolation - Automatic cleanup: commit uncommitted changes, push, remove worktrees - Progress monitoring and summary table output - Error recovery for common failure scenarios Usage: /pr-review 194 # Single PR /pr-review 53,141,143 --parallel # Multiple PRs with worktrees /pr-review all-open --parallel # All open PRs needing review Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Clarify pr-comment-responder skill is optional (comment 2638201580, 2638201614) - Improve warning message with actionable guidance (comment 2638201588) - Add $LASTEXITCODE checks after git operations (comment 2638201593) - Use default push behavior instead of hardcoded 'origin' (comment 2638201619) - Add language specifier to usage code block (markdownlint MD040) Comment 2638201604 dismissed as false positive - commit message already contains "session" as shown in line 193. Comment 2638201612 (missing tests) deferred to follow-up issue. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ommands format - Add YAML frontmatter with description, argument-hint, and allowed-tools - Use $ARGUMENTS for dynamic argument capture - Add !-prefixed bash commands for context execution - Streamline content while preserving critical constraints Follows: https://code.claude.com/docs/en/slash-commands Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Repository policy requires all actions to be pinned to full-length commit SHAs. - actions/labeler@v5 → @8558fd74291d67161a8a78ce36a881fa63b766a9 - actions/github-script@v7 → @f28e40c7f34bde8b3046d885e986cb6290c5673b Fixes workflow run 20420863324 failure. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes issues identified in Copilot review comments: label-issues.yml: - Fix bug/feature regex patterns: separate title prefix checks from content keyword matching (prefix patterns now check title only, not combined content) - Remove overly generic patterns (\badd\b, \bnew\b) that caused false positives labeler.yml: - Fix negation patterns: use all-globs-to-all-files for patterns with ! negation (any-glob-to-any-file doesn't properly handle negation patterns) label-pr.yml: - Add security comment explaining pull_request_target is safe for labeler (action only reads file paths, doesn't execute PR code) Invoke-BatchPRReview.ps1: - Capture and display git error output in New-PRWorktree - Capture and display git error output in Remove-PRWorktree Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document complete guardrail failure during autonomous agent execution: - 7 MUST protocol violations - 6 defects merged to main - Root cause: trust-based compliance fails under autonomy Creates P1 issue #230 for technical guardrail implementation. Refs: #226, #229, #230 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0bd8105 to
dda0eaa
Compare
…rotocol compliance
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
.claude/commands/pr-review.md (1)
91-102: Fix bash placeholder syntax.Past review comment remains unresolved:
{main_repo}is not valid bash syntax. Use$main_repoif it's a variable, or replace with actual command likegit rev-parse --show-toplevel. The placeholder appears to be documentation-only but could confuse users trying to execute the code.🔎 Suggested fix
-cd "{main_repo}" +cd "$(git rev-parse --show-toplevel)" for pr in pr_numbers; do worktree_path="../worktree-pr-${pr}" cd "$worktree_path" status="$(git status --short)" if [[ -z "$status" ]]; then - cd "{main_repo}" + cd "$(git rev-parse --show-toplevel)" git worktree remove "$worktree_path" else echo "WARNING: worktree-pr-${pr} has uncommitted changes" fi done
🧹 Nitpick comments (1)
📜 Review details
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
.agents/retrospective/2025-12-22-pr-226-premature-merge-failure.md.claude/commands/pr-review.md.github/labeler.yml.github/workflows/label-issues.yml.github/workflows/label-pr.yml.serena/memories/skill-autonomous-execution-guardrails.mdscripts/Invoke-BatchPRReview.ps1
🧰 Additional context used
📓 Path-based instructions (71)
{.github/workflows/*,*/.githooks/*,Dockerfile}
📄 CodeRabbit inference engine (.agents/governance/interviews/security-interview.md)
Review infrastructure code changes including GitHub Actions workflows, git hooks, and Dockerfile for security vulnerabilities
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
{.githooks/**,**/.github/**,**/infrastructure/**,**/config/**,**/*.tf,**/*.yml,**/*.yaml}
📄 CodeRabbit inference engine (.agents/metrics/baseline-report.md)
Infrastructure files (including
.githooks/pre-commit) must receive security review before deployment
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml.github/labeler.yml
.github/workflows/*
📄 CodeRabbit inference engine (.agents/metrics/dashboard-template.md)
Ensure infrastructure files in GitHub workflows directory are reviewed by agents with target rate of 100%
Implement full CodeRabbit enforcement for CI/CD workflow files in
.github/workflows/directory
.github/workflows/*: Detect files matching.github/workflows/*as infrastructure changes requiring specialist review from devops and security agents
GitHub Actions workflows must include an explicitpermissionsblock with minimally privileged permissions
GitHub Actions workflows must not usepull_request_targettrigger withactions/checkoutaction using pull request head SHA reference, as this creates a dangerous security pattern
GitHub Actions workflows requiring test reporting must explicitly grantchecks: writepermission for dorny/test-reporter compatibility
GitHub Actions workflows must avoid using overly permissivepermissions: write-alland instead use explicit minimal permissions
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
.github/workflows/*.{yml,yaml}
📄 CodeRabbit inference engine (.agents/security/infrastructure-file-patterns.md)
GitHub Actions workflow files (
.github/workflows/*.ymland.github/workflows/*.yaml) should trigger security agent review due to critical security implicationsAdd security detection check to CI/CD pipelines to analyze staged files for infrastructure changes before implementation
.github/workflows/*.{yml,yaml}: Infrastructure files (.github/workflows/) require devops and security agent review before commit
Add pre-commit validation that fails on infrastructure files (.github/workflows/) lacking security review documentation
Infrastructure files must include a security impact analysis document before creation or modification
Retroactive security review is required for quick-fix changes to workflow files made without pre-commit review
Workflow files must validate that all required permissions are explicitly declared and justifiedKeep workflow YAML files light and thin - MUST NOT put complex logic in workflow YAML files; use thin workflows with calls to external testable modules or skills
GitHub Actions workflows should remain thin and delegate complex logic to PowerShell modules rather than embedding bash-like commands in workflow YAML run blocks
.github/workflows/*.{yml,yaml}: Never use|| truepattern without explicit error handling and ADR justification
Do not use|| trueerror suppression in workflows without documenting rationale in an ADRUse thin workflow pattern: minimize logic in YAML files, delegate complex operations to PowerShell modules
.github/workflows/*.{yml,yaml}: Use YAML heredoc with proper indentation for multi-line GitHub Actions values
Use GH_TOKEN for auto-authentication in GitHub Actions shell scripts
Use fixed-length lookbehinds for regex patterns in GitHub Actions
GitHub Actions outputs must be single-line format
Matrix jobs in GitHub Actions should use artifacts for output storage
Use environment variables for shell command interpolation in GitHub Actions to prevent injection vulnerabilities
Use verdict tokens for str...
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
{.github/workflows/**,{.githooks,husky}/**,**/Auth/**,**/Security/**}
📄 CodeRabbit inference engine (.agents/utilities/security-detection/SKILL.md)
CI/CD workflow files (
.github/workflows/*), git hooks (.githooks/*,.husky/*), and authentication code (**/Auth/**,**/Security/**) require security agent review (CRITICAL level)
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
.github/workflows/*.yml
📄 CodeRabbit inference engine (.agents/analysis/pr41-issue-analysis.md)
.github/workflows/*.yml: Usedotnet-nunitreporter indorny/test-reporter@v1when Pester tests output NUnitXml format
Add explicit permissions block to GitHub Actions workflow jobs, specifying minimal required permissions (e.g.,contents: readandchecks: writefor test reporting workflows)
.github/workflows/*.yml: Use minimal GitHub Actions permissions in CI workflows
Addworkflow_dispatchtrigger to GitHub Actions workflows for manual triggering capability
Add PowerShell-Yaml module installation step in CI workflows
Useubuntu-latestfor drift detection CI workflows for lighter weight execution
Add issue deduplication for drift alerts in GitHub Actions workflows
Use path filtering appropriately scoped in GitHub Actions workflowsCI/CD pipeline must include a drift-linting job that compares Claude agent content against generated VS Code and Copilot CLI variants on every PR modifying agent files
Create automated CI validation to detect absolute paths (Windows, macOS, Linux patterns) in markdown files with colored output, line numbers, and remediation steps
Configure concurrency groups in GitHub Actions workflows to prevent comment spam and race conditions when multiple commits trigger parallel workflow runs on the same PR
.github/workflows/*.yml: Remove silent|| trueerror suppression from critical operations; instead track failures in arrays and provide summarized error reporting at workflow completion
Use minimal token scopes in GitHub Actions workflows: usereposcope for read-only operations,issues:writefor issue modifications, and workflowpermissionsdeclarations following principle of least privilege
.github/workflows/*.yml: Store heredoc content in separate files instead of inline within YAMLrun:blocks to avoid YAML parsing errors when content lacks proper indentation
Usegithub.token(workflow's built-in token) for PR comments in GitHub Actions instead of service account PATs, as it automatically has write access t...
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
.github/**/*.yml
📄 CodeRabbit inference engine (.agents/planning/prd-pre-pr-security-gate.md)
Detect files matching
.github/**/*.ymlas infrastructure changes requiring specialist review from devops and security agents
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml.github/labeler.yml
.github/workflows/**/*.{yml,yaml}
📄 CodeRabbit inference engine (.agents/retrospective/pr-feedback-remediation.md)
Use 'ubuntu-latest' for CI runner preference instead of 'windows-latest' for significantly faster performance, except for PowerShell Desktop or Windows-specific features
.github/workflows/**/*.{yml,yaml}: Workflows should be thin and contain only orchestration logic; all business logic (parsing, validation, formatting) must be extracted to PowerShell modules (.psm1)
Keep workflow YAML files to a maximum of 100 lines (orchestration only)
Do not parse complex strings (verdict, labels, etc.) in workflow YAMLrun:blocks; delegate to PowerShell modules
Do not validate business rules directly in workflow YAML; delegate to PowerShell modules
All PowerShell scripting for workflows must be PowerShell-only (no bash or other shell languages embedded in workflows)
.github/workflows/**/*.{yml,yaml}: PowerShell used consistently for label and milestone parsing in AI workflow (extract parsing logic to AIReviewCommon.psm1::Get-LabelsFromAIOutput rather than inline bash)
Use ::error:: GitHub Actions format for error output instead of echo or Write-Error to ensure errors are properly captured and cause workflow failure
Remove all '|| true' patterns and silent failure suppression in workflow steps - errors must be aggregated and reported explicitly using ::error:: format
Add token masking with ::add-mask:: before using secrets in workflow run steps to prevent accidental token leakage in logs
Replace secrets.BOT_PAT with github.token for issue and PR operations to minimize token privileges and reduce security attack surface
Document minimum required token scopes in workflow comments for each operation (e.g., 'repo' scope for issue edit and label application, 'read' scope for readonly operations)
Extract AI workflow parsing logic to testable PowerShell module functions (AIReviewCommon.psm1) rather than inline bash - enables unit testing in isolation and reduces regression risk
.github/workflows/**/*.{yml,yaml}: Use bash/PowerShell error collection pattern: initialize FAILED_...
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
**/.github/workflows/*.{yml,yaml}
📄 CodeRabbit inference engine (.agents/skills/ci-runner-preference.md)
**/.github/workflows/*.{yml,yaml}: Useubuntu-latest(orlinux-latest) runners for GitHub Actions workflows instead ofwindows-latestfor better CI/CD pipeline performance
Only usewindows-latestrunner when PowerShell Desktop (5.1) is required, Windows-specific features are needed, or testing Windows-only scenarios
Prefer PowerShell Core (pwsh) over PowerShell Desktop for GitHub Actions scripts to enable cross-platform compatibility on Linux runnersWorkflows SHOULD be less than 100 lines, containing orchestration only. Business logic SHOULD be extracted to PowerShell modules (.psm1).
PowerShell workflow files must follow the thin-workflow pattern where orchestration logic stays in the workflow and business logic is extracted to reusable modules
Maintain consistent token scopes and authentication strategy throughout workflows; use the same token source for all related operations to avoid permission errors
**/.github/workflows/*.{yml,yaml}: Avoid code injection vulnerabilities by never directly interpolating unsanitized GitHub context variables (like${{ github.event.issue.title }}or${{ github.event.issue.body }}) into bash commands; instead save them to files using heredoc syntax and read them back
UsetoJSON()to escape GitHub context variables when passing them to bash commands, or employ input validation before using variables in shell contexts
GitHub Actions workflows should request only the minimum necessary permissions (principle of least privilege) required for their operations
**/.github/workflows/*.{yml,yaml}: When ≥2 GitHub Actions workflows share logic, extract to composite action with parameterized inputs for reusability
GitHub Actions workflow files should include YAML syntax validation and actionlint checks in pre-commit configuration
**/.github/workflows/*.{yml,yaml}: Use artifacts instead of job outputs for passing data between matrix jobs in GitHub Actions workflows
Use environment variables for shell variable expans...
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
.github/workflows/**
📄 CodeRabbit inference engine (.agents/steering/security-practices.md)
Implement OWASP Top 10 prevention practices in GitHub Actions workflows
Use secure defaults and minimal exposure for security misconfiguration prevention
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
⚙️ CodeRabbit configuration file
.github/workflows/**: SECURITY-CRITICAL PATH - ASSERTIVE ENFORCEMENT
Review for: - Authentication and authorization (secrets handling, OIDC) - Credential exposure (env vars, git output, logs) - Injection vulnerabilities (command injection, script injection) - Race conditions (concurrent jobs, artifact operations) - Resource exhaustion (limits on runners, matrix expansions)
Flag: - Unquoted variables in shell commands - Direct use of user input in scripts - Missing error handling and early exit conditions - Hardcoded secrets or credentials - Unsafe use of 3rd party actions
DO NOT IGNORE any security-related findings on this path.
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
.github/workflows/**/*.yml
📄 CodeRabbit inference engine (.agents/architecture/DESIGN-REVIEW-pr-60-remediation-architecture.md)
Use GitHub Actions workflow steps with PowerShell for JSON parsing and data manipulation; reserve bash only for simple npm install, git operations, and environment variable exports
Aggregate errors across workflow steps using error accumulation arrays and export failure summary via GITHUB_OUTPUT
.github/workflows/**/*.yml: GitHub Actions workflows orchestrating multiple agents should use matrix strategy withfail-fast: falseto ensure all reviews complete
Use artifact passing (not job outputs) to transfer data between workflow jobs when using matrix strategy
Implement idempotency in workflow comment generation using comment markers to distinguish update vs create operations
Use skip optimization to check for docs-only changes before executing expensive AI review jobs
Add CI validation step to verify prompt templates include required output format markers before merging
.github/workflows/**/*.yml: Replace bash parsing with PowerShell functions in GitHub Actions workflows - useGet-LabelsFromAIOutputandGet-MilestoneFromAIOutputfrom AIReviewCommon.psm1 instead of bash grep/tr/xargs to prevent command injection (CWE-78) and word splitting vulnerabilities (CWE-20)
In GitHub Actions workflows parsing AI output, never use bashxargs, unquoted variable expansion, orforloops with simple string parsing - replace with PowerShell cmdlets that handle structured output safely
Verify PowerShell Core is available on GitHub Actions ubuntu-latest runner before using PowerShell in workflows
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
**/.github/workflows/**/*.{yml,yaml}
📄 CodeRabbit inference engine (.agents/governance/PROJECT-CONSTRAINTS.md)
**/.github/workflows/**/*.{yml,yaml}: MUST NOT put business logic in workflow YAML files
SHOULD keep workflows under 100 lines (orchestration only)Workflows must be thin and composed of testable, reusable modules
Follow Copilot follow-up PR naming convention:
copilot/sub-pr-{original_pr_number}for branches targeting the original PR's base branch
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
**/.github/**/*.{yml,yaml,sh,bash}
📄 CodeRabbit inference engine (.agents/planning/PR-60/001-pr-60-review-gap-analysis.md)
Use unique identifiers (e.g., run ID, timestamp) for temporary file paths in CI/CD workflows to prevent conflicts in concurrent runs on shared runners
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml.github/labeler.yml
**/.github/workflows/**/*.yml
📄 CodeRabbit inference engine (.agents/planning/PR-60/004-pr-60-implementation-review.md)
**/.github/workflows/**/*.yml: Replace bash label parsing in GitHub Actions workflows with PowerShell validation to prevent command injection via untrusted AI output
Validate all label strings against regex pattern '^[\w-.\s]{1,50}$' before applying to GitHub issues
Validate all category strings against regex pattern '^[\w-]{1,30}$' before using in workflow outputs
Validate all milestone strings against regex pattern '^[\w-.\s]{1,50}$' before assigning to issues
Use explicit error handling with informative error messages instead of '|| true' for GitHub CLI (gh) commands that should not fail silently
Keep '|| true' only for commands where empty/missing results are valid expected outcomes (e.g., grep with no matches, find with no results)
Verify GitHub CLI authentication status is successful before attempting API operations in CI workflows
Log validation rejections with details (invalid format, rejected label) for debugging label application failures
Provide detailed error messages in GitHub Actions workflow steps including context (what failed, why, what to check)
Use PowerShell 'Write-Host' with color output for structured workflow logging instead of plain echo statements
Use '|| true' in workflows only for commands where missing data is an expected valid state; document the reason in comments
Validate workflow inputs and outputs against strict regex patterns before using them in GitHub API commands
**/.github/workflows/**/*.yml: Use environment variables instead of direct${{ }}template syntax in shell scripts to prevent shell injection attacks
Use artifacts instead of job outputs to pass data between matrix job legs, since outputs only expose one matrix leg
Prepare multi-line content via prior steps with GITHUB_OUTPUT heredoc syntax rather than attempting to execute shell commands in YAMLwith:inputsEnsure GitHub workflow YAML files that use skip-validation jobs include a checkout step if equivalent reference implementations contain one
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
**/.github/workflows/*.yml
📄 CodeRabbit inference engine (.agents/planning/PR-60/007-phase-1-detailed-schedule.md)
Use PowerShell-only code (no bash, Python, or shell scripts) with all workflow steps configured with 'shell: pwsh' per ADR-006
Use quoted heredoc (with 'EOF' delimiter) for safely handling github.event.pull_request.title and github.event.pull_request.body in bash env vars to prevent code injection
GitHub Actions workflows must use PowerShell functions from exported modules rather than inline bash parsing (grep/sed/tr) for consistent security and testability
In workflow comments, use explicit language about verdict behavior and consequences (e.g., 'should cause the check to FAIL (block merge)' rather than ambiguous phrasing)
**/.github/workflows/*.yml: Use PowerShell syntax (shell: pwsh) for GitHub workflow steps when handling untrusted AI output
Import PowerShell modules using correct relative path format (Import-Module .github/scripts/AIReviewCommon.psm1) in GitHub workflows to ensure module dependencies are properly resolved
Use PowerShell environment variables for all user input in GitHub workflows instead of direct bash variable interpolation to eliminate word-splitting vulnerabilitiesUse
$env:GITHUB_WORKSPACEwith absolute paths instead of relative./prefix when importing PowerShell modules in GitHub Actions workflows
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
**/.github/{scripts,workflows}/*.{sh,yml}
📄 CodeRabbit inference engine (.agents/planning/pr-60-focused-plan.md)
Use
sedwith POSIX character classes instead ofgrep -Pfor regex patterns to ensure portability across Linux and macOS (grep -P is GNU-only)
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
.github/{workflows,scripts}/**/*.{yml,yaml,sh}
📄 CodeRabbit inference engine (.agents/planning/pr-60-security-review.md)
.github/{workflows,scripts}/**/*.{yml,yaml,sh}: Avoid leaking sensitive information or internal configuration details in error messages and workflow logs that could be visible to attackers. Use generic error messages in production and reserve detailed diagnostics for debug logs only.
Sanitize and validate all untrusted user input (such as GitHub event data like PR titles, issue bodies, commit messages) before using in shell commands, API calls, or other operations that could interpret special characters.
When updating GitHub comments in workflows, use idempotent markers (HTML comments with unique identifiers) in comment bodies to enable safe updates by specific comment ID rather than relying on comment position.Enforce ADR-005 with pre-commit hook rejecting bash in
.github/workflows/and.github/scripts/directories
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
**/.github/{workflows,scripts,prompts}/**
📄 CodeRabbit inference engine (.agents/retrospective/2025-12-18-ai-workflow-implementation.md)
AI automation in CI/CD requires verdict tokens (PASS/WARN/CRITICAL_FAIL) for deterministic bash parsing without AI interpretation
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
{.github/**/*.sh,.github/workflows/*.yml,.github/actions/**/*.yml}
📄 CodeRabbit inference engine (.agents/sessions/2025-12-18-session-04-ai-workflow-debugging.md)
Avoid explicit
gh auth login --with-tokenwhen GH_TOKEN environment variable is already set, as gh CLI automatically uses the env var and will fail with exit code 1
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
**/.github/{workflows,actions}/**/*.yml
📄 CodeRabbit inference engine (.agents/sessions/2025-12-18-session-13-workflow-lessons.md)
Use composite actions to encapsulate reusable workflow steps (Node.js/npm/Copilot CLI setup, authentication, agent loading, verdict parsing)
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
**/.github/workflows/***.yml
📄 CodeRabbit inference engine (.agents/sessions/2025-12-18-session-13-workflow-lessons.md)
Convert single-job loops to multi-job matrix structures (detect → validate → aggregate) for parallel validation with artifact passing
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
{.github/**/*.{sh,yml,yaml},**/*.sh}
📄 CodeRabbit inference engine (.agents/sessions/2025-12-18-session-34-pr-60-comment-response.md)
{.github/**/*.{sh,yml,yaml},**/*.sh}: Avoidgh auth loginauthentication patterns; use session-based authentication instead (reference Session 04 for implementation details)
Use secret masking for sensitive tokens like BOT_PAT in shell commands and CI/CD workflows
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml.github/labeler.yml
**/{.github/workflows/*.yml,.github/scripts/*.psm1}
📄 CodeRabbit inference engine (.agents/qa/057-pr-222-import-module-standardization.md)
Standardize Import-Module paths to use
$env:GITHUB_WORKSPACEvariable instead of relative paths
Files:
.github/workflows/label-issues.yml.github/workflows/label-pr.yml
scripts/**/*.ps1
📄 CodeRabbit inference engine (.agents/security/infrastructure-file-patterns.md)
PowerShell scripts in scripts directory (
scripts/**/*.ps1) should trigger security agent review due to high security implicationsValidation scripts belong in
scripts/directory; may duplicate to.agents/utilities/for agent accessAll scripts must avoid credential handling and should not store or process sensitive authentication information
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{ps1,psm1,psd1}
📄 CodeRabbit inference engine (.agents/retrospective/2025-12-15-cva-install-scripts.md)
Extract environment variations to .psd1 data files, keeping logic generic rather than hardcoding configuration in scripts
Convert PathInfo objects to string representations when passing to string-typed parameters to prevent type mismatch errors
Files:
scripts/Invoke-BatchPRReview.ps1
scripts/**/*.{ps1,psm1,psd1}
📄 CodeRabbit inference engine (.agents/retrospective/2025-12-15-documentation-gap.md)
Create module-specific README documentation for PowerShell scripts and modules, including parameter documentation and usage examples
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{ps1,psd1}?(@(test|spec))
📄 CodeRabbit inference engine (.agents/retrospective/2025-12-15-install-scripts-session.md)
Use BeforeAll blocks for all variable initialization in Pester 5.x tests; avoid variable assignments outside BeforeAll during Discovery phase
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.ps1
📄 CodeRabbit inference engine (.agents/retrospective/2025-12-15-instruction-files-gap.md)
User instruction files should be excluded from agent file copying during installation to prevent them from being treated as agent files
Use
.Pathproperty to extract string value from PathInfo objects returned by Resolve-Path in PowerShell (e.g.,(Resolve-Path $Path).Pathinstead ofResolve-Path $Path)PowerShell scripts should normalize output line endings (convert CRLF to LF) when output is intended to be processed by shell commands like grep to ensure cross-platform compatibility
Use
-cmatchinstead of-matchwhen pattern requires case-sensitive matching in PowerShell validation scripts (e.g., EPIC vs epic for naming conventions)
**/*.ps1: In PowerShell script scope, use exit with explicit exit codes instead of return; return exits with code 0 regardless of boolean value
Document the bash-PowerShell exit code contract explicitly in PowerShell script comments: exit code 0 means success, non-zero means failureWhen combining ShouldProcess with PassThru in PowerShell cmdlets: always provide explicit return value in else branch when ShouldProcess returns false
Before executing any PowerShell generation script, audit its code for alignment with known user requirements and identify dead/unused functions
**/*.ps1: Create regression tests for PowerShell scripts covering wildcard character detection, path resolution correctness, and edge cases when fixing path handling logic
In PowerShell, validate wildcard detection logic by distinguishing between literal wildcard characters (?and*) vs. actual wildcard patterns, using the-likeoperator correctly with character class escaping (e.g.,*[?]*instead of*?*)
**/*.ps1: Before implementing features search for pre-existing test coverage
When tests pre-exist run them first to understand feature expectations
Use deep cloning to preserve source data integrity when transforming configurations
Use regex with exact match anchors (^...$) to prevent partial matches in configuration transformations
Up...
Files:
scripts/Invoke-BatchPRReview.ps1
**/{install,*.ps1,*.json}
📄 CodeRabbit inference engine (.agents/retrospective/2025-12-15-instruction-files-gap.md)
Verify that all files referenced in installer configuration (InstructionsFile, SourceDir, etc.) exist in their expected locations before release
Files:
scripts/Invoke-BatchPRReview.ps1
{install.ps1,build/**/*.{ps1,sh},scripts/**/*.{ps1,sh}}
📄 CodeRabbit inference engine (.agents/roadmap/epic-agent-consolidation.md)
Build script must generate platform-specific YAML frontmatter for VS Code and Copilot CLI variants at build time
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{md,json,yml,yaml,ps1,sh,bash,toml,ini,cfg,config,txt}
📄 CodeRabbit inference engine (.agents/retrospective/phase1-remediation-pr43.md)
Use relative paths only in documentation and configuration files; avoid absolute paths (e.g., C:\ on Windows) to prevent environment contamination and maintain cross-platform portability
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{ps1,psm1}
📄 CodeRabbit inference engine (.agents/steering/powershell-patterns.md)
**/*.{ps1,psm1}: Use approved verbs for PowerShell functions (Get-, Set-, New-, Remove-, etc.)
Implement parameter conventions and validation in PowerShell functions
Use proper error handling with ErrorActionPreference, try/catch blocks in PowerShell
Follow PowerShell pipeline usage and best practices for function design
Use comment-based help standards in PowerShell functions
Implement advanced function templates with CmdletBinding attribute
Use parameter validation attributes in PowerShell functions
Handle pipeline input properly in PowerShell cmdlets
Implement progress reporting for long-running PowerShell operations
Use proper configuration management patterns in PowerShell
Avoid using aliases in PowerShell scripts
Never suppress errors without proper error handling in PowerShell
Avoid hardcoded paths in PowerShell scriptsUse
.claude/skills/github/scripts for GitHub operations. NEVER use rawghcommands directly.
**/*.{ps1,psm1}: All PowerShell scripts (.ps1, .psm1) must include corresponding Pester test files (.Tests.ps1) with test coverage
PowerShell modules should use type safety, object pipelines, and structured error handling rather than string-based output
**/*.{ps1,psm1}: Use PowerShell regex pattern^[a-zA-Z0-9][a-zA-Z0-9 _\-\.]{0,48}[a-zA-Z0-9]?$for GitHub label validation to allow spaces in labels
All GitHub label validation must reject empty strings, accept single characters only if alphanumeric, reject newlines and tabs, enforce maximum 50 character limit per GitHub's specifications, and allow spaces in label names
Document all regex edge cases including empty string rejection, single character handling, newline/tab rejection, and character limit rationale in PowerShell code commentsMUST use PowerShell for all scripting (.ps1, .psm1)
**/*.{ps1,psm1}: Sanitize all values written to $env:GITHUB_OUTPUT by escaping newlines and special characters to prevent injection of arbitrary output variables
Quote label names in gh commands or...
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{ps1,yml,yaml,md}
📄 CodeRabbit inference engine (.agents/analysis/003-session-protocol-skill-gate.md)
Validate skill availability before implementing GitHub operations - Check if
.claude/skills/github/directory exists and contains the required capability; list available GitHub skill scripts; read theskill-usage-mandatorymemory; document available skills in session log; use existing skills if they exist rather than writing inline code
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{ps1,yml,yaml}
📄 CodeRabbit inference engine (.agents/analysis/003-session-protocol-skill-gate.md)
NEVER use raw
ghcommands (likegh pr view,gh issue create,gh api) when a Claude skill exists for that functionality - Always use the tested skill scripts from.claude/skills/github/instead of writing inline commands
**/*.{ps1,yml,yaml}: Use atomicgh label create $label --forceoperation instead of separate check + create steps to prevent TOCTOU race conditions
Implement all 4 mandatory Phase 1 security hardening conditions (label creation atomicity, auth check always-run, GITHUB_OUTPUT sanitization, debug file path randomization) before merge approval
Files:
scripts/Invoke-BatchPRReview.ps1
**/{ai-issue-triage.yml,*.ps1}
📄 CodeRabbit inference engine (.agents/analysis/004-pr-60-gap-coverage-validation.md)
Add explicit exit code checks for npm and GitHub CLI commands instead of using
|| trueerror suppression patterns
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{yml,yaml,ps1}
📄 CodeRabbit inference engine (.agents/analysis/004-pr-60-gap-coverage-validation.md)
Generate unique temporary directories for each workflow run using timestamped or UUID-based naming to prevent directory collision
Ensure authentication checks always run and are not skipped by conditional logic in diagnostics mode - remove or restructure conditions that bypass authentication
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{ps1,psm1,yml,yaml}
📄 CodeRabbit inference engine (.agents/planning/PR-60/006-agent-validation-sign-offs.md)
Align all PowerShell implementations with ADR-005 (PowerShell-only requirement) and ADR-006 (thin workflows principle) to maintain architecture coherence
Add rate limiting for label operations to prevent DoS of GitHub API quota by capping the maximum number of labels per issue
Files:
scripts/Invoke-BatchPRReview.ps1
{**/*.yml,**/*.ps1}
📄 CodeRabbit inference engine (.agents/planning/PR-60/007-phase-1-detailed-schedule.md)
Verify exit code after each critical command (gh issue edit, npm install) in PowerShell workflows and scripts
Files:
scripts/Invoke-BatchPRReview.ps1
{**/*.ps1,**/*.yml}
📄 CodeRabbit inference engine (.agents/planning/PR-60/007-phase-1-detailed-schedule.md)
Remove or justify all '|| true' patterns in PowerShell scripts and workflows to prevent silent failures
Files:
scripts/Invoke-BatchPRReview.ps1
{**/*.psm1,**/*.ps1}
📄 CodeRabbit inference engine (.agents/planning/PR-60/007-phase-1-detailed-schedule.md)
Replace 'exit 1' with 'throw' statements in PowerShell modules and scripts for proper exception handling
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{md,js,ts,tsx,jsx,json,yaml,yml,sh,ps1}
📄 CodeRabbit inference engine (.agents/retrospective/2025-12-18-serena-memory-reference-migration.md)
Search entire codebase for pattern before migration to identify all references
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{ps1,psm1,sh,bash}
📄 CodeRabbit inference engine (.agents/security/SR-PR60-implementation-review.md)
Use unique, secured temporary file paths with random identifiers and cleanup logic instead of hardcoded predictable paths like /tmp/categorize-output.txt
Files:
scripts/Invoke-BatchPRReview.ps1
scripts/*.ps1
📄 CodeRabbit inference engine (.agents/sessions/2025-12-18-session-21-check-skill-exists.md)
PowerShell scripts must support -Operation, -Action, and -ListAvailable parameters with ValidateSet constraint for valid operations
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{js,ts,ps1,py,json,yaml,yml,md}
📄 CodeRabbit inference engine (.agents/retrospective/2025-12-19-skill-extraction-summary.md)
Use identical syntax for all instances when migrating patterns to maintain consistency
Files:
scripts/Invoke-BatchPRReview.ps1
**/*{.ps1,github,reaction}*
📄 CodeRabbit inference engine (.agents/retrospective/2025-12-20-pr-94-acknowledgment-failure.md)
PowerShell script failure requires immediate gh CLI fallback attempt (dual-path tooling for GitHub operations)
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{ps1,js,ts,tsx,jsx,py}
📄 CodeRabbit inference engine (.agents/sessions/2025-12-20-session-43-qa-validation-pr147.md)
Use regex patterns with single-line mode flag
(?s)for multi-line matching in YAML comment extraction
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.@(js|ts|py|go|java|rb|php|ps1|regex)
📄 CodeRabbit inference engine (.agents/critique/047-pr-212-retrospective-critique.md)
Use
([pattern])?instead of[pattern]?for optional trailing groups in regex to ensure correct optional behavior and prevent special character bypass
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{ps1,js,ts,py}
📄 CodeRabbit inference engine (.agents/retrospective/2025-12-20-pr-212-comment-response.md)
Use atomic optional groups
([pattern])?$instead of[pattern]?$for optional trailing characters in regex validation to prevent special character bypass
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{ps1,ts,tsx,js}
📄 CodeRabbit inference engine (.agents/sessions/2025-12-20-session-01.md)
Verify regex validation patterns in security remediation code
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{ps1,sh,bash}
📄 CodeRabbit inference engine (.agents/sessions/2025-12-21-session-53-pr212-security-continuation.md)
Transform validation error messages into 5-word activation prompts that trigger correct behavior
Use
gh api --paginateflag when fetching sweep jobs to handle pagination in GitHub CLI commands
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{ps1,psm1,yml}
📄 CodeRabbit inference engine (.agents/sessions/2025-12-21-session-57-pr-222-review-response.md)
Include the
-Forceflag when usingImport-Moduleto ensure module reload and prevent stale module state
Files:
scripts/Invoke-BatchPRReview.ps1
**/*.{ps1,yml,yaml,sh}
📄 CodeRabbit inference engine (.agents/HANDOFF.md)
Use PowerShell only for script implementations, avoiding bash and Python (ADR-005 compliance)
Files:
scripts/Invoke-BatchPRReview.ps1
.claude/commands/**/*.md
📄 CodeRabbit inference engine (.agents/pr-comments/PR-225/comments.md)
Clarify optional skill dependencies in command documentation, specifically marking /pr-comment-responder as optional with separate installation guidance in .claude/commands/pr-review.md
Files:
.claude/commands/pr-review.md
**/.agents/**/*.md
📄 CodeRabbit inference engine (.agents/governance/interview-response-template.md)
Primary deliverables from agents should be saved to
.agents/[category]/[pattern].mdwith naming convention[PREFIX]-NNN-[description].mdSingle-source agent files should use frontmatter markers to delineate platform-specific sections for VS Code and Copilot CLI variants
Maintain artifact synchronization markers in tracking files (.md) with status indicators ([COMPLETE], [RESOLVED], [VERIFIED]) and timestamps to document completion and verification of work
Files:
.agents/retrospective/2025-12-22-pr-226-premature-merge-failure.md
.agents/**/*.{md,yml,yaml,json}
📄 CodeRabbit inference engine (.agents/critique/001-agent-templating-critique.md)
For agent platform files, evaluate whether near-identical variants (99%+ overlap) can be consolidated with conditional configuration rather than maintaining separate files
Files:
.agents/retrospective/2025-12-22-pr-226-premature-merge-failure.md
.agents/**/*.md
📄 CodeRabbit inference engine (.agents/retrospective/pr43-coderabbit-root-cause-analysis.md)
.agents/**/*.md: Use PREFIX-NNN naming convention (e.g., EPIC-001, CRITIQUE-001) for sequenced artifacts and type-prefixed naming (e.g., prd-, tasks-) for non-sequenced artifacts
Normalize all file paths in markdown documents to be repository-relative before committing, removing absolute machine-specific paths
.agents/**/*.md: Session logs and documentation must include Phase checklist verification (Phase 1-3 protocol compliance including agent activation, instruction reading, handoff file updates, and session logging)
Session logs must document Session ID, date, agent name, and branch information in a standardized header formatAll artifact files in .agents/ must be in Markdown format
Document analysis recommendations with specific rationale when adding new governance documents like PROJECT-CONSTRAINTS.md
Maintain debugging skills documentation in
.agents/directoryDocument implementation notes explaining deviations from user prompts or decisions made during development (e.g., using plural form for directory names)
Run markdown lint on all generated artifacts before completing a session
Run markdown lint validation (0 errors expected) before committing documentation files in the .agents directory
Files:
.agents/retrospective/2025-12-22-pr-226-premature-merge-failure.md
.agents/retrospective/*.md
📄 CodeRabbit inference engine (.agents/SESSION-END-PROMPT.md)
Create retrospective document at
.agents/retrospective/YYYY-MM-DD-session-NN.mdwith analysis of emerging patterns, skills to extract, learnings, and discovered risksRetrospective analysis documents must include Phases 0-5 (Data Gathering, Generate Insights, Diagnosis, Decide What to Do, Learning Extraction, Close)
Retrospective documents MUST include atomicity validation table, deduplication analysis section, and clear skills extraction summary with impact metrics (scored 1-10)
Retrospective analysis files should document outcomes, patterns, and learnings from completed sessions while maintaining clarity about tool usage patterns discovered
Files:
.agents/retrospective/2025-12-22-pr-226-premature-merge-failure.md
.agents/retrospective/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-*.md
📄 CodeRabbit inference engine (.agents/governance/naming-conventions.md)
Retrospective artifacts should use the pattern
YYYY-MM-DD-[kebab-case-topic].mdwith ISO 8601 date format, located in.agents/retrospective/(e.g.,2025-01-15-authentication-sprint.md)Retrospective artifacts must follow naming pattern YYYY-MM-DD-topic.md
Files:
.agents/retrospective/2025-12-22-pr-226-premature-merge-failure.md
.agents/retrospective/**/*.md
📄 CodeRabbit inference engine (.agents/sessions/2025-12-18-session-10-hyper-critical-retrospective.md)
Document failures and fixes in retrospective analysis files
Files:
.agents/retrospective/2025-12-22-pr-226-premature-merge-failure.md
.agents/**
⚙️ CodeRabbit configuration file
Agent configuration files. Only flag security issues or broken cross-references. Ignore style, formatting, and structure.
Files:
.agents/retrospective/2025-12-22-pr-226-premature-merge-failure.md
.serena/memories/**/*.md
📄 CodeRabbit inference engine (.agents/retrospective/pr43-coderabbit-root-cause-analysis.md)
Update memory/knowledge base snapshots when refined estimates or critical data diverges from previously stored values by more than 10%
.serena/memories/**/*.md: Skill memory files MUST include atomicity scores (>85% threshold required for persistence), evidence citations with specific session numbers, and SMART validation criteria (Specific, Measurable, Actionable, Relevant, Time-bound)
Skill deduplication analysis MUST be performed with similarity scoring (0-100%) before persistence, comparing new skills against existing memories and documenting the decision (ADD, UPDATE, or MERGE)
All skill memory entries MUST include source reference, validation count (number of times applied), and cross-references to related skills in other memory files
.serena/memories/**/*.md: Atomic memory files must contain focused, high-relevance content to minimize token waste during read operations; avoid consolidating multiple skills into single library files
Memory files and index statements must be designed for human readability and agent pattern recognition; avoid relying on unverified internal mechanisms like word frequency matchingCapture user insights about token efficiency and activation vocabulary in the
.serena/memories/directory for future referenceDocument workflow pattern requirements (such as dorny/paths-filter checkout dependencies) in serialized memory files for future reference
Files:
.serena/memories/skill-autonomous-execution-guardrails.md
.serena/memories/*skill*.md
📄 CodeRabbit inference engine (.agents/analysis/004-check-skill-exists-tool.md)
Memory files documenting skill usage requirements (e.g., skill-usage-mandatory.md) must be kept synchronized with actual Check-SkillExists.ps1 tool interface and available skills
Files:
.serena/memories/skill-autonomous-execution-guardrails.md
**/.serena/memories/skill-*.md
📄 CodeRabbit inference engine (.agents/analysis/005-semantic-slug-protocol-analysis.md)
Use semantic slug naming convention for memory files instead of numeric IDs, following the pattern
skill-{technology}-{technique}.md(e.g.,skill-git-squash-merge-clean-history.md)Consolidate atomic skill files into domain libraries (e.g., merge multiple
skill-react-*.mdfiles into a singlecontext-react-development-standards.md) with a target of 15-20 domain libraries instead of 65+ individual files
Files:
.serena/memories/skill-autonomous-execution-guardrails.md
**/.serena/memories/{adr,context,pattern,skill}-*.md
📄 CodeRabbit inference engine (.agents/analysis/005-semantic-slug-protocol-analysis.md)
Use prefix taxonomy for memory files:
adr-for Architecture Decision Records,context-for domain knowledge libraries,pattern-for reusable solution patterns, andskill-for how-to guides
Files:
.serena/memories/skill-autonomous-execution-guardrails.md
**/.serena/memories/{skill,pattern}-*.md
📄 CodeRabbit inference engine (.agents/analysis/005-semantic-slug-protocol-analysis.md)
Use descriptive slugs in memory file names that include the technology, domain, and specific technique to enable LLM semantic matching (e.g.,
skill-pester-test-isolation-pattern.mdrather thanSkill-PowerShell-004.md)
Files:
.serena/memories/skill-autonomous-execution-guardrails.md
**/.serena/memories/{skill,pattern,context}-*.md
📄 CodeRabbit inference engine (.agents/analysis/005-semantic-slug-protocol-analysis.md)
Enforce semantic slug distinctiveness to prevent near-duplicate file names within the same domain (e.g., avoid both
skill-git-rebase.mdandskill-git-interactive-rebase.md)
Files:
.serena/memories/skill-autonomous-execution-guardrails.md
.serena/memories/skill-*.md
📄 CodeRabbit inference engine (.agents/critique/050-token-efficiency-principle-critique.md)
Use sequential numbering and collision prevention patterns for memory file naming to enforce skill lifecycle states and governance
.serena/memories/skill-*.md: Skill memory files in.serena/memories/with names matchingskill-*orskills-*pattern are subject to retrieval tracking and cold skill identification
Cold skill identification must exclude newly created skills (created less than threshold days ago, default 30 days) when reporting unused skills
.serena/memories/skill-*.md: Enforce skill ID naming convention: Skill-{Domain}-{Number} where Domain is CamelCase, Number is 3-digit zero-padded (001-999), and skill IDs must be globally unique
Reserve skill ID numbers 001-099 per domain for foundational skills; higher numbers (100+) are available for advanced or specialized skills
.serena/memories/skill-*.md: Extract skills from retrospectives with atomicity score >= 85%, persisting to .serena/memories/ with Skill-{Domain}-{Number} naming convention
Use structured skill ID naming: Skill-{Domain}-{Number} with CamelCase domain and 3-digit zero-padded number (e.g., Skill-Analysis-001)
Files:
.serena/memories/skill-autonomous-execution-guardrails.md
.serena/memories/skill*.md
📄 CodeRabbit inference engine (.agents/planning/PRD-skills-index-registry.md)
.serena/memories/skill*.md: Include activation vocabulary (5 words) in both skill file names and index statements to increase LLM association patterns and selection probability during skill discovery
Preserve all deprecated skill files (do NOT delete); link them in the index's Deprecated Skills section to prevent confusion when old references appear in historical documents
.serena/memories/skill*.md: Skill files must be renamed from numeric ID pattern (skill-domain-NNN) to semantic slug pattern (skill-domain-semantic-slug.md)
Verify all skill file migrations with content hash verification to ensure no data loss or corruption
Test Serena MCP integration operations (read_memory, list_memories, write_memory, edit_memory) with new semantic slug names to ensure compatibilityMaintain skill lifecycle states with transitions: Draft → Active → Deprecated, with replacement references for deprecated skills
Files:
.serena/memories/skill-autonomous-execution-guardrails.md
**/.serena/memories/**/*.md
📄 CodeRabbit inference engine (.agents/sessions/2025-12-20-session-22.md)
Memory file names and index statements MUST contain dense, high-signal keywords because agents select memories based on word frequency matching
**/.serena/memories/**/*.md: Use semantic slugs for memory file naming instead of numeric IDs (e.g.,skill-git-squash-merge-clean-history.mdinstead ofSkill-Git-004.md)
Adopt prefix taxonomy for memory files:adr-[number]-[slug].mdfor architectural decisions,context-[domain]-[topic].mdfor domain knowledge,pattern-[problem]-[solution].mdfor recurring solutions,skill-[technology]-[technique].mdfor how-to guides
Files:
.serena/memories/skill-autonomous-execution-guardrails.md
.serena/memories/**
📄 CodeRabbit inference engine (.agents/sessions/2025-12-20-session-48-semantic-slug-orchestration.md)
Commit all changes including
.serena/memoriesfiles as part of session completion
Files:
.serena/memories/skill-autonomous-execution-guardrails.md
**/.serena/memories/*.md
📄 CodeRabbit inference engine (.agents/sessions/2025-12-20-session-38-pr-94-review.md)
Document discovered skills from retrospectives or code reviews with atomicity scores and evidence references in the skillbook
Files:
.serena/memories/skill-autonomous-execution-guardrails.md
🪛 LanguageTool
.claude/commands/pr-review.md
[style] ~39-~39: Using many exclamation marks might seem excessive (in this case: 4 exclamation marks for a text that’s 1861 characters long)
Context: ... ``` Verify: PR exists, is open (state != MERGED, CLOSED), targets current repo....
(EN_EXCESSIVE_EXCLAMATION)
.agents/retrospective/2025-12-22-pr-226-premature-merge-failure.md
[uncategorized] ~63-~63: The official name of this software platform is spelled with a capital “H”.
Context: ...--------| | skill-usage-mandatory | Use .claude/skills/github/ scripts | Used raw gh api commands ...
(GITHUB)
🔇 Additional comments (12)
.github/labeler.yml (1)
52-64: LGTM - Negation handling fixed correctly.The switch to
all-globs-to-all-filesfor patterns with!negation correctly addresses the defect from PR #226. Per actions/labeler docs, negation patterns don't work withany-glob-to-any-file. The additionaldocs/**/*rule provides broader coverage.scripts/Invoke-BatchPRReview.ps1 (2)
86-89: LGTM - Error diagnostics improved.Capturing git output helps debugging worktree creation failures. The
2>&1redirection ensures both stdout and stderr are captured.
164-167: LGTM - Consistent error handling.Same diagnostic improvement pattern as
New-PRWorktree. Good consistency..serena/memories/skill-autonomous-execution-guardrails.md (1)
1-80: LGTM - Clear guardrails documentation.Well-structured retrospective learning. The checklist and anti-patterns provide actionable guidance. References to PR #226 and Issue #230 are appropriate.
.agents/retrospective/2025-12-22-pr-226-premature-merge-failure.md (1)
1-219: LGTM - Thorough retrospective.Comprehensive failure analysis with clear timeline, root causes, and remediation plan. The metrics and lessons learned sections provide actionable insights. References to PRs and issues are valid.
.claude/commands/pr-review.md (3)
1-5: Clarify platform and tool syntax.Two unresolved issues from past reviews:
- Line 2: Comment says "Claude Code" but format is Claude Desktop's slash command structure. Past reviewer noted this inconsistency.
- Line 4:
Bash(pwsh:*)syntax is unusual - typically PowerShell is invoked directly, not through Bash. Past reviewer questioned if this would work as expected.Are these YAML frontmatter fields actually recognized by the target platform? The syntax appears to be Claude Desktop specific but needs verification.
11-16: Document command execution syntax.The
!backtick syntax (e.g.,!git branch --show-current``) is non-standard. Past reviewer asked what environment interprets these commands. This needs clarification or a more portable approach should be documented.
1-152: Documentation restructure improves clarity.The step-by-step workflow organization is clearer than the previous version. However, several past review comments about syntax and placeholders remain unresolved (see specific comments above).
.github/workflows/label-pr.yml (2)
7-11: LGTM - Security rationale documented.The security comment correctly explains why
pull_request_targetis safe here: the labeler action only reads file paths from diff metadata without executing PR code. Noactions/checkoutstep present, which is correct.
38-38: Action pinning to commit SHA is correct.The SHA 8558fd74291d67161a8a78ce36a881fa63b766a9 corresponds to a v5 release commit and matches the tag's expected commit. Per repository policy, pinning actions to full commit SHAs is the correct approach.
.github/workflows/label-issues.yml (2)
95-102: LGTM - Title prefix logic fixed.Separating title prefix checks (
/^\[?bug\]?:?/i.test(title)) from content keyword matching correctly addresses the defect from PR #226. The previous^anchor on combinedtitle + bodyonly matched the start of the concatenated string. Now title prefixes are properly detected.
36-36: Verify that the pinned SHA corresponds to the v7 release tag.While pinning
actions/github-scriptto a full commit SHA follows security best practices, the specific SHAf28e40c7f34bde8b3046d885e986cb6290c5673bcannot be verified as matching the v7 release. Check the official release page or usegitto confirm this SHA is the correct one for the v7 tag before merging.
- Display captured git error output in worktree removal failure - Fix documentation label to match ANY markdown file, not ALL files Addresses review comments from @cursor[bot]: - Comment 2638885289: Display $output in error message - Comment 2638885293: Change all-globs-to-all-files to any-glob-to-any-file Comment-IDs: 2638885289, 2638885293
Pull Request
Summary
Addresses issues identified in PR #226 review comments and enhances auto-labeler workflow configuration.
Specification References
.agents/retrospective/2025-12-22-pr-226-premature-merge-failure.md.serena/memories/skill-autonomous-execution-guardrails.mdChanges
\badd\b,\bnew\b) that caused false positivesall-globs-to-all-filesfor patterns with!negationany-glob-to-any-filedoesn't properly handle negation per actions/labeler docsactions/labeler@v5to full commit SHA (required by repo policy)pull_request_targetis safe for labeleractions/github-script@v7to full commit SHAType of Change
Testing
Agent Review
Security Review
Files requiring security review:
Other Agent Reviews
Checklist
Related Issues
Fixes issues identified in PR #226 post-merge review
🤖 Generated with Claude Code