Skip to content
Back to skills

Source Snapshot

ASecurity

Pin and inspect fresh, exact Git source snapshots for read-only code analysis without touching the user's working tree.

  • 2 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 2, 2026
ai-agentsnodegitapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 2, 2026

npx -y skills add Cherwayway/agent-context-patch --skill source-snapshot --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Source Snapshot?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Source Snapshot
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/cherwayway-source-snapshot/badge)](https://www.skillsdirectory.com/skills/cherwayway-source-snapshot)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: source-snapshot
description: Pin and inspect fresh, exact Git source snapshots for read-only code analysis without touching the user's working tree.
---

# Source Snapshot

Use this skill when a task asks about current or latest repository code, an
exact remote ref, or a read-only code review whose conclusions depend on source
freshness.

Do not treat the primary checkout, local `main`, or a local remote-tracking ref
as current merely because it exists. Resolve the requested source against the
remote, pin its exact commit, and analyze only the resulting snapshot.

## Workflow

Run the bundled CLI relative to this skill directory:

```text
node scripts/agent-source.mjs resolve --repo <repository> --ref <full-ref>
node scripts/agent-source.mjs snapshot --receipt <source-receipt-path>
node scripts/agent-source.mjs close --receipt <snapshot-receipt-path>
```

`resolve` currently supports exact full remote refs such as
`refs/heads/main` and `refs/pull/123/head`. It compares `git ls-remote` with the
commit fetched into a workspace-external bare cache. A mismatch or unavailable
remote fails closed.

`snapshot` exports the pinned commit into a task-owned temporary directory,
rejects submodules and escaping symlinks, records an integrity digest, and
makes the extracted tree read-only. It never reads files from the user's
working tree.

`close` verifies the digest before cleanup. It removes only the task-owned
session and cache ref. If the snapshot changed, it retains the session and
reports the integrity failure instead of deleting evidence.

Always close a source receipt when snapshot creation fails:

```text
node scripts/agent-source.mjs close --receipt <source-receipt-path>
```

## Claims And Boundaries

- Report the source mode, remote ref, exact commit SHA, resolution time, and
  snapshot method with the analysis.
- If `resolve` did not succeed, do not describe cached or local code as latest.
- The guarantee is workspace-read-only, not system-wide zero-write: the CLI
  writes only its external Git cache and task-owned temporary session.
- Dependency installation, builds, generators, and tests are outside this
  read-only snapshot mode. Use a separately authorized isolated verification
  environment for them.
- A deployed revision is not the same as remote `main`; first obtain an exact
  deployed ref or SHA from a project-specific deployment resolver.

Files in this skill

  • SKILL.md2.3 KB
  • manifest.json109 B
  • runtime/index.mjs30.8 KB
  • scripts/agent-source.mjs2.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.