workloom

package module
v0.1.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Workloom 图标

Workloom

把 AI 编码 Agent 的项目状态,织回你的 Git 仓库。

独立于 Harness、Git 原生、面向多 Agent 的开发基础设施。

Agent 快速开始 · English · 使用手册 · 设计文档

Go 1.26 MCP Git native Status


Workloom 是一个独立于具体编码 Harness 的 Agent 开发基础设施。它把任务、工作流、审批、运行记录、决策、发现和知识上下文保存为项目内 .devsys/ 下的可读文本,并通过同一套 CLI 与 MCP 应用服务实施校验、并发控制和恢复。

这意味着你可以更换 Codex、Claude Code、OpenCode 或其他 Agent,而不丢失项目状态,也不需要维护跨项目数据库或常驻服务。

为什么是 Workloom

常见问题 Workloom 的方式
Agent 状态被锁在某个 Harness 中 状态模型独立,Agent 通过 MCP 或 CLI 接入
换设备后上下文难以恢复 .devsys/ 随 Git clone、pull 和 checkout 一起迁移
自动化直接改文件,容易绕过规则 写操作统一经过应用服务、版本守卫、门禁和事务
Agent 显示“完成”,但没有代码证据 完成前校验工作区 HEAD,证据不足时转入人工复核
项目知识很快过期 可计算知识新鲜度,支持受保护页面与增量刷新
看板成为第二事实来源 看板与静态站都是投影,.devsys/ 始终是唯一事实来源

核心能力

  • Git 原生状态:YAML、JSONL 与 Markdown 可读、可审计、可 diff。
  • Harness 解耦:内置 Codex、Claude Code、OpenCode 与 Shell 适配器。
  • 项目规划上下文:统一保存项目蓝图引用、目标、范围、约束、里程碑和当前状态。
  • 动态任务系统:Agent 可按蓝图创建任务与子任务,维护优先级和依赖关系。
  • 完整工作流:步骤、条件、门禁、审批、领取、租约、重试与恢复。
  • MCP 原生接入:按 session、executor、reviewer、admin profile 暴露能力。
  • 可靠写入:原子替换、乐观并发、文件锁、跨文件事务和崩溃恢复。
  • 上下文与知识:任务上下文装配、知识扫描、校验、新鲜度与增量刷新。
  • 可验证执行:隔离 worktree、运行事件流、完成校验与显式人工放行。
  • 只读工作区视图:终端摘要、离线静态站与本地只读服务。
  • 跨设备接力:分叉检查、租约审计、保守归档与确定性修复。

从项目蓝图到交付

Workloom 管理的不只是 Agent 的一次运行,而是项目从规划到交付的完整上下文:

层级 Workloom 管理的内容 Agent 可以做什么
项目蓝图 项目目标、范围、约束、技术栈、蓝图 Artifact 引用 读取项目方向,在蓝图缺失时先向用户澄清
里程碑与状态 当前阶段、里程碑、风险、阻塞项、下一步重点 汇总进度,判断应该继续交付还是回到规划
动态任务 任务、子任务、优先级、验收条件、依赖关系 根据目标拆分工作,在执行中发现并创建后续任务
工作流程 步骤、条件、阶段门禁、质量门和审批策略 选择匹配的流程,按规则推进而不是自由跳步
执行与验证 Agent 领取、worktree、Run、日志、重试和完成证据 执行代码变更,并用 Git 与测试证据证明完成
项目记忆 决策、发现、产物、事件和知识上下文 为下一位 Agent 留下可追踪、可恢复的上下文
项目蓝图
   ↓
目标 / 范围 / 里程碑
   ↓
动态任务 ── 子任务 ── 依赖
   ↓
工作流 ── 门禁 ── 审批
   ↓
Agent 执行 ── 验证 ── 人工复核
   ↓
项目状态与知识沉淀 ──→ 下一轮规划

架构

所有入口共享 internal/app 中的业务规则。CLI 和 MCP 不是两套实现,因此 Agent 无法通过切换入口绕过门禁、审批、版本守卫或事务恢复。

Coding Agents
    │
    ├── MCP ──┐
    ├── CLI ──┼── Workloom Core ── .devsys/ ── Git
    └── Files ┘      │
                     ├── Workflows & approvals
                     ├── Dispatch & worktrees
                     ├── Context & knowledge
                     └── Transactions & recovery

快速开始

方式 A:让 Agent 帮你接入(推荐)

你不需要先学会 Workloom 的命令。打开 Codex、Claude Code、OpenCode 或其他可执行终端命令的编码 Agent,把下面这段话直接发给它:

