Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

chore(skills): add a cleanup step to send-it, sherlock, and triage-enablement

merged#2933CedarCopilot

CedarCopilot wants to merge 0 commits into staging from chore/skills-cleanup-step

Live on prod, watching, 2 days leftTimeline and evidence
  1. Opened
    Sep 24, 2026, 12:54 PM
  2. Merged
    Sep 24, 2026, 12:59 PM
  3. Live on prod
    Sep 24, 2026, 12:59 PM
  4. Observed 2 hours
    Sep 24, 2026, 12:59 PM
  5. Watching

    Live on prod, watching, 2 days left

    Sep 24, 2026, 12:59 PM
  6. Pipelines steady after this deploy
    Sep 24, 2026, 12:59 PM

Libra has no production signal for this change on prod yet. Libra checks hourly for 3 days after each deploy.

What

Adds the same Cleanup block to three skills so a run does not leave scratch files, one-off runners or build outputs in a work tree:

  • send-it: new step 7 "Clean up" (report back is now step 8; the reference in references/monitoring.md is updated)
  • sherlock: new "Cleanup" section before "Output"
  • triage-enablement: new "Cleanup" section, naming the transcript runner and the replay scripts subagents write

The rule

  • Scratch goes in the session scratchpad. If a script must import repo code, it is named _scratch-* and recorded in a manifest when created; subagents list every repo file they create.
  • At the end, delete exactly what the manifest and subagent replies list. Never git clean, git checkout -- ., git reset --hard or git stash: the primary tree regularly holds other in-progress work, and files this run did not create are not this run's to delete.
  • Run git status --short in every tree touched. A worktree this run created must be clean; in the primary tree only what was there at the start may remain. Anything unattributable is reported, not deleted.
  • User-requested deliverables stay and are listed. The final report gets one Cleanup: line.

send-it still keeps its worktree on disk after the PR; cleaning means it holds only the committed change.

Docs-only change to skill files, no runtime code.

Verify

Run /send-it on a small task that needs a scratch script and check the final report's Cleanup: line and that git status in both trees shows nothing unexpected.

🤖 Generated with Claude Code

RetriggerConfidence Score: 4/5

The PR should not merge until triage's delegation prompts make the file inventory needed for cleanup available.

Findings

  1. P1 Delegation prompts omit file inventory ▶
  2. P2 Ignored outputs escape status check ▶
  3. P2 Worktree check runs too late ▶
Fix with agent prompt
### Issue 1
.claude/skills/triage-enablement/SKILL.md:223-224
**Delegation prompts omit file inventory.** During triage, subagents may create replay or eval scripts, but the investigation, playbook-change, and approved-change prompts do not tell them to use `_scratch-*` names or list files they create. The new cleanup deletes only files in the manifest or reported by subagents, so an unreported script can remain in the work tree. Put the file-reporting requirement in the prompts sent to subagents.

### Issue 2
.claude/skills/send-it/SKILL.md:143-146
**Ignored outputs escape status check.** `git status --short` does not show ignored files, including the `apps/server/dist/*.cjs` outputs this cleanup names. If an output is missed from the manifest, the final check can still show a clean tree while the file remains. Check for newly created ignored outputs as well, without deleting files that were already there. The same check appea
Show production surfaces and changed-file mapping

Production surfaces

Libra has not measured any production surfaces for this change yet.

Changed files → surfaces

  • .claude/skills/send-it/SKILL.mdno production surface mapped
  • .claude/skills/send-it/references/monitoring.mdno production surface mapped
  • .claude/skills/triage-enablement/SKILL.mdno production surface mapped
  • apps/server/.claude/skills/sherlock/SKILL.mdno production surface mapped