temp-storage-and-build-hygiene

Enforce repository-scoped temp directory isolation and pre-build cleanup across CI/CD workflows.

Updated May 16, 2026
One-click install
npx skills add https://github.com/alimtvnetwork/img-pdf-v2 --skill temp-storage-and-build-hygiene-alimtvnetwork
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: temp-storage-and-build-hygiene
Source: https://github.com/alimtvnetwork/img-pdf-v2/tree/main/.agents/skills/temp-storage-and-build-hygiene
Command: npx skills add https://github.com/alimtvnetwork/img-pdf-v2 --skill temp-storage-and-build-hygiene-alimtvnetwork

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Builds and tests often scatter temporary files across the OS temp directory, accumulate stale binaries that waste disk space, and CI pipelines can exhaust shared artifact storage quotas. This Skill enforces a consistent, repository-scoped temp storage policy so builds stay clean and storage is reused efficiently. ## Core Features & Use Cases - Repository-Scoped Temp Namespacing: Routes all temporary files into dedicated subdirectories under <temp>/gitmap/ (build, test, purge, downloads, handoff, sandbox) instead of polluting the OS temp root. - Mandatory Pre-Build Cleanup: Wipes previous build artifacts (bin/gitmap.exe and <temp>/gitmap/build/) before every go build, goreleaser, or CI runner invocation. - CI Artifact Ban: Prohibits actions/upload-artifact in CI workflows to protect the 0.5 GB free-tier GitHub Actions storage quota, reserving binaries for GitHub Releases. - Use Case: When adding a new Go build step or Python CI runner script, apply this Skill to direct GOTMPDIR/TMPDIR into the repo-scoped temp folders and clear stale binaries before compiling. ## Quick Start Apply the temp storage and build hygiene rules to isolate all temp files under the repository-scoped gitmap directories and clean build artifacts before compiling.

Frequently Asked Questions about temp-storage-and-build-hygiene

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I isolate temporary files in a Go project?

Use a helper like tempdir.RepoTempDir(subdirs) that namespaces all paths under a repository-scoped folder inside os.TempDir(). Direct GOTMPDIR to the build subdirectory and TMPDIR/TEMP/TMP to the test subdirectory so nothing lands loose in the OS temp root.

How to clean build artifacts before compiling in CI?

Delete the target binary and the build temp directory before every go build, goreleaser, or CI runner invocation. This wipe-before-write approach prevents stale binaries from accumulating and reuses disk storage on every build run.

Why avoid actions/upload-artifact in GitHub Actions CI?

Free-tier GitHub accounts share a 0.5 GB artifact storage quota across all repositories. Multi-platform matrix builds uploading binaries can exhaust this quota and block all subsequent workflow runs, so CI should build only to verify compilation and publish binaries via GitHub Releases instead.

Where should Python build scripts write temporary files?

Define a helper returning Path(tempfile.gettempdir()) / "gitmap" / subdir so all downloads, sandboxes, and test runtimes stay in repository-scoped folders. Set GOTMPDIR to the build subfolder and TMPDIR/TEMP/TMP to the test subfolder before invoking compilers.

Can I create a .tmp folder in the repository root?

No, root-level .tmp directories are banned under this policy. Repository-internal temporary files must be isolated inside .ai-memory/temp/, such as .ai-memory/temp/failures/ for failure logs.