tdd:fix-tests
Systematically fix all failing tests after business logic changes or refactoring
- License 许可
- MIT
- 最近更新
- 2026-10-02
- Stars
- ★ 9
- Forks
- 1
01 前言 Front Matter
- name
- tdd:fix-tests
- description
- Systematically fix all failing tests after business logic changes or refactoring
- argument-hint
- what tests or modules to focus on
02 资源文件 268
- 参考文档.pi/skills/prompt-lab/prompts/12_qra_RELATIONSHIP_SYSTEM_PROMPT.txt3.8 KB
- 参考文档.pi/skills/prompt-lab/prompts/12_qra_SIMPLE_SYSTEM_PROMPT.txt3.5 KB
- 参考文档.pi/skills/prompt-lab/prompts/12_qra_SPARTA_SYSTEM_PROMPT.txt3.6 KB
- 参考文档.pi/skills/prompt-lab/prompts/12_qra_TACTIC_CONTROL_PROMPT.txt4.1 KB
- 脚本analyze_disagreements.py3.3 KB
- 脚本batch_checkpoint.py8.7 KB
- 脚本citation_validator.py7.2 KB
- 脚本config.py4.3 KB
- 脚本cwe_evaluation.py15.1 KB
- 参考文档docs/01_HARDENING_TASKS.md6.6 KB
- 参考文档docs/01_PROMPT_LAB_RELIABILITY_TASKS.md6.7 KB
- 参考文档docs/QRA_QUESTION_EXAMPLES.md12.1 KB
- 参考文档docs/review_request.md1.4 KB
- 脚本eval_assessor.py6.4 KB
- 脚本eval_qra_correction.py4.6 KB
- 脚本evaluation.py17.0 KB
- 脚本fetch_chutes_models.py12.4 KB
- 脚本ground_truth.py11.9 KB
- 参考文档ground_truth/quality_review.md4.1 KB
- 脚本llm.py20.3 KB
- 脚本memory_integration.py6.6 KB
- 脚本model_memory.py11.0 KB
- 脚本models.py4.4 KB
- 脚本optimization.py8.5 KB
- 脚本pl_app.py660 B
- 脚本pl_eval_f36.py12.6 KB
- 脚本pl_eval_heart_rationale.py10.0 KB
- 脚本pl_eval_heart.py12.1 KB
- 脚本pl_eval_json.py14.2 KB
- 脚本pl_eval_judge.py11.9 KB
- 脚本pl_eval_mind_rationale.py10.4 KB
- 脚本pl_eval_nlg.py8.8 KB
- 脚本pl_eval_qra.py4.3 KB
- 脚本pl_eval_sparta.py32.0 KB
- 脚本pl_eval_vision.py11.7 KB
- 脚本pl_eval.py13.2 KB
- 脚本pl_find_minimum.py14.3 KB
- 脚本pl_ground_truth.py11.8 KB
- 脚本pl_judge.py3.3 KB
- 脚本pl_models.py1.1 KB
- 脚本pl_optimize.py15.0 KB
- 脚本pl_tools.py5.2 KB
- 参考文档policy.yaml1.2 KB
- 脚本pricing_core.py15.8 KB
- 脚本pricing_data.py6.7 KB
- 脚本pricing_estimation.py10.4 KB
- 脚本pricing_models.py6.8 KB
- 脚本pricing_providers.py17.2 KB
- 脚本prompt_extractor.py1.7 KB
- 脚本prompt_hash.py5.3 KB
- 脚本prompt_lab.py1.5 KB
- 参考文档prompts/adversarial_commands_v1.txt4.9 KB
- 参考文档prompts/binary_explorer_chat_v1.txt979 B
- 参考文档prompts/bridge-tagger.txt911 B
- 参考文档prompts/cascade_grader_v4.txt1.7 KB
- 参考文档prompts/cascade_grader_v5.txt1.5 KB
- 参考文档prompts/cascade_grader_v6_lite.txt718 B
- 参考文档prompts/cascade_grader_v6.txt2.9 KB
- 参考文档prompts/cascade_grader_v7.txt4.2 KB
- 参考文档prompts/cascade_grader_v8.txt4.2 KB
- 参考文档prompts/cascade_grader_v9.txt5.5 KB
- 参考文档prompts/chain_rationale_v1.txt1.9 KB
- 参考文档prompts/chain_rationale_v2.txt5.1 KB
- 参考文档prompts/code_runner_format_v1.txt196 B
- 参考文档prompts/code_runner_format_v2.txt964 B
- 参考文档prompts/code_runner_format_v3.txt2.1 KB
- 参考文档prompts/code_runner_system_v1.txt2.6 KB
- 参考文档prompts/code_runner_system_v2.txt2.0 KB
- 参考文档prompts/code_runner_system_v3.txt2.5 KB
- 参考文档prompts/convergence_advice_v1.txt1.3 KB
- 参考文档prompts/create_movie_dream_prompter_v1.txt1.1 KB
- 参考文档prompts/create_movie_expert_review_v1.txt732 B
- 参考文档prompts/create_paper_grounded_section_v1.txt777 B
- 参考文档prompts/cwe_validation_v1.txt2.0 KB
- 参考文档prompts/data-sufficiency-gate.txt1019 B
- 参考文档prompts/datalake_tier2_validator.txt372 B
- 参考文档prompts/discord_brandon_prefix.txt430 B
- 参考文档prompts/discord_embry_system.txt1.3 KB
- 参考文档prompts/discord_jennifer_prefix.txt345 B
- 参考文档prompts/discord_noah_prefix.txt328 B
- 参考文档prompts/doc2qra_context_prefix_v1.txt221 B
- 参考文档prompts/doc2qra_system_v1.txt938 B
- 参考文档prompts/doc2qra_system_v2.txt4.1 KB
- 参考文档prompts/doc2qra_user_v1.txt124 B
- 参考文档prompts/doc2qra_user_v2.txt430 B
- 参考文档prompts/elf_features_v1.txt1.5 KB
- 参考文档prompts/elf_features_v2.txt1.6 KB
- 参考文档prompts/embry_os_design_master_v1.txt2.4 KB
- 参考文档prompts/evidence_answer_repair_v1.txt310 B
- 参考文档prompts/evidence_answer_v1.txt215 B
- 参考文档prompts/evidence_case_adversarial_v1.txt2.8 KB
- 参考文档prompts/evidence_case_chat.txt462 B
- 参考文档prompts/evidence_grounding_gate_v1.txt3.7 KB
- 参考文档prompts/evidence_grounding_gate_v2.txt2.5 KB
- 参考文档prompts/evidence_grounding_gate_v3.txt656 B
- 参考文档prompts/evidence_qra_correction_v1.txt1.5 KB
- 参考文档prompts/evidence_qra_correction_v2.txt1.7 KB
- 参考文档prompts/evidence_qra_correction_v3.txt2.2 KB
- 参考文档prompts/exploit_writer_v1.txt453 B
- 参考文档prompts/exploit_writer_v2.txt1.1 KB
- 参考文档prompts/extracted/12_qra_RELATIONSHIP_SYSTEM_PROMPT.txt2.4 KB
- 参考文档prompts/extracted/12_qra_SIMPLE_SYSTEM_PROMPT.txt2.3 KB
- 参考文档prompts/extracted/12_qra_SPARTA_SYSTEM_PROMPT.txt3.1 KB
- 参考文档prompts/extracted/12_qra_TACTIC_CONTROL_PROMPT.txt2.8 KB
- 参考文档prompts/f36_compliance_bridge_v1.txt4.5 KB
- 参考文档prompts/f36_safety_artifact_v1.txt5.8 KB
- 参考文档prompts/f36_threat_artifact_v1.txt4.6 KB
- 参考文档prompts/gpt_binex-intent_v2.txt2.2 KB
- 参考文档prompts/gpt_binex-intent.txt2.3 KB
- 参考文档prompts/gpt_binex-queryspec_v3.txt3.0 KB
- 参考文档prompts/gpt_bridge-tagger.txt858 B
- 参考文档prompts/gpt_cascade-grader.txt1.3 KB
- 参考文档prompts/gpt_chain-rationale.txt5.1 KB
- 参考文档prompts/gpt_cybersecurity-extraction-auditor.txt1.8 KB
- 参考文档prompts/gpt_edge-relevance-scorer.txt1.0 KB
- 参考文档prompts/gpt_edge-scorer.txt624 B
- 参考文档prompts/gpt_edge-verifier.txt685 B
- 参考文档prompts/gpt_episodic-session-scorer.txt852 B
- 参考文档prompts/gpt_extraction-quality-assessor.txt1.5 KB
- 参考文档prompts/gpt_heart-rationale.txt835 B
- 参考文档prompts/gpt_humanization-rewriter.txt968 B
- 参考文档prompts/gpt_mind-rationale.txt996 B
- 参考文档prompts/gpt_page-anticipation.txt222 B
- 参考文档prompts/gpt_paper-section-reviewer.txt982 B
- 参考文档prompts/gpt_peer-review-critic.txt994 B
- 参考文档prompts/gpt_proof-rationale.txt1.1 KB
- 参考文档prompts/gpt_qra-assessor.txt1.2 KB
- 参考文档prompts/gpt_session-analyzer.txt641 B
- 参考文档prompts/gpt_sparta_stress_grading.txt824 B
- 参考文档prompts/gpt_sparta-entity-extractor.txt1.1 KB
- 参考文档prompts/gpt_sparta-intent.txt1.1 KB
- 参考文档prompts/gpt_sparta-pipeline-validator.txt1.9 KB
- 参考文档prompts/gpt_sparta-question-miner.txt1.2 KB
- 参考文档prompts/gpt_sparta-rationale.txt872 B
- 参考文档prompts/gpt_taxonomy-enricher.txt2.0 KB
- 参考文档prompts/gpt_test-task.txt271 B
- 参考文档prompts/heart_tagger_v1.txt1.9 KB
- 参考文档prompts/humanization-rewriter.txt951 B
- 参考文档prompts/ingest_youtube_enrichment_system_v1.txt1.5 KB
- 参考文档prompts/intent_augmentation_v1.txt18.6 KB
- 参考文档prompts/memory_horus_lore_enrichment_v1.txt1.9 KB
- 参考文档prompts/midi_arrangement_v1.txt3.0 KB
- 参考文档prompts/music-compile-generation-prompt.txt5.1 KB
- 参考文档prompts/music-lyrics-annotate.txt4.4 KB
- 参考文档prompts/music-piano-roll-spec.txt4.8 KB
- 参考文档prompts/nico_design_review_v1.txt1.6 KB
- 参考文档prompts/nlg_synthesis_v1.txt3.9 KB
- 参考文档prompts/paper-section-reviewer.txt1.7 KB
- 参考文档prompts/patch_writer_v1.txt479 B
- 参考文档prompts/patch_writer_v2.txt986 B
- 参考文档prompts/persona_review_code_vlm_v1.txt1.4 KB
- 参考文档prompts/persona_review_v1.txt1.9 KB
- 参考文档prompts/persona_review_vlm_v1.txt3.0 KB
- 参考文档prompts/qra_assessor.txt1.4 KB
- 参考文档prompts/qra_capec_v1.txt3.5 KB
- 参考文档prompts/qra_cwe_v1.txt4.8 KB
- 参考文档prompts/qra_cwe_v2.txt2.6 KB
- 参考文档prompts/qra_defensive_v1.txt4.1 KB
- 参考文档prompts/qra_do178c_v1.txt2.8 KB
- 参考文档prompts/qra_domain_system_prompt.txt10.5 KB
- 参考文档prompts/qra_evidence_formatter_v1.txt2.2 KB
- 参考文档prompts/qra_exploit_v1.txt4.0 KB
- 参考文档prompts/qra_formal_v1.txt2.8 KB
- 参考文档prompts/qra_generation_control_native_v1.txt4.2 KB
- 参考文档prompts/qra_generation_sparta_context_v1.txt9.1 KB
- 参考文档prompts/qra_grounded_v1.txt3.6 KB
- 参考文档prompts/qra_ics_ot_v1.txt2.8 KB
- 参考文档prompts/qra_independent_judge.txt2.2 KB
- 参考文档prompts/qra_judge.txt3.1 KB
- 参考文档prompts/qra_model_v1.txt4.1 KB
- 参考文档prompts/qra_nist_v1.txt2.7 KB
- 参考文档prompts/qra_persist_v1.txt4.1 KB
- 参考文档prompts/qra_quality_judge_v2.txt4.0 KB
- 参考文档prompts/qra_quality_judge.txt2.2 KB
- 参考文档prompts/qra_semantic_relevance_v1.txt5.0 KB
- 参考文档prompts/qra_simple_system_prompt.txt4.1 KB
- 参考文档prompts/qra_stpa_v1.txt2.8 KB
- 参考文档prompts/qra_tactic_control_prompt.txt5.3 KB
- 参考文档prompts/qra_v1.txt1.6 KB
- 参考文档prompts/qra_variations_v1.txt4.3 KB
- 参考文档prompts/queryspec_v1.txt1.3 KB
- 参考文档prompts/relationship_system_prompt_v1_backup.txt6.9 KB
- 参考文档prompts/relationship_system_prompt_v2.txt2.5 KB
- 参考文档prompts/relationship_system_prompt_v3.txt5.4 KB
- 参考文档prompts/relationship_system_prompt.txt5.4 KB
- 参考文档prompts/review_code_loop_coder_fix_v1.txt587 B
- 参考文档prompts/review_code_loop_coder_init_v1.txt298 B
- 参考文档prompts/review_code_loop_reviewer_v1.txt945 B
- 参考文档prompts/review_code_step1_v1.txt351 B
- 参考文档prompts/review_code_step2_v1.txt567 B
- 参考文档prompts/review_code_step3_v1.txt493 B
- 参考文档prompts/review_design_persona.txt944 B
- 参考文档prompts/review_design_step1_audit.txt3.6 KB
- 参考文档prompts/review_design_step2_judge.txt1.4 KB
- 参考文档prompts/review_design_step3_finalize.txt1.6 KB
- 参考文档prompts/review_design_system.txt2.3 KB
- 参考文档prompts/review_music_system.txt743 B
- 参考文档prompts/review_paper_cross_section_v1.txt652 B
- 参考文档prompts/review_paper_section_review_v1.txt1.2 KB
- 参考文档prompts/review_paper_system_v1.txt243 B
- 参考文档prompts/review_question_brandon.txt1.4 KB
- 参考文档prompts/review_question_difficulty.txt563 B
- 参考文档prompts/review_question_evaluation.txt1.1 KB
- 参考文档prompts/review_question_follow_up.txt855 B
- 参考文档prompts/review_question_generation.txt2.6 KB
- 参考文档prompts/review_question_naturalness.txt653 B
- 参考文档prompts/review_question_v1_optimized_variant_a.txt2.4 KB
- 参考文档prompts/review_question_v1.txt2.3 KB
- 参考文档prompts/shadow_bridge_tagger.txt361 B
- 参考文档prompts/shadow_edge_relevance_scorer.txt426 B
- 参考文档prompts/shadow_extraction_quality_assessor.txt380 B
- 参考文档prompts/shadow_page_anticipation.txt640 B
- 参考文档prompts/shadow_qra_assessor_v2.txt1.8 KB
- 参考文档prompts/shadow_qra_assessor_v3.txt2.4 KB
- 参考文档prompts/shadow_qra_assessor_v4.txt3.1 KB
- 参考文档prompts/shadow_qra_assessor_v5.txt4.4 KB
- 参考文档prompts/shadow_qra_assessor_v6.txt2.5 KB
- 参考文档prompts/shadow_qra_assessor_v7.txt1.9 KB
- 参考文档prompts/shadow_qra_assessor.txt1.8 KB
- 参考文档prompts/shadow_sparta_ambiguity.txt353 B
- 参考文档prompts/shadow_sparta_intent.txt372 B
- 参考文档prompts/shadow_sparta_pipeline_validator.txt329 B
- 参考文档prompts/shadow_table_strategy_selector.txt543 B
- 参考文档prompts/simple_system_prompt_v2.txt2.3 KB
- 参考文档prompts/simple_system_prompt_v3.txt2.8 KB
- 参考文档prompts/simple_system_prompt.txt6.7 KB
- 参考文档prompts/skill_lab_distill_failure_v1.txt610 B
- 参考文档prompts/skill_lab_distill_success_v1.txt613 B
- 参考文档prompts/skill_lab_gap_reasoning_v1.txt1.2 KB
- 参考文档prompts/sparta_entity_extraction_v1.txt446 B
- 参考文档prompts/sparta_intent_queryspec.txt2.6 KB
- 参考文档prompts/sparta_qra_expert_v1.txt865 B
- 参考文档prompts/sparta_qra_v2.txt2.7 KB
- 参考文档prompts/sparta_reasoning_system_v1.txt1.1 KB
- 参考文档prompts/sparta_student_grade_v1_optimized_variant_a.txt2.6 KB
- 参考文档prompts/sparta_student_grade_v1.txt1.9 KB
- 参考文档prompts/sparta_system_prompt.txt7.6 KB
- 参考文档prompts/sparta_teacher_grade_v1_optimized_variant_a.txt2.0 KB
- 参考文档prompts/sparta_teacher_grade_v1.txt1.4 KB
- 参考文档prompts/sparta_tier2_validator.txt338 B
- 参考文档prompts/tactic_control_prompt_optimized_variant_a.txt2.3 KB
- 参考文档prompts/tactic_control_prompt_optimized_variant_b.txt3.4 KB
- 参考文档prompts/tactic_control_prompt_v1_backup.txt7.9 KB
- 参考文档prompts/tactic_control_prompt_v2.txt3.0 KB
- 参考文档prompts/tactic_control_prompt_v3.txt7.0 KB
- 参考文档prompts/tactic_control_prompt.txt7.0 KB
- 参考文档prompts/taxonomy_cwe_v1.txt2.4 KB
- 参考文档prompts/taxonomy_v1.txt1.4 KB
- 参考文档prompts/taxonomy_v2.txt1.6 KB
- 参考文档prompts/viz-type-selector.txt1.5 KB
- 参考文档prompts/voice_embry_fallback.txt235 B
- 参考文档prompts/yt_qra_v1.txt1.4 KB
- 参考文档prompts/yt_summary_v1.txt574 B
- 脚本provenance.py6.3 KB
- 脚本provider_pricing.py3.0 KB
- 其他pyproject.toml564 B
- 脚本qra_evaluation.py12.6 KB
- 脚本qra_validators.py26.3 KB
- 脚本quality_sampling.py4.4 KB
- 脚本run.sh844 B
- 脚本sanity.sh3.8 KB
- 脚本scripts/eval_chain_rationale.py10.2 KB
- 脚本space_specificity_scorer.py14.0 KB
- 脚本sparta_connector.py11.6 KB
- 脚本task_monitor_client.py7.2 KB
- 脚本test_scillm.py1.8 KB
- 脚本utils.py1.6 KB
- 脚本watchdog.py3.2 KB
03 SKILL.md 正文
Fix Tests
User Arguments
User can provide to focus on specific tests or modules:
$ARGUMENTS
If nothing is provided, focus on all tests.
Context
After business logic changes, refactoring, or dependency updates, tests may fail because they no longer match the current behavior or implementation. This command orchestrates automated fixing of all failing tests using specialized agents.
Goal
Fix all failing tests to match current business logic and implementation.
Important Constraints
- Focus on fixing tests - avoid changing business logic unless absolutely necessary
- Preserve test intent - ensure tests still validate the expected behavior
- "Analyse complexity of changes" -
- if there 2 or more changed files, or one file with complex logic, then Do not write tests yourself - only orchestrate agents!
- if there is only one changed file, and it's a simple change, then you can write tests yourself.
Workflow Steps
Preparation
-
Read sadd skill if available
- If available, read the sadd skill to understand best practices for managing agents
-
Discover test infrastructure
- Read @README.md and package.json (or equivalent project config)
- Identify commands to run tests and coverage reports
- Understand project structure and testing conventions
-
Run all tests
- Execute full test suite to establish baseline
-
Identify all failing test files
- Parse test output to get list of failing test files
- Group by file for parallel agent execution
Analysis
- Verify single test execution
- Choose any test file
- Launch haiku agent with instructions to find proper command to run this only test file
- Ask him to iterate until you can reliably run individual tests
- After he complete try running a specific test file if it exists
- This ensures agents can run tests in isolation
Test Fixing
-
Launch
developeragents (parallel)- Launch one agent per failing test file
- Provide each agent with clear instructions:
- Context: Why this test needs fixing (business logic changed)
- Target: Which specific file to fix
- Guidance: Read TDD skill (if available) for best practices how to write tests.
- Resources: Read README and relevant documentation
- Command: How to run this specific test file
- Goal: Iterate until test passes
- Constraint: Fix test, not business logic (unless clearly broken)
-
Verify all fixes
- After all agents complete, run full test suite again
- Verify all tests pass
-
Iterate if needed
- If any tests still fail: Return to step 5
- Launch new agents only for remaining failures
- Continue until 100% pass rate
Success Criteria
- All tests pass ✅
- Test coverage maintained
- Test intent preserved
- Business logic unchanged (unless bugs found)
Agent Instructions Template
When launching agents, use this template:
The business logic has changed and test file {FILE_PATH} is now failing.
Your task:
1. Read the test file and understand what it's testing
2. Read TDD skill (if available) for best practices on writing tests.
3. Read @README.md for project context
4. Run the test: {TEST_COMMAND}
5. Analyze the failure - is it:
- Test expectations outdated? → Fix test assertions
- Test setup broken? → Fix test setup/mocks
- Business logic bug? → Fix logic (rare case)
6. Fix the test and verify it passes
7. Iterate until test passes
04 同仓库更多 Skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
docs:write-concisely
Apply writing rules to any documentation that humans will read. Makes your writing clearer, stronger, and more professional.
kaizen:why
Iterative Five Whys root cause analysis drilling from symptoms to fundamentals
verification-loop
A comprehensive verification system for Claude Code sessions.
verification-before-completion
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always