agentleFS
siculosiculo/okf-skills/skills/_okf-skill-scan-bundle/SKILL.md

okf:_okf-skill-scan-bundle

Skill2 starsChanged 5 months agoUnlicenseView on GitHub

Internal skill: scan all concept files in an OKF bundle, choose between full and two-pass read mode based on bundle size, and return an index map. Called by okf:update, okf:reconcile, and okf:search.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Look for scan_bundle.py in these locations, in order:

    line 14
  2. Distinctive:

    If found and Python 3 is available, run:

    line 19
  3. Distinctive:

    If the script is not found but Python 3 is available, enumerate concept files with:

    line 45
  4. Very specific:

    Use the resulting file list to determine N, choose the read mode (§3 table), then read each file using the Read tool: full file in full …

    line 56
  5. Very specific:

    If Python is not available, traverse the directory tree using the Read tool:

    line 60
  6. Distinctive:

    Read the bundle root directory to list its contents.

    line 62

≈ “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

Scan the bundle root provided by the calling skill.

1. Run the scanner script (preferred)

Look for scan_bundle.py in these locations, in order:

  1. skills/_scan-bundle/scan_bundle.py (relative to the current working directory)
  2. ~/.claude/skills/_scan-bundle/scan_bundle.py

If found and Python 3 is available, run:

python3 <path>/scan_bundle.py <bundle_root>

The script outputs JSON to stdout:

{
  "mode": "full | two-pass",
  "count": 42,
  "index": {
    "group/concept.md": {
      "type": "...", "title": "...", "description": "...",
      "tags": [], "resource": "...", "timestamp": "...",
      "body": "..."
    }
  }
}

Parse this output and use it as the result of this skill. Skip to §4.

2. Fallback A: Python inline (script not found, Python available)

If the script is not found but Python 3 is available, enumerate concept files with:

python3 -c "
import pathlib, json, sys
root = pathlib.Path(sys.argv[1])
files = sorted(str(f.relative_to(root)) for f in root.rglob('*.md') if f.name not in {'index.md', 'log.md'} and not (f.parent == root and f.name in {'README.md', 'SPEC.md'}) and not any(p.startswith('.') for p in f.relative_to(root).parts))
print(json.dumps(files))
" <bundle_root>

Use the resulting file list to determine N, choose the read mode (§3 table), then read each file using the Read tool: full file in full mode, or with limit: 30 in two-pass mode to capture only the frontmatter. Build the index map manually. Skip to §4.

3. Fallback B: native tools only (Python unavailable)

If Python is not available, traverse the directory tree using the Read tool:

  1. Read the bundle root directory to list its contents.
  2. Recurse into each subdirectory, collecting all .md files. Exclude index.md and log.md.
  3. Let N = total count of files collected.

Choose the read mode:

ConditionModeWhat to read
N ≤ 50fullFrontmatter + body for all N files
N > 50two-passFrontmatter only (use limit: 30)

Build an index map: concept path → { type, title, description, tags, resource, timestamp [, body] }

In two-pass mode, body is omitted. The calling skill must read the full body on demand, only when a concept becomes a candidate for change, match, or semantic diff (Pass 2).

4. Return to the calling skill

Provide:

  • mode — full or two-pass
  • count — N
  • index — the map built in §1, §2, or §3

The calling skill must include the following line in its final report when mode is two-pass:

Bundle mode: two-pass (N concepts, threshold 50)

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.