context-end
Skill30 starsChanged 37 days agoMITView on GitHub
Close a workspace session by reviewing a proposed summary, recording approved outcomes, updating state and decisions, and checking repository safety. Use only when the user explicitly asks to end, close, or hand off the current session.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- starter/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- context-setupSkill
- context-startSkill
- context-updateSkill
- endSkill
- migrate-geminiSkill
- mine-gemini-workflowsSkill
- setupSkill
- startSkill
- updateSkill
- skill-creatorSkill
- contextos-workspaceSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 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.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
When the host executes commands inside Bash, replace the bash executable shown below with "$BASH" to reuse that shell.
- Very specific: line 17
Use the exact roots supplied by the host attachment: KernelRoot is the trusted Context OS product containing scripts/contextos.sh.
- Distinctive: line 26
Do not search upward or infer a root from cwd or the skill installation.
- Distinctive: line 39
Leave durable, reviewable state for the next session.
- Distinctive: line 66
Run exactly one matching form:
- Distinctive: line 81
After explicit approval of that exact diff, run:
- Very specific: line 115
Only an explicit choice may create a separate board promote proposal with a reviewed JSON payload and exact canonical target.
≈ “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
End a workspace session
Execution roots (required)
When the host executes commands inside Bash, replace the bash executable
shown below with "$BASH" to reuse that shell. This avoids selecting a different
Bash from PATH, such as the Windows WSL launcher inside a Git Bash session.
In a terminal outside Bash, select the installed Bash explicitly.
Use the exact roots supplied by the host attachment: KernelRoot is the trusted
Context OS product containing scripts/contextos.sh; ContextRoot owns tracked
identity and lifecycle state; and WorkingRoot is the ordinary application.
For an external attachment, require all three exact absolute paths and run:
bash <KernelRoot>/scripts/contextos.sh --context-root <ContextRoot> --working-root <WorkingRoot> <command>Do not search upward or infer a root from cwd or the skill installation. The
kernel must validate the ignored local binding before strict lifecycle work. A
missing, moved, stale, linked, nested, or mismatched binding stops the workflow;
use the explicit project rebind proposal after a legitimate move. ContextRoot
owns all lifecycle writes. WorkingRoot is read-only evidence. The colocated
bash scripts/contextos.sh <command> compatibility form remains valid.
Throughout this procedure, resolve routing, state, session, proposal, receipt,
and local-artifact paths beneath ContextRoot. In split mode, spell local paths
as absolute <ContextRoot>/... paths and invoke every lifecycle command through
the absolute KernelRoot wrapper with both exact role options. In colocated mode,
run the relative compatibility commands from the colocated root.
Leave durable, reviewable state for the next session.
Procedure
1. Draft before writing
Determine today's local date and time. Extract completed work, durable decisions and rationale, meaningful rejected alternatives, priority or thread changes, blockers, open work, and next actions. Present the draft and obtain confirmation before creating a proposal.
2. Build the deterministic proposal
Create a reviewed JSON payload under <ContextRoot>/.context-os/inputs/. Write each lifecycle fact as one self-contained sentence that names its subject; avoid label-prefixed fragments such as Atlas: ... and sentences that combine multiple facts. Keep a status and its qualifiers in the same sentence (for example, "Beacon's import review stopped after the draft, before approval."). This applies to handoff prose as well as the payload arrays. The payload contains:
what_happened: approved factual strings;decisions: durable objects containingdecision,rationale, and optionalrejected_alternatives;next_time: approved open-work strings; and- optional complete desired Markdown for
current_markdown,blockers_markdown, orweekly_priorities_markdown, only when that state materially changed.
For current_markdown, read the existing current-state file and preserve exactly
one **Last Updated:** line in the complete replacement. The kernel advances
its date; it rejects a missing or duplicate line instead of inventing one.
Run exactly one matching form:
split: bash <KernelRoot>/scripts/contextos.sh --context-root <ContextRoot> --working-root <WorkingRoot> propose end --input <ContextRoot>/.context-os/inputs/<payload.json>
colocated: bash scripts/contextos.sh propose end --input .context-os/inputs/<payload.json>The kernel owns session append behavior, decision rows, dates, exact paths, the
single Last Updated line, and same-day history. Present every returned diff
and its proposal digest. The digest binds the exact content but does not
authenticate a human approver; rely on the host permission boundary for
explicit confirmation.
3. Apply only the approved proposal
After explicit approval of that exact diff, run:
split: bash <KernelRoot>/scripts/contextos.sh --context-root <ContextRoot> --working-root <WorkingRoot> apply <ContextRoot>/<proposal> --confirm <digest> --runtime <active-runtime>
colocated: bash scripts/contextos.sh apply <proposal> --confirm <digest> --runtime <active-runtime>The kernel must refuse altered proposals, changed targets, path escapes, or a concurrent apply. Never bypass those checks or edit lifecycle state directly.
4. Check repository state
Inspect WorkingRoot Git history and status for application work: show recent commits that may overlap this run, uncommitted files, and the count of unpushed commits when an upstream exists. Inspect ContextRoot Git state separately for the lifecycle files just changed. Do not conflate either repository's history or status. Flag conflicts and wait for direction. Never commit, push, discard, or reconcile without explicit approval. Outside Git, skip the corresponding repository check.
5. Coordination board (when present)
In split mode, skip coordination-board operations explicitly because the CLI
rejects board commands for attachments; do not probe WorkingRoot for board
files. In colocated mode only, if <ContextRoot>/coordination/README.md exists,
offer—never auto-execute—to post a short board message for other runs
(bash scripts/contextos.sh board post ... from ContextRoot) and to release or
hand off any claims this run holds (board release, optionally with
--then-claim-*). Follow the ContextRoot board contract: no secrets or
sensitive personal data ever (git history keeps every message), durable facts
stay canonical elsewhere and are referenced with commit:path, and publishing
pushes to the ContextRoot remote, so it happens only with the user's approval at
the host permission boundary. If compaction surfaces a promotion candidate,
ask the user to classify it as a durable decision, a session handoff, or neither.
Only an explicit choice may create a separate board promote proposal with a
reviewed JSON payload and exact canonical target; the message's age, kind, or
wording never supplies approval. Present that proposal's full diff and use the
normal exact-digest apply path only after separate approval.
6. Confirm the handoff
Report the receipt path, what was logged, changed state files, and the top next action. Mention any conflict or repository work still awaiting a decision.
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.

