Skip to content

fix(skills): merge temp-file cleanup into approved command chain — eliminate repeated rm permission prompts #1204

@akaszubski

Description

@akaszubski

Summary

Skills that create temp files (/create-issue, /plan, /plan-to-issues, /improve) instruct a separate standalone rm cleanup Bash call, triggering a user permission prompt every time — rm is never auto-allowed, and compound commands require every segment allowed. User hits repeated prompts in every planning/filing flow.

Implementation Approach

Durable fix at the skill level — cleanup rides the SAME Bash invocation as the file-consuming command, so the single create-approval covers it:

  1. MODIFY plugins/autonomous-dev/commands/create-issue.md (Quick Steps 4-5): create command becomes gh issue create --title ... --body-file /tmp/create_issue_body_${RUN_TS}.md; rm -f /tmp/create_issue_body_${RUN_TS}.md /tmp/autonomous_dev_cmd_context.json. Remove standalone cleanup step.
  2. MODIFY plugins/autonomous-dev/commands/plan.md (STEP 6): per-issue create ends with trailing cleanup of its own temp file; final create also removes the context file.
  3. MODIFY plugins/autonomous-dev/commands/plan-to-issues.md (STEPs 4-5): same pattern; drop standalone Cleanup bullets.
  4. MODIFY plugins/autonomous-dev/commands/improve.md (STEP 5): same pattern for context-file cleanup.
  5. Keep unique RUN_TS temp suffixes (collision safety; a missed cleanup is harmless on tmpfs).
  6. Decide at plan time: optional companion scoped allow rules in settings templates (Bash(rm -f /tmp/plan_issue_*) etc.) for immediate relief on existing installs.

Test Scenarios

  1. Happy path: /create-issue --quick run end-to-end produces at most ONE Bash permission prompt (the create itself).
  2. Grep-locked regression: no commands/*.md instructs a standalone rm Bash call for its own temp files.
  3. Failure path: gh create fails — trailing cleanup still executes (command chain uses ; not && for the rm segment).
  4. Collision safety: two concurrent runs use distinct RUN_TS files; neither removes the other's temp file.
  5. Context-file lifecycle: removed exactly once at flow end; mid-flow steps that need it still find it.

Acceptance Criteria

  • No skill instructs a standalone rm Bash call for its own temp files (grep-locked test across commands/*.md)
  • Cleanup verified to ride the same Bash invocation as the consuming command
  • ; chaining ensures cleanup runs even when the create fails
  • RUN_TS unique-suffix convention documented in each modified skill
  • End-to-end /create-issue --quick completes with at most one Bash permission prompt

Origin: user-reported friction 2026-06-11 ("writing and deleting plans keeps asking for permissions"). Durable fix explicitly requested over settings allow-rules.
Plugin Version: 3.50.0 (c41558b)

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-improvementContinuous improvement analyst findingsenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions