Skip to content

feat: add main review guidelines library#28

Merged
menny merged 5 commits intomainfrom
feat/reviewer-prompts-library
Apr 7, 2026
Merged

feat: add main review guidelines library#28
menny merged 5 commits intomainfrom
feat/reviewer-prompts-library

Conversation

@menny
Copy link
Copy Markdown
Owner

@menny menny commented Apr 7, 2026

  • Create reviewer_prompts/ directory with 7 specialized review philosophies.
  • Refactor main guidelines resolution logic into testable helper.
  • Update core/prompts/reviewer_prompt.md to be fully generic and behavior-driven.
  • Set 'general' (Robust Maintainer) as the default guideline for the action and CLI.
  • Ensure format and linting issues are skipped by the AI reviewer.
  • Update README.md and DESIGN.md with new guideline library documentation.

Closes #27

menny added 4 commits April 7, 2026 10:44
- Create reviewer_prompts/ directory with 7 specialized review philosophies.
- Refactor main guidelines resolution logic into testable helper.
- Update core/prompts/reviewer_prompt.md to be fully generic and behavior-driven.
- Set 'general' (Robust Maintainer) as the default guideline for the action and CLI.
- Ensure format and linting issues are skipped by the AI reviewer.
- Update README.md and DESIGN.md with new guideline library documentation.
- Redirect missing arguments error to stderr.
- Explicitly handle error from os.Getwd() to ensure system resilience.
- Move prompt library to core/prompts/library/.
- Use Go embed to include prompt .md files into the binary.
- Add GetLibraryPrompt helper to retrieve embedded content by name.
- Restore default for --main-guidelines to 'general'.
- Update CLI resolution logic to favor local files then embedded prompts.
- Refactor Bazel configuration to support internal embedding.
- Clean up unused imports and variables in main.go.
Update documentation to reflect the inclusion of REVIEWERS.md and
personal.ai_code_review_guidelines.md in the prompt assembly.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

[Maintenance] [cmd/ai_reviewer/main.go:187-194] This error handling masks the underlying os.ReadFile error. If a user provides a valid file path that cannot be read (e.g., due to permissions, or if it is a directory), this silently falls back to GetLibraryPrompt and ultimately fails with a confusing "prompt not found" error. We should check if the error is os.ErrNotExist (or use errors.Is(err, fs.ErrNotExist)) before falling back, so we don't swallow actionable filesystem errors.

[Observation] [action.yml:101-105] Since the action falls back to checking if a local file exists with the name of the provided guidelines, if a repository accidentally contains a file literally named general (or google, minimalist) in its root, the action will pick that file up instead of using the built-in library prompt. This is an edge case, but worth noting for future debugging.

[Observation] [cmd/ai_reviewer/main.go:88] log.Fatalf is used here instead of the stderr logger instantiated earlier in the file (stderr := log.New(os.Stderr, "", 0)). While log.Fatalf still outputs to os.Stderr, it will use the standard Go log formatting (with timestamps), which differs from the rest of the diagnostic output. Using stderr.Printf followed by `os.Exit

- Use path.Join instead of filepath.Join for embed.FS access (must be forward slashes).
- Update README.md to show --main-guidelines is optional with a default of 'general'.
@menny menny merged commit c31e5c6 into main Apr 7, 2026
2 checks passed
@menny menny deleted the feat/reviewer-prompts-library branch April 7, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a main review guidelines library

1 participant