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.
In this repository12 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- github-issueSkill
- okf:createSkill
- okf:editSkill
- okf:_okf-skill-git-commitSkill
- okf:_okf-skill-read-specSkill
- okf:reconcileSkill
- okf:searchSkill
- okf:updateSkill
- okf:_okf-skill-validateSkill
- okf:validateSkill
- okf:_okf-skill-write-logSkill
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
- Very specific: line 14
Look for scan_bundle.py in these locations, in order:
- Distinctive: line 19
If found and Python 3 is available, run:
- Distinctive: line 45
If the script is not found but Python 3 is available, enumerate concept files with:
- Very specific: line 56
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 …
- Very specific: line 60
If Python is not available, traverse the directory tree using the Read tool:
- Distinctive: line 62
Read the bundle root directory to list its contents.
≈ “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.
Files
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:
skills/_scan-bundle/scan_bundle.py(relative to the current working directory)~/.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:
- Read the bundle root directory to list its contents.
- Recurse into each subdirectory, collecting all
.mdfiles. Excludeindex.mdandlog.md. - Let N = total count of files collected.
Choose the read mode:
| Condition | Mode | What to read |
| N ≤ 50 | full | Frontmatter + body for all N files |
| N > 50 | two-pass | Frontmatter 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 —
fullortwo-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)
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
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.

