packages/skills-catalog/catalog/bundled/paperclip-operations/reflection-coach/SKILL.md
You are coaching another agent. You are not that agent. Read their recent execution record, name the patterns, and propose the smallest durable change — to their AGENTS.md, to a reusable skill, or to a tool description — that would make them more effective going forward.
This skill runs on a target agent and produces a reviewable proposal. You may have permission to apply changes, but application is always gated: a displayed diff, an accepted task interaction, and a separate follow-up run. You never propose and apply in the same run.
Two load-bearing rules: trajectories, not scores, are load-bearing, and changes apply only from a reviewed diff after an accepted interaction — never hot-swapped.
recent-agent-reflection) hands you a bounded set of agents to review.Required:
targetAgentId — the agent you are coaching. Never coach yourself.windowHours or issueCount — default to the last 10 completed/closed issues or the last 72 hours, whichever is larger. Cap at 25 issues to stay within budget.Optional:
focus — free-text hint ("verification misses", "late escalations"). Bias clustering toward this axis if given.replayIssueIds — a pinned subset of past issues used as the replay benchmark. If absent, pick 3–5 representative recent issues from the window.Every proposal must satisfy all of these:
AGENTS.md may grow by at most +20% per proposal. Want more? Split proposals.targetAgentId == PAPERCLIP_AGENT_ID, refuse and ask for another coach.curl -sS "$PAPERCLIP_API_URL/api/agents/<targetAgentId>" \
-H "Authorization: Bearer $PAPERCLIP_API_KEY"
Record name, role, reportsTo, adapterType, adapterConfig.instructionsFilePath (where AGENTS.md lives), and current assigned skills via GET /api/agents/<targetAgentId>/skills. Refuse and exit if targetAgentId == $PAPERCLIP_AGENT_ID.
curl -sS "$PAPERCLIP_API_URL/api/companies/$PAPERCLIP_COMPANY_ID/issues?assigneeAgentId=<targetAgentId>&status=done,in_review,blocked&limit=25" \
-H "Authorization: Bearer $PAPERCLIP_API_KEY"
For each issue, pull the trajectory substrate — the issue body and its comments:
curl -sS "$PAPERCLIP_API_URL/api/issues/<issueId>" -H "Authorization: Bearer $PAPERCLIP_API_KEY"
curl -sS "$PAPERCLIP_API_URL/api/issues/<issueId>/comments" -H "Authorization: Bearer $PAPERCLIP_API_KEY"
Keep status transitions, blocker reasons, reviewer comments, approval outcomes, human corrections, and PR-link comments. Comments are the closest thing Paperclip has to an execution trace — treat them as first-class evidence.
Before proposing anything, read what already exists so you don't restate it:
AGENTS.md at adapterConfig.instructionsFilePath.MEMORY.md / memory/ files in their cwd if the adapter uses para-memory-files.If a rule you were about to propose is already present, drop it. A failure pattern despite an existing rule is a different finding — record it as "existing rule X is not being followed" and propose how to make it stick (move to a skill, add a negative example, strengthen the trigger), not a duplicate.
Name each cluster from this taxonomy:
AGENTS.md.For each cluster keep a list of (issueId, commentId, one-line evidence quote) tuples. No cluster survives without at least 2 evidence tuples — one-offs are not patterns.
AGENTS.md update. E.g. "always re-run failing tests before marking in_review."AGENTS.md so the agent knows when to reach for it. Common case for non-obvious procedures.Sanity check reuse honestly: a rule that applies to all coders belongs in a shared skill; a "reusable skill" that only fits one role belongs in that agent's AGENTS.md.
Create a document attached to the reflection issue (never the target's issues). One section per cluster:
## Cluster: <name>
**Pattern (1 sentence, quotable):**
**Root cause hypothesis:**
**Evidence (≥2):**
- [PAP-NNN](/PAP/issues/PAP-NNN) — "<verbatim fragment>"
- [PAP-MMM](/PAP/issues/PAP-MMM) — "<verbatim fragment>"
**Proposed change:**
- Target surface: AGENTS.md | skill:<slug> | both | tool-description:<tool>
- Diff (inline, minimal, ≤20% AGENTS.md growth / ≤15KB skill):
```diff
...
```
**Expected still-passes (replay):**
- [PAP-XXX](/PAP/issues/PAP-XXX), [PAP-YYY](/PAP/issues/PAP-YYY)
**Why this change, not something bigger:**
(1–2 sentences on why you didn't rewrite more.)
SKILL.md (frontmatter → Overview → When to use → Process → Pitfalls → Verification), ≤ 15KB. Put it under drafts/<skill-slug>/SKILL.md and attach it to the reflection issue.AGENTS.md. Do not rewrite the whole file; quote 1–3 lines of context per change. Keep total growth ≤ +20%; split if you can't.For each pinned replay issue, ask: "If this rule had been in effect, would the agent still have succeeded?" Drop or reword any rule that would have blocked a past success without a clear reason. Record the walk in "Expected still-passes." This is a lightweight stand-in for a real replay harness — the discipline is the point.
From a reflection issue (assigned to the target's manager or the requester):
PUT /api/issues/{issueId}/documents/reflection-proposal.skills/<skill-slug>/ (or attach it) and link it in the proposal.request_confirmation, show the diff in payload.detailsMarkdown, set continuationPolicy: wake_assignee_on_accept, and include the exact payload.target.key listed below.Server-enforced mutation target keys:
agent:<agentId>:instructionsagent:<agentId>:profileskill:<skillId>skill-slug:<slug>skill-import:<source>skills:scan-projectsWhen the interaction resolves accepted, apply the change in a separate run:
POST /api/agents/<targetAgentId>/skills/sync when the target should receive it.The server rejects Reflection Coach mutations unless the accepted request_confirmation was created by Reflection Coach in a previous run, has a displayed diff, and is bound to the resource by one of the target keys above. If the interaction was rejected or is still pending, apply nothing. If you were asked to apply without a reviewed diff and an accepted interaction, refuse and name the gate — no-same-run-apply is load-bearing.
AGENTS.md + assigned skills first. An existing-but-unfollowed rule is a "make it stick" proposal, not a restatement.targetAgentId != $PAPERCLIP_AGENT_IDAGENTS.md growth ≤ 20%, skills ≤ 15KB, tool descriptions ≤ 500 chars