
Add an AI agent to an existing project by teaching it the repository’s operating rules before asking for a feature. Document the stack, directory ownership, build and test commands, coding conventions, forbidden changes, and definition of done. Start with read access or a small isolated branch.
First, make the project reproducible for a new contributor: dependencies install cleanly, environment variables are documented without secrets, and checks run from explicit commands. Give the agent a map of key modules and authoritative files, but let it inspect the code instead of pasting the whole repository into a prompt. Assign a low-risk task such as explaining a flow, adding a focused test, or fixing a reproducible defect. Require a plan before edits and a final report that identifies files changed, checks run, failures, and remaining uncertainty.
Review permissions as capabilities expand. Restrict network access, deployment credentials, production data, and destructive commands unless a task truly needs them. Keep changes in version control and make approval boundaries visible. A broad “improve the project” instruction is unsuitable for onboarding.
The first success criterion is not a large diff. It is evidence that the agent can follow local rules, find the right context, and recover from a failed check. Use that result to refine project instructions, then widen task scope one controlled step at a time.
