ateam_patch
Surgically update ANY field in a skill or solution definition, redeploy, and optionally re-test — all in one step.
⚠️ MERGE-BY-DEFAULT (v0.4.0) — Arrays are protected from silent replace. Bare array writes on solution.linked_skills / ui_plugins / platform_connectors / handoffs / grants / triggers (etc.) and skill.tools / connectors / handoffs / scenarios are REFUSED to prevent sibling loss. Add or remove items with the _push / _delete / _update suffixes; opt into a full-array replace only when you really mean it.
OPERATIONS (safe by construction):
Scalar (dot notation): { "problem.statement": "new value", "role.persona": "You are..." }
Deep nested: { "intents.thresholds.accept": 0.9, "policy.escalation.enabled": true }
Array APPEND: { "tools_push": [{ name: "new_tool", description: "..." }] }
Array REMOVE: { "tools_delete": ["tool_name"] }
Array MODIFY-ONE: { "tools_update": [{ name: "existing_tool", description: "updated" }] }
Full-array REPLACE (opt-in): { "linked_skills": [...], "linked_skills_replace": true } — or { _replace: true, ... } to opt every array in this call.
SOLUTION-LEVEL EXAMPLES (target='solution'):
ADD a skill to the solution: updates: { "linked_skills_push": ["my-new-skill"] } ← NOT { linked_skills: ["my-new-skill"] } (that would REFUSE — it drops your other skills)
REMOVE a skill: updates: { "linked_skills_delete": ["old-skill"] }
ADD a UI plugin: updates: { "ui_plugins_push": [{ id: "mcp:conn:panel", ... }] }
ADD a handoff: updates: { "handoffs_push": [{ id: "h1", ... }] }
SKILL-LEVEL EXAMPLES (target='skill' + skill_id):
Change persona: updates: { "role.persona": "You are a friendly assistant" }
Append to persona: updates: { "persona_append": "\n\nALWAYS respond in 2 sentences." }
Add a guardrail: updates: { "policy.guardrails.never_push": ["Never share passwords"] }
Add a tool: updates: { "tools_push": [{ name: "conn.tool", description: "...", inputs: [...], output: {...} }] }
Change intent: updates: { "intents.supported_update": [{ id: "i1", description: "new desc" }] }
CREATE a new skill: target='skill', skill_id='my-new-skill', updates: { "problem.statement": "...", "role.persona": "..." } — auto-scaffolded and added to solution topology.
PREVIEW BEFORE WRITING: pass dry_run:true to see the diff (arrays_merged, arrays_replaced, dropped_ids, added_ids) without applying. Use this before any destructive-looking edit.
VERDICT (skill target): the response carries a NON-BLOCKING validation block { skill_id, valid, ready_to_export, error_count, incomplete_sections[], unresolved_refs } — the patch always saves even if the def is now invalid, so CHECK valid: false and fix incomplete_sections before relying on it (build_and_run will refuse to deploy an invalid skill). error_count can include auto-import connector-tool artifacts, so act on incomplete_sections first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | No | Where the solution/skill definition lives. Omit (DEFAULT) — prefer the tenant's GitHub repo (GitHub is master), but AUTO-DEGRADE to the Builder FS store if the tenant hasn't connected a repo, so a simple def patch always succeeds (it's pushed to GitHub once connected). 'github' — force GitHub; fails loud if not connected (use when you specifically require the repo write). 'local' — force the Builder FS store, no GitHub (repo-less bootstrap tenant). Redeploy is local in all modes. | |
| target | Yes | What to update: 'solution' for solution definition, 'skill' for skill definition fields (problem, role, intents, tools, policy, engine, scenarios, etc.) | |
| dry_run | No | If true, apply the patch in memory and return the diff (arrays_merged, arrays_replaced, dropped_ids, added_ids, would_write_bytes) WITHOUT writing to GitHub or redeploying. Preview a change before committing to it. | |
| updates | Yes | The update payload. Use dot notation for nested scalars (e.g. 'problem.statement': 'new value'). For arrays, use _push/_delete/_update suffixes (e.g. 'tools_push', 'tools_delete'). You can update ANY field in the skill definition: problem, role, intents, tools, policy, engine, scenarios, glossary, etc. | |
| skill_id | No | Required when target is 'skill'. The skill ID to patch. | |
| solution_id | Yes | The solution ID | |
| test_message | No | Optional: re-test the skill after patching. Requires skill_id. | |
| include_definition | No | If true, return the FULL patched definition. Default false — the result returns a compact patched_summary instead, because the full definition can exceed the ~50KB output limit and truncate the rest of the result (redeploy status, widget_health). |