Skip to content

fix(docs): update --body-file convention to use OS temp directory (#256)#276

Merged
MScottAdams merged 2 commits intomasterfrom
agent1/fix/256-body-file-temp-dir
Apr 10, 2026
Merged

fix(docs): update --body-file convention to use OS temp directory (#256)#276
MScottAdams merged 2 commits intomasterfrom
agent1/fix/256-body-file-temp-dir

Conversation

@MScottAdams
Copy link
Copy Markdown
Collaborator

Summary

Update scm/github.md --body-file convention to write temp files to the OS temp directory instead of the worktree. This eliminates the rm denylist collision that blocks autonomous swarm agents in Warp.

Changes

  • scm/github.md: Added ! rule requiring --body-file temp files in OS temp dir; PowerShell (GetTempFileName) and Unix (mktemp) examples; no explicit rm needed (OS handles cleanup); added anti-pattern against writing temp files in the worktree
  • skills/deft-swarm/SKILL.md: Prompt Template Step 5 note referencing OS temp dir pattern
  • tests/content/test_standards.py: test_body_file_os_temp_dir_guidance covering PS + Unix patterns
  • SPECIFICATION.md: t1.13.2 acceptance criteria filled in
  • CHANGELOG.md: Entry under [Unreleased]

Closes #256
Spec task: t1.13.2


This PR body was written to a temp file in c:\temp -- practicing the convention it implements.

- scm/github.md: --body-file temp files must be written to OS temp dir
  (GetTempFileName/mktemp), not worktree
- No explicit rm needed -- OS handles cleanup; eliminates rm denylist
  collision blocking swarm agents in Warp autonomous mode
- Added PowerShell and Unix examples with BOM-safe write pattern
- Added anti-pattern against writing temp files inside the worktree
- skills/deft-swarm/SKILL.md Prompt Template Step 5: note OS temp dir
  pattern for --body-file
- tests/content/test_standards.py: coverage for OS temp dir guidance
- SPECIFICATION.md: t1.13.2 acceptance criteria filled in
- CHANGELOG.md: entry under [Unreleased]
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 10, 2026

Greptile Summary

This PR updates the --body-file convention in scm/github.md to require writing temp files to the OS temp directory (via GetTempFileName/mktemp) instead of the worktree, resolving a rm denylist collision that blocks autonomous swarm agents in Warp. It also updates skills/deft-swarm/SKILL.md Step 5, adds a targeted test, and fills in the SPECIFICATION.md t1.13.2 acceptance criteria.

Confidence Score: 5/5

Safe to merge — documentation-only change with well-structured examples and adequate test coverage.

All five changed files are documentation or tests; the only code is a new pytest assertion. The sole finding (P2 style) is about echo vs printf in an illustrative code snippet and does not block merge. All t1.13.2 acceptance criteria are met.

No files require special attention.

Important Files Changed

Filename Overview
scm/github.md Added ! rule requiring OS temp dir for --body-file, with PowerShell (GetTempFileName) and Unix (mktemp) examples and a anti-pattern; new rules are internally consistent with existing file content.
skills/deft-swarm/SKILL.md Added OS temp directory note to Prompt Template STEP 5 referencing $env:TEMP/$TMPDIR//tmp; wording is accurate and consistent with scm/github.md guidance.
tests/content/test_standards.py Added test_body_file_os_temp_dir_guidance asserting GetTempFileName and mktemp are present in scm/github.md; straightforward string-presence assertions matching acceptance criteria.
CHANGELOG.md Entry added under [Unreleased] for #256/t1.13.2 following existing format conventions; no issues found.
SPECIFICATION.md t1.13.2 acceptance criteria filled in and marked [completed]; criteria match what was actually implemented in scm/github.md and SKILL.md.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Agent needs PR body longer than one line] --> B{Platform?}
    B -- Windows/PowerShell --> C[GetTempFileName creates file in env:TEMP]
    B -- Unix bash/zsh --> D[mktemp creates file in TMPDIR or /tmp]
    C --> E[WriteAllText with UTF8-no-BOM encoding]
    D --> F[Write content to temp file]
    E --> G[gh pr create --body-file tempfile]
    F --> G
    G --> H[PR created successfully]
    H --> I[No explicit rm needed]
    I --> J[No rm denylist collision in Warp autonomous mode]

    style J fill:#90EE90,color:#000
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: scm/github.md
Line: 23-25

Comment:
**`echo` may misinterpret flag-like content**

If a PR body happens to begin with `-n` or `-e`, bash's `echo` builtin treats those as flags (suppresses newline / enables escape sequences), silently corrupting the file. `printf '%s\n'` is the POSIX-portable alternative that never interprets the value as flags.

```suggestion
    bodyFile=$(mktemp)
    printf '%s\n' "$content" > "$bodyFile"
    gh pr create --title "feat: example" --body-file "$bodyFile"
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (2): Last reviewed commit: "fix: address Greptile review findings (b..." | Re-trigger Greptile

- SPECIFICATION.md: flip t1.13.2 status from [pending] to [completed]
- scm/github.md: tighten Windows temp cleanup wording -- %TEMP% is not
  auto-cleaned on Windows; key benefit is avoiding rm denylist collision
@MScottAdams MScottAdams merged commit 59550dc into master Apr 10, 2026
9 checks passed
@MScottAdams MScottAdams deleted the agent1/fix/256-body-file-temp-dir branch April 10, 2026 01:39
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.

fix(docs): use system temp directory for --body-file to avoid rm denylist collision

1 participant