From first-plan
Builds inverted Reuse Index in .first-plan/03-reuse/ mapping intentions like 'validate input' or 'fetch with loading' to existing reusable components, utils, types, hooks across TS/JS, Go, Python, PHP, Rust during discovery.
How this skill is triggered — by the user, by Claude, or both
Slash command
/fp:reuse-indexingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Como criar `.first-plan/03-reuse/` com índice invertido focado em "intenção -> existente".
Como criar .first-plan/03-reuse/ com índice invertido focado em "intenção -> existente".
A pergunta certa nao é "o que existe?" - é "preciso fazer X, o que ja existe?". O índice é organizado por intenção, não por estrutura.
| Categoria | Exemplo |
|---|---|
| Validação | "validar input HTTP" |
| Logging | "registrar evento" |
| Auth | "verificar JWT" |
| HTTP client | "chamar API externa" |
| Persistência | "buscar registro no DB" |
| Conversão / format | "formatar data" |
| Testing helper | "criar fixture" |
| Crypto | "hash de senha" |
| Categoria | Exemplo |
|---|---|
| UI components | "form com validação" |
| Hooks | "fetch com loading state" |
| State management | "store de carrinho" |
| Routing | "redirect autenticado" |
| Forms | "form com validação" |
| Modals / overlays | "dialog de confirmação" |
Item entra no índice se:
@deprecated)helper.foo())Por linguagem, identifica símbolos exportados:
func / type em pacote pkg/ ou internal/util/export em arquivos lib/, utils/, helpers/, components/, hooks/App\Services, App\Helpersutils/, helpers/, services/pub em src/lib.rs e módulos públicosAgrupa candidatos por categoria. Mapping comum:
| Nome contém | Categoria |
|---|---|
validate, valid, check | Validação |
log, logger, audit | Logging |
auth, jwt, token, permission | Auth |
client, request, fetch, api | HTTP client |
repository, dao, query, db | Persistência |
format, parse, convert, to_ | Format |
factory, builder, mock, stub | Testing helper |
hash, encrypt, decrypt, sign | Crypto |
Component, View, Layout | UI components |
use<Capitalized> (TS/JS) | React hooks |
name: <nome do símbolo>
category: <categoria de intenção>
path: <arquivo>:<linha>
signature: <assinatura completa>
purpose: <inferido por nome + comentário se houver>
usages:
- <path:line de quem usa>
... (até 5 ocorrências)
when_to_reuse: <contexto>
when_not_to_reuse: <contexto exclusionário>
03-reuse/INDEX.md:
03-reuse/components.md, utils.md, types.md, hooks.md:
03-reuse/search.json:
{
"items": [
{
"name": "...",
"category": "...",
"path": "...",
"signature": "...",
"tags": ["...", "..."],
"usage_count": 5
}
]
}
Inferir purpose a partir de:
Inferir "when to reuse":
Inferir "when NOT to reuse":
func square(x int) int { return x*x }) não entram.Se o projeto tem > 200 items reusáveis:
INDEX.md ao top 30 por categoria por usage_countsearch.json tem todosnpx claudepluginhub vynazevedo/first-plan --plugin fpGenerates or refreshes .claude/reuse-index.md inventory of shared utilities, enums, hooks, components, and primitives. Project-agnostic scan of common directories like src/shared; invoke once per project or on changes.
Performs semantic search (BM25) over project symbol index, matching by intent rather than exact name. Replaces grep during /fp:reuse and /fp:plan to find reusable components.
Generates YAML index files (.ai/index/) for design system codebases: component inventory, relationship graph, summary stats. Enables fast AI agent queries on components and dependencies.