---
name: artifact-guard-workflow
description: Use when an AI coding task may create temporary artifacts. Starts ArtifactGuard before work, checks status during the session, and runs cleanup reporting or safe deletion before the final response.
---

# ArtifactGuard Workflow

Use this skill when a task may create, download, extract, copy, or generate temporary files.

## Start

At the beginning of artifact-producing work, run:

```bash
npx -y artifact-guard start
```

This records the baseline workspace snapshot.

## During Work

If you need to inspect what changed, run:

```bash
npx -y artifact-guard status
```

Treat categories as follows:

- `Source changes`: intended project edits; summarize normally.
- `Temporary artifacts`: safe cleanup candidates if they were created during the session.
- `Sensitive / needs review`: never auto-delete silently; confirm handling or report deletion if explicitly removed.
- `Deliverables`: keep and report path.
- `Unknown`: review manually before deleting.

## Finish

Before the final response, run:

```bash
npx -y artifact-guard finish
```

If the user has approved automatic safe cleanup, or the task policy allows it, run:

```bash
npx -y artifact-guard finish --delete-safe
```

If the user wants to review each safe cleanup candidate, run:

```bash
npx -y artifact-guard finish --interactive
```

Both cleanup modes apply only to files classified as both:

- `temporary`
- `created`

They do not delete modified files, source files, deliverables, sensitive files, or unknown files. `--interactive` asks before deleting each safe candidate.

## Final Response

Include one concise cleanup line:

- `Cleanup: deleted safe temporary artifacts with ArtifactGuard.`
- `Cleanup: no temporary artifacts detected.`
- `Cleanup: kept <path> because <reason>.`
