一键导入
ldd-enforcement
Lint-Driven Development — formatting and syntax gate that runs BEFORE test execution. Violations block TDD entry. Triggers at Phase 4 entry.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Lint-Driven Development — formatting and syntax gate that runs BEFORE test execution. Violations block TDD entry. Triggers at Phase 4 entry.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
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.
基于 SOC 职业分类
| name | ldd-enforcement |
| description | Lint-Driven Development — formatting and syntax gate that runs BEFORE test execution. Violations block TDD entry. Triggers at Phase 4 entry. |
LDD ensures code is structurally sound before testing begins. Run linters, formatters, and type-checkers FIRST. Fix all violations. Only then proceed to TDD.
LDD is the formatting and syntax gate. TDD is the success criteria gate. Both are mandatory, both are sequential, both block.
1. Run all configured linters → collect violations
2. Run all configured formatters → collect formatting issues
3. Run all configured type-checkers → collect type errors
4. Run repo convention structural scan → collect convention violations when target repo conventions are present
5. Any violations?
YES → Fix all violations → Go to step 1
NO → Proceed to TDD
This is a hard gate. Lint violations block test execution. A task cannot enter TDD until LDD is clean.
| Language | Linters | Formatters | Type Checkers |
|---|---|---|---|
| Python | ruff | black | mypy |
| JavaScript | eslint | prettier | — |
| TypeScript | eslint | prettier | tsc |
| Rust | clippy | rustfmt | (compiler) |
| Go | golangci-lint | gofmt | (compiler) |
| Category | Examples | Why It Matters |
|---|---|---|
| Code style | Indentation, line length, naming conventions | Consistency reduces cognitive load |
| Type safety | Missing type annotations, type mismatches | Catches bugs before runtime |
| Import hygiene | Unused imports, circular imports, ordering | Reduces dependency surface |
| Dead code | Unreachable code, unused variables/functions | Reduces maintenance burden |
| Naming conventions | snake_case vs camelCase consistency | Pattern recognition speed |
| File structure | Module organization, init.py completeness | Navigability |
| Repo conventions | Rust module doc first-line responsibility, impure-shell boundaries, coordinator-thin files | Enforces target repo standards before TDD |
When target repo conventions are present, LDD must run the mechanical convention gate for every changed file it supports:
bin/adlc convention-scan --file <changed-file> --json
Rust is supported first. The scan fails a changed Rust file when:
//! module-doc line appears to describe multiple jobs with andmod.rs or module.rs beside module/) contains worker logic instead of thin coordination and re-exportsEscape hatch: a task may proceed only if the scan output or task output records an explicit waiver with file, rule, and reason, for example src/foo.rs:side_effect_without_impure_shell:legacy split tracked separately. Silent ignores are failures.
Hard boundary: LDD must never use file size, line count, or SLOC as a criterion. Size may be observed by other tools, but it cannot block, warn, or justify a split.
A Rust file with a first module-doc line such as //! Reading and writing records plus std::fs access fails before TDD:
bin/adlc convention-scan --file src/collect.rs --json
Expected findings:
module_doc_multiple_jobs because the first //! line describes more than one responsibility with andside_effect_without_impure_shell because filesystem access appears without an impure-shell declarationA coordinator file such as src/project.rs or src/project/mod.rs also fails with coordinator_worker_logic when it contains worker functions instead of declarations, wiring, and re-exports.
LDD checks outcomes (does the code pass lint?) not process (did the agent format before writing?).
Remove when: Models produce lint-clean code >95% of the time. At that point, this gate becomes a no-op validation — keep it running but it won't block.
adlc:
ldd:
linters:
- ruff
- mypy
formatters:
- black
type_checkers: [] # covered by mypy for Python
convention_scan: true
block_on_violation: true
auto_fix: true # attempt auto-fix before reporting violations
| Excuse | Rebuttal |
|---|---|
| "Linting slows down iteration" | A 2-second lint check prevents 20-minute debugging sessions |
| "The code works, formatting doesn't matter" | Unformatted code increases review time and hides bugs |
| "Type annotations are overkill for this" | Types are documentation that the compiler verifies |
| "I'll clean it up later" | Later never comes. Lint debt compounds. |
| "The file is small enough" | File size and line count are not ADLC convention criteria. Enforce responsibility, side effects, and coordinator boundaries instead. |
bin/adlc convention-scan passes for changed supported files, or every waiver is explicit with file, rule, and reason