Skip to content

af-spec template changes that directly enable new lint rules #166

@mickume

Description

@mickume

Requirement count validation

The SKILL.md says "no more than 10 requirements" and the completeness checklist includes it, but no lint rule enforces it.

SKILL change: None needed (already specified). Lint rule: excess-requirements (warning) — count ### Requirement N: headings per spec.

Task group 1 must be "Write failing spec tests"

This is described as "mandatory and non-negotiable" in the SKILL, it's in the completeness checklist, but it's not checked by the linter.

SKILL change: None needed. Lint rule: first-group-not-tests (warning) — check task group 1's title contains "test" or "spec test."

Property-to-Requirement back-reference validation

Each property in design.md has a Validates: Requirements X.Y, X.Z line. Currently the linter checks Property -> test_spec (via untraced-property) but never validates that the requirement IDs in the Validates: line actually exist in requirements.md.

SKILL change: Standardize the Validates: line format more strictly. Require requirement IDs to use the full NN-REQ-X.Y form (some specs use shorthand like "Requirements 1.1, 1.2"). Lint rule: orphan-property-ref (warning) — validate that every requirement ID in a property's Validates: line exists in requirements.md.

Test spec entry required fields

Each test case entry should have Requirement:, Type:, Preconditions:, Input:, Expected:, and Assertion pseudocode:. These are in the template but nothing checks they're present.

SKILL change: Mark these as mandatory sub-sections within each ### TS-NN-N entry. Lint rule: incomplete-test-case (warning) — for each TS entry heading, check that the required field markers are present before the next TS heading.

Edge-case-to-error-table bidirectional check

The error handling table in design.md should have an entry for every edge case requirement (NN-REQ-X.EY). Currently the linter checks that error table refs exist in requirements.md, but not the reverse: that every edge case requirement has a corresponding error table entry.

SKILL change: Add to the completeness checklist: "Every edge case requirement (NN-REQ-X.EY) has a corresponding row in the Error Handling table." Lint rule: uncovered-edge-case (warning) — edge case requirements in requirements.md not found in the error handling table.

Test spec ID prefix validation

Test spec IDs should use the spec's numeric prefix (e.g., spec 45 uses TS-45-*). There's no check that a spec doesn't accidentally use wrong-numbered TS IDs.

Lint rule: wrong-ts-prefix (error) — TS entry uses a numeric prefix that doesn't match the spec folder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions