一键导入
design-contracts
Enforces smriti's three design contracts (observability, dry-run, versioning) when writing or modifying CLI command handlers or JSON output.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Enforces smriti's three design contracts (observability, dry-run, versioning) when writing or modifying CLI command handlers or JSON output.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | design-contracts |
| description | Enforces smriti's three design contracts (observability, dry-run, versioning) when writing or modifying CLI command handlers or JSON output. |
This skill activates whenever you are adding or modifying a CLI command, changing JSON output, touching telemetry/logging code, or altering config defaults in the smriti project.
--dry-runThe following commands write to disk, the database, or the network. Every one of
them must honour --dry-run:
| Command | Expected guard pattern |
|---|---|
ingest | const dryRun = hasFlag(args, "--dry-run"); then no DB/file writes when true |
embed | same |
categorize | same |
tag | same |
share | same |
sync | same |
context | already implemented — keep it |
When --dry-run is active:
stdout must describe what would happen (e.g. Would ingest N sessions).stderr must note what was skipped (No changes were made (--dry-run)).--json is also set, the output envelope must include
"meta": { "dry_run": true }.--dry-runThese commands never mutate state. If they receive --dry-run, they must print
a usage error and process.exit(1):
search, recall, list, status, show, compare, projects, team,
categories
The following are forbidden in any console.log, console.error, or
log/audit output:
.content, .text, .body)✅ OK to log: command name, exit code, duration, session IDs, counts, smriti version.
SMRITI_TELEMETRY must default to 0/false/"off" — never 1.if (telemetryEnabled) { ... }.smriti telemetry sample output.The standard output envelope is:
{ "ok": true, "data": { ... }, "meta": { ... } }
Rules:
data or meta — add @deprecated in a
comment instead.data or meta must be optional._deprecated: true sibling or comment.Once a command or flag has shipped:
--dry-run → -n) but not
rename.stderr warning.Before finishing any edit that touches src/index.ts or a command handler:
--dry-run is supported and guarded--dry-run is rejected with a usage errorconsole.log/console.errorconfig.tsIf any item fails, fix it before proceeding.