Commit Graph

7 Commits

Author SHA1 Message Date
Daniel Avila 51e3e9cdf4 perf: split components.json to cut dashboard browser payload (#672)
The dashboard is on Cloudflare Pages with a 24h edge cache already in
place, but every island still downloaded the full ~1.9MB index (327KB
gz) — even the sidebars/plugins/collection pages that only need per-type
counts. This splits the index into purpose-built artifacts so the
browser fetches only what each surface needs.

Generator (scripts/generate_components_json.py):
- Decouple the docs and dashboard index writes (they were a byte copy).
  docs/components.json keeps `security` (the legacy site renders it);
  the dashboard index drops both `content` and `security` (unused there)
  → ~13% smaller.
- Emit dashboard/public/counts.json (per-type counts, ~150 bytes),
  components/{type}.json (per-type slices), and search-index.json
  (flat name/description/category/type/path for global search).

Dashboard islands:
- ComponentGrid loads only the active type via fetchComponentsByType,
  re-fetching on type switch (per-type in-memory cache).
- SearchModal (Cmd+K) uses the lighter search-index.json.
- Sidebar + plugins index/detail + collection pages fetch counts.json
  instead of the full index just to read array lengths.
- data.ts gains fetchComponentsByType/fetchSearchIndex (additive);
  fetchComponents() stays for the SSR detail page and Discord bot.

Fix: SendToRepoModal read `match.content` off an index that no longer
carries content, so "Send to repo" produced empty PRs / threw "No
component content found". buildFileMap now pulls each item's content via
fetchComponentContent (the per-component files), which also removes its
full-index fetch.

_headers: cache/CORS blocks for counts.json, components/*, search-index.json.

Payload (gzip on-the-wire): sidebars/plugins/collection 327KB → ~124B;
grid default type (agents) 327KB → 145KB; Cmd+K 327KB → 260KB.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-04 16:22:46 -04:00
Daniel Avila 7f890b1b3b feat: add Loops component type with referenced components (#643)
* feat: add Loops component type with referenced components

Introduce "loops" as a new first-class component type — autonomous
agentic workflows (goal + interval + stop condition) inspired by Loop
Engineering and the Forward Future Loop Library. A loop references other
components (agents, skills, hooks, commands) and the dashboard renders
those references as clickable cards on the loop detail page.

- Add 10 starter loops under cli-tool/components/loops/
  (engineering, evaluation, operations)
- Catalog generator: scan loops + write per-component content files
- Dashboard: new type in icons/types/data, /loops page, and a
  "Referenced Components" section on the loop detail page
- CLI: --loop flag installs the loop to .claude/loops/ and
  auto-installs its referenced components
- Docs: CLAUDE.md and cli-tool rule updated

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T9ynMiCHt8JwdMd8KjCkES

* feat: add 8 more loops (goal/loop/schedule patterns)

Expand the loops catalog to 18, drawing ideas from community "Loop
Engineering" patterns. Adds loops across the three trigger verbs
(/goal, /loop, /schedule) and emphasizes the verifier-in-the-loop and
budget / anti-spin guardrails:

- engineering/five-minute-maintainer-loop
- engineering/build-test-fix-loop
- engineering/anti-spin-build-loop
- engineering/completion-contract-loop (goal)
- engineering/goal-refiner-loop (goal)
- engineering/adversarial-review-loop (cross-model)
- operations/overnight-pr-routine-loop (schedule)
- evaluation/human-approval-loop (human-in-the-loop)

All referenced components verified to exist; catalog regenerated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T9ynMiCHt8JwdMd8KjCkES

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-06-21 20:19:16 -04:00
daniel 36386276c2 refactor(generator): escribir content files directo a dashboard/public/, sin duplicado en docs/
El commit anterior creó docs/component-content/ como directorio intermedio
y luego lo copió a dashboard/public/component-content/, resultando en 1774
archivos duplicados en el repo. Ahora el generador escribe directo al destino
final (dashboard/public/component-content/) y se agrega docs/component-content/
a .gitignore para evitar que se vuelva a trackear.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 17:02:21 -04:00
daniel 41cbbea00c perf(dashboard): reducir payload del home 87% y restaurar caching en Cloudflare
- Split components.json: índice sin content (1.9 MB / 249 KB br vs 15.6 MB / 4.15 MB br).
  Generador produce component-content/{type}/{slug}.json por componente y auto-copia
  a dashboard/public/. Página de detalle carga contenido on-demand via fetchComponentContent().
- Restaurar cabeceras de caché y seguridad perdidas en la migración Vercel→Cloudflare:
  _headers con Cache-Control max-age=86400 para JSONs, immutable para _astro/*,
  y HSTS, X-Frame-Options, Referrer-Policy, Permissions-Policy en todas las rutas.
- Eliminar dashboard/vercel.json (config muerta desde migración a Cloudflare Pages).
- Diferir hidratación: ClerkIsland y AuthButton client:load → client:idle;
  SaveToCollectionButton → client:visible.
- Eliminar gpt-tokenizer del bundle del navegador: reemplazado por estimación chars/4.
- Actualizar .claude/rules/dashboard.md para reflejar hosting en Cloudflare Pages.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 16:58:13 -04:00
daniel 4889304c24 feat(dashboard): redesign component detail pages with unified viewer components
- Add MarkdownViewer, JsonViewer, SkillExplorer components with Code/Preview toggle, search (Cmd+F), TOC sidebar, and gradient fade expand/collapse
- Add FileTreeSidebar for skill file navigation (starts collapsed)
- Make file tree panel stretch to match content height
- Green download badge with icon on detail pages
- Remove Add to Stack button and sidebar collapse functionality
- Metadata displayed as clickable label pills with modal
- Add marked dependency for client-side markdown rendering

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:04:11 -04:00
Daniel Avila b811e42de7 feat: Add author field to component schema and display on website (#292) 2026-01-20 23:22:27 -05:00
Dani 6866f91f10 refactor: Reorganize project structure for better maintainability
Moved files to improve project organization:

📦 Scripts → /scripts:
- dev-server.js
- generate_agents_api.py
- generate_claude_jobs.py
- generate_components_json.py
- generate_trending_data.py
- sync-api.sh

📚 Documentation → /docs/guides:
- claude-jobs.md (was CLAUDE_JOBS_README.md)
- deployment.md (was DEPLOYMENT.md)
- discord-bot-setup.md (was DISCORD_BOT_SETUP.md)
- growth-kit-pr.md (was GROWTH_KIT_PR.md)

🖼️ Images → /docs/images:
- social-preview.png

Updated all references:
- .github/workflows/update-json-data.yml
- CLAUDE.md
- docs/CLAUDE.md
- docs/api/README.md
- docs/guides/growth-kit-pr.md
- cli-tool/src/validation/README.md

Result:
- Root directory reduced from ~24 files to 13 essential config files
- Better separation of concerns (scripts, docs, images)
- Follows industry-standard project structure
- Easier navigation and maintenance

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 16:25:18 -05:00