bc-session-close
Executes a rigorous 9-step session closure sequence, including summary generation and state preservation.
Install
mkdir -p .claude/skills/bc-session-close && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11373" && unzip -o skill.zip -d .claude/skills/bc-session-close && rm skill.zipInstalls to .claude/skills/bc-session-close
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use on procedure terminal step, explicit customer close, session end, or pending-state submit-now branch. Runs the 9-step close sequence — summary, save state, per-item observation review, drafter handoff for ready research-notes, contributions double-filtered, direct typed submission, defensive dossier check, next-time framing, cleanup, goodbye. Auto-spawns bc-path-drafter and bc-process-drafter sub-agents for ready research-notes.Key capabilities
- →Summarize progress
- →Save session state
- →Review observations
- →Submit contributions
How it works
It executes a 9-step sequence to review observations, save state, and submit contributions via a secure wire utility.
Inputs & outputs
When to use bc-session-close
- →Concluding a work session
- →Archiving research progress
- →Automating end-of-task cleanup
About this skill
Be Civic — Session Close
Two invocations:
- Full close — procedure terminal step, explicit customer close, session timeout. Runs the 9 steps below in order.
- Resume-submit — invoked from the
PENDING_STATEsurface at session open (preamble §4.3). Skip steps 1–2 and 7–9; jump to per-item review (step 3), drafter handoff (step 4), and submission (step 6). Used when the customer chose "handle now" on a deferred item from a prior session — the items live in${SUBSTRATE_STATE}/sessions/<session_id>/pending-submissions.jsonl(a prior session's local-buffer fallback).
The customer-facing language for the observation buffer is list or notes, never "buffer."
Wire basics (read once)
All submissions are direct typed POSTs through the bundled wire.py over bash — not WebFetch, which is GET-only and cannot carry a request body (so it cannot do a single write). wire.py is the documented "provide a utility script" write path; it sends the request to the REST surface at ${BASE}/api, handles auth internally, and retries once on a transient network failure. The per-item user review below IS the gate — it is harness behaviour, not an API call. Once the user approves an item, exactly one POST leaves the machine.
$BC_ROOT below is the resolved install root the preamble emits as the BC_ROOT: session fact at session start (harness §3) — use that value, never a bare ${SUBSTRATE_ROOT}/${CLAUDE_PLUGIN_ROOT} literal in a bash command.
- Auth — handled inside
wire.py.wire.pyreadsBECIVIC_HARNESS_KEYfrom${SUBSTRATE_STATE}/.envitself and sendsAuthorization: Bearer <harness_key>; you never touch the key here and it is never echoed or logged. If the session is in anonymous-read mode (no key — user declined verification), no submissions are possible:wire.pywould post anonymously and the worker 401s. So do not call it — tell the customer plainly that their notes can't be sent without verification, offer to verify (hand back to onboarding) or to hold the notes locally (step 6 fallback). - submission_id. Generate client-side before each POST:
python3 "$BC_ROOT/scripts/gen_submission_id.py" <issue|validation|feedback|rating>→ prints<iss|val|fbk|rat>_<uuidv7>. One id per submission; the worker echoes it back. - submitting_harness = the
SUBMITTING_HARNESSvalue the preamble surfaces (formbe-civic/<version>; also persisted at${SUBSTRATE_STATE}/version.json). Use it verbatim — never hardcode a version, it tracks the plugin manifest. submitting_model = the model running this session with optional effort suffix (e.g.claude-opus-4-7/xhigh), per the preamble's model context. - NEVER send worker-set fields. The worker stamps and rejects-if-present:
user_id,accepted_at,cohort_anchor,regex_passes,ner_status,cancel_token. Build envelopes from submitter fields only. - Accept response.
wire.pyprintshttp_status:,result: ok|error, thedata:object (when present), and the fullbody:, and exits 0 on a 2xx. The accept body is202 { "status": 202, "data": { "submission_id", "accepted_at", "cancel_token"[, "cohort_anchor"] } }. Persistcancel_token(and thesubmission_id+ type) — it is the only handle for the 48-hour cancellation window and cannot be reissued if lost. Branch on thehttp_status:line first; a non-202 (result: error) with{ "error": "<category>", ... }in the body means the item did not land (handle per step 6). - Cancellation (48h). A
DELETE(also viawire.py):python3 "$BC_ROOT/scripts/wire.py" DELETE /api/submissions/<type>/<submission_id> --cancel-token <token>(the Bearer is read from.envinside the script;--cancel-tokensets theX-Cancel-Tokenheader), where<type>∈issue|validation|feedback|rating. Surface the cancel handle to the customer at goodbye (step 7).
The 9 steps
1. Summarise progress
One short paragraph in plain English. What you covered today, what's done, what's still open. Tone is warm and concrete, not a status report. Skip on resume-submit.
2. Save state
Update each procedure walked this session: write its visible progress at ${SUBSTRATE_DATA}/<procedure-slug>/procedure_progress.md (last step reached, what's pending, anything the user said worth holding) and refresh that procedure's entry status / updated_at in ${SUBSTRATE_STATE}/procedures.json. Skip on resume-submit.
3. Per-item observation review (consume the buffer)
Read this session's observation list at ${SUBSTRATE_STATE}/sessions/<session_id>/observations-buffer.jsonl (on resume-submit, read pending-submissions.jsonl instead). One JSON object per line, each a V2 submission shape per step 6 (Issue v5 / Validation v5 / Feedback v1 / Rating v4), written by bc-path-traversal and bc-discovery as observations accumulated this session. Inline-commit Validations on path sources (target_type: path_source) were already POSTed at traversal time and are not in this buffer — do not re-submit them.
For each item:
- Show it in plain English (rendered from the JSON, not the JSON itself).
- AskUserQuestion: approve / edit / discard. (Two options + free-text fallback keeps the gate MECE.)
- On edit: ask what to change, rewrite, re-run
scripts/scrub-layer1.pyagainst the rewritten version before it is eligible to send. - On discard: drop the line; do not re-surface.
Apply the CC BY 4.0 grant reminder once at the top of this step, not per item: "Anything you approve is shared anonymously under CC BY 4.0. You can cancel anything within 48 hours of submission — I'll give you the cancel codes after we send."
Approved items carry forward to step 6 for submission. The buffer file itself is deleted in step 8, only after every item is submitted, discarded, or written into pending-submissions.jsonl.
4. Drafter handoff (the new core of close)
Scan ${SUBSTRATE_DATA}/<procedure-slug>/memory/research-notes-*.md (the preamble surfaced these as PENDING_STATE: ready_to_draft) for files with frontmatter status: ready_to_draft. For each:
- Surface to customer: "I have research-notes from [N] session(s) about [target]. Submit now, keep researching, or discard?"
- Submit now: spawn the relevant drafter via the Agent tool. Dispatch in parallel when multiple distinct entities are ready; collect results and surface them to the user one at a time for review.
bc-process-drafterfor process-shaped notes (model: opusfor a new-Process proposal — judgment-heavy;model: sonnetonly for a trivial amendment to an existing Process). If the drafter's Step 0 finds the notes are path-shaped, it hands off tobc-path-drafteritself.bc-path-drafterfor path-shaped notes (model: sonnetusually;model: opusfor cross-region / cross-commune scope judgment).- Pass the research-notes path and the customer's profile snapshot.
- The drafter returns a structured payload:
{ proposed_process_id | target_process_id (or path equivalent), label, canonical_markdown | body_diff, rationale, evidence, provenance: { research_notes_scrubbed } }. It also returns the Issue submission envelope it built (it does NOT submit — close owns the wire call):- New Process proposal →
target_type: knowledge_graph,label: gap,evidence.proposed_process_id: <kebab-slug>. - Amend an existing Process →
target_type: process,label: missing | bug | divergence,target_id: <process_id>. - Wholly-new Path →
target_type: path,label: missing. - New / commune-specific Path source →
target_type: path_source,label: missing | divergence,target_id: <path_id>:<source_id>.
- New Process proposal →
- Present the payload + research-notes to the customer for review.
- On approve: submit the Issue envelope per step 6 (single direct POST to
/api/issues). On a202, rewrite the notes frontmatter tostatus: draftedand clear the matchingdiscovery:*entry fromprofile.json.active_procedures. - On keep-researching: leave status
ready_to_draft; the next session's pending-state scan picks it up. - On discard: rewrite frontmatter
status: discarded.
5. Surface §8 Requests-for-contributions — filtered
For every procedure Process walked this session, read its body's [Requests for contributions] section (if present). Apply two filters before surfacing — never dump the full list on the customer:
- Relevance filter. Only surface items the customer's session actually touched. If the Process has 5 contribution requests but this customer's path only exercised 2 sub-scenarios, surface only those 2.
- Genuine-access filter. Only surface items the customer is actually positioned to help with. A request for "first-hand commune-staff judgment from Schaerbeek" is for a Schaerbeek customer, not a Ghent customer. A request about a sub-category the customer didn't qualify under is not for them.
Present the survivors (typically 0–2 items) as: "Things you've seen firsthand that would help others." Frame as contribution, not extraction. If zero survive, skip the section entirely — don't manufacture asks.
For each item the customer commits to, map to the right submission shape (concern/amendment-shaped items are all submitted as Issues, per the routing table below):
- "I saw an extra step / a missing doc on this Process" → Issue,
target_type: process,label: missing(orbugfor an incorrect step). - "A citation / source link is dead" → Issue,
target_type: process | path | path_source,label: rotted. - "It differed at my commune" → Issue,
target_type: process | path_source,label: divergence, withevidence.scope+evidence.specifier(NIS5). - "This whole sub-procedure is missing from Be Civic" → route into
bc-discoveryfor next session (becomes research-notes, then a drafter handoff at a future close), not a bare Issue now.
6. Submission — single direct typed POST, with local-buffer fallback
Submit each approved item — obs
Content truncated.
When not to use it
- →Without verification of harness key
Prerequisites
Limitations
- →Cannot submit without verification
- →Requires harness key for API access
How it compares
It formalizes session closure by ensuring all work is reviewed, cleaned, and submitted through a secure, authenticated channel.
Compared to similar skills
bc-session-close side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| bc-session-close (this skill) | 0 | 2mo | Review | Advanced |
| trello | 41 | 2mo | Review | Beginner |
| executing-plans | 6 | 3mo | No flags | Intermediate |
| github-project-management | 4 | 6mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
trello
openclaw
Manage Trello boards, lists, and cards via the Trello REST API.
executing-plans
obra
Use when you have a written implementation plan to execute in a separate session with review checkpoints
github-project-management
ruvnet
Comprehensive GitHub project management with swarm-coordinated issue tracking, project board automation, and sprint planning
project-clickup
incidentfox
ClickUp project management integration for incident tracking and task management
coo-advisor
alirezarezvani
Operations leadership for scaling companies. Process design, OKR execution, operational cadence, and scaling playbooks. Use when designing operations, setting up OKRs, building processes, scaling teams, analyzing bottlenecks, planning operational cadence, or when user mentions COO, operations, process improvement, OKRs, scaling, operational efficiency, or execution.
tlc-spec-driven
tech-leads-club
Project and feature planning with 4 phases - Specify, Design, Tasks, Implement+Validate. Creates atomic tasks with verification criteria and maintains persistent memory across sessions. Stack-agnostic. Use when: (1) Starting new projects (initialize vision, goals, roadmap), (2) Working with existing codebases (map stack, architecture, conventions), (3) Planning features (requirements, design, task breakdown), (4) Implementing with verification, (5) Tracking decisions/blockers across sessions, (6) Pausing/resuming work. Triggers on "initialize project", "map codebase", "specify feature", "design", "tasks", "implement", "pause work", "resume work".