feat: implement agent-os standards system and feature planning tools
- Split CODING_GUIDELINES.md into 19 indexed standards files under .claude/standards/ - 9 from CODING_GUIDELINES (conventions, powershell, security, api, git, gururmm) - 10 from session log tribal knowledge (syncro, ssh, gitea, python, client, gururmm) - Add .claude/standards/index.yml for cheap relevance-based lookup - Add /inject-standards command: load targeted standards per task instead of full guidelines - Add /shape-spec command: pre-implementation spec for GuruRMM features (plan.md, shape.md, references.md, standards.md) with mandatory out-of-scope gate - Add docs/tech-stack.md and docs/mission.md for ClaudeTools API - Add projects/msp-tools/guru-rmm/docs/tech-stack.md and mission.md for GuruRMM - Update CLAUDE.md commands table with /inject-standards and /shape-spec Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
68
.claude/standards/powershell/tmp-path-windows.md
Normal file
68
.claude/standards/powershell/tmp-path-windows.md
Normal file
@@ -0,0 +1,68 @@
|
||||
---
|
||||
name: tmp-path-windows
|
||||
description: /tmp resolves to different directories in Git Bash vs Write tool on Windows; use .claude/tmp/ instead
|
||||
applies-to: all
|
||||
---
|
||||
|
||||
# /tmp Path Mismatch on Windows
|
||||
|
||||
## The problem
|
||||
|
||||
On Windows, `/tmp` resolves to two different real directories depending on which tool accesses it:
|
||||
|
||||
| Tool | /tmp resolves to |
|
||||
|------|-----------------|
|
||||
| Git Bash / curl | `%LOCALAPPDATA%\Temp\` (e.g., `C:\Users\Howard\AppData\Local\Temp\`) |
|
||||
| Claude Code Write tool | `C:\tmp\` |
|
||||
|
||||
These are different directories. If you write a file with the Write tool to `/tmp/payload.json` and then read it back with curl in a Bash command, curl reads a stale file from a previous session — or a completely different file.
|
||||
|
||||
## Incident that established this rule
|
||||
|
||||
2026-05-01: The Write tool created `/tmp/comment_payload.json` in `C:\tmp\`. curl read `/tmp/comment_payload.json` from `%LOCALAPPDATA%\Temp\` — a stale payload from the previous day's Cascades session. The wrong comment (containing Karen Rossini / ALDOCS content) was posted to a Sombra ticket. The comment could not be deleted via the Syncro API.
|
||||
|
||||
## The fix: use .claude/tmp/ or heredocs
|
||||
|
||||
**Option 1 — Heredoc (preferred for JSON payloads):**
|
||||
|
||||
```bash
|
||||
curl -s -X POST "${URL}" -H "Content-Type: application/json" --data-binary @- <<'JSON'
|
||||
{"key": "value", "other": "data"}
|
||||
JSON
|
||||
```
|
||||
|
||||
No file involved — no path ambiguity. Use `<<'JSON'` for static content and `<<JSON` when you need shell variable interpolation.
|
||||
|
||||
**Option 2 — .claude/tmp/ directory:**
|
||||
|
||||
Both the Write tool and Git Bash agree on the absolute Windows path when you use the repo-relative temp directory:
|
||||
|
||||
```
|
||||
D:/claudetools/.claude/tmp/
|
||||
```
|
||||
|
||||
Write files there using the Write tool, then read them in Bash with `D:/claudetools/.claude/tmp/filename`. Forward slashes work in Git Bash.
|
||||
|
||||
```bash
|
||||
# After writing with Write tool to D:/claudetools/.claude/tmp/payload.json
|
||||
curl -s -X POST "${URL}" -H "Content-Type: application/json" \
|
||||
-d @D:/claudetools/.claude/tmp/payload.json
|
||||
```
|
||||
|
||||
**Option 3 — Python urllib (no file at all):**
|
||||
|
||||
```bash
|
||||
py -c "
|
||||
import urllib.request, json
|
||||
data = json.dumps({'key': 'value'}).encode()
|
||||
req = urllib.request.Request('$URL', data=data, headers={'Content-Type': 'application/json'})
|
||||
print(urllib.request.urlopen(req).status)
|
||||
"
|
||||
```
|
||||
|
||||
## Applies to
|
||||
|
||||
Any workflow where the Write tool creates a file that is subsequently read by a Bash command on Windows. This includes:
|
||||
- Syncro API payloads
|
||||
- PowerShell script files (use .claude/tmp/ or the Write tool with an absolute path)
|
||||
- Any temp file exchange between Write tool and Bash tool
|
||||
Reference in New Issue
Block a user