Files
fn_registry/functions/infra/scan_flows_dir.md
T
egutierrez 7913116a8e chore: auto-commit (129 archivos)
- .claude/agents/fn-analizador/SKILL.md
- .claude/agents/fn-constructor/SKILL.md
- .claude/agents/fn-executor/SKILL.md
- .claude/agents/fn-mejorador/SKILL.md
- .claude/agents/fn-orquestador/SKILL.md
- .claude/agents/fn-recopilador/SKILL.md
- .claude/commands/app.md
- .claude/commands/compile.md
- .claude/commands/cpp-app.md
- .claude/commands/create_functions.md
- ...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-01 22:23:12 +02:00

2.1 KiB

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
name kind lang domain version purity signature description tags uses_functions uses_types returns returns_optional error_type imports params output tested tests test_file_path file_path
scan_flows_dir function go infra 0.1.0 impure func ScanFlowsDir(root string) ([]Flow, error) Escanea el directorio dev/flows/ (root) y devuelve todos los Flows encontrados en *.md directos. Skippea INDEX.md, README.md y AGENT_GUIDE.md. Si un archivo falla al parsearse emite warning y continua. Resultado ordenado por ID ascendente.
flow
scanner
frontmatter
yaml
dev-ux
kanban
flow_go_infra
flow_go_infra
false error_go_core
fmt
log
os
path/filepath
sort
strings
gopkg.in/yaml.v3
name desc
root Ruta al directorio dev/flows/ (absoluta o relativa).
Slice de Flow ordenado por ID asc con FilePath y MtimeNs rellenados. Flows con YAML malformado se omiten con warning. true
scan devuelve al menos 5 flows
flow 0001 esta presente
flows tienen FilePath y MtimeNs
flows ordenados por ID asc
functions/infra/scan_flows_dir_test.go functions/infra/scan_flows_dir.go

Ejemplo

flows, err := infra.ScanFlowsDir("$HOME/fn_registry/dev/flows")
if err != nil {
    log.Fatal(err)
}
fmt.Printf("Total flows: %d\n", len(flows))
for _, f := range flows {
    fmt.Printf("  %s [%s] %s\n", f.ID, f.Status, f.Title)
}

Cuando usarla

Al arrancar el backend de kanban_cpp para cargar el panel Flows. Tambien util para dashboards de estado del proyecto que necesiten listar flujos activos/pendientes.

Gotchas

  • El struct Flow tiene campos Name y Title porque algunos flows del registry usan name: y otros title: en el frontmatter. parseFlowMd normaliza: si Title esta vacio pero Name no, copia Name a Title.
  • No tiene subdirectorio completed/ equivalente — todos los flows activos e historicos viven en el mismo directorio raiz.
  • La funcion parseFlowMd es interna (no exportada). Si necesitas parsear un flow individual, usa directamente yaml.Unmarshal o expone una funcion separada.