Session knowledge contribution to the shared brain
The /contribute command lets users explicitly trigger knowledge extraction and contribution at any point during a session. It summarizes what worked, what required manual intervention, and what domain-specific patterns emerged — then offers to submit these lessons to the shared brain.
This is the user-invocable entry point for brain contributions. While the standard workflow dispatches distiller automatically after noteworthy workflows (brain-sync Phase 3), /contribute gives users direct control: they can invoke it whenever they want to share what they've learned.
| User says | Detected intent |
|---|---|
/contribute | Direct skill invocation |
"contribute" / "contribute to brain" / "share what I learned" | Natural language trigger |
"submit lessons" / "share knowledge" / "add to brain" | Natural language trigger |
| / + intent to share |
"summarize lessons""what did we learn"| Natural language trigger |
/contribute purely to share knowledge from their experienceBrain mode must be "connected". If brain mode is "isolated" or unset:
AskUserQuestion: "Brain mode is currently disabled. Would you like to enable it to contribute knowledge?"BrainMode: "connected" in context.md, acquire brain repos (Phase 1 of skills/brain-sync/SKILL.md), then proceed./contribute requires brain mode and stop.Brain repos must be available. If .repos/brain/ or .repos/brain-seedbank/ are not cloned:
Workspace repo should be available (for storing the contribution artifact in the run directory). If not, /contribute still proceeds — the contribution goes to brain-seedbank regardless.
Push credentials for the user's fork of statsclaw/brain-seedbank must be verifiable. Leader checks during the flow and warns if push access cannot be confirmed.
| Parameter | Source | Default |
|---|---|---|
scope | User prompt or inferred | "session" — all runs in the current session |
run_id | User prompt (optional) | Latest completed run if not specified |
target_repo | User prompt or inferred from context | Current active repo from context.md |
Leader collects all available run artifacts for the specified scope:
Session scope (default): scan .repos/workspace/<repo-name>/runs/ for all runs from the current session. Collect from each run:
comprehension.md, spec.md, test-spec.md, sim-spec.mdimplementation.md, simulation.md, audit.mdlog-entry.md, docs.md, mailbox.mdreview.mdSingle run scope: collect artifacts from the specified <run_id> only.
If no artifacts are found (e.g., no runs have been executed yet), inform the user: "No workflow artifacts found to extract knowledge from. Run a workflow first, then use /contribute."
Generate a contribution-specific run directory:
CONTRIBUTE-<timestamp>.repos/workspace/<repo-name>/runs/CONTRIBUTE-<timestamp>/request.md with scope, source runs, and intentLeader dispatches the distiller agent with:
.repos/brain/index.md for duplicate checking.repos/brain/ for existing entry browsingbrain-contributions.md in the contribution run directoryDistiller follows its standard workflow (agents/distiller.md):
skills/privacy-scrub/SKILL.md)templates/brain-entry.mdbrain-contributions.mdLeader reads brain-contributions.md and presents the FULL content to the user via AskUserQuestion:
Here's a summary of what StatsClaw learned during this session:
---
[Full content of brain-contributions.md, showing each proposed entry with:
- What worked well
- What required manual intervention
- What domain-specific patterns emerged]
---
Would you like to contribute this to StatsClaw's shared brain?
Your contribution will be publicly visible on GitHub (statsclaw/brain-seedbank)
with your GitHub username as the contributor.
1. Yes — contribute all entries above
2. Yes, but let me pick which ones (partial)
3. No — skip this time
This consent step is MANDATORY and NEVER skipped. The user always sees exactly what would be shared.
Handle responses:
brain-contributions.md to remove declined entries, proceed to Step 5Leader dispatches shipper with a brain-upload-only task:
brain-contributions.md pathbrain-contributions.md and a minimal log to the workspace repoShipper follows its brain upload workflow (agents/shipper.md Step 7b):
statsclaw/brain-seedbank (if not already forked)contribute/<date>-<short-slug>index.md on the branchstatsclaw/brain-seedbankLeader reports to the user:
| Artifact | Location | Purpose |
|---|---|---|
request.md | Contribution run directory | Records contribution scope and intent |
brain-contributions.md | Contribution run directory | Proposed entries (from distiller) |
shipper.md | Contribution run directory | Brain-seedbank PR URL and status |
The /contribute command uses a simplified state flow (no full pipeline):
BRAIN_CHECK → ARTIFACTS_GATHERED → DISTILLER_DISPATCHED → USER_CONSENT → UPLOAD → DONE
| State | Meaning |
|---|---|
BRAIN_CHECK | Verifying brain mode and repo availability |
ARTIFACTS_GATHERED | Collected run artifacts for extraction |
DISTILLER_DISPATCHED | Distiller is extracting knowledge |
USER_CONSENT | Waiting for user to approve/decline |
UPLOAD | Shipper is creating brain-seedbank PR |
DONE | Contribution complete (or declined) |
| Aspect | Standard (brain-sync Phase 3-5) | /contribute |
|---|---|---|
| Trigger | Automatic after noteworthy workflows | User-invoked at any time |
| Scope | Single run | Session-wide or single run |
| Frequency heuristic | Leader decides if distiller should run | Always runs (user explicitly asked) |
| Distiller | Same agent, same rules | Same agent, same rules |
| Privacy scrub | Mandatory | Mandatory |
| User consent | Mandatory | Mandatory |
| Upload | Via shipper (end of workflow) | Via shipper (standalone dispatch) |
| Quality gate | 5-question gate | 5-question gate |
The key difference: /contribute bypasses the frequency heuristic because the user has explicitly signaled intent to share knowledge. Everything else (distiller, privacy scrub, quality gate, user consent, shipper upload) is identical.
brain-contributions.md from the standard workflow, distiller should check for duplicates against it to avoid re-proposing the same entries./contribute extracts from all of them (scanning each repo's workspace runs).Like all brain features, /contribute failures are non-blocking:
brain-contributions.md/contribute failuresUser: /contribute
→ Leader checks brain mode (connected? repos available?)
→ Leader gathers artifacts from all session runs
→ Leader dispatches distiller
→ Distiller extracts 3 entries: a math method, a coding pattern, a validation strategy
→ Leader shows all 3 entries to user
→ User: "Yes, contribute all"
→ Leader dispatches shipper for brain upload
→ Shipper creates PR to statsclaw/brain-seedbank
→ Leader: "3 entries contributed! PR: https://github.com/statsclaw/brain-seedbank/pull/42"
User: contribute what we learned about panel data
→ Same flow, but distiller focuses extraction on panel-data-related knowledge
→ User reviews, approves 2 of 3 entries
→ PR created with 2 entries
User: share the lessons from run REQ-20260404-001
→ Leader scopes to single run
→ Same extraction and consent flow