Repository navigation
feat(templates): declare skills-library skills to assign at creation (#4387) - #4388
Conversation
…bilityai#4387) A template can now name skills from the platform skills library in `template.yaml` `library_skills:`. Creating an agent from it assigns each name the library has (as the owner; the creating agent recorded for attribution) and delivers them once the agent's /health answers, through the start-path injection. Creation starts the container directly, so nothing else delivered assigned skills before the agent's next start. - services/template_skills.py: total reader (charset from skill_packaging, de-dup, cap 50, `set:` refused by name); both catalog builders surface library_skills + library_skill_errors - all three resolver branches fill _TemplateResolution.declared_library_skills - the skills.manage fence applies at creation: an agent key without the grant gets no assignment; people, user keys and the system key pass - ghost-skipped, non-fatal inside the creation rollback fence; a missed delivery is repaired by the next start - requirements §21.3.4, architecture map + agent-lifecycle section, agent guide Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for this — the gap is real: a single agent created from a template gets no library skills today, only system manifests assign them. We'd like to take it, with one change before review:
Everything else in the design (the |
|
merge-train 2026-11-10: ejected. Rides the next train once fixed. The feature looks right and all 6 acceptance criteria map to code. These items keep it off this train:
Tier 1 has also never run on this fork PR, since its workflows are waiting at |
…refusal (Abilityai#4387) Addresses the merge-train review on Abilityai#4388. - Call site pinned: three test_4387_* cases in the create-agent characterization suite run a whole create_agent_internal. With the call site passing tr.declared_library_skills unfenced, the agent-key case goes red. The copy-snapshot resolver branch gets its own test as well. - The fence refusal at creation is now an audit row (capability_refused, target = the new agent), and an agent key the grant admits leaves a capability_used row, like the route fence. dependencies._audit_capability now tolerates request=None, which a system deploy passes. - LIBRARY_SKILLS_READY_TIMEOUT_S is a constant, not an env read. - Third-party names removed from the requirement text and test fixtures. - Feature-flow doc (template-library-skills.md) and a "Declared Library Skills" section in the creating-agents user doc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review. All four items are addressed in de068e9.
Tests: 65 related files (create path, templates, skills, every capability-audit suite) gave 2423 passed. The same 8 Tier 1 still needs a maintainer to approve the workflow runs on this fork PR. |
Conflicts in docs/memory/feature-flows.md and agent_service/crud.py were keep-both: dev's declared_model seed (Abilityai#4442) and bundled avatar install (ent#1173) sit beside this branch's declared_library_skills. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Merged current |
…gnment (Abilityai#4387) dev's ent#753 guard requires every agent_skills writer to reach the gate reconcile. The creation-time writer now does, before delivery, and is listed in the guard's expected sites. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
One more push from me (
|
…incipal (Abilityai#4387) The assignment-time gate reconcile carried no actor, so a default gate applied at creation was audited as system. The principal and request are now threaded through, a test pins the reconcile and its order before delivery, and an ephemeral creation no longer runs the skills.manage fence it cannot use. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
merge-train (2026-11-19): validated at Ruling on skill sets: names-only ships now. The 11-10 request for One more commit from me on this branch (
292 tests across the nine suites that touch these functions pass. @francisjervis please pull before pushing anything further. Left for follow-up, none blocking: the create dialog does not show a template's declared skills, there is no |
Closes #4387
Journey Impact: extends: J18
What
template.yamlcan now declare skills from the platform skills library that an agent created from the template should hold:At creation (
local:,github:and copy-snapshot templates), each declared name the library has is assigned to the new agent (assigned_by= owner,assigned_by_agent= the creating agent, if any). Once the agent's/healthanswers, the start-path injection delivers them.Why
template.yaml'sskills:field is documentation only, and the create path never assigned library skills. A template built around a library source (a research agent and its skills source, in the case that prompted this) was created without its core skills, and the owner had to assign them by hand. Bundling copies into the template freezes them and cuts them off from library updates.Creation also starts the container directly, not through
start_agent_internal, so even a skill assigned right after creation was not delivered until the agent's next start.How
services/template_skills.py: a total reader, the shape oftemplate_plugins/template_schedules(never raises; charset fromskill_packaging.SKILL_NAME_RE, de-duplicated, capped at 50,set:<name>refused with a named error). Both catalog builders surfacelibrary_skills+library_skill_errors._TemplateResolution.declared_library_skills, filled by all three resolver branches (nottemplate_data, which is{}ongithub:).create_agent_internalpasses the declaration through_permitted_library_skills: the §21.3.1skills.managefence viadependencies.capability_refusal, all-or-none and non-raising. An agent key without the grant gets no assignment, so creating an agent from a template can't be used to obtain library skills. A refusal writes acapability_refusedaudit row (target = the new agent); an agent key the grant admits writescapability_used, as at the route fence.dependencies._audit_capabilitynow toleratesrequest=None(system deploy)._materialize_agent_filesassigns each name the library has (db.assign_skill; unknown names skipped and logged), then spawns a fire-and-forget task that waits onlifecycle.wait_for_agent_ready(LIBRARY_SKILLS_READY_TIMEOUT_S, a 900 s constant) and runslifecycle.inject_assigned_skills, so sets, gates and the prune behave as on a start.Relationship to
skill_assignment_service.assign_and_deliver(ent#1030): that helper delivers immediately, which at creation time would only reportnot_deliveredbecause the agent server is not up yet. This path writes the rows at creation and defers delivery to the start-path injection once the agent is ready (that injection reconciles library gates before delivering). Happy to route the post-readiness step throughassign_and_deliverinstead if you'd rather keep a single sequence, which would also add theskills_changedbroadcast.Docs
Requirements §21.3.4 (
requirements/skills.md), the Architecture Map row and a section inarchitecture/agent-lifecycle.mdfor the new module, thetemplate.yamlreference inTRINITY_COMPATIBLE_AGENT_GUIDE.md, the feature flowfeature-flows/template-library-skills.md(indexed), and a "Declared Library Skills" section inuser-docs/agents/creating-agents.md.Testing
tests/unit/test_4387_template_library_skills.py: 45 tests covering the reader's shapes, both catalog builders, all three resolver branches (copy snapshot included), the fence and its audit rows (person / user / system pass; agent key without the grant, connector and no-scope refused; the real audit writer withrequest=None), assignment (owner attribution, creating-agent attribution, unknown names skipped, ghost skip, non-fatal), and delivery (readiness-gated, failure swallowed, no-loop spawn).tests/unit/test_1484_create_agent_characterization.py(test_4387_*, 3 tests): a wholecreate_agent_internalrun pins the call site. A person gets the names; an agent key without the grant gets none plus a refusal row; an agent key with the grant gets them, attributed to itself.tr.declared_library_skillsunfenced at the call site turnstest_4387_an_agent_key_without_skills_manage_gets_nonered; dropping the copy-snapshot assignment turnstest_copy_snapshot_branch_populates_declared_library_skillsred.test_ent1030_skills.pyand fail identically ondevwithout this change when run in the same set; the file passes on its own (24/24) and alongside the new tests in either order.local:template declaring 4 library skills. All 4 were assigned at creation and delivered after the agent became ready ([§21.3.4] Delivered library skills to …: success).🤖 Generated with Claude Code