Skip to content

ci: add markdownlint infrastructure#159

Draft
scottschreckengaust wants to merge 7 commits intomainfrom
worktree-add-markdownlint
Draft

ci: add markdownlint infrastructure#159
scottschreckengaust wants to merge 7 commits intomainfrom
worktree-add-markdownlint

Conversation

@scottschreckengaust
Copy link
Copy Markdown
Member

@scottschreckengaust scottschreckengaust commented Mar 30, 2026

Summary

Adds markdownlint-cli2 infrastructure and fixes all violations outside aidlc-rules/. Remaining violations exist only in LLM prompt files and are temporarily disabled in config for incremental remediation.

  • .markdownlint-cli2.yaml — project rule configuration with tiered exceptions
  • .github/workflows/ci.yml — CI workflow (pull_request, push to main, workflow_dispatch)
  • .pre-commit-config.yaml — optional local pre-commit hook
  • 585 violations fixed across 25 non-prompt files (zero aidlc-rules/ changes)
  • 4 rules fully re-enabled (MD041, MD049, MD034, MD028 — zero violations remain)

Why a separate ci.yml (not pull-request-lint.yml)

pull-request-lint.yml uses pull_request_target and deliberately never checks out PR code — it only inspects metadata (title, labels, body). Running markdownlint requires checking out code, which must use pull_request to avoid running untrusted PR code in a privileged base-branch context.


Violation Report

Starting point: 3,118 violations across 57 files (603,487 chars total)

What this PR resolves

Category Violations Action
Fixed outside aidlc-rules/ 585 Auto-fix + manual (MD009, MD012, MD022, MD028, MD029, MD031, MD032, MD034, MD040, MD047, MD049, MD060)
Rules fully re-enabled 4 rules MD041 (fixed), MD049, MD034, MD028 (all at zero violations)
Permanently disabled 1,674 4 rules (MD013, MD033, MD024, MD036)
Remaining (aidlc-rules/ only) 859 14 rules temporarily disabled

Rules permanently disabled (1,674 violations)

Rule Description Violations Why permanently disabled
MD013 line-length (80 chars) 1,630 Long URLs, tables, code examples, ASCII diagrams. Reflowing would touch ~60% of files.
MD033 no-inline-html 4 <img> tags for screenshots/badges in README
MD024 no-duplicate-heading 18 Platform guides reuse section names for consistency
MD036 no-emphasis-as-heading 22 Bold text functions as sub-labels inside list items

Rules fully re-enabled (0 violations)

Rule Description How resolved
MD041 first-line-heading Fixed: CODE_OF_CONDUCT.md H2→H1
MD049 emphasis-style Fixed: all _* outside aidlc-rules/; zero violations inside
MD034 no-bare-urls Fixed: URLs wrapped outside aidlc-rules/; zero violations inside
MD028 no-blanks-blockquote Fixed: WORKING-WITH-AIDLC.md blockquote continuations; zero inside

Incremental Remediation Plan — Remaining aidlc-rules/ Violations

All 859 remaining violations are exclusively inside aidlc-rules/ (LLM prompt instructions). Each follow-up PR re-enables one rule and fixes its violations, ordered by minimal prompt impact.

Tier 1: Zero prompt impact — invisible whitespace (15 violations)

PR Rule Description Violations Chars changed LLM impact
2 MD009 no-trailing-spaces 9 -9 (spaces) None — trailing spaces stripped during tokenization
3 MD012 no-multiple-blanks 2 -2 (newlines) None — consecutive newlines collapse to single token
4 MD047 single-trailing-newline 4 +4 (newlines) None — EOF newline invisible to tokenizer

Tier 2: Zero prompt impact — formatting normalization (18 violations)

PR Rule Description Violations Chars changed LLM impact
5 MD029 ol-prefix (1/1/1) 1 0 (digit swap) None — numbering style irrelevant to parsed list
6 MD026 no-trailing-punctuation 17 -17 (colons) None — heading structure from ## markers, not :

Tier 3: Zero prompt impact — blank line structure (731 violations)

