[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M793977Q7A2T0HSWBACM34EE":3,"skill-same:01M793977Q7A2T0HSWBACM34EE":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M793977Q7A2T0HSWBACM34EE","agentos-secondmates",null,"Charter, provision, route to, recover, change, and retire persistent AgentOS Second Mates. Use only from First Mate before any Second-Mate lifecycle operation, scope decision, charter handoff, runtime recovery, work transfer, configuration change, or retirement.","akua-dev\u002Fagentos","akua-dev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F173261869?v=4","01M7938GS2G2Q6E2M9PRW7QWRJ","Akua - Build autonomous companies ","01M7938GT412SS56QZVCE0Z7FV",8,"MIT","https:\u002F\u002Fgithub.com\u002Fakua-dev\u002Fagentos\u002Fblob\u002Fmain\u002Fpackages\u002Fagentos\u002Fresources\u002Froles\u002Ffirstmate\u002Fskills\u002Fagentos-secondmates\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: agentos-secondmates\ndescription: Charter, provision, route to, recover, change, and retire persistent AgentOS Second Mates. Use only from First Mate before any Second-Mate lifecycle operation, scope decision, charter handoff, runtime recovery, work transfer, configuration change, or retirement.\n---\n\n# Manage AgentOS Second Mates\n\nTreat a Second Mate as a persistent direct report with an isolated charter, Agent identity, home and supervision loop.\nUse the same Task, Assignment, Inbox and direct-report lifecycle as ordinary delegation; do not create a parallel coordination system.\n\n## Check the capability boundary\n\n1. Inspect the selected AgentOS release for implemented Second-Mate identity, charter storage, persistent runtime provisioning, database principal registration and Pi launch or recovery primitives.\n2. Stop if any required schema, Kustomize base or native tool capability is absent.\n   Explain the missing release capability instead of inventing metadata keys,\n   SQL, credentials or an AgentOS wrapper.\n3. Load `$agentos-database`, `$agentos-runtime`, `$agentos-auth` and `$agentos-delegation` at their respective boundaries.\n\n## Decide whether a Second Mate is warranted\n\nCreate a Second Mate for a durable domain that benefits from its own queue, context and Crewmate subtree.\nDo not create one for a single bounded task, temporary concurrency or a project name alone.\nProject access is non-exclusive; route by natural-language charter scope.\n\nBefore creating one:\n\n1. Query every active Second Mate and compare the requested responsibility with existing charters.\n2. Prefer extending or clarifying one compatible charter over creating overlap.\n3. Present the proposed charter, project access, runtime footprint, model authentication and expected cost to the Captain.\n4. Ask before provisioning identity, credentials, PVC, pod, RBAC or other infrastructure.\n\n## Define the charter\n\nRequire one durable charter with:\n\n- a short responsibility summary and unambiguous natural-language scope;\n- the parent First-Mate identity;\n- non-exclusive project access needed for read-only intake and delegated work;\n- authority already granted and actions that must escalate;\n- the upward reporting path through Inbox, Tasks and Assignments;\n- the rule that project work is always delegated to Crewmates;\n- the rule that the Second Mate never creates another Second Mate;\n- the idle contract: reconcile owned work, then wait silently without inventing work;\n- retirement and handoff expectations.\n\nStore the charter only through the released schema or provisioning primitive that owns its exact format.\nDo not improvise a second registry in Markdown, terminal state or an unreviewed JSON shape.\nKeep stable Fleet-wide or domain guidance in the owning Mate's private context\nthrough `$agentos-memory`; it is fallible context and never a shared\ncoordination, charter or approval authority. Keep the Second-Mate charter in\nthe released `agents.metadata.charter` shape, and use Inbox for exact Captain\ndecisions. Do not copy memory into another home or inherited Pi configuration.\nLearnings remain domain-local unless promoted through a reviewed shared\nAgentOS or project instruction change.\n\n## Provision and hand off\n\n1. Create exactly one `second_mate` identity as a direct child of First Mate with the released `agentos.provision_agent` Function.\n   Pass handle, role `second_mate`, harness `pi`, useful provisioning status text, display name and an object at `metadata.charter` with non-empty `summary` and `scope` strings.\n   The Function returns the existing UUID on an exact retry, rejects a conflicting handle and leaves new identities in `provisioning` state.\n2. Keep Second Mate on Pi with its own persistent home and PostgreSQL login.\n   Give it a dedicated Pod, ServiceAccount, home PVC and pod-local Herdr server.\n3. Through the selected database platform's approved role-management path, create one login without `SUPERUSER`, `CREATEDB`, `CREATEROLE`, `BYPASSRLS` or inherited owner authority.\n   Bind it with `agentos.register_agent_principal`; never embed its password in Fleet rows or the database URL.\n4. Load `$agentos-runtime`. From the active First Mate role resource directory,\n   create a reviewed per-Agent overlay over\n   `..\u002Fsecondmate\u002Fkubernetes\u002Fdomain` under\n   `$HOME\u002F.local\u002Fstate\u002Fagentos\u002Fworkloads\u002F\u003Chandle>\u002F`. Select one Kubernetes-safe\n   domain namespace and patch the Namespace name, Fleet label, returned owner\n   Agent UUID, Second-Mate RoleBinding subject namespace, workload identity,\n   immutable AgentOS image digest, password-free fully qualified PostgreSQL\n   URL, Secret name, labels, Herdr session and storage. The released domain\n   composition supplies restricted Pod Security labels, ingress-only\n   isolation, bounded quota, the Second-Mate workload Role and the core\n   First-Mate supervisor Role. Never add an egress-deny policy.\n   If a persistent-Mate model or thinking level was selected, follow\n   `$agentos-harnesses` and patch its `AGENTOS_MODEL` and `AGENTOS_THINKING`\n   values onto the `prepare-home` init container before rendering or applying\n   the workload. Do not add an omitted axis or a shared release default.\n   The runtime workflow must begin one SQL `provision` operation from the\n   reviewed render digest before apply and advance that same operation through\n   apply, workload and harness evidence.\n5. Render and inspect the complete overlay, then apply its reviewed Namespace\n   resource first. Verify its concrete Fleet and owner-Agent labels, restricted\n   Pod Security profile and absence of an egress policy. Create or select one\n   approved Secret in that namespace with a `pgpass` key for the login. Every\n   Secret in this namespace is domain-visible because the Second Mate can mount\n   it through a child workload; never place Fleet-root credentials there. Do\n   not print the value or invent a second secret format.\n6. Use the runtime skill's native server-side dry-run,\n   `kubectl diff` and synchronous `kubectl apply` sequence. Stop on an existing\n   resource with conflicting identity rather than adopting it by name. The\n   overlay creates no database role, Secret or public endpoint. It must retain\n   the base's projected ServiceAccount identity and exactly the reviewed domain\n   Roles, RoleBindings, ResourceQuota and ingress NetworkPolicy. Verify the\n   Second Mate can create and operate Crewmate workloads only in this namespace,\n   cannot read or create Secrets or mutate namespace controls, and cannot read,\n   exec or create anything in a sibling domain. Verify First Mate can inspect,\n   attach, stop, manage domain credentials and repair controls. Later Crewmate\n   overlays contain no RBAC; they consume the installed domain Role.\n7. Attach to the Second Mate Pod and load `$agentos-auth` for Pi's browser login.\n   Login happens in the persistent Pi home; never copy First Mate's or the local bootstrap agent's token directory.\n8. Verify the PostgreSQL session resolves the expected Agent identity, parent and charter through the password-free URL and persisted mode-`0600` pgpass file.\n   Verify the PVC is Bound, exactly one named Herdr Agent is Ready, the selected\n   model can answer a harmless request, and Pi's live model and thinking level\n   match every explicitly selected axis. A matching `settings.json` alone is\n   not runtime evidence. Verify that a Pod replacement restores the same PVC,\n   native Pi session and effective selected profile.\n9. In one short database transaction, record the verified Kubernetes and Herdr locators, set useful status text and change lifecycle state from `provisioning` to `active`.\n   On partial failure, preserve the row and runtime evidence in `provisioning` state for reconciliation; do not create a replacement identity or destructively roll back the PVC.\n   Complete the same runtime operation only after this transaction commits. On\n   an ambiguous boundary, mark it `recovery_required`, inspect native truth and\n   repair forward. A changed desired render uses atomic supersession, not an\n   unlinked new operation.\n10. Move accepted in-scope Tasks with\n    `agentos.handoff_task_assignment`. Preserve the stable Task, Assignment\n    history, dependencies, complete destination brief and concrete dispatch\n    profile; do not clone backlog rows or rewrite the previous Agent. Active\n    work requires an explicit handoff report. An exact retry returns the same\n    replacement; invalid hierarchy or destination fails closed.\n11. Deliver one concise Inbox handoff naming the chartered outcome or queue.\n12. Confirm the Second Mate reconciles only its own work and then establishes its own supervision wait.\n\nFirst Mate supervises the Second Mate as one direct report.\nThe Second Mate supervises its Crewmates; First Mate does not reconstruct the descendant subtree during routine operation.\n\n## Maintain the domain topology\n\nTreat Second-Mate topology as a reviewed operating decision, not a scheduler.\nReview it after durable changes in assignment load, backlog, routing ambiguity,\nhandoff frequency, cross-domain escalation, dependency coupling, failures,\ncapacity, cost, idle duration or delivery health. OpenTelemetry is diagnostic\nevidence only; at least one observed PostgreSQL, Kubernetes or Herdr signal is\nrequired. Never store prompts, messages, model reasoning or task content in a\ntopology plan.\n\nKeep domains broad and permeable:\n\n- `expand`, `modify` or `shrink` changes one existing charter without moving work automatically;\n- `split` narrows one existing charter and provisions exactly one new broad domain;\n- `merge` names one of two existing domains as survivor and retires the other only after every active Assignment and child Agent has been handed off;\n- `retire` removes one empty domain only after the same safety checks.\n\nEvery proposal must retain non-exclusive project access, common-ancestor\ncross-domain routing, forbidden lateral delivery and forbidden automatic\nscheduling. A project, repository, temporary load spike or current team shape\nis not by itself a durable domain. Prefer one compatible charter over parallel\nspecialists, shared queues or overlapping ownership that would become a silo.\n\nFor each change:\n\n1. Read the current direct Second-Mate identities, exact\n   `agents.metadata.charter` values, active Assignments and child Agents. Record\n   only bounded reason and signal classes in the proposal.\n2. Build one closed v1 proposal with an expiry of at most 30 days and compile it\n   through the released Effect API `compileSecondMateTopologyPlan`. Do not hand\n   craft the digest or add fields. If the active release has no Effect caller\n   boundary for this API, stop instead of bypassing it with ad hoc JSON.\n3. Create the typed Inbox decision with\n   `agentos.hold_second_mate_topology_decision` on an accepted managed Task.\n   Present the action, exact before\u002Fafter charters, runtime consequence,\n   evidence classes and expected cost to the Captain.\n4. Record the Captain's exact approval or rejection with\n   `agentos.resolve_second_mate_topology_decision`. Approval alone does not\n   mutate identity, charter or runtime state.\n5. On approval, call `agentos.apply_second_mate_topology_decision`. It rejects\n   expired plans, stale charters, the wrong First Mate, unsafe retirement and\n   conflicting retries. An exact retry returns the immutable prior result.\n6. Read `agentos.second_mate_topology_transitions` for the durable applied\n   result. Reconcile any resulting provisioning or teardown with the existing\n   runtime-operation journal and this Skill's provision, handoff and retire\n   workflows. Never infer Kubernetes success from the SQL transition.\n\nChanging a charter never grants new external API authority, database authority\nor Kubernetes RBAC. Apply those through their owning authorization workflows\nafter separate review. First Mate remains responsible for revisiting domain\nboundaries as reality changes; Second Mates remain responsible for flexible\nCrewmate delegation inside their current broad domain.\n\n## Route work\n\n1. Resolve the project and request first, then compare the nature of the work with active charters.\n2. Route to one clear match.\n   If charters overlap or no charter fits, keep routing authority with First Mate and resolve the ambiguity before dispatch.\n3. Create or associate the durable Task and first Assignment through the atomic\n   acceptance path in `$agentos-delegation` before sending the request. Never\n   accept work with separate Task and Assignment inserts.\n4. Use Inbox for the chartered request and upward answer.\n   Do not rely on terminal injection as the handoff record.\n5. Let the Second Mate own its internal Crewmate lifecycle and report only decisions, blockers, material phase changes, completion and failure upward.\n\n## Recover\n\n1. Load `$agentos-supervision` and reconcile the Second Mate's database identity, current Assignment, pod, PVC, Herdr locator and native Pi session.\n2. Treat an idle live session as healthy.\n3. If the runtime is missing, reuse the same Agent identity, home and native session through the released recovery primitive.\n4. Never create a replacement Second-Mate row merely because its pod or terminal disappeared.\n5. Do not sweep or mutate the Second Mate's descendant runtimes from First Mate unless the Second Mate cannot recover and the Captain authorizes intervention.\n\n## Retire\n\nRetirement is explicit, never an idle timeout.\n\n1. Stop new routing to the charter.\n2. Complete or reassign every active Task Assignment.\n3. Require the Second Mate to hand off every active child Agent and durable decision thread.\n4. Preserve delivered artifacts, reports, Inbox history and charter history.\n5. Call `agentos.retire_agent` only after the database accepts that no active Assignments or children remain.\n6. Begin one `teardown` runtime operation bound to the retired Agent, exact\n   namespace\u002Fworkload and desired render digest. Declare the recorded PVC with\n   explicit `retain` or separately approved `discard` disposition; the SQL\n   boundary rejects active work or an omitted PVC decision.\n7. Remove the StatefulSet, Service and ServiceAccount without deleting retained\n   PVCs. Keep the domain Namespace and its controls while any retained PVC or\n   recoverable state remains.\n   Record `applied` after the exact resources are absent and complete the\n   operation only after the retained-resource disposition is verified.\n8. Delete retained PVCs and then the Namespace only after separate explicit\n   Captain approval for that destructive discard. Namespace deletion is never\n   routine cleanup because it deletes namespaced PVC objects regardless of the\n   StatefulSet retention policy.\n9. Never use a forced runtime or Namespace deletion to bypass database\n   retirement guards.\n","# Manage AgentOS Second Mates\n\nTreat a Second Mate as a persistent direct report with an isolated charter, Agent identity, home and supervision loop.\nUse the same Task, Assignment, Inbox and direct-report lifecycle as ordinary delegation; do not create a parallel coordination system.\n\n## Check the capability boundary\n\n1. Inspect the selected AgentOS release for implemented Second-Mate identity, charter storage, persistent runtime provisioning, database principal registration and Pi launch or recovery primitives.\n2. Stop if any required schema, Kustomize base or native tool capability is absent.\n   Explain the missing release capability instead of inventing metadata keys,\n   SQL, credentials or an AgentOS wrapper.\n3. Load `$agentos-database`, `$agentos-runtime`, `$agentos-auth` and `$agentos-delegation` at their respective boundaries.\n\n## Decide whether a Second Mate is warranted\n\nCreate a Second Mate for a durable domain that benefits from its own queue, context and Crewmate subtree.\nDo not create one for a single bounded task, temporary concurrency or a project name alone.\nProject access is non-exclusive; route by natural-language charter scope.\n\nBefore creating one:\n\n1. Query every active Second Mate and compare the requested responsibility with existing charters.\n2. Prefer extending or clarifying one compatible charter over creating overlap.\n3. Present the proposed charter, project access, runtime footprint, model authentication and expected cost to the Captain.\n4. Ask before provisioning identity, credentials, PVC, pod, RBAC or other infrastructure.\n\n## Define the charter\n\nRequire one durable charter with:\n\n- a short responsibility summary and unambiguous natural-language scope;\n- the parent First-Mate identity;\n- non-exclusive project access needed for read-only intake and delegated work;\n- authority already granted and actions that must escalate;\n- the upward reporting path through Inbox, Tasks and Assignments;\n- the rule that project work is always delegated to Crewmates;\n- the rule that the Second Mate never creates another Second Mate;\n- the idle contract: reconcile owned work, then wait silently without inventing work;\n- retirement and handoff expectations.\n\nStore the charter only through the released schema or provisioning primitive that owns its exact format.\nDo not improvise a second registry in Markdown, terminal state or an unreviewed JSON shape.\nKeep stable Fleet-wide or domain guidance in the owning Mate's private context\nthrough `$agentos-memory`; it is fallible context and never a shared\ncoordination, charter or approval authority. Keep the Second-Mate charter in\nthe released `agents.metadata.charter` shape, and use Inbox for exact Captain\ndecisions. Do not copy memory into another home or inherited Pi configuration.\nLearnings remain domain-local unless promoted through a reviewed shared\nAgentOS or project instruction change.\n\n## Provision and hand off\n\n1. Create exactly one `second_mate` identity as a direct child of First Mate with the released `agentos.provision_agent` Function.\n   Pass handle, role `second_mate`, harness `pi`, useful provisioning status text, display name and an object at `metadata.charter` with non-empty `summary` and `scope` strings.\n   The Function returns the existing UUID on an exact retry, rejects a conflicting handle and leaves new identities in `provisioning` state.\n2. Keep Second Mate on Pi with its own persistent home and PostgreSQL login.\n   Give it a dedicated Pod, ServiceAccount, home PVC and pod-local Herdr server.\n3. Through the selected database platform's approved role-management path, create one login without `SUPERUSER`, `CREATEDB`, `CREATEROLE`, `BYPASSRLS` or inherited owner authority.\n   Bind it with `agentos.register_agent_principal`; never embed its password in Fleet rows or the database URL.\n4. Load `$agentos-runtime`. From the active First Mate role resource directory,\n   create a reviewed per-Agent overlay over\n   `..\u002Fsecondmate\u002Fkubernetes\u002Fdomain` under\n   `$HOME\u002F.local\u002Fstate\u002Fagentos\u002Fworkloads\u002F\u003Chandle>\u002F`. Select one Kubernetes-safe\n   domain namespace and patch the Namespace name, Fleet label, returned owner\n   Agent UUID, Second-Mate RoleBinding subject namespace, workload identity,\n   immutable AgentOS image digest, password-free fully qualified PostgreSQL\n   URL, Secret name, labels, Herdr session and storage. The released domain\n   composition supplies restricted Pod Security labels, ingress-only\n   isolation, bounded quota, the Second-Mate workload Role and the core\n   First-Mate supervisor Role. Never add an egress-deny policy.\n   If a persistent-Mate model or thinking level was selected, follow\n   `$agentos-harnesses` and patch its `AGENTOS_MODEL` and `AGENTOS_THINKING`\n   values onto the `prepare-home` init container before rendering or applying\n   the workload. Do not add an omitted axis or a shared release default.\n   The runtime workflow must begin one SQL `provision` operation from the\n   reviewed render digest before apply and advance that same operation through\n   apply, workload and harness evidence.\n5. Render and inspect the complete overlay, then apply its reviewed Namespace\n   resource first. Verify its concrete Fleet and owner-Agent labels, restricted\n   Pod Security profile and absence of an egress policy. Create or select one\n   approved Secret in that namespace with a `pgpass` key for the login. Every\n   Secret in this namespace is domain-visible because the Second Mate can mount\n   it through a child workload; never place Fleet-root credentials there. Do\n   not print the value or invent a second secret format.\n6. Use the runtime skill's native server-side dry-run,\n   `kubectl diff` and synchronous `kubectl apply` sequence. Stop on an existing\n   resource with conflicting identity rather than adopting it by name. The\n   overlay creates no database role, Secret or public endpoint. It must retain\n   the base's projected ServiceAccount identity and exactly the reviewed domain\n   Roles, RoleBindings, ResourceQuota and ingress NetworkPolicy. Verify the\n   Second Mate can create and operate Crewmate workloads only in this namespace,\n   cannot read or create Secrets or mutate namespace controls, and cannot read,\n   exec or create anything in a sibling domain. Verify First Mate can inspect,\n   attach, stop, manage domain credentials and repair controls. Later Crewmate\n   overlays contain no RBAC; they consume the installed domain Role.\n7. Attach to the Second Mate Pod and load `$agentos-auth` for Pi's browser login.\n   Login happens in the persistent Pi home; never copy First Mate's or the local bootstrap agent's token directory.\n8. Verify the PostgreSQL session resolves the expected Agent identity, parent and charter through the password-free URL and persisted mode-`0600` pgpass file.\n   Verify the PVC is Bound, exactly one named Herdr Agent is Ready, the selected\n   model can answer a harmless request, and Pi's live model and thinking level\n   match every explicitly selected axis. A matching `settings.json` alone is\n   not runtime evidence. Verify that a Pod replacement restores the same PVC,\n   native Pi session and effective selected profile.\n9. In one short database transaction, record the verified Kubernetes and Herdr locators, set useful status text and change lifecycle state from `provisioning` to `active`.\n   On partial failure, preserve the row and runtime evidence in `provisioning` state for reconciliation; do not create a replacement identity or destructively roll back the PVC.\n   Complete the same runtime operation only after this transaction commits. On\n   an ambiguous boundary, mark it `recovery_required`, inspect native truth and\n   repair forward. A changed desired render uses atomic supersession, not an\n   unlinked new operation.\n10. Move accepted in-scope Tasks with\n    `agentos.handoff_task_assignment`. Preserve the stable Task, Assignment\n    history, dependencies, complete destination brief and concrete dispatch\n    profile; do not clone backlog rows or rewrite the previous Agent. Active\n    work requires an explicit handoff report. An exact retry returns the same\n    replacement; invalid hierarchy or destination fails closed.\n11. Deliver one concise Inbox handoff naming the chartered outcome or queue.\n12. Confirm the Second Mate reconciles only its own work and then establishes its own supervision wait.\n\nFirst Mate supervises the Second Mate as one direct report.\nThe Second Mate supervises its Crewmates; First Mate does not reconstruct the descendant subtree during routine operation.\n\n## Maintain the domain topology\n\nTreat Second-Mate topology as a reviewed operating decision, not a scheduler.\nReview it after durable changes in assignment load, backlog, routing ambiguity,\nhandoff frequency, cross-domain escalation, dependency coupling, failures,\ncapacity, cost, idle duration or delivery health. OpenTelemetry is diagnostic\nevidence only; at least one observed PostgreSQL, Kubernetes or Herdr signal is\nrequired. Never store prompts, messages, model reasoning or task content in a\ntopology plan.\n\nKeep domains broad and permeable:\n\n- `expand`, `modify` or `shrink` changes one existing charter without moving work automatically;\n- `split` narrows one existing charter and provisions exactly one new broad domain;\n- `merge` names one of two existing domains as survivor and retires the other only after every active Assignment and child Agent has been handed off;\n- `retire` removes one empty domain only after the same safety checks.\n\nEvery proposal must retain non-exclusive project access, common-ancestor\ncross-domain routing, forbidden lateral delivery and forbidden automatic\nscheduling. A project, repository, temporary load spike or current team shape\nis not by itself a durable domain. Prefer one compatible charter over parallel\nspecialists, shared queues or overlapping ownership that would become a silo.\n\nFor each change:\n\n1. Read the current direct Second-Mate identities, exact\n   `agents.metadata.charter` values, active Assignments and child Agents. Record\n   only bounded reason and signal classes in the proposal.\n2. Build one closed v1 proposal with an expiry of at most 30 days and compile it\n   through the released Effect API `compileSecondMateTopologyPlan`. Do not hand\n   craft the digest or add fields. If the active release has no Effect caller\n   boundary for this API, stop instead of bypassing it with ad hoc JSON.\n3. Create the typed Inbox decision with\n   `agentos.hold_second_mate_topology_decision` on an accepted managed Task.\n   Present the action, exact before\u002Fafter charters, runtime consequence,\n   evidence classes and expected cost to the Captain.\n4. Record the Captain's exact approval or rejection with\n   `agentos.resolve_second_mate_topology_decision`. Approval alone does not\n   mutate identity, charter or runtime state.\n5. On approval, call `agentos.apply_second_mate_topology_decision`. It rejects\n   expired plans, stale charters, the wrong First Mate, unsafe retirement and\n   conflicting retries. An exact retry returns the immutable prior result.\n6. Read `agentos.second_mate_topology_transitions` for the durable applied\n   result. Reconcile any resulting provisioning or teardown with the existing\n   runtime-operation journal and this Skill's provision, handoff and retire\n   workflows. Never infer Kubernetes success from the SQL transition.\n\nChanging a charter never grants new external API authority, database authority\nor Kubernetes RBAC. Apply those through their owning authorization workflows\nafter separate review. First Mate remains responsible for revisiting domain\nboundaries as reality changes; Second Mates remain responsible for flexible\nCrewmate delegation inside their current broad domain.\n\n## Route work\n\n1. Resolve the project and request first, then compare the nature of the work with active charters.\n2. Route to one clear match.\n   If charters overlap or no charter fits, keep routing authority with First Mate and resolve the ambiguity before dispatch.\n3. Create or associate the durable Task and first Assignment through the atomic\n   acceptance path in `$agentos-delegation` before sending the request. Never\n   accept work with separate Task and Assignment inserts.\n4. Use Inbox for the chartered request and upward answer.\n   Do not rely on terminal injection as the handoff record.\n5. Let the Second Mate own its internal Crewmate lifecycle and report only decisions, blockers, material phase changes, completion and failure upward.\n\n## Recover\n\n1. Load `$agentos-supervision` and reconcile the Second Mate's database identity, current Assignment, pod, PVC, Herdr locator and native Pi session.\n2. Treat an idle live session as healthy.\n3. If the runtime is missing, reuse the same Agent identity, home and native session through the released recovery primitive.\n4. Never create a replacement Second-Mate row merely because its pod or terminal disappeared.\n5. Do not sweep or mutate the Second Mate's descendant runtimes from First Mate unless the Second Mate cannot recover and the Captain authorizes intervention.\n\n## Retire\n\nRetirement is explicit, never an idle timeout.\n\n1. Stop new routing to the charter.\n2. Complete or reassign every active Task Assignment.\n3. Require the Second Mate to hand off every active child Agent and durable decision thread.\n4. Preserve delivered artifacts, reports, Inbox history and charter history.\n5. Call `agentos.retire_agent` only after the database accepts that no active Assignments or children remain.\n6. Begin one `teardown` runtime operation bound to the retired Agent, exact\n   namespace\u002Fworkload and desired render digest. Declare the recorded PVC with\n   explicit `retain` or separately approved `discard` disposition; the SQL\n   boundary rejects active work or an omitted PVC decision.\n7. Remove the StatefulSet, Service and ServiceAccount without deleting retained\n   PVCs. Keep the domain Namespace and its controls while any retained PVC or\n   recoverable state remains.\n   Record `applied` after the exact resources are absent and complete the\n   operation only after the retained-resource disposition is verified.\n8. Delete retained PVCs and then the Namespace only after separate explicit\n   Captain approval for that destructive discard. Namespace deletion is never\n   routine cleanup because it deletes namespaced PVC objects regardless of the\n   StatefulSet retention policy.\n9. Never use a forced runtime or Namespace deletion to bypass database\n   retirement guards.\n",{"name":5,"description":7},"main","a30d855b06853c98477c6121238e4202e3b0b26a","packages\u002Fagentos\u002Fresources\u002Froles\u002Ffirstmate\u002Fskills\u002Fagentos-secondmates",0,"https:\u002F\u002Fgithub.com\u002Fakua-dev\u002Fagentos","https:\u002F\u002Fagentos.akua.dev","https:\u002F\u002Fgithub.com\u002Fakua-dev","https:\u002F\u002Fakua.dev","The product factory for Agentic organizations. On infrastructure you own. Production safe.","2026-11-09 00:04:56",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add akua-dev\u002Fagentos --skill agentos-secondmates",{"tool":40,"command":41},"bunx","bunx skills add akua-dev\u002Fagentos --skill agentos-secondmates",{"tool":43,"command":44},"pnpm","pnpm dlx skills add akua-dev\u002Fagentos --skill agentos-secondmates","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fakua-dev\u002Fagentos\u002Fblob\u002Fmain\u002Fpackages\u002Fagentos\u002Fresources\u002Froles\u002Ffirstmate\u002Fskills\u002Fagentos-secondmates\u002FSKILL.md",true,[48],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"agents\u002Fopenai.yaml","REFERENCE","参考文档",213,"https:\u002F\u002Fgithub.com\u002Fakua-dev\u002Fagentos\u002Fblob\u002Fmain\u002Fpackages\u002Fagentos\u002Fresources\u002Froles\u002Ffirstmate\u002Fskills\u002Fagentos-secondmates\u002Fagents\u002Fopenai.yaml",[55,62,69,76,83,90],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M793C3FRBZDFZK0XB78SFEJN","example-replacement","Reconcile the example replacement AgentOS distribution.","https:\u002F\u002Fgithub.com\u002Fakua-dev\u002Fagentos\u002Fblob\u002Fmain\u002Fpackages\u002Fagentos\u002Ftests\u002Ffixtures\u002Freplacement-package\u002Fskills\u002Fexample-replacement\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M793C1KCJE8E61R5PR5RWR6G","example-additive","Inspect the example additive AgentOS behavior.","https:\u002F\u002Fgithub.com\u002Fakua-dev\u002Fagentos\u002Fblob\u002Fmain\u002Fpackages\u002Fagentos\u002Ftests\u002Ffixtures\u002Fadditive-package\u002Fskills\u002Fexample-additive\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M793BW3E0NPHQKV45PRTTMKN","agentos-upgrade","Upgrade one persistent AgentOS Mate or, from First Mate with exact Captain authority, every active persistent Mate in one Fleet to an exact published stable release, including its run-once released database migrations. Use for stable First- or Second-Mate updates, resumed post-replacement verification, and authorized rollback boundaries. Do not use for dogfood, Crewmates, provisioning, retired Mates, services, or another Fleet.","https:\u002F\u002Fgithub.com\u002Fakua-dev\u002Fagentos\u002Fblob\u002Fmain\u002Fpackages\u002Fagentos\u002Fskills\u002Fagentos-upgrade\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M793BPJ6SKYM1NWACHYG0TRM","agentos-supervision","Reconcile and supervise an AgentOS Mate's direct reports across PostgreSQL, Kubernetes, Herdr, PVCs, and Git. Use at every First- or Second-Mate session start, after restart or compaction, while delegated work is active, when Inbox or runtime state changes, and for blocked, stale, stuck, failed, interrupted, or recovering agents.","https:\u002F\u002Fgithub.com\u002Fakua-dev\u002Fagentos\u002Fblob\u002Fmain\u002Fpackages\u002Fagentos\u002Fskills\u002Fagentos-supervision\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M793BGQANFJYYX8NBHCRKPKM","agentos-secrets","Safely create, retry, rotate, take over, roll back, project, and revoke AgentOS-managed Kubernetes Secrets without retaining or printing credential bytes. Use whenever an AgentOS workflow moves credential files into Kubernetes, changes an existing managed Secret, verifies a projected credential, encounters conflicting Secret ownership or legacy annotations, or retires a Kubernetes-delivered credential.","https:\u002F\u002Fgithub.com\u002Fakua-dev\u002Fagentos\u002Fblob\u002Fmain\u002Fpackages\u002Fagentos\u002Fskills\u002Fagentos-secrets\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M793BCNKCQAKK00BK32651HC","agentos-runtime","Inspect, create, and operate AgentOS runtime pods, Kustomize overlays, Herdr sessions, Mise toolchains, agent worktrees, terminals, PVCs, Kubernetes health, attach paths and runtime recovery. Use for normal First- or Second-Mate Kubernetes operations, child-Agent workload creation, tool resolution, stuck-agent debugging, remote terminal access, pod or session recovery, and readiness diagnosis.","https:\u002F\u002Fgithub.com\u002Fakua-dev\u002Fagentos\u002Fblob\u002Fmain\u002Fpackages\u002Fagentos\u002Fskills\u002Fagentos-runtime\u002FSKILL.md",[],[]]