帮我在当前项目接入 Workloom(https://github.com/JAYY513/Workloom):

1. 若 workloom 未安装(workloom --version 无输出):优先
   `npm install -g @kaki317/workloom`(Node.js ≥ 18);平台不支持或失败时
   按该仓库 INSTALL.md 的 §1 安装,装完自证版本。
2. 在目标项目目录执行 init → `workloom setup`(该目录已是 git 仓则建议在仓库根;
   非 Git 原型可直接 init)。`setup` 一步完成接入并自检(init → 工作流模板 →
   wire → wire --check → prime → 蓝图检查 → doctor),失败即停。

任一步失败就停下报告;走脚本安装路径时不要跳过哈希校验;不要直接修改 .devsys/ 内的
受管文件(所有写入走 workloom CLI 或 MCP);若某一步必须我手动操作,
只告诉我那一步,然后继续完成剩余工作。

接入完成后,你可以直接这样和 Agent 沟通:

请先用 Workloom 读取项目蓝图、目标、范围、里程碑和当前状态。
然后规划并实现用户登录功能:把工作拆成有验收条件的任务与子任务,
维护依赖关系,选择合适的工作流推进,并在需要我决策或审批时暂停。
继续上次的工作。先读取 Workloom 中的当前里程碑、未完成任务、
相关决策和风险;执行过程中发现的新工作请创建为任务并建立依赖。
完成后记录验证证据,更新项目状态,并告诉我结果和剩余风险。

Agent 会从仓库中的 AGENTS.md 和 .agents/skills/devsys/ 获得操作规范,通过 workloom prime 恢复上下文;你仍然可以在 Git 中审查所有状态变化。

方式 B:手动接入

1. 安装

完整安装与接入流程(含校验、回退与排障)见 INSTALL.md;下面是最短路径。

npm install -g @kaki317/workloom   # 需要 Node.js ≥ 18
workloom --version                 # 自证

就这么一条:升级就是重跑同一条命令,平台二进制与完整性由 npm 处理。当前平台包只发布了 Windows x64;macOS / Linux / Windows ARM64,以及 Release 脚本、go install、源码构建等 其余安装方式见 INSTALL.md §1。

改名兼容:旧版主命令 devsys 仍可用(同一程序的兼容别名);状态目录仍是 .devsys/。 npm 包只装 workloom 一个 bin;装安装脚本才同时装入 devsys。

2. 初始化项目

在任意目录运行一条命令(Git 仓库根目录最佳;非 Git 目录也可用):

workloom setup

它按顺序完成 init(幂等)→ 安装 quick-fix 起手工作流(已有文件不动)→ wire(AGENTS.md 纪律块 + Agent Skill)→ 配置校验 → 环境检查 → prime → 蓝图检查(未声明只报告,不猜)→ doctor,任一步硬失败即停。重跑安全: 已存在的文件一律保留。

装好二进制后,workloom mcp install 把 devsys 注册进检测到的 MCP 客户端(服务器名仍为 devsys,兼容既有客户端配置) (Codex / Claude Code / OpenCode;显式 --client 可强制)。默认只预览不写;--apply 才写入, 已有条目不覆盖,--force 才替换。无法安全合并时拒绝并指向 wire --print-mcp。 --apply 之后会现场起一次 mcp serve 做启动检查(probe: ok (N tools);起不来则 probe: failed 并以退出码 3 结束,配置已写入但没接上;沙箱里不能起子进程时用 DEVSYS_MCP_PROBE=0 跳过)。

想逐步执行或换模板时,底层命令仍然都在:

workloom init
workloom config check
workloom wire
workloom session start
workloom setup --template reference-template   # 或 workflow init --template <id> 单装工作流
workloom workflow check                        # 校验全部策略文件

模板清单单源化:setup --template 与 workflow init --template 的 完整模板列表见该命令的用法输出(内嵌于二进制,随版本更新)。

workloom init 幂等创建 .devsys/;wire 将精简的协作纪律写入 AGENTS.md,且保留文件中的手写内容。 新项目的 .devsys/workflows/ 是空的:没有工作流时任务照常推进,但派发给 Agent 的轮次提示词里不会有流程约束。

3. 接着用它

装好之后的日常使用——创建并推进工作、质量门与阶段门、连接 MCP 客户端、 查看项目状态——见《使用手册》(docs/使用手册.md)。最常用的三个命令:

workloom next            # 现在该做什么(只读)
workloom prime           # 会话起手:项目事实 + 在飞工作 + 推荐下一步
workloom workitem create # 新任务入口

一个典型闭环

定义工作流 → 创建工作项 → 就绪检查 → Agent 领取
     ↑                                  ↓
人工审批 ← 复核与验证 ← 记录证据 ← 隔离 worktree 执行
  1. 工作流定义步骤、条件、门禁、审批与执行限制。
  2. next 只读评估风险,并给出确定性的下一步建议。
  3. dispatch 恢复异常状态、规划容量、领取任务并启动指定 Harness。
  4. Agent 在隔离 worktree 中执行,日志、命令和结果进入 Run 事件流。
  5. run complete 校验 Git HEAD 是否真实推进;证据不足则 fail closed。
  6. 决策与发现以引用传播,供后续 Agent 恢复上下文。

状态模型

.devsys/
├── project.yaml          # 项目标识与元数据
├── config.yaml           # 调度、知识、工作区与默认策略配置
├── workitems/            # 工作项与工作流实例
├── workflows/            # Markdown 工作流策略
├── approvals/            # 审批请求与消费状态
├── runs/                 # Run 摘要与 JSONL 事件流
├── decisions/            # 架构与产品决策
├── findings/             # 调研、风险与发现
├── artifacts/            # 产物及不可变版本链
├── events/               # 按月分片的项目事件
├── knowledge/            # 知识快照与新鲜度状态
└── archive/              # 可审计的保守归档

.devsys/ 是唯一事实来源。只读工具可以直接消费这些文本;所有运行时写入都应经过 CLI 或 MCP,以保留并发与一致性保证。

设计原则

  1. 项目自治:状态属于项目,而不是某台机器、某个 Agent 或某个 SaaS。
  2. 先证据,后状态:没有可验证证据,就不能把任务标记为完成。
  3. 默认拒绝:版本冲突、策略损坏、审批缺失和恢复未完成时 fail closed。
  4. 文本优先:数据可以被人阅读、Git 审查,并由简单工具交换。
  5. 投影不是事实:Dashboard、静态站和 Contrabass 只是执行或观察后端。
  6. 单写者接力:当前跨设备模型是明确交接,不支持多设备同时写入。

文档

文档 用途
使用手册 15 分钟上手、日常操作与完整命令路径
发布流程 发版 runbook:tag/Actions 触发、产物校验、回退与故障处理
迁移指南 Schema 升级、二进制替换与回退
设计文档 架构原则、数据模型与设计取舍(活文档)
贡献指南 环境要求、提交规范与文档纪律
更新日志 版本历史与用户可感知的变更
RepoWiki 自动生成的模块级项目知识

开发

要求 Go 1.26 与 Git:

make build
go test ./...
go vet ./...

项目包含分层单元测试、CLI/MCP 集成测试,以及 scripts/smoke-m*.{sh,ps1} 端到端剧本。测试策略优先覆盖行为、边界与回归,而不是单纯追求覆盖率数字。

当前状态与边界

Workloom 已完成 M0–M9 实施与 17 项成功标准验收,当前仍处于 pre-release 阶段。

  • 核心路径以本地 CLI、stdio MCP 与 Git 为主,不提供远程中心协调服务。
  • 跨设备协作采用单写者接力;同时写入由 Git 合并流程人工处理。
  • Contrabass 集成已通过 fixture 闭环,真实环境字段仍标记为 [UNVERIFIED]。
  • 采用 MIT 许可证(LICENSE);贡献约定见 CONTRIBUTING.md,版本历史见 CHANGELOG.md。

参与贡献

提交改动前,请阅读以下步骤(完整约定见 CONTRIBUTING.md):

  1. 先阅读 设计文档 中的设计原则。
  2. 为行为变化补充高价值测试,并运行 go test ./... 与 go vet ./...。
  3. 保持 .devsys/ 为唯一事实来源,不引入绕过应用服务的写路径。
  4. 在 Pull Request 中说明动机、兼容性影响、验证方式和回退路径。

Workloom keeps the project memory with the project.

Documentation

Overview

Package workloom exists to embed the example workflow policies into the binary, so `devsys workflow init --template` works for users who only have the release binary — the docs/ tree ships with the repository, not with the binary. docs/examples/workflows/ stays the single source: the smoke scripts and the README copy from the same files.

Index

Constants

This section is empty.

Variables

View Source
var WorkflowTemplatesFS embed.FS

WorkflowTemplatesFS holds the example workflow policies (quick-fix, feature-development, architecture-change, reference-template) exactly as they appear in docs/examples/workflows/.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
devsys command
Command devsys is the compatibility alias for the workloom CLI: the same entry point under the historical name, kept so existing scripts and muscle memory keep working.
Command devsys is the compatibility alias for the workloom CLI: the same entry point under the historical name, kept so existing scripts and muscle memory keep working.
workloom command
Command workloom is the CLI entry point for the project-local agent development infrastructure described in docs/原始文档/ (方案 = specification, 实施计划 = step plan).
Command workloom is the CLI entry point for the project-local agent development infrastructure described in docs/原始文档/ (方案 = specification, 实施计划 = step plan).
internal
app
Package app is the shared application service behind every workloom surface (CLI, MCP, file protocol): one implementation of input validation, gates, approvals, version guards and transactions, so no entry point can bypass a constraint the others enforce (方案 §8.1, 实施计划 M4.2).
Package app is the shared application service behind every workloom surface (CLI, MCP, file protocol): one implementation of input validation, gates, approvals, version guards and transactions, so no entry point can bypass a constraint the others enforce (方案 §8.1, 实施计划 M4.2).
approval
Package approval persists Approval records as one file per approval under .devsys/approvals/<id>.yaml (方案 §4.9/§5.8, 实施计划 M3.7) and implements the request → decide → consume lifecycle.
Package approval persists Approval records as one file per approval under .devsys/approvals/<id>.yaml (方案 §4.9/§5.8, 实施计划 M3.7) and implements the request → decide → consume lifecycle.
archive
Package archive implements M8.3 (方案 §14.2): conservative archiving of the append-only JSONL streams — project events and run streams — to keep the working tree small without losing history.
Package archive implements M8.3 (方案 §14.2): conservative archiving of the append-only JSONL streams — project events and run streams — to keep the working tree small without losing history.
cli
Package cli implements the workloom command surface: global switches, command dispatch, output rendering and the exit-code taxonomy.
Package cli implements the workloom command surface: global switches, command dispatch, output rendering and the exit-code taxonomy.
config
Package config validates the managed metadata files devsys owns inside a project's .devsys/ directory (方案 §14.1/§14.2/§14.3, 实施计划 M0.4).
Package config validates the managed metadata files devsys owns inside a project's .devsys/ directory (方案 §14.1/§14.2/§14.3, 实施计划 M0.4).
dispatch
Package dispatch decides which work items a scheduling tick may start (方案 §4.8/§7.4): the ordering, the concurrency gates and the preconditions, as a pure function of the state the caller read.
Package dispatch decides which work items a scheduling tick may start (方案 §4.8/§7.4): the ordering, the concurrency gates and the preconditions, as a pure function of the state the caller read.
domain
Package domain defines the versioned, text-persisted project records.
Package domain defines the versioned, text-persisted project records.
events
Package events appends and filters the project event stream under .devsys/events/<YYYY-MM>.jsonl (方案 §4.6, 实施计划 M1.3).
Package events appends and filters the project event stream under .devsys/events/<YYYY-MM>.jsonl (方案 §4.6, 实施计划 M1.3).
harness
Package harness is the execution layer: one adapter interface over the harnesses devsys can drive (方案 §9.1/§9.2) plus the shell adapter that runs an arbitrary command with line-level streaming.
Package harness is the execution layer: one adapter interface over the harnesses devsys can drive (方案 §9.1/§9.2) plus the shell adapter that runs an arbitrary command with line-level streaming.
knowledge
Package knowledge implements the knowledge layer's page contract and the bookkeeping that keeps the layer honest about which code it describes (方案 §12): the front matter every page carries, located validation, and the scan/freshness machinery the later milestones build on.
Package knowledge implements the knowledge layer's page contract and the bookkeeping that keeps the layer honest about which code it describes (方案 §12): the front matter every page carries, located validation, and the scan/freshness machinery the later milestones build on.
mcp
Package mcp exposes the devsys application service over the Model Context Protocol using the official Go SDK (github.com/modelcontextprotocol/go-sdk).
Package mcp exposes the devsys application service over the Model Context Protocol using the official Go SDK (github.com/modelcontextprotocol/go-sdk).
next
Package next evaluates a project's readiness verdict and the single recommended next action (方案 §7.4, 实施计划 M3.4).
Package next evaluates a project's readiness verdict and the single recommended next action (方案 §7.4, 实施计划 M3.4).
project
Package project implements project-local devsys operations.
Package project implements project-local devsys operations.
prompt
Package prompt assembles the text one attempt round hands to a harness (方案 §4.8): the first round carries the full task brief, later rounds carry only what changed and what is left, so a session's context is not rebuilt from scratch every round.
Package prompt assembles the text one attempt round hands to a harness (方案 §4.8): the first round carries the full task brief, later rounds carry only what changed and what is left, so a session's context is not rebuilt from scratch every round.
reconcile
Package reconcile implements M2.3 (orphan recovery) and M2.4 (state repair) per 方案 §15.4.
Package reconcile implements M2.3 (orphan recovery) and M2.4 (state repair) per 方案 §15.4.
record
Package record persists Decision, Finding and Artifact records as one file per record under .devsys/{decisions,findings,artifacts}/<id>.yaml (方案 §14.3, 实施计划 M1.5).
Package record persists Decision, Finding and Artifact records as one file per record under .devsys/{decisions,findings,artifacts}/<id>.yaml (方案 §14.3, 实施计划 M1.5).
registry
Package registry manages the user-level project path registry defined in 方案 §14.4: it stores only project id, path and last_seen_at — never project state.
Package registry manages the user-level project path registry defined in 方案 §14.4: it stores only project id, path and last_seen_at — never project state.
retry
Package retry computes when a failed or stalled attempt may run again (方案 §15.4): an exponential backoff with a reproducible jitter.
Package retry computes when a failed or stalled attempt may run again (方案 §15.4): an exponential backoff with a reproducible jitter.
run
Package run persists Run records under .devsys/runs/<id>.yaml (方案 §14.3, 实施计划 M1.4).
Package run persists Run records under .devsys/runs/<id>.yaml (方案 §14.3, 实施计划 M1.4).
search
Package search scans .devsys/ text files for a keyword without any database or index (方案 §14.1, 实施计划 M1.6).
Package search scans .devsys/ text files for a keyword without any database or index (方案 §14.1, 实施计划 M1.6).
sitestatic
Package sitestatic renders a view.Model as an offline static site (实施计划 M7.2, 方案 §17 两种形态之一)。
Package sitestatic renders a view.Model as an offline static site (实施计划 M7.2, 方案 §17 两种形态之一)。
storage
Package storage implements the text state primitives required by 方案 §15.2: atomic single-file replacement, JSONL appends with torn-tail detection, stable-key YAML/JSON serialization, a project-level short write lock, optimistic version checks and a recoverable multi-file transaction log.
Package storage implements the text state primitives required by 方案 §15.2: atomic single-file replacement, JSONL appends with torn-tail detection, stable-key YAML/JSON serialization, a project-level short write lock, optimistic version checks and a recoverable multi-file transaction log.
syncstatus
Package syncstatus implements the read-only inspection behind `workloom sync status` (实施计划 M8.1, 方案 §14.4).
Package syncstatus implements the read-only inspection behind `workloom sync status` (实施计划 M8.1, 方案 §14.4).
version
Package version carries the build identity of the workloom CLI.
Package version carries the build identity of the workloom CLI.
view
Package view assembles the read-only workspace view (方案 §17, 实施计划 M7.1): one snapshot of a project's blueprint, progress, runs, records and knowledge freshness, built from the .devsys/ state files and git state.
Package view assembles the read-only workspace view (方案 §17, 实施计划 M7.1): one snapshot of a project's blueprint, progress, runs, records and knowledge freshness, built from the .devsys/ state files and git state.
workflow
Policy cache and last-known-good resolution (实施计划 M3.5, 方案 §5.3).
Policy cache and last-known-good resolution (实施计划 M3.5, 方案 §5.3).
workitem
Package workitem — scheduling: claim / heartbeat / release / start / retry / repair.
Package workitem — scheduling: claim / heartbeat / release / start / retry / repair.
workspace
Package workspace manages execution workspaces for runs (方案 §4.8): one workspace per work item below a configured root, its lifecycle hooks, and the path invariants that keep an agent inside its workspace.
Package workspace manages execution workspaces for runs (方案 §4.8): one workspace per work item below a configured root, its lifecycle hooks, and the path invariants that keep an agent inside its workspace.
The smoke-m1 helper walks the M1 lifecycle against one initialized project directory (实施计划 M1.7): 创建项目 → 建任务 → 记录决策 → 完成.
The smoke-m1 helper walks the M1 lifecycle against one initialized project directory (实施计划 M1.7): 创建项目 → 建任务 → 记录决策 → 完成.
m3helper command
Command m3helper prepares and inspects M3.3 smoke fixtures for scripts/smoke-m3.*: stage gates, the claim-time quality gate and completion propagation.
Command m3helper prepares and inspects M3.3 smoke fixtures for scripts/smoke-m3.*: stage gates, the claim-time quality gate and completion propagation.
m4helper command
Command m4helper drives a scripted MCP session against a devsys binary and asserts the M4 acceptance: profile filtering, the health tool, a record round-trip through the tool surface, the session interface, and the error taxonomy.
Command m4helper drives a scripted MCP session against a devsys binary and asserts the M4 acceptance: profile filtering, the health tool, a record round-trip through the tool surface, the session interface, and the error taxonomy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL