Skip to content
Skills Library
AI & agents · Automation

artifact-path

/artifact-path

Internal skill for commands. Resolve a unique, task-scoped, collision-safe path for an artifact written under .lets/ (plans, reviews, session snapshots, hand-off briefs, per-run agent report directories). Do not trigger on user conversation - only when a command is about to write an artifact.

Licence
MIT
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Internal skill for commands. Resolve a unique, task-scoped, collision-safe path for an artifact written under .lets/ (plans, reviews, session snapshots, hand-off briefs, per-run agent report directories). Do not trigger on user conversation - only when a command is about to write an artifact.

Original author description

Internal skill for commands. Resolve a unique, task-scoped, collision-safe path for an artifact written under .lets/ (plans, reviews, session snapshots, hand-off briefs, per-run agent report directories). Do not trigger on user conversation - only when a command is about to write an artifact.

How it works

  1. Name shape
  2. Step 1: Resolve the task id
  3. Step 2: Compute the path
  4. Return
  5. Rules
Original SKILL.md headings · 76 lines, 558 words
SKILL.md preview
---
name: artifact-path
description: Internal skill for commands. Resolve a unique, task-scoped, collision-safe path for an artifact written under .lets/ (plans, reviews, session snapshots, hand-off briefs, per-run agent report directories). Do not trigger on user conversation - only when a command is about to write an artifact.
user-invocable: false
---

# Artifact Path

`.lets/` is ONE directory shared by every worktree of the repo (whole-dir symlink). Two sessions writing the same artifact kind on the same day used to overwrite each other (lets-05c4s - a plan review was lost). This skill is the single place that names an artifact and guarantees the path is free.

**Contract:** args `kind=<kind> ext=<md|json|dir> [task=<task-id>]`. Output: ONE echoed line `ARTIFACT_FILE=<absolute path>`. The caller writes to that path VERBATIM - never recomputes the stamp, never strips the `-vN` suffix, never writes anywhere else. `ext=dir` CREATES the directory (the `mkdir` is the claim) and echoes its path; a file kind only names a free path.

## Name shape

`{YYYY-MM-DD}-{HHMM}-{ID}-{KIND}[-vN].{EXT}` under the kind's directory:

| kind | directory |
|------|-----------|
| `plan` | `.lets/plans/` |
| `idea` | `.lets/plans/` |
| `review-local`, `review-branch`, `review-pr-<n>`, `review-plan` | `.lets/reviews/` |
| `snapshot` | `.lets/sessions/` |
| `handoff` | `.lets/handoffs/` |
| `reports-<command>` (with `ext=dir`) | `.lets/reports/` - one directory per dispatching run, filled by the `agent-report` skill |

`ID` is the task id when one is active (MANDATORY whenever a task exists - same rule as the branch named by the active tracker convention). With no task: `{branch-slug}-{6hex}`, 6hex = first 6 chars of `$CLAUDE_CODE_SESSION_ID`, so two taskless sessions on `main` still get distinct names. `-vN` (v2, v3, ...) is appended whenever the path already exists - for task and taskless alike.

## Step 1: Resolve the task id

If the caller passed `task=`, use it. Otherwise invoke `Skill(skill: "lets:detect-task", args: "fallback=no")` and use its result (may be empty). `fallback=no` is mandatory: the searched fallback asks a question, and a taskless snapshot on `/lets:end` must stay silent.

## Step 2: Compute the path

