Skip to content

samples: add pua skill — anti-pattern recovery procedure#305

Open
FMXExpress wants to merge 1 commit into
mainfrom
claude/sample-skill-pua
Open

samples: add pua skill — anti-pattern recovery procedure#305
FMXExpress wants to merge 1 commit into
mainfrom
claude/sample-skill-pua

Conversation

@FMXExpress

Copy link
Copy Markdown
Owner

Summary

Ports tanweai/pua (MIT) as a PasClaw sample skill at samples/skills/pua/SKILL.md. The upstream's framing is humorous; the substance is real — a five-pattern taxonomy of agent failure modes, each with a concrete recovery checklist.

The five anti-patterns the skill addresses:

  1. Brute-force retry — same command, no new info, give up.
  2. Blame-shifting — ask the user without reading the relevant files / logs / errors first.
  3. Idle tools — have the capability, don't use it.
  4. Busywork — rewrite the same function without reading callers or tests.
  5. Passive waiting — fix went green, never ran the verification step that proves it.

For each, the SKILL.md body has a short, concrete recovery procedure using PasClaw's tools.

Port choices

  • Tool-name mapping. PasClaw uses fs_grep / fs_read / shell_exec / execute_code / kb_search / memory_search / session_search / web_search / tool_output_get. Upstream targeted Claude Code's bash / glob / grep. The skill's tool-skip table now lists the PasClaw tools.
  • Drop the hook machinery. Upstream uses Claude Code's SessionStart / PostToolUse / UserPromptSubmit / PreCompact hooks for always-on injection. PasClaw skills load on-demand via fs_read when the model self-diagnoses the trigger conditions — same shape as samples/skills/hello, picoclaw, nanobot, and the rest of the agent-skills ecosystem.
  • Drop the 14 corporate flavours + /pua:p7..p10 role variants. The substance is the five-pattern taxonomy; the cosmetic skinning adds tokens without changing behaviour.
  • Knowledge-only. No kind: in the frontmatter, no skill_pua tool. The model reads the body when one of the five trigger conditions applies.

Smoke test

cp -r samples/skills/pua /tmp/pcl-h/workspace/skills/
PASCLAW_HOME=/tmp/pcl-h pasclaw skills list

shows pua knowledge ~/workspace/skills/pua/SKILL.md with the full description rendered, so the existing skill loader picks it up with no changes.

Files

samples/skills/pua/SKILL.md   # ~165 LOC; frontmatter + body

Test plan

  • YAML frontmatter parses cleanly (name + description, no kind)
  • pasclaw skills list recognises it as a knowledge-only skill
  • End-to-end: install in ~/.pasclaw/workspace/skills/, run a session that hits one of the five trigger conditions, verify the model fs_reads the skill and applies the checklist

Credit

Concept and the five-pattern taxonomy are from https://github.com/tanweai/pua, MIT-licensed. License is preserved via the trailing "Credit" section in the SKILL.md body.


Generated by Claude Code

Port of tanweai/pua (MIT) -- a Claude Code skill that gives the
agent a concrete checklist for getting out of the five most common
"stuck loop" failure patterns:

  1. Brute-force retry (same command, no new info, give up)
  2. Blame-shifting (ask the user without reading the relevant
     files / logs first)
  3. Idle tools (have the capability, don't use it)
  4. Busywork (rewrite the same function without reading callers
     or tests)
  5. Passive waiting (fix went green, never ran verification)

Port adaptations from the upstream:

  * Tool-name mapping. PasClaw uses fs_grep / fs_read / shell_exec
    / execute_code / kb_search / memory_search / session_search /
    web_search / tool_output_get; upstream targeted Claude Code's
    bash + glob + grep. The skill's tool-skip table now lists the
    PasClaw tools so the model doesn't have to translate.

  * Drop the SessionStart / PostToolUse / UserPromptSubmit hooks.
    Claude Code-specific machinery; PasClaw skills load on-demand
    via fs_read when the model decides the trigger conditions
    apply, which fits the agent-skills standard the rest of
    PasClaw's catalogue uses (samples/skills/hello, picoclaw,
    nanobot all share this shape).

  * Drop the 14 "corporate flavour" personalities and the
    /pua:p7..p10 role variants. The substance is the five-pattern
    taxonomy + recovery checklists; the cosmetic skinning isn't
    needed and adds tokens.

  * Knowledge-only -- no `kind:` in the frontmatter, no callable
    skill_pua tool. The model reads the body via fs_read when one
    of the five trigger conditions self-applies. Matches the
    upstream's "on-demand reference" intent; the upstream's
    always-on hook injection is a different mechanism PasClaw
    skills can't directly express anyway.

The trigger conditions are concrete enough that the model can
self-diagnose: same command twice with no new info between calls,
asking the operator before fs_grep'ing, a tool unused this turn
that would clearly apply, three rewrites of the same function
without reading callers, fix-without-verification.

Skill loads cleanly under `pasclaw skills list` -- the existing
loader recognises the knowledge-only shape (kind absent).

Credit + license attribution in the trailing "Credit" section
points at the upstream repo. MIT-licensed both sides.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 94d0e274d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +62 to +63
- [ ] `kb_search` and `memory_search` for the same term — past
sessions may have hit and resolved this.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Qualify kb_search as optional when no KB exists

In a fresh or otherwise unindexed PasClaw install, RegisterKBTools intentionally does not register kb_search/kb_get when the knowledgebase has no sources, but this checklist still requires kb_search before asking any clarification. When this skill is installed in that common context, the model cannot complete the recovery procedure and may loop around an unavailable tool instead of escalating; please make the KB step conditional on the tool being present.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants