$npx -y skills add GoogleCloudPlatform/cxas-scrapi --skill cxas-agent-foundryEnd-to-end GECX/CXAS/CES conversational agent lifecycle -- build agents from requirements (PRD-to-agent), create and run evals (goldens, simulations, tool tests, callback tests), debug failures, and iterate to production quality. Use this skill whenever the user mentions GECX, CX
| 1 | # Agent Foundry |
| 2 | |
| 3 | End-to-end lifecycle for GECX conversational agents: build, test, debug, iterate. |
| 4 | |
| 5 | ## Step tracking — MANDATORY (Phase 0, blocking) |
| 6 | |
| 7 | **Before doing ANY work — including running setup, asking questions, or scaffolding files — initialize `<project>/todo.md` from the relevant sub-skill's checklist (verbatim).** The checklist is a contract, not a suggestion. If `todo.md` doesn't exist for the current task, refuse to proceed and create it first. |
| 8 | |
| 9 | Long debug/build runs skip verification steps under pressure (e.g., pushing without linting, scaffolding without a TDD, claiming "deployed" without actually pushing). The checklist exists because of this. **The instinct to skip a step is the moment the checklist earns its keep — that's when you must consult it, not the moment to bypass it.** |
| 10 | |
| 11 | |
| 12 | ## Quick Reference |
| 13 | |
| 14 | ```bash |
| 15 | # Lint: dispatch agents/lint-fixer.md sub-agent — DO NOT run `cxas lint` on the main thread. |
| 16 | # Lint output is verbose; keep it inside the sub-agent context. |
| 17 | |
| 18 | # Push local files to platform (only after lint-fixer returns status: clean) |
| 19 | cxas push --app-dir <project>/cxas_app/<AppName> \ |
| 20 | --to projects/<project_id>/locations/<location>/apps/<app_id> \ |
| 21 | --project-id <project_id> --location <location> |
| 22 | |
| 23 | # Pull platform state to local |
| 24 | cxas pull projects/<project_id>/locations/<location>/apps/<app_id> \ |
| 25 | --project-id <project_id> --location <location> --target-dir <project>/cxas_app/ |
| 26 | |
| 27 | # Run evals + triage + report (single command) |
| 28 | python .agents/skills/cxas-agent-foundry/scripts/run-and-report.py --message "what changed" --runs 5 |
| 29 | |
| 30 | # Inspect app architecture |
| 31 | python .agents/skills/cxas-agent-foundry/scripts/inspect-app.py |
| 32 | |
| 33 | # Triage failures |
| 34 | python .agents/skills/cxas-agent-foundry/scripts/triage-results.py --last 3 |
| 35 | |
| 36 | # Run all 6 build-verification gates against the deployed app |
| 37 | python .agents/skills/cxas-agent-foundry/scripts/gate-check.py |
| 38 | |
| 39 | # Tune scoring thresholds (similarity, hallucination, extra-tools) |
| 40 | python .agents/skills/cxas-agent-foundry/scripts/app-thresholds.py show |
| 41 | |
| 42 | # Sync callback Python code into evals/callback_tests/agents/ + create test.py symlinks. |
| 43 | # Required for tests to be discoverable by test_all_callbacks_in_app_dir. |
| 44 | python .agents/skills/cxas-agent-foundry/scripts/sync-callbacks.py # post-push: pull from platform |
| 45 | python .agents/skills/cxas-agent-foundry/scripts/sync-callbacks.py --from-local <app_dir> # pre-push: copy from local app dir |
| 46 | |
| 47 | # Cold-start setup (first-time only — venv + project bootstrap) |
| 48 | .agents/skills/cxas-agent-foundry/scripts/setup.sh |
| 49 | python .agents/skills/cxas-agent-foundry/scripts/setup-project.py |
| 50 | ``` |
| 51 | |
| 52 | **Disambiguation:** `gate-check.py` and `inspect-app.py` overlap on "show me the architecture" but `gate-check.py` is the answer whenever the user is about to push, finished building, or wants a verification pass. `inspect-app.py` is for a quick "what's in here" look without the verification gates. When in doubt, use `gate-check.py`. |
| 53 | |
| 54 | ## Sub-agents |
| 55 | |
| 56 | For heavy diagnosis/analysis work that would otherwise burn main-thread context, dispatch one of these sub-agents via the `Agent` tool. Pass the contents of the relevant `.md` file as the prompt, then add the inputs the file lists. |
| 57 | |
| 58 | | Sub-agent | Reasoning intensity | When to use | |
| 59 | |---|---|---| |
| 60 | | `agents/triage-failure.md` | HIGH | Diagnose ONE failing eval. Fan out for the top 5 failures by category priority in parallel. Iterate on more after the first batch returns. | |
| 61 | | `agents/tdd-writer.md` | HIGH | Reverse-engineer a TDD from an existing agent OR draft from PRD. Returns the TDD + open-questions handoff; main thread runs the show/ask/iterate loop with the user (sub-agents can't ask). | |
| 62 | | `agents/scaffolder.md` | MEDIUM | Bulk-generate all agent code (agent JSONs, instruction.txt, tool python_code, callbacks, app.json) from an APPROVED TDD. One dispatch replaces 30-60 main-thread file writes. | |
| 63 | | `agents/coverage-analyst.md` | MEDIUM | Generate a full eval coverage report against an agent's architecture. | |
| 64 | | `agents/eval-writer.md` | MEDIUM | Generate evals for one entire eval TYPE (all goldens, all sims, etc.) — reads TDD's Coverage Map itself. Max 4 dispatches per build. | |
| 65 | | `agents/lint-fixer.md` | LOW (mechanical) | Run `cxas lint` and mechanically fix all errors + deterministic warnings until clean. Never run lint on main thread. | |
| 66 | |
| 67 | For running evals: there is no sub-agent. Use `scripts/run-and-report.py --json-summary <path> > /dev/null 2>&1` and read the summary fil |