xdg-spec-compliance
Audit and fix XDG Base Directory compliance in a repo (data/config/cache/state paths, 0700 dirs, 0600 secrets, precedence). Use when the app resolves paths with `expanduser`/`Path.home`, writes logs outside `$XDG_STATE_HOME`, or ships world-readable secrets.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- xdg-spec-compliance
- metadata
- { "tags": [ "linux", "xdg", "packaging", "security", "python", "bash" ] }
- description
- Audit and fix XDG Base Directory compliance in a repo (data/config/cache/state paths, 0700 dirs, 0600 secrets, precedence). Use when the app resolves paths with `expanduser`/`Path.home`, writes logs outside `$XDG_STATE_HOME`, or ships world-readable secrets.
- when-to-use
- Use when auditing a repo's path resolution against the XDG Base Directory spec: relative/tilde rejection, precedence (shell env > XDG file > .env), dir and file permissions, and vendor subdirs.
- argument-hint
- [<repo-root>]
02 资源文件 5
- 参考文档references/audit-order.md1.4 KB
- 参考文档references/bash-installer.md802 B
- 参考文档references/destructive-provisioning.md971 B
- 参考文档references/rules.md1.9 KB
- 参考文档references/testing-sandbox.md1.3 KB
03 SKILL.md 正文
XDG Base Directory Compliance
Audit and fix a repo's path resolution against the XDG Base Directory spec: run the four-step audit order, check the seven rules projects break, and fix the installer, tests, and provisioner where each rule fails.
Global Rules
- Quote the spec, don't reason from memory. The authoritative text is v0.8 at https://specifications.freedesktop.org/basedir/latest/ — three rules are routinely guessed wrong; the rules reference is the single home.
- Reproduce before claiming. Relative/tilde env values and mkdir umask inheritance are invisible to reading alone; the audit order reference ends in a repro step, and no claim rests on reading alone.
- Clean up probe junk. Any file the repro dumps into the repo is removed before the run is done;
git statusmust be clean at the end.
Routing
| Step | Reference | Purpose |
|---|---|---|
| Audit order | references/audit-order.md |
The four cheapest-signal-first checks: path grep, LOG/state location, write/read split, repro. |
| The rules projects break | references/rules.md |
The seven spec rules: absolute-only, empty/unset default, 0700 dirs, 0600 secrets, precedence, vendor subdir, XDG_RUNTIME_DIR. |
| Bash installer | references/bash-installer.md |
Installer rules: absoluteness helper, 0700 tree, venv install, entry points. |
| Test it without touching the user's home | references/testing-sandbox.md |
The import-time sandbox, the asserts, the fake-green guards, and the lazy log handler. |
| Destructive provisioning | references/destructive-provisioning.md |
Stale-dir rename instead of rmtree, and the symlink exfiltration rule. |
04 同仓库更多 Skills
github-workflow
Umbrella for GitHub auth, repo management, issues, PRs, Mergify, and releases. Subsumes github-auth and repo-manager.
brave-automation
baa CLI: Brave profiles, Google sessions, credentials.
aes
AES docs, layers, rule fixes, and legacy migration.
pretext
Build creative browser demos with DOM-free text layout.
popular-web-designs
54 real design systems (Stripe, Linear, Vercel) as HTML/CSS.
p5js
p5.js sketches: gen art, shaders, interactive, 3D.