quality-playbook
Run a complete quality engineering audit on any codebase. Derives behavioral requirements from the code, generates spec-traced functional tests, runs a three-pass code review with regression tests, executes a multi-model spec audit (Council of Three), and produces a consolidated bug report with TDD-verified patches. Finds the 35% of real defects that structural code review alone cannot catch. Works with any language. Trigger on 'quality playbook', 'spec audit', 'Council of Three', 'fitness-to-purpose', or 'coverage theater'.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-11
- Stars
- ★ 90
- Forks
- 14
01 前言 Front Matter
- name
- quality-playbook
- license
- Complete terms in LICENSE.txt
- metadata
- { "author": "Andrew Stellman", "github": "https://github.com/andrewstellman/quality-playbook", "version": "1.6.1" }
- description
- Run a complete quality engineering audit on any codebase. Derives behavioral requirements from the code, generates spec-traced functional tests, runs a three-pass code review with regression tests, executes a multi-model spec audit (Council of Three), and produces a consolidated bug report with TDD-verified patches. Finds the 35% of real defects that structural code review alone cannot catch. Works with any language. Trigger on 'quality playbook', 'spec audit', 'Council of Three', 'fitness-to-purpose', or 'coverage theater'.
02 资源文件 500
- 脚本_qpb_build_backend.py9.9 KB
- 参考文档.claude-plugin/marketplace.json647 B
- 参考文档.github/workflows/publish.yml4.9 KB
- 其他.gitignore4.3 KB
- 其他.npmignore1.3 KB
- 参考文档AGENTS.md37.3 KB
- 参考文档ai_context/AI_ORCHESTRATION_PATTERNS.md33.3 KB
- 参考文档ai_context/BENCHMARK_PROTOCOL.md20.3 KB
- 参考文档ai_context/CALIBRATION_PROTOCOL.md51.3 KB
- 参考文档ai_context/DEVELOPMENT_CONTEXT.md48.7 KB
- 参考文档ai_context/DEVELOPMENT_PROCESS.md55.4 KB
- 参考文档ai_context/IMPROVEMENT_LOOP.md31.3 KB
- 参考文档ai_context/TOOLKIT_TEST_PROTOCOL.md23.3 KB
- 参考文档ai_context/TOOLKIT.md94.7 KB
- 参考文档ai_context/VERSION_HISTORY.md36.5 KB
- 参考文档ai_context/WATCHER_PROMPT.md14.2 KB
- 脚本bin/__init__.py2.6 KB
- 脚本bin/bootstrap_self_audit_docs.py6.9 KB
- 脚本bin/build_channel_package.py33.7 KB
- 脚本bin/classify_project.py35.4 KB
- 脚本bin/copilot_resolver.py8.1 KB
- 脚本bin/harness_demo_worker.py4.6 KB
- 脚本bin/harness_heartbeat.py10.2 KB
- 参考文档bin/HARNESS_LINEAGE.md452 B
- 脚本bin/harness_ticker.py10.2 KB
- 脚本bin/install_skill.py3.4 KB
- 脚本bin/metrics_reconstruction.py29.4 KB
- 脚本bin/progress_monitor.py11.8 KB
- 脚本bin/publish_npm.py23.4 KB
- 脚本bin/publish_pip.py26.7 KB
- 脚本bin/qpb_harness_tick.py36.3 KB
- 脚本bin/qpb_heartbeat.py1.8 KB
- 脚本bin/quality-playbook.js10.3 KB
- 脚本bin/regression_replay.py24.2 KB
- 脚本bin/run_playbook.py283.8 KB
- 脚本bin/skill_derivation/__init__.py1.7 KB
- 脚本bin/skill_derivation/__main__.py26.8 KB
- 脚本bin/skill_derivation/citation_search.py9.3 KB
- 脚本bin/skill_derivation/curate_requirements.py8.6 KB
- 脚本bin/skill_derivation/divergence_execution.py7.0 KB
- 脚本bin/skill_derivation/divergence_internal.py37.9 KB
- 脚本bin/skill_derivation/divergence_prose_to_code_llm.py12.8 KB
- 脚本bin/skill_derivation/divergence_prose_to_code_mechanical.py11.4 KB
- 脚本bin/skill_derivation/divergence_to_bugs.py13.0 KB
- 脚本bin/skill_derivation/execution_gate_loader.py6.8 KB
- 脚本bin/skill_derivation/pass_a.py17.0 KB
- 脚本bin/skill_derivation/pass_b.py8.5 KB
- 脚本bin/skill_derivation/pass_c.py19.8 KB
- 脚本bin/skill_derivation/pass_d.py15.2 KB
- 脚本bin/skill_derivation/phase4_inbox.py9.5 KB
- 参考文档bin/skill_derivation/prompts/pass_a_section.md4.2 KB
- 参考文档bin/skill_derivation/prompts/pass_a_uc_section.md4.2 KB
- 脚本bin/skill_derivation/protocol.py12.1 KB
- 脚本bin/skill_derivation/runners.py12.6 KB
- 脚本bin/skill_derivation/sections.py20.3 KB
- 脚本bin/submit_awesome_copilot.py42.9 KB
- 脚本bin/tests/__init__.py62 B
- 脚本bin/tests/_channel_test_helpers.py4.6 KB
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_a_pass/quality/bugs_manifest.json881 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_a_pass/quality/challenge/BUG-001-challenge.md136 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_a_pass/quality/challenge/BUG-002-challenge.md136 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_a_pass/quality/challenge/BUG-003-challenge.md136 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_a_pass/quality/challenge/BUG-004-challenge.md136 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_a_pass/quality/challenge/BUG-005-challenge.md136 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_a_pass/quality/challenge/BUG-006-challenge.md136 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_c_bad_verdict/quality/bugs_manifest.json216 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_c_bad_verdict/quality/challenge/BUG-001-challenge.md197 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_d_rejected/quality/bugs_manifest.json221 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_d_rejected/quality/challenge/BUG-042-challenge.md183 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_e_iteration/quality/bugs_manifest.json286 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_e_iteration/quality/challenge/BUG-050-challenge.md285 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_e_iteration/quality/requirements_manifest.json626 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_e_iteration/quality/writeups/BUG-050.md154 B
- 参考文档bin/tests/fixtures/challenge_coverage/fixture_f_no_manifest/quality/README.md57 B
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/bugs_manifest.json5.7 KB
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/challenge/BUG-001-challenge.md730 B
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/challenge/BUG-002-challenge.md844 B
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/challenge/BUG-003-challenge.md727 B
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/challenge/BUG-004-challenge.md741 B
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/challenge/BUG-005-challenge.md740 B
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/challenge/BUG-006-challenge.md830 B
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/requirements_manifest.json23.9 KB
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/writeups/BUG-001.md2.0 KB
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/writeups/BUG-002.md2.3 KB
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/writeups/BUG-003.md2.2 KB
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/writeups/BUG-004.md2.3 KB
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/writeups/BUG-005.md2.2 KB
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/writeups/BUG-006.md2.2 KB
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/writeups/BUG-007.md2.5 KB
- 参考文档bin/tests/fixtures/challenge_coverage/virtio-1.4.6/quality/writeups/BUG-008.md2.6 KB
- 参考文档bin/tests/fixtures/classification_review_032/empty.md232 B
- 参考文档bin/tests/fixtures/classification_review_032/formal_records_fallback.md807 B
- 参考文档bin/tests/fixtures/classification_review_032/main_no_offer.md2.7 KB
- 参考文档bin/tests/fixtures/classification_review_032/main_offer.md2.7 KB
- 参考文档bin/tests/fixtures/classification_review_032/zero_authoritative_no_offer.md1.1 KB
- 参考文档bin/tests/fixtures/classification_review_032/zero_authoritative.md1.1 KB
- 脚本bin/tests/fixtures/classify_project/code_fixture/calculator.py2.4 KB
- 脚本bin/tests/fixtures/classify_project/code_fixture/cli.py1.6 KB
- 参考文档bin/tests/fixtures/classify_project/code_fixture/README.md408 B
- 脚本bin/tests/fixtures/multilang_disclosure/mod1.py6 B
- 脚本bin/tests/fixtures/multilang_disclosure/mod2.py6 B
- 脚本bin/tests/fixtures/multilang_disclosure/mod3.py6 B
- 脚本bin/tests/fixtures/multilang_disclosure/mod4.py6 B
- 脚本bin/tests/fixtures/multilang_disclosure/mod5.py6 B
- 脚本bin/tests/fixtures/multilang_disclosure/mod6.py6 B
- 脚本bin/tests/fixtures/multilang_disclosure/mod7.py6 B
- 脚本bin/tests/fixtures/multilang_disclosure/mod8.py6 B
- 参考文档bin/tests/fixtures/multilang_disclosure/README.md318 B
- 脚本bin/tests/fixtures/multilang_disclosure/src1.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src10.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src11.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src12.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src13.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src14.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src15.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src16.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src17.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src18.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src19.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src2.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src20.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src3.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src4.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src5.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src6.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src7.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src8.go13 B
- 脚本bin/tests/fixtures/multilang_disclosure/src9.go13 B
- 脚本bin/tests/fixtures/narrow_margin_tiebreak/f1.rs12 B
- 脚本bin/tests/fixtures/narrow_margin_tiebreak/f1.ts10 B
- 脚本bin/tests/fixtures/narrow_margin_tiebreak/f2.rs12 B
- 脚本bin/tests/fixtures/narrow_margin_tiebreak/f2.ts10 B
- 脚本bin/tests/fixtures/narrow_margin_tiebreak/f3.rs12 B
- 脚本bin/tests/fixtures/narrow_margin_tiebreak/f3.ts10 B
- 脚本bin/tests/fixtures/narrow_margin_tiebreak/f4.rs12 B
- 脚本bin/tests/fixtures/narrow_margin_tiebreak/f4.ts10 B
- 脚本bin/tests/fixtures/narrow_margin_tiebreak/f5.rs12 B
- 脚本bin/tests/fixtures/narrow_margin_tiebreak/f5.ts10 B
- 脚本bin/tests/fixtures/narrow_margin_tiebreak/f6.rs12 B
- 脚本bin/tests/fixtures/narrow_margin_tiebreak/f6.ts10 B
- 参考文档bin/tests/fixtures/narrow_margin_tiebreak/README.md318 B
- 参考文档bin/tests/fixtures/phase2_virtio_mini/formal_docs/virtio-excerpt.meta.json152 B
- 参考文档bin/tests/fixtures/phase2_virtio_mini/formal_docs/virtio-excerpt.txt1020 B
- 参考文档bin/tests/fixtures/phase7_variations/empty_cite_dir/reference_docs/cite/README.md211 B
- 参考文档bin/tests/fixtures/phase7_variations/empty_informal_docs/formal_docs/spec.meta.json73 B
- 参考文档bin/tests/fixtures/phase7_variations/empty_informal_docs/formal_docs/spec.txt365 B
- 参考文档bin/tests/fixtures/phase7_variations/empty_informal_docs/informal_docs/README.md295 B
- 参考文档bin/tests/fixtures/phase7_variations/empty_informal_docs/quality/formal_docs_manifest.json325 B
- 参考文档bin/tests/fixtures/phase7_variations/empty_informal_docs/quality/requirements_manifest.json708 B
- 参考文档bin/tests/fixtures/phase7_variations/malformed_citation/formal_docs/spec.meta.json73 B
- 参考文档bin/tests/fixtures/phase7_variations/malformed_citation/formal_docs/spec.txt436 B
- 参考文档bin/tests/fixtures/phase7_variations/malformed_citation/quality/formal_docs_manifest.json345 B
- 参考文档bin/tests/fixtures/phase7_variations/malformed_citation/quality/requirements_manifest.json769 B
- 参考文档bin/tests/fixtures/phase7_variations/stale_spec/formal_docs/spec.meta.json80 B
- 参考文档bin/tests/fixtures/phase7_variations/stale_spec/formal_docs/spec.txt572 B
- 参考文档bin/tests/fixtures/phase7_variations/stale_spec/quality/formal_docs_manifest.json332 B
- 参考文档bin/tests/fixtures/phase7_variations/stale_spec/quality/requirements_manifest.json831 B
- 参考文档bin/tests/fixtures/render_contract_v160/chi/quality/renumber_map.json386 B
- 参考文档bin/tests/fixtures/render_contract_v160/chi/quality/requirements_manifest.before.json5.1 KB
- 参考文档bin/tests/fixtures/render_contract_v160/chi/quality/requirements_manifest.json5.1 KB
- 参考文档bin/tests/fixtures/render_contract_v160/chi/quality/REQUIREMENTS.before.md16.7 KB
- 参考文档bin/tests/fixtures/render_contract_v160/chi/quality/REQUIREMENTS.md24.5 KB
- 参考文档bin/tests/fixtures/render_contract_v160/chi/quality/RUN_CONTRACT.md3.0 KB
- 参考文档bin/tests/fixtures/render_contract_v160/express/quality/renumber_map.json386 B
- 参考文档bin/tests/fixtures/render_contract_v160/express/quality/requirements_manifest.before.json10.2 KB
- 参考文档bin/tests/fixtures/render_contract_v160/express/quality/requirements_manifest.json11.9 KB
- 参考文档bin/tests/fixtures/render_contract_v160/express/quality/REQUIREMENTS.before.md12.6 KB
- 参考文档bin/tests/fixtures/render_contract_v160/express/quality/REQUIREMENTS.md19.7 KB
- 参考文档bin/tests/fixtures/render_contract_v160/express/quality/RUN_CONTRACT.md3.4 KB
- 参考文档bin/tests/fixtures/render_contract_v160/virtio/quality/renumber_map.json410 B
- 参考文档bin/tests/fixtures/render_contract_v160/virtio/quality/requirements_manifest.before.json7.9 KB
- 参考文档bin/tests/fixtures/render_contract_v160/virtio/quality/requirements_manifest.json9.3 KB
- 参考文档bin/tests/fixtures/render_contract_v160/virtio/quality/REQUIREMENTS.before.md21.3 KB
- 参考文档bin/tests/fixtures/render_contract_v160/virtio/quality/REQUIREMENTS.md23.9 KB
- 参考文档bin/tests/fixtures/render_contract_v160/virtio/quality/RUN_CONTRACT.md3.7 KB
- 脚本bin/tests/test_192_audit_log.py3.5 KB
- 脚本bin/tests/test_192_trim_regression.py3.5 KB
- 脚本bin/tests/test_agents_md.py6.7 KB
- 脚本bin/tests/test_archive_lib.py31.6 KB
- 脚本bin/tests/test_archive_preservation.py16.7 KB
- 脚本bin/tests/test_banner_version_059.py3.7 KB
- 脚本bin/tests/test_benchmark_lib.py29.2 KB
- 脚本bin/tests/test_bug_heading_pattern_pinned.py6.1 KB
- 脚本bin/tests/test_cardinality_gate.py35.6 KB
- 脚本bin/tests/test_channel_artifact_hygiene_089y.py11.5 KB
- 脚本bin/tests/test_channel_install_e2e_090b.py19.5 KB
- 脚本bin/tests/test_citation_stale.py10.5 KB
- 脚本bin/tests/test_citation_verifier.py24.8 KB
- 脚本bin/tests/test_classification_gate_v160.py11.5 KB
- 脚本bin/tests/test_classification_review_v160.py53.2 KB
- 脚本bin/tests/test_classifier_cache_and_polish_032.py51.5 KB
- 脚本bin/tests/test_classify_project.py25.4 KB
- 脚本bin/tests/test_content_authority_bar_034.py28.6 KB
- 脚本bin/tests/test_copilot_resolver_call_site_audit.py5.9 KB
- 脚本bin/tests/test_copilot_resolver.py16.9 KB
- 脚本bin/tests/test_council_config.py10.0 KB
- 脚本bin/tests/test_council_semantic_check.py25.9 KB
- 脚本bin/tests/test_curate_requirements.py6.7 KB
- 脚本bin/tests/test_divergence_execution.py8.7 KB
- 脚本bin/tests/test_divergence_internal.py33.6 KB
- 脚本bin/tests/test_divergence_prose_to_code.py11.2 KB
- 脚本bin/tests/test_divergence_to_bugs.py8.1 KB
- 脚本bin/tests/test_doc_classification_v160.py62.5 KB
- 脚本bin/tests/test_doc_drift.py18.9 KB
- 脚本bin/tests/test_doc_gathering_skill_integration_132.py6.9 KB
- 脚本bin/tests/test_documentation_state.py20.0 KB
- 脚本bin/tests/test_encoding_sweeps_2e.py8.4 KB
- 脚本bin/tests/test_entry_point_bootstrap_audit.py5.8 KB
- 脚本bin/tests/test_feature_d_interview_fixture_v160.py40.0 KB
- 脚本bin/tests/test_feature_d_supersession_v160.py5.1 KB
- 脚本bin/tests/test_feature_h_provenance_v160.py4.1 KB
- 脚本bin/tests/test_finalizer.py23.5 KB
- 脚本bin/tests/test_full_banner_on_clis_090a.py9.1 KB
- 脚本bin/tests/test_full_build_publish_path_090f.py11.9 KB
- 脚本bin/tests/test_gate_verdict_honesty_v161.py42.7 KB
- 脚本bin/tests/test_harness_heartbeat_generic_2b.py8.0 KB
- 脚本bin/tests/test_harness_schemas.py3.1 KB
- 脚本bin/tests/test_harness_ticker_2b.py6.8 KB
- 脚本bin/tests/test_harness_windows_readiness_2e.py7.6 KB
- 脚本bin/tests/test_heartbeat_gate_invariant.py4.7 KB
- 脚本bin/tests/test_install_layouts_pinned.py6.6 KB
- 脚本bin/tests/test_install_manifest_no_drift.py7.7 KB
- 脚本bin/tests/test_install_skill_banner_089j.py27.7 KB
- 脚本bin/tests/test_install_skill_bundle_completeness.py14.4 KB
- 脚本bin/tests/test_install_skill_script_form.py4.2 KB
- 脚本bin/tests/test_install_skill_sentinels_and_legacy.py8.7 KB
- 脚本bin/tests/test_install_skill.py49.6 KB
- 脚本bin/tests/test_installed_bundle_freshness.py19.6 KB
- 脚本bin/tests/test_installed_skill_guardrail.py15.3 KB
- 脚本bin/tests/test_iterations_explicit.py2.2 KB
- 脚本bin/tests/test_lane_a_parse_validation_033.py47.1 KB
- 脚本bin/tests/test_language_disclosure_override_058.py21.7 KB
- 脚本bin/tests/test_latest_pointer_portable.py23.3 KB
- 脚本bin/tests/test_legacy_project_type_consistency.py8.9 KB
- 脚本bin/tests/test_logs_flat_layout_end_to_end.py11.2 KB
- 脚本bin/tests/test_logs_latest_symlink.py7.4 KB
- 脚本bin/tests/test_metrics_reconstruction.py33.1 KB
- 脚本bin/tests/test_migrate_v1_5_0_layout.py10.4 KB
- 脚本bin/tests/test_mode_a_b_parity_documented.py5.0 KB
- 脚本bin/tests/test_mode_a_self_execution_contract.py20.7 KB
- 脚本bin/tests/test_no_cache_033.py10.6 KB
- 脚本bin/tests/test_npm_channel_e2e_089v.py8.7 KB
- 脚本bin/tests/test_npm_channel_package_parity_089v.py15.2 KB
- 脚本bin/tests/test_npm_channel_remediation_089v.py7.1 KB
- 脚本bin/tests/test_npm_channel_shim_089v.py18.9 KB
- 脚本bin/tests/test_one_override_channel_033.py18.2 KB
- 脚本bin/tests/test_parent_witness_161.py22.6 KB
- 脚本bin/tests/test_persona_apply_v160.py8.1 KB
- 脚本bin/tests/test_persona_catalog_v160.py6.2 KB
- 脚本bin/tests/test_persona_fixes_v161.py21.8 KB
- 脚本bin/tests/test_persona_grounding_v160.py16.6 KB
- 脚本bin/tests/test_persona_maturity_seam_v160.py6.1 KB
- 脚本bin/tests/test_persona_merge_v160.py10.6 KB
- 脚本bin/tests/test_persona_orchestration_v160.py11.6 KB
- 脚本bin/tests/test_persona_pipeline_v160.py15.3 KB
- 脚本bin/tests/test_phase_identity_1b0.py10.7 KB
- 脚本bin/tests/test_phase_prompt_validator_mandate.py7.2 KB
- 脚本bin/tests/test_phase_prompts_externalized.py49.5 KB
- 脚本bin/tests/test_phase_sentinel_109.py29.1 KB
- 脚本bin/tests/test_phase_stop_inversion.py4.6 KB
- 脚本bin/tests/test_phase0_validator_install_location_aware_090t.py8.6 KB
- 脚本bin/tests/test_phase1_guide_verify_py_invariant_prose.py3.5 KB
- 脚本bin/tests/test_phase1_invocation_documented.py5.2 KB
- 脚本bin/tests/test_phase2_abort_preservation.py24.0 KB
- 脚本bin/tests/test_phase3_iteration_prompt.py760 B
- 脚本bin/tests/test_phase3_prompt_worked_example.py5.0 KB
- 脚本bin/tests/test_phase4_fixture_execution.py3.5 KB
- 脚本bin/tests/test_phase4_fixture_internal_prose.py3.9 KB
- 脚本bin/tests/test_phase4_fixture_prose_to_code.py2.9 KB
- 脚本bin/tests/test_phase5_build_prep_and_env_remediation_090o.py11.5 KB
- 脚本bin/tests/test_phase6_gate_witness.py13.0 KB
- 脚本bin/tests/test_phase6_integration.py9.5 KB
- 脚本bin/tests/test_phase6_subagent_contract.py11.7 KB
- 脚本bin/tests/test_phase7_variations.py7.3 KB
- 脚本bin/tests/test_pip_channel_e2e_089u.py16.7 KB
- 脚本bin/tests/test_pip_channel_package_parity_089u.py11.2 KB
- 脚本bin/tests/test_pip_channel_remediation_089u.py6.4 KB
- 脚本bin/tests/test_pipeline_activation.py43.7 KB
- 脚本bin/tests/test_plugin_layout_208.py16.2 KB
- 脚本bin/tests/test_pre_publish_191.py5.8 KB
- 脚本bin/tests/test_pretag_cleanup_089i.py24.1 KB
- 脚本bin/tests/test_progress_monitor.py21.8 KB
- 脚本bin/tests/test_publish_npm.py24.2 KB
- 脚本bin/tests/test_publish_pip.py23.5 KB
- 脚本bin/tests/test_publish_safety_090c.py24.3 KB
- 脚本bin/tests/test_qpb_config.py10.0 KB
- 脚本bin/tests/test_qpb_harness_tick.py28.2 KB
- 脚本bin/tests/test_qpb_validate_event_schema.py4.5 KB
- 脚本bin/tests/test_qpb_validate_in_closure_090k.py17.5 KB
- 脚本bin/tests/test_qpb_validate_platform_detection.py2.9 KB
- 脚本bin/tests/test_qpb_validate_remediation_catalog.py4.6 KB
- 脚本bin/tests/test_qpb_validate_remediation_commands.py13.5 KB
- 脚本bin/tests/test_qpb_validate_stale_quality.py2.5 KB
- 脚本bin/tests/test_qpb_validate_static_parse.py5.8 KB
- 脚本bin/tests/test_qpb_validate.py17.4 KB
- 脚本bin/tests/test_quality_gate_gates.py228.8 KB
- 脚本bin/tests/test_quality_gate_language_detection.py15.8 KB
- 脚本bin/tests/test_quality_playbook.py3.6 KB
- 脚本bin/tests/test_read_and_judge_033.py21.1 KB
- 脚本bin/tests/test_read_channel_033.py25.5 KB
- 脚本bin/tests/test_recap_tdd_signal_drift_089p.py6.2 KB
- 脚本bin/tests/test_red_validity_090p.py18.9 KB
- 脚本bin/tests/test_reference_docs_ingest.py23.1 KB
- 脚本bin/tests/test_reference_docs_plaintext_extensions_pinned.py3.5 KB
- 脚本bin/tests/test_regression_replay_schema.py5.8 KB
- 脚本bin/tests/test_regression_replay.py32.6 KB
- 脚本bin/tests/test_release_affirmation_sweep_206.py5.6 KB
- 脚本bin/tests/test_render_contract_v160.py79.3 KB
- 脚本bin/tests/test_render_fence_differential_v160.py14.7 KB
- 脚本bin/tests/test_render_regeneration_fixture_v160.py40.8 KB
- 脚本bin/tests/test_req_pattern.py1.9 KB
- 脚本bin/tests/test_resolve_targets.py9.2 KB
- 脚本bin/tests/test_role_map_queries_cookbook.py13.0 KB
- 脚本bin/tests/test_role_tagging.py70.0 KB
- 脚本bin/tests/test_run_playbook_agent_context.py17.1 KB
- 脚本bin/tests/test_run_playbook_gate_verdict_reader_109fix.py16.9 KB
- 脚本bin/tests/test_run_playbook_log_layout.py20.6 KB
- 脚本bin/tests/test_run_playbook_preflight_no_informal_docs_090h.py7.7 KB
- 脚本bin/tests/test_run_playbook_runner_extra_args_129.py8.8 KB
- 脚本bin/tests/test_run_playbook.py219.3 KB
- 脚本bin/tests/test_run_state_lib.py104.2 KB
- 脚本bin/tests/test_runner_command_shim_resolution.py9.8 KB
- 脚本bin/tests/test_runners_and_models_doc.py3.6 KB
- 脚本bin/tests/test_runners.py3.3 KB
- 脚本bin/tests/test_safety_notes_191.py3.2 KB
- 脚本bin/tests/test_schemas_audit_191.py6.1 KB
- 脚本bin/tests/test_scripts_self_describing_089x.py8.9 KB
- 脚本bin/tests/test_setup_repos_bundle_parity_089n.py9.3 KB
- 脚本bin/tests/test_setup_repos.py16.5 KB
- 脚本bin/tests/test_skill_derivation_main.py30.8 KB
- 脚本bin/tests/test_skill_derivation_pass_a_uc.py13.7 KB
- 脚本bin/tests/test_skill_derivation_pass_a.py15.1 KB
- 脚本bin/tests/test_skill_derivation_pass_b.py19.2 KB
- 脚本bin/tests/test_skill_derivation_pass_c.py27.6 KB
- 脚本bin/tests/test_skill_derivation_pass_d.py13.9 KB
- 脚本bin/tests/test_skill_derivation_protocol.py9.5 KB
- 脚本bin/tests/test_skill_derivation_sections.py16.9 KB
- 脚本bin/tests/test_skill_md_consistency_191.py5.8 KB
- 脚本bin/tests/test_skill_md_self_encoding.py15.2 KB
- 脚本bin/tests/test_skill_md_size.py10.2 KB
- 脚本bin/tests/test_skill_reference_resolves.py4.2 KB
- 脚本bin/tests/test_skill_resolution_order.py12.4 KB
- 脚本bin/tests/test_skill_template_gitignore_in_closure_090u.py16.3 KB
- 脚本bin/tests/test_source_edit_guardrail.py6.4 KB
- 脚本bin/tests/test_submit_awesome_copilot.py35.6 KB
- 脚本bin/tests/test_upstream_submission_161.py22.3 KB
- 脚本bin/tests/test_validate_phase_artifacts.py35.6 KB
- 脚本bin/tests/test_validator_compile_cache_and_anti_scavenge_090q.py11.6 KB
- 脚本bin/tests/test_verify_py_subprocess_witness.py30.8 KB
- 脚本bin/tests/test_version_literal_sweep_v160.py7.7 KB
- 脚本bin/tests/test_version_single_source_057.py6.3 KB
- 脚本bin/tests/test_virtio_run_fixes_031.py51.6 KB
- 脚本bin/tests/test_visualize_calibration.py10.4 KB
- 脚本bin/tests/test_what_just_happened.py29.1 KB
- 脚本bin/visualize_calibration.py24.4 KB
- 参考文档CHANGELOG.md56.8 KB
- 参考文档docs/bootstrap/Claude-web-Quality-Playbook-Opus-4.6.json4.7 MB
- 参考文档docs/bootstrap/Cowork-2026-04-03-Convert playbook to open-source skill-1.md1.9 MB
- 参考文档docs/bootstrap/Cowork-2026-04-06-Review Quality Playbook v1.3.7 results.md6.4 MB
- 参考文档docs/bootstrap/README.md1.6 KB
- 参考文档docs/CI_INTEGRATION.md1.6 KB
- 参考文档docs/design/QPB_Harness_Multi_Host_Support_Research.md16.4 KB
- 参考文档docs/design/QPB_Harness_Requirements.md29.0 KB
- 参考文档docs/design/QPB_Test_Harness_1.5.7_Design.md39.7 KB
- 参考文档docs/design/QPB_Test_Harness_1.5.7_Implementation_Plan.md12.2 KB
- 参考文档docs/design/QPB_v1.2.15_Design.md44.5 KB
- 参考文档docs/design/QPB_v1.3.0_Design.md30.1 KB
- 参考文档docs/design/QPB_v1.3.1_Design.md28.6 KB
- 参考文档docs/design/QPB_v1.3.14_Design.md24.1 KB
- 参考文档docs/design/QPB_v1.3.21_Design.md22.9 KB
- 参考文档docs/design/QPB_v1.3.29_Design.md21.3 KB
- 参考文档docs/design/QPB_v1.3.33_Design.md22.3 KB
- 参考文档docs/design/QPB_v1.3.35_Design.md51.8 KB
- 参考文档docs/design/QPB_v1.3.44_Design.md34.9 KB
- 参考文档docs/design/QPB_v1.3.5_Design.md21.1 KB
- 参考文档docs/design/QPB_v1.3.50_Design.md82.0 KB
- 参考文档docs/design/QPB_v1.3.7_Design.md28.1 KB
- 参考文档docs/design/QPB_v1.4_Design.md72.2 KB
- 参考文档docs/design/QPB_v1.5.0_Design.md24.0 KB
- 参考文档docs/design/QPB_v1.5.0_Implementation_Plan.md17.3 KB
- 参考文档docs/design/QPB_v1.5.1_Design.md37.9 KB
- 参考文档docs/design/QPB_v1.5.1_Implementation_Plan.md26.5 KB
- 参考文档docs/design/QPB_v1.5.10_Design.md24.9 KB
- 参考文档docs/design/QPB_v1.5.10_Implementation_Plan.md28.5 KB
- 参考文档docs/design/QPB_v1.5.10_Language_Disclosure_And_Override_Design.md19.0 KB
- 参考文档docs/design/QPB_v1.5.2_Design.md36.5 KB
- 参考文档docs/design/QPB_v1.5.2_Implementation_Plan.md36.6 KB
- 参考文档docs/design/QPB_v1.5.3_Design.md33.2 KB
- 参考文档docs/design/QPB_v1.5.3_Implementation_Plan.md35.9 KB
- 参考文档docs/design/QPB_v1.5.3_Phase4_Council_Override_Workflow.md5.4 KB
- 参考文档docs/design/QPB_v1.5.4_Design.md24.4 KB
- 参考文档docs/design/QPB_v1.5.4_Implementation_Plan.md23.7 KB
- 参考文档docs/design/QPB_v1.5.5_Design.md24.6 KB
- 参考文档docs/design/QPB_v1.5.5_Implementation_Plan.md21.5 KB
- 参考文档docs/design/QPB_v1.5.5_Remaining_Work.md24.0 KB
- 参考文档docs/design/QPB_v1.5.6_Design.md36.7 KB
- 参考文档docs/design/QPB_v1.5.6_Implementation_Plan.md34.2 KB
- 参考文档docs/design/QPB_v1.5.7_Design.md78.3 KB
- 参考文档docs/design/QPB_v1.5.7_Implementation_Plan.md57.3 KB
- 参考文档docs/design/QPB_v1.5.7_Release_Acceptance_Checklist.md8.6 KB
- 参考文档docs/design/QPB_v1.5.8_Release_Close_Out_Checklist.md12.9 KB
- 参考文档docs/design/QPB_v1.5.9_Design.md18.1 KB
- 参考文档docs/design/QPB_v1.5.9_Harness_Skill_Design.md33.9 KB
- 参考文档docs/design/QPB_v1.5.9_Harness_Skill_Implementation_Plan.md30.3 KB
- 参考文档docs/design/QPB_v1.5.9_Implementation_Plan.md15.4 KB
- 参考文档docs/design/QPB_v1.6.0_Design.md114.1 KB
- 参考文档docs/design/QPB_v1.6.0_Implementation_Plan.md17.2 KB
- 参考文档docs/design/QPB_v1.6.0_Requirements_Readability_Rubric.md8.4 KB
- 参考文档docs/design/QPB_v1.6.0_Test_Fixtures.md6.6 KB
- 参考文档docs/design/QPB_v1.6.1_Cloud_Implementation_Spec.md19.5 KB
- 参考文档docs/design/QPB_v1.6.1_Design.md14.1 KB
- 参考文档docs/design/QPB_v1.6.1_Implementation_Plan.md10.6 KB
- 参考文档docs/design/QPB_v1.6.2_Design.md16.4 KB
- 参考文档docs/design/QPB_v1.6.2_Implementation_Plan.md12.1 KB
- 参考文档docs/design/QPB_v1.6.x_Bug_Report_PR_Automation_Proposal.md19.9 KB
- 参考文档docs/design/QPB_v1.6.x_Distribution_Channels_Proposal.md16.4 KB
- 参考文档docs/design/QPB_v1.6.x_Phase6_Structural_Enforcement_Proposal.md31.0 KB
- 参考文档docs/design/QPB_v1.6.x_Requirements_Review_Proposal.md27.4 KB
- 参考文档docs/design/QPB_v1.6.x_Skill_Surface_Routing_Proposal.md4.2 KB
- 参考文档docs/design/QPB_v1.6.x_Verdict_Explanation_Proposal.md17.1 KB
- 参考文档docs/design/QPB_v1.7.0_Design.md39.1 KB
- 参考文档docs/design/QPB_v1.7.0_Implementation_Plan.md18.2 KB
- 参考文档docs/design/QPB_v1.8.0_Design.md24.1 KB
- 参考文档docs/design/QPB_v1.8.0_Implementation_Plan.md22.4 KB
- 参考文档docs/process/Lever_Calibration_Log.md13.0 KB
- 参考文档docs/process/QPB_v1.6.0_Features_G_H_Design_Council.md6.9 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_001_Self_Council/evidence_c1_c7_before_after.md5.8 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_001_Self_Council/panelist_A_render_contract_correctness.md26.9 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_001_Self_Council/panelist_B_fixture_fidelity.md19.3 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_001_Self_Council/panelist_C_regression_safety.md14.9 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_001_Self_Council/README.md3.8 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_001_Self_Council/round2_verification.md25.4 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_001_Self_Council/round3_closure.md21.5 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_001_Self_Council/round4_closure.md21.9 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_001_Self_Council/round5_closure.md15.6 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_001_Self_Council/round6_closure.md17.8 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_001_Self_Council/round7_closure.md15.3 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_001_Self_Council/synthesis.md12.8 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_002_Self_Council/panelist_focused_items_1_2_4_5.md23.6 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_002_Self_Council/panelist_item3_warn_never_fail.md13.0 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_002_Self_Council/round2_closure.md15.0 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_002_Self_Council/synthesis.md5.7 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_003_Self_Council/panelist_A_manifest_writeback.md12.4 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_003_Self_Council/panelist_B_gate_compliance.md11.2 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_003_Self_Council/panelist_C_supersession.md7.5 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_003_Self_Council/panelist_D_f2a_durability.md10.5 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_003_Self_Council/round2_closure.md4.8 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_003_Self_Council/synthesis.md4.1 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_004_Self_Council/round1_verdicts.md4.3 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_004_Self_Council/round2_closure.md3.4 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_004_Self_Council/synthesis.md3.4 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_005_Self_Council/synthesis.md3.8 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_006_Self_Council/round1_verdicts.md4.1 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_006_Self_Council/round2_closure.md2.6 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_006_Self_Council/synthesis.md4.3 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_007_Self_Council/synthesis.md4.8 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_008_Self_Council/synthesis.md2.6 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_009_Self_Council/synthesis.md5.1 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_010_Self_Council/synthesis.md5.6 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_011_Self_Council/synthesis.md4.9 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_013_Self_Council/synthesis.md4.0 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_014_Self_Council/synthesis.md4.4 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_015_Self_Council/synthesis.md4.2 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_016_Self_Council/synthesis.md4.4 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_017_Self_Council/synthesis.md4.0 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_018_Self_Council/synthesis.md3.3 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_019_Self_Council/synthesis.md5.5 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_020_Self_Council/synthesis.md2.4 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_021_Self_Council/synthesis.md3.9 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_022_Umbrella_Council/synthesis.md7.0 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_023_Self_Council/synthesis.md5.5 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_024_Self_Council/synthesis.md4.9 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_025_Self_Council/synthesis.md5.2 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_026_Self_Council/synthesis.md4.4 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_027_Self_Council/synthesis.md4.3 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_028_Self_Council/synthesis.md4.5 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_029_Self_Council/synthesis.md4.7 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_030_Self_Council/synthesis.md13.1 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_031_Self_Council/synthesis.md13.5 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_032_Self_Council/synthesis.md18.9 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_033_Self_Council/panelist_A_promotion_unbypassable.md85.7 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_033_Self_Council/panelist_B_no_regression.md55.5 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_033_Self_Council/panelist_C_simplification_is_real.md29.1 KB
- 参考文档docs/process/QPB_v1.6.0_Instruction_033_Self_Council/synthesis.md14.8 KB
- 参考文档docs/process/QPB_v1.6.0_Regeneration_Expectations.md13.8 KB
- 参考文档docs/QPB_v1.5.3_Decisions_Journal.md32.1 KB
- 参考文档docs/QPB_v1.5.3_Development_Journal.md40.9 KB
- 参考文档docs/RELEASE_PUBLISHING.md6.6 KB
- 其他evidence/.gitignore380 B
- 参考文档evidence/CANDIDATES-2026-09-27.md5.0 KB
- 参考文档evidence/README.md44.7 KB
- 参考文档evidence/SUBMISSION-PROTOCOL.md4.0 KB
- 参考文档evidence/SUBMIT/addressable-route-from-base-query.body.md1.1 KB
- 参考文档evidence/SUBMIT/adonis-cookie-maxage-zero.body.md781 B
- 参考文档evidence/SUBMIT/adonis-toroute-qs-mutation.body.md632 B
- 参考文档evidence/SUBMIT/adonis-unknown-content-type.body.md689 B
- 参考文档evidence/SUBMIT/README.md5.5 KB
- 许可证LICENSE.txt10.5 KB
- 其他MANIFEST.in1.1 KB
- 参考文档README.md47.1 KB
03 SKILL.md 正文
Quality Playbook Generator
Plan Overview — read this first, then explain it to the user
Before reading any other section of this skill, understand the plan and its dependencies. Each phase produces artifacts that the next phase depends on. Skipping or rushing a phase means every downstream phase works from incomplete information.
Phase 0 (Prior Run Analysis): If previous quality runs exist, load their findings as seed data. This is automatic and only applies to re-runs.
Phase 1 (Explore): Run the documentation intake first. Invocation form: bin/reference_docs_ingest.py does from bin import benchmark_lib at import, so Python's -m bin.reference_docs_ingest resolves ONLY when bin/ is reachable as a top-level package. Resolve the install root (the directory containing this SKILL.md) via the same install-location fallback list this skill uses for references/ / quality_gate.py (the 10 canonical layouts documented below — install-root forms: <empty>, .claude/skills/quality-playbook, .github/skills, .github/skills/quality-playbook, .cursor/skills/quality-playbook, .continue/skills/quality-playbook, .codex/skills/quality-playbook, .windsurf/skills/quality-playbook, .cline/skills/quality-playbook, .aider/skills/quality-playbook). Then, from the target repo root, run PYTHONPATH=<install_root> python3 -m bin.reference_docs_ingest <target>. If <install_root> is empty (QPB self-bootstrap, or a setup_repos.sh install where bin/ is already at the target root) omit the PYTHONPATH= prefix — cwd already provides bin/. The bare python -m bin.reference_docs_ingest <target> works ONLY for those two layouts; an install_skill.py-layout adopter (bin/ inside the marker dir) otherwise gets ModuleNotFoundError: No module named 'bin'. This walks reference_docs/ — cite/ files produce quality/formal_docs_manifest.json records; top-level files are loaded as Tier 4 context via reference_docs_ingest.load_tier4_context(<target>). Then explore the codebase in three stages: open exploration driven by domain knowledge, domain-knowledge risk analysis, and selected structured exploration patterns. Write all findings to quality/EXPLORATION.md. This file is the foundation — Phase 2 reads it as its primary input.
Phase 2 (Generate): Read EXPLORATION.md and produce the quality artifacts: requirements, constitution, functional tests, code review protocol, integration tests, spec audit protocol, TDD protocol. (AGENTS.md at the target's repo root is generated by the orchestrator after the Phase 6 gate passes and is not required for the gate to pass; you do not write it in Phase 2 — see "File 6" below.)
Phase 3 (Code Review): Run the three-pass code review against HEAD. Write regression tests for every confirmed bug. Generate patches.
Phase 4 (Spec Audit): Three independent AI auditors review the code against requirements. Triage with verification probes. After triage, the same Council runs the Layer-2 semantic citation check — one prompt per reviewer, structured per-REQ verdicts for every Tier 1/2 citation, output to quality/citation_semantic_check.json. Write regression tests for net-new findings.
Phase 5 (Reconciliation): Close the loop — every bug from code review and spec audit is tracked, regression-tested or explicitly exempted. Run TDD red-green cycle. Finalize the completeness report.
Phase 6 (Verify): Run self-check benchmarks against all generated artifacts. Check for internal consistency, version stamp correctness, and convergence.
Phase 7 (Present, Explore, Improve): Present results to the user with a scannable summary table, offer drill-down on any artifact, and provide a menu of improvement paths (iteration strategies, requirement refinement, integration test tuning). This is the interactive phase where the user takes ownership of the quality system.
Every bug found traces back to a requirement, and every requirement traces back to an exploration finding.
The critical dependency chain: Exploration findings → EXPLORATION.md → Requirements → Code review + Spec audit → Bug discovery. A shallow exploration produces abstract requirements. Abstract requirements miss bugs. The exploration phase is where bugs are won or lost.
MANDATORY FIRST ACTION: After reading and understanding the plan above, print the following attribution banner exactly as written below — do NOT condense, abbreviate, summarize, or reformat. Reproduce the full 8-line canonical block including the two ===…=== rules, both taglines, the blank lines, and the license line, byte-for-byte matching bin/_purpose.print_attribution_banner() (the single source of truth). On the title line, include the running skill version — render it as Quality Playbook vX.Y.Z -- by Andrew Stellman, where vX.Y.Z is the version: from this skill's frontmatter, exactly as print_attribution_banner() emits it. This lets the operator confirm at a glance which version is running (and catches a stale install silently running old behavior). Then explain the plan in your own words — what you'll do, what each phase produces, and why the exploration phase matters most. Emphasize that exploration starts with open-ended domain-driven investigation, followed by domain-knowledge risk analysis that reasons about what goes wrong in systems like this, then supplemented by selected structured patterns. Do not copy the plan verbatim; paraphrase it to demonstrate understanding.
================================================================================
Quality Playbook -- by Andrew Stellman
https://github.com/andrewstellman/quality-playbook
AI code review is good. Quality engineering is better.
Because code that looks right can still do the wrong thing.
Licensed under the Apache License, Version 2.0
================================================================================
(The template above shows the canonical 8-line block; on the first line, insert vX.Y.Z after Quality Playbook using this skill's frontmatter version:, matching bin/_purpose.print_attribution_banner().)
Generate a complete quality system tailored to a specific codebase. Unlike test stub generators that work mechanically from source code, this skill explores the project first — understanding its domain, architecture, specifications, and failure history — then produces a quality playbook grounded in what it finds.
How to run this — self-encoded invocation contract
If the operator hands you this skill (or points you at any QPB-installed target) and says "Run the Quality Playbook" — possibly with a hint like "this is a bootstrap run" or "run on itself" or "self-audit" — this section tells you exactly what to do. The operator should not need to provide additional instructions; the canonical invocation, the defaults, the guardrails, and the output contract all live here.
Pick your execution mode
QPB ships in two execution shapes. Pick the one that matches your runtime — the wrong choice produces the codex-on-codex indirection pathology.
| Mode | When this is you | What you do |
|---|---|---|
| A. Skill-direct (UI-context) | You are a coding agent (Claude Code, Cursor, Copilot, Codex desktop, etc.) handed this skill in your own chat. Your runtime IS the reasoning loop — you read files, you write files, you decide. | Walk through Phase 1 → Phase 6 yourself using the externalized phase prompts in phase_prompts/. Write artifacts into the target's quality/ directory directly. No subprocess, no runner. |
| B. Runner-driven (CLI-automation) | The operator is invoking python3 -m bin.run_playbook deliberately — to batch across multiple targets, drive a headless CI run, or fan out per-phase work to a different model than the one reading this prose. |
The orchestrator spawns a CLI agent (claude, copilot, codex, or cursor) per phase. You (or whoever is reading this) are the operator-side control loop, not the per-phase reasoner. |
Both modes use the same phase prompt content — the phase_prompts/*.md files at the repo root are the single source of truth, loaded by bin/run_playbook.py::_load_phase_prompt and read directly by Mode A walkthroughs. The only thing the two modes differ on is WHO drives — you (Mode A) or the orchestrator subprocess-spawning a CLI agent (Mode B).
When in doubt, default to Mode A. If the operator wanted runner-driven invocation they would have run the runner themselves; if they pasted "Run the Quality Playbook" into your chat, they want you to drive. The Mode B section below tells you what to do if the operator explicitly invokes the runner.
Documented Mode A vs Mode B asymmetries — by design. Three behaviors deliberately differ between the modes because the modes serve different purposes (Mode A is the adopter-facing walkthrough on a target repo; Mode B is the QPB-internal runner used for benchmarking + headless CI). The phase prompts are identical (single source of truth — see paragraph above); the divergences are in the driver obligations, not the audited contract:
- Phase 0 entry contract — install validator (Mode A only). Mode A's mandatory first action is to run the install validator. Invocation form is install-location-aware: resolve the install root (the directory containing this SKILL.md) via the same install-location fallback list this skill uses for
references//phase_prompts/(the 10 canonical layouts documented below), then runpython3 <install_root>/bin/qpb_validate.py <target>. For a clone / self-bootstrap (install root is the QPB clone,bin/reachable from cwd) the barepython3 bin/qpb_validate.py <target>works. For aninstall_skill-layout adopter (channel or manual install —bin/inside the marker dir, e.g..github/skills/quality-playbook/bin/) you MUST use the install-root-prefixed form; running barebin/qpb_validate.pyfrom the target repo root fails (the validator lives under the marker dir, not at repo root). The adopter has just installed QPB into their target repo and must confirm canonical layout before any phase. Mode B (the QPB clone running its own runner) operates from the canonical install by construction; the validator would always succeed against the QPB clone itself, so the check would be vacuous. Adopters running Mode A get the install correctness gate; Mode B operators have it already. - End-of-run archive (Mode B only). Mode B's
_finalize_iterationcallsarchive_lib.archive_runafter Phase 6, materializingquality/previous_runs/<ts>/for benchmark replay + cross-run diffing. Mode A produces artifacts directly into the target's livequality/for the adopter to inspect, commit, or re-run on top of; there is no archive partition because there is no benchmark loop. Adopters who want longitudinal archives invoke Mode B explicitly (python3 -m bin.run_playbook --full-run <target>). - Phase 6 auditor-prompt sub-agent dispatch (Mode A only).
phase_prompts/phase6.mdroutes Mode A throughphase_prompts/phase6_auditor.mdvia a fresh-context sub-agent spawn (the A-13 hybrid). Mode B's per-phase CLI subprocess is already a fresh context (the structural separation the auditor exists to provide), sophase6.md:5-7tells Mode B to execute the verification inline and skip the auditor spawn.phase_prompts/phase6_auditor.mdis therefore only loaded under Mode A; the file's header documents this routing explicitly.
These asymmetries are pinned by bin/tests/test_mode_a_b_parity_documented.py. If a future change wants to align them, update the pin test, the rationale here, and add the missing behavior to the appropriate side.
Mode A — skill-direct walkthrough (UI-context)
The operator's prompt is just "Run the Quality Playbook" (or "run on itself", "self-audit", etc.). You drive every phase inline.
Mode A means YOU execute the skill. If you are an interactive coding agent (Claude Code, Cursor, Copilot UI, Codex desktop, any tool where the operator is monitoring your chat output in real-time), DO NOT:
- Spawn a sub-skill via your
quality-playbookskill-invocation mechanism. - Spawn a sub-agent via your Task tool / Agent tool / similar to run a phase, unless you follow the parent-witness rule below.
- Invoke
python3 -m bin.run_playbook— that's Mode B, the CLI-automation path.
Parent-witness rule (per-phase subagents). You may run each phase in its own subagent (pattern: agents/quality-playbook-claude.agent.md) only if, after every Phase 6, YOU — the parent — run python3 <install_root>/bin/qpb_gate_witness.py <target-repo>, paste its Total:/RESULT: lines verbatim in your chat, and stop and report if it prints MISMATCH (exit 1) or the log is missing (exit 2). Subagents cannot spawn subagents: the parent spawns the Feature H personas, the Phase 6 auditor, and any sub-agent a phase prompt asks for (e.g. challenge-gate reviewers); a phase subagent that needs one returns to the parent. See references/orchestrator_protocol.md. Driving every phase yourself stays the default.
Phase 0 entry contract (MANDATORY first action): run the QPB install validator. Resolve the install root via the install-location fallback list (per the Phase 0 numbered step above), then run python3 <install_root>/bin/qpb_validate.py <target-repo> — bare python3 bin/qpb_validate.py <target-repo> works only when cwd already contains bin/ (QPB clone / self-bootstrap); install_skill-layout adopters (channel install — bin/ under .github/skills/quality-playbook/, etc.) MUST prefix the install root. Paste every event= line; do not proceed until event=validation_complete status=ok — see AGENTS.md "Mode A entry sequence". Non-negotiable — skipped/fabricated validation and bare-path-from-repo-root invocation are both documented adopter failure modes.
EXCEPTION: Phase 6 verification MUST be delegated to a fresh-context sub-agent. Sub-agent delegation for EXECUTION (Phases 1-5) requires the parent-witness rule. Sub-agent delegation is MANDATED for VERIFICATION (Phase 6) because shared-context executor-as-verifier has empirically fabricated PASS verdicts against failing gates across multiple benchmark runs despite repeated rounds of strengthened prompt-level witness language. The principle is the same as the rule above — operator chat should carry the truth — but the mechanism is opposite: visibility for execution; isolation for verification (a fresh auditor has none of the executor's memory/anchoring/completion-reward bias). See phase_prompts/phase6.md + phase_prompts/phase6_auditor.md for the sub-agent delegation protocol. The auditor is required either way; with per-phase subagents the parent spawns it.
EXCEPTION: the Feature H persona validation pass may spawn its personas. The parent-witness rule governs delegating a PHASE'S EXECUTION (Phases 1–5). The Feature H persona validation pass (bin/persona_apply.run_feature_h, run automatically at the Phase 2→3 boundary; Design §8b, references/requirements_pipeline.md § E.9) is a second narrowly-scoped sanctioned exception: it spawns fresh-context, tool-restricted domain-expert + security personas to validate the finalized requirements. This does NOT reopen either failure mode the rule closes: (a) it does not delegate a phase's execution — it is a bounded validation remediation that runs at one boundary and returns to your session, never a worker running phases 2–6 (so the delegated-agent-silent-death mode cannot apply); (b) operator visibility is preserved and mandatory — the pass writes an operator-visible quality/expert_review_summary.json listing every applied change with its grounding, every change is agent-validation-tagged and revertible (persona_apply.revert), and the pass is opt-out (disablable for the run), so nothing is hidden and no verdict is fabricated. The guardrail's own principle — operator chat carries the truth — is honored, not bypassed: that review summary is the trail. Scoped strictly to this pass; delegating a phase still requires the parent-witness rule, and you may NOT invoke the quality-playbook orchestrator sub-skill.
Why: on 2026-05-16 a delegated session hand-wrote quality/results/quality-gate.log with a "PASS" tally while the actual gate showed 14 FAIL, GATE FAILED, and the parent trusted it. The witness contract (quote the gate's verdict lines verbatim) enforces only when the parent runs the gate itself: a subagent can write any log, not what the gate prints in the parent's session. On 2026-10-01 a cloud run with one subagent per phase had the parent re-run the gate after both Phase 6 runs; both matched the subagent's log.
YOU read SKILL.md and the phase prompts. By default YOU execute Phases 1-5 yourself and write artifacts to quality/. Phase 6 verification is delegated to the fresh-context auditor sub-agent per the exception above (the auditor invokes quality_gate.py); you paste its verbatim verdict. Your chat IS the trust trail — execution stays visible, verification stays bias-isolated.
You have shell access — probe before claiming unavailability. Mode A means an interactive coding agent (Claude Code, Cursor, Copilot UI) running commands on the operator's actual machine via your Bash tool — NOT a sandboxed runtime. A common failure is writing "the sandbox can't run X" reflexively, conflating your model-level "I can't natively execute" with the harness Bash tool you DO have. A which <tool> / <tool> --version probe costs one line; assuming-and-being-wrong forfeits the entire Phase 5 evidence trail.
For each phase 1..6, in order:
- Load the phase prompt. Read
phase_prompts/phaseN.md(resolve via the same install-location fallback list documented forreferences/below). Forphase1.md, substitute{seed_instruction}(the prelude that says "skip Phase 0/0b" — empty string when seeds are allowed) and{role_taxonomy}(the taxonomy block rendered from the role taxonomy below). Forphase2.mdthroughphase6.md, the file is pure-literal — read it verbatim. - Execute the phase per the prompt. Read the inputs the prompt names, do the analysis, write outputs into the target's
quality/directory. - STOP at the end-of-phase boundary. Every phase prompt ends with an "IMPORTANT: Do NOT proceed to Phase N+1" instruction. Honor it. The operator advances to the next phase by saying so.
You are responsible — without the orchestrator's structural backstop — for the same source-unchanged invariant the runner enforces: do NOT modify any file outside the target's quality/ directory. In Mode B the gate would catch this; in Mode A you are the gate. A documented failure mode: a Phase 2 LLM modifying the target's root AGENTS.md — the same failure mode applies in Mode A.
For the bootstrap-run (self-audit) variant of Mode A, see "Bootstrap mode" below — the only delta is that the target IS the QPB repo, so cite the same phase_prompts/ files you read from.
Mode A scope — what's covered, what's Mode-B-only
The per-phase walkthrough above scopes Mode A to phases 1..6. The following surfaces are deliberately Mode-B-only — if the operator wants them, point them at the runner instead of trying to drive them yourself:
- Phase 0 / Phase 0b (seed injection from prior runs). The orchestrator handles seed discovery, prior-run scanning, and seed-prompt injection. In Mode A, treat every run as
--no-seeds(skip Phase 0/0b entirely, start at Phase 1). If the operator explicitly asks for seed-driven exploration, hand off to Mode B (python3 -m bin.run_playbook --with-seeds <target>). - Phase 7 (interactive Present / Explore / Improve). Mode A's Phase 7 is the conversational version — present the artifact summary table inline and let the operator drive what to explore. See the Phase 7: Present, Explore, Improve section below for the canonical treatment covering both modes.
- Iteration strategies (gap / unfiltered / parity / adversarial). Iterations re-enter the playbook with a strategy-specific addendum. In Mode A, after Phase 6 completes cleanly, hand off to Mode B for iterations:
python3 -m bin.run_playbook --next-iteration --strategy <name> <target>. The iteration prompts (phase_prompts/iteration.md) ARE single-source-of-truth, but the iteration-orchestration loop (rotating through gap → unfiltered → parity → adversarial) is the runner's job. A Mode A operator who wants iterations after Phase 6 should be told: "Phase 6 is done; runpython3 -m bin.run_playbook --full-run <target>to get all four iteration strategies, or pick one strategy explicitly with--next-iteration --strategy gap."
If the operator asks for one of these surfaces in Mode A and the request is ambiguous (e.g., "also do the iterations"), surface the mode-handoff explicitly rather than improvising — improvisation is how the prompt content drifts away from the runner's canonical loop.
Mode B — runner-driven invocation (CLI-automation)
The operator runs python3 -m bin.run_playbook themselves (typically because they want batching, headless CI, or to route per-phase work to a different model). The orchestrator at bin/run_playbook.py spawns a CLI agent per phase, feeds it the externalized phase prompt, and aggregates the result.
Canonical invocation
The orchestrator is the entry point. Two invocation forms are supported:
python3 -m bin.run_playbook <target>— canonical package-module form.python3 /path/to/QPB/bin/run_playbook.py <target>— direct script form. Works from any cwd because the module injects QPB root intosys.pathbefore importing sibling modules.
<target> is the path to the project to audit. For a bootstrap run (target IS the QPB repo), pass . from the repo root. For any other target, pass the path to that target's repo root.
Default behavior (no flags)
Bare invocation triggers a full run: all 6 phases (Explore → Generate → Code Review → Spec Audit → Reconciliation → Verify) followed by all 4 iteration strategies (gap → unfiltered → parity → adversarial), executed synchronously in the same session. Any prior quality/ directory is auto-archived to quality/previous_runs/<TIMESTAMP>/ before the new run starts.
This is the canonical operator path. Don't ask permission to add flags; the defaults are the answer.
When the bare invocation fires, the orchestrator emits a one-line stderr banner naming the run cost. That banner is informational; let it scroll.
Common overrides
Use only when the operator asks for something specific:
| Need | Flag | Effect |
|---|---|---|
| Run a single phase | --phase N (where N ∈ 1..6) |
Use --phase 1 for an explore-only run. |
| Skip iteration strategies | omit --iterations and pass --phase 1,2,3,4,5,6 |
Phases run; iterations don't. |
| Specific iteration | --strategy <name> --next-iteration |
Iterates on an existing quality/ run with a chosen strategy. |
| Multi-target | pass several positional targets | Each runs independently. |
| Per-phase CLI agent | --claude / --copilot / --codex / --cursor |
Picks which CLI runner the orchestrator spawns. Default is --copilot. The --cursor runner requires cursor-cli 3.1+. |
| Target a language on a polyglot repo | --language <lang> (go/py/java/kt/rs/ts/js/scala/c/clj/agc) |
QPB tests one language per run. On a repo with ≥2 testable languages the gate discloses which were detected/tested/skipped; re-run with --language to audit a different one. A --language re-run that differs from the prior run ARCHIVES the current quality/ folder into previous_runs/ first (a failed archive never clears live data). Unknown/non-testable value → exit 2. |
Recovering from a partial / aborted runner-driven run
Council 2026-04-30 P1-4: the operator-hygiene guidance for cleaning up after an aborted run lives in the Bootstrap mode section below ("Bootstrap-run operator hygiene") — the recovery is identical in Mode B: git restore quality/ to discard the partial Phase 1/2 output, then re-invoke. Do NOT edit files outside quality/ to "tidy up" — the source-unchanged invariant trips on the very next run. See the Bootstrap-mode hygiene paragraph for the full mechanic; it applies regardless of whether the abort happened during a self-audit run or against an external target.
Bootstrap mode (running QPB on itself)
When the operator says "this is a bootstrap run" or "we're running QPB on itself" or "self-audit":
- Confirm the working directory is the QPB repo root (or
cdthere). - Invoke
python3 -m bin.run_playbook .— same canonical form, target is.. - The orchestrator handles archival of the existing
quality/tree toquality/previous_runs/<TIMESTAMP>/automatically; you don't need to clean anything manually.
The run proceeds the same way as any other target. The only difference is that the audit subject IS the playbook itself, so the produced artifacts describe QPB's own quality system.
Bootstrap-run operator hygiene — recovering from a partial / aborted run. If a prior bootstrap run aborted mid-flight (e.g., the source-unchanged invariant tripped, a phase prompt errored, the operator hit Ctrl-C), the working tree may contain a half-written quality/ directory plus a quality/previous_runs/<TIMESTAMP>/.partial sentinel marking the abandoned archive. Before re-invoking, run git restore quality/ (and, if you want a clean slate, git clean -fd quality/) to drop any uncommitted Phase 1/2 output from the aborted run. The orchestrator will re-archive the now-pristine quality/ tree and start clean. Do NOT edit files outside quality/ to "tidy up" — anything outside quality/ is QPB source; touching it for cleanup will trip the source-unchanged invariant on the very next run. The 2026-04-30 bootstrap test surfaced this exact recovery question: the operator had a half-written quality/ from an aborted Phase 2 and re-running without restoring left stale Phase 1 artifacts that confused the next run's archival.
Guardrails (machine-checkable; treat as hard constraints)
These are not suggestions; the orchestrator enforces them and a violation aborts the run:
- Synchronous execution, or per-phase subagents under the parent-witness rule (Mode A section). Run every phase yourself, or one subagent per phase under that rule. Do NOT use background-agent invocations, the
quality-playbookskill-invocation mechanism, or any "delegate phases 2–6 to a worker" pattern. Two verified failure modes the guardrail closes: (a) Phase 1 completes, phases 2–6 silently die in a delegated agent that loses its parent session, the runner self-marks-PARTIAL, and the operator gets no signal anything was wrong. (b) An interactive coding session spawns thequality-playbookorchestrator sub-skill; sub-skill runs Mode A in its own context but fabricatesquality/results/quality-gate.logand reports "Gate: PASS" against an actual failing gate. The Phase 6 witness contract cannot enforce when the witness lives in a sub-skill's chat that the parent never sees; the parent'sqpb_gate_witness.pyrun restores it. Phase 6 verification — mandatory sub-agent delegation: the parent-witness rule governs Phase 1-5 EXECUTION (operator visibility). Phase 6 VERIFICATION is the opposite: it MUST run in a fresh-context sub-agent, because shared-context executor-as-verifier has empirically fabricated PASS verdicts against failing gates despite repeated rounds of strengthened witness language. Same principle (operator chat carries the truth), opposite mechanism (visibility for execution; bias-isolation for verification). Scoped strictly to Phase 6 verification — seephase_prompts/phase6.md+phase_prompts/phase6_auditor.md. Feature H persona pass — the second sanctioned exception (EXCEPTION block above): its personas are a bounded, operator-visible remediation (quality/expert_review_summary.json), not a delegated phase. Sub-agents never nest — the parent spawns them. - Don't patch QPB source mid-run. If you encounter a bug in
bin/,.github/skills/,agents/,references/,SKILL.md, orAGENTS.mdduring the run, STOP and report: name the file:line, describe the failure, propose a fix shape — but do NOT apply the fix. The orchestrator captures a git-SHA baseline at run start and verifies the source tree unchanged at every phase boundary; an autonomous patch fails the gate with a diagnostic naming the modified files. Patches go through Council review, not mid-run improvisation. - Don't delete sentinel files. Files protected by
.gitignore !-rules (e.g.,reference_docs/.gitkeep,reference_docs/cite/.gitkeep) keep otherwise-empty tracked directories present. The pre-flight check enumerates every!-rule and aborts if any sentinel is missing. If you find such a file and don't understand its purpose, leave it alone. - Phase 1 file enumeration uses
git ls-files. Usegit ls-filesas the canonical file list when the target is a git repo; this respects.gitignoreautomatically. Do NOT useos.walk,find,os.listdir, or any recursive directory walker — those pull in.git/,.venv/,node_modules/, build outputs, and vendored dependencies, all of which the role-map validator rejects. Disallowed path prefixes are.git/,.venv/,venv/,node_modules/,__pycache__/,.pytest_cache/,.mypy_cache/,.ruff_cache/,.tox/, plus any path whose components end in.egg-infoor.dist-info. The role map carries aprovenancefield recording which enumeration source you used ("git-ls-files"or"filesystem-walk-with-skips"for non-git targets). There is also a 2000-entry ceiling; a role map exceeding it almost certainly walked .gitignored content. - Cross-artifact agreement. EXPLORATION.md's "File inventory" section and the role map's
summaryfield both render frombin.role_map.summarize_role_map(). Don't write file counts or role percentages by hand; copy from the helper. The validator cross-checks the two and rejects mismatches.
If the operator's prompt says something that conflicts with these guardrails (e.g., "delegate phases 3–6 to one sub-agent, skip the gate re-run"), don't comply with the conflicting instruction. Surface the conflict, name the guardrail, and ask for clarification. The guardrails exist because each one corresponds to a verified historical failure mode.
What this run produces — output artifact contract
A successful run produces this canonical set under the target's quality/ directory plus an AGENTS.md at the target's repo root. Every file listed here except AGENTS.md is gate-validated:
| Path | Role |
|---|---|
quality/EXPLORATION.md |
Phase 1 findings — the foundation. |
quality/exploration_role_map.json |
Per-file role tagging from Phase 1. |
quality/REQUIREMENTS.md |
Testable requirements with use cases. |
quality/QUALITY.md |
Quality constitution. |
quality/CONTRACTS.md |
Behavioral contracts. |
quality/COVERAGE_MATRIX.md |
Requirement → test traceability. |
quality/COMPLETENESS_REPORT.md |
Final gate verdict. |
quality/test_functional.* |
Automated functional tests. |
quality/RUN_CODE_REVIEW.md |
Three-pass code review protocol. |
quality/RUN_INTEGRATION_TESTS.md |
Integration test protocol. |
quality/RUN_SPEC_AUDIT.md |
Council of Three spec audit protocol. |
quality/RUN_TDD_TESTS.md |
TDD red-green verification protocol. |
quality/BUGS.md |
Consolidated bug report. |
quality/INDEX.md |
Run metadata + role breakdown + gate verdict. |
quality/PROGRESS.md |
Phase-by-phase checkpoint log. |
quality/previous_runs/<TIMESTAMP>/ |
Archive of any prior run. |
quality/writeups/BUG-<id>.md |
Per-bug writeups. |
quality/patches/ |
Fix and regression-test patches (one per bug). |
quality/code_reviews/, quality/spec_audits/, quality/results/, quality/mechanical/ |
Intermediate pipeline artifacts. Top-level only — quality/workspace/ is forbidden (gated by check_no_workspace_dir). |
quality/logs/<run-id>/ |
Centralized per-run logs (transcripts, control prompts, etc.). <run-id> is the run's UTC ISO-8601 compact timestamp (YYYYMMDDTHHMMSSZ). Pass --logs-flat (or set QPB_LOGS_LEGACY=1) to preserve the legacy scattered layout (parent-dir log file + top-level quality/control_prompts/) for tooling that depends on the old paths. See references/run_state_schema.md for the run_id / log_layout discriminator fields on the run_start event. |
<repo_dir>/quality.gate-failed-<UTC-ts>/ |
Preserved on Phase 2 gate-failure: the failed quality/ tree is renamed to this sibling directory and a fresh quality/ is created. The preserved directory carries its own logs/<run-id>/ subtree with the failure logs. Operators inspect it post-mortem; the next run starts clean. |
AGENTS.md (target repo root) |
Per-project orientation written by the orchestrator after the Phase 6 gate passes; not required for the gate to pass. Carries a QPB sentinel marker so future runs detect QPB-managed copies. |
The gate verdict in quality/INDEX.md (pass / pass-with-cleanup / pass-with-decisions / partial / fail) is the operator-facing summary of how the run went. The four-state taxonomy (089c F15 plus the decisions state) maps the gate's RESULT: line to this enum: RESULT: GATE PASSED → pass; RESULT: GATE PASSED WITH CLEANUP NEEDED → pass-with-cleanup (review completed, bug findings stand, only audit record-keeping incomplete — non-blocking); RESULT: GATE PASSED WITH DECISIONS NEEDED → pass-with-decisions (no substantive issue; the operator decides N requirement wordings no confirmed bug rests on, from quality/OPERATOR_DECISIONS.md — State DN); RESULT: GATE FAILED → fail (a substantive issue). partial covers aborted / WARN-only runs. If the verdict is anything other than pass, surface why before considering the run done; pass-with-cleanup is a successful outcome, but the State CN emit (per references/what_just_happened.md) walks the adopter through completing the remaining audit records.
quality/INDEX.md uses schema_version: "2.0" and carries a target_role_breakdown field with the per-role counts and percentages computed from quality/exploration_role_map.json. Pipelines activate from the role map's per-file role tags (skill-prose, skill-reference, skill-tool, code, test, docs, config, fixture, formal-spec, playbook-output) rather than a project-type label — the skill-derivation pipeline runs over files tagged skill-prose/skill-reference, the code-review pipeline runs over files tagged code, the prose-to-code divergence check runs over files tagged skill-tool, and when the role map shows zero of a role that pipeline no-ops cleanly. Both pipelines run when both surfaces are present.
Locating reference files
This skill references files in a references/ directory (e.g., references/iteration.md, references/review_protocols.md). The location depends on how the skill was installed. When a reference file is mentioned, resolve it by checking these paths in order and using the first one that exists (the canonical ten install layouts):
references/(relative to SKILL.md — works when running from the skill directory or self-bootstrap).claude/skills/quality-playbook/references/(Claude Code installation).github/skills/references/(GitHub Copilot flat installation).cursor/skills/quality-playbook/references/(Cursor installation).continue/skills/quality-playbook/references/(Continue installation).github/skills/quality-playbook/references/(alternate Copilot installation, nested).codex/skills/quality-playbook/references/(Codex installation).windsurf/skills/quality-playbook/references/(Windsurf installation).cline/skills/quality-playbook/references/(Cline installation).aider/skills/quality-playbook/references/(aider installation — aider does not auto-discover; tell aider to read SKILL.md explicitly)
All reference file mentions in this skill use the short form references/filename.md. If the relative path doesn't resolve, walk the fallback list above.
Council roster + adopter override
The Phase 4 Council of Three runs against a default 3-member roster defined in bin/council_config.py::DEFAULT_COUNCIL_MEMBERS — claude-opus-4.7, gpt-5.5, claude-sonnet-4.6. Adopters override per-operator via ~/.qpb/config.json (or $XDG_CONFIG_HOME/qpb/config.json); manage with python3 -m bin.qpb_config show|set|unset <key>. Per-run override via the --council-roster <m1,m2,m3> CLI flag takes highest precedence. See references/runners_and_models.md for the full override docs (precedence chain, model-availability behavior, falling back when a member is unavailable).
Why This Exists
Most software projects have tests, but few have a quality system. Tests check whether code works. A quality system answers harder questions: what does "working correctly" mean for this specific project? What are the ways it could fail that wouldn't be caught by tests? What should every developer (human or AI) know before touching this code?
Without a quality playbook, every new contributor (and every new AI session) starts from scratch — guessing at what matters, writing tests that look good but don't catch real bugs, and rediscovering failure modes that were already found and fixed months ago. A quality playbook makes the bar explicit, persistent, and inherited.
What This Skill Produces
Nine files that together form a repeatable quality system:
| File | Purpose | Why It Matters | Executes Code? |
|---|---|---|---|
quality/QUALITY.md |
Quality constitution — coverage targets, fitness-to-purpose scenarios, theater prevention | Every AI session reads this first. It tells them what "good enough" means so they don't guess. | No |
quality/REQUIREMENTS.md |
Testable requirements with project overview, use cases, and narrative — generated by a five-phase pipeline (contract extraction → derivation → verification → completeness → narrative) | The foundation for Passes 2 and 3 of the code review. Without requirements, review is limited to structural anomalies (~65% ceiling). With them, the review can catch intent violations — absence bugs, cross-file contradictions, and design gaps that are invisible to code reading alone. | No |
quality/test_functional.* |
Automated functional tests derived from specifications | The safety net. Tests tied to what the spec says should happen, not just what the code does. Use the project's language: test_functional.py (Python), FunctionalSpec.scala (Scala), functional.test.ts (TypeScript), FunctionalTest.java (Java), etc. |
Yes |
quality/RUN_CODE_REVIEW.md |
Three-pass code review protocol: structural review, requirement verification, cross-requirement consistency | Structural review alone misses ~35% of real defects. The three-pass pipeline adds requirement verification and consistency checking — backed by experiment evidence showing it finds bugs invisible to all structural review conditions. | No |
quality/RUN_INTEGRATION_TESTS.md |
Integration test protocol — end-to-end pipeline across all variants | Unit tests pass, but does the system actually work end-to-end with real external services? | Yes |
quality/BUGS.md |
Consolidated bug report with patches | Every confirmed bug in one place with reproduction details, spec basis, severity, and patch references. The single source of truth for what's broken and how to verify it. | No |
quality/RUN_TDD_TESTS.md |
TDD red-green verification protocol | Proves each bug is real (test fails on unpatched code) and each fix works (test passes after patch). Stronger evidence than a bug report alone — maintainers trust FAIL→PASS demonstrations. | Yes |
quality/RUN_SPEC_AUDIT.md |
Council of Three multi-model spec audit protocol | No single AI model catches everything. Three independent models with different blind spots catch defects that any one alone would miss. | No |
AGENTS.md |
Bootstrap context for any AI session working on this project | The "read this first" file. Without it, AI sessions waste their first hour figuring out what's going on. | No |
Plus output directories: quality/code_reviews/, quality/spec_audits/, quality/results/, quality/history/.
AGENTS.md at the target repo root is Generated by orchestrator after Phase 6 — not a Phase 2 deliverable, after the gate passes (it carries a QPB sentinel marker so future runs detect QPB-managed copies). See the full gate-validated artifact table in references/artifact_contract.md.
The pipeline also generates supporting artifacts: quality/PROGRESS.md (phase-by-phase checkpoint log with cumulative BUG tracker), quality/CONTRACTS.md (behavioral contracts), quality/COVERAGE_MATRIX.md (traceability), quality/COMPLETENESS_REPORT.md (final gate), and quality/VERSION_HISTORY.md (review log). At the end of Phase 1 the documentation classification is always shown to the operator in plain language (doc_classification.classification_review) — which gathered documents are being used as authoritative sources and which are background — and the operator can confirm or correct it before Phase 2 derives anything against it; a correction is recorded in the operator-authored, content-keyed reference_docs/qpb_decisions.txt — the ONE override channel, which instruction 033 collapsed qpb_promote.txt, qpb_advisory_rescue.txt, qpb_authoritative.txt and cite/ placement into — and a re-run ingest makes a promoted document byte-citable (Design §8a; references/phase1_exploration_guide.md). Only the human operator can promote a document — document content, the classifier, and personas never can. The show prints in every mode; only the pause varies — pause only when an operator is stepping the run phase by phase and waiting, never in the continuous full-pipeline default, the single-pass prompt, or any unattended/runner-driven run. The requirements validation interview (references/requirements_interview.md) — an operator-driven, fitness-for-purpose review whose corrections write back to the manifest — is offered at the Phase 2 → Phase 3 boundary (the requirements are complete and Phases 3–6 build on them; Design §6), with one playbook-end reminder if the operator declined. It is opt-in and never auto-starts. At the same boundary, the Feature H persona validation pass (bin/persona_apply.run_feature_h; Design §8b, references/requirements_pipeline.md § E.9) runs automatically unless disabled for the run — fresh-context, tool-restricted domain-expert + security personas validate the spec, apply grounded (cited + byte-verified) fixes tagged agent-validation, and write an operator-visible review summary to quality/expert_review_summary.json. It is a remediator, not a gate (opt-out; the human interview is opt-in). Because it changes the operator's requirements, the end-of-Phase-2 message must disclose it in plain language (persona_apply.persona_review_disclosure, rendered into the State P2 block after the pass runs — instruction 031): reviewers ran, what they changed, where to read it, that it can be undone; nothing is added when the pass did not run. Spawning its personas is a sanctioned exception to the sub-agent guardrail (the second EXCEPTION block in the Mode A walkthrough, sibling to Phase 6 verification): a bounded, operator-visible validation remediation, not a delegated phase — so a faithful agent runs it here rather than disabling it.
The two critical deliverables are the requirements file and the functional test file. The requirements file (quality/REQUIREMENTS.md) feeds the code review protocol's verification and consistency passes — it's what makes the code review catch more than structural anomalies. The functional test file (named for the project's language and test framework conventions) is the automated safety net. The Markdown protocols are documentation for humans and AI agents.
See references/artifact_contract.md for the complete gate-validated artifact contract (the full artifact table, the canonical sidecar-JSON examples, and the run-metadata schema).
How to Use
The playbook is designed to run one phase at a time. Each phase runs in its own session with a clean context window, producing files on disk that the next phase reads. This gives much better results than running all phases at once — each phase gets the full context window for deep analysis instead of competing for space with other phases.
Default behavior: run Phase 1 only. When someone says "run the quality playbook" or "execute the quality playbook," run Phase 1 (Explore) and stop. After Phase 1 completes, tell the user what happened and what to say next. The user drives each phase forward explicitly.
Interactive protocol — how to guide the user
After every phase and every iteration, STOP and print guidance. Use a # header so it's prominent in the chat. The guidance must include: what just happened (one line), what the key outputs are, and the exact prompt to continue. See the end-of-phase messages defined after each phase section below.
If the user says "keep going", "continue", "next phase", "next", or anything similar, run the next phase in sequence. If all phases are complete, suggest the first iteration strategy (gap). If an iteration just finished, suggest the next strategy in the recommended cycle.
If the user says "run all phases", "run everything", or "run the full pipeline", run all phases sequentially in a single session. This uses more context but some users prefer it.
If the user asks "help", "how does this work", "what is this", or any similar phrasing, respond with this explanation (adapt the wording naturally, don't copy verbatim):
The Quality Playbook finds bugs that structural code review alone can't catch — the 35% of real defects that require understanding what the code is supposed to do. It works phase by phase:
- Phase 1 (Explore): Understand the codebase — architecture, risks, failure modes, specifications
- Phase 2 (Generate): Produce quality artifacts — requirements, tests, review protocols
- Phase 3 (Code Review): Three-pass review with regression tests for every confirmed bug
- Phase 4 (Spec Audit): Three independent AI auditors check the code against requirements
- Phase 5 (Reconciliation): Close the loop — TDD red-green verification for every bug
- Phase 6 (Verify): Self-check benchmarks validate all generated artifacts
After the numbered phases complete, you can run iteration strategies (gap, unfiltered, parity, adversarial) to find additional bugs — iterations typically add 40-60% more confirmed bugs on top of the baseline.
The playbook works best when you provide documentation alongside the code — specs, API docs, design documents, community documentation. It also gets significantly better results when you run each phase separately rather than all at once.
To get started, say: "Run the quality playbook on this project."
If the user asks "what happened", "what's going on", "where are we", or "what should I do next", read quality/PROGRESS.md and give them a concise status update: which phases are complete, how many bugs found so far, and what the next step is.
Documentation warning
At the start of Phase 1, before exploring any code, check for documentation. Look for directories named docs/, reference_docs/, doc/, documentation/, or any gathered documentation files. Also check if the user mentioned documentation in their prompt.
If no documentation is found, print this warning immediately (before proceeding):
Important: No project documentation found. The quality playbook works without documentation, but it finds significantly more bugs — and higher-confidence bugs — when you provide specs, API docs, design documents, or community documentation. In controlled experiments, documentation-enriched runs found different and better bugs than code-only baselines.
If you have documentation available, you can add it to a
reference_docs/directory and re-run Phase 1. Otherwise, I'll proceed with code-only analysis.
Then proceed with Phase 1 — don't block on this, just make sure the user sees the warning.
Doc gathering (pre-audit)
QPB derives a project's invariants from background documentation in its reference_docs/ directory — without it, QPB falls back to source-only evidence (Tier 3) and finds only shallow defects. QPB knows how to gather these docs itself.
When the user asks to gather background documentation, prepare reference_docs/, collect pre-audit context, or any equivalent ("get the docs ready for an audit of X", "build the reference corpus for X"), follow the protocol in references/DOC_GATHERING_PROMPT.md. Open that file, find the section "## The prompt (copy everything in this block)", and follow the boxed instructions inside the triple-backtick fences step by step (Step 0 grounding through Step 4 source-summary handback).
The same protocol works in two modes — the boxed prompt handles both without modification: when QPB is installed (you are now), Step 0 option (c) reads the local ai_context/TOOLKIT.md; when pasted into a fresh AI chat outside QPB, Step 0 option (a) handles the URL fetch.
Running a specific phase
The user can request any individual phase:
Run quality playbook phase 1.
Run quality playbook phase 3 — code review.
Run phase 5 reconciliation.
When running a specific phase, check that its prerequisites exist (e.g., Phase 3 requires Phase 2 artifacts). If prerequisites are missing, tell the user which phases need to run first.
Iteration mode — improve on a previous run
Use this when a previous playbook run exists and you want to find additional bugs. Iteration mode replaces Phase 1's from-scratch exploration with a targeted exploration using one of five strategies, then merges findings with the previous run and re-runs Phases 2–6 against the combined results.
When to use iteration mode: After a complete playbook run, when you believe the codebase has more bugs than the first run found. This is especially effective for large codebases where a single run can only cover 3–5 subsystems, and for library/framework codebases where different exploration paths find different bug classes.
Read references/iteration.md for detailed strategy instructions. That file contains the full operational detail for each strategy, shared rules, merge steps, and the completion gate. The summary below describes when to use each strategy.
TDD applies to iteration runs. Every newly confirmed bug in an iteration run must go through the full TDD red-green cycle and produce quality/results/BUG-NNN.red.log (and .green.log if a fix patch exists). The quality gate enforces this — missing logs cause FAIL. See references/iteration.md shared rule 5 and the TDD Log Closure Gate in Phase 5.
Iteration strategies. The user selects a strategy by naming it in the prompt. If no strategy is named, default to gap.
Run the next iteration of the quality playbook. # default: gap strategy
Run the next iteration of the quality playbook using the gap strategy.
Run the next iteration using the unfiltered strategy.
Run the next iteration using the parity strategy.
Run an iteration using the adversarial strategy.
Recommended cycle: gap → unfiltered → parity → adversarial. Each strategy finds different bug classes:
gap(default) — Scan previous coverage, explore uncovered subsystems and thin sections. Best when the first run was structurally sound but only covered a subset of the codebase.unfiltered— Pure domain-driven exploration with no structural constraints. No pattern templates, no applicability matrices, no section format requirements. Recovers bugs that structured exploration suppresses.parity— Systematically enumerate parallel implementations of the same contract (transport variants, fallback chains, setup-vs-reset paths) and diff them for inconsistencies. Finds bugs that only emerge from cross-path comparison.adversarial— Re-investigate dismissed/demoted triage findings and challenge thin SATISFIED verdicts. Recovers Type II errors from conservative triage.all— Runner-level convenience: executes gap → unfiltered → parity → adversarial in sequence, each as a separate agent session. Stops early if a strategy finds zero new bugs.
Phase-by-phase execution
Each phase produces files on disk that the next phase reads. This is how context transfers between phases — through files, not through conversation history. The key handoff files are:
quality/EXPLORATION.md— Phase 1 writes this, Phase 2 reads it. Contains everything Phase 2 needs to generate artifacts without re-exploring the codebase.quality/PROGRESS.md— Updated after every phase. Cumulative BUG tracker ensures no finding is lost.- Generated artifacts (REQUIREMENTS.md, CONTRACTS.md, etc.) — Phase 2 writes these, Phases 3–5 read them to run reviews, audits, and reconciliation.
The pattern for each phase boundary: finish the current phase, write everything to disk, then print the end-of-phase message and stop. When the user starts the next phase, read back the files you need before proceeding. This "write then read" cycle is the phase boundary — it lets you drop exploration context from working memory before loading review context, for example.
Phase 0 entry contract. The VERY first Bash call you make after the skill is invoked — before pwd, before ls, before any other Bash command — MUST be:
python3 <install_root>/bin/qpb_validate.py .
This is the Phase 0 entry contract first-probe. The phase0_first_probe assertion in the harness grading checks that qpb_validate.py is the LITERAL first Bash call — the first probe MUST be qpb_validate, before pwd, before ls, before any other Bash invocation.
If qpb_validate returns status=blocked (the target has both .claude and .github markers and you must disambiguate), DO NOT continue with any other tool call until you've re-invoked qpb_validate with the explicit --ai-tool=<tool> flag and confirmed it returns status=ok. Resolving the block is the only legitimate next action.
Phase 0 entry contract (gitignore remediation). After qpb_validate returns status=ok and before any artifact Writes, you must add quality/ to .gitignore in the target repo. If the file does not exist, create it; if it exists but does not contain a quality/ line, append quality/ on its own line. The gitignore_remediation_followed assertion in the harness grading verifies this step ran to completion. Do not skip this step — it prevents the playbook's own artifacts from polluting the target repo's git history.
Phase sentinel markers. After qpb_validate returns status=ok and the gitignore remediation lands, the next tool call you make MUST be the first qpb_phase emission:
python3 <install_root>/bin/qpb_phase.py 1 start
This is non-negotiable. The Test Harness status layer uses this sentinel to track which phase your run is in; without it, observers see your run as phase=— for 5-10 minutes while you do real work. Resolve <install_root> via the 10-layout fallback list documented below.
At each subsequent phase boundary:
- On phase entry:
python3 <install_root>/bin/qpb_phase.py <n> start(no--note). This MUST be the first tool call of that phase. - On phase exit:
python3 <install_root>/bin/qpb_phase.py <n> done --note "<1-3 sentence summary of what happened in this phase>". The note is your own free-text summary — what you did, what you found, what's notable. No rigid schema.
Tool-use protocol — parallel-call hygiene. Phase-artifact Writes — REQUIREMENTS.md, CONTRACTS.md, BUGS.md, QUALITY.md, COVERAGE_MATRIX.md, COMPLETENESS_REPORT.md, RUN_CODE_REVIEW.md, RUN_SPEC_AUDIT.md, RUN_TDD_TESTS.md, RUN_INTEGRATION_TESTS.md, and tdd-results.json — must NEVER be issued in a parallel batch with other tool calls. Each phase-artifact Write must be its own assistant turn — each phase-artifact Write must be a standalone tool call.
After every artifact Write, your VERY NEXT tool call must immediately Read the same file path to verify the file exists on disk. If the Read returns "file not found," the previous Write was cancelled (typically because a sibling Bash or other tool call in the same parallel batch errored, and Claude's parallel-call cancellation propagates the failure to the Write). When this happens you must retry the Write as a standalone tool call in its own turn.
This is non-negotiable. Agents that issued Write+Bash in parallel batches have been observed to see the Write silently cancelled when the Bash sibling errored — artifacts go missing, the Phase 6 gate FAILs with "missing artifact" issues, and the agent often misdiagnoses the symptom as "tool output delivered out of order" rather than "Write cancelled by sibling failure."
Each invocation prints exactly one ::QPB:: {json} line; the helper is install-bundled. The sentinel is observability only — it does NOT change any phase output, gate verdict, or grading.
Write your Phase 1 exploration findings to quality/EXPLORATION.md before proceeding. This file is mandatory in all modes. Make it thorough: domain identification, architecture map, existing tests, specification summary, quality risks, skeleton/dispatch analysis, derived requirements (REQ-NNN), and derived use cases (UC-NN). Everything Phase 2 needs to generate artifacts must be in this file.
The discipline of writing exploration findings to disk is what forces thorough analysis. Without it, the model keeps vague impressions in working memory and produces broad, abstract requirements that miss function-level defects. Writing forces specificity: file paths, line numbers, exact function names, concrete behavioral rules. That specificity is what makes requirements precise enough to catch bugs during code review.
Run-state instrumentation (write events as you go)
Two files in quality/ track this run's state across the filesystem so the run is observable in flight, resumable across crashes, and auditable afterward. Maintain both throughout the run.
quality/run_state.jsonl— append-only machine-readable event log. One JSON object per line. The orchestrator and any monitor reads this file to know exactly where the run is.quality/PROGRESS.md— human-readable status file, atomically rewritten on every event.
Authoritative schema: references/run_state_schema.md. Read it once at run start; it defines the full event taxonomy, required fields, cross-validation rules, and PROGRESS.md format.
The run initialization sequence, per-phase events (phase_start/phase_end), the Phase-1/4/5/6 sub-events (pattern_walked/pass_started/gate_check/run_end), the phase-end cross-validation rules, resume semantics, and the PROGRESS.md format are all defined in the authoritative references/run_state_schema.md (named above). bin/run_state_lib.py provides validate_phase_artifacts(quality_dir, phase) (cross-validation) and write_progress_md(...) (PROGRESS.md) as the programmatic enforcers.
Heartbeat emission (only when running under the harness)
If your dispatch prompt began with a HEARTBEAT_PATH=… / TASK_ID=… block (you were launched by the quality-playbook-harness orchestrator), emit liveness heartbeats so the orchestrator can track progress and detect stalls. If there is no such block (a normal interactive run), skip this section entirely — or pass --mode-a-noop and the calls silently no-op. Use the absolute HEARTBEAT_PATH and TASK_ID from that block verbatim; never derive paths from your cwd. The helper lives at <install_root>/bin/qpb_heartbeat.py (same <install_root> as qpb_phase.py).
- Every ~3 minutes mid-phase (mandatory keepalive):
python3 <install_root>/bin/qpb_heartbeat.py keepalive --run-state quality/run_state.jsonl --heartbeat-path <HEARTBEAT_PATH> --task-id <TASK_ID>. It reads your current phase fromrun_state.jsonl(the canonical position) and appends anIN_PROGRESSline — so the heartbeat's phase always matches the::QPB::sentinel. Without this ping a long phase trips the 45-minute stall threshold. - On any error before you abort:
… qpb_heartbeat.py emit --phase <N> --step <step> --status FAILED --message "<what failed>" --heartbeat-path <HEARTBEAT_PATH> --task-id <TASK_ID>. - At terminal (run end):
… qpb_heartbeat.py terminal --status COMPLETED --result-file quality/SUMMARY.md --summary "<one-line outcome>" --heartbeat-path <HEARTBEAT_PATH> --task-id <TASK_ID>(useFAILED/ABANDONEDif the run did not finish clean). This terminal line is how the orchestrator reaps your run.
Every value is JSON-encoded by the helper, so %, quotes, and backslashes in a message are safe. Phase identity comes from the shared phase_identity table — never hand-write a phase name. (Phase-boundary heartbeats are handled automatically by the phase-transition facade; you only issue the keepalive / error / terminal calls above.)
Phase 0: Prior Run Analysis (Automatic)
This phase runs only if quality/previous_runs/ exists and contains prior quality artifacts. If there are no prior runs, skip to Phase 1. If quality/previous_runs/ exists but is empty or contains no conformant quality artifacts (no subdirectories with quality/BUGS.md under them), skip Phase 0a and fall through to Phase 0b. (Legacy archives at quality/runs/ from pre-v1.5.4 remain readable for backward compatibility, but the canonical archive root is quality/previous_runs/.)
When prior runs exist, the playbook enters continuation mode. This enables iterative bug discovery: each run inherits confirmed findings from prior runs, verifies them mechanically, and explores for additional bugs. The iteration converges when a run finds zero net-new bugs.
Step 0a: Build the seed list. Read quality/previous_runs/*/quality/BUGS.md from all prior runs. For each confirmed bug, extract: bug ID, file:line, summary, and the regression test assertion. Deduplicate by file:line (the same bug found in multiple runs counts once). Write the merged seed list to quality/SEED_CHECKS.md with this format:
## Seed Checks (from N prior runs)
| Seed | Origin Run | File:Line | Summary | Assertion |
|------|-----------|-----------|---------|-----------|
| SEED-001 | run-1 | virtio_ring.c:3509-3529 | RING_RESET dropped | `"case VIRTIO_F_RING_RESET:" in func` |
Step 0b: Execute seed checks mechanically. For each seed, run the assertion against the current source tree. Record PASS (bug was fixed since last run) or FAIL (bug still present). A failing seed is a confirmed carry-forward bug — it must appear in this run's BUGS.md regardless of whether any auditor independently finds it. A passing seed means the bug was fixed — note it in PROGRESS.md as "SEED-NNN: resolved since prior run."
Step 0c: Identify prior-run scope. Read quality/previous_runs/*/quality/PROGRESS.md for scope declarations. Note which subsystems were covered in prior runs. During Phase 1 exploration, prioritize areas NOT covered by prior runs to maximize the chance of finding new bugs. If all subsystems were covered in prior runs, explore the same scope but with different emphasis (e.g., different scrutiny areas, different entry points).
Step 0d: Inject seeds into downstream phases. The seed list becomes input to:
- Phase 3 (code review): Add to the code review prompt: "Prior runs confirmed these bugs — verify they are still present and look for additional findings in the same subsystems."
- Phase 4 (spec audit): Add to
RUN_SPEC_AUDIT.md: "Known open issues from prior runs: [seed list]. Expect auditors to find these. If an auditor does NOT flag a known seed bug, that is a coverage gap in their review, not evidence the bug was fixed."
Why this exists: Non-deterministic scope exploration means different runs notice different bugs. In cross-version testing, 4/8 repos had bugs found in some versions but not others — not because the bugs were fixed, but because the model explored different parts of the codebase. Iterating with seed injection solves this: confirmed bugs carry forward mechanically (no re-discovery needed), and each new run can focus exploration on uncovered territory.
Phase 0b: Sibling-Run Seed Discovery (Automatic)
This step runs only if quality/previous_runs/ does not exist OR quality/previous_runs/ exists but contains no conformant quality artifacts (i.e., Phase 0a has nothing to work with) and the project directory is versioned (e.g., httpx-1.3.23/ sits alongside httpx-1.3.21/). If quality/previous_runs/ exists with conformant artifacts, Phase 0a already handles seed injection — skip this step.
If quality/previous_runs/ exists but is empty or contains only non-conformant subdirectories, emit a warning: "Phase 0b: quality/previous_runs/ exists but contains no conformant artifacts — consulting sibling versioned directories for seeds." Then proceed with the sibling discovery below.
When no quality/previous_runs/ directory exists but sibling versioned directories do, look for prior quality artifacts in those siblings:
- Discover siblings. List directories matching the pattern
<project-name>-<version>/quality/BUGS.mdrelative to the parent directory. Exclude the current directory. Sort by version descending (most recent first). - Import confirmed bugs as seeds. For each sibling with a
quality/BUGS.md, extract confirmed bugs using the same format as Step 0a. Write them toquality/SEED_CHECKS.mdwith origin noted as the sibling directory name. - Execute seed checks mechanically (same as Step 0b in Phase 0a). For each imported seed, run the assertion against the current source tree and record PASS/FAIL.
- Inject into downstream phases (same as Step 0d in Phase 0a).
Why this exists: A prior benchmark observed a target repo producing a zero-bug result on one run despite a previous run on the same repo having found a real bug. The model simply explored different code paths and never examined the area where the prior bug lived. Sibling-run seeding ensures that bugs confirmed in prior versioned runs carry forward even without an explicit quality/previous_runs/ archive. This is a different failure class than mechanical tampering — it addresses exploration non-determinism, not evidence corruption.
Phase 1: Explore the Codebase (Write As You Go)
See references/phase1_exploration_guide.md for the full Phase 1 coverage (instrumentation, file-role tagging, exploration patterns, EXPLORATION.md template, gate self-check, end-of-phase message).
Phase 2: Generate the Quality Playbook
See references/phase2_generation_guide.md for the full Phase 2 coverage (instrumentation, required-references list, source-modification guardrail, entry gate, requirements pipeline, generated-artifact templates, completion gate, end-of-phase message).
Phase 3: Code Review and Regression Tests
Instrumentation: Append phase_start phase=3 to quality/run_state.jsonl now. At phase end, cross-validate (quality/RUN_CODE_REVIEW.md exists; one writeup per identified bug) then append phase_end phase=3.
Required references for this phase:
quality/REQUIREMENTS.md— target list for the code reviewreferences/review_protocols.md— three-pass protocol and regression test conventions
Run the code review protocol (all three passes) as described in File 3. After producing findings, write regression tests for every confirmed BUG per the closure mandate in references/review_protocols.md.
Update PROGRESS.md: Add every confirmed BUG to the cumulative BUG tracker with source "Code Review", the file:line reference, description, severity, and closure status (regression test function name or exemption reason). Mark Phase 3 (Code review + regression tests) complete.
End-of-phase message (mandatory — print this after Phase 3 completes, then STOP):
# Phase 3 Complete — Code Review
The three-pass code review is done. [Summarize: N bugs confirmed, N regression test
patches generated, N fix patches generated. List the bug IDs and one-line summaries.]
To continue to Phase 4 (Spec audit — Council of Three), say:
Run quality playbook phase 4.
Or say "keep going" to continue automatically.
After printing this message, continue automatically to Phase 4 unless the operator invoked you for the current phase only (e.g., they typed Run quality playbook phase 3. for a single-phase run). The Mode A default per AGENTS.md is the full six-phase pipeline; per-phase STOP applies only to incremental operator-driven invocations.
Phase 4: Spec Audit and Triage
Instrumentation: Append phase_start phase=4 now. For each pass A/B/C/D, append pass_started phase=4 pass=X and pass_ended phase=4 pass=X. At phase end, cross-validate (quality/REQUIREMENTS.md non-empty AND quality/COVERAGE_MATRIX.md exists) then append phase_end phase=4.
Required references for this phase:
references/spec_audit.md— Council of Three protocol, triage process, verification probes
See references/spec_audit.md for the full spec-audit execution detail — the Council-of-Three audit + triage protocol, the effective-council gating rule for enumeration checks, the pre-audit spot-checks-from-code rule, the post-spec-audit regression step, the mandatory individual-auditor artifacts, and the Phase 4 completion gate.
Layer 2 — Semantic Citation Check (Council sub-pass)
After the main spec audit triage, each Council member runs a per-REQ verdict against every Tier 1/2 REQ's citation_excerpt. This is Layer 2 of the hallucination gate: Layer 1 is the mechanical byte-equality check — bin/citation_verifier is invoked by bin/reference_docs_ingest at ingest time and re-invoked by quality_gate.py at gate time; the LLM never shells out to it directly. Layer 2 is semantic — the reviewer decides whether the excerpt actually supports the requirement as stated, or whether the requirement overreaches what the excerpt says.
Protocol.
-
One prompt per Council member, all Tier 1/2 REQs batched in. Not one REQ at a time (3×N prompts is too many). Not a prose response (pattern-matching risk). The reviewer receives the full list of
(req_id, citation_excerpt, REQ description)tuples and returns a structured per-REQ JSON response. -
Structured response schema. For each REQ the reviewer records
{"req_id": "REQ-NNN", "reviewer": "<stable string>", "verdict": "supports" | "overreaches" | "unclear", "notes": "<reasoning>"}. The threeverdictvalues (supports,overreaches,unclear) are the legal enum. -
Batching threshold. When a run produces more than 15 Tier 1/2 REQs, split into batches of up to 15 REQs per prompt per Council member. The same reviewer sees each batch sequentially; their response entries are concatenated into one
reviews[]array under the samereviewerstring. -
Reviewer identifier stability. Use fixed strings like
"claude-opus-4.7","gpt-5.5","claude-sonnet-4.6"(the default Council roster). The majority computationquality_gate.pyruns groups on this field — a typo silently becomes a fourth reviewer and breaks the 2-of-3 majority check. -
Output. Assemble
quality/citation_semantic_check.jsonwithpython3 -m bin.quality_playbook semantic-check assemble(seephase_prompts/phase4.md), not by hand: the assembler stamps each review withreq_hash, which the gate uses to reject a review that predates a rewrite of its REQ. Standard manifest wrapper, record array namedreviews. One file per run, regenerated on every audit pass.
Majority rule (gate-enforced). For each Tier 1/2 REQ, the gate groups reviews by req_id and fails the run when ≥2 of 3 reviewers recorded verdict == "overreaches". A single-member overreaches or unclear verdict surfaces as a warning but does not fail the gate. A REQ with fewer than three reviewer entries (missing reviewer, skipped batch) has insufficient evidence — the gate treats that as a fail.
No-op for Spec Gap runs. If a run produces zero Tier 1/2 REQs, citation_semantic_check.json is still written with an empty reviews array — the file's existence is part of the artifact contract even when the check has nothing to evaluate.
End-of-phase message (mandatory — print this after Phase 4 completes, then STOP):
# Phase 4 Complete — Spec Audit
The Council of Three spec audit is done. [Summarize: N auditors ran, N net-new bugs
confirmed from triage, total bugs now at N. List any new bug IDs and summaries.]
To continue to Phase 5 (Reconciliation — TDD verification, writeups, closure), say:
Run quality playbook phase 5.
Or say "keep going" to continue automatically.
After printing this message, continue automatically to Phase 5 unless the operator invoked you for the current phase only (e.g., they typed Run quality playbook phase 4. for a single-phase run). The Mode A default per AGENTS.md is the full six-phase pipeline; per-phase STOP applies only to incremental operator-driven invocations.
Phase 5: Post-Review Reconciliation and Closure Verification
Instrumentation: Append phase_start phase=5 now. For each gate check, append gate_check gate_name=X verdict=pass|fail|warn|skip. At phase end, cross-validate (quality/results/quality-gate.log non-empty) then append phase_end phase=5.
Source-edit guardrail (mandatory). Phase 5 emits patch artifacts at quality/patches/<BUG-NNN>-fix.patch and quality/patches/<BUG-NNN>-regression-test.patch. The invariant is no source modification REMAINING at run end — not "never touch source mid-cycle." Phase 5 MAY apply patches solely to run the TDD red/green cycle and MUST git apply -R immediately after each log capture. At run end bin.run_state_lib.validate_no_source_edits(target_dir) runs; any non-quality/ path left dirty appends error recoverable:false and ends with run_end status=aborted. Boundary: apply→run→revert is OK; apply-and-leave is the 2026-05-02 off-rails class and aborts. When the runner is unavailable or a bug has no in-tree fix (upgrade-only CVE), the operator-supervised separate-apply step is the fallback. See phase_prompts/phase5.md.
Required references for this phase:
quality/PROGRESS.md— cumulative BUG tracker (authoritative finding list)references/challenge_gate.md— two-round challenge protocol for false-positive detectionreferences/requirements_pipeline.md— post-review reconciliation processreferences/review_protocols.md— regression test cleanup after reversalsreferences/spec_audit.md— verification probe protocol for conflicts
See references/phase5_reconciliation_guide.md for the full Phase 5 procedure (entry gate, challenge gate, terminal gate, TDD log-closure gate, and the reconciliation sub-gates).
End-of-phase message (mandatory — print this after Phase 5 completes, then STOP):
# Phase 5 Complete — Reconciliation and TDD Verification
All confirmed bugs now have regression tests, writeups, and TDD red-green verification.
[Summarize: N total confirmed bugs, N with TDD verified status, N with fix patches.
List all bug IDs with one-line summaries and their TDD verdicts.]
To continue to Phase 6 (Final verification and quality gate), say:
Run quality playbook phase 6.
Or say "keep going" to continue automatically.
After printing this message, continue automatically to Phase 6 unless the operator invoked you for the current phase only (e.g., they typed Run quality playbook phase 5. for a single-phase run). The Mode A default per AGENTS.md is the full six-phase pipeline; per-phase STOP applies only to incremental operator-driven invocations.
Phase 6: Verify
See references/phase6_verify_guide.md for the full Phase 6 coverage (instrumentation, verification protocol, convergence analysis, gate verdicts, end-of-phase message).
Recheck Mode — Verify Bug Fixes
See references/recheck_mode.md for the full recheck mode (when to use, the four-step recheck procedure, the recheck-results.json + recheck-summary.md schemas, and the trigger phrases).
Phase 7: Present, Explore, Improve (Interactive)
Canonical treatment. Phase 7 IS a phase — it produces operator-visible value — but it has no pre-baked prompt in phase_prompts/ because it's interactive by design. In Mode A, Phase 7 is conversational: the agent presents the artifact summary table, drills down on operator-selected artifacts, and surfaces a menu of improvement paths; the operator drives what to explore. In Mode B (runner-driven), Phase 7 is the orchestrator's post-Phase-6 hand-off — there is no automated subprocess, just the runner's next-step banner pointing the operator at the menu. "Do not skip" applies to both modes: Mode A means "present the summary and offer to explore"; Mode B means "the runner emits the next-step banner alongside the artifact path."
After generating and verifying, present the results clearly and give the user control over what happens next. This phase has three parts: a scannable summary, drill-down on demand, and a menu of improvement paths.
Do not skip this phase. The autonomous output from Phases 1-6 is a solid starting point, but the user needs to understand what was generated, explore what matters to them, and choose how to improve it. A quality playbook is only useful if the people who own the project trust it and understand it. Dumping six files without explanation creates artifacts nobody reads.
See references/phase7_guide.md for the full Phase 7 detail (Part 1 the summary table, Part 2 drill-down on demand, Part 3 the improvement menu, executing each improvement path, and iteration).
Prepare upstream submissions is menu path 5, operator-invoked only: policy check, shortlist (stop for the operator's pick), confirm, fix, review panel, then one bug at a time with a REVIEW.md and an operator-run submit.sh. See references/upstream_submission.md. Binding guardrails:
- The skill never submits, marks a PR ready, comments upstream, or merges; it never runs a
submit.shunless the operator asks in this session. - One bug at a time; no schedules, no batches. The project's contribution policy is checked first and wins (stop if AI contributions are banned).
- A finding with a security angle never becomes a public PR or issue; note it for private disclosure and set it aside.
- Every submission carries the disclosure line ("Found by Quality Playbook, an AI code-review tool, with Claude; I reviewed the change."), extended as the project's policy requires.
- No agent
Signed-off-byorCo-Authored-By; the operator authors the commit.
Fixture Strategy
The quality/ folder is separate from the project's unit test folder. Create the appropriate test setup for the project's language:
- Python:
quality/conftest.pyfor pytest fixtures. If fixtures are defined inline (common with pytest'stmp_pathpattern), prefer that over shared fixtures. - Java: A test class with
@BeforeEach/@BeforeAllsetup methods, or a shared test utility class. - Scala: A trait mixed into test specs (e.g.,
trait FunctionalTestFixtures), or inline data builders. - TypeScript/JavaScript: A
quality/setup.tswithbeforeAll/beforeEachhooks, or inline test factories. - Go: Helper functions in the same
_test.gofile or a sharedtestutil_test.go. Uset.Helper()for test helpers. Go convention prefers inline test setup over shared fixtures. - Rust: Helper functions in a
#[cfg(test)] mod testsblock, or a sharedtest_utils.rsmodule. Use builder patterns for test data.
Examine existing test files to understand how they set up test data. Whatever pattern the existing tests use, copy it. Study existing fixture patterns for realistic data shapes.
Terminology
- Functional testing — Does the code produce the output specs say it should? Distinct from unit testing (individual functions in isolation).
- Integration testing — Do components work together end-to-end, including real external services?
- Spec audit — AI models read code and compare against specs. No code executed. Catches where code doesn't match documentation.
- Coverage theater — Tests that produce high coverage numbers but don't catch real bugs. Example: asserting a function didn't throw without checking its output.
- Fitness-to-purpose — Does the code do what it's supposed to do under real-world conditions? A system can have 95% coverage and still lose records silently.
Principles
- Fitness-to-purpose over coverage percentages
- Scenarios come from code exploration AND domain knowledge
- Concrete failure modes make standards non-negotiable — abstract requirements invite rationalization
- Guardrails transform AI review quality (line numbers, read bodies, grep before claiming)
- Triage before fixing — many "defects" are spec bugs or design decisions
- Structural review has a ceiling (~65%). The remaining ~35% are intent violations — absence bugs, cross-file contradictions, design gaps — invisible to any tool that only reads code. Requirements make the invisible visible.
- The specification is the unique contribution, not the review structure. Focus areas and review protocols are secondary to having the right testable requirements derived from intent sources.
- Cross-requirement consistency checking is essential. Bugs often live in the gap between two individually-correct pieces of code. Per-requirement verification alone can't find these.
- Keep all derived requirements — do not filter. The cost of checking an extra requirement is low; the cost of missing a bug because you pruned the requirement that would have caught it is high.
- A failing test is the strongest evidence a bug exists. Run the red-green TDD cycle (test fails on buggy code, passes on fixed code) for every confirmed bug with a fix patch. Show the FAIL→PASS output — reviewers can disagree with your fix but can't argue with a reproducing test.
"What just happened" — required final block at every phase boundary
After completing any phase (1, 2, 3, 4, 5, 6), a single-pass run, an iteration round (gap / unfiltered / parity / adversarial), or a recheck, emit a Markdown-rendered block in chat of this shape — as the last visible content of the phase, after any technical artifact summary:
## What just happened
<1-3 sentences of plain English describing what was completed, what wasn't,
and the honest interpretation of the result. NOT a copy of PROGRESS.md or
BUGS.md — an interpretive layer over them.>
### What to do next
<1-3 sentences naming the logical next step, with the exact command or prompt to use.>
This block is mandatory at every phase boundary. The reason it exists: without it, adopters who hit failure modes like pass-process / fail-recall (where Phases 1-2 produce real artifacts but Phases 3-5 stub out and the gate passes with zero confirmed bugs) cannot see what went wrong without QPB-power-user knowledge of the gate verdicts. Surfacing the interpretive layer as plain English in chat scrollback fixes that.
Single source of truth: the decision tree mapping run state → block content is in references/what_just_happened.md. Consult it before emitting — it holds one template per run state and the mechanical classifier for picking which state applies. Do NOT inline the decision tree here or in phase prompts — single-sourced in the reference file.
Plain-English contract. No QPB-internal jargon without a parenthetical gloss. The first sentence of "What just happened" should make sense to an adopter reading their first run; the "What to do next" sentence must contain a concrete next prompt or shell command. See the DO NOT section of references/what_just_happened.md for full enforcement rules.
Reference Files
Read these as you work through each phase:
| File | When to Read | Contains |
|---|---|---|
references/exploration_patterns.md |
Phase 1 (explore) | Pattern applicability matrix, deep-dive templates, domain-knowledge questions |
references/defensive_patterns.md |
Step 5 (finding skeletons) | Grep patterns, how to convert findings to scenarios |
references/schema_mapping.md |
Step 5b (schema types) | Field mapping format, mutation validity rules |
references/requirements_pipeline.md |
Phase 2 (requirements) | Five-phase pipeline, versioning protocol, carry-forward rules |
references/constitution.md |
File 1 (QUALITY.md) | Full template with section-by-section guidance |
references/functional_tests.md |
File 2 (functional tests) | Test structure, anti-patterns, cross-variant strategy |
references/review_protocols.md |
Files 3–4 (code review, integration) | Templates for both protocols, patch validation, skip guards |
references/spec_audit.md |
File 5 (Council of Three) | Full audit protocol, triage process, fix execution |
references/iteration.md |
Iterations (after Phase 6) | Four iteration strategies: gap, unfiltered, parity, adversarial |
references/verification.md |
Phase 6 (verify) | Complete self-check checklist (45 benchmarks; the file lists them) |
references/upstream_submission.md |
Phase 7 path 5, when the operator asks | Policy check, shortlist, confirmer/fixer briefs, review panel, REVIEW.md template, bin/upstream_scripts.py |
references/claims_rules.md |
Before writing BUGS.md, writeups, or any operator-facing claim | Claim rules R1–R3, R6–R8, flag words, pre-output checklist |
references/what_just_happened.md |
Every phase boundary (1-6) + end-of-run + iterations + recheck | Mandatory ## What just happened + ### What to do next block contract; run-state classifier; one template per run state |
04 同仓库更多 Skills
template-skill
Replace with description of the skill and when Claude should use it.
quality-playbook
暂无简介
quality-playbook-harness
Orchestrate Quality Playbook (or any) runs across multiple repos from one agent session. Drives a disk-backed state machine one idempotent tick at a time — each tick the tick script reads workers' heartbeats, advances the state machine, and lists which workers to dispatch; the orchestrator launches them, prints the script's status table, and schedules the next tick (via ScheduleWakeup at cadence rung 1, or the foreground ticker at lower rungs). Dispatch is in-session subagents (rung 1) or detached shell workers. Runs until every job is terminal or a STOP file appears. Use when asked to run QPB against several repos at once, run a benchmark plan, or orchestrate multi-repo quality reviews.
skill_fixture
暂无简介
hybrid_fixture
暂无简介