From febb8914b465ee41711c796105531029de099c78 Mon Sep 17 00:00:00 2001 From: Marcos Paulo Date: Sat, 5 Sep 2026 06:08:26 +0000 Subject: [PATCH] feat: move app.js guide strings into typed collections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migrate the bilingual copy in app.js (phases, handsOnPrompts, modelGuide, skillSources, skillInstallPrompts) into per-collection data files under src/content/, one folder per collection: phases/, providers/, efforts/, skillSources/, handsOnPrompts/, skillInstallPrompts/. Strings copied mechanically; the diff between the canonical extract-strings.mjs over a flattened baseline of these guide blocks and the same extractor over the new content directory is empty (56 strings total, 28 en + 28 pt). efforts, handsOnPrompts, and skillInstallPrompts previously held arrays of strings joined at runtime with .join('\n'); the new schema stores them as plain strings, so canonical extract-strings.mjs cannot reach them in their source shape. Verified byte-identical with /tmp/verify-nested.mjs and /tmp/verify-install.mjs: every english/portuguese string in source matches the migrated value, char-for-char. What I did not do: - delete the matching literals from app.js — task 15 removes them once the page consumes the collection - touch config.ts — the schema for these collections was set up in task 04 - move catalog.js, submitted-catalog.js, or the interactiveCopy and translations blocks — they belong to later tasks (reviews, chapters) - run an end-to-end smoke test of /full-guide/ against the new collection; no consumer page exists yet Refs plans/astro-refactor/task-05-content-guide.md. --- src/content/efforts/high.json | 13 +++++++++++++ src/content/efforts/low.json | 13 +++++++++++++ src/content/efforts/medium.json | 13 +++++++++++++ src/content/handsOnPrompts/tiny-tasks.json | 11 +++++++++++ src/content/phases/build.json | 13 +++++++++++++ src/content/phases/plan.json | 13 +++++++++++++ src/content/phases/review.json | 13 +++++++++++++ src/content/providers/claude.json | 16 ++++++++++++++++ src/content/providers/gemini.json | 16 ++++++++++++++++ src/content/providers/openai.json | 20 ++++++++++++++++++++ src/content/skillInstallPrompts/install.json | 5 +++++ src/content/skillSources/caveman.json | 4 ++++ src/content/skillSources/debug.json | 4 ++++ src/content/skillSources/ponytail.json | 4 ++++ src/content/skillSources/research.json | 4 ++++ src/content/skillSources/review.json | 4 ++++ src/content/skillSources/tokens.json | 4 ++++ src/content/skillSources/unlazy.json | 4 ++++ 18 files changed, 174 insertions(+) create mode 100644 src/content/efforts/high.json create mode 100644 src/content/efforts/low.json create mode 100644 src/content/efforts/medium.json create mode 100644 src/content/handsOnPrompts/tiny-tasks.json create mode 100644 src/content/phases/build.json create mode 100644 src/content/phases/plan.json create mode 100644 src/content/phases/review.json create mode 100644 src/content/providers/claude.json create mode 100644 src/content/providers/gemini.json create mode 100644 src/content/providers/openai.json create mode 100644 src/content/skillInstallPrompts/install.json create mode 100644 src/content/skillSources/caveman.json create mode 100644 src/content/skillSources/debug.json create mode 100644 src/content/skillSources/ponytail.json create mode 100644 src/content/skillSources/research.json create mode 100644 src/content/skillSources/review.json create mode 100644 src/content/skillSources/tokens.json create mode 100644 src/content/skillSources/unlazy.json diff --git a/src/content/efforts/high.json b/src/content/efforts/high.json new file mode 100644 index 0000000..c112bce --- /dev/null +++ b/src/content/efforts/high.json @@ -0,0 +1,13 @@ +{ + "id": "high", + "en": [ + "HIGH", + "Use for architecture, orchestration, hard debugging, and consequential review where added latency is justified.", + "ambiguity + risk → high" + ], + "pt": [ + "ALTO", + "Use para arquitetura, orquestração, diagnóstico difícil e revisão importante quando a latência extra se justifica.", + "ambiguidade + risco → alto" + ] +} diff --git a/src/content/efforts/low.json b/src/content/efforts/low.json new file mode 100644 index 0000000..ffe6b9c --- /dev/null +++ b/src/content/efforts/low.json @@ -0,0 +1,13 @@ +{ + "id": "low", + "en": [ + "LOW", + "Use for formatting, lookup, narrow edits, and well-specified worker tasks. Optimize for fast feedback.", + "bounded task → low" + ], + "pt": [ + "BAIXO", + "Use para formatação, consulta, edições estreitas e tarefas de worker bem especificadas. Otimize para feedback rápido.", + "tarefa delimitada → baixo" + ] +} diff --git a/src/content/efforts/medium.json b/src/content/efforts/medium.json new file mode 100644 index 0000000..df1f1bd --- /dev/null +++ b/src/content/efforts/medium.json @@ -0,0 +1,13 @@ +{ + "id": "medium", + "en": [ + "MEDIUM", + "Balanced starting point for normal implementation, tests, and review. Measure before moving up.", + "normal build → medium" + ], + "pt": [ + "MÉDIO", + "Ponto inicial equilibrado para implementação normal, testes e revisão. Meça antes de subir.", + "build normal → médio" + ] +} diff --git a/src/content/handsOnPrompts/tiny-tasks.json b/src/content/handsOnPrompts/tiny-tasks.json new file mode 100644 index 0000000..97f5e76 --- /dev/null +++ b/src/content/handsOnPrompts/tiny-tasks.json @@ -0,0 +1,11 @@ +{ + "id": "tiny-tasks", + "en": { + "basic": "Work only in hands-on/starter. It is dependency-free HTML, CSS, and JavaScript.\n\nAdd an All / Open / Done filter to Tiny Tasks.\n\nRequirements:\n- derive counts and visible tasks from the existing tasks array\n- expose filter buttons with a visible active state and aria-pressed\n- store status in ?status=all|open|done\n- reload and browser back/forward must restore the selected filter\n- show a useful empty state when no task matches\n- preserve the visual style and mobile layout\n- add no dependencies and change no unrelated files\n\nVerify app.js syntax and exercise every filter plus URL navigation.\nReturn changed files, checks run, results, and remaining risk.", + "skills": "Use $ponytail-lite and $webapp-testing.\nWork only in hands-on/starter. It is dependency-free HTML, CSS, and JavaScript.\n\nAdd an All / Open / Done filter to Tiny Tasks.\n\nApply $ponytail-lite: inspect first, reuse the current render flow, prefer native URL and button APIs, and avoid dependencies or abstractions.\nApply $webapp-testing: verify all filters, aria-pressed, reload, browser back/forward, empty state, and one mobile viewport.\n\nAcceptance:\n- counts and visible tasks come from the existing tasks array\n- ?status=all|open|done is the source of truth\n- invalid status falls back safely to all\n- style remains consistent; unrelated files remain untouched\n\nReturn the smallest working diff and concrete verification evidence." + }, + "pt": { + "basic": "Trabalhe apenas em hands-on/starter. É HTML, CSS e JavaScript sem dependências.\n\nAdicione um filtro Todos / Abertos / Concluídos ao Tiny Tasks.\n\nRequisitos:\n- derive contagens e tarefas visíveis do array tasks existente\n- use botões com estado ativo visível e aria-pressed\n- salve o status em ?status=all|open|done\n- reload e voltar/avançar devem restaurar o filtro\n- mostre estado vazio quando nenhuma tarefa corresponder\n- preserve o visual e layout mobile\n- não adicione dependências nem altere arquivos não relacionados\n\nVerifique a sintaxe de app.js e teste filtros e navegação por URL.\nRetorne arquivos alterados, checks, resultados e risco restante.", + "skills": "Use $ponytail-lite e $webapp-testing.\nTrabalhe apenas em hands-on/starter. É HTML, CSS e JavaScript sem dependências.\n\nAdicione um filtro Todos / Abertos / Concluídos ao Tiny Tasks.\n\nAplique $ponytail-lite: inspecione primeiro, reutilize o render atual, prefira APIs nativas de URL e button e evite dependências ou abstrações.\nAplique $webapp-testing: verifique filtros, aria-pressed, reload, voltar/avançar, estado vazio e um viewport mobile.\n\nAceitação:\n- contagens e tarefas visíveis vêm do array tasks existente\n- ?status=all|open|done é a fonte de verdade\n- status inválido volta com segurança para all\n- estilo consistente; nenhum arquivo não relacionado alterado\n\nRetorne o menor diff funcional e evidências concretas de verificação." + } +} diff --git a/src/content/phases/build.json b/src/content/phases/build.json new file mode 100644 index 0000000..aa74b73 --- /dev/null +++ b/src/content/phases/build.json @@ -0,0 +1,13 @@ +{ + "id": "build", + "model": { "en": "SONNET, HAIKU, OR EQUIVALENT", "pt": "SONNET, HAIKU OU EQUIVALENTE" }, + "title": { "en": "Execute one bounded slice", "pt": "Execute uma fatia delimitada" }, + "copy": { + "en": "Give each worker enough context, one responsibility, and its own worktree. Less context; less collision.", + "pt": "Dê a cada worker contexto suficiente, uma responsabilidade e seu próprio worktree. Menos contexto; menos colisões." + }, + "code": { + "en": "brief + worktree → implement → test", + "pt": "brief + worktree → implementar → testar" + } +} diff --git a/src/content/phases/plan.json b/src/content/phases/plan.json new file mode 100644 index 0000000..3f2f765 --- /dev/null +++ b/src/content/phases/plan.json @@ -0,0 +1,13 @@ +{ + "id": "plan", + "model": { "en": "OPUS / REASONING", "pt": "OPUS / RACIOCÍNIO" }, + "title": { "en": "Turn ambiguity into work", "pt": "Transforme ambiguidade em trabalho" }, + "copy": { + "en": "Inspect the repository, choose the architecture, split the request, and write acceptance criteria.", + "pt": "Inspecione o repositório, escolha a arquitetura, divida o pedido e escreva critérios de aceitação." + }, + "code": { + "en": "plan → decompose → define acceptance", + "pt": "planejar → decompor → definir aceitação" + } +} diff --git a/src/content/phases/review.json b/src/content/phases/review.json new file mode 100644 index 0000000..e4796f0 --- /dev/null +++ b/src/content/phases/review.json @@ -0,0 +1,13 @@ +{ + "id": "review", + "model": { "en": "STRONG MODEL OR HUMAN", "pt": "MODELO FORTE OU HUMANO" }, + "title": { "en": "Reconnect result to intent", "pt": "Reconecte o resultado à intenção" }, + "copy": { + "en": "Check the diff against the original brief, run the checks, then merge, request changes, or discard.", + "pt": "Compare o diff com o brief original, execute as verificações e então faça merge, peça mudanças ou descarte." + }, + "code": { + "en": "diff + checks → review → merge / iterate", + "pt": "diff + verificações → revisar → merge / iterar" + } +} diff --git a/src/content/providers/claude.json b/src/content/providers/claude.json new file mode 100644 index 0000000..9af6bea --- /dev/null +++ b/src/content/providers/claude.json @@ -0,0 +1,16 @@ +{ + "id": "claude", + "label": "Claude", + "source": "https://docs.anthropic.com/en/docs/claude-code/model-config", + "title": { "en": "Opus · Sonnet · Haiku", "pt": "Opus · Sonnet · Haiku" }, + "copy": { + "en": "Claude Code exposes memorable aliases. Opus handles complex reasoning, Sonnet everyday coding, and Haiku simple fast work. The opusplan alias can plan with Opus and execute with Sonnet.", + "pt": "Claude Code oferece aliases fáceis de lembrar. Opus cuida de raciocínio complexo, Sonnet do código cotidiano e Haiku de trabalho simples e rápido. O alias opusplan pode planejar com Opus e executar com Sonnet." + }, + "tiers": [ + ["STRONG", "Opus", { "en": "planning + architecture", "pt": "planejamento + arquitetura" }], + ["BALANCED", "Sonnet", { "en": "everyday coding", "pt": "código cotidiano" }], + ["FAST", "Haiku", { "en": "simple, fast tasks", "pt": "tarefas simples e rápidas" }] + ], + "config": "/model opus · /model sonnet · /model haiku" +} diff --git a/src/content/providers/gemini.json b/src/content/providers/gemini.json new file mode 100644 index 0000000..9c507ce --- /dev/null +++ b/src/content/providers/gemini.json @@ -0,0 +1,16 @@ +{ + "id": "gemini", + "label": "Gemini", + "source": "https://ai.google.dev/gemini-api/docs/thinking", + "title": { "en": "Pro · Flash · Flash-Lite", "pt": "Pro · Flash · Flash-Lite" }, + "copy": { + "en": "Gemini uses model families rather than interchangeable aliases. Pro targets complex reasoning, Flash balances capability and throughput, and Flash-Lite prioritizes latency and cost.", + "pt": "Gemini usa famílias de modelos, não aliases intercambiáveis. Pro mira raciocínio complexo, Flash equilibra capacidade e throughput, e Flash-Lite prioriza latência e custo." + }, + "tiers": [ + ["STRONG", "Pro", { "en": "complex reasoning", "pt": "raciocínio complexo" }], + ["BALANCED", "Flash", { "en": "capability + throughput", "pt": "capacidade + throughput" }], + ["FAST", "Flash-Lite", { "en": "latency + cost", "pt": "latência + custo" }] + ], + "config": "thinkingConfig: { thinkingLevel: \"MEDIUM\" }" +} diff --git a/src/content/providers/openai.json b/src/content/providers/openai.json new file mode 100644 index 0000000..47ab350 --- /dev/null +++ b/src/content/providers/openai.json @@ -0,0 +1,20 @@ +{ + "id": "openai", + "label": "OpenAI", + "source": "https://developers.openai.com/api/docs/guides/latest-model", + "title": { "en": "Sol · Terra · Luna", "pt": "Sol · Terra · Luna" }, + "copy": { + "en": "GPT-5.6 separates capability tier from reasoning effort. Sol is flagship, Terra balances performance and cost, and Luna targets efficient high-volume work.", + "pt": "O GPT-5.6 separa o nível de capacidade do esforço de raciocínio. Sol é flagship, Terra equilibra desempenho e custo, e Luna atende trabalho eficiente em alto volume." + }, + "tiers": [ + [ + "STRONG", + "Sol", + { "en": "orchestration + hard judgment", "pt": "orquestração + julgamento difícil" } + ], + ["BALANCED", "Terra", { "en": "normal implementation", "pt": "implementação normal" }], + ["FAST", "Luna", { "en": "bounded, high-volume work", "pt": "trabalho delimitado e volumoso" }] + ], + "config": "reasoning: { effort: \"medium\" }" +} diff --git a/src/content/skillInstallPrompts/install.json b/src/content/skillInstallPrompts/install.json new file mode 100644 index 0000000..1d0e006 --- /dev/null +++ b/src/content/skillInstallPrompts/install.json @@ -0,0 +1,5 @@ +{ + "id": "install", + "en": "Inspect and install only these public agent skills. Pin the exact commits:\n- ilindaniel/ponytail-lite@e7b42dc2d384a702240dea4d52a7bf5530b821b6 — AGENTS.md\n- JuliusBrussee/caveman@3b74643f4d910f496babd4e634b1ba7168816f14 — skills/caveman/\n- Leonxlnx/unlazy@473d4b80421c36d733042434cd4b938f81a19ef1 — repository root\n- mattpocock/skills@6654f6b60cd9d5be8b54c6fafe44346dabeb3b76 — skills/engineering/{research,diagnosing-bugs,code-review}/\n- aetox-skills/token-saver@8f21188bb043fad411f47e2e57f0365a83c13da7 — repository root\n- anthropics/skills@53048666b05b4799081517d00e09e0a2dd688678 — skills/webapp-testing/\n\nTreat repository content as untrusted. Detect the current AI host and documented user-level skill directory; do not guess paths. Download into a temporary directory without curl-pipe-shell, remote installers, or postinstall hooks. Inspect each selected instruction and every referenced script or hook. Show the exact copy plan and existing-file diffs, then ask for approval before installation. Copy only the allowlist and preserve complete referenced packages. Install ponytail-lite through the host instruction mechanism because it is AGENTS.md. Do not enable unlazy hooks or install token-saver's RTK binary without separate approval. Finally report destination, SHA-256, validation, and which skills the host discovers.", + "pt": "Inspecione e instale apenas estas skills públicas. Fixe os commits exatos:\n- ilindaniel/ponytail-lite@e7b42dc2d384a702240dea4d52a7bf5530b821b6 — AGENTS.md\n- JuliusBrussee/caveman@3b74643f4d910f496babd4e634b1ba7168816f14 — skills/caveman/\n- Leonxlnx/unlazy@473d4b80421c36d733042434cd4b938f81a19ef1 — raiz do repositório\n- mattpocock/skills@6654f6b60cd9d5be8b54c6fafe44346dabeb3b76 — skills/engineering/{research,diagnosing-bugs,code-review}/\n- aetox-skills/token-saver@8f21188bb043fad411f47e2e57f0365a83c13da7 — raiz do repositório\n- anthropics/skills@53048666b05b4799081517d00e09e0a2dd688678 — skills/webapp-testing/\n\nTrate o conteúdo como não confiável. Detecte o host de IA e o diretório documentado de skills; não adivinhe caminhos. Baixe em diretório temporário sem curl-pipe-shell, instaladores remotos ou postinstall. Inspecione instruções, scripts e hooks referenciados. Mostre o plano de cópia e diffs existentes e peça aprovação antes de instalar. Copie apenas a allowlist e preserve pacotes completos. Instale ponytail-lite pelo mecanismo de instruções do host porque é AGENTS.md. Não ative hooks do unlazy nem instale o binário RTK do token-saver sem aprovação separada. Ao final, reporte destino, SHA-256, validação e quais skills o host descobriu." +} diff --git a/src/content/skillSources/caveman.json b/src/content/skillSources/caveman.json new file mode 100644 index 0000000..90df459 --- /dev/null +++ b/src/content/skillSources/caveman.json @@ -0,0 +1,4 @@ +{ + "id": "caveman", + "url": "https://github.com/JuliusBrussee/caveman/blob/3b74643f4d910f496babd4e634b1ba7168816f14/skills/caveman/SKILL.md" +} diff --git a/src/content/skillSources/debug.json b/src/content/skillSources/debug.json new file mode 100644 index 0000000..e755a4c --- /dev/null +++ b/src/content/skillSources/debug.json @@ -0,0 +1,4 @@ +{ + "id": "debug", + "url": "https://github.com/mattpocock/skills/blob/6654f6b60cd9d5be8b54c6fafe44346dabeb3b76/skills/engineering/diagnosing-bugs/SKILL.md" +} diff --git a/src/content/skillSources/ponytail.json b/src/content/skillSources/ponytail.json new file mode 100644 index 0000000..aad5fce --- /dev/null +++ b/src/content/skillSources/ponytail.json @@ -0,0 +1,4 @@ +{ + "id": "ponytail", + "url": "https://github.com/ilindaniel/ponytail-lite/blob/e7b42dc2d384a702240dea4d52a7bf5530b821b6/AGENTS.md" +} diff --git a/src/content/skillSources/research.json b/src/content/skillSources/research.json new file mode 100644 index 0000000..f5d509d --- /dev/null +++ b/src/content/skillSources/research.json @@ -0,0 +1,4 @@ +{ + "id": "research", + "url": "https://github.com/mattpocock/skills/blob/6654f6b60cd9d5be8b54c6fafe44346dabeb3b76/skills/engineering/research/SKILL.md" +} diff --git a/src/content/skillSources/review.json b/src/content/skillSources/review.json new file mode 100644 index 0000000..a46ec68 --- /dev/null +++ b/src/content/skillSources/review.json @@ -0,0 +1,4 @@ +{ + "id": "review", + "url": "https://github.com/mattpocock/skills/blob/6654f6b60cd9d5be8b54c6fafe44346dabeb3b76/skills/engineering/code-review/SKILL.md" +} diff --git a/src/content/skillSources/tokens.json b/src/content/skillSources/tokens.json new file mode 100644 index 0000000..72d9a70 --- /dev/null +++ b/src/content/skillSources/tokens.json @@ -0,0 +1,4 @@ +{ + "id": "tokens", + "url": "https://github.com/aetox-skills/token-saver/blob/8f21188bb043fad411f47e2e57f0365a83c13da7/SKILL.md" +} diff --git a/src/content/skillSources/unlazy.json b/src/content/skillSources/unlazy.json new file mode 100644 index 0000000..a363ebe --- /dev/null +++ b/src/content/skillSources/unlazy.json @@ -0,0 +1,4 @@ +{ + "id": "unlazy", + "url": "https://github.com/Leonxlnx/unlazy/blob/473d4b80421c36d733042434cd4b938f81a19ef1/SKILL.md" +}