skills/pin-audit/SKILL.md
Use when checking pin graph health. Runs lib/pins/audit to detect dangling relations, duplicates, invalid entities, stale entries, and orphans, then presents a ranked report.
npx skillsauth add toongri/oh-my-toong-playground pin-auditInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run a read-only health check over the pin knowledge graph by calling audit(input, opts?) from lib/pins/audit.ts.
import { audit } from "lib/pins/audit.ts";
import { resolveManifest } from "lib/pins/manifest.ts";
const result = await resolveManifest();
if (result.kind !== "resolved") throw new Error("pins manifest absent");
const report: AuditReport = await audit(
result.manifest.location, // string path resolved from pins.yaml — or an Entity[] array for scoped checks
{ now: new Date() } // required for stale detection; omit to skip stale checks entirely
);
// report.findings: AuditFinding[]
audit is read-only. It does not write, delete, or modify any file.
now omission disables stale detection. When opts.now is absent, detectStale skips every entity — no stale findings will appear in the report. Always pass { now: new Date() } unless you intentionally want to suppress staleness.
Findings are ordered highest-signal first in report.findings:
| Rank | Type | Severity | What it means |
|------|------|----------|---------------|
| 1 | dangling | error | A relation's target id is absent from the in-scope entity set. Primary signal — fix before anything else. |
| 2 | duplicate | error | Two entities share the same source_url. |
| 3 | invalid | error | Entity fails schema validate(). |
| 4 | stale | error | Entity exceeds its tier threshold (tier1=180d, tier2=90d, tier3=30d). reference type uses checked_at ?? created_at (falls back to created_at when checked_at is absent); all other types use created_at. |
| 5 | orphan | warning | Entity has no outgoing relations. Soft signal only — never a violation. |
Dangling relations are the primary check: a broken link is a structural defect; an isolated node is merely informational.
type, entityId, and message. For dangling, also include targetId. For duplicate, also include conflictsWith.orphan findings as soft warnings at the end of the report, not violations requiring action.findings is empty, report "audit clean — no issues found".tools
Use at the end of a work session to review the WHOLE session and record entities worth pinning. This is the manual, deliberate complete-sweep review — NOT an automated nudge. Triggers on "wrap up", "wrap-up", "session wrap", "end of session", "what should I pin".
documentation
Use when initializing the pins knowledge graph for the first time in a project. Guides the user through creating pins.yaml (the storage manifest). Triggers on "setup pins", "initialize pins", "create pins.yaml", "first-run pins".
testing
Use when you need to record a single pin entity to the knowledge graph. Invokes lib/pins record() to validate and write a canonical .md file. Triggers on "record pin", "pin this", "save this as a pin".
databases
Use when looking up pins by type, tags, or source. Drives lib/pins/query.ts to retrieve matching pin entries from the knowledge graph. Supersedes the legacy manual ls+frontmatter procedure.