agentleFS
polyaipolyai/adk/AGENTS.md

adk

AGENTS.md83 starsChanged 39 days agoApache-2.0View on GitHub

polyai-adk is the poly CLI: a git-like workflow (pull, push, branch, diff, …) for building PolyAI Agent Studio agents locally as YAML and Python files. These rules apply to every coding agent and reviewer working in this repo. Review-specific guidance is in REVIEW.md, which repeats the rules below that matter in review: when you change one of those rules, update both. Run everything through uv run; don't activate the venv first. CI runs all of these on every PR, with…

  • Installs packages

The file

We split this AGENTS.md into the rules it gives an agent

11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run everything through uv run.

    line 10
  2. Very specific:

    Reuse before writing: Use make_request, load_yaml / dump_yaml (resources/resource_utils.py), each resource's discover_resources, …

    line 71
  3. Distinctive:

    Delete, don't shim: When a platform field or behaviour is removed, delete it from the ADK.

    line 77
  4. Distinctive:

    Don't keep back-compat paths or code nothing uses.

    line 78
  5. Very specific:

    Comments explain why, briefly: No narration of the change, and no stray files (scratch scripts, BUILD.bazel, editor settings) in the diff.

    line 87
  6. Very specific:

    Add to the existing test file and class for the area (e.g.

    line 92
  7. Very specific:

    When a resource gains a field or a new resource type is added, add it to src/poly/tests/test_projects/test_project/ too.

    line 94
  8. Distinctive:

    Prefer real objects and the fixture projects over mocks, and mock only at the API boundary.

    line 96
  9. Very specific:

    Run uv run licensecheck --zero and uv run pip-licenses, and commit licenses.json.

    line 110
  10. Distinctive:

    Every merge to main can release.

    line 115
  11. Distinctive:

    No internal client names, project IDs, internal repos, services or tooling anywhere in a PR.

    line 131

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

PolyAI ADK

polyai-adk is the poly CLI: a git-like workflow (pull, push, branch, diff, …) for building PolyAI Agent Studio agents locally as YAML and Python files. These rules apply to every coding agent and reviewer working in this repo. Review-specific guidance is in REVIEW.md, which repeats the rules below that matter in review: when you change one of those rules, update both.

Commands

Run everything through uv run; don't activate the venv first.

TaskCommand
Install (with dev extras)uv pip install -e ".[dev]"
Testsuv run pytest src/poly/tests/
Coverageuv run pytest src/poly/tests/ --cov=poly --cov-report=term-missing
Lint / formatuv run ruff check . / uv run ruff format .
Licence checkuv run licensecheck --zero
Regenerate licenses.jsonuv run pip-licenses
Validate user skillsuv run python scripts/validate_skills.py

CI runs all of these on every PR, with tests on Ubuntu and Windows, plus a check that the PR title is a conventional commit. The ci-check skill runs the same set locally.

Layering

cli_commands/        →  AgentStudioProject (project.py)  →  AgentStudioInterface  →  PlatformAPIHandler / sdk
user interaction        logic and validation                 API facade               HTTP / protobuf
  • Anything that acts on a project is a method on AgentStudioProject, so it can be done programmatically as project.<method>(). Tests and other tools build on the project directly, without going through the CLI. That includes reads: if a command needs project data, add a project method, even one that only forwards to the interface.
  • project.py owns the logic and validation: API calls, file I/O, merging, and checking inputs (raise ValueError with a clear message). Validating there gives programmatic callers the same checks as the CLI.
  • cli_commands/ owns user interaction: argument parsing, prompts and confirmations, --json versus human output, and exit codes. Project methods never print, prompt or exit; they return data or raise, and the command decides how to show it.
  • Exception: commands that run before a project exists (login, apikey, setup, init, project list / create) may call AgentStudioInterface directly. Some project-scoped commands that still do (audio_cache.py, functions.py, conversations.py) are leftovers to fix, not patterns to copy.
  • New HTTP calls go through PlatformAPIHandler.make_request. If it lacks something you need, extend it.

Where things go

PathWhat belongs there
src/poly/cli.pyThin dispatcher that registers command classes. No logic.
src/poly/cli_commands/One module per command family. See src/poly/cli_commands/AGENTS.md.
src/poly/project.pyAgentStudioProject: everything a command needs, scoped to one local project.
src/poly/resources/One module per resource type that appears in the project projection. See src/poly/resources/AGENTS.md.
src/poly/handlers/API clients: interface.py (facade), platform_api.py (REST), sdk.py (protobuf command queue), auth, GitHub, PostHog.
src/poly/output/Terminal output (console.py) and --json output (json_output.py).
src/poly/call/, src/poly/auth/Voice calls over WebRTC (the optional [call] extra), and the login device flow.
src/poly/utils/Shared helpers: merge, credentials, JSON I/O, decorators, pre-push checks.
src/poly/docs/Resource docs shipped in the wheel and served by poly docs.
src/poly/tests/Tests, plus fixture projects in test_projects/.
docs/docs/The public docs site (mkdocs).
skills/User-facing agent skills, installed into users' projects by poly setup / poly update.
.claude/skills/Contributor skills for working on this repo (ci-check, review-pr, write-tests, add-resource-type, open-pr). Marked metadata.internal: true so poly setup never installs them.

Generated, never edit by hand: src/poly/handlers/protobuf/ and src/poly/types/.

Conventions

  • Reuse before writing. Use make_request, load_yaml / dump_yaml (resources/resource_utils.py), each resource's discover_resources, load_project (cli_commands/shared.py) and json_print. Don't add a parallel helper.
  • Match sibling commands. Same flag names (--json, --path, --force), and --json skips confirmation prompts. Most commands are scoped to a project, and regions are written us-1 / euw-1 / uk-1. Use the existing name for a concept; don't invent a new one.
  • Delete, don't shim. When a platform field or behaviour is removed, delete it from the ADK. Don't keep back-compat paths or code nothing uses.
  • Validate locally. Anything the platform would reject on push should fail in poly validate / pre-push first. A pull followed by a push must round-trip with no changes.
  • Guard side effects. Deletes touch only files the ADK owns. Anything that reaches live says so in its prompt and help text.
  • Code style: 100-char lines, type hints and docstrings on public functions, absolute poly. imports, ValueError for validation and SourcererAPIError (handlers/sdk.py) for API failures. User output goes through output/console.py or json_print in the CLI layer, diagnostics through logging.getLogger(__name__), and never a bare print.
  • Comments explain why, briefly. No narration of the change, and no stray files (scratch scripts, BUILD.bazel, editor settings) in the diff.

Tests

  • Add to the existing test file and class for the area (e.g. resources_test.py, cli_test.py, tests/api/, tests/call/). Create a new file or class only when nothing fits.
  • When a resource gains a field or a new resource type is added, add it to src/poly/tests/test_projects/test_project/ too.
  • Prefer real objects and the fixture projects over mocks, and mock only at the API boundary.

Docs and skills

A user-facing change updates, in the same PR:

  • docs/docs/: the command page in reference/cli/ and any development/ guide that covers it. Pages in reference/cli/ and reference/resources/ follow the AGENTS.md in those directories.
  • src/poly/docs/, when a resource's YAML shape changes (it backs poly docs).
  • skills/, when a command, flag or workflow that a skill mentions changes.

Docs are public. Don't name real customers, projects or internal tools.

Dependencies

Run uv run licensecheck --zero and uv run pip-licenses, and commit licenses.json. Heavy or platform-specific dependencies go in an optional extra (like [call]), not the base install.

Pull requests and releases

Every merge to main can release. The PR title becomes the squash commit, the version bump and the public release note.

Title typeRelease
feat:Minor. Anything a user can see, including output or on-disk changes.
fix:, perf:Patch
feat!: or a BREAKING CHANGE: footerMajor
chore:, docs:, ci:, build:, refactor:, style:, test:No release
  • Never edit version numbers by hand. semantic-release sets pyproject.toml's version, stamps every skills/*/SKILL.md version: and writes CHANGELOG.md. Adding a user skill means adding it to version_variables in pyproject.toml.
  • Fill in .github/PULL_REQUEST_TEMPLATE.md, using its sections only.
  • No ticket IDs (Linear or otherwise) in the PR title or description. Link the ticket in a PR comment instead.
  • No internal client names, project IDs, internal repos, services or tooling anywhere in a PR. The repo is public.
  • Stacked PRs merge bottom-up. Retarget each one to main after the PR below it merges.
  • One concern per PR. Small related fixes are fine; structural refactors get their own PR.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.