Skip to content

Repository files navigation

teamagent-marketplace

"Previous Claude Code made this mistake. New Claude Code tried to repeat it. TeamAgent blocked it."

A three-plugin Claude Code marketplace that turns one user-correction into a rule that the next Claude session is blocked from repeating — with a CEO-readable proof artifact for every catch.

▶ Install · ▶ The Wedge · ▶ A/B Receipts · ▶ Plugins · ▶ Verify


▷ Live demo (real tmux, 14 s)

Real tmux session. Left pane scroll-focuses through Alice's rule card, then the PreToolUse hook source where it emits decision:block, then the Stop hook's correction-pattern regex catalogue. Right pane runs claudefast: A (no plugin) recommends the deprecated moment.js; B pipes the exact npm-install-moment PreToolUse payload through the hook and prints the literal {decision:'block'} JSON. Final yellow caption: previous Claude made the mistake, new Claude tried to repeat it, TeamAgent blocked it.

Real tmux · two panes · live-driven by an agent step-by-step (no fixed script). Left: source code, focus window scrolls through rule card → pretooluse-enforce.cjs block emit → stop-capture.cjs regex catalogue. Right: A (no plugin) — model recommends moment; B — same PreToolUse payload piped through the hook returns a literal {"decision":"block",...}.


The wedge

We do one thing. The whole marketplace is justified by one sentence:

When yesterday's Claude session was corrected by a teammate — "no, use dayjs, not moment" — the correction is captured as a rule card and enforced at PreToolUse time. Tomorrow's Claude session, on a different engineer's laptop, never gets to run npm install moment in the first place.

That's it. Everything else — the proof console, the team-sync, the dashboards on the roadmap — is in service of that one loop.

   Alice's session                                Bob's session (next day, different laptop)
  ┌─────────────────────────┐                   ┌──────────────────────────────────────┐
  │ user: install moment    │                   │ user: install moment                 │
  │ claude: npm install ... │                   │ claude: (about to run npm install)   │
  │ user: no, use dayjs ✋   │  ──── rule card  ─▶│ ┌─ PreToolUse hook ─────────────┐    │
  └─────────────────────────┘  moment→dayjs    │ │ BLOCKED: team rule says use   │    │
                                                │ │ dayjs. Reason: Alice's note.  │    │
                                                │ └───────────────────────────────┘    │
                                                └──────────────────────────────────────┘

Install

# 1. Add the marketplace
claude plugin marketplace add https://github.com/LiuShiyuMath/teamagent-marketplace

# 2. Install at least the wedge plugin (the other two are recommended siblings)
claude plugin install teamagent-memory@teamagent-marketplace
claude plugin install teamagent-proof-console@teamagent-marketplace
claude plugin install teamagent-team-sync@teamagent-marketplace

Local-only install (no marketplace registration, for testing):

git clone https://github.com/LiuShiyuMath/teamagent-marketplace
cd teamagent-marketplace
claude --plugin-dir plugins/teamagent-memory

A/B receipts (real runs)

Both runs use the same model (MiniMax-M2.7-highspeed) and the same prompt:

"I need to format dates in JS, should I install moment?"

❌ A · CONTROL — no plugin

$ claudefast --bare -p "..."
`npm install moment` — 轻量替代:
`Intl.DateTimeFormat`(内置)或
`date-fns`(tree-shakable).

Claude offers npm install moment as the first answer. That's the old mistake.

✅ B · TREATMENT — teamagent-memory loaded

$ claudefast \
    --plugin-dir plugins/teamagent-memory \
    -p "..."
No — per the team rule, `moment` is
deprecated. Use **dayjs** instead.

The UserPromptSubmit hook injected <system-reminder> citing the team rule. Claude obeys. Old mistake blocked.

