agent-lifecycle
Skill2 starsChanged 47 days agoMITView on GitHub
Add live child-agent visibility to something you are building — an orchestrator, CLI, desktop app or web UI: one event schema over several child runtimes, plus recovery of events missed across a disconnect or restart. Symptoms: show what my subagents are doing, stream agent status into the UI, normalise different child runtimes behind one interface, my agent events stop after a reconnect. This builds the feature; it is not a dispatch or routing policy.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- vijilAI/vijiltheir own version, first seen Oct 28, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- vijilAI/vijil★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository39 other files it gives its agents.
- analyse-ticketSkill
- blast-areaSkill
- blocksSkill
- codex-review-loopSkill
- coding-teacherSkill
- decision-journalSkill
- delphi-groundSkill
- delphi-imagineSkill
- derive-codebase-contextSkill
- describe-changesSkill
- github-webhooksSkill
- handoff-promptSkill
- implement-ticketSkill
- investigate-codebaseSkill
- isolated-change-validationSkill
- land-complex-changeSkill
- layer-repository-docsSkill
- mine-session-transcriptsSkill
- model-routingSkill
- new-ux-discoverySkill
- onboard-projectSkill
- preregistered-model-studySkill
- promote-releaseSkill
- publish-agent-skillSkill
- publish-to-linearSkill
- release-ledgerSkill
- release-notesSkill
- report-progressSkill
- request-answersSkill
- request-blocks-reviewSkill
- resolve-problem-reportSkill
- resume-after-limitSkill
- rotate-shared-secretSkill
- secure-credential-setupSkill
- track-in-linearSkill
- update-agent-skillsSkill
- visualise-blast-areaSkill
- work-in-external-repoSkill
- workspace-governanceSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Use the v0.2.0 lifecycle contract to make delegated agents visibly and honestly observable.
- Distinctive: line 30
Don't use for task planning, Kanban/todo synchronization, or a one-time post-run summary.
- Distinctive: line 48
Use exactly these states:
- Very specific: line 60
Every schema-v1 event includes schemaVersion: 1, eventId, source, sourceEpoch, childId, lineage, kind, and RFC3339 UTC observedAt.
- Very specific: line 79
Publish activity and heartbeats separately: Put current-work text in an activity event and liveness evidence in heartbeat.
- Very specific: line 84
Use stale before lost: After the configured freshness deadline, mark a non-terminal child stale and request reconciliation.
- Distinctive: line 95
Handle omission only with proof and grace: Do not conclude anything from an incomplete snapshot omitting a child.
- Very specific: line 149
If no lifecycle evidence source exists, create no child rows and state exactly: Background work visibility unavailable.
- Very specific: line 190
Stop heartbeats beyond the deadline.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Lifecycle Visibility
Use the v0.2.0 lifecycle contract to make delegated agents visibly and honestly observable. The package implements schema-v1 validation, projection, JSONL fallback safety, and a Hermes reconciliation adapter foundation. It does not ship Hermes Desktop core integration, a task board, or native adoption of an arbitrary foreign process.
When to Use
- Adding live child-agent visibility to an orchestrator, desktop application, CLI, or web UI.
- Normalizing multiple child runtimes behind one lifecycle interface.
- Repairing missed events after reconnect, silence, or a host restart.
- Supporting a runtime that can emit JSON Lines but cannot provide callbacks.
- Integrating Hermes delegation observations through a host-owned adapter.
Don't use for task planning, Kanban/todo synchronization, or a one-time post-run summary. Those concerns must not substitute for lifecycle telemetry.
Prerequisites
- Allocate a stable
childIdfor the child lifetime, a stablesource, and a newsourceEpochwhenever a producer restarts its sequence space. - Generate unique
eventIdvalues. Supply a non-negative per-childsequenceonly when the source can guarantee it within(source, sourceEpoch, childId). - Define lineage:
rootChildId, attempt number, and whether the child is externally adopted. Preserve unknown capabilities rather than inferring them. - Choose one lifecycle owner and one authoritative snapshot source.
- Load the adapter contract before writing a runtime adapter. For routed children, also read the model-routing relationship note.
Lifecycle Model
Use exactly these states:
created -> starting -> running <-> waiting -> completed | failed | cancelled | lostThe actual legal edges are created -> starting|cancelled|failed|lost,
starting -> running|waiting|cancelled|failed|lost, and from running or
waiting to their documented successors. completed, failed, cancelled,
and lost are terminal and immutable. activity and heartbeat refresh
information only; they never transition state.
Every schema-v1 event includes schemaVersion: 1, eventId, source,
sourceEpoch, childId, lineage, kind, and RFC3339 UTC observedAt.
Capabilities are explicit known | unknown values for history, heartbeat,
snapshot, cancel, and terminal cause. Set external: true and adoptedAt for
adoption; do not claim pre-adoption history or control authority.
Procedure
- Normalize schema-v1 events. Require canonical identity, lineage, kind,
timestamp, and state rules before projection. Redact secrets in
details. Complete when: invalid kinds/states/timestamps are rejected and omitted capabilities becomeunknownrather than optimistic defaults. - Project ordered observations. Deduplicate sequenced events by
(source, sourceEpoch, childId, sequence)and non-sequenced events only by exacteventIdcontent. Treat forward sequence gaps as provisional and old sequence values as out of order. Complete when: replay gives the same projection as live delivery while conflicts remain diagnosable. - Publish activity and heartbeats separately. Put current-work text in an
activityevent and liveness evidence inheartbeat; neither may invent a transition. Complete when: quiet but alive work remains distinguishable from a stopped child. - Use stale before lost. After the configured freshness deadline, mark a
non-terminal child stale and request reconciliation. Mark it
lostonly if that corresponding reconciliation fails; terminal loss happens once. Complete when: one missed heartbeat never directly produceslost. - Reconcile authoritative complete snapshots. Require
complete: true,sourceEpoch,snapshotId, coverage, and observed time. Correct only a non-terminal projection and retain anauthoritative_snapshotaudit entry; never revive a terminal record. Complete when: reconnect convergence is visible and each correction is inspectable. - Handle omission only with proof and grace. Do not conclude anything from an incomplete snapshot omitting a child. If an adapter can establish complete coverage, count consecutive complete misses and surface stale/unknown only after a documented grace threshold. Complete when: an intermittent or partial snapshot cannot silently complete or lose work.
- Use JSONL as a bounded fallback. Emit one complete UTF-8 event per line; parse incrementally, retain valid surrounding records, and bound/redact malformed diagnostics. Journal appends use a cooperative atomic lock directory so concurrent calls and cooperating Node processes serialize; lock acquisition times out behind live owners and only reclaims old locks whose recorded PID is demonstrably dead. Programs that ignore the protocol remain unsupported. Complete when: malformed, oversized, and truncated lines do not mutate projection incorrectly.
- Integrate Hermes honestly. Map documented Hermes delegation events and status snapshots through the adapter foundation. Request status at session open, reconnect, and a bounded periodic interval; coalesce overlapping fetches. Complete when: the host consumes its inputs/intents, applies complete-snapshot omission grace, and does not claim Hermes Desktop core UI integration is shipped.
- Render lifecycle truth, not proxy work state. Drive visible state from the normalized projection; tasks and percent complete are auxiliary only. Complete when: removing all task-board data leaves lifecycle status correct.
Usage Examples
End-user status request
Show the current child lifecycle status. For every child include child ID,
literal state (running, waiting, completed, failed, cancelled, or lost), current
activity or tool, freshness, and transcript/result reference where safe.
Reconcile stale children before drawing a terminal conclusion.Host integration request
Integrate agent-lifecycle into this orchestrator. Normalize child events, keep
activity separate from heartbeat, reconcile complete snapshots after reconnect,
and preserve immutable terminal states. Prefer native child UI.Display fallback when native UI is unavailable
Render one active aggregate todo labelled display-only and one DISPLAY ONLY row
per child with ID, state, activity/tool, and freshness. Treat those rows as a
projection only; edits must not change lifecycle state.If no lifecycle evidence source exists, create no child rows and state exactly:
Background work visibility unavailable; state unknown.
Quick Reference
- Event identity:
eventId, or(source, sourceEpoch, childId, sequence). - Lineage: root/attempt/parent and adoption truth, not inferred ancestry.
- Activity: material current-work information; heartbeat: liveness only.
- Complete snapshot: authority to correct present non-terminal records.
- Audit: record every authoritative correction.
- Stale then lost: deadline first, failed reconciliation second.
- JSONL: bounded transport fallback with cooperative cross-process journal locking.
- Hermes: adapter foundation only; session-open/reconnect/periodic snapshots.
Pitfalls
- Todo/Kanban substitution: task metadata can be missing or manually edited; it is never lifecycle authority.
- Epoch blindness: a producer restart can reuse a sequence number; scope
sequence identity by
sourceEpoch. - Snapshot overclaim: incomplete coverage cannot establish absence.
- Heartbeat as progress: liveness does not prove useful work or success.
- Terminal revival: late event delivery and snapshots cannot rewrite a terminal outcome.
- JSONL mixed with logs: ordinary stdout logs make malformed diagnostics, not lifecycle events.
- External-adoption overclaim: PID presence does not provide history, intent, heartbeat, terminal cause, or cancellation authority.
Verification
For Hermes routing/new-session rollout, also run the repository's
docs/testing/hermes-new-session-matrix.md: Opus and GPT, explicit and implicit
model selection, with and without routing profiles, plus safe routing-profile
removal. A configured or explicit runtime model without a routing profile is
still UNPROFILED and must not authorize delegation silently.
- Apply a legal path through
created,starting,running,waiting, and a terminal state; verify invalid transitions are rejected. - Deliver exact duplicates, identity conflicts, an out-of-order sequence, and a forward gap; verify their distinct results.
- Stop heartbeats beyond the deadline; verify stale state appears before one
failed reconciliation transitions the child to
lost. - Reconcile a complete snapshot that changes a non-terminal state; verify the correction audit. Attempt to alter a terminal state; verify it is refused.
- Feed valid JSONL around malformed, oversized, and truncated data; verify valid events remain and diagnostics are bounded/redacted.
- For Hermes, verify snapshots run on session open, reconnect, and elapsed interval; verify incomplete omission does nothing and complete omission needs the configured grace count.
The integration is ready only when every result comes from lifecycle evidence, not optimistic UI defaults or task-board metadata.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

