| name | looply-context-sync |
| description | Use to verify and sync context files (context-index, project-context, session-context, code-context) against the real codebase state. |
Use this skill when the user explicitly invokes $looply-context-sync, asks to run /looply:context-sync, or clearly requests context synchronization.
Quick usage:
$looply-context-sync [feature-name]
Primary references:
- Workflow playbook: ../../../../.looply/state/workflow-playbook.opencode.md
- Host status contract: ../../../../.looply/state/host-status-contract.json
- Managed pack: ../../../../.looply/managed/packs/software-delivery-suite
- Custom overrides: ../../../../.looply/custom
- Execution hints: ../../../../.looply/state/execution-hints.opencode.json
- Context index: ../../../../.looply/state/context-index.md
- Project context: ../../../../.looply/custom/project-context.md
- Session context: ../../../../.looply/custom/session-context.md
- Code context: ../../../../.looply/state/code-context.json
- Knowledge graph: ../../../../.looply/state/knowledge-graph.json
Usage:
- Explicit mention:
$looply-context-sync
- Workflow alias to honor:
/looply:context-sync
- Syntax in Codex:
$looply-context-sync [feature-name]
Example:
- $looply-context-sync pix-webhook-retry
When to use:
- Context files are marked as stale, draft or empty
- Before starting a new workflow to ensure updated context
- After significant codebase changes (refactor, new dependency, architecture change)
- When auto-resume detects inconsistent context
Curated example guidance:
- ICL mode:
on
- Use examples only for style, structure and quality calibration.
- Do not copy feature-specific names, identifiers or business details from examples.
- No example was selected for this workflow.
Context Sync Flow
Stage 1: Context Audit
- Read all context files listed in Primary references.
- Check the status of each one:
status: empty → file exists but has no content
status: draft → partial content, may be outdated
status: stale → content present but potentially outdated
status: valid → content is up to date
- Compare modification timestamps with git log to detect staleness.
Stage 2: Codebase Validate
- For each file with stale/draft/empty status, validate against the real codebase:
context-index.md → verify all listed features have a corresponding workflow-status.md
project-context.md → verify directory structure, dependencies in package.json, frameworks
session-context.md → verify session-links.json
code-context.json → run looply refresh-code-context if missing or stale
knowledge-graph.json → run looply refresh-code-context if missing or stale
- Document discrepancies found.
Stage 3: Sync Report
Generate a report in .looply/custom/context-sync-report.md with:
# Context Sync Report
## Verified Files
| File | Status | Action |
|---------|--------|------|
| context-index.md | valid | keep |
| project-context.md | stale | update |
## Discrepancies Found
- project-context.md: dependency X not listed
## Suggested Actions
- Update project-context.md with dependency X
- Run looply refresh-code-context
Stage 4: Apply Sync
Present the report to the user and ask:
"Context files need updating. Apply the fixes?"
[y] Yes - apply all updates
[n] No - keep as is
[p] Partial - choose which to update
Execution rules:
- Start by reading the workflow playbook and the context index file.
- If the user asked for help, explain syntax, arguments, example, expected output and next step without mutating state.
- Never overwrite manual context without user confirmation.
- For code-context.json and knowledge-graph.json, use
looply refresh-code-context.
- Use managed pack files as canonical process definition and write local state only under
.looply/custom.
- Respond in the same language as the user's input.
- For existing projects, use the real local codebase as the primary source of truth and use context files only as accelerators.
- If a context file has
status: empty, status: draft or status: stale, validate it against the local codebase before trusting it.
- Follow balanced interaction mode to avoid unnecessary repeated clarifications.
- When curated examples are referenced, use them only for style, structure and quality calibration.
- Keep the response visually structured with clear Markdown section titles.
- Do not use emojis.
Composed Agent Context
The sections below were pre-composed by looply from agent context_slots.
Constraints
- Never modify context files without user confirmation
- Always use
looply refresh-code-context for code-context and knowledge-graph
- Do not modify managed files (only .looply/custom)
Escalation
- Escalate context inconsistencies to delivery-orchestrator
- Escalate codebase structure changes to architect
Arguments:
- feature-name: optional short identifier of the feature to sync context for (optional)