跳到正文
cccskills
免费在 GitHub 公开

power-tdd

Use when implementing any feature or fixing any bug, before writing implementation code

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(2)

  • SKILL.md2.9 KB
  • agents/openai.yaml172 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Test First

The iron law

No production code without a failing test first.

Not "usually". Not "unless it's small". The rule has no exception clause, because every exception anyone has proposed was a case where the test was skipped and the bug shipped.

The cycle

RED — write one failing test

One test, for one behavior, with a name that says what the behavior is. Use real code, not mocks of the thing you are testing. A mock of your own function tests that you can configure a mock.

Before you write it, name the production change that would make this test fail. If you cannot name it, you do not yet know what you are testing.

Verify RED — mandatory

Run it. Watch it fail. Then check why it failed:

  • It must fail, not error. An import error is not a red test.
  • It must fail because the behavior is missing, not because of a typo, a missing fixture, or a wrong path.
  • If it passes, you are testing behavior that already exists. Stop and find the real gap.

Skipping this step is where the whole cycle stops working, because a test that never failed proves nothing when it passes.

GREEN — the minimum

Write the least code that makes it pass. No speculative parameters, no "we'll need this later", no configuration for a case nobody asked for.

Verify GREEN

Run it and watch it pass. Then run the surrounding suite: your change must not have broken anything. Read the output — not the exit code alone.

REFACTOR — only on green

Improve names and structure with the tests passing. Run them again after.

If you wrote code first

Delete it. Do not keep it in a scratch file, do not adapt it, do not look at it while writing the test. Code you can see is code the test will be shaped to fit, which produces a test that passes for the wrong reason.

Rationalizations

ThoughtReality
"It's a one-line change"One-line changes ship bugs. That is why they are worth a test.
"I'll add the test after"The test after is shaped by the code. It tests what you built, not what was needed.
"It's just a config value"If a wrong value breaks things, a test can catch a wrong value.
"There's no framework here"Then the first task is the framework, and it is a real task.
"I already know it works"Then the test passes immediately and costs a minute. Write it.
"The test would be trivial"Trivial tests catch typos, which are the most common defect.
"This is exploratory"Exploration is a spike, and its code is throwaway. Label it and delete it.

Regression tests

A bugfix needs a test that fails before the fix and passes after. Prove it both ways: write the test, watch it fail, apply the fix, watch it pass, revert the fix and watch it fail again, restore. A regression test you never saw fail is a regression test you cannot trust.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Accessibility auditing and remediation skill for Vue 3 + Reka UI. Use when reviewing components, verifying WCAG 2.1 AA, fixing ARIA issues, or validating keyboard navigation in Reka UI components.

中文简介正在准备中。当前显示原文说明。

pwdev-solucoes/pwdev-claude-marketplace32026年10月15日 更新

ai-infra

免费

Infraestrutura para IA — GPU, servidores MCP, gateway de LLM, pipeline de inferência, custo de token, cache semântico e observabilidade de modelo. Use quando o usuário disser "GPU", "MCP server", "LLM", "inferência", "modelo", "gateway de IA", "custo de token", "rate limit da API de IA", "self-host de modelo".

中文简介正在准备中。当前显示原文说明。

pwdev-solucoes/pwdev-claude-marketplace32026年10月15日 更新

alt-text

免费

Escreve texto alternativo e descrição de imagem para peças de rede social. Use quando o usuário disser "alt text", "texto alternativo", "descrição da imagem", "acessibilidade da peça", "descrever para leitor de tela", ou automaticamente antes de qualquer publicação. Obrigatório em todas as peças — em carrossel, um por slide.

中文简介正在准备中。当前显示原文说明。

pwdev-solucoes/pwdev-claude-marketplace32026年10月15日 更新

Organiza, compara e seleciona entre as variações geradas, e publica a grade de comparação como Artifact para aprovação do time. Use quando o usuário disser "qual dessas", "comparar as variações", "escolher a melhor", "mostrar as opções", "montar grade de aprovação", ou após qualquer lote de geração. Selecionar é trabalho, não detalhe.

中文简介正在准备中。当前显示原文说明。

pwdev-solucoes/pwdev-claude-marketplace32026年10月15日 更新

Aumenta resolução e qualidade de imagem via Freepik/Magnific, ou orienta o processo manual quando não há chave. Use quando o usuário disser "upscale", "melhorar a resolução", "a imagem está pixelada", "Magnific", "Freepik", "aumentar a imagem", "imagem pequena demais". Gasta crédito — exige confirmação.

中文简介正在准备中。当前显示原文说明。

pwdev-solucoes/pwdev-claude-marketplace32026年10月15日 更新

CI/CD e automação — GitHub Actions, Terraform, OpenTofu, Ansible, n8n. Use quando o usuário disser "pipeline", "CI/CD", "GitHub Actions", "workflow", "terraform", "ansible", "n8n", "automatizar", "deploy automático", "IaC".

中文简介正在准备中。当前显示原文说明。

pwdev-solucoes/pwdev-claude-marketplace32026年10月15日 更新

查看 pwdev-solucoes 的全部技能

报告此技能的问题