---
title: "ruflo-jujutsu"
url: "https://claudemods.dev/zh-cn/builds/ruflo-jujutsu-fa7bef"
source: "https://github.com/ruvnet/ruflo/tree/main/plugins/ruflo-jujutsu"
source_type: "github"
repo: "https://github.com/ruvnet/ruflo/tree/main/plugins/ruflo-jujutsu"
author: "ruvnet"
author_handle: "ruvnet"
stars: 82392
category: "Git 与代码审查"
categories: ["git"]
tags: ["code-review", "diff-analysis", "git", "hooks", "mcp", "risk-scoring"]
permission_level: 2
scan_complete: true
install: "claude plugin marketplace add ruvnet/ruflo\nclaude plugin install ruflo-jujutsu@ruflo"
added: "2026-10-05T08:13:14.584Z"
updated: "2026-11-25T06:14:05Z"
locale: "zh-cn"
content_locale: "zh-cn"
---

# ruflo-jujutsu

高级 git 工作流，提供 diff 分析、风险评分、变更分类和审阅者建议，并为 PR 操作提供 function-hook 防护 mod。

## Description

高级 git 工作流，提供 diff 分析、风险评分和审阅者建议。

安装：
/plugin marketplace add ruvnet/ruflo
/plugin install ruflo-jujutsu@ruflo

功能：带风险评分的 diff 分析、变更分类（feature/bugfix/refactor/...）、依据代码所有权提供审阅者建议，以及逐文件风险拆分。

命令：/jujutsu（根据风险得分分析当前 diff）。技能：diff-analyze、git-workflow。MCP 面：6 个 analyze_* 工具（analyze_diff、analyze_diff-risk、analyze_diff-classify、analyze_diff-reviewers、analyze_file-risk、analyze_diff-stats）。

作为 mod（ADR-445，hooks/register.ts）：只收紧的防护，拒绝 github_pr_manage create/review 中包含密钥、令牌或密码的请求，并拒绝没有 confirm: true 的 merge/close；提供 /jujutsu-mod（status、recent、tools、scan）；以及状态文件 .claude-flow/jujutsu-mod/status.json。不进行网络调用、启动进程或模型调用。使用 claude plugin validate、claude plugin test 和 bash plugins/ruflo-jujutsu/scripts/smoke.sh 验证。

## Install

```
claude plugin marketplace add ruvnet/ruflo
claude plugin install ruflo-jujutsu@ruflo
```

## Original README

# ruflo-jujutsu

Advanced git workflows with diff analysis, risk scoring, and reviewer recommendations.

## Install

```
/plugin marketplace add ruvnet/ruflo
/plugin install ruflo-jujutsu@ruflo
```

## Features

- **Diff analysis**: Comprehensive change analysis with risk scoring
- **Change classification**: Auto-categorize as feature, bugfix, refactor, etc.
- **Reviewer recommendations**: Suggest reviewers based on code ownership
- **File-level risk**: Per-file risk breakdown for targeted review

## Commands

- `/jujutsu` -- Analyze current diff with risk scoring

## Skills

- `diff-analyze` -- Analyze diffs for risk, reviewers, and classification
- `git-workflow` -- Advanced branch management and PR lifecycle

## MCP surface (6 tools)

All defined at `v3/@claude-flow/cli/src/mcp-tools/analyze-tools.ts`:

| Tool | Purpose |
|------|---------|
| `analyze_diff` | Full diff analysis (risk + classification + reviewers + stats) |
| `analyze_diff-risk` | Risk score for the staged/unstaged diff |
| `analyze_diff-classify` | Classify change as feature, bugfix, refactor, perf, security, docs, …|
| `analyze_diff-reviewers` | Recommend reviewers based on code ownership |
| `analyze_file-risk` | Per-file risk breakdown |
| `analyze_diff-stats` | Lines added/removed, files touched, complexity delta |

## Compatibility

- **CLI:** pinned to `@claude-flow/cli` v3.6 major+minor.
- **Verification:** `bash plugins/ruflo-jujutsu/scripts/smoke.sh` is the contract.

## ADR-compliance integration

This plugin's diff analysis is the substrate that [ruflo-adr ADR-0001](../ruflo-adr/docs/adrs/0001-adr-plugin-pattern.md)'s `/adr check` runs on. When ADR compliance is queried for a diff:

1. `/adr check` calls `analyze_diff` to get the structured diff
2. Then `analyze_diff-classify` to determine change type
3. Then cross-references the `adr-patterns` namespace for ADRs related to the touched files
4. Flags violations: code referencing deprecated/superseded ADRs, or code contradicting accepted ADRs

Without this plugin, `/adr check` falls back to plain `git diff` parsing — usable but no risk scoring or reviewer recommendations.

## Namespace coordination

This plugin owns the `git-patterns` AgentDB namespace (kebab-case, follows the convention from [ruflo-agentdb ADR-0001 §"Namespace convention"](../ruflo-agentdb/docs/adrs/0001-agentdb-optimization.md)). Reserved namespaces (`pattern`, `claude-memories`, `default`) MUST NOT be shadowed.

## Verification

```bash
bash plugins/ruflo-jujutsu/scripts/smoke.sh
# Expected: "10 passed, 0 failed"
```

## Architecture Decisions

- [`ADR-0001` — ruflo-jujutsu plugin contract (ADR-compliance integration, smoke as contract)](./docs/adrs/0001-jujutsu-contract.md)

## Related Plugins

- `ruflo-adr` — `/adr check` consumes this plugin's `analyze_diff` output
- `ruflo-agentdb` — namespace convention owner

## As a mod

This plugin ships a function-hook mod (ADR-445, `hooks/register.ts`). It makes no network call, spawns no process and makes no model call.

- **Guard** (tighten-only, on by default): Refuses `github_pr_manage` create/review whose title or body holds a key, token or password (PR text is public), and `merge`/`close` unless the call carries `confirm: true`. A refusal never echoes the secret.
- **`/jujutsu-mod`**: `status`, `recent`, `tools` (which of this plugin's tools are connected) and `scan <text>` (would the guard refuse it). Answered locally.
- **Status file**: `.claude-flow/jujutsu-mod/status.json` (`{version: 1, updatedMs, guard, calls, total, blocked, recent}`, counters only, never tool input), written at session start and after every call to this plugin's tools.

Options (`userConfig`): `guard` (on), `confirmPrActions` (on).

Test it: `claude plugin validate plugins/ruflo-jujutsu`, `claude plugin test plugins/ruflo-jujutsu`, `bash plugins/ruflo-jujutsu/scripts/smoke.sh`.
