| name | lattice-search |
| description | Search and navigate The Fold's skill lattice using meta-tooling. Use for finding functions, exploring dependencies, type-aware queries, and cross-reference analysis. Invoke when searching for capabilities, exploring the codebase structure, or finding how functions relate. |
| allowed-tools | Bash(./fold:*), Read, Grep, Glob |
Lattice Search Skill
Overview
The Fold's lattice is a DAG of verified skills with comprehensive meta-tooling for discovery and navigation. This skill provides search, inspection, and cross-reference capabilities.
Use lattice search for:
- Finding functions by name, description, or type signature
- Exploring skill dependencies and dependents
- Understanding what a skill exports
- Tracing call graphs (what calls what)
- Discovering capabilities you didn't know existed
Quick Reference
| Command | Purpose | Example |
|---|
lf | Full-text search (BM25 ranked) | (lf "matrix decomposition") |
lfe | Exact symbol lookup | (lfe 'vec3) |
lfp | Prefix search | (lfp 'matrix) |
lfs | Substring search | (lfs 'c2d) |
li | Skill description | (li 'linalg) |
le | List exports | (le 'linalg) |
lm | List modules | (lm 'linalg) |
ld | Dependencies (what it needs) | (ld 'physics/diff) |
lu | Dependents (what uses it) | (lu 'linalg) |
lxu | Callers (what calls this) | (lxu 'matrix-rows) |
lxc | Callees (what this calls) | (lxc 'floyd-warshall) |
ls | Lattice statistics | (ls) |
Instructions
Basic Search
./fold "(lf \"parser combinator\")"
./fold "(lfe 'maybe-bind)"
./fold "(lfp 'matrix)"
./fold "(lfs 'zoh)"
./fold "(lattice-complete \"mat\")"
Type-Aware Search (Hoogle-style)
./fold "(lf-type \"Monad\")"
./fold "(lf-input \"Matrix\")"
./fold "(lf-output \"Maybe\")"
Cross-Reference Queries
./fold -s dev "(build-xref-cache!)"
./fold -s dev "(lxu 'matrix-rows)"
./fold -s dev "(lxc 'floyd-warshall)"
./fold -s dev "(xref-callers-transitive 'fn)"
./fold -s dev "(xref-most-called 10)"
DAG Navigation
./fold "(ld 'physics/diff)"
./fold "(lu 'linalg)"
./fold "(lattice-path 'physics/diff 'linalg)"
./fold "(lattice-roots)"
./fold "(lattice-leaves)"
./fold "(lattice-hubs)"
Inspection
./fold "(li 'linalg)"
./fold "(le 'linalg)"
./fold "(lm 'linalg)"
./fold "(lattice-summary)"
./fold "(lattice-info 'linalg)"
Analytics & Health
./fold "(ls)"
./fold "(lh)"
./fold "(lattice-coverage-pretty)"
./fold "(lattice-graph)"
Manifest Auditing
./fold "(audit-skill-pretty 'fp)"
./fold "(suggest-missing 'fp)"
Search Best Practices
- Start broad, then narrow: Use
(lf "concept") first, then (lfe 'symbol) for exact matches
- Use substring for partial names: If you know part of a name (like
c2d), use (lfs 'c2d)
- Try multiple query variations: Function might be named differently than expected
- Check skill exports: Use
(le 'skill-name) to see what a skill actually exports
- Not all functions are exported: Use
(audit-skill 'name) to find functions in source but missing from manifests
Examples
Example 1: Finding Matrix Operations
./fold "(lf \"matrix multiplication\")"
./fold "(le 'linalg)"
./fold "(lm 'linalg)"
Example 2: Exploring a Function's Usage
./fold -s dev "(build-xref-cache!)"
./fold -s dev "(lxu 'matrix-transpose)"
./fold -s dev "(lxc 'the-caller-function)"
Example 3: Finding Control System Functions
./fold "(lfs 'c2d)"
./fold "(li 'fp)"
./fold "(le 'fp)"
Example 4: Discovering Capabilities
./fold "(lf \"parser\")"
./fold "(lf-type \"Monad\")"
./fold "(li 'data)"
./fold "(le 'data)"
Lattice Structure
Tiers are derived from DAG depth (not declared). Use (lattice-depth 'skill-name) to check. Tier 0 = no lattice deps (foundational), higher tiers = more dependencies. Implementation in lattice/meta/dag.ss.