skills/pin-query/SKILL.md
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.
npx skillsauth add toongri/oh-my-toong-playground pin-queryInstall 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.
Retrieve pins from the knowledge graph by calling query(pinsDir, criteria) from lib/pins/query.ts.
query calls buildIndex() on every invocation, scanning pinsDir in-memory. There is no index.json cache; every call performs a full directory scan and produces results directly.
The full entity set is always covered, including pins with no outgoing relations. Orphan pins remain findable by type, tags, or source — relation traversal is not required.
Resolve pinsDir from the manifest before calling query:
import { resolveManifest } from "lib/pins/manifest.ts";
import { query } from "lib/pins/query.ts";
const result = await resolveManifest();
if (result.kind === 'absent') { /* handle missing manifest */ }
const pinsDir = result.manifest.location;
const results = query(pinsDir, { type: 'code', tags: ['auth'] });
// returns QueryResult[] — each: { id: string, frontmatter: Frontmatter }
pinsDir is manifest.location as resolved by resolveManifest() (from lib/pins/manifest.ts). Omit any criterion to leave that field unrestricted.
Return matched slugs (id), source_url from the frontmatter, and a one-line summary to the caller. Report "no match" on an empty result set. Do not re-traverse the graph; the returned Frontmatter already carries relations if the caller needs to follow links.
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".
testing
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.