memory-sync
Use when Wingman memory is already known enabled in the current repository and progress, decisions, business logic, API contracts, state flow, field mappings, or durable project knowledge should be recorded, or when the user explicitly asks to sync Wingman memory.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 1.6k
- Forks
- 491
01 前言 Front Matter
- name
- memory-sync
- description
- Use when Wingman memory is already known enabled in the current repository and progress, decisions, business logic, API contracts, state flow, field mappings, or durable project knowledge should be recorded, or when the user explicitly asks to sync Wingman memory.
02 资源文件 2
- 参考文档references/history-events.md2.4 KB
- 参考文档references/templates.md2.7 KB
03 SKILL.md 正文
Wingman Memory Sync
memory-sync writes the smallest useful memory update after meaningful work. It chooses the owning body for each memory item before writing.
Storage Roles
brief.md / domains/ = current projection, current binding truth bodies
history/events/ = event log, historical event bodies
history indexes = projection indexes for historical lookup
context.md = hot cache, active work state and short pointers
Authority order:
brief.md current Project Decisions
> domains/ current truths
> context.md hot working state
> history/ past events and evidence
Current truth says what future agents must obey now. History explains what changed and why. Context carries only active work state and short pointers.
Gate
Apply these gates before reading or writing memory:
- If the user opts out of memory for this work, stop without reading or writing memory.
- If
.wingman/memory/is missing, ordinary completion does not usememory-sync. If sync was explicitly requested, report that repository memory is disabled andmemory-setupis the explicit enable path. - If
.wingman/memory/exists but.wingman/memory/brief.mdor.wingman/memory/context.mdis missing, stop before writing, report the missing core entry files, and suggestmemory-setup. Do not repair frommemory-sync. - Continue only when both
brief.mdandcontext.mdexist.
Before reporting meaningful coding, documentation, configuration, product, or operational work as complete in a repository where memory is enabled, run the routing checks below. If a write route qualifies, sync memory before saying the work is done unless the user opted out.
Ownership Routing
Classify each memory item into one of these routes:
| Route | Owner | Qualifies When |
|---|---|---|
IGNORE |
none | The change has no reusable future value. |
CURRENT_TRUTH |
brief.md or domains/ |
Future agents must obey the rule, contract, field meaning, state flow, policy, invariant, or recurring debugging conclusion. |
HISTORY_EVENT |
history/events/ |
The change explains durable rule evolution, old-to-new meaning, important correction, migration, incident, important regression fix, or user-requested historical memory. |
CONTEXT_POINTER |
context.md |
Active unfinished work, pending follow-up, blocker, debugging state, or an immediate continuation pointer is needed. |
Use IGNORE for typo-only edits, formatting-only edits, rename-only cleanup, isolated visual tweaks, obvious local implementation details, and failed attempts with no reusable lesson.
A task may write more than one route, but each route needs its own reason. When current truth and history are both written, current truth owns the binding rule and history owns the change narrative.
Single Owner Body
Each durable memory item has one owning body:
- current binding rule body:
brief.mdordomains/; - historical event body:
history/events/; - historical lookup entry:
history/index.md,history/domains/,history/topics/, orhistory/months/; - hot working state or pointer:
context.md.
Short summaries and pointers are valid. Full duplicated rule bodies, event narratives, evidence, reasoning, or debugging paths are not valid.
Write Flow
- Apply the Gate.
- Route each memory item with Ownership Routing.
- If every item is
IGNORE, write nothing and report the threshold that blocked writing. - Write
CURRENT_TRUTHbeforeHISTORY_EVENTwhen both are needed. - Write
HISTORY_EVENTonly when the event has durable trace value beyond the current rule. - Write
CONTEXT_POINTERonly for hot state or immediate continuation. - Update history projections only for new or changed history events.
- Report changed memory files or the route that blocked writing.
Current Truth
Write current truth when future agents must obey the result or would otherwise need old logs to avoid a semantic mistake.
Use brief.md for project-wide decisions: global conventions, cross-domain rules, architecture choices, repository policies, memory policy, and project-wide agent behavior.
Use domains/ for one-domain rules: business rules, API contracts, canonical fields, field meanings, state flow, enum mapping, permissions, routing, money, quotas, lifecycle, product invariants, operational procedures, or recurring debugging conclusions.
Before writing current truth:
- Read
brief.md. - Use the Domain Registry to choose
brief.mdor a domain file. - Inspect same-subject current entries when practical.
- Verify evidence from user direction, existing memory, docs, schema, tests, accepted specs, or intentional implementation behavior.
- If two current entries conflict and no
updatesorextendsrelation resolves them, stop and ask which rule is valid.
Use stable identity:
ID:mem:<domain>:<subject-slug>.Subject: stable dotted subject such asorder.status.meaning.Status:current | superseded | deprecated | candidate.Relation:updates <id> | extends <id> | derived_from <id-or-path> | None.Confidence:confirmed | implementation-backed | inferred.
Only Status: current entries are binding. Inferred entries start as candidate unless confirmed by user, spec, schema, test, or intentional implementation contract.
When replacing a rule, mark the old entry superseded or deprecated and point to the replacement. When extending a compatible rule, keep both current and link with extends.
Read references/templates.md before using the default current truth template.
History Event
Write history when a completed change has durable trace value beyond hot context, especially when:
- a current truth was added, changed, deprecated, or superseded and the reason matters;
- a rule, field meaning, workflow interpretation, data contract, or agent behavior changed;
- the event explains why a current rule exists;
- a recurring confusion, debugging path, or wrong interpretation was resolved;
- a migration, incident, important regression fix, or user-requested historical record needs later lookup.
History is not mandatory for every current truth. Skip history when the reason is obvious from the current rule or the change is trivial.
When writing history:
- Read
references/history-events.md. - Write one event body under
.wingman/memory/history/events/YYYY/MM/YYYY-MM-DD-<event-slug>.md. - Update only the needed projections:
history/index.md,history/domains/<domain>.md,history/topics/<topic>.md, andhistory/months/YYYY-MM.md. - Link
Promoted Truthsto current truth IDs or useNone. - Keep projection indexes short and link-only.
Use generic topic names such as order-status, checkout-flow, payment-selection, upload-retry, or quota-display.
Context Pointer
Write context.md only for active working state:
- unfinished work;
- pending follow-up;
- blocker or debugging state needed in the next few sessions;
- immediate continuation pointer to a current truth or history event.
If current truth or history owns the durable detail, context receives only a short pointer. If no hot follow-up exists, write no context entry.
Use the ## Short Pointers section when present. If an older memory file lacks that section, add it near current work rather than creating a new log section.
Read references/templates.md before using the default context pointer shape.
Domain Registry
Update the Domain Registry only when creating, renaming, deprecating, or superseding a domain route.
Registry rows use:
| Domain | Read When | Current File | History Domain Index | History Topics | Aliases | Related Domains | Status |
History Domain Index and History Topics are routing hints for historical lookup. They do not make history current truth.
Language And Completion
Memory language follows brief.md Memory Settings when set; otherwise follow existing memory language, then the user's language, then English. Keep code symbols, paths, API names, config names, and field names unchanged.
Finish by reporting changed memory files. If nothing was written, name the blocking gate or route.
04 同仓库更多 Skills
worktable-review-with-annotations
Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.
worktable-find-and-synthesize-context
Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.
worktable-create-or-update-docs
Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.
worktable-create-or-manage-records
Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.
worktable-create-or-manage-interactive-html
Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.
worktable-collaborate-threads
Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.