```bash
LETS_PROJECT_ROOT=$(git rev-parse --show-toplevel)
KIND="{kind}"; EXT="{ext}"; TASK_ID="{task-id or empty}"
case "$KIND" in
  plan|idea) DIR=plans ;;
  review-*) DIR=reviews ;;
  snapshot*) DIR=sessions ;;
  handoff) DIR=handoffs ;;
  reports-*) DIR=reports ;;
  *) echo "artifact-path: unknown kind '$KIND'"; exit 1 ;;
esac
mkdir -p "$LETS_PROJECT_ROOT/.lets/$DIR"
STAMP=$(date +%Y-%m-%d-%H%M)
if [ -n "$TASK_ID" ]; then
  ID="$TASK_ID"
else
  HEX=$(printf '%s' "${CLAUDE_CODE_SESSION_ID:-$$}" | cut -c1-6)   # session-id prefix; PID outside Claude Code
  ID="$(git branch --show-current | tr '/' '-')-${HEX}"
fi
BASE="$LETS_PROJECT_ROOT/.lets/$DIR/${STAMP}-${ID}-${KIND}"
N=2
if [ "$EXT" = dir ]; then
  # mkdir without -p is atomic: two sessions in the same minute get two directories, never one shared
  ARTIFACT_FILE="$BASE"
  until mkdir "$ARTIFACT_FILE" 2>/dev/null; do
    [ -e "$ARTIFACT_FILE" ] || { echo "artifact-path: cannot create $ARTIFACT_FILE"; exit 1; }
    ARTIFACT_FILE="${BASE}-v${N}"; N=$((N+1))
  done
else
  ARTIFACT_FILE="${BASE}.${EXT}"
  while [ -e "$ARTIFACT_FILE" ]; do ARTIFACT_FILE="${BASE}-v${N}.${EXT}"; N=$((N+1)); done
fi
echo "ARTIFACT_FILE=$ARTIFACT_FILE"
```

## Return

Return the echoed `ARTIFACT_FILE` to the caller. If the echo is missing or `exit 1` fired, the caller MUST NOT write anything - surface the error.

## Rules

- NEVER overwrite: the loop is the guard; the caller never "fixes" a path by hand.
- `ext=dir`: the directory exists when the echo returns; the caller never creates or renames it.
- NEVER compute a second `date` in the caller - the stamp is captured here once.
- Task id in the name is mandatory when a task is active.
- No tracker calls here beyond `detect-task`.
- Go-owned state files are NOT artifacts and never come through here: `.lets/sessions/.task-*` (`lets worktree task-state`), `.lets/sessions/peers/last/*.last` (`lets peers who` / `orchestrator`; a legacy `.lets/sessions/peers/*.role` is never read or written), `.lets/cache/released-*` (`lets worktree release`), and `.lets/cache/ask-ro-mcp-empty.json` - their owner writes them.

Versions

The database has no other skills named artifact-path.

Database snapshot: 13.11.2026 · package version e87161e49123 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100session-snapshot
    Internal skill for commands. Write a recovery-grade session snapshot (file-primary) for /lets:end and for the --session snapshot-only flag of /lets:end and /lets:note. Always writes a .lets/sessions/ file; adds a one-line task pointer only when a task is unambiguously active. Do…
  • 100member-run
    Internal skill for commands. Spawn, hand the next brief to, correct, dismiss or wait for the round report of ONE named member - any lets:* role - of a team or an execute run; the caller's record (the execute run record, the team file) is the record, and ListAgents judges who is…
  • 100reviewing-artifact-conventions
    Reviews a standardized non-source artifact against its own published "well-formed X" standard rather than as application code — the artifact review shape (D15), presence-activated. On detecting a supported artifact it loads that artifact''s rubric and reviews against it.…
  • 100fs-handoff
    User-invoked slash command: run ONLY when the user types /fs-handoff; never choose it on your own. Slash-command closer (/fs-handoff) for a FoundationSkills session: takes this session's artifact JSON paths, optional notes and next_steps and writes ONE handoff artifact that…
  • 100artifact
    Create and manage artifact.json for task outputs. Use when creating code files, documentation, or any files that should be tracked as artifacts.
  • 90artifact-use
    Use when the user asks to publish, share, review, gate, get a link for, or check stats on agent output (self-contained HTML tools, dashboards, static folders, images, PDFs) through Artifact Use, or to read and resolve reviewer comments on a published artifact. Covers the hosted…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.