Something went wrong. Try again.
Something went wrong. Try again.
pullrequest.review AGENTS.md
AGENTS.md #
pullrequest.review is a Bitbucket and GitHub pull request review UI with a terminal-style interface focused on fast diff and file-tree navigation.
Project Principles #
- Keep the UI practical, compact, and keyboard-friendly.
- Prefer simple, maintainable code over complex abstractions.
- Mobile-specific UX is a non-goal; optimize for desktop keyboard-first workflows.
Technical Direction #
- Use Bun only for dependency management and scripts.
- Keep the app client-first and avoid unnecessary server complexity.
- Prefer existing context/state patterns before introducing new globals.
- Keep git host integration host-agnostic where possible.
- Prefer TanStack DB collections + live queries for externally loaded app data.
TanStack DB Architecture #
- External host data is collection-driven.
- Components read host data via
useLiveQueryagainst the scoped.collectioninstead of ad-hocuseQuerycalls in UI components. - App bootstrap must initialize both settings storage and host-data storage (
ensureStorageReady()+ensureGitHostDataReady()) before rendering data-dependent providers. - To extend host data features, add/extend a collection in
src/lib/git-host/query-collections.tsfirst, then consume it from UI withuseLiveQueryand scoped collection utils.
Persistence (RxDB-backed) #
- App persistence uses a TanStack DB + RxDB-backed key/value layer in
src/lib/storage/client-storage-db.ts. src/lib/storage/versioned-local-storage.tsis the storage API surface used by contexts/components/providers.- Do not introduce direct
window.localStorageusage insrc/; route reads/writes through storage helpers. - Settings/auth/view state keys use
makeVersionedStorageKey(...). - Old storage keys/data are not read; storage is current-schema-only.
- To add persisted settings or UI state, add a new versioned key and keep all read/write logic inside the storage helpers or the owning context/provider.
Host and Routing Conventions #
- Bitbucket PR route:
/$workspace/$repo/pull-requests/$pullRequestId. - GitHub PR route:
/$workspace/$repo/pull/$pullRequestId. - Do not infer host from workspace memory. Route shape selects host.
- GitHub public PR read access should work without a token (subject to rate limits).
- GitHub write actions require authentication.
Coding Conventions #
- Use ASCII in source files.
- Keep components small and focused.
- Use memoization for provider/context values when needed to avoid avoidable re-renders.
Validation #
- Always run
bun run tscandbun run checkafter code changes. - Always run
bun run knipand fix all findings after code changes. - Run
bun run testwhen touching data mappings, storage behavior, or keyboard/input handling logic. - Run
bun run react-doctorwhen you are done with a feature, fix warnings and errors until there are none.
UI Conventions #
- Monospaced-first typography.
- Sharp corners and clean panel structure.
- Consistent controls for settings, themes, and keyboard shortcuts.
Naming #
- Use
pullrequestdotreviewas the canonical project name whenpullrequest.reviewcannot be used. - Keep app-facing git host/domain models camelCase in
src/lib/git-host/types.tsand map provider snake_case fields at provider boundaries.
UI Component Anchors #
-
Use
data-component="<name>"on shared layout and diff primitives. -
Keep names canonical and kebab-case.
-
Prefer semantic HTML landmarks first (
nav,aside,header,main), then usedata-componentfor stable identification. -
navbar -
sidebar -
top-sidebar -
search-sidebar -
summary-page -
summary-header(PR title header in summary view) -
diff-view(primary content viewport below navbar and right of sidebar; hosts summary/settings/single-diff/list-diff views) -
diff-list-view(all file diffs container, multi-file stream) -
diff-file-view(single file diff container) -
settings -
tree(directory tree)
Skills Workflow #
- Before major refactors, read and apply:
./.agents/skills/vercel-react-best-practices/SKILL.md./.agents/skills/vercel-composition-patterns/SKILL.md- For TanStack data/router/query work, also read:
./.agents/skills/tanstack-suite/SKILL.md- When working in TanStack areas, consult the specific reference docs under
./.agents/skills/tanstack-suite/references/(db/query/router/etc.) before implementing.