diff --git a/.cspell.json b/.cspell.json deleted file mode 100644 index fbf8052..0000000 --- a/.cspell.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "version": "0.2", - "language": "en", - "words": [ - "Anson", - "Blockquotes", - "buildmark", - "BuildMark", - "buildnotes", - "camelcase", - "Checkmarx", - "CodeQL", - "copilot", - "cspell", - "csproj", - "dbproj", - "dcterms", - "Dema", - "demaconsulting", - "DEMACONSULTINGNUGETKEY", - "Dependabot", - "dependabot", - "doctitle", - "dotnet", - "editorconfig", - "filepart", - "fsproj", - "Gidget", - "gitattributes", - "ibiqlik", - "LINQ", - "maintainer", - "markdownlint", - "mermaid", - "mstest", - "myterm", - "ncipollo", - "nuget", - "nupkg", - "opencover", - "pagetitle", - "pandoc", - "Pylint", - "Qube", - "reqstream", - "ReqStream", - "reviewmark", - "ReviewMark", - "reviewplan", - "reviewreport", - "Sarif", - "SarifMark", - "SBOM", - "Semgrep", - "semver", - "slnx", - "snupkg", - "sonarmark", - "SonarMark", - "SonarQube", - "spdx", - "streetsidesoftware", - "templatetool", - "testname", - "TMPL", - "tracematrix", - "triaging", - "Trivy", - "trx", - "vbproj", - "vcxproj", - "Weasyprint", - "yamllint" - ], - "ignorePaths": [ - "node_modules", - ".git", - "bin", - "obj", - "*.nupkg", - "*.snupkg", - "*.dll", - "*.exe", - "*.trx", - "*.spdx.json", - "package-lock.json", - "yarn.lock", - "AGENT_REPORT_*.md" - ] -} diff --git a/.cspell.yaml b/.cspell.yaml new file mode 100644 index 0000000..87c7064 --- /dev/null +++ b/.cspell.yaml @@ -0,0 +1,100 @@ +--- +# Spell-Checking +# +# PURPOSE: +# - Maintain professional documentation and code quality +# - Catch spelling errors before publication +# - Support consistent technical terminology usage +# - Misspelled words should be fixed in the source +# - NEVER add a misspelled word to the 'words' list +# - PROPOSE only genuine technical terms/names as needed + +version: "0.2" +language: en + +# Project-specific technical terms and tool names +words: + - Anson + - Blockquotes + - buildmark + - BuildMark + - buildnotes + - camelcase + - Checkmarx + - CodeQL + - copilot + - cspell + - csproj + - dbproj + - dcterms + - Dema + - demaconsulting + - DEMACONSULTINGNUGETKEY + - Dependabot + - dependabot + - doctitle + - dotnet + - editorconfig + - filepart + - fsproj + - Gidget + - gitattributes + - ibiqlik + - LINQ + - maintainer + - markdownlint + - mermaid + - mstest + - myterm + - ncipollo + - nuget + - nupkg + - opencover + - pagetitle + - pandoc + - Propagatable + - Pylint + - Qube + - reqstream + - ReqStream + - reviewmark + - ReviewMark + - reviewplan + - reviewreport + - Sarif + - SarifMark + - SBOM + - Semgrep + - semver + - slnx + - snupkg + - sonarmark + - SonarMark + - SonarQube + - spdx + - streetsidesoftware + - templatetool + - testname + - TMPL + - tracematrix + - triaging + - Trivy + - trx + - vbproj + - vcxproj + - versionmark + - Weasyprint + - yamllint + +# Exclude common build artifacts, dependencies, and vendored third-party code +ignorePaths: + - "**/.git/**" + - "**/node_modules/**" + - "**/.venv/**" + - "**/thirdparty/**" + - "**/third-party/**" + - "**/3rd-party/**" + - "**/AGENT_REPORT_*.md" + - "**/bin/**" + - "**/obj/**" + - package-lock.json diff --git a/.github/agents/code-quality-agent.md b/.github/agents/code-quality.agent.md similarity index 71% rename from .github/agents/code-quality-agent.md rename to .github/agents/code-quality.agent.md index ac9ea02..56f9fd1 100644 --- a/.github/agents/code-quality-agent.md +++ b/.github/agents/code-quality.agent.md @@ -1,6 +1,7 @@ --- -name: Code Quality Agent +name: code-quality description: Ensures code quality through linting and static analysis - responsible for security, maintainability, and correctness +tools: [read, search, execute] --- # Code Quality Agent - SarifMark @@ -31,8 +32,8 @@ Ensure the project is: 1. **Build**: Zero warnings (TreatWarningsAsErrors=true) 2. **Linting**: - - markdownlint (`.markdownlint-cli2.jsonc`) - - cspell (`.cspell.json`) + - markdownlint (`.markdownlint-cli2.yaml`) + - cspell (`.cspell.yaml`) - yamllint (`.yamllint.yaml`) - dotnet format (`.editorconfig`) 3. **Static Analysis**: @@ -70,12 +71,19 @@ dotnet reqstream --requirements requirements.yaml \ lint.bat # Windows ``` -## Defer To +## Subagent Delegation -- **Requirements Agent**: For requirements quality and test linkage strategy -- **Technical Writer Agent**: For fixing documentation content -- **Software Developer Agent**: For fixing production code issues -- **Test Developer Agent**: For fixing test code issues +If requirements quality or test linkage issues are found, call the @requirements agent with the **request** to +address requirements quality and test linkage strategy and the **context** of the issues found. + +If documentation content needs fixing, call the @technical-writer agent with the **request** to fix the +documentation content and the **context** of the issues found. + +If production code issues are found, call the @software-developer agent with the **request** to fix the +production code issues and the **context** of the issues found. + +If test code issues are found, call the @test-developer agent with the **request** to fix the test code issues +and the **context** of the issues found. ## Don't diff --git a/.github/agents/code-review-agent.md b/.github/agents/code-review.agent.md similarity index 98% rename from .github/agents/code-review-agent.md rename to .github/agents/code-review.agent.md index 0f35499..63566d2 100644 --- a/.github/agents/code-review-agent.md +++ b/.github/agents/code-review.agent.md @@ -1,6 +1,7 @@ --- -name: Code Review Agent +name: code-review description: Assists in performing formal file reviews - knows how to elaborate review-sets and perform structured review checks +tools: [read, search] --- # Code Review Agent - SarifMark diff --git a/.github/agents/repo-consistency-agent.md b/.github/agents/repo-consistency.agent.md similarity index 84% rename from .github/agents/repo-consistency-agent.md rename to .github/agents/repo-consistency.agent.md index 61ffd1d..7e2ba9c 100644 --- a/.github/agents/repo-consistency-agent.md +++ b/.github/agents/repo-consistency.agent.md @@ -1,6 +1,7 @@ --- -name: Repo Consistency Agent +name: repo-consistency description: Ensures downstream repositories remain consistent with the TemplateDotNetTool template patterns and best practices +tools: [read, search, execute] --- # Repo Consistency Agent - SarifMark @@ -56,7 +57,7 @@ The agent reviews the following areas for consistency with the TemplateDotNetToo #### Quality Configuration -- **Linting Rules**: `.cspell.json`, `.markdownlint.json`, `.yamllint.yaml` +- **Linting Rules**: `.cspell.yaml`, `.markdownlint-cli2.yaml`, `.yamllint.yaml` - Note: Spelling exceptions will be repository-specific - **Editor Config**: `.editorconfig` settings (file-scoped namespaces, 4-space indent, UTF-8+BOM, LF endings) - **Code Style**: C# code style rules and analyzer configuration @@ -118,18 +119,27 @@ long-term consistency. ### What NOT to Flag - Project-specific naming (SarifMark vs TemplateDotNetTool, package IDs, repository URLs) -- Project-specific spell check exceptions in `.cspell.json` +- Project-specific spell check exceptions in `.cspell.yaml` - Workflow variations for specific project needs - Additional requirements or features beyond the template - Project-specific dependencies -## Defer To +## Subagent Delegation -- **Software Developer Agent**: For implementing code changes recommended by consistency check -- **Technical Writer Agent**: For updating documentation to match template -- **Requirements Agent**: For updating requirements.yaml -- **Test Developer Agent**: For updating test patterns -- **Code Quality Agent**: For applying linting and code style changes +If code changes recommended by the consistency check need implementing, call the @software-developer agent +with the **request** to implement the code changes and the **context** of the consistency findings. + +If documentation needs updating to match the template, call the @technical-writer agent with the **request** +to update the documentation and the **context** of the template differences. + +If requirements.yaml needs updating, call the @requirements agent with the **request** to update +requirements.yaml and the **context** of the changes needed. + +If test patterns need updating, call the @test-developer agent with the **request** to update the test +patterns and the **context** of the template differences. + +If linting and code style changes need applying, call the @code-quality agent with the **request** to apply +the linting and code style changes and the **context** of the template differences. ## Usage Pattern diff --git a/.github/agents/requirements-agent.md b/.github/agents/requirements.agent.md similarity index 78% rename from .github/agents/requirements-agent.md rename to .github/agents/requirements.agent.md index 6bfb689..05179db 100644 --- a/.github/agents/requirements-agent.md +++ b/.github/agents/requirements.agent.md @@ -1,6 +1,7 @@ --- -name: Requirements Agent +name: requirements description: Develops requirements and ensures appropriate test coverage - knows which requirements need unit/integration/self-validation tests +tools: [read, edit, search, github] --- # Requirements Agent - SarifMark @@ -66,12 +67,19 @@ evidence. This is critical for platform and framework requirements - **never rem Without the source filter, a test result from any platform/framework satisfies the requirement. Removing a filter invalidates the evidence for platform/framework requirements. -## Defer To +## Subagent Delegation -- **Software Developer Agent**: For implementing self-validation tests -- **Test Developer Agent**: For implementing unit and integration tests -- **Technical Writer Agent**: For documentation of requirements and processes -- **Code Quality Agent**: For verifying test quality and enforcement +If self-validation tests need implementing, call the @software-developer agent with the **request** to +implement the self-validation tests and the **context** of the requirements and test strategy. + +If unit or integration tests need implementing, call the @test-developer agent with the **request** to +implement the unit and integration tests and the **context** of the requirements and test strategy. + +If documentation of requirements and processes needs updating, call the @technical-writer agent with the +**request** to update the documentation and the **context** of the requirements changes. + +If test quality or enforcement needs verifying, call the @code-quality agent with the **request** to verify +test quality and enforcement and the **context** of the requirements and test linkage. ## Don't diff --git a/.github/agents/software-developer.md b/.github/agents/software-developer.agent.md similarity index 72% rename from .github/agents/software-developer.md rename to .github/agents/software-developer.agent.md index 53ab991..f37b0f1 100644 --- a/.github/agents/software-developer.md +++ b/.github/agents/software-developer.agent.md @@ -1,6 +1,7 @@ --- -name: Software Developer +name: software-developer description: Writes production code and self-validation tests - targets design-for-testability and literate programming style +tools: [read, edit, search, execute] --- # Software Developer - SarifMark @@ -66,12 +67,19 @@ var results = ProcessFile(options.InputFile); - Must support TRX/JUnit output format - Link to requirements in `requirements.yaml` -## Defer To +## Subagent Delegation -- **Requirements Agent**: For new requirement creation and test strategy -- **Test Developer Agent**: For unit and integration tests -- **Technical Writer Agent**: For documentation updates -- **Code Quality Agent**: For linting, formatting, and static analysis +If new requirements or test strategy decisions are needed, call the @requirements agent with the **request** to +create new requirements and determine the test strategy and the **context** of the feature being implemented. + +If unit or integration tests are needed, call the @test-developer agent with the **request** to implement the +unit and integration tests and the **context** of the production code changes. + +If documentation updates are needed, call the @technical-writer agent with the **request** to update the +documentation and the **context** of the code changes made. + +If linting, formatting, or static analysis issues need resolving, call the @code-quality agent with the +**request** to resolve the linting and static analysis issues and the **context** of the code changes made. ## Don't diff --git a/.github/agents/technical-writer.md b/.github/agents/technical-writer.agent.md similarity index 63% rename from .github/agents/technical-writer.md rename to .github/agents/technical-writer.agent.md index 5cb044c..942a045 100644 --- a/.github/agents/technical-writer.md +++ b/.github/agents/technical-writer.agent.md @@ -1,6 +1,7 @@ --- -name: Technical Writer +name: technical-writer description: Ensures documentation is accurate and complete - knowledgeable about regulatory documentation and special document types +tools: [read, edit, search] --- # Technical Writer - SarifMark @@ -34,14 +35,15 @@ Invoke the technical-writer for: - **All markdown files**: Use reference-style links `[text][ref]` with `[ref]: url` at document end - **Exceptions**: - **README.md**: Use absolute URLs in the links (shipped in NuGet package) - - **AI agent markdown files** (`.github/agents/*.md`): Use inline links `[text](url)` so URLs are visible in agent context + - **AI agent markdown files** (`.github/agents/*.agent.md`): Use inline links `[text](url)` so URLs are visible + in agent context - Max 120 characters per line - Lists require blank lines (MD032) #### Linting Requirements - **markdownlint**: Style and structure compliance -- **cspell**: Spelling (add technical terms to `.cspell.json`) +- **cspell**: Spelling (add technical terms to `.cspell.yaml`) - **yamllint**: YAML file validation ### Regulatory Documentation @@ -52,12 +54,20 @@ For documents requiring regulatory compliance: - Appropriate detail level for audience - Traceability to requirements where applicable -## Defer To +## Subagent Delegation -- **Requirements Agent**: For requirements.yaml content and test linkage -- **Software Developer Agent**: For code examples and self-validation behavior -- **Test Developer Agent**: For test documentation -- **Code Quality Agent**: For running linters and fixing lint issues +If requirements.yaml content or test linkage needs updating, call the @requirements agent with the **request** +to update requirements.yaml content and test linkage and the **context** of the documentation changes. + +If code examples or self-validation behavior needs clarifying, call the @software-developer agent with the +**request** to clarify code examples and self-validation behavior and the **context** of the documentation +being written. + +If test documentation needs updating, call the @test-developer agent with the **request** to update the test +documentation and the **context** of the documentation changes. + +If linting issues need fixing, call the @code-quality agent with the **request** to run linters and fix lint +issues and the **context** of the documentation changes made. ## Don't diff --git a/.github/agents/test-developer.md b/.github/agents/test-developer.agent.md similarity index 84% rename from .github/agents/test-developer.md rename to .github/agents/test-developer.agent.md index 842a34a..3505c0f 100644 --- a/.github/agents/test-developer.md +++ b/.github/agents/test-developer.agent.md @@ -1,6 +1,7 @@ --- -name: Test Developer +name: test-developer description: Writes unit and integration tests following AAA pattern - clear documentation of what's tested and proved +tools: [read, edit, search, execute] --- # Test Developer - SarifMark @@ -132,12 +133,20 @@ Common anti-patterns to avoid (not exhaustive): // ✅ Good: Assert.StartsWith("prefix", value); ``` -## Defer To +## Subagent Delegation -- **Requirements Agent**: For test strategy and coverage requirements -- **Software Developer Agent**: For self-validation tests and production code issues -- **Technical Writer Agent**: For test documentation in markdown -- **Code Quality Agent**: For test linting and static analysis +If test strategy or coverage requirements need clarifying, call the @requirements agent with the **request** to +clarify test strategy and coverage requirements and the **context** of the tests being developed. + +If self-validation tests or production code issues arise, call the @software-developer agent with the +**request** to address the self-validation tests and production code issues and the **context** of the +test findings. + +If test documentation in markdown needs updating, call the @technical-writer agent with the **request** to +update the test documentation and the **context** of the tests developed. + +If test linting or static analysis issues need resolving, call the @code-quality agent with the **request** to +resolve the test linting and static analysis issues and the **context** of the test code changes. ## Don't diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 35bd679..d6177f8 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -46,8 +46,6 @@ Please run the following checks before submitting: - [ ] **Spell checker passes**: `cspell "**/*.{md,cs}"` - [ ] **Markdown linter passes**: `markdownlint "**/*.md"` - [ ] **YAML linter passes**: `yamllint .` -- [ ] **Self-validation passes**: - `dotnet run --project src/DemaConsulting.SarifMark --configuration Release --framework net10.0 --no-build -- --validate` ### Testing diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ffb2470..f0028f2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,6 +19,7 @@ jobs: contents: read steps: # === INSTALL DEPENDENCIES === + # This section installs all required dependencies for quality checks. # Downstream projects: Add any additional dependency installations here. - name: Checkout @@ -33,6 +34,16 @@ jobs: run: > dotnet tool restore + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: lts/* + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.14' + - name: Capture tool versions shell: bash run: | @@ -44,29 +55,20 @@ jobs: echo "✓ Tool versions captured" # === CAPTURE OTS SELF-VALIDATION RESULTS === + # This section captures self-validation results from OTS tools. + # Downstream projects: Add any additional self-validation steps here. - - name: VersionMark self-validation + - name: Run VersionMark self-validation run: > dotnet versionmark --validate --results artifacts/versionmark-self-validation-quality.trx # === RUN QUALITY CHECKS === + # This section runs all quality checks for the project. # Downstream projects: Add any additional quality checks here. - - name: Run markdown linter - uses: DavidAnson/markdownlint-cli2-action@v22 - with: - globs: '**/*.md' - - - name: Run spell checker - uses: streetsidesoftware/cspell-action@v8 - with: - files: '**/*.{md,cs}' - incremental_files_only: false - - - name: Run YAML linter - uses: ibiqlik/action-yamllint@v3 - with: - config_file: .yamllint.yaml + - name: Run linters + shell: bash + run: bash ./lint.sh # === UPLOAD ARTIFACTS === # Downstream projects: Add any additional artifact uploads here. diff --git a/.gitignore b/.gitignore index a17a432..ed69e8f 100644 --- a/.gitignore +++ b/.gitignore @@ -60,6 +60,7 @@ npm-debug.log __pycache__/ *.py[cod] *$py.class +.venv/ # Generated documentation docs/**/*.html diff --git a/.markdownlint-cli2.jsonc b/.markdownlint-cli2.jsonc deleted file mode 100644 index a46ee1a..0000000 --- a/.markdownlint-cli2.jsonc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "config": { - "default": true, - "MD003": { "style": "atx" }, - "MD007": { "indent": 2 }, - "MD013": { "line_length": 120 }, - "MD025": false, - "MD033": false, - "MD041": false - }, - "ignores": [ - "node_modules", - "**/AGENT_REPORT_*.md" - ] -} diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml new file mode 100644 index 0000000..04f1f80 --- /dev/null +++ b/.markdownlint-cli2.yaml @@ -0,0 +1,47 @@ +--- +# Markdown Linting Standards +# +# PURPOSE: +# - Maintain professional technical documentation standards +# - Ensure consistent formatting for readability and maintenance +# - Support automated documentation generation and publishing +# +# DO NOT MODIFY: These rules represent coding standards +# - If files fail linting, fix the files to meet these standards +# - Do not relax rules to accommodate existing non-compliant files +# - Consistency across repositories is critical for documentation quality + +config: + # Enable all default rules + default: true + + # Require ATX-style headers (# Header) instead of Setext-style + MD003: + style: atx + + # Set consistent indentation for nested lists + MD007: + indent: 2 + + # Allow longer lines for URLs and technical content + MD013: + line_length: 120 + + # Allow multiple top-level headers per document + MD025: false + + # Allow inline HTML for enhanced documentation + MD033: false + + # Allow documents without top-level header (for fragments) + MD041: false + +# Exclude common build artifacts, dependencies, and vendored third-party code +ignores: + - "**/.git/**" + - "**/node_modules/**" + - "**/.venv/**" + - "**/thirdparty/**" + - "**/third-party/**" + - "**/3rd-party/**" + - "**/AGENT_REPORT_*.md" diff --git a/.yamllint.yaml b/.yamllint.yaml index 7684efa..6c6c4fb 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -1,14 +1,31 @@ --- -# yamllint configuration for SarifMark -# This configuration defines the rules for YAML file linting +# YAML Linting Standards +# +# PURPOSE: +# - Maintain consistent code quality and readability standards +# - Support CI/CD workflows with reliable YAML parsing +# - Ensure professional documentation and configuration files +# +# DO NOT MODIFY: These rules represent coding standards +# - If files fail linting, fix the files to meet these standards +# - Do not relax rules to accommodate existing non-compliant files +# - Consistency across repositories is critical for maintainability extends: default +# Exclude common build artifacts, dependencies, and vendored third-party code +ignore: | + .git/ + node_modules/ + .venv/ + thirdparty/ + third-party/ + 3rd-party/ + rules: # Allow 'on:' in GitHub Actions workflows (not a boolean value) truthy: allowed-values: ['true', 'false', 'on', 'off'] - check-keys: true # Allow longer lines for URLs and complex expressions line-length: diff --git a/AGENTS.md b/AGENTS.md index 7ff927b..96e989d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,26 +4,38 @@ Project-specific guidance for agents working on SarifMark - a .NET CLI tool for ## Available Specialized Agents -- **Requirements Agent** - Develops requirements and ensures test coverage linkage -- **Technical Writer** - Creates accurate documentation following regulatory best practices -- **Software Developer** - Writes production code and self-validation tests in literate style -- **Test Developer** - Creates unit and integration tests following AAA pattern -- **Code Quality Agent** - Enforces linting, static analysis, and security standards -- **Code Review Agent** - Assists in performing formal file reviews -- **Repo Consistency Agent** - Ensures downstream repositories remain consistent with template patterns +- **requirements** agent - Develops requirements and ensures test coverage linkage +- **technical-writer** agent - Creates accurate documentation following regulatory best practices +- **software-developer** agent - Writes production code and self-validation tests in literate style +- **test-developer** agent - Creates unit and integration tests following AAA pattern +- **code-quality** agent - Enforces linting, static analysis, and security standards +- **code-review** agent - Assists in performing formal file reviews +- **repo-consistency** agent - Ensures downstream repositories remain consistent with template patterns ## Agent Selection Guide -- Fix a bug → **Software Developer** -- Add a new feature → **Requirements Agent** → **Software Developer** → **Test Developer** -- Write a test → **Test Developer** -- Fix linting or static analysis issues → **Code Quality Agent** -- Update documentation → **Technical Writer** -- Add or update requirements → **Requirements Agent** -- Ensure test coverage linkage in `requirements.yaml` → **Requirements Agent** -- Run security scanning or address CodeQL alerts → **Code Quality Agent** -- Perform a formal file review → **Code Review Agent** -- Propagate template changes → **Repo Consistency Agent** +- Fix a bug → call the @software-developer agent with the **request** to fix the bug and the **context** of the + bug details +- Add a new feature → call the @requirements agent with the **request** to define the feature requirements and the + **context** of the feature details, then call the @software-developer agent with the **request** to implement the + feature and the **context** of the requirements, then call the @test-developer agent with the **request** to add + tests and the **context** of the feature implemented +- Write a test → call the @test-developer agent with the **request** to write the test and the **context** of + what needs to be tested +- Fix linting or static analysis issues → call the @code-quality agent with the **request** to fix the issues + and the **context** of the errors encountered +- Update documentation → call the @technical-writer agent with the **request** to update the documentation and + the **context** of what needs to change +- Add or update requirements → call the @requirements agent with the **request** to add or update requirements + and the **context** of the feature details +- Ensure test coverage linkage in `requirements.yaml` → call the @requirements agent with the **request** to + ensure test coverage linkage and the **context** of the current coverage gaps +- Run security scanning or address CodeQL alerts → call the @code-quality agent with the **request** to address + security scanning or CodeQL alerts and the **context** of the alerts found +- Perform a formal file review → call the @code-review agent with the **request** to perform a formal review and + the **context** of the review-set name +- Propagate template changes → call the @repo-consistency agent with the **request** to propagate template + changes and the **context** of the downstream repository ## Tech Stack @@ -33,7 +45,17 @@ Project-specific guidance for agents working on SarifMark - a .NET CLI tool for - **`requirements.yaml`** - All requirements with test linkage (enforced via `dotnet reqstream --enforce`) - **`.editorconfig`** - Code style (file-scoped namespaces, 4-space indent, UTF-8, LF endings) -- **`.cspell.json`, `.markdownlint-cli2.jsonc`, `.yamllint.yaml`** - Linting configs +- **`.cspell.yaml`, `.markdownlint-cli2.yaml`, `.yamllint.yaml`** - Linting configs + +### Spell check word list policy + +**Never** add a word to the `.cspell.yaml` word list in order to silence a spell-checking failure. +Doing so defeats the purpose of spell-checking and reduces the quality of the repository. + +- If cspell flags a word that is **misspelled**, fix the spelling in the source file. +- If cspell flags a word that is a **genuine technical term** (tool name, project identifier, etc.) and is + spelled correctly, raise a **proposal** (e.g. comment in a pull request) explaining why the word + should be added. The proposal must be reviewed and approved before the word is added to the list. ## Requirements (SarifMark-Specific) @@ -69,11 +91,12 @@ evidence. This is critical for platform and framework requirements - **do not re - **Errors**: `ArgumentException` for parsing, `InvalidOperationException` for runtime, Write* only after success - **No code duplication**: Extract to properties/methods -## Linting (SarifMark-Specific) +## Markdown Link Style -- **README.md**: Absolute URLs only (shipped in NuGet package) -- **Other .md**: Reference-style links `[text][ref]` with `[ref]: url` at end -- **All linters must pass locally**: markdownlint, cspell, yamllint (see CI workflows for commands) +- **AI agent markdown files** (`.github/agents/*.agent.md`): Use inline links `[text](url)` so URLs are visible + in agent context +- **README.md**: Use absolute URLs (shipped in NuGet package) +- **All other markdown files**: Use reference-style links `[text][ref]` with `[ref]: url` at document end ## Build & Quality (Quick Reference) @@ -93,15 +116,15 @@ dotnet build --configuration Release && dotnet test --configuration Release Delegate tasks to specialized agents for better results: -- **requirements-agent** - Invoke for: creating/reviewing requirements in requirements.yaml, ensuring +- **requirements** - Invoke for: creating/reviewing requirements in requirements.yaml, ensuring proper test coverage linkage, determining test strategy (unit/integration/self-validation) - **technical-writer** - Invoke for: documentation updates/reviews, markdown/spell/YAML linting, regulatory documentation best practices -- **repo-consistency-agent** - Invoke for: ensuring SarifMark stays consistent with TemplateDotNetTool +- **repo-consistency** - Invoke for: ensuring SarifMark stays consistent with TemplateDotNetTool template patterns, identifying drift from template standards -- **code-quality-agent** - Invoke for: linting issues, static analysis, security scanning, quality +- **code-quality** - Invoke for: linting issues, static analysis, security scanning, quality gates enforcement, requirements traceability verification -- **code-review-agent** - Invoke for: performing formal reviews of named review-sets, producing +- **code-review** - Invoke for: performing formal reviews of named review-sets, producing review evidence for the Continuous Compliance pipeline - **software-developer** - Invoke for: production code features, self-validation tests (SarifMark_*), code refactoring, literate programming style diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b3c8ad9..e78f37f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -188,19 +188,16 @@ All markdown files must follow these rules (enforced by markdownlint): - Use reference-style links: `[text][ref]` with `[ref]: url` at document end - **Exceptions**: - `README.md` uses absolute URLs (it's included in the NuGet package) - - AI agent markdown files (`.github/agents/*.md`) use inline links `[text](url)` so URLs + - AI agent markdown files (`.github/agents/*.agent.md`) use inline links `[text](url)` so URLs are visible in agent context ### Spell Checking -All files are spell-checked using cspell. Add project-specific terms to `.cspell.json`: +All files are spell-checked using cspell. Add project-specific terms to `.cspell.yaml`: -```json -{ - "words": [ - "myterm" - ] -} +```yaml +words: + - myterm ``` ## Quality Checks diff --git a/lint.bat b/lint.bat index 21f0051..181cb47 100644 --- a/lint.bat +++ b/lint.bat @@ -6,7 +6,7 @@ call npx markdownlint-cli2 "**/*.md" if %errorlevel% neq 0 exit /b %errorlevel% echo Checking spelling... -call npx cspell "**/*.{cs,md,json,yaml,yml}" --no-progress +call npx cspell --no-progress --no-color "**/*.{cs,md,json,yaml,yml,txt,c,cpp,h,hpp}" if %errorlevel% neq 0 exit /b %errorlevel% echo Checking YAML... diff --git a/lint.sh b/lint.sh index 1a1cb82..7d8116b 100755 --- a/lint.sh +++ b/lint.sh @@ -1,18 +1,35 @@ -#!/usr/bin/env bash -# Run all linters for SarifMark +#!/bin/bash -set -e # Exit on error +# Comprehensive Linting Script +# +# PURPOSE: +# - Run ALL lint checks when executed (no options or modes) +# - Output lint failures directly for agent parsing +# - NO command-line arguments, pretty printing, or colorization +# - Agents execute this script to identify files needing fixes -echo "📝 Checking markdown..." -npx markdownlint-cli2 "**/*.md" +lint_error=0 -echo "🔤 Checking spelling..." -npx cspell "**/*.{cs,md,json,yaml,yml}" --no-progress +# Install npm dependencies +npm install -echo "📋 Checking YAML..." -yamllint -c .yamllint.yaml . +# Create Python virtual environment (for yamllint) +if [ ! -d ".venv" ]; then + python -m venv .venv +fi +source .venv/bin/activate +pip install -r pip-requirements.txt -echo "🎨 Checking code formatting..." -dotnet format --verify-no-changes +# Run spell check +npx cspell --no-progress --no-color "**/*.{md,yaml,yml,json,cs,cpp,hpp,h,txt}" || lint_error=1 -echo "✨ All linting passed!" +# Run markdownlint check +npx markdownlint-cli2 "**/*.md" || lint_error=1 + +# Run yamllint check +yamllint . || lint_error=1 + +# Run .NET formatting check (verifies no changes are needed) +dotnet format --verify-no-changes || lint_error=1 + +exit $lint_error diff --git a/pip-requirements.txt b/pip-requirements.txt new file mode 100644 index 0000000..7ce0eab --- /dev/null +++ b/pip-requirements.txt @@ -0,0 +1 @@ +yamllint==1.38.0