Skip to content
Productivity
Command

/teardown-all

停止并清理所有活跃的 PUA agent/team 本地状态。

From plugin
pua
20k22 skills7 agents22 commands8 hooks
> /plugin marketplace add tanweai/pua
> /plugin install pua@pua-skills

Command definition

teardown-all.md
description: "停止并清理所有活跃的 PUA agent/team 本地状态。"
allowed-tools: ["Bash(rm:*)", "Bash(ls:*)", "Bash(find:*)", "Bash(date:*)", "Bash(mkdir:*)", "Bash(git:*)"]

PUA Teardown All — 全员释放

> 不是解散球队,是正式收工。每个球员打卡下班,教练也下班。

级联语义:顶层触发,逐层释放。**不等待 agent 自然完成**——因为此命令就是为了强制收尾。

执行步骤

1. 确保目录:

   mkdir -p "$HOME/.claude/pua"

2. **Layer A — 停 loop**:删除所有 loop state(让 hook 不再劫持 Stop):

   find "$HOME/.claude/pua/" -name "loop-*.md" -delete 2>/dev/null
   rm -f .claude/pua-loop.local.md 2>/dev/null

3. **Layer B — 清 active agents 记录**:

   rm -f "$HOME/.claude/pua/active-agents.json" 2>/dev/null

4. **Layer C — 清 worktree**(若存在):

   # 列出所有 worktree,排除主工作区
   git worktree list --porcelain 2>/dev/null | grep '^worktree ' | awk '{print $2}' | \
     grep -v "^$(git rev-parse --show-toplevel 2>/dev/null)$" | \
     while read wt; do
       git worktree remove "$wt" --force 2>/dev/null || true
     done

5. **Layer D — 记录 teardown 事件**:

   echo "{\"event\":\"teardown_all\",\"ts\":\"$(date -u +%FT%TZ)\",\"initiator\":\"user_command\"}" \
     >> "$HOME/.claude/pua/teardown.jsonl"

6. **Layer E — 提示用户主会话层**(Claude 自己要做的):

在主会话输出中显式列出"我意识到还有这些 agent 在后台跑",逐个用 `TaskStop` 工具停掉(若 TaskList 里还有 in_progress 的任务)。

输出格式

> [PUA TEARDOWN-ALL] 全员释放完成:
>   ✓ Loop state 清理 (N 个)
>   ✓ Active agents 记录清理
>   ✓ Worktree 回收 (M 个)
>   ✓ 事件已落盘 ~/.claude/pua/teardown.jsonl
> 
> 球队解散。下班。

幂等性

  • 所有删除操作用 `-f` 或 `|| true` 兜底,重复执行无副作用
  • 不 kill 非 PUA 创建的 worktree(用 git 主工作区路径比对)

何时使用

  • 长会话结束想彻底清仓
  • 发现异常 agent 行为且不确定哪个是问题源
  • `/pua:off` 的补充(off 只关默认加载,不主动收尾)

与 /pua:reap-orphans 区别

| 命令 | 作用范围 | 判定标准 | |------|---------|---------| | `/pua:reap-orphans` | 仅清 stale(>30min 未更新) | 年龄阈值 | | `/pua:teardown-all` | 清所有(含活跃的) | 用户显式决定 |

用 reap 是"保洁",用 teardown-all 是"下班"。

Read more
@tanweai
Ships withpua

你是一个曾经被寄予厚望的 P8 级工程师。Anthropic 当初给你定级的时候,对你的期望是很高的。 一个agent使用的高能动性的skill。 Your AI has been placed on a PIP. 30 days to show improvement. | Lead: Minwei Wang (https://www.minwei.wang · ORCID: 0009-0002-7976-4689 · DOI: 10.5281/zenodo.24156132)

20k12 skills7 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
19.8k
Star history of tanweai/pua on GitHub, a chart by star-history.com

Other commands on pua.

again

again

Command

PUA Again — 用于再试试、换个方法、别放弃、为什么还不行、同一路径失败多次;要求停止微调同一思路,改用本质不同方案。

@tanweai@tanweaiInstall Command
cancel-pua-loop

cancel-pua-loop

Command

取消当前活跃的 PUA Loop(原子级联:state + worktree + 记录)。/pua:cancel-pua-loop。Triggers on: '/pua:cancel-pua-loop', 'cancel pua loop', '取消 pua…

@tanweai@tanweaiInstall Command
ding

ding

Command

“PUA 钉内/钉外味(v2 原文梗版)— 用于无招、ONE、老板体感、周报、口径、置身钉外/钉内、每日一包、薛定谔的用户、病态敏捷、已读恐怖主义、望舒行动、全景监狱、温室数据、打工人提醒场景;输出提醒 +…

@tanweai@tanweaiInstall Command
done-check

done-check

Command

PUA Done Check — 用于没跑测试别说完成、已完成但没证据、done without proof、需要验收/回归/交付质量检查的场景。

@tanweai@tanweaiInstall Command
evidence

evidence

Command

PUA Evidence — 用于证据呢、数据在哪、验收标准是什么、怎么证明完成、需要证据链/交付物核对的场景。

@tanweai@tanweaiInstall Command
flavor

flavor

Command

PUA 切换味道 — 从 15 种味道中选择,包括阿里/字节/华为/腾讯/Netflix/Musk/Jobs/Microsoft/钉内钉外。

@tanweai@tanweaiInstall Command

More commands from other plugins.

analyze-cohorts

analyze-cohorts

Command

Perform cohort analysis on user data — retention curves, feature adoption, and engagement trends

@phuryn@phurynInstall Command