Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

feat(ruflo-jujutsu): v0.2.0 β€” adopt plugin contract (ADR-0001, ADR-compliance integration, smoke)

Reuven312f59943078
diff --git a/plugins/ruflo-jujutsu/.claude-plugin/plugin.json b/plugins/ruflo-jujutsu/.claude-plugin/plugin.json
index 4093881d48..adb7d3bb06 100644
--- a/plugins/ruflo-jujutsu/.claude-plugin/plugin.json
+++ b/plugins/ruflo-jujutsu/.claude-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "ruflo-jujutsu",
- "description": "Advanced git workflows with diff analysis, risk scoring, and reviewer recommendations",
- "version": "0.1.0",
+ "description": "Advanced git workflows with diff analysis, risk scoring, change classification (feature/bugfix/refactor/...), and reviewer recommendations β€” wraps 6 analyze_* MCP tools (diff, diff-risk, diff-classify, diff-reviewers, file-risk, diff-stats)",
+ "version": "0.2.0",
"author": {
"name": "ruvnet",
"url": "https://github.com/ruvnet"
@@ -14,6 +14,9 @@
"git",
"diff",
"review",
- "risk-analysis"
+ "risk-analysis",
+ "mcp",
+ "change-classification",
+ "reviewer-recommendation"
]
}
diff --git a/plugins/ruflo-jujutsu/README.md b/plugins/ruflo-jujutsu/README.md
index 827d8ac51c..d0aad9fdbc 100644
--- a/plugins/ruflo-jujutsu/README.md
+++ b/plugins/ruflo-jujutsu/README.md
@@ -24,3 +24,52 @@ Advanced git workflows with diff analysis, risk scoring, and reviewer recommenda
- `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
diff --git a/plugins/ruflo-jujutsu/docs/adrs/0001-jujutsu-contract.md b/plugins/ruflo-jujutsu/docs/adrs/0001-jujutsu-contract.md
new file mode 100644
index 0000000000..668fc6b418
--- /dev/null
+++ b/plugins/ruflo-jujutsu/docs/adrs/0001-jujutsu-contract.md
@@ -0,0 +1,43 @@
+---
+id: ADR-0001
+title: ruflo-jujutsu plugin contract β€” pinning, namespace coordination, ADR-compliance integration, smoke as contract
+status: Proposed
+date: 2026-05-04
+authors:
+ - reviewer (Claude Code)
+tags: [plugin, jujutsu, git, diff, risk-analysis, namespace, smoke-test]
+---
+
+## Context
+
+`ruflo-jujutsu` (v0.1.0) β€” git workflow + diff analysis. Wraps **6 `analyze_*` MCP tools** at `v3/@claude-flow/cli/src/mcp-tools/analyze-tools.ts:24, 100, 143, 185, 234, 291` (`analyze_diff`, `analyze_diff-risk`, `analyze_diff-classify`, `analyze_diff-reviewers`, `analyze_file-risk`, `analyze_diff-stats`).
+
+Surface: 1 agent (`git-specialist`), 2 skills (`diff-analyze`, `git-workflow`), 1 command (`/jujutsu`). All 6 MCP tools correctly referenced.
+
+Standard contract gaps: no plugin-level ADR, no smoke test, no Compatibility section, no namespace coordination, no cross-link to [ruflo-adr ADR-0001](../../ruflo-adr/docs/adrs/0001-adr-plugin-pattern.md) which the `/adr check` command depends on this plugin's diff analysis.
+
+## Decision
+
+1. Add this ADR (Proposed).
+2. README augment: Compatibility (pin v3.6); Namespace coordination (claims `git-patterns`); ADR-compliance integration block (jujutsu's diff analysis is the substrate that `/adr check` runs on); 6-tool MCP surface table; Verification + Architecture Decisions sections.
+3. Bump `0.1.0 β†’ 0.2.0`. Keywords add `mcp`, `change-classification`, `reviewer-recommendation`.
+4. `scripts/smoke.sh` β€” 10 structural checks: version + keywords; both skills + agent + command with valid frontmatter; all 6 `analyze_*` tools referenced; v3.6 pin; namespace coordination; ADR-compliance cross-reference (ruflo-adr); ADR Proposed; no wildcard tools.
+
+## Consequences
+
+**Positive:** plugin joins the cadence. ADR-compliance integration becomes contractually documented (ruflo-adr's `/adr check` uses this plugin's diff analysis).
+
+**Negative:** none material.
+
+## Verification
+
+```bash
+bash plugins/ruflo-jujutsu/scripts/smoke.sh
+# Expected: "10 passed, 0 failed"
+```
+
+## Related
+
+- `plugins/ruflo-adr/docs/adrs/0001-adr-plugin-pattern.md` β€” `/adr check` consumes this plugin's diff analysis
+- `plugins/ruflo-agentdb/docs/adrs/0001-agentdb-optimization.md` β€” namespace convention
+- `v3/@claude-flow/cli/src/mcp-tools/analyze-tools.ts` β€” 6 `analyze_*` tools
diff --git a/plugins/ruflo-jujutsu/scripts/smoke.sh b/plugins/ruflo-jujutsu/scripts/smoke.sh
new file mode 100755
index 0000000000..56ae4e4082
--- /dev/null
+++ b/plugins/ruflo-jujutsu/scripts/smoke.sh
@@ -0,0 +1,75 @@
+#!/usr/bin/env bash
+set -u
+ROOT="$(cd "$(dirname "$0")/.." && pwd)"
+PASS=0
+FAIL=0
+step() { printf "β†’ %s ... " "$1"; }
+ok() { printf "PASS\n"; PASS=$((PASS+1)); }
+bad() { printf "FAIL: %s\n" "$1"; FAIL=$((FAIL+1)); }
+
+step "1. plugin.json declares 0.2.0 with new keywords"
+v=$(grep -E '"version"' "$ROOT/.claude-plugin/plugin.json" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
+if [[ "$v" != "0.2.0" ]]; then bad "expected 0.2.0, got '$v'"; else
+ miss=""
+ for k in mcp change-classification reviewer-recommendation; do
+ grep -q "\"$k\"" "$ROOT/.claude-plugin/plugin.json" || miss="$miss $k"
+ done
+ [[ -z "$miss" ]] && ok || bad "missing keywords:$miss"
+fi
+
+step "2. all 6 analyze_* MCP tools referenced"
+miss=""
+for t in analyze_diff analyze_diff-risk analyze_diff-classify analyze_diff-reviewers analyze_file-risk analyze_diff-stats; do
+ grep -rq "$t" "$ROOT" --include='*.md' || miss="$miss $t"
+done
+[[ -z "$miss" ]] && ok || bad "undocumented:$miss"
+
+step "3. both skills present with valid frontmatter"
+miss=""
+for s in diff-analyze git-workflow; do
+ f="$ROOT/skills/$s/SKILL.md"
+ [[ -f "$f" ]] || { miss="$miss missing-$s"; continue; }
+ for k in 'name:' 'description:' 'allowed-tools:'; do
+ grep -q "^$k" "$f" || miss="$miss $s-no-$k"
+ done
+done
+[[ -z "$miss" ]] && ok || bad "$miss"
+
+step "4. agent + command present"
+[[ -f "$ROOT/agents/git-specialist.md" ]] && [[ -f "$ROOT/commands/jujutsu.md" ]] \
+ && ok || bad "agent or command missing"
+
+step "5. README pins @claude-flow/cli to v3.6"
+grep -qE "@claude-flow/cli.*v3\.6|v3\.6.*claude-flow/cli" "$ROOT/README.md" \
+ && ok || bad "v3.6 pin missing"
+
+step "6. README defers to ruflo-agentdb namespace convention"
+grep -q "ruflo-agentdb" "$ROOT/README.md" \
+ && grep -q "Namespace convention" "$ROOT/README.md" \
+ && ok || bad "namespace coordination block incomplete"
+
+step "7. ADR-compliance integration documented (ruflo-adr cross-reference)"
+F="$ROOT/README.md"
+grep -q "ADR-compliance" "$F" \
+ && grep -q "ruflo-adr" "$F" \
+ && grep -q "/adr check" "$F" \
+ && ok || bad "ADR-compliance integration block incomplete"
+
+step "8. git-patterns namespace claimed"
+grep -q "git-patterns" "$ROOT/README.md" \
+ && ok || bad "git-patterns namespace not claimed"
+
+step "9. ADR-0001 exists with status Proposed"
+ADR="$ROOT/docs/adrs/0001-jujutsu-contract.md"
+[[ -f "$ADR" ]] && grep -qE "^status:[[:space:]]*Proposed" "$ADR" \
+ && ok || bad "ADR missing or status != Proposed"
+
+step "10. no wildcard tool grants in skills"
+bad_skills=""
+for f in "$ROOT"/skills/*/SKILL.md; do
+ grep -q '^allowed-tools:[[:space:]]*\*' "$f" && bad_skills="$bad_skills $(basename $(dirname "$f"))"
+done
+[[ -z "$bad_skills" ]] && ok || bad "wildcard:$bad_skills"
+
+printf "\n%s passed, %s failed\n" "$PASS" "$FAIL"
+[[ $FAIL -eq 0 ]] || exit 1