@nikoniko.wuw/luoshu0.1.1
Spec-driven development CLI and thin agent plugins with triggered rules, curated specs index, explicit change context, and isolated verification
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
洛书(Luoshu)
Spec-Driven Development(SDD)工具:无状态 TypeScript Core CLI + 分宿主轻量 Agent Plugin。
- 业务仓库纯文本资产(
.luoshu/):config.yaml:控制面(全局context、文档rules、阶段operations/ Verifygates&checklist/ Archive 策略)rules/:按always_on、glob、model_decision、manual与priority触发的工程规范(_前缀忽略,相对路径去扩展名即规则 ID)specs/:经人治理的系统架构与契约真相,固定入口.luoshu/specs/index.mdchanges/&archive/:单次变更工作区(支持完整路径与--quick快速路径),归档默认移入.luoshu/archive/只读封存
- 无第三方运行时依赖:基于 Node.js
>= 22LTS 内置模块,支持离线运行与npx快速冷启动。 - 分宿主薄 Plugin(Tier 1 全渠道):
- plugins/antigravity:Antigravity 原生 Plugin + Hooks(
PLUGIN_DATA会话去重、PreInvocation注入、Verify 源码只读拦截) - plugins/claude-code:Claude Code 原生 Plugin + Hooks(
CLAUDE_PLUGIN_DATA会话去重、additionalContext注入、VerifypermissionDecision: deny) - plugins/codex:Codex Hooks(
~/.codex/hooks.json,支持apply_patch路径解析与拦截)+ Skills + Plugin manifest - plugins/pi:Pi 原生 Extension(
before_agent_start/tool_resultsteer /tool_callVerify 拦截 //luoshu命令 +resources_discover) - plugins/dsh:DeepSeek Harness (
dsh) Cordis Bundle(agent/pre-step/tools/result/ 单调ctx.tools.guard//luoshu命令 +~/.dsh/skills/) - 通用 Tier 2 宿主:通过
luoshu plugin install skills安装 5 个阶段 Skill 至~/.agents/skills/并显式调用luoshuCLI。
- plugins/antigravity:Antigravity 原生 Plugin + Hooks(
快速开始
在业务仓库运行交互式向导(类似 Trellis 的终端交互体验,同时完成 .luoshu/ 初始化与宿主插件/Skills 安装):
npx @nikoniko.wuw/luoshu init
# 或已全局安装后:
luoshu init
非交互 / 脚本模式也支持显式参数:
luoshu init -y --antigravity --claude --codex --pi --dsh
luoshu plugin install # 交互式仅配置宿主插件/Skills
luoshu update # 一键刷新所有已安装的全局与当前项目宿主插件/Skills
CLI 概览
luoshu init [dir] [-y|--yes] [-f|--force] [-s|--skip-existing] [--scope user|project] [--antigravity] [--claude] [--codex] [--pi] [--dsh] [--skills] [--profile <name>] [--link] [--json]
luoshu scan [dir] [--max-files <n>] [--format md|json] [--json]
luoshu import [dir] [--from auto|agents-rules|openspec|trellis] [--dry-run] [--fix-frontmatter] [--init] [--force] [--json]
luoshu audit [dir] [--run-gates] [--include-legacy] [--strict] [--max-files <n>] [--format md|json] [--json]
luoshu config validate [dir] [--strict] [--json]
luoshu rules list [dir] [--json]
luoshu rules validate [dir] [--strict] [--json]
luoshu rules match [dir] [--path <file>]... [--change <id>] [--rule <id>]... [--format md|json]
luoshu specs index [dir] [--json]
luoshu specs validate [dir] [--strict] [--json]
luoshu status [id] [dir] [--all] [--archived] [--json]
luoshu changes [dir] [--all] [--archived] [--json]
luoshu changes new <slug> [--quick] [--worktree] [--worktree-dir <dir>] [--branch <name>] [--specs a,b] [--rules r1,r2]
luoshu changes list [dir] [--all] [--archived] [--json]
luoshu changes status [id] [dir] [--all] [--archived] [--json]
luoshu changes validate <id> [dir] [--json]
luoshu changes worktree list [dir] [--json]
luoshu changes worktree path <target> [dir] [--json]
luoshu changes worktree remove <target> [dir] [--delete-branch] [--force] [--json]
luoshu context build --stage <explore|propose|apply|verify|archive> [--change <id>] [--path <file>]... [--format md|json]
luoshu verify run <id> [--skip-gates] [--include-diff] [--json]
luoshu verify snapshot [--out <file>]
luoshu verify assert-unchanged --baseline <file> [--change <id>]
luoshu verify validate-report <id>
luoshu archive <id> --specs-reviewed --rules-reviewed [--delete|--keep] [--force]
luoshu plugin status [dir] [--json]
luoshu plugin install [antigravity|claude-code|codex|pi|dsh|skills] [--target <dir>] [--scope user|project|local] [--profile <name>] [--link] [--force]
luoshu plugin update [antigravity|claude-code|codex|pi|dsh|skills|all] [--target <dir>] [--scope user|project|local|all] [--profile <name>] [--link|--copy] [--dry-run] [--force]
luoshu plugin uninstall [antigravity|claude-code|codex|pi|dsh|skills|all] [--target <dir>] [--scope user|project|local] [--profile <name>] [--clean-cli]
luoshu update [antigravity|claude-code|codex|pi|dsh|skills|all] [dir] [--scope user|project|local|all] [--target <dir>] [--profile <name>] [--link|--copy] [--dry-run] [--force]
仓库结构
src/
├── index.ts # 对外 programmatic API 汇总入口(dist/index.js)
├── cli.ts # CLI 可执行入口(dist/cli.js)
├── core/ # 无依赖基础能力:YAML、glob、frontmatter、workspace、git、config
├── sdd/ # .luoshu/ 领域引擎:init、rules、specs、tasks、changes、context、verify、archive
├── discovery/ # 环境与存量探测:detect、scan、import、audit
├── plugin/ # 宿主插件安装/卸载与运行时桥接(antigravity / claude-code / codex / pi / dsh / skills)
├── ui/ # 零依赖 TUI 交互原语与 setup wizard
└── cli/ # 参数解析与分域子命令路由
plugins/ # 各宿主可独立拷贝的薄 Plugin / Hook / Extension 包
skills/ # 6 个规范化 Luoshu 工作流 Skill(luoshu-bootstrap/explore/propose/apply/verify/archive)
test/ # Node 原生 node:test 单元、集成、TUI、架构分层与 CLI E2E 测试
开发与验证
npm run check
# 等价于:
npm run typecheck
npm run build
npm test
agy plugin validate ./plugins/antigravity --strict
claude plugin validate .