{"slug":"poly-adk-workflow","title":"poly-adk-workflow","summary":"This skill should be used when the user wants to \"build an agent\", \"update an agent\", \"create a PolyAI project\", \"push changes to Agent Studio\", or work with the PolyAI ADK (`poly`) in any way. Entrypoint for the PolyAI ADK skills suite — covers setup, project structure, resource","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-10-19T20:29:02.236042Z","repo":{"url":"https://github.com/polyai/adk","stars":83,"forks":20,"license":"Apache-2.0","updatedAt":"2026-10-19T14:31:01Z"},"bodyHtml":"<hr>\n<h2>name: poly-adk-workflow\ndescription: &gt;\nThis skill should be used when the user wants to \"build an agent\", \"update an agent\",\n\"create a PolyAI project\", \"push changes to Agent Studio\", or work with the PolyAI ADK\n(<code>poly</code>) in any way. Entrypoint for the PolyAI ADK skills suite — covers setup, project\nstructure, resource choice, and the core edit/validate/push/test/merge workflow, and\nroutes to the task-specific skills (testing, branching, conversations, rtc).\nmetadata:\nauthor: PolyAI\nlicense: Apache-2.0\nversion: 0.71.3\nrequires:\nbins:\n- poly\ninstall: \"uv tool install polyai-adk\"</h2>\n<h1>PolyAI ADK workflow</h1>\n<p>The PolyAI ADK (<code>poly</code>) is a CLI for building dialog agents on the Agent Studio platform. It gives you a Git-like local workflow: agent resources (flows, functions, topics, entities, settings) live on disk as YAML, text, and Python files, and you <code>pull</code>, <code>push</code>, <code>branch</code>, and <code>merge</code> them against the platform.</p>\n<p>Use <code>poly &lt;command&gt; --help</code> as the source of truth for flags. Almost every command accepts <code>--json</code> (a single JSON object on stdout, exit code 0 on success) — prefer it when you need to parse output.</p>\n<h2>Task-specific skills</h2>\n<p>This skill covers setup and the core loop. Load the matching skill when the task goes deeper:</p>\n<table>\n<thead>\n<tr>\n<th>Task</th>\n<th>Skill</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Testing the agent — scripted chat, running the test suite, writing test cases</td>\n<td><code>poly-adk-testing</code></td>\n</tr>\n<tr>\n<td>Merge conflicts, branch management, sharing reviews</td>\n<td><code>poly-adk-branching</code></td>\n</tr>\n<tr>\n<td>Inspecting real conversations, logging and metrics</td>\n<td><code>poly-adk-conversations</code></td>\n</tr>\n<tr>\n<td>Per-environment real-time configuration</td>\n<td><code>poly-adk-rtc</code></td>\n</tr>\n</tbody>\n</table>\n<h2>1. Installing and updating</h2>\n<p>Assume <code>poly</code> is installed. If a command fails because it isn't:</p>\n<ul>\n<li><strong>Install</strong> → <code>uv tool install polyai-adk</code> (install <code>uv</code> first if needed: <code>curl -LsSf https://astral.sh/uv/install.sh | sh</code>)</li>\n<li><strong>Update to latest</strong> → <code>uv tool upgrade polyai-adk</code></li>\n</ul>\n<h2>2. Authentication</h2>\n<p>Assume the user is already logged in — do not check credentials up front. Only if a command fails with an authentication error, ask the user to run <code>poly login</code> — it opens a browser to sign in, so they must complete it themselves. Regions: <code>studio</code> for self-serve accounts, <code>us</code> / <code>eu</code> / <code>uk</code> for enterprise workspaces. On a fresh machine, <code>poly setup</code> runs sign-in plus shell completion, AI skills, and project setup in one command.</p>\n<p>Credentials are resolved in this order: <code>~/.poly/credentials.json</code> (written by <code>poly login</code>), then a region-scoped env var (<code>POLY_ADK_KEY_US</code> / <code>POLY_ADK_KEY_EUW</code> / <code>POLY_ADK_KEY_UK</code> / <code>POLY_ADK_KEY_STUDIO</code>), then <code>POLY_ADK_KEY</code> — useful when debugging why the CLI is using the wrong account or region. <code>POLY_API_KEY</code> is an account API key for the PolyAI APIs; the ADK does not read it, so exporting it does not log the CLI in. When no ADK key resolves, the error names the region, any other regions that already hold a key, and <code>poly login --region &lt;region&gt;</code> as the fix.</p>\n<h2>3. Load the resource documentation</h2>\n<p>Before creating or editing any resource, load the built-in docs — they define each resource type's exact schema, valid values, and conventions:</p>\n<pre><code>poly docs # For the top level overview of all resource types\npoly docs {resource name} # For a specific resource type, e.g. flows, functions, topics, etc.\npoly docs flows functions topics # For multiple resource types at once\n</code></pre>\n<p>Read the relevant sections before writing files. Do not guess at resource schemas — <code>poly docs</code> is authoritative for the installed version.</p>\n<h3>Choosing the right resource type</h3>\n<p>The three that overlap most are rules, topics, and functions. The test: if an instruction is <strong>always true</strong>, it belongs in <code>agent_settings/rules.txt</code>; if it's only relevant <strong>when a subject comes up</strong>, it belongs in a topic; if it needs a <strong>comparison, calculation, or API call</strong>, it belongs in a Python function. Prompts are for collecting and presenting information; Python is for branching, routing, and validation — never write \"if X then Y\" conditionals in prompt text.</p>\n<p>Resources reference each other by name with <code>{{prefix:name}}</code> placeholders (<code>{{fn:}}</code> functions, <code>{{entity:}}</code> entities, <code>{{ho:}}</code> handoffs, <code>{{attr:}}</code> variant attributes, <code>{{vrbl:}}</code> state variables, <code>{{twilio_sms:}}</code> SMS templates, <code>{{tn:}}</code> translations). <code>poly validate</code> checks every reference resolves.</p>\n<h2>4. Set up or connect a project</h2>\n<pre><code>poly project create   # create a new Agent Studio project and pull it locally\npoly init             # connect to an existing project (interactive pickers)\npoly template list    # optional: start from a pre-built template\npoly template load &lt;name&gt;\n</code></pre>\n<p>Projects land in a <code>&lt;account_id&gt;/&lt;project_id&gt;/</code> directory. <strong>Run all <code>poly</code> commands from inside the project directory</strong>, or pass <code>--path</code>.</p>\n<p>A project looks like:</p>\n<pre><code>&lt;account&gt;/&lt;project&gt;/\n├── _gen/                    # Generated stubs — NEVER edit\n├── agent_settings/          # persona.txt, rules.txt, guardrails, languages\n├── config/                  # entities, handoffs, sms_templates, api_integrations, mcp, variants, translations\n├── context/                 # background docs for Studio Assistant\n├── voice/                   # voice channel config, speech_recognition/, response_control/\n├── chat/                    # webchat channel config\n├── flows/                   # multi-step guided conversations\n├── functions/               # Python functions (deterministic logic, lifecycle hooks)\n├── topics/                  # knowledge base entries\n├── test_suite/              # simulated conversation tests\n├── real_time_configuration/ # per-environment RTC (see poly-adk-rtc)\n└── project.yaml             # project metadata\n</code></pre>\n<h2>5. The core development loop</h2>\n<p><strong>You cannot work on <code>main</code>.</strong> Every change goes on a branch. The branch you are on determines what <code>poly push</code> writes to and what <code>poly chat</code> talks to.</p>\n<pre><code>poly pull                        # 1. start from the latest state on main\npoly branch create &lt;name&gt;        # 2. create + switch to a branch (keeps local edits)\n# 3. edit resource files on disk\npoly status                      # 4. see unpushed local changes\npoly diff                        #    inspect them in detail\npoly validate                    # 5. catch structural errors locally, before pushing\npoly push                        # 6. push to the branch\npoly chat --push                 # 7. test interactively (see poly-adk-testing)\npoly test run                    #    and/or run the simulated test suite\n# 8. iterate: repeat 3–7\npoly branch diff                 # 9. review everything on the branch since creation\npoly branch merge '&lt;message&gt;'    # 10. merge into main (deploys to sandbox automatically)\n</code></pre>\n<p>Key distinctions:</p>\n<ul>\n<li><code>poly status</code> / <code>poly diff</code> show <strong>unpushed local edits</strong>; <code>poly branch status</code> / <code>poly branch diff</code> show <strong>everything on the branch</strong> since it was created. Use the branch-level commands before merging.</li>\n<li><code>poly revert</code> discards local changes; <code>poly format</code> normalizes resource files.</li>\n<li><code>poly pull</code> three-way merges rather than overwriting, and <code>poly branch merge</code> can conflict — if either reports conflicts, load <code>poly-adk-branching</code> for the resolution workflow.</li>\n</ul>\n<h2>6. Testing</h2>\n<p>Four layers, catching different problems — load <code>poly-adk-testing</code> for the details of each:</p>\n<table>\n<thead>\n<tr>\n<th>Command</th>\n<th>Catches</th>\n<th>Runs against</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>poly validate</code></td>\n<td>Invalid resources, missing values, broken references</td>\n<td>Local files</td>\n</tr>\n<tr>\n<td><code>poly chat</code></td>\n<td>Conversational behavior, judged by reading</td>\n<td>Last <strong>pushed</strong> state</td>\n</tr>\n<tr>\n<td><code>poly test run</code></td>\n<td>Regressions, repeatably</td>\n<td>Last <strong>pushed</strong> state</td>\n</tr>\n<tr>\n<td><code>poly conversations</code></td>\n<td>What happened on real calls</td>\n<td>Live traffic</td>\n</tr>\n</tbody>\n</table>\n<p><code>poly chat</code> and <code>poly test run</code> run against the last pushed state, <strong>not</strong> local files — push first, or use <code>poly chat --push</code> / <code>poly test run --push</code>.</p>\n<h2>7. Deployment</h2>\n<p>Merging into <code>main</code> deploys to <code>sandbox</code> automatically. From there, promotion is one step at a time up the ladder — <code>sandbox</code> → <code>pre-release</code> → <code>live</code>:</p>\n<pre><code>poly deployments promote --from sandbox --to pre-release --dry-run\npoly deployments list             # what is deployed where\n</code></pre>\n<p><strong>Never promote to <code>pre-release</code> or <code>live</code> unless the user explicitly asks</strong> — <code>live</code> is production. Use <code>--dry-run</code> first to preview, and re-run tests against each environment after promoting. See <code>poly deployments --help</code> for the full surface, including rollback.</p>\n<h2>Rules and gotchas</h2>\n<ul>\n<li>Never edit anything under <code>_gen/</code> — generated stubs.</li>\n<li>Never work on <code>main</code>; check <code>poly branch current</code> if unsure.</li>\n<li>Run <code>poly validate</code> before every push — push runs the same validation and rejects what validate rejects.</li>\n<li>Python functions callable by the model need <code>@func_description</code> and <code>@func_parameter</code> decorators; without them the platform creates the function with no parameters and calls fail at runtime. Lifecycle functions and function steps don't need them.</li>\n<li>Keep resource names stable — resources reference each other by name (<code>{{prefix:name}}</code> syntax).</li>\n<li>Keep branches small and focused; pull before starting work so conflicts stay small.</li>\n<li>The web UI edits the same branches — someone may change the branch in Agent Studio while you work; <code>poly pull</code> reconciles.</li>\n</ul>\n","files":[{"path":"SKILL.md","sizeBytes":9302,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-10-19T20:29:18.95611Z","sha256":"42DCBA287FD89188658D9A4A3D45FAAE9B8B92571650985C192C28DB487A79DA","sizeBytes":4078},"review":null,"source":{"repositoryUrl":"https://github.com/polyai/adk","path":"skills/poly-adk-workflow","license":"Apache-2.0","commit":"f615d0fa167805d1e5ecc04560cd6fdf73924aad","subtreeSha":"DB3132E98D1EA1A6B58D42A75CE0760FBBAFB0673E7FAE8CF518690E2FFDCFF9","lastSyncedAt":"2026-10-19T20:29:00.12477Z"},"reviewedAt":"2026-10-19T20:29:38.699906Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/polyai/adk/tree/main/skills/poly-adk-workflow"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install polyai-adk@llmmart"},{"target":"git","command":"git clone https://github.com/polyai/adk.git"}]}