docs: extract guide design into reusable skills

This commit is contained in:
Marcos Paulo
2026-09-04 02:57:42 +00:00
parent 5ff258ded5
commit a7034db94b
11 changed files with 307 additions and 0 deletions
+6
View File
@@ -41,6 +41,7 @@ npm run verify
- `hands-on/starter/` — dependency-free Tiny Tasks exercise - `hands-on/starter/` — dependency-free Tiny Tasks exercise
- `hands-on/rules/` — dependency-free Guardrails lab; toggles rule sources into the prompt - `hands-on/rules/` — dependency-free Guardrails lab; toggles rule sources into the prompt
- `rules/` — bilingual case study of skills, CLI ratchets, Husky, and PR review - `rules/` — bilingual case study of skills, CLI ratchets, Husky, and PR review
- `skills/` — reusable design and rules-case-study skills extracted from this implementation
- `GATES.md` — acceptance ledger for the project - `GATES.md` — acceptance ledger for the project
## Publishing ## Publishing
@@ -74,3 +75,8 @@ skills, machine-readable repo ledgers, a UI contract ratchet, lint-staged,
Husky, commitlint, specialist verifier agents, and PR review reinforce one Husky, commitlint, specialist verifier agents, and PR review reinforce one
another. Every example links to its source file in Gitea, and the page includes another. Every example links to its source file in Gitea, and the page includes
a copy-ready prompt for mapping the same layers in another repository. a copy-ready prompt for mapping the same layers in another repository.
The implementation patterns are also packaged as project-local skills in
[skills/](skills/README.md). Use `editorial-playbook` when adding chapters or
sections, and `rules-case-study` when turning repository controls into a
source-linked teaching page.
+92
View File
@@ -0,0 +1,92 @@
const languageCopy = {
en: {
back: 'field guide', navPipeline: 'Pipeline', navExamples: 'Examples', stageContext: 'CONTEXT', stageReview: 'REVIEW', heroEyebrow: 'A real repository case study', heroTitle: 'Rules that<br />survive the <em>prompt.</em>',
heroText: 'Prompts ask for behavior. Repositories preserve it. The interview project combines written context, reusable skills, executable checks, commit hooks, and independent review so the rule is still present when the conversation is gone.',
heroAside: '8 skills · 3 agents · 4 enforcement layers', thesisLabel: 'THE SHORT VERSION', thesis: 'A prompt is advice for one run. A repository rule is reusable context plus an executable boundary.',
pipelineLabel: 'Enforcement pipeline', pipelineMeta: 'select a checkpoint', pipelineEyebrow: 'From intent to evidence', pipelineTitle: 'Five places<br />a rule can <em>hold.</em>', pipelineText: 'Not every rule belongs in a hook. Put guidance where an agent can discover it, deterministic policy in a command, cheap checks at commit time, and independent judgment at review.',
skillsLabel: 'Project-local skills', skillsMeta: 'procedures born from repeated friction', skillsEyebrow: 'Small instruction packages', skillsTitle: 'Teach the trap.<br />Name the <em>trigger.</em>', skillsText: 'These skills are not downloaded magic. They are repository-specific procedures under <code>.agents/skills/</code>, distilled from mistakes, commands, and architectural decisions that kept recurring.', skillGate: 'prove green is real', skillParallel: 'worktree per task', skillRepo: 'query before crawling', skillDebt: 'separate line of work', skillWriter: 'repeat twice, encode once', skillArea: 'stack-specific traps',
examplesLabel: 'Concrete examples', examplesMeta: 'open the source, then adapt', ratchetLabel: 'CLI RATCHET', ratchetTitle: 'Debt may go down.<br />Never silently up.', hookTitle: 'Fast checks before history.', commitLabel: 'COMMIT MESSAGE', commitTitle: 'Intent has a grammar.', reviewLabel: 'INDEPENDENT REVIEW', reviewTitle: 'A second reader checks intent.', readChecker: 'Read the checker →', readHook: 'Read the hook →', readCommit: 'Read commitlint config →', readReview: 'Read review policy →',
copyLabel: 'COPY / ADAPT', copyTitle: 'Ask your agent to map the enforcement stack.', copyText: 'Use this in the interview repository or adapt the path names to another project.', copyButton: 'COPY PROMPT', deeperLabel: 'GO DEEPER', deeperTitle: 'Read the implementation, not just this summary.', deepContext: 'Repository context', deepSkills: 'Skill catalog', deepAgents: 'Specialist agents', deepPolicy: 'Staged-file policy'
},
pt: {
back: 'guia de campo', navPipeline: 'Pipeline', navExamples: 'Exemplos', stageContext: 'CONTEXTO', stageReview: 'REVISÃO', heroEyebrow: 'Um estudo de caso de repositório real', heroTitle: 'Regras que<br />sobrevivem ao <em>prompt.</em>',
heroText: 'Prompts pedem comportamento. Repositórios o preservam. O projeto interview combina contexto escrito, skills reutilizáveis, verificações executáveis, hooks de commit e revisão independente para que a regra continue existindo quando a conversa terminar.',
heroAside: '8 skills · 3 agentes · 4 camadas de enforcement', thesisLabel: 'A VERSÃO CURTA', thesis: 'Um prompt orienta uma execução. Uma regra de repositório é contexto reutilizável mais uma fronteira executável.',
pipelineLabel: 'Pipeline de enforcement', pipelineMeta: 'selecione um checkpoint', pipelineEyebrow: 'Da intenção à evidência', pipelineTitle: 'Cinco lugares<br />onde a regra <em>segura.</em>', pipelineText: 'Nem toda regra pertence a um hook. Coloque orientação onde o agente descobre, política determinística em um comando, checks baratos no commit e julgamento independente na revisão.',
skillsLabel: 'Skills locais do projeto', skillsMeta: 'procedimentos nascidos de atrito repetido', skillsEyebrow: 'Pequenos pacotes de instrução', skillsTitle: 'Ensine a armadilha.<br />Nomeie o <em>gatilho.</em>', skillsText: 'Estas skills não são mágica baixada. São procedimentos específicos do repositório em <code>.agents/skills/</code>, extraídos de erros, comandos e decisões arquiteturais recorrentes.', skillGate: 'prove que o verde é real', skillParallel: 'um worktree por tarefa', skillRepo: 'consulte antes de explorar', skillDebt: 'linha de trabalho separada', skillWriter: 'repita duas vezes, codifique uma', skillArea: 'armadilhas da stack',
examplesLabel: 'Exemplos concretos', examplesMeta: 'abra a fonte, depois adapte', ratchetLabel: 'CATRACA CLI', ratchetTitle: 'A dívida pode cair.<br />Nunca subir em silêncio.', hookTitle: 'Checks rápidos antes do histórico.', commitLabel: 'MENSAGEM DE COMMIT', commitTitle: 'A intenção tem gramática.', reviewLabel: 'REVISÃO INDEPENDENTE', reviewTitle: 'Um segundo leitor verifica a intenção.', readChecker: 'Ler o checker →', readHook: 'Ler o hook →', readCommit: 'Ler config do commitlint →', readReview: 'Ler política de revisão →',
copyLabel: 'COPIAR / ADAPTAR', copyTitle: 'Peça ao agente para mapear o enforcement.', copyText: 'Use isto no repositório interview ou adapte os caminhos para outro projeto.', copyButton: 'COPIAR PROMPT', deeperLabel: 'APROFUNDE', deeperTitle: 'Leia a implementação, não apenas este resumo.', deepContext: 'Contexto do repositório', deepSkills: 'Catálogo de skills', deepAgents: 'Agentes especialistas', deepPolicy: 'Política dos arquivos staged'
}
};
const stages = {
context: { number: '01', file: 'AGENTS.md', title: { en: 'Give every agent the same map', pt: 'Dê o mesmo mapa a cada agente' }, text: { en: 'Stack, commands, product boundaries, and known traps load before implementation. This is discoverable guidance—not an executable guarantee.', pt: 'Stack, comandos, limites do produto e armadilhas conhecidas carregam antes da implementação. É orientação descobrível — não garantia executável.' }, code: 'Read AGENTS.md\n→ query .agents/db\n→ load area skill', link: 'https://git.marcospaulo.dev.br/netcracker/interview/src/branch/main/AGENTS.md' },
skills: { number: '02', file: '.agents/skills/', title: { en: 'Load only the relevant procedure', pt: 'Carregue apenas o procedimento relevante' }, text: { en: 'Frontend, Go API, gate discipline, parallel agents, repo databases, issues, skill writing, and tech debt each have a narrow trigger.', pt: 'Frontend, API Go, disciplina de gates, agentes paralelos, bancos do repo, issues, escrita de skills e dívida técnica têm gatilhos estreitos.' }, code: 'request + description\n→ matching SKILL.md\n→ focused workflow', link: 'https://git.marcospaulo.dev.br/netcracker/interview/src/branch/main/.agents/skills' },
cli: { number: '03', file: 'scripts/check-ui-contract.mjs', title: { en: 'Turn measurable policy into a ratchet', pt: 'Transforme política mensurável em catraca' }, text: { en: 'The UI checker counts known violations and fails only when a count rises. Existing debt can be reduced, but a new change cannot quietly increase it.', pt: 'O checker de UI conta violações conhecidas e falha quando o total sobe. Dívida existente pode cair, mas uma mudança não pode aumentá-la em silêncio.' }, code: 'pnpm check:ui\ncurrent ≤ baseline → pass\ncurrent > baseline → fail', link: 'https://git.marcospaulo.dev.br/netcracker/interview/src/branch/main/scripts/check-ui-contract.mjs' },
commit: { number: '04', file: '.husky/pre-commit', title: { en: 'Block cheap mistakes at the boundary', pt: 'Bloqueie erros baratos na fronteira' }, text: { en: 'Husky runs lint-staged plus the whole-tree UI ratchet. Commitlint separately enforces Conventional Commit messages.', pt: 'Husky executa lint-staged mais a catraca de UI da árvore inteira. Commitlint aplica Conventional Commits separadamente.' }, code: 'git commit\n├─ lint-staged\n├─ check:ui\n└─ commitlint', link: 'https://git.marcospaulo.dev.br/netcracker/interview/src/branch/main/.husky/pre-commit' },
review: { number: '05', file: '.pr-review.json', title: { en: 'Reserve judgment for the PR', pt: 'Reserve julgamento para o PR' }, text: { en: 'An AI reviewer checks security, generated-code discipline, test quality, scope, and repository-specific traps. A verifier independently reruns gates before merge.', pt: 'Um revisor de IA verifica segurança, código gerado, qualidade dos testes, escopo e armadilhas do repositório. Um verifier roda os gates novamente antes do merge.' }, code: 'diff + house rules + prior review\n→ findings + risks\n→ human merge decision', link: 'https://git.marcospaulo.dev.br/netcracker/interview/src/branch/main/.pr-review.json' }
};
const skills = {
gate: { name: 'gate-discipline', trigger: { en: 'Before commit, PR, or merge.', pt: 'Antes de commit, PR ou merge.' }, lesson: { en: 'Run canonical gates separately, inspect exit codes, distrust convenient cache hits, and prove generated code is current.', pt: 'Rode gates separadamente, leia exit codes, desconfie de cache conveniente e prove que código gerado está atual.' }, example: 'pnpm lint; echo "lint=$?"', path: '.agents/skills/gate-discipline/SKILL.md' },
parallel: { name: 'parallel-agents', trigger: { en: 'When independent tasks can run concurrently.', pt: 'Quando tarefas independentes podem rodar juntas.' }, lesson: { en: 'One worktree and file ownership per task; prior-art scout first, verifier last, merge sequentially.', pt: 'Um worktree e ownership por tarefa; prior-art scout primeiro, verifier por último, merges sequenciais.' }, example: 'git worktree add .claude/worktrees/task -b feat/task', path: '.agents/skills/parallel-agents/SKILL.md' },
repo: { name: 'repo-db', trigger: { en: 'At task start and before debugging.', pt: 'No início da tarefa e antes de diagnosticar.' }, lesson: { en: 'Query the repo map, canonical commands, and known-issues ledger before crawling thousands of files.', pt: 'Consulte mapa, comandos canônicos e known-issues antes de vasculhar milhares de arquivos.' }, example: "jq -r '.verify[]' .agents/db/commands.json", path: '.agents/skills/repo-db/SKILL.md' },
debt: { name: 'tech-debt', trigger: { en: 'When unrelated debt appears mid-task.', pt: 'Quando dívida não relacionada aparece no meio.' }, lesson: { en: 'Do not smuggle cleanup into a feature. Record it, give it its own branch, and finish the underlying condition.', pt: 'Não esconda limpeza em uma feature. Registre, dê uma branch própria e finalize a condição original.' }, example: 'feature diff ≠ debt cleanup', path: '.agents/skills/tech-debt/SKILL.md' },
writer: { name: 'skill-writer', trigger: { en: 'When a workflow is explained twice.', pt: 'Quando um fluxo é explicado duas vezes.' }, lesson: { en: 'Procedures become skills; isolated facts become known-issues entries. Keep the body short and the trigger discriminating.', pt: 'Procedimentos viram skills; fatos isolados viram known-issues. Corpo curto e gatilho discriminante.' }, example: '.agents/skills/<name>/SKILL.md', path: '.agents/skills/skill-writer/SKILL.md' },
area: { name: 'frontend / go-api', trigger: { en: 'When changing the matching subsystem.', pt: 'Ao alterar o subsistema correspondente.' }, lesson: { en: 'Encode version-specific traps close to the work: Next/React/AntD boundaries, Connect APIs, sqlc types, migrations, and code generation.', pt: 'Codifique armadilhas de versão perto do trabalho: Next/React/AntD, APIs Connect, tipos sqlc, migrations e codegen.' }, example: 'area → local skill → canonical checks', path: '.agents/skills/' }
};
const prompts = {
en: `Inspect this repository's enforcement stack before changing code.\n\n1. Read AGENTS.md.\n2. List .agents/skills and select only skills whose descriptions match the task.\n3. Query .agents/db/commands.json and .agents/db/known-issues.json.\n4. Explain what is guidance versus mechanically enforced by scripts, Husky, commitlint, CI, and PR review.\n5. For each relevant rule, cite the source path and the command that proves it.\n6. Identify gaps where documentation claims enforcement but no executable check exists.\n\nDo not modify files. Return a compact map: rule → source → enforcement point → verification command → remaining gap.`,
pt: `Inspecione a stack de enforcement deste repositório antes de alterar código.\n\n1. Leia AGENTS.md.\n2. Liste .agents/skills e selecione apenas skills cuja descrição corresponda à tarefa.\n3. Consulte .agents/db/commands.json e .agents/db/known-issues.json.\n4. Explique o que é orientação e o que é imposto mecanicamente por scripts, Husky, commitlint, CI e revisão de PR.\n5. Para cada regra relevante, cite o caminho fonte e o comando que a comprova.\n6. Identifique lacunas onde a documentação promete enforcement sem check executável.\n\nNão modifique arquivos. Retorne um mapa compacto: regra → fonte → ponto de enforcement → comando de verificação → lacuna restante.`
};
let language = localStorage.getItem('rules-language') === 'pt' ? 'pt' : 'en';
function select(selector, value, key) {
document.querySelectorAll(selector).forEach((button) => {
const active = button.dataset[key] === value;
button.classList.toggle('active', active);
button.setAttribute('aria-selected', String(active));
});
}
function renderStage(id) {
const item = stages[id];
document.querySelector('#stage-detail').innerHTML = `<div class="stage-number">${item.number}</div><div><span>${item.file}</span><h3>${item.title[language]}</h3><p>${item.text[language]}</p><a href="${item.link}">${language === 'pt' ? 'ABRIR FONTE ↗' : 'OPEN SOURCE ↗'}</a></div><pre><code>${item.code}</code></pre>`;
select('[data-stage]', id, 'stage');
}
function renderSkill(id) {
const item = skills[id];
document.querySelector('#skill-detail').innerHTML = `<header><span>${language === 'pt' ? 'GATILHO' : 'TRIGGER'}</span><strong>${item.trigger[language]}</strong></header><h3>${item.name}</h3><p>${item.lesson[language]}</p><pre><code>${item.example}</code></pre><a href="https://git.marcospaulo.dev.br/netcracker/interview/src/branch/main/${item.path}">${language === 'pt' ? 'LER SKILL ↗' : 'READ SKILL ↗'}</a>`;
select('[data-skill]', id, 'skill');
}
function renderLanguage(next) {
language = next;
document.documentElement.lang = language === 'pt' ? 'pt-BR' : 'en';
document.querySelectorAll('[data-copy]').forEach((node) => { node.innerHTML = languageCopy[language][node.dataset.copy]; });
document.querySelector('#explore-prompt').textContent = prompts[language];
document.querySelectorAll('[data-lang]').forEach((button) => { const active = button.dataset.lang === language; button.classList.toggle('active', active); button.setAttribute('aria-pressed', String(active)); });
renderStage(document.querySelector('[data-stage].active')?.dataset.stage || 'context');
renderSkill(document.querySelector('[data-skill].active')?.dataset.skill || 'gate');
localStorage.setItem('rules-language', language);
}
async function copyPrompt() {
const value = prompts[language];
try {
await navigator.clipboard.writeText(value);
document.querySelector('#copy-status').textContent = language === 'pt' ? 'Prompt copiado.' : 'Prompt copied.';
} catch {
document.querySelector('#copy-status').textContent = language === 'pt' ? 'Selecione o texto manualmente.' : 'Select the text manually.';
}
}
document.querySelectorAll('[data-stage]').forEach((button) => button.addEventListener('click', () => renderStage(button.dataset.stage)));
document.querySelectorAll('[data-skill]').forEach((button) => button.addEventListener('click', () => renderSkill(button.dataset.skill)));
document.querySelectorAll('[data-lang]').forEach((button) => button.addEventListener('click', () => renderLanguage(button.dataset.lang)));
document.querySelector('[data-copy-prompt]').addEventListener('click', copyPrompt);
window.addEventListener('scroll', () => { const height = document.documentElement.scrollHeight - innerHeight; document.querySelector('.progress span').style.width = `${height > 0 ? scrollY / height * 100 : 0}%`; }, { passive: true });
renderLanguage(language);
+102
View File
@@ -0,0 +1,102 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="A concise case study of agent skills, CLI ratchets, Husky hooks, and PR review in netcracker/interview." />
<title>Rules That Survive the Prompt — AI For Dummies</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="progress" aria-hidden="true"><span></span></div>
<header class="topbar">
<a class="back" href="../"><b>A</b><span data-copy="back">field guide</span></a>
<nav aria-label="Page sections"><a href="#pipeline" data-copy="navPipeline">Pipeline</a><a href="#skills">Skills</a><a href="#examples" data-copy="navExamples">Examples</a></nav>
<div class="languages" aria-label="Language"><button class="active" data-lang="en" aria-pressed="true">EN</button><span>/</span><button data-lang="pt" aria-pressed="false">PT</button></div>
</header>
<main>
<section class="hero">
<p class="eyebrow" data-copy="heroEyebrow">A real repository case study</p>
<h1 data-copy="heroTitle">Rules that<br />survive the <em>prompt.</em></h1>
<div class="hero-foot">
<p data-copy="heroText">Prompts ask for behavior. Repositories preserve it. The interview project combines written context, reusable skills, executable checks, commit hooks, and independent review so the rule is still present when the conversation is gone.</p>
<aside><span>CASE / NETCRACKER</span><strong>interview</strong><small data-copy="heroAside">8 skills · 3 agents · 4 enforcement layers</small></aside>
</div>
</section>
<section class="thesis">
<span data-copy="thesisLabel">THE SHORT VERSION</span>
<strong data-copy="thesis">A prompt is advice for one run. A repository rule is reusable context plus an executable boundary.</strong>
</section>
<section class="pipeline-section" id="pipeline">
<div class="section-label"><span data-copy="pipelineLabel">Enforcement pipeline</span><span data-copy="pipelineMeta">select a checkpoint</span></div>
<div class="intro"><div><p class="eyebrow" data-copy="pipelineEyebrow">From intent to evidence</p><h2 data-copy="pipelineTitle">Five places<br />a rule can <em>hold.</em></h2></div><p data-copy="pipelineText">Not every rule belongs in a hook. Put guidance where an agent can discover it, deterministic policy in a command, cheap checks at commit time, and independent judgment at review.</p></div>
<div class="pipeline" role="tablist" aria-label="Rule enforcement stages">
<button class="active" data-stage="context" role="tab" aria-selected="true"><span>01</span><strong data-copy="stageContext">CONTEXT</strong><small>AGENTS.md</small></button>
<i></i><button data-stage="skills" role="tab" aria-selected="false"><span>02</span><strong>SKILLS</strong><small>.agents/skills</small></button>
<i></i><button data-stage="cli" role="tab" aria-selected="false"><span>03</span><strong>CLI</strong><small>check:ui</small></button>
<i></i><button data-stage="commit" role="tab" aria-selected="false"><span>04</span><strong>COMMIT</strong><small>Husky</small></button>
<i></i><button data-stage="review" role="tab" aria-selected="false"><span>05</span><strong data-copy="stageReview">REVIEW</strong><small>pragent</small></button>
</div>
<article class="stage-detail" id="stage-detail" aria-live="polite"></article>
</section>
<section class="skill-section" id="skills">
<div class="section-label"><span data-copy="skillsLabel">Project-local skills</span><span data-copy="skillsMeta">procedures born from repeated friction</span></div>
<div class="intro"><div><p class="eyebrow" data-copy="skillsEyebrow">Small instruction packages</p><h2 data-copy="skillsTitle">Teach the trap.<br />Name the <em>trigger.</em></h2></div><p data-copy="skillsText">These skills are not downloaded magic. They are repository-specific procedures under <code>.agents/skills/</code>, distilled from mistakes, commands, and architectural decisions that kept recurring.</p></div>
<div class="skill-console">
<div class="skill-list" role="tablist" aria-label="Repository skills">
<button class="active" data-skill="gate" role="tab" aria-selected="true"><strong>gate-discipline</strong><small data-copy="skillGate">prove green is real</small></button>
<button data-skill="parallel" role="tab" aria-selected="false"><strong>parallel-agents</strong><small data-copy="skillParallel">worktree per task</small></button>
<button data-skill="repo" role="tab" aria-selected="false"><strong>repo-db</strong><small data-copy="skillRepo">query before crawling</small></button>
<button data-skill="debt" role="tab" aria-selected="false"><strong>tech-debt</strong><small data-copy="skillDebt">separate line of work</small></button>
<button data-skill="writer" role="tab" aria-selected="false"><strong>skill-writer</strong><small data-copy="skillWriter">repeat twice, encode once</small></button>
<button data-skill="area" role="tab" aria-selected="false"><strong>frontend / go-api</strong><small data-copy="skillArea">stack-specific traps</small></button>
</div>
<article class="skill-detail" id="skill-detail" aria-live="polite"></article>
</div>
</section>
<section class="examples" id="examples">
<div class="section-label"><span data-copy="examplesLabel">Concrete examples</span><span data-copy="examplesMeta">open the source, then adapt</span></div>
<div class="example-grid">
<article><span data-copy="ratchetLabel">CLI RATCHET</span><h3 data-copy="ratchetTitle">Debt may go down.<br />Never silently up.</h3><pre><code>pnpm check:ui
# raw buttons
# swallowed catches
# pages without h1
# hardcoded colours</code></pre><a data-copy="readChecker" data-source="ratchet" href="https://git.marcospaulo.dev.br/netcracker/interview/src/branch/main/scripts/check-ui-contract.mjs">Read the checker →</a></article>
<article><span>HUSKY / PRE-COMMIT</span><h3 data-copy="hookTitle">Fast checks before history.</h3><pre><code>pnpm exec lint-staged
node scripts/check-ui-contract.mjs</code></pre><a data-copy="readHook" data-source="hooks" href="https://git.marcospaulo.dev.br/netcracker/interview/src/branch/main/.husky/pre-commit">Read the hook →</a></article>
<article><span data-copy="commitLabel">COMMIT MESSAGE</span><h3 data-copy="commitTitle">Intent has a grammar.</h3><pre><code>pnpm exec commitlint --edit $1
feat: add interview timer
fix(api): scope session query</code></pre><a data-copy="readCommit" data-source="commit" href="https://git.marcospaulo.dev.br/netcracker/interview/src/branch/main/commitlint.config.cjs">Read commitlint config →</a></article>
<article><span data-copy="reviewLabel">INDEPENDENT REVIEW</span><h3 data-copy="reviewTitle">A second reader checks intent.</h3><pre><code>.pr-review.json
├── focus
├── exclude_paths
├── languages
└── instructions</code></pre><a data-copy="readReview" data-source="review" href="https://git.marcospaulo.dev.br/netcracker/interview/src/branch/main/.pr-review.json">Read review policy →</a></article>
</div>
</section>
<section class="copy-lab">
<div><span data-copy="copyLabel">COPY / ADAPT</span><h2 data-copy="copyTitle">Ask your agent to map the enforcement stack.</h2><p data-copy="copyText">Use this in the interview repository or adapt the path names to another project.</p></div>
<article><button data-copy-prompt><span data-copy="copyButton">COPY PROMPT</span><b></b></button><pre><code id="explore-prompt"></code></pre><p id="copy-status" role="status" aria-live="polite"></p></article>
</section>
<section class="deeper">
<div><span data-copy="deeperLabel">GO DEEPER</span><strong data-copy="deeperTitle">Read the implementation, not just this summary.</strong></div>
<nav>
<a href="https://git.marcospaulo.dev.br/netcracker/interview/src/branch/main/AGENTS.md"><span>01</span><b data-copy="deepContext">Repository context</b><small>AGENTS.md</small></a>
<a href="https://git.marcospaulo.dev.br/netcracker/interview/src/branch/main/.agents/skills"><span>02</span><b data-copy="deepSkills">Skill catalog</b><small>.agents/skills/</small></a>
<a href="../skills/"><span>03</span><b>Design skills</b><small>skills/</small></a>
<a href="https://git.marcospaulo.dev.br/netcracker/interview/src/branch/main/.claude/agents"><span>03</span><b data-copy="deepAgents">Specialist agents</b><small>.claude/agents/</small></a>
<a href="https://git.marcospaulo.dev.br/netcracker/interview/src/branch/main/.lintstagedrc.cjs"><span>04</span><b data-copy="deepPolicy">Staged-file policy</b><small>.lintstagedrc.cjs</small></a>
</nav>
</section>
</main>
<script src="app.js" defer></script>
</body>
</html>
+6
View File
File diff suppressed because one or more lines are too long
+10
View File
@@ -0,0 +1,10 @@
# Reusable skills
These project-local skills extract the design and implementation patterns used by AI For Dummies. They are intentionally small: copy a skill into an agent's skill directory, or give the `SKILL.md` path to an agent when building a new chapter.
## Skills
- [`editorial-playbook`](editorial-playbook/SKILL.md) — shape a content-led, responsive, bilingual explainer with small interactive islands.
- [`rules-case-study`](rules-case-study/SKILL.md) — turn repository rules, skills, CLI checks, hooks, and review policy into a source-linked teaching page.
The reference files are deliberately disclosed beside each skill. The `evals/evals.json` files contain small prompts for checking that an agent reaches the right workflow.
+19
View File
@@ -0,0 +1,19 @@
---
name: editorial-playbook
description: Use when building or reshaping a content-led interactive explainer, technical playbook, or presentation-like static page; define the information architecture, visual system, responsive behavior, bilingual copy, and minimal interactive islands before coding.
---
# Editorial playbook
Treat the page as a guided argument, not a dashboard. Give it one audience, one job, and one memorable thesis.
## Workflow
1. Write the chapter map before markup. Every section gets a stable slug, number, title, purpose, and a single interaction or proof point when useful. Reach for [page anatomy](references/page-anatomy.md) when adding a new section.
2. Compose from a few editorial primitives: label, thesis, pipeline or diagram, comparison/table, code panel, callout, source card, and next-chapter link. Keep the content model separate from rendering so more sections stay cheap.
3. Use a restrained visual system: paper background, ink text, muted copy, one cool accent, one warm signal, hairlines, and typography with a strong display/body contrast. Prefer intentional asymmetry and generous rhythm over cards everywhere.
4. Keep runtime light. Use plain HTML/CSS/JS for static, mostly content-led pages. Choose Astro or MDX only when many chapters need shared templates, content collections, or build-time localization. Preserve an existing framework when it already owns routing and tokens.
5. Make the page bilingual at the content boundary. Pair English and Portuguese strings, toggle the document language, persist the choice, and translate labels, controls, status text, and dynamic details—not paths, commands, or code.
6. Make interactions causal and inspectable. One active state should explain one idea; expose it with keyboard focus, an accessible state, a live status region, copy feedback, and a reduced-motion path.
7. Design for mobile, Full HD, and 4K. Use fluid type and spacing, cap readable measure, stack dense regions at narrow widths, keep diagrams scrollable only when semantically necessary, and test 390px, 1920px, and 3840px viewports.
8. Finish with evidence: content verification, JavaScript syntax checks, interaction tests, responsive browser checks, and a diff check. The section is done when its content, dynamic states, links, and three viewport classes pass.
@@ -0,0 +1,10 @@
[
{
"prompt": "Add a new bilingual chapter to a dependency-free static explainer with one diagram and one copy control. What should you decide and verify first?",
"expected_behavior": "Create a chapter map and content model first; pair EN/PT strings; use a small accessible interaction; verify mobile, Full HD, and 4K behavior."
},
{
"prompt": "The explainer needs 20 more sections but has no data source for section metadata. Recommend a lightweight implementation.",
"expected_behavior": "Keep content in structured data and render shared editorial primitives; recommend plain HTML/CSS/JS for a small static site, or Astro/MDX when shared build-time content collections justify it."
}
]
@@ -0,0 +1,16 @@
# Page anatomy
Use this as a compact design contract for a new AI For Dummies chapter.
1. **Orientation** — eyebrow, chapter number, title, short promise, language control.
2. **Thesis** — one sentence that changes how the reader sees the topic.
3. **Model** — a pipeline, tree, timeline, or comparison that makes the relationship visible.
4. **Practice** — a copy-ready prompt, command, example, or tiny exercise.
5. **Proof** — source paths, checks, observed behavior, and the boundary between advice and enforcement.
6. **Transfer** — a small “use this next” link to the next chapter or deeper source.
Keep the first screen editorial and calm. Let code, diagrams, and controls earn their space by teaching something. Avoid a generic hero followed by an undifferentiated card grid.
## Section contract
Each new section should answer: what does the reader learn, what is the visible proof, what can they copy or try, and what source supports it? Add its copy to the language map before adding a control. Add its slug to navigation only after the section has a stable purpose.
+18
View File
@@ -0,0 +1,18 @@
---
name: rules-case-study
description: Use when explaining how a repository turns agent guidance into enforceable behavior across context files, skills, CLI checks, Git hooks, CI, worktrees, or PR review; build a concise, source-linked case-study page.
---
# Rules case study
Show the control loop: context → skills → CLI → commit → review. The reader should see where a rule lives, what executes it, and how to verify it.
## Workflow
1. Inspect authoritative files before writing copy. Start with the repository context file, skill directory, command or database ledger, enforcement scripts, hooks, staged-file config, CI, and review policy. Use [the interview source map](references/interview-source-map.md) as a routing hint, then confirm paths in the target repository.
2. Separate guidance from enforcement. A context file or skill teaches an agent; a CLI check, hook, CI job, or reviewer blocks or reports behavior. Never describe prose as mechanically enforced.
3. For every example, show the rule, exact source path, enforcement point, verification command, and remaining gap. Prefer one concrete ratchet or hook example over a list of vague best practices.
4. Add a skills shelf. Each skill needs a trigger, the lesson it carries, a tiny example, and a source link. Keep examples short enough to copy into an agent prompt.
5. Include a read-only exploration prompt that asks an agent to map rules to evidence and gaps. Add copy feedback and bilingual labels if the host guide supports both languages.
6. Use a dependency-free standalone page when the case study is mostly explanatory. Link back to the main guide and exact source files. Do not modify the source repository merely to document it.
7. Verify dynamic stage and skill states, source links, copy behavior, language switching, no horizontal overflow, and the 390px/1920px/3840px viewports. The page is done when every claim has a source or is clearly labeled as a design recommendation.
+10
View File
@@ -0,0 +1,10 @@
[
{
"prompt": "Explain a repository's AGENTS.md, reusable skills, UI ratchet script, Husky hooks, and PR review config as one teachable page.",
"expected_behavior": "Build a context → skills → CLI → commit → review pipeline; link every claim to an exact source path; distinguish guidance from enforcement; include a short read-only exploration prompt."
},
{
"prompt": "A skill says all pages need an h1 and a pre-commit script checks it. How should the case study describe that relationship?",
"expected_behavior": "Describe the skill/context as guidance and the script/hook as executable enforcement, then show the verification command and any gap between local hooks and CI."
}
]
@@ -0,0 +1,18 @@
# Interview source map
This map records the implementation inspected for the rules case study. Reconfirm paths when the source repository changes.
| Concern | Source | Role |
| --- | --- | --- |
| Shared context | `AGENTS.md` | Stack, commands, product shape, conventions, and verification expectations. |
| Reusable procedures | `.agents/skills/` | Focused workflows such as gates, frontend, Go API, repo DB, and skill writing. |
| Machine-readable routing | `.agents/db/commands.json` | Canonical checks and code-generation commands. |
| UI enforcement | `scripts/check-ui-contract.mjs` | Ratchet for buttons, catches, headings, colors, and duplicate components. |
| Ratchet state | `scripts/ui-contract-baseline.json` | Baseline counts that new violations cannot exceed. |
| Commit boundary | `.husky/pre-commit` | Runs lint-staged and the UI contract check. |
| Commit message boundary | `.husky/commit-msg` | Runs commitlint. |
| Staged-file tools | `.lintstagedrc.cjs` | Biome, ESLint, Prettier, and Buf formatting by file type. |
| Independent review | `.pr-review.json` | Review focus, exclusions, security constraints, and test expectations. |
| Agent roles | `.claude/agents/` | Prior-art scout, scoped implementer, and verifier responsibilities. |
The source of truth is the repository. This table is a teaching map, not a replacement for reading the files.