longcipher/pb-spec

pb-build

Execute a spec task-by-task via a strict TDD loop (Red → Green → Refactor → selective Mutate).

Voir la source

Mode d’emploi

  1. Copiez la commande et examinez le paquet avant de l’installer dans votre environnement agent.
  2. Consultez le document original pour les outils, identifiants et environnements requis.
  3. Décrivez les entrées et le livrable souhaité ; comparez la sortie aux sources.
npx skills add https://github.com/longcipher/pb-spec --skill pb-build

Avant de commencer

  • L’installation n’inclut ni abonnement au modèle, ni quota API, ni accès aux fichiers.
  • Étoiles et installations reflètent l’activité, pas un test indépendant de qualité ou de sécurité.
Document Skill original

Rendu depuis le dépôt source en conservant titres, exemples, code, tableaux, liens et images.

pb-build

Execute the spec task-by-task. The spec is the source of truth.

Workflow

1. Load spec and resolve tasks

  • Resolve <spec-dir> from actual directory names under specs/. Never guess.
  • Parse ### Task X.Y: blocks (4 fields, schema in docs/contract.md), build the dependency graph from DependsOn (cycle → stop), and execute in dependency order. Independent tasks may run in parallel subagents; same-file tasks must not.

2. Per task — strict TDD loop

  1. Red: write the failing test first (unit + property tests where applicable; for bug fixes the reproducer IS the red test) → verify it fails. If you wrote code before the test, delete it and start over.
  2. Green: minimum implementation → verify pass.
  3. Refactor: clean up → suite still green.
  4. Verify layers: per the project testing principle, add integration/E2E/fuzz coverage the task's test matrix calls for — boundary and exception paths included. No production code without a failing test first; no completion claims without fresh evidence (run the command, paste output, check exit code — "should pass" is a lie).

3. Mutation testing — selective and scope-bounded

Mutation testing is very slow. Do NOT run it unconditionally:

  • Run it when the task touches core logic with subtle correctness risk (parsers, state machines, gas/crypto/boundary math, concurrency), or when the spec's TDD & Mutation Testing Strategy marks it required.
  • Scope it strictly: mutate only the files changed by this task — pb-spec mutate --against <base> or the project's diff-based script. Never whole-repo runs. Prefer targeted selection (e.g. mutmut path filters) to shrink the run further.
  • Skip it for infra, config, docs, trivial getters/setters, and UI code.
  • Surviving mutants on changed code are test failures: strengthen assertions until they are killed — or record a justified exemption in the task.

4. Failures and handoff

  • Per-task failure retry: 1st → retry with the error as hint; 2nd → root-cause analysis before retrying; 3rd → emit a Build Blocked / DCR packet (3 fields: Reason / Requested Change / Impact) and stop, hand off to /pb-refine.
  • After each task: flip its Status: to 🟢 DONE in tasks.md and append a one-line result (task, commits, verdict) to the spec's progress notes.
  • All tasks done → run the full suite once, emit a handoff summary (what shipped, evidence, next steps). On session resume, trust files over memory.

Constraints

  • Never improvise beyond the spec: ambiguity or defect → DCR packet, not silent "improvement".
  • The only permitted edits under specs/ are bookkeeping: flipping task Status: markers and

appending progress notes. Any design/content change goes through a DCR packet instead.

  • Never commit/push unless explicitly asked.
  • Incremental tests after each task; full suite only at the end.
  • Match AGENTS.md conventions.

Tâches connexes

du même dépôt

Autres Skills

Tous les Skills