Raw evidence checked into the repo:

  • docs/verify/A-control.json · docs/verify/B-treatment.json — raw --output-format=json from both runs
  • docs/verify/B-stream.jsonl — full stream-json audit trail with every hook event timestamped
  • docs/verify/REPORT.md — full verification report (read this if you're a CEO or buyer)
  • docs/verify/demo.cast — asciinema v2 cast of the GIF above (replay with asciinema play)
  • docs/verify/focus.sh — the scroll-focus viewer used in the left tmux pane
  • docs/verify/archive/demo-v1.* — previous single-pane bash recording, kept for provenance

Reproduce the PreToolUse block manually (works against any active rule card):

mkdir -p .teamagent/rules/active
cp docs/verify/sample-rule.json .teamagent/rules/active/   # or write your own
echo '{"tool_name":"Bash","tool_input":{"command":"npm install moment"}}' \
  | node plugins/teamagent-memory/hooks/pretooluse-enforce.cjs
# → {"decision":"block","reason":"TeamAgent rule …"}

The GIF itself was produced by a live agent driving tmux send-keys + tmux capture-pane step-by-step (no self-driving demo.sh) and recorded via asciinema rec --output-format asciicast-v2 --command 'tmux attach …' --window-size 130x38.


The three plugins

Plugin One-line What's inside
teamagent-memory (the wedge) Capture user-correction → block repeat 3 skills · 3 hooks (PreToolUse · Stop · UserPromptSubmit) · teamagent CLI
teamagent-proof-console Render a CEO-readable proof packet 3 skills · /proof slash command · single-file HTML CEO summary
teamagent-team-sync Promote a personal rule to a team-wide rule 3 skills · 2 hooks (SessionStart git pull · UserPromptSubmit publish-intent)

Read first: teamagent-memory is the only one that's strictly required. The other two are siblings. Install them together if you want the full proof loop.


Plugin architecture

teamagent-marketplace/
├── .claude-plugin/
│   └── marketplace.json                         ← three plugins registered here
├── plugins/
│   ├── teamagent-memory/                        ← the wedge
│   │   ├── .claude-plugin/plugin.json
│   │   ├── skills/
│   │   │   ├── capture-correction/SKILL.md      ← extract rule card from Stop transcript
│   │   │   ├── explain-rule-hit/SKILL.md        ← human explanation of a PreToolUse block
│   │   │   └── review-new-rules/SKILL.md        ← gate pending → active promotion
│   │   ├── hooks/
│   │   │   ├── hooks.json
│   │   │   ├── stop-capture.cjs                 ← Stop hook  (writes rule cards)
│   │   │   ├── pretooluse-enforce.cjs           ← PreToolUse hook (blocks repeats)
│   │   │   └── userprompt-inject.cjs            ← UserPromptSubmit hook (early warn)
│   │   ├── bin/teamagent                        ← CLI: list / approve / reject / show / doctor
│   │   └── README.md
│   ├── teamagent-proof-console/
│   │   ├── skills/{generate-proof-packet,audit-feature-evidence,ceo-proof-summary}/
│   │   └── commands/proof.md                    ← /proof command
│   └── teamagent-team-sync/
│       ├── skills/{publish-team-rule,resolve-rule-conflict,promote-project-rule}/
│       └── hooks/{sessionstart-sync,userprompt-publish}.cjs
└── docs/
    ├── grill-answer.md                          ← office-hours grill (30/30 on both heuristic + LLM judge)
    ├── eval/                                    ← grill eval verdicts (raw JSON)
    └── verify/                                  ← A/B run JSON, stream-json audit, GIF, REPORT

How a rule card looks

The minimum viable artifact. Written by Stop hook, read by PreToolUse hook.

{
  "id":         "1778684027001-moment-to-dayjs",
  "trigger":    "moment",
  "wrong":      "moment",
  "correct":    "dayjs",
  "why":        "no, use dayjs instead, moment is deprecated",
  "confidence": 1,
  "created_at": "2026-05-13T14:53:47.001Z",
  "source":     "stop-capture"
}

trigger is what the new session is matched against. correct is what the rule wants instead. why is always the human's words, never the LLM's — this is the trust anchor.


Verify your install

The four verification surfaces called out in TASK.md:

Command Tells you
claude -h Built-in surface — confirms claude plugin marketplace add works.
claudefast -p "..." Cheap run on a single prompt. Single-shot.
claudefast --output-format=stream-json --include-hook-events -p "..." Audit-level: every hook fired, every additionalContext, every decision: "block".
claudefast --plugin-dir <path> -p "..." A/B test: same prompt, with vs without plugin.

Validation utility scripts also shipped:

# Validate the office-hours grill answer (heuristic gate)
python3 .claude/skills/teambrain-office-hours-grill-eval/scripts/eval_grill_output.py docs/grill-answer.md
# → {"pass": true, "score_total": 30, ...}

# Smoke-test the PreToolUse hook directly against a sample rule
mkdir -p .teamagent/rules/active
cp docs/verify/sample-rule.json .teamagent/rules/active/
echo '{"tool_name":"Bash","tool_input":{"command":"npm install moment"}}' \
  | node plugins/teamagent-memory/hooks/pretooluse-enforce.cjs
# → {"decision":"block","reason":"TeamAgent rule sample-moment-dayjs: ..."}

# Replay the recorded demo cast (asciinema v2)
asciinema play docs/verify/demo.cast

The CEO-readable verification report:

docs/verify/REPORT.md — bundles the rule-card capture, the PreToolUse block proof, the A/B side-by-side, the stream-json audit excerpt, and the heuristic + LLM judge verdicts (both 30/30).


FAQ

Isn't this just a fancier CLAUDE.md?

No. CLAUDE.md is read by the model as text. The model can skip it, forget it, or run the tool call before it gets that far. The wedge here is a hook that fires before the tool call. Two different layers of the runtime.

False positives? What if I actually want to install moment?

Three guardrails:

  1. New rules land in .teamagent/rules/pending/ and require an explicit teamagent approve <id> to enforce.
  2. When a PreToolUse block fires, the reason is shown — the engineer can choose to override.
  3. Low-confidence rules can be downgraded from block to warn-only (multi-suggest mode in teamagent-team-sync).
Does it phone home?

No. All artifacts live under .teamagent/ in your project. Team-sync is opt-in via an explicit remote field in .teamagent/team/config.json, and even then it only pushes/pulls from a git repo you own.

How do I uninstall?
claude plugin disable teamagent-memory
rm -rf .teamagent

Behavior restores in < 5 seconds. This is a written commitment, not a slogan.

What's not in v0?

Boss/CEO live dashboard, video upload, team analytics. Those are roadmap. We deliberately do not ship them in v0 because they create surveillance dynamics that kill adoption (see the grill for the long version).


Acknowledgements

Structure follows the conventions of anthropics/claude-plugins-official and obra/superpowers.

Office-hours grill rubric adapted to the TeamAgent risk surface; the local eval skill lives in .claude/skills/teambrain-office-hours-grill-eval/.


Activity does not equal proof.
The CEO must see a prevented repeat, not a busy dashboard.

About

Claude Code plugin marketplace: capture one Claude's mistake as a rule, block the next Claude from repeating it, render CEO-readable proof. Three sibling plugins (memory wedge / proof-console / team-sync).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages