fix(docs): update --body-file convention to use OS temp directory (#256)#276
fix(docs): update --body-file convention to use OS temp directory (#256)#276MScottAdams merged 2 commits intomasterfrom
Conversation
- 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 SummaryThis PR updates the Confidence Score: 5/5Safe 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 No files require special attention. Important Files Changed
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
Prompt To Fix All With AIThis 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
Summary
Update
scm/github.md--body-fileconvention to write temp files to the OS temp directory instead of the worktree. This eliminates thermdenylist collision that blocks autonomous swarm agents in Warp.Changes
!rule requiring--body-filetemp files in OS temp dir; PowerShell (GetTempFileName) and Unix (mktemp) examples; no explicitrmneeded (OS handles cleanup); addedanti-patternagainst writing temp files in the worktreetest_body_file_os_temp_dir_guidancecovering PS + Unix patternsCloses #256
Spec task: t1.13.2
This PR body was written to a temp file in
c:\temp-- practicing the convention it implements.