@bluenyang/reins

中文文档
0.2.0发布于 2026/10/29MITES Module构建来源已验证近 30 天下载 3107

Installs, migrates and updates an agent harness (harness → loop → graph) that keeps coding agents inside their permitted roles.

原始使用文档
文档目录10 节
  1. Status
  2. The ladder
  3. How it works
  4. Enforced versus advised
  5. Quick start
  6. Commands
  7. Skills
  8. Roadmap
  9. Documents
  10. License

reins

한국어

reins installs, migrates and updates an agent harness for a repository: roles for coding agents, a loop policy, schema-checked handoff files, a knowledge store and gates. A script, reins check, decides at fixed points whether the loop may continue, so an agent stays inside the role it was given and does what was specified. People make the gate decisions.

It exists because twelve repositories of BlueNyang and Team Croffle share one harness lineage and share its problems: agents stepping outside the request, one session that implements and also judges, knowledge lost in gitignored space, no rule for stopping, copies that drift apart, and a loop that works only with Claude. The full list (P1–P6) is in docs/proposal.md.

Status

Version 0.1.5 is on npm: npx @bluenyang/reins <command>. It is round one of the plan — the graph tier, with generated vendor files verified for Claude Code only; the loop and harness tiers are carved out of it in 0.2. 0.1.3 split the loop into stage skills with a PR → CI → rc release flow, 0.1.4 prepares large repositories (release settings, monorepo gates, migrate fixes), and 0.1.5 states which rules are enforced and which are only advised, splits model bindings into a team and a per-user layer, and runs CI on Ubuntu, Windows and macOS with Node 22 and 24. 0.2.0 (in rc) adds reins config, a terminal screen for models and roles, and asks install and update questions as screens. What changed in each version is in CHANGELOG.md; what comes next is in the roadmap.

reins develops itself through its own loop: intents 001 (reins status), 002 (reins metrics) and 003 (violation scenarios) each went intent → spec → plan → tickets, with the checks at T1 to T5 passing and Codex doing the code review. Roles bound to other vendors ran through their CLIs (codex exec, agy -p): the lead agent called them following the reins-loop skill. The CLI does not dispatch to vendors by itself yet.

The ladder

There are three tiers. Each one contains the one below it, and the tiers share one source.

TierWhat it has
harnessthe verifier at commit and push (T2, T4, T6), red lines, generated permissions
loopthe plan → work → test → release cycle with fewer roles; same transition points and stop conditions
graphall twelve roles, schema-checked handoff files and per-role model bindings

reins install <tier> takes any of the three. Round one targets the graph tier; the plan is to carve the loop and harness tiers out of it in 0.2, using measured cost as input.

How it works

Roles. There are twelve: pm, planner, pl, implementer, lookup, verify-tool, code-review, qa-design, qa-run, deploy, docs and advisor. Each role file lists what the role must not do. Role separation is not model separation: every role can run on one model, and bindings.yaml assigns a vendor and model per role. By design, a role bound to a vendor that is not detected falls back to its fallback, else to the pm model, so all twelve roles can run on Claude alone.

Red lines. Ten rules (C1–C10) apply to every role, for example: no implementing "to pass" (C1), no editing managed blocks, policy or roles (C2), no editing one's own permission file (C3), no reading secrets (C4), no bypassing hooks (C5), and no push, PR, merge or release outside the deploy role (C6). The list is in docs/design.md section 2. How each rule is actually held is in Enforced versus advised below: some are blocked, some are checked at a transition, and some are only written in a role or skill.

The verifier. reins check runs at transition points and prints one verdict. It does not call a model; roles write their judgement to a handoff file and the verifier applies it.

VerdictExit codeMeaning
CONTINUE0go on
HOLD10the user must answer
STOP20fixable without a person; the stop records where, why (an id from A1 to G2) and how to resume
ESCALATE30the failure chain: pl → pm → advisor → user

The 24 stop conditions A1–G2 cover irreversible actions, open decisions, collapsed premises, repeated failure, cost, rule violations and user interruption.

The chain and the two human decisions. Work moves through four files: intent.md → spec.md → plan.md → tickets. A person decides at two points: the user approves the intent, and the user may veto the three-to-five-line summary of the spec. Everything else is reviewed by roles. Verification output is pasted as produced; a bare "passed" is not a pass.

Layout.

