Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
229 commits
Select commit Hold shift + click to select a range
acdd151
feat: add test summary tool for GitHub Actions job summaries
osterman Aug 28, 2025
5361b89
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 28, 2025
1ce85f2
fix: address linting issues in test-summary tool
osterman Aug 28, 2025
b5ba5cd
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 28, 2025
4085470
test: add comprehensive test coverage for test-summary tool
osterman Aug 29, 2025
39e44d0
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 29, 2025
79d285f
feat: add PR comment functionality for test summaries
osterman Aug 29, 2025
4899db6
test: add comprehensive test coverage for test-summary tool
osterman Aug 29, 2025
1837968
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 29, 2025
bb1b114
feat: adjust coverage thresholds from 50% to 40% for medium threshold
osterman Aug 29, 2025
7c3576a
test: fix GitHub CI test failures by isolating GITHUB_STEP_SUMMARY en…
osterman Aug 29, 2025
816d3dd
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 29, 2025
1dd37d4
feat: enhance test-summary with function coverage and mock filtering
osterman Aug 29, 2025
b11cd19
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 29, 2025
724340e
test: fix Windows CI failures with cross-platform temp paths
osterman Aug 29, 2025
4fcb33b
feat: enhance test-summary output with improved formatting and PR-foc…
osterman Aug 29, 2025
3632b4b
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 29, 2025
12d2147
feat: enhance test-summary with improved formatting and function cove…
osterman Aug 29, 2025
aa13794
resolve merge conflict in main.go
osterman Aug 29, 2025
cbc6584
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 29, 2025
81fcc2e
docs: add mandatory compilation requirements to CLAUDE.md
osterman Aug 29, 2025
6eb487e
Merge branch 'testacc-job-summary' of https://github.com/cloudposse/a…
osterman Aug 29, 2025
2d00452
fix: correct go run command for test-summary in Makefile
osterman Aug 29, 2025
eafb392
refactor: fix all golangci-lint errors in test-summary
osterman Aug 29, 2025
8e7760e
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 29, 2025
82c6286
feat: enhance test-summary with shields.io badges, UUID comments, and…
osterman Aug 29, 2025
8b08ccc
Merge branch 'testacc-job-summary' of https://github.com/cloudposse/a…
osterman Aug 29, 2025
03a79f3
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 29, 2025
c6e4979
feat: always show test result badges and hide empty sections
osterman Aug 30, 2025
363a99b
Merge branch 'testacc-job-summary' of https://github.com/cloudposse/a…
osterman Aug 30, 2025
4490982
feat: add comprehensive test coverage and percentage columns to test-…
osterman Aug 30, 2025
7ee9c55
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 30, 2025
4df0c06
fix: resolve linting issues in test-summary tool
osterman Aug 30, 2025
0d39de8
Merge branch 'origin/testacc-job-summary' - resolve conflicts
osterman Aug 30, 2025
6f44c32
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 30, 2025
2968299
fix: resolve all remaining test failures in test-summary tool
osterman Aug 30, 2025
804095a
Merge branch 'testacc-job-summary' of https://github.com/cloudposse/a…
osterman Aug 30, 2025
4055b89
Add test for UUID sentinel comment injection
osterman Aug 30, 2025
420e100
Add static UUID to workflow and comprehensive README for test-summary…
osterman Aug 30, 2025
ae5f161
fix: reduce complexity in output_functions_test.go by flattening cond…
osterman Aug 30, 2025
abdd20c
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 30, 2025
f5d0970
fix: use UUID for comment deduplication and skip flaky CI test
osterman Aug 30, 2025
5ff0a75
refactor: define TEST_SUMMARY_UUID as job-level environment variable
osterman Aug 30, 2025
4395d74
fix: suppress failed tests display when test suite passes
osterman Aug 30, 2025
24fe628
revert: remove TEST_SUITE_PASSED environment variable hack
osterman Aug 30, 2025
52e9281
fix: eliminate duplicate GitHub Step Summary and improve Windows test…
osterman Aug 30, 2025
0475267
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 30, 2025
1ba5771
revert: remove incorrect Windows test skips and re-enable CI tests fo…
osterman Aug 30, 2025
0645838
resolve merge conflicts: keep Windows test skips removal for diagnost…
osterman Aug 30, 2025
8902b7d
fix: remove unused os import from formatters_test.go
osterman Aug 30, 2025
5c78be1
feat: implement streaming mode for test-summary tool
osterman Aug 30, 2025
a570251
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 30, 2025
b1a5902
fix: resolve TTY hang and implement proper Bubble Tea streaming
osterman Aug 31, 2025
1578d19
fix: resolve gotcha no-args error and update README with inspirations
osterman Aug 31, 2025
16e5dd4
feat: complete test-summary to gotcha transformation
osterman Aug 31, 2025
a959ca0
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 31, 2025
4848e24
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Aug 31, 2025
0728ade
fix: add show parameter validation for gotcha
osterman Aug 31, 2025
97e7980
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 31, 2025
f781155
docs: add gotcha testing tool documentation to main README
osterman Aug 31, 2025
f425b25
fix: resolve critical gotcha TUI issues and improve display functiona…
osterman Aug 31, 2025
8f3019a
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 31, 2025
e4dc922
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Aug 31, 2025
62bc55f
feat: add optional alert sound feature to gotcha
osterman Sep 1, 2025
4842a1e
feat: add .gitignore to exclude gotcha binaries and test artifacts
osterman Sep 1, 2025
e4b1950
Merge branch 'testacc-job-summary' of https://github.com/cloudposse/a…
osterman Sep 1, 2025
62ff6bf
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 1, 2025
ca5bac6
fix: resolve critical linting issues in gotcha tool
osterman Sep 1, 2025
3c20745
Merge branch 'testacc-job-summary' of https://github.com/cloudposse/a…
osterman Sep 1, 2025
4b890bd
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 1, 2025
0ce1f50
fix: update Makefile to use gotcha instead of test-summary
osterman Sep 1, 2025
07c3096
Merge branch 'testacc-job-summary' of https://github.com/cloudposse/a…
osterman Sep 1, 2025
3345013
feat: restore non-TTY streaming functionality for CI environments
osterman Sep 1, 2025
08c0d19
fix: use structured logging instead of stderr for system messages
osterman Sep 1, 2025
8def10d
feat: improve non-TTY streaming output for CI environments
osterman Sep 1, 2025
47c209b
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 1, 2025
bf27a98
feat: improve non-TTY streaming output for CI environments
osterman Sep 1, 2025
897f61d
Merge branch 'testacc-job-summary' of https://github.com/cloudposse/a…
osterman Sep 1, 2025
e93d030
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 1, 2025
1763b04
fix: resolve golangci-lint issues in pkg/merge
osterman Sep 1, 2025
6206fa4
Merge branch 'testacc-job-summary' of https://github.com/cloudposse/a…
osterman Sep 1, 2025
725a264
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 1, 2025
75a6228
feat: implement native GitHub comment support with pagination and mocks
osterman Sep 1, 2025
c05fae6
Merge branch 'testacc-job-summary' of https://github.com/cloudposse/a…
osterman Sep 1, 2025
64b9f3b
feat: fix GitHub comment truncation with strategic resizing and exit …
osterman Sep 2, 2025
7f0a07d
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 2, 2025
da67427
feat: update GitHub comment coverage format to match job summary
osterman Sep 2, 2025
505e0f7
fix: resolve merge conflicts for coverage table format update
osterman Sep 2, 2025
91e4fa8
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 2, 2025
2f5b53c
fix: revert exit code handling to pass through go test exit codes unm…
osterman Sep 2, 2025
7537d4b
Merge branch 'testacc-job-summary' of https://github.com/cloudposse/a…
osterman Sep 2, 2025
dd92adb
fix: configure color profile for charmbracelet/log in GitHub Actions
osterman Sep 2, 2025
89b7f2e
feat: simplify gotcha installation and usage documentation
osterman Sep 2, 2025
6f99593
chore: remove backup files from gotcha tool directory
osterman Sep 2, 2025
16aff94
chore: remove gotcha-results.json artifact and add to .gitignore
osterman Sep 2, 2025
2902610
fix: build gotcha locally instead of installing from remote repo
osterman Sep 2, 2025
169c04a
refactor: use go install -C for cleaner directory handling
osterman Sep 2, 2025
33ed40c
refactor: use go run instead of installing gotcha for CI
osterman Sep 2, 2025
402ae10
fix: revert to go install -C to preserve correct working directory
osterman Sep 2, 2025
8c74c53
Merge branch 'main' into testacc-job-summary
osterman Sep 2, 2025
e65a460
docs: add comprehensive PRD for gotcha test runner and update CLAUDE.md
osterman Sep 3, 2025
4a3cb74
refactor: move gotcha PRD to prd/tools/ for better organization
osterman Sep 3, 2025
aceed4f
Merge branch 'main' into testacc-job-summary
osterman Sep 5, 2025
798911f
refactor(gotcha): restructure project and add test output control fea…
osterman Sep 5, 2025
d22b445
Merge main into testacc-job-summary
osterman Sep 5, 2025
3ff8d2d
Merge branch 'testacc-job-summary' of https://github.com/cloudposse/a…
osterman Sep 5, 2025
37ca59b
feat(gotcha): add smart test caching and improved test filtering (#1451)
osterman Sep 7, 2025
5561ad0
refactor(gotcha): cleanup binary files and add developer guidelines
osterman Sep 7, 2025
3838bd1
test(gotcha): add missing skip reason test coverage (#1460)
osterman Sep 7, 2025
4b284e9
chore: remove binary files and test artifacts from repository
osterman Sep 7, 2025
61f8cff
refactor: rename VCS to CI terminology throughout gotcha codebase (#1…
osterman Sep 7, 2025
5f76b3b
docs(gotcha): comprehensive README update and PRD rename
osterman Sep 7, 2025
785bf9a
refactor(gotcha): split large files to meet 500-line lint requirement
osterman Sep 7, 2025
8435043
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 7, 2025
e09e7d2
docs: add Claude PR standards agent and command
osterman Sep 7, 2025
4c4432f
docs: add PR update behavior to standards agent
osterman Sep 7, 2025
bef787c
docs: add semantic versioning and backwards compatibility guidance
osterman Sep 7, 2025
9a379dc
docs: add issue discovery and linking requirements to PR standards
osterman Sep 7, 2025
83d3478
fix(gotcha): add missing command files from refactoring
osterman Sep 7, 2025
49498ab
docs: add mandatory build and test verification to PR standards
osterman Sep 7, 2025
cdc76c7
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 7, 2025
98b269e
docs: improve PR title guidance to focus on value over compliance
osterman Sep 7, 2025
317fa4a
docs: require specific details in PR titles, avoid generic phrases
osterman Sep 7, 2025
720cd34
docs: emphasize problem/solution framing in PR titles
osterman Sep 7, 2025
18270be
fix(gotcha): restore missing CLI flags to fix CI regression
osterman Sep 7, 2025
2909120
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 7, 2025
d086733
debug(gotcha): add comprehensive logging to diagnose GitHub comment p…
osterman Sep 7, 2025
6911bde
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 7, 2025
d623d71
fix(gotcha): update GetRepoName() calls to GetRepo() after CI interfa…
osterman Sep 7, 2025
b65b420
debug(gotcha): add comprehensive logging to diagnose GitHub comment p…
osterman Sep 7, 2025
11772a6
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 7, 2025
59e10d9
feat: add Claude refactoring agent with Go best practices
osterman Sep 7, 2025
8ccd54b
fix(gotcha): update GetRepoName() calls to GetRepo() after CI interfa…
osterman Sep 7, 2025
1aa2a26
refactor(gotcha): reduce complexity in runStream and displayTest func…
osterman Sep 7, 2025
b60ce60
refactor: rename stream_refactored.go to stream_orchestrator.go
osterman Sep 7, 2025
492c4ed
fix(gotcha): restore single-line TUI progress bar and fix exit behavior
osterman Sep 8, 2025
cf719c3
feat(gotcha): restore usage examples in help output
osterman Sep 8, 2025
78e91ae
fix(gotcha): enable native terminal scrolling and direct test name su…
osterman Sep 8, 2025
656f24b
fix(gotcha): remove AltScreen and fix SilenceUsage for proper TUI beh…
osterman Sep 8, 2025
e194c3d
fix(gotcha): restore TUI output display and fix test counting
osterman Sep 8, 2025
fd06cf7
fix(gotcha): remove binary files and clean up debug code
osterman Sep 8, 2025
f95070d
fix(gotcha): fix TUI subtest display and event processing
osterman Sep 10, 2025
3ff30de
refactor(gotcha): unify TUI and non-TUI code paths using TestReporter…
osterman Sep 10, 2025
0242b36
fix(gotcha): restore TUI progress bar and colored output
osterman Sep 10, 2025
3646791
refactor(gotcha): use TestReporter pattern for non-TUI mode only
osterman Sep 10, 2025
7a5fd8c
fix(gotcha): fix spacing and clarify coverage display
osterman Sep 10, 2025
ec55017
fix(gotcha): add blank line after package headers and clarify coverag…
osterman Sep 10, 2025
48522cf
Merge remote-tracking branch 'origin/main' into refactor-long-files
osterman Sep 10, 2025
c62645d
Merge branch 'origin/testacc-job-summary' into refactor-long-files
osterman Sep 10, 2025
1eb3155
fix(gotcha): remove unused os import after merge
osterman Sep 10, 2025
844f74d
feat(ci): add test matrix for tools including gotcha
osterman Sep 10, 2025
c4ee12e
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 10, 2025
d4a1d3d
fix(gotcha): restore mini test indicators for parent tests with subtests
osterman Sep 10, 2025
4c511ba
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 10, 2025
388e595
feat(gotcha): add startup logging for test display configuration
osterman Sep 10, 2025
bb6036b
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 10, 2025
d004001
feat(gotcha): add compound discriminator for GitHub comments
osterman Sep 10, 2025
a568652
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 10, 2025
4e23ed0
fix(gotcha): refactor project context detection to use filepath funct…
osterman Sep 10, 2025
fa1d558
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 10, 2025
b741ed9
fix(gotcha): resolve lint errors and refactor tests to use testdata a…
osterman Sep 10, 2025
9c67380
Merge branch 'testacc-job-summary' - resolve conflicts
osterman Sep 10, 2025
f85984a
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 10, 2025
7023c96
refactor(gotcha): restructure to follow Go conventions and enable sel…
osterman Sep 11, 2025
7767dbe
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 11, 2025
0ccff3d
fix(gotcha): fix TUI detection and signal handling issues
osterman Sep 11, 2025
e4a5e86
fix(gotcha): improve test stability and fix TUI progress bar display
osterman Sep 11, 2025
68b5cfe
fix(gotcha): simplify coverage display format in package summaries
osterman Sep 11, 2025
1f5dc1e
fix(gotcha): improve coverage display formatting and fix duplicate va…
osterman Sep 12, 2025
da38435
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 12, 2025
d11b05a
fix(gotcha): fix failing TUI tests and improve emoji consistency
osterman Sep 12, 2025
5e9d1e8
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 12, 2025
6de3e35
Merge branch 'main' into testacc-job-summary
osterman Sep 12, 2025
405eb70
fix(gotcha): resolve compilation errors and add coverage configuration
osterman Sep 12, 2025
011ac6b
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 12, 2025
19b76b5
fix: remove unnecessary .gitignore entries
osterman Sep 12, 2025
a48bfab
feat: separate tools testing into dedicated workflow with path filters
osterman Sep 12, 2025
b62b89f
fix: restore critical UUID/discriminator env vars in tools workflow
osterman Sep 12, 2025
0d8fb70
fix: enable GitHub Actions job summary for gotcha tests
osterman Sep 12, 2025
539b25e
fix: use gotcha for all tests instead of go test directly
osterman Sep 12, 2025
1ea5b19
fix: improve GitHub Actions test environment and fix race conditions
osterman Sep 12, 2025
a8408d2
fix: add Windows compatibility for gotcha build
osterman Sep 12, 2025
cc2a5a4
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 12, 2025
a66e0a0
fix: resolve multiple gotcha issues in GitHub Actions
osterman Sep 12, 2025
f7dd8b2
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 12, 2025
5c40dc4
fix: add debugging for exit code issues and improve log styling
osterman Sep 12, 2025
fafe93a
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 12, 2025
486df94
fix: ensure deterministic test output order in TestStreamProcessorSub…
osterman Sep 13, 2025
b8c7f65
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 13, 2025
8cc6b79
fix: use structured logging for test exit reasons instead of UI messages
osterman Sep 13, 2025
ffc80be
feat: display skip reasons in test output
osterman Sep 13, 2025
9c67203
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 13, 2025
d06465c
feat: enhance gotcha error reporting for process-level test failures
osterman Sep 14, 2025
ec6b34b
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 14, 2025
8f680da
fix: update test helpers to set working directory for CI compatibility
osterman Sep 14, 2025
ab9b170
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 14, 2025
adb472e
fix: resolve gotcha test issues in CI
osterman Sep 15, 2025
ac1c603
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 15, 2025
8c38f38
fix: prevent test executions from polluting GitHub step summaries
osterman Sep 15, 2025
f27e610
fix: scope gotcha tests to only test gotcha packages
osterman Sep 15, 2025
ad588bb
fix: restore discriminator, emoji, and fix Windows test failures
osterman Sep 15, 2025
f8c28e5
fix: resolve gotcha test issues in CI
osterman Sep 15, 2025
1d900c7
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 15, 2025
ba93dd7
chore: remove accidentally committed test output file
osterman Sep 15, 2025
7b5c8b6
fix: resolve err113 lint errors with static errors
osterman Sep 15, 2025
c3a7fed
debug: add vanilla go test step to diagnose non-zero exit code
osterman Sep 15, 2025
0db645d
fix: remove tests that spawn gotcha binaries causing CI failures
osterman Sep 15, 2025
484d2f1
fix: correct invalid Go versions causing coverage tool failures
osterman Sep 15, 2025
73e4fe4
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 15, 2025
d90d71a
chore: run go mod tidy after Go version correction
osterman Sep 15, 2025
099e8c7
fix: use Go 1.23 for CI compatibility
osterman Sep 15, 2025
18252b5
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 15, 2025
13c9412
fix: pin CI to Go 1.23 instead of reading from go.mod
osterman Sep 15, 2025
e2a0739
fix: skip Sync() on Windows to prevent test hangs
osterman Sep 15, 2025
047773f
chore: run go mod tidy to satisfy CI requirements
osterman Sep 15, 2025
43b9c78
fix: remove inappropriate os.Stderr.Sync() calls entirely
osterman Sep 15, 2025
bffdeca
feat: implement output abstraction for better CI/terminal output hand…
osterman Sep 15, 2025
7c56ba3
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 15, 2025
7d288d2
fix: properly count and report build failures in test statistics
osterman Sep 15, 2025
ad9ba43
fix: add missing vertical connector between file names and functions …
osterman Sep 15, 2025
3013c8f
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 15, 2025
d057c7d
fix: resolve duplicate test summaries and compilation errors
osterman Sep 15, 2025
29eec44
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 15, 2025
6bcf711
cleanup: remove unused displayFinalTestSummary function
osterman Sep 15, 2025
1d54266
refactor: integrate coverage processor with output.Writer interface
osterman Sep 15, 2025
05f4ea2
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 15, 2025
614cea3
fix: resolve error message placement and test output handling in CI
osterman Sep 15, 2025
22bc076
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 15, 2025
844c1b8
fix: populate skip reasons in GitHub summaries and comments
osterman Sep 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
398 changes: 398 additions & 0 deletions .claude/agents/pr-standards.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,398 @@
# PR Standards Agent

An agent that ensures pull requests follow Cloud Posse standards as defined in CLAUDE.md.

## Purpose

This agent helps create and validate pull requests according to the project's contribution guidelines, ensuring consistent PR descriptions and proper formatting.

## Capabilities

1. **PR Title Best Practices**
- Focus on value and outcomes, not compliance requirements
- Describe what the change accomplishes for users/developers
- Use active voice and clear language
- Avoid "because we have to" framing

2. **PR Description Formatting**
- Enforces the required sections: `what`, `why`, and `references`
- Ensures descriptions are in plain English with bullet points
- Validates business justification is provided

3. **Commit Message Standards**
- Follows conventional commit format
- Includes the Claude Code attribution footer
- Uses appropriate commit types (feat, fix, refactor, docs, etc.)

4. **Label Management**
- Applies "no-release" label for documentation-only changes
- Suggests appropriate labels based on changes
- **AVOID major version labels** - Changes should be backwards compatible
- Use `patch` for bug fixes and minor improvements
- Use `minor` for new features that don't break existing functionality
- `major` labels require strategic planning and should rarely be used

5. **Template Compliance**
- Uses the PR template from `.github/PULL_REQUEST_TEMPLATE.md`
- Ensures all required sections are populated
- Validates references format (e.g., `closes #123`)

6. **Issue and PR Discovery**
- Searches GitHub for related open/closed issues
- Links to issues that this PR addresses or relates to
- References PRs that introduced bugs being fixed
- Ensures proper issue tracking and context

7. **Build and Test Verification** (CRITICAL)
- **ALWAYS compile the code before committing**
- **ALWAYS run tests before pushing changes**
- Never assume code works without verification
- Fix all compilation errors immediately
- Address test failures before creating PR

## PR Title Guidelines

**IMPORTANT**: PR titles should communicate value, not compliance.

### Good PR Titles (Problem-Focused and Clear)
- βœ… `refactor(gotcha): break up 1000+ line files to make code easier to find and modify`
- βœ… `feat(auth): enable enterprise customers to use their existing SAML/OIDC providers`
- βœ… `fix(parser): stop parser from consuming 2GB RAM on large files`
- βœ… `perf(cli): make CLI start 7x faster by deferring module loading`
- βœ… `docs: help new users understand stack configuration with 12 examples`

### Bad PR Titles (Too Generic or Compliance-Focused)
- ❌ `refactor(gotcha): improve code organization and maintainability` (too vague)
- ❌ `refactor(gotcha): implement best practices` (meaningless)
- ❌ `refactor(gotcha): split files to meet 500-line lint requirement` (compliance-focused)
- ❌ `feat(auth): add new authentication feature` (too generic)
- ❌ `fix(parser): fix memory issue` (not specific enough)
- ❌ `perf(cli): improve performance` (how much? what aspect?)
- ❌ `docs: update documentation` (what documentation? why?)

### Title Writing Tips
1. **Frame as problem/solution**: What problem does this solve for developers/users?
2. **Be specific about impact**: "make code easier to find" vs "improve organization"
3. **Include concrete details**: "1000+ line files", "3s to 400ms", "SAML 2.0"
4. **Avoid meaningless buzzwords**: "best practices", "improve", "enhance" without context
5. **Answer "why should I care?"**: Not just what changed, but why it matters

## PR Template Structure

```markdown
## what
- High-level description of changes in plain English
- Use bullet points for clarity
- Include implementation details when they help understand the change
- Describe the end state, not the development journey

## why
- Business justification for the changes
- Explain why these changes solve the problem
- Use bullet points for clarity
- Link to context or background information

## references
- Link to supporting GitHub issues or documentation
- Use `closes #123` if PR closes an issue
- Link to related PRs or discussions
- Reference PR that introduced the bug (ONLY if fixing a pre-existing regression)
- Link to related issues even if not directly closing them
```

### Critical PR Description Guidelines

**IMPORTANT**: Only document fixes for problems that existed BEFORE your PR, not problems you created and fixed during development.

**DO include:**
- βœ… Implementation details that help reviewers understand the change
- βœ… Technical specifics about how you accomplished the goal
- βœ… Problems that existed in main/master that your PR fixes
- βœ… What functionality the PR adds or improves
- βœ… The final state of the codebase after merging

**DO NOT include:**
- ❌ Bugs you introduced and fixed within the same PR
- ❌ "Fixed missing flags" (if YOU removed them earlier in the PR)
- ❌ "Restored functionality" (if YOU broke it earlier in the PR)
- ❌ "Fixed compilation errors" (if YOUR changes caused them)
- ❌ Any problem that didn't exist before you started work

**Example - WRONG (documenting self-inflicted problems):**
```markdown
## what
- Refactored gotcha into smaller modules
- Fixed compilation errors I introduced when refactoring
- Added back missing --github-token flag I accidentally removed
- Restored Viper bindings I forgot to implement
- Fixed nil pointer I caused by moving code around
```

**Example - RIGHT (documenting accomplishments and implementation):**
```markdown
## what
- Refactored gotcha tool into 15 focused modules for better maintainability
- Extracted TUI, streaming, and parsing logic into dedicated packages
- Created pkg/stream package with StreamProcessor and event handlers
- Moved CLI command definitions to separate files (stream.go, parse.go, version.go)
- Implemented proper Viper bindings for all configuration options
- Maintained full backwards compatibility with all existing CLI commands
```

**The key distinction:**
- If a problem existed in main branch β†’ "Fixed X" βœ…
- If you created the problem in your PR β†’ Don't mention it ❌
- Implementation details are welcome β†’ "Extracted X to Y" βœ…
- Development missteps are not β†’ "Accidentally broke X then fixed it" ❌

## Validation Rules

1. **what section**:
- Must be present
- Should contain at least one bullet point
- Should be concise and clear
- Avoid technical jargon where possible

2. **why section**:
- Must be present
- Should explain the business value or problem solved
- Should justify why the change is needed now
- Connect to user impact or system improvement

3. **references section**:
- Should link to at least one issue or documentation
- Use proper GitHub keywords (closes, fixes, resolves)
- Include links to PRDs if applicable

## Usage Examples

### Good PR Description

```markdown
## what
- Refactored 5 gotcha files exceeding 500-line lint limit
- Created new pkg/stream package for streaming functionality
- Improved code organization with focused modules

## why
- Files over 500 lines violate our lint standards and fail CI checks
- Large files are difficult to maintain and review
- Better organization improves code discoverability and reduces cognitive load
- Follows Go idioms for package structure

## references
- Addresses lint requirement from `.golangci.yml` (max: 500 lines)
- Implements refactoring per internal code quality standards
```

### Bad PR Description (to avoid)

```markdown
## what
Refactored some files

## why
They were too long

## references
N/A
```

## Integration with CI

- PR descriptions are validated in CI
- Missing or improperly formatted sections will trigger warnings
- The agent can auto-fix common issues when invoked

## Backwards Compatibility and Semantic Versioning

**CRITICAL**: All PRs should maintain backwards compatibility unless there's strategic planning for breaking changes.

### Version Label Guidelines

1. **`patch` label** (preferred for most changes):
- Bug fixes that don't change functionality
- Performance improvements
- Internal refactoring
- Documentation updates (with `no-release`)
- Security fixes that don't break APIs

2. **`minor` label** (for additive changes):
- New features that don't break existing functionality
- New configuration options with sensible defaults
- New commands or subcommands
- Deprecation notices (actual removal is `major`)

3. **`major` label** (AVOID - requires strategic planning):
- Breaking API changes
- Removing deprecated features
- Changing default behavior in incompatible ways
- Renaming commands or flags without aliases
- Changes requiring user migration

### Ensuring Backwards Compatibility

- **Add, don't modify**: Add new fields/options rather than changing existing ones
- **Use defaults**: New features should have sensible defaults that maintain current behavior
- **Provide aliases**: When renaming, keep old names as aliases
- **Deprecate gradually**: Mark as deprecated first, remove in next major version
- **Test upgrades**: Ensure existing configurations/workflows continue to work

### Breaking Change Checklist

If a breaking change is absolutely necessary:
- [ ] Document migration path in PR description
- [ ] Update all documentation
- [ ] Provide migration tools/scripts if applicable
- [ ] Coordinate with team for major version release
- [ ] Consider feature flags for gradual rollout

## Best Practices

1. **Write for your audience**: Assume readers have context about the project but not your specific changes
2. **Be specific but concise**: Provide enough detail to understand impact without overwhelming
3. **Link liberally**: Connect to issues, docs, and discussions for full context
4. **Use conventional commits**: Ensure commit messages align with PR title
5. **Update as needed**: If PR scope changes during review, update the description
6. **Maintain backwards compatibility**: Default to non-breaking changes
7. **Use appropriate version labels**: Most changes should be `patch` or `minor`

## Issue Discovery and Linking

When creating or updating a PR, the agent should:

1. **Search for related issues**:
```bash
# Search for issues related to the changes
gh issue list --search "keywords from your changes"
gh issue list --search "error message being fixed"
gh issue list --search "component or file names"
```

2. **Identify regression sources**:
- If fixing a bug, search for the PR that introduced it
- Use git blame to find the commit that introduced the problematic code
- Link to the original PR for context

3. **Link comprehensively**:
- Use `closes #123` for issues being resolved
- Use `relates to #456` for related but not closed issues
- Use `fixes regression from #789` when fixing bugs from other PRs
- Use `partially addresses #321` for incremental work

4. **Example references section**:
```markdown
## references
- closes #123 - Original issue requesting this feature
- relates to #456 - Similar issue with additional context
- fixes regression from #789 - PR that introduced the bug
- partially addresses #321 - Larger epic this contributes to
- See discussion in #654 for design decisions
```

## Pre-Commit Verification Checklist

**MANDATORY**: Before creating any commit or PR, verify:

1. **Compilation Check**:
```bash
# For Go projects
go build ./...

# For Atmos
make build

# For gotcha
cd tools/gotcha && go build ./cmd/gotcha
```

2. **Test Execution**:
```bash
# Run all tests
go test ./...

# Or use make targets
make test
make testacc
```

3. **Lint Check**:
```bash
# Run linters
make lint

# Or directly
golangci-lint run
```

4. **File Verification**:
- Ensure all new files are staged (`git status`)
- Check no files are accidentally ignored
- Verify refactored code includes all split files

5. **Common Mistakes to Avoid**:
- ❌ Assuming code works without building
- ❌ Committing with compilation errors
- ❌ Forgetting to add new files after refactoring
- ❌ Ignoring test failures
- ❌ Not checking git status before committing

## Command Integration

This agent is automatically invoked when using the `/pr` command to ensure compliance with standards.

## Updating Existing PRs

When pushing additional commits to an existing PR branch, the agent should:

1. **Update the PR description** to reflect cumulative changes:
- Add new items to the `what` section for new functionality
- Update the `why` section if the justification has evolved
- Add new references if additional issues are addressed

2. **Maintain chronological clarity**:
- Keep the original context but expand with new changes
- Don't remove original items unless they're no longer relevant
- Mark completed items if using a checklist format

3. **Example of updating a PR**:

**Original PR (after first commit):**
```markdown
## what
- Refactored large files to meet lint requirements
- Created new package structure for better organization

## why
- Files over 500 lines violate lint standards
- Improves maintainability

## references
- Addresses `.golangci.yml` requirements
```

**Updated PR (after adding documentation):**
```markdown
## what
- Refactored large files to meet lint requirements
- Created new package structure for better organization
- Added Claude agent and command for PR standards enforcement
- Updated CLAUDE.md with references to new automation tools

## why
- Files over 500 lines violate lint standards
- Improves maintainability
- Ensures future PRs follow consistent standards automatically
- Reduces review friction by enforcing templates

## references
- Addresses `.golangci.yml` requirements
- Implements PR standards from CLAUDE.md
- Creates `.claude/agents/pr-standards.md` for automation
```

4. **Automation behavior**:
- When detecting an existing PR, fetch current description
- Merge new changes into existing sections
- Preserve manual edits made by reviewers
- Use `gh pr edit` to update the description
Loading
Loading