Skip to content

feat: add Write discipline section to prevent direct file edits#5

Open
WorksOnMyVM wants to merge 1 commit into
superdesigndev:mainfrom
WorksOnMyVM:feat/write-discipline
Open

feat: add Write discipline section to prevent direct file edits#5
WorksOnMyVM wants to merge 1 commit into
superdesigndev:mainfrom
WorksOnMyVM:feat/write-discipline

Conversation

@WorksOnMyVM
Copy link
Copy Markdown
Contributor

背景

loopany 是 agent 长期记忆系统,使用 markdown + frontmatter 存储 artifact,并通过 append-only JSONL 存储引用关系。Agent 在日常使用中会频繁创建和修改 artifact,因此写入路径需要保持一致。

修改内容

  • skills/loopany-core/SKILL.md 的 Anti-patterns 前新增 Write discipline 小节。
  • 明确 artifact 写入必须通过 loopany artifact createloopany artifact appendloopany artifact setloopany artifact statusloopany refs add
  • 明确禁止直接写 artifacts/ 下文件,以及使用 cat >sedawk、editor writes 等绕过 CLI 的写法。
  • 补充 v0.2.0 frontmatter 使用 camelCase 属性,例如 createdAtupdatedAt
  • skills/loopany-capture/SKILL.md 的 capture 流程附近补充必须通过 loopany CLI 写入 artifact 的提示。
  • 在 capture Anti-patterns 中增加 Direct file writes instead of loopany CLI

为什么重要

直接写文件会绕过 loopany CLI 提供的关键机制,包括 schema 校验、状态机约束、audit 日志、journal 自动关联和 reference indexing。这会让 artifact 看起来写入成功,但系统索引、追踪和后续 reflect/review 流程可能缺失必要元数据或关系。

测试

  • bun test 通过
  • bun run typecheck 通过
  • 单独解析两个 SKILL.md 的 frontmatter 并检查新增标题通过

@WorksOnMyVM WorksOnMyVM force-pushed the feat/write-discipline branch from f45bf4c to c247235 Compare May 8, 2026 13:08
@WorksOnMyVM WorksOnMyVM force-pushed the feat/write-discipline branch from c247235 to 7063881 Compare May 9, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant