name: apply-artifacts
description: Safely parse and apply ## ARTIFACTS blocks from planning outputs into repository files with strict path validation and atomic writes. Use when a workflow response contains artifact payloads (for PRD/PSD/master plan/feature plan/PR plan/change-review outputs) that must be written exactly as provided.
Apply Artifacts
Apply planning artifacts deterministically and report exactly what changed.
Workflow
- Confirm input contains an
## ARTIFACTSsection with one or more### <relative/path>headers. - Save the full planning output to a temporary input file.
- Run
scripts/apply_artifacts.pyagainst the target repository root. - Return the script report verbatim.
- If validation fails, stop and ask for corrected artifacts.
Run
python3 "$HOME/.codex/skills/apply-artifacts/scripts/apply_artifacts.py" \
--input /tmp/artifacts-input.md \
--root /path/to/repo
Use --check to validate without writing files.
Rules
- Write only files listed under
## ARTIFACTS. - Require relative paths only.
- Reject path traversal (
../,..\\), home shortcuts (~/), absolute paths, URL-like paths, and duplicate artifact targets. - Create parent directories when needed.
- Replace file contents atomically.
- Do not rewrite or "improve" artifact content.
Output
Expect Markdown sections:
Applied ArtifactsDirectories CreatedWarningsNotes
References
- Artifact format and edge-case guidance:
references/artifact-format.md