### Install LintLang 0.6.0 Source: https://github.com/hermes-labs-ai/lintlang/blob/main/docs/baselines.md Install the release that includes baseline support. Use this before creating or applying a baseline. ```bash python -m pip install lintlang==0.6.0 ``` -------------------------------- ### Clone and scan the bundled broken example Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Clones the LintLang repository and runs a scan on the bundled broken example, failing on any FAIL verdict. The command exits with status 1 because --fail-on fail is used. ```bash git clone --depth 1 https://github.com/hermes-labs-ai/lintlang.git cd lintlang lintlang scan samples/bad_tool_descriptions.yaml --fail-on fail ``` -------------------------------- ### Install lintlang and run first scan Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Installs lintlang 0.6.0 and creates /tmp/agent.yaml with a support agent definition, then scans it with --fail-on fail. The scan reports FAIL with 1 CRITICAL, 1 HIGH, 1 MEDIUM and exits 1; the CRITICAL is H1.1 tool:process_ticket. The exit 1 is a successful detection, not a broken install. ```bash python -m pip install lintlang==0.6.0 cat > /tmp/agent.yaml <<'YAML' system_prompt: | You are a support agent. Use the tools to help the user. tools: - name: process_ticket description: "" parameters: type: object properties: ticket_id: type: string YAML lintlang scan /tmp/agent.yaml --fail-on fail ``` -------------------------------- ### Install and scan with pip Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Install LintLang via pip and run a scan on a file. The scan is deterministic and local, making no LLM, API, telemetry, or network calls. ```bash python -m pip install lintlang lintlang scan AGENTS.md ``` -------------------------------- ### GitHub Actions workflow for linting agent instructions Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Example workflow that checks out the repository and runs the LintLang action against AGENTS.md. The release tag pins both the action and the LintLang source it installs; upgrade deliberately and inspect findings before making them blocking. ```yaml jobs: lint-agent-instructions: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Inspect agent instructions uses: hermes-labs-ai/lintlang@v0.6.0 with: path: AGENTS.md ``` -------------------------------- ### Minimal commands for lintlang Source: https://github.com/hermes-labs-ai/lintlang/blob/main/AGENTS.md Commands for installing the package, viewing help, scanning a sample file, running preflight with JSON output, running tests, linting, and building. Use these for local development and CI. ```bash pip install -e ".[dev]" ``` ```bash lintlang --help ``` ```bash lintlang scan samples/bad_tool_descriptions.yaml ``` ```bash printf '%s' 'Is it true that X?' | lintlang preflight - --format json ``` ```bash pytest -q ``` ```bash ruff check src/ tests/ ``` ```bash python -m build ``` -------------------------------- ### Example scan output Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Example output from running `lintlang scan` on a sample file with two tools that have no distinguishing terms. Shows the version, file path, and a summary of findings (1 CRITICAL, 2 HIGH, 7 MEDIUM, 3 LOW) with details for H1 issues. ```text $ lintlang scan samples/bad_tool_descriptions.yaml LINTLANG v0.6.0 samples/bad_tool_descriptions.yaml ────────────────────────────────────────────────── ❌ FAIL — 1 CRITICAL, 2 HIGH, 7 MEDIUM, 3 LOW H1: Tool Description Ambiguity !! [CRITICAL] H1.1 tool:process_ticket Tool 'process_ticket' has no description. → Add a specific, disambiguating description that explains WHEN to use this tool, not just WHAT it does. ! [HIGH] H1.2 tool:get_user_info Tool 'get_user_info' has a very short description (13 chars): "Get user info" Evidence: "Get user info" → Expand description to include: purpose, when to use vs alternatives, expected input shape, output behavior. ~ [MEDIUM] H1.6 tool:get_user_info vs tool:fetch_user_data Tools 'get_user_info' and 'fetch_user_data' carry no differentia — every meaning-bearing term in one is present, or has a synonym, in the other. Both descriptions may be accurate and still give a model nothing to choose between them. Evidence: "'Get user info' vs 'Get user data from the system'" → Name a condition that selects one over the other. State what each tool is for that the other is NOT for — e.g. 'use X for orders already placed, use Y for carts not yet submitted'. ────────────────────────────────────────────────── lintlang v0.6.0 | H1-H7 structural analysis | Zero LLM calls ``` -------------------------------- ### Install development dependencies with pip Source: https://github.com/hermes-labs-ai/lintlang/blob/main/CONTRIBUTING.md Install the package in editable mode with development dependencies for local development. ```bash pip install -e ".[dev]" ``` -------------------------------- ### Install lintlang with pipx and scan Source: https://github.com/hermes-labs-ai/lintlang/blob/main/llms-full.txt Install lintlang as an isolated persistent command via pipx, then scan AGENTS.md. If pipx's app directory is not on PATH, run 'pipx ensurepath' and open a new shell. ```bash pipx install lintlang lintlang scan AGENTS.md ``` -------------------------------- ### Install LintLang Claude Code plugin Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Install the LintLang plugin from the Claude Code marketplace without a checkout. The plugin is also indexed in the third-party Claude Market directory. ```text /plugin marketplace add hermes-labs-ai/lintlang /plugin install lintlang@lintlang ``` -------------------------------- ### Start Claude Code from the maintainer checkout Source: https://github.com/hermes-labs-ai/lintlang/blob/main/WORKSPACE.md Run from the canonical checkout directory to launch Claude Code. The checkout is at ~/github-projects/lintlang. ```bash cd ~/github-projects/lintlang claude ``` -------------------------------- ### Activate and test LintLang pre-commit hook Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Install the pre-commit hook and run LintLang on the configured paths. This verifies the hook is active and working as expected. ```bash pre-commit install pre-commit run lintlang ``` -------------------------------- ### Run lintlang scan without installing (uvx) Source: https://github.com/hermes-labs-ai/lintlang/blob/main/llms-full.txt Run a one-off scan of AGENTS.md using uvx without installing lintlang. Requires Python 3.10+ and uvx available. ```bash uvx lintlang scan AGENTS.md ``` -------------------------------- ### Install lintlang into current Python environment Source: https://github.com/hermes-labs-ai/lintlang/blob/main/llms-full.txt Install lintlang into the current Python environment using pip. Requires Python 3.10+ and the single runtime dependency pyyaml. ```bash pip install lintlang ``` -------------------------------- ### Run preflight with matched hard negative Source: https://github.com/hermes-labs-ai/lintlang/blob/main/examples/preflight/README.md Use this command to run preflight with a matched hard negative query, which is the second command in the example set. ```bash printf '%s' 'What evidence supports or refutes whether remote work always reduces productivity?' \ | lintlang preflight - ``` -------------------------------- ### Example LintLang scan output Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Shows the output of a LintLang scan on the broken example, including the summary line and details of findings. The output is from lintlang 0.6.0. ```text LINTLANG v0.6.0 FAIL — 1 CRITICAL, 2 HIGH, 7 MEDIUM, 3 LOW H1: Tool Description Ambiguity [CRITICAL] H1.1 tool:process_ticket Tool 'process_ticket' has no description. [HIGH] H1.2 tool:get_user_info Tool 'get_user_info' has a very short description (13 chars): "Get user info" … H2: Missing Constraint Scaffolding [HIGH] system_prompt System prompt defines tools but contains no termination conditions, retry budgets, or progress checks. ``` -------------------------------- ### Check Git remote, status, and worktrees Source: https://github.com/hermes-labs-ai/lintlang/blob/main/WORKSPACE.md Run these commands at the start of every development task to verify the current Git state. They show the origin URL, the short branch status, and the list of linked working trees. ```bash git remote get-url origin git status --short --branch git worktree list ``` -------------------------------- ### lintlang preflight - Source: https://github.com/hermes-labs-ai/lintlang/blob/main/examples/preflight/README.md Runs preflight without snippet inclusion, providing a redacted output. This is a matched hard negative example. ```APIDOC ## lintlang preflight - ### Description Runs preflight without snippet inclusion, providing a redacted output. This is a matched hard negative example. ### Command ```bash printf '%s' 'What evidence supports or refutes whether remote work always reduces productivity?' \ | lintlang preflight - ``` ### Parameters - `-` (stdin) - Required - Input text to preflight. ### Output Default output is redacted. ``` -------------------------------- ### lintlang CLI usage examples Source: https://github.com/hermes-labs-ai/lintlang/blob/main/llms-full.txt Common lintlang CLI commands: scanning a file or directory, JSON output, CI gates with --fail-on, severity filtering, detector selection, listing detectors, and preflight with JSON output. ```bash lintlang scan config.yaml # Scan a file lintlang scan configs/ # Scan a directory lintlang scan config.yaml --format json # JSON output lintlang scan config.yaml --fail-on fail # CI gate: fail on CRITICAL/HIGH lintlang scan config.yaml --fail-on review # CI gate: fail on MEDIUM+ lintlang scan config.yaml --min-severity high # Only show HIGH+ lintlang scan config.yaml --patterns H1 H3 # Only run specific detectors lintlang patterns # List all detectors printf '%s' 'Is it true that X?' | lintlang preflight - --format json ``` -------------------------------- ### Run LintLang in CI with pre-commit Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md In a CI pipeline, after installing pre-commit, run the configured LintLang hook across the entire repository using the --all-files flag. ```yaml - name: Lint agent instructions run: pre-commit run lintlang --all-files ``` -------------------------------- ### Configure AI_LINTLANG in .mega-linter.yml with HTTPS plugin URL Source: https://github.com/hermes-labs-ai/lintlang/blob/main/mega-linter-plugin-lintlang/README.md Add the plugin descriptor URL and enable the AI_LINTLANG linter in .mega-linter.yml. The plugin installs lintlang==0.6.0 and runs 'lintlang scan --fail-on fail' on selected files. ```yaml PLUGINS: - https://raw.githubusercontent.com/hermes-labs-ai/lintlang/main/mega-linter-plugin-lintlang/lintlang.megalinter-descriptor.yml ENABLE_LINTERS: - AI_LINTLANG ``` -------------------------------- ### Typed constraint example Source: https://github.com/hermes-labs-ai/lintlang/blob/main/docs/preflight.md Shows the object shape for a typed constraint. Only json and markdown are recognized output formats in rule bundle v1. ```json {"kind": "output_format", "value": "markdown"} ``` -------------------------------- ### GitHub Action workflow with baseline input Source: https://github.com/hermes-labs-ai/lintlang/blob/main/docs/baselines.md Use this YAML in a GitHub Actions workflow to run the Lintlang scanner with a baseline. The `baseline` input points to a committed baseline file, and `fail-on: review` fails the run on review findings. The Action installs the scanner from the same version as the Action release. ```yaml name: Lint agent instructions on: [push, pull_request] permissions: contents: read jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: hermes-labs-ai/lintlang@v0.6.0 with: path: AGENTS.md baseline: .lintlang-baseline.json fail-on: review ``` -------------------------------- ### Enable LintLang feature in devcontainer.json Source: https://github.com/hermes-labs-ai/lintlang/blob/main/devcontainer-features/src/lintlang/README.md Adds the LintLang feature to a devcontainer configuration. Installs the default LintLang version (0.6.0) in an isolated virtual environment and exposes the 'lintlang' command at /usr/local/bin/lintlang. ```json { "features": { "ghcr.io/hermes-labs-ai/lintlang/lintlang:1": {} } } ``` -------------------------------- ### Override LintLang version in devcontainer.json Source: https://github.com/hermes-labs-ai/lintlang/blob/main/devcontainer-features/src/lintlang/README.md Overrides the default LintLang version with an exact released PyPI version. The version must be an exact release; the example uses 0.6.0. ```json { "features": { "ghcr.io/hermes-labs-ai/lintlang/lintlang:1": { "version": "0.6.0" } } } ``` -------------------------------- ### lintlang scan [FILE] --fail-on [LEVEL] Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Scans a single agent configuration file for issues. The scan is offline and deterministic. Exit code 0 indicates PASS (no findings above LOW), exit code 1 indicates FAIL (findings at or above the fail-on level). Use --format json to get structured output with a verdict field. ```APIDOC ## lintlang scan [FILE] --fail-on [LEVEL] ### Description Scans a single agent configuration file for issues. The scan is offline and deterministic: it reads the file you name and nothing else, no credential, no private file, no network. The exit code indicates whether findings were detected at or above the specified fail-on level. ### Method CLI ### Endpoint `lintlang scan [FILE] --fail-on [LEVEL]` ### Parameters #### Positional Arguments - **FILE** (string) - Required - Path to the agent configuration file to scan. #### Options - **--fail-on** (string) - Required - The minimum severity level that causes a non-zero exit code. Allowed values: `fail` (or possibly other levels). - **--format** (string) - Optional - Output format. Use `json` to get structured output with a `verdict` field and a non-null `input_error` on input errors. ### Request Example ```bash lintlang scan /tmp/agent.yaml --fail-on fail ``` ### Response #### Success Response (exit 0) - **verdict** (string) - `PASS` when no findings above LOW are found. - **findings** (array) - List of findings (empty when PASS). #### Response Example (exit 0) ``` PASS — 0 findings ``` #### Error Response (exit 1) - **verdict** (string) - `FAIL` when findings at or above the fail-on level are found. - **findings** (array) - List of findings, each with severity and rule ID. #### Error Response Example (exit 1) ``` FAIL — 1 CRITICAL, 1 HIGH, 1 MEDIUM ``` #### Error Response (exit nonzero, input error) - **verdict** (string) - `ERROR` when the input cannot be scanned. - **input_error** (string) - Description of the input error (e.g., `File not found`). #### Error Response Example (input error) ``` ERROR Input error: File not found ``` ### Notes - The scan is offline and deterministic; it reads only the specified file. - Exit code 1 under `--fail-on fail` indicates successful detection, not a broken install. - `PASS` means the selected checks found nothing above LOW in the content extracted from the file; it is not evidence that the agent is safe or runtime-correct. ``` -------------------------------- ### Scan an instruction file from project root Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Run a scan from your project root. Replace AGENTS.md with your prompt, tool-definition, agent-configuration, or supported directory path. ```bash lintlang scan AGENTS.md ``` -------------------------------- ### Initialize GitHub Code Scanning workflow with lintlang init --github Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Run this command from a Git repository containing recognized agent instruction files to create the pinned GitHub Code Scanning workflow. Use --path to specify the input when auto-detection should not choose it. The initializer will not replace an existing workflow unless --force is passed. ```bash lintlang init --github ``` -------------------------------- ### lintlang preflight - --context examples/preflight/video-context.json --format json Source: https://github.com/hermes-labs-ai/lintlang/blob/main/examples/preflight/README.md Runs preflight with explicit context materialization from a JSON file and outputs in JSON format. This proves explicit context materialization without history mining or a provider call. ```APIDOC ## lintlang preflight - --context examples/preflight/video-context.json --format json ### Description Runs preflight with explicit context materialization from a JSON file and outputs in JSON format. This proves explicit context materialization without history mining or a provider call. ### Command ```bash printf '%s' 'Make a video about alligators.' \ | lintlang preflight - --context examples/preflight/video-context.json --format json ``` ### Parameters - `-` (stdin) - Required - Input text to preflight. - `--context` (file path) - Optional - Path to a JSON file containing explicit context. - `--format` (string) - Optional - Output format, e.g., `json`. ### Output Output is in JSON format. ``` -------------------------------- ### Run preflight with explicit context and JSON output Source: https://github.com/hermes-labs-ai/lintlang/blob/main/examples/preflight/README.md Use this command to run preflight with explicit context materialization using --context and output in JSON format with --format json. This proves explicit context materialization without history mining or a provider call. ```bash printf '%s' 'Make a video about alligators.' \ | lintlang preflight - --context examples/preflight/video-context.json --format json ``` -------------------------------- ### Preflight with leading truth question and patch preview Source: https://github.com/hermes-labs-ai/lintlang/blob/main/docs/preflight.md Runs `lintlang preflight` on a piped instruction that frames confirmation as the default. Returns NOTICE with a PF001 finding and a patch preview, showing the correction but noting meaning preservation is unverified. ```console $ printf '%s' 'Is it true that remote work always reduces productivity?' \ | lintlang preflight - --include-snippets NOTICE PF001 validation-seeking-frame [0:15] pf_... Risk: The wording frames confirmation as the conversational default. Correction pc_... (meaning preservation unverified) --- prompt +++ prompt @@ ... -Is it true that remote work always reduces productivity? +What evidence supports or refutes whether remote work always reduces productivity? ``` -------------------------------- ### Run preflight with snippets (hero path) Source: https://github.com/hermes-labs-ai/lintlang/blob/main/examples/preflight/README.md Use this command to run preflight with the --include-snippets flag, which reveals local evidence and correction text. The default output is redacted. ```bash printf '%s' 'Is it true that remote work always reduces productivity?' \ | lintlang preflight - --include-snippets ``` -------------------------------- ### Preflight with explicit context and JSON format Source: https://github.com/hermes-labs-ai/lintlang/blob/main/docs/preflight.md Runs `lintlang preflight` with explicit context from a JSON file and requests JSON output. Returns NOTICE with a source-hash-bound correction because the known IN_PROMPT binding is not yet materialized. ```console $ printf '%s' 'Make a video about alligators.' \ | lintlang preflight - --context examples/preflight/video-context.json --format json ``` -------------------------------- ### Create a baseline with --write-baseline Source: https://github.com/hermes-labs-ai/lintlang/blob/main/docs/baselines.md Run from the project's Git root. Replace AGENTS.md with the actual file or directory to gate. Writes a new baseline file and prints the scan report. Never overwrites an existing file, including a symlink, and writes nothing if an input fails or no input is scanned. ```bash lintlang scan AGENTS.md --write-baseline .lintlang-baseline.json ``` -------------------------------- ### lintlang preflight - --include-snippets Source: https://github.com/hermes-labs-ai/lintlang/blob/main/examples/preflight/README.md Runs preflight with snippet inclusion, revealing local evidence and correction text. This is the hero path. ```APIDOC ## lintlang preflight - --include-snippets ### Description Runs preflight with snippet inclusion, revealing local evidence and correction text. This is the hero path. ### Command ```bash printf '%s' 'Is it true that remote work always reduces productivity?' \ | lintlang preflight - --include-snippets ``` ### Parameters - `-` (stdin) - Required - Input text to preflight. - `--include-snippets` (flag) - Optional - Include local evidence and correction text in output. ### Output Default output is redacted; with `--include-snippets`, local evidence and correction text are revealed. ``` -------------------------------- ### Verify Hermes plugin discovery with hermes plugins list Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Run this command to verify that Hermes Agent discovers the LintLang plugin through its native entry-point contract. The plugin registers a bounded pre_verify hook that runs a local deterministic scan after coding turns that change recognized agent instruction surfaces. ```bash hermes plugins list ``` -------------------------------- ### Configure AI_LINTLANG with local file plugin URL Source: https://github.com/hermes-labs-ai/lintlang/blob/main/mega-linter-plugin-lintlang/README.md Use a file:// URL for the plugin descriptor when working with a local checkout of the repository. ```yaml PLUGINS: - file://mega-linter-plugin-lintlang/lintlang.megalinter-descriptor.yml ``` -------------------------------- ### Create fixed agent file and rescan Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Creates /tmp/agent-fixed.yaml with a disambiguating description for the process_ticket tool and adds constraints (max_iterations, timeout_seconds). Scanning it with --fail-on fail reports PASS with 0 findings and exits 0; the original /tmp/agent.yaml still fails. ```bash cat > /tmp/agent-fixed.yaml <<'YAML' system_prompt: | You are a support agent. Use the tools to help the user. Stop and report the failure once the retry limit is reached. tools: - name: process_ticket description: "Apply a resolution action to one existing support ticket. Use this only after the ticket has been read; do NOT use it to look tickets up." parameters: type: object properties: ticket_id: type: string description: "Identifier of the existing ticket to act on" required: [ticket_id] constraints: max_iterations: 3 timeout_seconds: 30 YAML lintlang scan /tmp/agent-fixed.yaml --fail-on fail ``` -------------------------------- ### Create scratch workspace .mega-linter.yml for container test Source: https://github.com/hermes-labs-ai/lintlang/blob/main/mega-linter-plugin-lintlang/README.md Create a .mega-linter.yml file in a scratch workspace to test the plugin inside a real MegaLinter container. It includes the plugin descriptor, enables AI_LINTLANG, and sets validation options. ```yaml # .mega-linter.yml PLUGINS: - file://mega-linter-plugin-lintlang/lintlang.megalinter-descriptor.yml ENABLE_LINTERS: - AI_LINTLANG VALIDATE_ALL_CODEBASE: true LOG_LEVEL: INFO ``` -------------------------------- ### Scan with SARIF output to file Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Runs LintLang scan on AGENTS.md, outputting deterministic SARIF 2.1.0 to stdout and redirecting it to lintlang.sarif. Fails on 'fail' severity findings. ```bash lintlang scan AGENTS.md --format sarif --fail-on fail > lintlang.sarif ``` -------------------------------- ### Context JSON structure for bindings and constraints Source: https://github.com/hermes-labs-ai/lintlang/blob/main/docs/preflight.md Shows the expected shape for requirements, bindings, and constraints in context. Values can be delivered via SIDE_CHANNEL (host-managed) or IN_PROMPT (must appear in outgoing instruction). ```json { "requirements": [ { "key": "video_format", "required": true, "description": "The user-approved house video format" } ], "bindings": [ { "key": "video_format", "value": "16:9, 20 seconds, title card then three scenes", "source": "user", "delivery": "IN_PROMPT" } ], "constraints": [] } ``` -------------------------------- ### Run MegaLinter container with docker run Source: https://github.com/hermes-labs-ai/lintlang/blob/main/mega-linter-plugin-lintlang/README.md Run the plugin inside a real MegaLinter container using docker run. Mounts the current directory as /tmp/lint and sets the workspace. ```console docker run --rm --platform linux/amd64 \ -v "$PWD:/tmp/lint:rw" -e DEFAULT_WORKSPACE=/tmp/lint \ oxsecurity/megalinter:v8 ``` -------------------------------- ### Create and review a candidate baseline Source: https://github.com/hermes-labs-ai/lintlang/blob/main/docs/baselines.md Run lintlang scan to write a candidate baseline, compare it with the committed baseline using git diff --no-index, and after review, replace the committed baseline. git diff --no-index exits 1 when files differ, which is expected. Never refresh a baseline automatically after a failed gate. ```bash lintlang scan AGENTS.md --write-baseline .lintlang-baseline.candidate.json git diff --no-index .lintlang-baseline.json .lintlang-baseline.candidate.json # After review: mv .lintlang-baseline.candidate.json .lintlang-baseline.json ``` -------------------------------- ### Preflight with neutral control Source: https://github.com/hermes-labs-ai/lintlang/blob/main/docs/preflight.md Runs `lintlang preflight` on a neutral control question that avoids the leading truth frame. Returns ALLOW, indicating required coverage completed and no listed risk detected. ```console $ printf '%s' 'What evidence supports or refutes whether remote work always reduces productivity?' \ | lintlang preflight - ALLOW ``` -------------------------------- ### Run the full test suite with pytest Source: https://github.com/hermes-labs-ai/lintlang/blob/main/CONTRIBUTING.md Run the complete test suite before submitting a pull request to ensure all tests pass. ```bash pytest ``` -------------------------------- ### Apply baseline with --fail-on review Source: https://github.com/hermes-labs-ai/lintlang/blob/main/docs/baselines.md Enable the gate after reviewing the baseline. Blocks remaining MEDIUM, HIGH, or CRITICAL findings. An unchanged scan with all findings acknowledged passes. Missing, malformed, or unsupported baselines and source input errors return a nonzero exit even without a severity gate. ```bash lintlang scan AGENTS.md --baseline .lintlang-baseline.json --fail-on review ``` -------------------------------- ### Baseline workflow: write baseline and fail on new MEDIUM+ findings Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Two-step baseline workflow: first review the full report and write a baseline, then use that baseline to keep known findings acknowledged while blocking new MEDIUM+ findings. Baseline matching is exact and count-limited; changed findings and findings in another file remain visible. Invalid inputs still fail; HERM scores are unchanged. ```bash # Review the full report before committing the generated baseline. lintlang scan AGENTS.md --write-baseline .lintlang-baseline.json ``` ```bash # Keep the known backlog acknowledged while blocking new MEDIUM+ findings. lintlang scan AGENTS.md --baseline .lintlang-baseline.json --fail-on review ``` -------------------------------- ### Run local plugin tests with pytest Source: https://github.com/hermes-labs-ai/lintlang/blob/main/mega-linter-plugin-lintlang/README.md Run the plugin's test suite from the LintLang repository root. The test validates the descriptor contract and exercises the CLI in-process. ```console python -m pytest -q tests/test_megalinter_plugin.py ``` -------------------------------- ### Preflight text with provider-neutral request Source: https://github.com/hermes-labs-ai/lintlang/blob/main/llms-full.txt Performs a preflight check on a text prompt using a provider-neutral request. Prints the status (e.g., NOTICE) and the raw JSON output with prompt/context/patch text redacted by default. ```python from lintlang import PreflightRequest, preflight_text result = preflight_text(PreflightRequest(prompt="Is it true that X?")) print(result.status.value) # NOTICE print(result.to_json()) # raw prompt/context/patch text redacted by default ``` -------------------------------- ### Add LintLang hook to .pre-commit-config.yaml Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Configure the LintLang pre-commit hook with explicit instruction paths to scan. The hook scans only the configured paths and reports findings without blocking on a verdict by default. ```yaml repos: - repo: https://github.com/hermes-labs-ai/lintlang rev: v0.6.0 hooks: - id: lintlang args: [AGENTS.md] ``` -------------------------------- ### Upgrade lintlang to latest release Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Upgrades lintlang to the latest release. The counts in the page are approximate after upgrading; a newer release may report different findings. ```bash python -m pip install --upgrade lintlang ``` -------------------------------- ### Scan with JSON output Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Runs LintLang scan on AGENTS.md, outputting JSON to stdout and failing on any 'fail' severity findings. ```bash lintlang scan AGENTS.md --format json --fail-on fail ``` -------------------------------- ### GitHub Actions workflow for LintLang Code Scanning Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Complete workflow with scan and upload jobs. The scan job runs LintLang, uploads the SARIF artifact, and preserves it even on failure. The upload job downloads the artifact and uploads it to GitHub Code Scanning with the required permissions. ```yaml name: LintLang Code Scanning on: push: pull_request: jobs: scan: runs-on: ubuntu-latest permissions: contents: read steps: - name: Check out repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Run LintLang uses: hermes-labs-ai/lintlang@f89c3b0b8986fad162859dca052a8d5fe227eede # v0.5.3 with: path: AGENTS.md fail-on: fail sarif-file: lintlang.sarif - name: Preserve LintLang SARIF if: always() uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: lintlang-sarif path: lintlang.sarif if-no-files-error: error upload-sarif: needs: scan if: always() && (github.event_name == 'push' || (github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository)) runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write steps: - name: Check out repository for SARIF fingerprinting uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Download LintLang SARIF uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: lintlang-sarif - name: Upload LintLang SARIF uses: github/codeql-action/upload-sarif@5595ccaf912efad79be6eef63a5619ff05969be3 # v4 with: sarif_file: lintlang.sarif ``` -------------------------------- ### Opt into blocking FAIL findings Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Configure the LintLang hook to fail on FAIL findings by adding the --fail-on fail argument. Missing, unreadable, or malformed configured inputs still return nonzero. ```yaml hooks: - id: lintlang args: [AGENTS.md, --fail-on, fail] ``` -------------------------------- ### Run LintLang scan command Source: https://github.com/hermes-labs-ai/lintlang/blob/main/devcontainer-features/src/lintlang/README.md Runs a LintLang scan on AGENTS.md with the --fail-on fail option. A FAIL scan is an expected analyzer result; missing or malformed input remains an error. ```bash lintlang scan AGENTS.md --fail-on fail ``` -------------------------------- ### preflight_text Source: https://github.com/hermes-labs-ai/lintlang/blob/main/llms-full.txt Performs a provider-neutral preflight check on a prompt. ```APIDOC ## preflight_text ### Description Performs a provider-neutral preflight check on a prompt, returning a status and raw prompt/context/patch text redacted by default. ### Method Function call ### Endpoint `preflight_text(request)` ### Parameters - **request** (PreflightRequest) - Required - Object containing the prompt to check. ### Returns - **result** (object) - Contains `status` (one of `ALLOW`, `NOTICE`, `HOLD`, `UNAVAILABLE`, `ERROR`) and `to_json()` method. ### Example ```python from lintlang import PreflightRequest, preflight_text result = preflight_text(PreflightRequest(prompt="Is it true that X?")) print(result.status.value) print(result.to_json()) ``` ``` -------------------------------- ### Broaden AI_LINTLANG file scope with AI_LINTLANG_FILE_EXTENSIONS Source: https://github.com/hermes-labs-ai/lintlang/blob/main/mega-linter-plugin-lintlang/README.md Override the default file selection by specifying additional file extensions for the AI_LINTLANG linter. This is a normal MegaLinter per-linter override. ```yaml AI_LINTLANG_FILE_EXTENSIONS: - .yaml - .yml - .json ``` -------------------------------- ### Scan file and compute verdict Source: https://github.com/hermes-labs-ai/lintlang/blob/main/llms-full.txt Scans a YAML file and computes a verdict. The verdict can be ERROR, PASS, REVIEW, or FAIL. Iterates over structural findings to print severity, pattern, description, and suggestion. ```python from lintlang import scan_file, scan_directory, compute_verdict result = scan_file("config.yaml") verdict = compute_verdict(result) # ERROR, PASS, REVIEW, or FAIL for finding in result.structural_findings: print(f"[{finding.severity.value}] {finding.pattern}: {finding.description}") print(f" -> {finding.suggestion}") ``` -------------------------------- ### Scan a non-existent file Source: https://github.com/hermes-labs-ai/lintlang/blob/main/README.md Scans a file that does not exist with --fail-on fail. The command prints the verdict ERROR with 'Input error: File not found' and exits nonzero; --format json carries the same distinction as verdict plus a non-null input_error. ```bash lintlang scan /tmp/does-not-exist.yaml --fail-on fail ``` -------------------------------- ### scan_file Source: https://github.com/hermes-labs-ai/lintlang/blob/main/llms-full.txt Scans a single file for structural findings. ```APIDOC ## scan_file ### Description Scans a single file for structural findings and returns a result object containing findings and a verdict. ### Method Function call ### Endpoint `scan_file(path)` ### Parameters - **path** (string) - Required - Path to the file to scan. ### Returns - **result** (object) - Contains `structural_findings` list and other result data. ### Example ```python from lintlang import scan_file result = scan_file("config.yaml") ``` ``` -------------------------------- ### scan_directory Source: https://github.com/hermes-labs-ai/lintlang/blob/main/llms-full.txt Scans a directory for structural findings. ```APIDOC ## scan_directory ### Description Scans a directory for structural findings and returns a result object containing findings and a verdict. ### Method Function call ### Endpoint `scan_directory(path)` ### Parameters - **path** (string) - Required - Path to the directory to scan. ### Returns - **result** (object) - Contains `structural_findings` list and other result data. ### Example ```python from lintlang import scan_directory result = scan_directory("config") ``` ``` -------------------------------- ### compute_verdict Source: https://github.com/hermes-labs-ai/lintlang/blob/main/llms-full.txt Computes a verdict based on scan results. ```APIDOC ## compute_verdict ### Description Computes a verdict (ERROR, PASS, REVIEW, or FAIL) based on the findings in a scan result. ### Method Function call ### Endpoint `compute_verdict(result)` ### Parameters - **result** (object) - Required - The result object from `scan_file` or `scan_directory`. ### Returns - **verdict** (string) - One of `ERROR`, `PASS`, `REVIEW`, or `FAIL`. ### Example ```python from lintlang import compute_verdict verdict = compute_verdict(result) ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.