PathCommittedHolds
AGENTS.mdyesmanaged blocks written by the tool, project sections written by you
.agents/yesintent/, knowledge/, harness/ (roles, policy, schemas, templates, bindings.yaml, gates.yaml), skills/
.claude/yesgenerated from .agents/; do not edit
.loctx/no (gitignored)tickets, reports, handoff bus/, history/, local roadmap

Enforced versus advised

Not every rule is enforced. Each one is held in one of three ways, and harness/policy/enforcement.yaml says which, one line per rule.

  • blocked: a script, hook or permission deny stops the action before it happens.
  • checked: a transition check, the drift check or CI catches it afterwards.
  • advised: it is written in a role or skill only; nothing in code catches it.

The grade is the strongest part that really holds, and the gap column says what is left open. Hooks apply only when they are installed, and deny rules and agent tool limits exist for Claude Code only. Rule ids are in docs/design.md sections 2 and 3, and the evidence is in docs/violations.md. The advised rules are the input for 0.2.

idheldbygap
C1advisedrolejudged by reviewers only; nothing detects a hard-coded pass
C2blockedhook:pre-commit, check:driftonly when the hook is installed; the edit itself is not prevented
C3blockedhook:pre-commit, check:driftonly when the hook is installed; no deny rule covers .claude/settings.json itself
C4blockeddeny, hook:pre-commitClaude Code only; .env.* is a finite list, so names such as .env.custom have no deny rule; the hook sees staged paths, not reads
C5blockeddeny, gate, check:verdictcombined or later-position forms such as git commit -nm are not denied
C6advisedrolepre-push holds pushes to the default branch (A4) and the deny rules stop force and --no-verify pushes; any other push, PR, merge, release or tag is not blocked
C7advisedrole—
C8advisedrole—
C9advisedrole—
C10advisedroleT2 lists it but the pre-commit check does not compare the diff with plan.md
A1blockeddeny, hook:pre-pushmoving a published tag forward to a descendant passes the ancestry test
A2advisedrole—
A3advisedrole—
A4blockedhook:pre-pushonly a push to the default branch is held; other ways of leaving the machine are not detected
B1checkedcheck:ticket-start—
B2advisedrole—
B3advisedrole, check:ticket-startthe scope conflict is a role's judgement; ticket-start checks only the approval chain
B4advisedrole—
B5advisedrole—
P1advisedrole—
P2checkedcheck:ticket-start, check:rc-closeonly ticket-in-plan; a diff is not compared with plan.md
D1checkedcheck:verdictdoes not tell a ticket before rc.1 from an rc after
D2advisedroleno memory across runs
D3advisedroleno alone-versus-full-run comparison
D4blockedgate, check:verdictan empty gate output is only a WARN
D5checkedcheck:verdict—
E1advisedrolenothing reads a budget or a token count
E2advisedrolenothing reads a budget or a token count
E3advisedroleT5 lists it but nothing reads a budget or a token count
F1advisedrolethe deny rules stop some attempts in Claude Code, but no stop is recorded
F2blockedhook:pre-commit, check:drift, check:ticket-start, check:rc-close—
F3advisedrole—
G1advisedroleno signal handler and no resume record on an interrupt
G2advisedrole—
T1checkedcheck:ticket-startbudget-left is not implemented
T2blockedhook:pre-commitonly when the hook is installed; the P2 and C10 diff checks do not exist
T3checkedcheck:verdict—
T4blockedhook:pre-pushimplements A1 and the default-branch push (A4); A2, A3, C6 and the loop-step check do not exist
T5checkedcheck:rc-closeE3 is not implemented
T6advisedroleno code runs on an interrupt or a violation signal
roleblockedcheckedadvisedblocked items
advisor002—
code-review102edit code
deploy102force-push, delete or move tags, rewrite main
docs003—
implementer005—
lookup300write any file; produce reports or context files; run gates or tests
planner003—
pl003—
pm012—
qa-design003—
qa-run002—
verify-tool021—
budget scopes006—

The tables are rendered by pnpm docs:enforcement and a test keeps them equal to the YAML.

Quick start

In Claude Code, install the plugin and let it set the repository up:

/plugin marketplace add bluenyang/reins
/plugin install reins@bluenyang
/reins:reins-setup

For Codex, Antigravity, Cursor or a plain terminal, use the CLI. It requires Node 22 or later. Run it from the root of the repository you want to set up; the repository needs at least one commit (check fails on an empty history in 0.1.0):

npx @bluenyang/reins install graph --dry-run   # show what would be written
npx @bluenyang/reins install graph --mode auto # place files, detect CLIs, take defaults
npx @bluenyang/reins check --drift             # prints "drift: ok" when sources and output match
npx @bluenyang/reins status                    # intents, tickets, bus, last history entry

install refuses over a 3rd or 4th generation harness and points to migrate. Hooks are proposed in the install notes and added only with --hooks.

After the install, work goes through the agent: in Claude Code run /reins-setup once, then /reins-intent for each new request; Codex, Antigravity and Cursor read the same skills from .agents/skills/. The skills call the CLI themselves.

To work on reins itself: git clone https://github.com/bluenyang/reins.git, then pnpm install, pnpm build, and run node cli/dist/reins.js <command> (see CONTRIBUTING.md).

Commands

CommandStateDoes
install <harness|loop|graph>implementedplaces the harness; on a terminal --mode manual asks vendors, language, gates and subdirectory gates as screens; --mode manual|auto, --hooks, --dry-run, --json
migrate <tier>implementedmoves an existing harness or .ai/ workspace to this layout
updateimplementedre-applies the packaged harness without touching project sections; on a terminal it shows the plan and asks first (--yes skips the question)
configimplementedsettings screen on a terminal (models and roles configuration, exit); without a terminal it prints the resolved bindings table and how to change it; --json
configure bindingsimplemented--set role=model ... or --vendors claude,openai; --disable <role...> / --enable <role...> switch roles off or on (--local for you only; pm, implementer and verify-tool cannot be switched off); no options asks
gate [names...]implementedruns gates.yaml as declared and keeps the raw output in .loctx/reports/
statusimplementedread-only view of harness, intents, tickets, bus and last history
checkimplemented--stage ticket-start|pre-commit|verdict|pre-push|rc-close, or --drift
metricsimplementedsummary of .loctx/reports/metrics.jsonl: tokens by role, vendor, ticket and intent, knowledge stops per ticket; metrics record adds a role run's tokens
recallnot implementedsearch past decisions by symptom
doctornot implemented—
configure gatesimplementedlists subdirectory gate proposals; --add <name>... appends them to gates.yaml
configure budget|languagenot implemented—

install, migrate, update, gate, status, check and metrics take --json. Every check and gate run also appends a line to .loctx/reports/metrics.jsonl. check stages map to T1 (ticket-start), T2 (pre-commit), T3 (verdict), T4 (pre-push) and T5 (rc-close).

Skills

Ten skills follow the SKILL.md standard: reins-setup bootstraps, reins-loop conducts, and eight stage skills each take one stage and can be called alone.

SkillUse when
reins-setupinstalling reins, or moving an existing harness onto it
reins-roadmapupdating the public roadmap and picking the target version
reins-intenta new request arrives: questionnaire and approved intent
reins-specan intent is approved: accepted spec, plan and tickets
reins-implementa ticket is ready: implement it in committed units
reins-reviewa ticket is finished: verify, review and close it
reins-testall tickets of a version are done: scenarios and build
reins-releasea version is tested: PR, CI, merge and rc
reins-retroa version is released: retrospective and knowledge proposals
reins-loopa spec is accepted: calls the stage skills in order

Roadmap

The full plan is in docs/ROADMAP.md (한국어).

Documents

License

MIT

版本与发布记录

@bluenyang/reins 共发布 17 个版本,首次发布于 2026/10/26;过去 12 个月发布了 17 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.2.0latest2026/10/2910 天前
0.2.0-rc.1rc2026/10/2811 天前
0.1.52026/10/2811 天前
0.1.5-rc.22026/10/2711 天前
0.1.5-rc.12026/10/2711 天前
0.1.42026/10/2712 天前

关于 @bluenyang/reins 的常见问题

@bluenyang/reins 是什么?

Installs, migrates and updates an agent harness (harness → loop → graph) that keeps coding agents inside their permitted roles.

如何安装 @bluenyang/reins?

在项目目录运行 npm install @bluenyang/reins,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 reins,可以用 npx reins 直接运行。

@bluenyang/reins 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bluenyang__reins 是否存在。

@bluenyang/reins 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@bluenyang/reins 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@bluenyang/reins 可以商用吗?

@bluenyang/reins 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bluenyang/reins 的下载量有多少?

根据 npm 官方下载统计,@bluenyang/reins 在 2026/10/09 – 2026/11/07 这 30 天内被下载 3,107 次,日均约 104 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bluenyang/reins 还在维护吗?

最新版本 0.2.0 发布于 2026/10/29(10 天前);至今共发布 17 个版本,其中过去 12 个月发布了 17 个;首次发布于 2026/10/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。