| name | sync |
| description | Consolidate session debriefs into a single source of truth (SSOT). Run once daily from the cortex repo. |
/sync — Morning Consolidation
Read all unprocessed debriefs from the cortex OACP workspace, enrich with project memory and git history, and rewrite SSOT.md — a compact document that any agent can read at session start.
Arguments
/sync — full consolidation
/sync --dry-run — generate the SSOT without writing to disk
Instructions
When the user runs /sync, do the following:
1. Load configuration
Read config.yaml from the cortex repo root. Extract:
oacp_home — path to the OACP home directory (default: $OACP_HOME)
project — cortex project name (default: cortex)
cortex_dir — path to the cortex repo (default: current directory)
enrich_sources.oacp_memory — base dir and glob pattern for project memory files
enrich_sources.git_repos — list of repos to pull git history from
max_ssot_lines — maximum lines for SSOT output (default: 60)
If config.yaml does not exist, check for config.example.yaml and prompt the user to create a config.
2. Collect unprocessed debriefs
Scan all agent inboxes in the cortex OACP workspace:
find "$OACP_HOME/projects/cortex/agents" -path "*/inbox/*.yaml" -type f
If no debriefs are found, report "No new debriefs. SSOT unchanged." and exit (no-op).
For each debrief file:
- Read the YAML message
- Extract the debrief body (structured markdown)
- Note the source agent, project, and timestamp
3. Enrich with context
OACP project memory
Read memory files matching the configured pattern:
$OACP_HOME/projects/*/memory/*.md
Extract active priorities, open threads, and recent decisions.
Git history
For each configured git repo, collect recent activity:
git -C <repo_path> log --oneline --since="<lookback_days> days ago"
4. Generate SSOT
Synthesize all inputs (debriefs + memory + git history) into a compact SSOT document. Follow this format:
# SSOT — <YYYY-MM-DD>
> Auto-generated by `/sync`. Do not edit manually.
## Active Work
- <project>: <summary> (<agents involved>). <status>.
## Decisions
- <project>: <decision> (<date>)
## Blockers
- <project>: <blocker description>
## Carry-Forward
- [ ] <project>: <next step>
Constraints:
- Stay under
max_ssot_lines (default 60)
- Prioritize recent and active items over completed work
- Group by project, not by agent or session
- Drop stale items (>7 days with no activity)
5. Write SSOT
Write the generated document to SSOT.md in the cortex repo root.
If --dry-run was specified, display the output without writing.
6. Clean up processed debriefs
Delete each processed debrief from its agent inbox:
rm "$OACP_HOME/projects/cortex/agents/<agent>/inbox/<debrief_file>"
Debriefs are deleted after successful SSOT generation, not moved to outbox. The sender's outbox copy (created at send time) serves as the durable record.
7. Confirm
Print:
Sync complete: <N> debriefs processed, SSOT.md updated (<line_count> lines).
Sources: <list of agents/projects that contributed>
Notes
- Run this skill from the cortex repo (it writes
SSOT.md to the repo root)
- Idempotent — running with no new debriefs is a clean no-op
- The SSOT is meant to be read by agents at session start for cross-session context
- Debrief inbox entries are deleted after processing, not moved to outbox (outbox is sender-side per OACP protocol)
- If enrichment sources are unreachable (repo not cloned, memory dir missing), skip gracefully and note in output