agentleFS
GreatMarkGreatMark/fable-field-guide-skills/skills/reference-hunt/SKILL.md

reference-hunt

Skill9 starsChanged 5 months agoMITView on GitHub

Port the semantics of a reference implementation by reading its actual source, not screenshots or docs. Use when the user says "reference hunt", "照着这个实现", "像这个一样", "要做成像 X 那样", "抄作业" while pointing at a concrete product, library, or code, says "find me a reference implementation" or "steal X's logic", asks "how does <product> do that? I want that here" — the question is the trigger — or struggles to articulate a behavior they can recognize. If the user has no reference — or has one but wants several divergent directions to react to — use design-directions (a reference hunt can feed it one direction's semantics). Not for finding documentation or tutorials, and not for merely matching the project's existing code style.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. Neeeophytee/finding-unknowns-skills★ 342same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository8 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Get a pointer: If the user already named a reference (a library, a vendored crate, a folder, a component on a website), start there.

    line 23
  2. Distinctive:

    Write down what you are taking: Before implementing, give the user a short list, in the language of the conversation: the semantics being …

    line 43
  3. Very specific:

    if implementation starts now, record the ported semantics under Context and your own deliberate deviations under Decisions in …

    line 48
  4. Distinctive:

    Never copy code verbatim from an external reference — port semantics and match the project's style.

    line 85
  5. Distinctive:

    If the reference's behavior conflicts with something the user stated, surface the conflict instead of silently picking one.

    line 95
  6. Distinctive:

    If the reference turns out to be a poor fit, say so and propose another.

    line 97

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Reference Hunt

Sometimes the user cannot describe what they want in words — showing beats telling. The best reference is source code.

Workflow

  1. Get a pointer. If the user already named a reference (a library, a vendored crate, a folder, a component on a website), start there. If not, propose 2-3 candidate references yourself — from the codebase, vendored dependencies, or well-known open-source implementations — and let the user pick. One short message, not an interview.
  2. Read the real implementation. Locate the source in this order: node_modules/vendored copies inside the project → the package's repository at the installed version (npm view <pkg> repository or the ecosystem's equivalent, then fetch the tagged file) → GitHub code search (needs auth; anonymous fallback: shallow-clone the repo or fetch raw files by path from raw.githubusercontent.com). For a website module, read the underlying markup and code. Read the source, not its README, docs, or a screenshot. Also skim its test file — edge-case semantics (ordering, error paths, boundary values) live in tests more reliably than in the implementation body. A different language from the target is fine; semantics transfer, syntax does not. When the reference's framework differs from the target's, list which behaviors are carried by framework scheduling (pre-paint effects, batched updates, subscription timing) — re-create those deliberately; they neither transfer for free nor count as mere syntax.
  3. Write down what you are taking. Before implementing, give the user a short list, in the language of the conversation: the semantics being ported and what is deliberately not being ported. Cover five dimensions: inputs/API shape, outputs and return values, state transitions, edge cases, failure behavior. The list must outlive the chat:
    • if implementation starts now, record the ported semantics under Context and your own deliberate deviations under Decisions in implementation-notes.md (per the implementation-notes skill);
    • otherwise write it to porting-checklist.md in the project root, headed by the reference name+version, then the five dimensions; if planning comes next, hand that file to implementation-plan as an input. Do not commit it unless the user asks; in a git repo, exclude it locally: n=porting-checklist.md; p="$(git rev-parse --git-path info/exclude 2>/dev/null)" && { mkdir -p "$(dirname "$p")" && { grep -qxF "$n" "$p" || echo "$n" >> "$p"; }; } 2>/dev/null || echo "note: could not exclude — leaving it untracked, never staging it"
  4. Reimplement, don't transplant. Port the behavior into the target stack following the project's existing conventions and idioms. Cite the reference file paths — with version or commit for remote references (e.g. lodash@4.17.21 debounce.js) — in your summary so claims are checkable.

When source is not readable

  • Website with minified JS: check for sourcemaps first (look for a sourceMappingURL directive at the file tail, then confirm the .map actually loads); otherwise use the minified code only to confirm structure, and find an open-source implementation of the same pattern to read for semantics.
  • Closed-source SaaS or nothing readable: first look for a well-known open-source implementation of the same pattern and read that as the semantic reference. Only when none exists, tell the user you are downgrading to black-box observation (drive the UI/API, record behavior as a table of input → output/state; if the behavior sits behind a login, ask the user for access or a screen recording), and mark ported semantics as "observed, not read".
  • Reference too large to read fully: find the file that owns the core behavior (search for the distinctive algorithm/state names first), read it plus its direct tests — budget roughly 3-5 files; follow at most one import hop when the behavior clearly spans modules, and name what you skipped as "assumed standard".

Rules

  • Never copy code verbatim from an external reference — port semantics and match the project's style. Check the reference's license first (LICENSE file, package.json, or npm view <pkg> license): permissive (MIT/Apache/BSD) is fine to port from with attribution in your summary. For GPL/AGPL, warn that reading the source then reimplementing risks a derivative work; if the user proceeds, extract semantics into the taking list first, implement only from the list without re-opening the source, and say so in the summary. For no license, warn that the default is all-rights-reserved and prefer a permissive alternative; black-box observation is the license-safe fallback.
  • If the reference's behavior conflicts with something the user stated, surface the conflict instead of silently picking one.
  • If the reference turns out to be a poor fit, say so and propose another.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.