一键导入
factstr-implementation
Implement or change factstr behavior while preserving the shared semantic contract across store implementations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Implement or change factstr behavior while preserving the shared semantic contract across store implementations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | factstr-implementation |
| description | Implement or change factstr behavior while preserving the shared semantic contract across store implementations. |
Use this skill when working on factstr.
This repository is built around:
The task is never just to make code compile.
The task is to preserve or improve the semantic contract while keeping the implementation small, explicit, and easy to reason about.
Use this skill for tasks such as:
Do not use this skill for generic repository setup, CI, packaging, or unrelated infrastructure work unless the task directly affects factstr behavior.
Events are immutable facts in one append-only log.
A command checks the version of the facts relevant to its decision context and appends only if that context has not changed.
Memory, embedded persistent, and PostgreSQL stores may differ internally, but they must expose the same observable semantics.
Do not overload one value with multiple meanings.
In particular, keep these meanings distinct when the contract requires it:
Prefer the smallest coherent design that makes the semantics explicit and testable.
Unless the task explicitly changes the contract, preserve these meanings:
minSequenceNumber is a read cursor onlyDo not reshape the project into:
IDs may appear in events. They do not define the core model.
Do not leak store-specific mechanics into shared contract types unless they are true cross-store semantics.
Examples of store-specific mechanics that should usually stay local:
Do not introduce generic folders, files, modules, or types such as:
coredomainsharedcommonutilshelpersservicesmanagersrepositoriesmodelsentitiesIf code is added, its name must explain what it owns.
Before changing code, classify the task into one of these:
If the task touches more than one of these, keep the boundary explicit.
Write down what must be true after the change.
Examples:
minSequenceNumber affects reads onlyDo this before designing new abstractions.
Ask:
If the behavior is shared:
If the behavior is store-specific:
Before adding new structure:
Do not create new top-level structure unless the current structure clearly cannot own the change.
Prefer:
Avoid:
Tests are part of the contract.
Prefer tests that prove:
minSequenceNumber behaviorWhen possible, keep the same semantic test shape reusable across multiple store implementations.
Before considering the task done, verify:
Use this path when the change affects repository-wide semantics.
Steps:
Use this path when the change affects one store only.
Steps:
Use this path when adding a backend.
Steps:
Do not let a new backend redefine the project around its own constraints.
Use names that describe semantics directly.
Prefer names like:
event_recordnew_eventevent_queryquery_resultappend_resultcontext_versionlast_returned_sequencesequence_numbermemory_storepostgres_storefile_storelive_subscriptionAvoid vague names like:
servicemanagerrepositoryhelperutilprocessorbase_modelshared_helpersDo not introduce:
Avoid refactors that mainly rearrange code without improving semantics, ownership, or tests.
A task is not done because the code compiles.
A task is done when:
Use src/lib.rs as a thin module root only.
Once a crate contains real behavior, move implementation out of src/lib.rs into ownership-based modules.
src/lib.rs should mainly:
Do not let src/lib.rs become the main implementation file after bootstrap.
Prefer module names that describe owned behavior directly, for example:
memory_store.rsquery.rspayload_match.rsconditional_append.rsAvoid vague names and avoid one giant internal file.
Use inline tests only for very small bootstrap checks.
When behavior becomes real and semantic, place tests in <crate>/tests/.
Organize test files by behavior and let the test layout reflect the owned behavior of the crate.
Examples:
tests/append.rstests/query.rstests/conditional_append.rstests/payload_match.rsDo not keep a growing semantic test suite inside one production source file.
Do not confuse better structure with speculative abstraction.
Splitting code into ownership-based modules and moving tests into a dedicated tests/ folder is required when it improves:
As soon as a crate owns meaningful behavior, prefer clear structure over extreme file minimization.