一键导入
spec-to-tests
Authors failing tests and reproducers from Build Brief acceptance criteria plus verification_spec before coding starts.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Authors failing tests and reproducers from Build Brief acceptance criteria plus verification_spec before coding starts.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Orchestration skill: chains the full ADLC Build Loop. PRD → Brief → Council → Scaffold → Codegen → LDD → TDD → Council → PR. Use when implementing a new feature end-to-end.
Generate a bounded, schema-valid goal prompt from one validated Build Brief task for zero-context external execution.
Applicability-aware Definition of Done checklist. Core checks apply to every task; overlay checks activate only when the applicability manifest says the surface exists. Binary verification — pass or fail. Triggers at Phase 4 completion and Phase 5 entry.
Score whether each task is specific enough for autonomous, one-shot, production-ready execution.
Reviews code changes for understanding, blast radius, state, secrets, assumptions, and explainability. Produces a blocking comprehension artifact when implications are unclear.
Resolve ambiguous triage outcomes in the middle confidence band.
| name | spec-to-tests |
| description | Authors failing tests and reproducers from Build Brief acceptance criteria plus verification_spec before coding starts. |
| contract_version | 1.0.0 |
| side_effect_profile | mutating |
Spec -> tests is the locking stage. The Build Brief names the contract; failing tests and reproducers turn that contract into a harness that blocks guesswork and anchors code to correctness. Coding should begin only after the verifier fails for the documented reason.
phase: 3
event: context_assembly_pending
requires:
- applicability_manifest
- verification_spec
- structured acceptance_criteria
This skill runs when gen_tests receives assembled Build Brief context for a task and must author the native failing verifier artifacts that the coder will inherit.
Use exactly these inputs:
task_classificationverification_spec (primary_verifier, secondary_verifiers, optional target_files, optional expected_failure_mode)acceptance_criteriafiles_to_create/modifyreference_impl pathmodule_plan; required when the task creates or reshapes modules unless module-plan-check generated one from a registered paved-road patternloop_contract_path when the task changes an LLM-driven loop, action admission, test selection, control events, no-progress detection, escalation, or loop maturityIf any acceptance criterion arrives as an unstructured string with no normalized id, given, when, and then, do not invent structure. Emit stuck.
module_plan.applicability=required, the architecture test named in
module_plan.architecture_test.test_path is authored before production code
and before behavior tests that depend on the new layout.module_plan_source=pattern, the architecture test must also preserve the matched pattern's pure/impure split and exemplar structure. If an explicit plan departs from the pattern, test the stated pattern_deviation_reason..adlc/test_plan.json mapping ac_id -> test_path -> expected_pre_change_failure_reasoncoverage_tags and covers_required_tests so bin/adlc loop-test-selection can mechanically prove the mandatory floor and task-signal tests are covered.execution_evidence_refs and top-level test_result_refs, then use bin/adlc loop-test-selection --require-test-results [path] so coverage cannot pass on tags alone..adlc/pre_change_run.txt capturing stdout from the pre-change run that proves the generated verifier fails for the documented reasonverification_spec, acceptance_criteria, files_to_create/modify, and reference_impl.module_plan.applicability=required, author module_plan.architecture_test first. The test must enforce the listed files, one-line responsibilities, pure/impure markings, registered pattern constraints when module_plan_source=pattern, and forbidden catch-all names before any production code is written.verification_spec.target_files when present.loop_contract_path is active, read the Loop Contract and list its test_selection.mandatory_floor and test_selection.required_from_task_signals test IDs before authoring tests.coverage_tags and covers_required_tests when they satisfy a Loop Contract test ID.bin/adlc loop-test-selection --loop-contract [loop_contract_path] --test-plan .adlc/test_plan.json --json before returning done when a Loop Contract is active.loop-test-result artifact exists for required tests, run bin/adlc loop-test-selection --loop-contract [loop_contract_path] --test-plan .adlc/test_plan.json --require-test-results [loop-test-result path] --json before returning done..adlc/pre_change_run.txt..adlc/test_plan.json only after the self-check passes.featurebugfixbuild_validationlint_cleanuprefactortarget_files is set, place or select tests whose paths intersect those files or the immediate native test peer paths that exercise them.infradocstarget_files when those paths are provided.securityexpected_failure_mode is set, make the pre-change run show that specific vulnerable behavior or failure signature before coding starts.Before emitting done, all of these must pass:
acceptance_criteria id has >=1 generated test.assert true, no empty bodies.expected_failure_mode when set.verification_spec.target_files when target_files is set.test_plan.json validates against the schema in this skill.Loop Contract addendum:
loop_contract_path is active.coverage_tags and covers_required_tests; prose explanations do not satisfy bin/adlc loop-test-selection.docs/schemas/loop-test-result.schema.json; tag-only plans are capped below robust.test_plan.json){
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ADLC Spec-to-Tests Plan",
"type": "object",
"additionalProperties": false,
"required": [
"brief_id",
"task_id",
"generated_tests",
"pre_change_run_path",
"verifier_target_intersection",
"self_check"
],
"properties": {
"brief_id": {
"type": "string",
"minLength": 1
},
"task_id": {
"type": "string",
"minLength": 1
},
"generated_tests": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"ac_id",
"test_path",
"test_name",
"expected_pre_change_failure_reason",
"assertion_count"
],
"properties": {
"ac_id": {
"type": "string",
"pattern": "^AC-[A-Z0-9_-]+$"
},
"test_path": {
"type": "string",
"minLength": 1
},
"test_name": {
"type": "string",
"minLength": 1
},
"expected_pre_change_failure_reason": {
"type": "string",
"minLength": 1
},
"assertion_count": {
"type": "integer",
"minimum": 1
},
"coverage_tags": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"covers_required_tests": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"execution_evidence_refs": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
}
}
}
},
"test_result_refs": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"pre_change_run_path": {
"type": "string",
"const": ".adlc/pre_change_run.txt"
},
"verifier_target_intersection": {
"type": "boolean"
},
"self_check": {
"type": "object",
"additionalProperties": false,
"required": [
"gate_1",
"gate_2",
"gate_3",
"gate_4",
"gate_5",
"gate_6"
],
"properties": {
"gate_1": {
"type": "string",
"enum": ["pass", "fail"]
},
"gate_2": {
"type": "string",
"enum": ["pass", "fail"]
},
"gate_3": {
"type": "string",
"enum": ["pass", "fail"]
},
"gate_4": {
"type": "string",
"enum": ["pass", "fail"]
},
"gate_5": {
"type": "string",
"enum": ["pass", "fail"]
},
"gate_6": {
"type": "string",
"enum": ["pass", "fail"]
}
}
}
}
}
stuck.stuck.target_files cannot be confirmed -> emit revise.No TODO/FIXME/PLACEHOLDER. No stub functions. No commented-out code. Every function has a real implementation. Every import is used.
Banned in shipped code and generated tests:
TODO, FIXME, PLACEHOLDERtodo!(), unimplemented!(), panic!("not implemented")NotImplementedError, pass, empty placeholder bodiesassert true, empty it() or test() bodies, and snapshot-only tests with no concrete assertionInput acceptance criterion:
{
"id": "AC-BALANCE-ZERO",
"given": "a newly created account with no ledger entries",
"when": "the account summary is requested",
"then": "the summary returns balance_cents set to 0",
"measurable_post_condition": "response.json.balance_cents == 0"
}
Output test body:
def test_account_summary_returns_zero_balance_for_new_account(client, account_factory):
account = account_factory(entries=[])
response = client.get(f"/accounts/{account.id}/summary")
assert response.status_code == 200
assert response.json["balance_cents"] == 0
Expected pre-change failure reason:
AssertionError: assert None == 0
Input acceptance criterion:
{
"id": "AC-CSV-TRAILING-NEWLINE",
"given": "a CSV export with one data row",
"when": "the exporter serializes the file",
"then": "the export ends with exactly one trailing newline"
}
Output test body:
def test_export_csv_ends_with_exactly_one_trailing_newline(report_factory):
report = report_factory(rows=[{"id": 1, "name": "Ada"}])
output = export_csv(report)
assert output.endswith("\n")
assert not output.endswith("\n\n")
assert output == "id,name\n1,Ada\n"
Expected pre-change failure reason:
AssertionError: assert not True