Keep this file byte-for-byte identical in OpenDevEd/openscholar and
OpenDevEd/evidence-community. Repository-specific rules belong in
docs/agents/project.md.
Read docs/agents/project.md in the repository the task is about before
acting on any non-trivial task, and before every push: it names the checks to
run first. Read a named plan or specification when the request points to one.
Do not load every plan or document by default.
For product, architecture, roadmap, or cross-repository work, check that the
Outline MCP server works, then read Outline in the order that
docs/agents/project.md lists before acting.
This product spans two repositories. The folder a session starts in does not tell you which one a request is about: the user often starts in one and means the other.
OpenDevEd/openscholar(formerlyOpenDevEd/openalex-count) is OpenScholar: branchdev, integration checkout~/Documents/Github/openscholar/dev-self. It owns research features, accounts, billing, and Evidence Library setup. "The config", "the configuration page", and "library settings" mean OpenScholar's Evidence Library configuration.OpenDevEd/evidence-community(formerlyOpenDevEd/new-el, still called new-el) is the Evidence Library: branchmain, checkout~/Documents/Github/new-el. It owns the public library and its admin. "The admin", "the admin page", and "the admin panel" mean new-el's/admin. "Evidence Library" on its own means new-el unless the request is about configuration or setup.- People read "Evidence Community" and "community". "Library" on its own means
the saved papers in OpenScholar. Code, tables, service APIs and older plans
still say Evidence Library (
evidenceLibraries,/api/v1/evidence-libraries,new-el), and "Evidence Community" in a request means that same thing. Never write "library" in text people read when the community is meant. - People read the product's name as "Openscholar". Code names, HTTP headers such
as
X-OpenScholar-Route, comments and older plans still say OpenScholar. - Before touching code, decide which repository the request is about from what it names, not from the current directory. Work in that repository's checkout or a worktree of it, even when the session started in the other one.
- Example: "tooltips in the Evidence Library admin", asked from
dev-self, meant new-el's/admin. An agent changed OpenScholar's configuration pages instead, and the work had to be redone in new-el.
When sources disagree, use this order:
- The user's latest instruction.
- Current code, tests, Git history, and verified runtime behavior.
docs/agents/project.mdand the current shared Outline decisions.- The current product roadmap.
- Old plans, prototypes, transcripts, and audits.
Plans describe task scope and product contracts. They do not replace this working agreement unless the user's latest message explicitly changes the workflow.
- A request to inspect, diagnose, explain, or review is read-only.
- A request to implement authorizes scoped file changes, commits, and pushes. It authorizes a pull request and merging on green only once the work is ready to merge; while a mock or design is still under review, stop at the push.
- Preserve unrelated dirty and untracked files.
- Use an isolated worktree when the main checkout is dirty or another agent is editing nearby files.
- Never use a hook bypass or a destructive Git command to get around a problem.
- Check facts instead of guessing. Use current code first, installed package documentation second, and the web only for facts those sources do not resolve. Do not run several research tools as a checklist.
- Prefer clean breaking changes in code. Saved library data is never
disposable: follow the migration rules in
docs/agents/project.mdfor any change to its shape.
- Do not use React effects for app state, URL state, copied props, derived values, data loading, navigation, mutations, filters, tabs, pages, or forms.
- Effects are only for a real outside browser system such as an event listener, observer, timer, focus operation, or third-party widget. Keep the effect small, name the outside system, and include full cleanup and dependencies.
- Use server components,
nuqs, render-time calculations, lifted state, context, and event handlers for application state.docs/agents/project.mdnames the repository's data layer.
- Use
ponytailfor substantial planning and implementation. Choose the smallest complete solution. .agents/skills/is the canonical repository skill directory..claude/skills/contains links to those skills, not separate copies.CLAUDE.mdcontains only@AGENTS.md.
- Optimize elapsed wall-clock time. Run independent repository reads, dependency installs, focused checks, builds, and deployment preparation at the same time instead of serially.
- Batch related searches, file reads, status checks, and API queries. Prefer one bounded command or parallel tool call over a long sequence of tiny calls. Reaching 50 completed tool calls in one phase is a trigger to consolidate the remaining work, not to pause or stop.
- After an unexpected integration or deployment failure, collect the relevant logs, runtime state, configuration, and connected code paths in one pass. Test independent hypotheses at the same time when safe, then make one combined root-cause fix. Do not release one patch per newly discovered clue.
- Code that introduces an external service boundary must record useful internal diagnostics in its first version. Do not require a separate release merely to reveal the real error.
- Before creating, editing, or executing anything under
plans/, readplans/AGENTS.md. - Keep small and medium plans in the conversation.
- Commit a repository plan only for multi-day work, a breaking data migration, a cross-repository contract, a product decision, or work that must survive a fresh session.
- A committed plan records decisions, dependencies, owned paths, checks, deployment gates, and completion rules. Link to this file instead of copying its standing rules.
- Do not commit research scratch, agent transcripts, duplicated prompts, or a plan for a change that is already obvious from the code.
- Update a plan before code only when the implementation changes an approved contract or direction.
- During implementation, run the smallest local test, type check, lint target, or service check that can catch the current defect.
- Use red, green, clean up for new plain logic. Use test-after for integration work where the real boundary must exist first.
- Test behavior, roles, labels, data, API responses, database state, and real service state. Never test CSS class strings.
- When a change needs runtime proof, test the unmerged commit in an isolated or preview deployment before merge. Merge must not be the first way to exercise the real boundary.
convex-e2e(convex-e2e.opendev.space) belongs to OpenScholar CI'se2e-authjob. Never deploy an unmerged branch to it, or point a preview,npm run verify, or a script at it: a row saved in a new shape fails every other CI run withSchema validation failed. Test an unmerged Convex change on a throwaway Convex project of its own.- Run one final browser, deployment, or live-service gate when the changed boundary needs one.
- When a change touches a loading state, a dialog, sheet, popover or menu, or
motion, run
npm run verify -- shifton the routes it touched, in a repository that has the command (theverifyskill says how). - A new or changed flow a person walks through is done when the first two
passes of the
first-use-qaskill are complete: a state table for each changed screen, then a first-use walk on a new account and on an account with history. Scripted QA waves follow those passes. A tester who is told the steps can't show whether a new person gets through them. - Documentation-only work needs link checks and
git diff --check, not the application test suite.
Every issue in both repositories belongs to the organisation project
Openscholar (OpenDevEd project 4) and to a milestone (OS-NN in
openscholar, EL-NN in evidence-community).
- Before creating an issue, search open and closed issues in both repositories. Update an existing issue instead of creating a duplicate.
- Write only what the user asked for. Title: the user-visible outcome,
prefixed with the milestone code, such as
[EL-05] Preview draft records. Body: the problem, the checks that prove it's done, and what is out of scope. No padded requirements. - Create it with everything in one step, then read it back: milestone,
project (
gh issue create --milestone "<title>" --project Openscholar), board Status (Backlog, orReadywhen the user wants it soon), and any label that applies (needs-decision,external-blocker,documentation). - Work that needs several issues becomes a milestone with issues, not a plan document.
- Set
In progresswhen you start, andBlockerwith a comment naming the blocker. The board-upkeep workflow in openscholar does the rest, every four hours and on openscholar's issue and pull request events:In reviewwhile an open PR closes the issue andIn progressagain once none does,Donewhen the issue closes, the current Sprint on an issue in progress, missing issues added to the board, and a milestone closed when its last issue closes. Its run summary lists issues in progress with no activity for a week. - Sprints are weekly, Monday to Sunday. When an issue is picked for this week, set its Sprint to the current week. If no upcoming sprints are left, add more weekly ones to the Sprint field; the board-upkeep run reports it.
- When a decision changes an issue's scope, edit its body in the same turn so it never contradicts what was agreed. Use comments for progress.
- A PR for planned work names its issue:
Closes OpenDevEd/<repo>#Nwhen it finishes the issue,Part of OpenDevEd/<repo>#Notherwise. A small fix with nothing planned behind it (a bug the user just reported, a copy change, a dependency bump) goes straight to a PR whose title is the record; don't open an issue only to close it. Closesonly works in PRs into the default branch:devin openscholar,mainin evidence-community. After merging, check the issue actually closed.- Close an issue as soon as its work is merged and verified. If only part is done, comment what remains.
- Use conventional commit prefixes:
feat,fix,refactor,test,chore,docs,perf, orstyle. - Keep one concern per pull request. Keep commits small enough to review but do not split a working unit into ceremony.
- Stage named files. Check the staged diff before committing.
- Never use
--no-verify,--no-gpg-sign, force-push, or history rewriting unless the user explicitly requests the exact action.
An implementation task is complete when the requested behavior is present at the real boundary, targeted checks pass, and no known dead path or hidden fallback remains. Report the checks actually run, commit, deployment state, and remaining risk. Never call a unit test alone proof of a browser or deployed service.
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in node_modules/next/dist/docs/ (resolved from this file's directory; in monorepos the next package may not be visible from the repo root) before writing any code. Heed deprecation notices.
This block is written and re-added by next dev — verify at node_modules/next/dist/server/lib/generate-agent-files.js. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.