PR Rule Description Violations Chars changed LLM impact
7 MD022 blanks-around-headings 274 +274 (newlines) None — LLMs parse ## regardless of whitespace
8 MD032 blanks-around-lists 426 +426 (newlines) None — list items parsed from markers, not blank lines
9 MD031 blanks-around-fences 31 +31 (newlines) None — code fences parsed from ``` markers

Tier 4: Minimal prompt impact — table formatting (34 violations)

PR Rule Description Violations Chars changed LLM impact
10 MD060 table-column-style 34 ~50 (spaces) Negligible — pipe-delimited structure unchanged

Tier 5: Low prompt impact — structural cosmetic (42 violations)

PR Rule Description Violations Chars changed LLM impact
11 MD046 code-block-style 8 ~40 Low — normalizes to fenced style; content identical
12 MD007 ul-indent 34 ~70 (spaces) Low — adjusts nesting spaces; hierarchy preserved

Tier 6: Needs review — adds content or changes structure (31 violations)

PR Rule Description Violations Chars changed LLM impact
13 MD040 fenced-code-language 18 ~90 Review — adds language specifiers; some fences may intentionally omit
14 MD025 single-title (H1) 13 varies Review — may require restructuring heading hierarchy

Permanently disabled — not planned

Rule Violations Rationale
MD013 1,630 80-char limit impractical for tables, URLs, ASCII diagrams
MD033 4 <img> tags needed for image sizing/alignment
MD024 18 Platform guides intentionally reuse section names
MD036 22 Bold sub-labels would change document structure if converted to headings

Total summary

Metric Value
Starting violations 3,118
Fixed in this PR 585 (all outside aidlc-rules/)
Rules re-enabled 4 (MD041, MD049, MD034, MD028)
Permanently suppressed 1,674 (4 rules)
Remaining (aidlc-rules/ only) 859 (14 rules)
Planned follow-up PRs 13
Total chars to change in aidlc-rules/ ~965 of 603,487 (0.16%)
Files modified in this PR 25 (zero under aidlc-rules/)

Licenses

All dependencies are MIT licensed:

Component License Repository
markdownlint MIT DavidAnson/markdownlint
markdownlint-cli2 MIT DavidAnson/markdownlint-cli2
markdownlint-cli2-action MIT DavidAnson/markdownlint-cli2-action
pre-commit MIT pre-commit/pre-commit

Test plan

  • ci.yml workflow runs successfully on this PR (0 violations expected)
  • npx markdownlint-cli2 "**/*.md" produces 0 errors locally
  • .pre-commit-config.yaml works with pre-commit run --all-files
  • Verify zero files under aidlc-rules/ were modified
  • Review permanently disabled rules rationale
  • Review tiered remediation plan ordering
  • Confirm remaining 859 violations are all inside aidlc-rules/

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

Add .markdownlint-cli2.yaml with all current violations temporarily
disabled and tiered for incremental re-enablement by prompt impact.
Add ci.yml workflow with markdownlint-cli2-action on pull_request,
push to main, and workflow_dispatch. Add .pre-commit-config.yaml for
optional local pre-commit linting.

No markdown content changes — violation fixes planned for follow-up PRs.
@scottschreckengaust scottschreckengaust force-pushed the worktree-add-markdownlint branch from 8380b3d to b121070 Compare March 30, 2026 22:49
scottschreckengaust and others added 4 commits March 30, 2026 15:53
Change `## Code of Conduct` to `# Code of Conduct` (H2 → H1) to
satisfy MD041/first-line-heading. Only violation was outside
aidlc-rules/ — zero LLM prompt impact. Rule re-enabled in config.
Fix 585 violations across 25 non-LLM-prompt files:
- MD028: fix 4 blank lines in blockquotes (WORKING-WITH-AIDLC.md)
- MD040: add language specifiers to 84 fenced code blocks
- MD060: normalize table pipe spacing across 13 files (322 fixes)
- Auto-fix: MD009, MD012, MD022, MD029, MD031, MD032, MD047, MD049

Re-enable 3 rules now at zero violations: MD049, MD034, MD028.
Update remaining violation counts to aidlc-rules/-only totals.

No files under aidlc-rules/ were modified — zero LLM prompt impact.
Set MD060 to "aligned" style in project config — all table columns
are now width-padded with vertically aligned pipes.

Add aidlc-rules/.markdownlint-cli2.yaml to suppress MD060 in LLM
prompt files pending separate review.

Aligned tables in 14 files outside aidlc-rules/ using automated
formatter. Zero aidlc-rules/ content files modified.
@github-actions
Copy link
Copy Markdown
Contributor

Note: This PR changes aidlc-rules/ but the codebuild label has not been applied.

A maintainer must add the codebuild label to trigger the CodeBuild evaluation pipeline.
Once labeled, subsequent pushes will re-trigger the build automatically.

Update git-cliff body template:
- Add blank line after ### group headings (MD022/MD032)
- Add postprocessor to collapse triple+ blank lines (MD012)
- Set trim = false so leading \n creates inter-body separators

Add CHANGELOG.md to markdownlint ignores since git-cliff
postprocessors run per-body and cannot control inter-body
spacing or trailing whitespace.

Regenerate CHANGELOG.md with improved template.
Move all temporarily disabled rules from the top-level config into
aidlc-rules/.markdownlint-cli2.yaml since violations exist only in
that directory. The top-level config now contains only permanently
disabled rules and global style settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant