### Development setup commands Source: https://github.com/0xmariowu/agentlint/blob/main/templates/configs/CONTRIBUTING.md Clone the repository, navigate into it, and run the scanner test script. No npm install is needed because there are no dependencies. Requires bash, jq, and node 20+. ```bash git clone https://github.com/__OWNER__/__PROJECT_NAME__.git cd __PROJECT_NAME__ # No npm install needed — no dependencies bash tests/test-scanner.sh # verify scanner works ``` -------------------------------- ### Development setup Source: https://github.com/0xmariowu/agentlint/blob/main/docs/content/contributing.md Clone the repository and verify the scanner works. No npm install is needed because there are no dependencies. ```bash git clone https://github.com/0xmariowu/AgentLint.git cd agent-lint # No npm install needed — no dependencies bash tests/test-scanner.sh # verify scanner works ``` -------------------------------- ### Run AgentLint checks, fix, and setup Source: https://github.com/0xmariowu/agentlint/blob/main/INSTALL.md Scan the current repo with agentlint check, fix a specific check by ID, or bootstrap CI/hooks/templates with agentlint setup. The setup command uses --ignore-scripts by default; use --with-scripts to also run dependency lifecycle hooks. ```bash agentlint check # scan current repo agentlint fix W11 # fix a specific check by ID agentlint setup --lang ts . # bootstrap CI / hooks / templates for a project (uses --ignore-scripts by default) # agentlint setup --lang ts --with-scripts . # opt-in: also run dependency lifecycle hooks ``` -------------------------------- ### AgentLint CLI commands: check, fix, setup Source: https://github.com/0xmariowu/agentlint/blob/main/docs/content/intro.md Shows the three main CLI commands: check for diagnosis, fix to apply a specific fix (e.g., W11), and setup to bootstrap CI/hooks/templates. The setup command installs 12 CI workflows, git hooks, a CLAUDE.md template, plan format, and compliance tests. ```bash agentlint check # diagnose (51 core checks, 6 dimensions) agentlint fix W11 # fix a specific check directly agentlint setup --lang ts . # bootstrap CI/hooks/templates ``` -------------------------------- ### AgentLint CLI output example Source: https://github.com/0xmariowu/agentlint/blob/main/docs/content/intro.md Shows the terminal output when running the AgentLint command `/al`. Displays the overall score, dimension breakdowns, and a fix plan with guided and assisted items. The output includes a note that the HTML report is saved after fixes are applied. ```text $ /al AgentLint — Score: 72/100 (core) Findability ██████████████░░░░░░ 7/10 Instructions ████████████████░░░░ 8/10 Workability ████████████░░░░░░░░ 6/10 Safety ██████████░░░░░░░░░░ 5/10 Continuity ██████████████░░░░░░ 7/10 Harness ██████████████████░░ 9/10 Deep ░░░░░░░░░░░░░░░░░░░░ n/a (opt-in) Session ░░░░░░░░░░░░░░░░░░░░ n/a (opt-in) Fix Plan (7 items): [guided] Pin 8 GitHub Actions to SHA (supply chain risk) [guided] Add .env to .gitignore (AI exposes secrets) [assisted] Generate HANDOFF.md [guided] Reduce IMPORTANT keywords (7 found, Anthropic uses 4) Select items → AgentLint fixes → re-scores → saves HTML report ``` -------------------------------- ### Verify AgentLint installation Source: https://github.com/0xmariowu/agentlint/blob/main/INSTALL.md Check the installed version and view help for the agentlint CLI. ```bash agentlint --version agentlint help ``` -------------------------------- ### Setup output claiming hooks activated Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md The misleading output from setup that claims hooks are activated even though no hook files exist. ```text hooks activated via core.hooksPath (--no-install; run 'npm install' to complete setup) pre-commit hook (author whitelist + PII scan + secrets + codenames + lint) pre-push hook (rebase + test) commit-msg hook (conventional commit format) direct git commit is blocked by the installed pre-commit hook ``` -------------------------------- ### Migration commands from @0xmariowu/agent-lint to agentlint-ai Source: https://github.com/0xmariowu/agentlint/blob/main/CHANGELOG.md Commands to uninstall the old scoped package and install the new unscoped agentlint-ai package. The comment lines are part of the original example. ```bash npm uninstall -g @0xmariowu/agent-lint # remove old npm install -g agentlint-ai # install new (unscoped) # or: npx agentlint-ai init ``` -------------------------------- ### Bootstrap a project with agentlint setup Source: https://github.com/0xmariowu/agentlint/blob/main/CHANGELOG.md Bootstrap any repo with a full AI-native development stack. The `--lang` flag specifies the language, and `--visibility` sets the repository visibility (e.g., public). ```bash agentlint setup --lang python ~/Projects/my-repo ``` ```bash agentlint setup --lang ts --visibility public ~/Projects/my-repo ``` -------------------------------- ### Acceptance test: agentlint setup fails and preserves core.hooksPath Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Verifies that agentlint setup --no-install exits non-zero and leaves core.hooksPath unchanged when a custom hooksPath is already set. ```bash tmp=$(mktemp -d) && cd "$tmp" && git init -q && git config core.hooksPath .custom-hooks agentlint setup --lang ts --no-install "$tmp" test $? -ne 0 && [ "$(git config core.hooksPath)" = ".custom-hooks" ] ``` -------------------------------- ### Inspect setup.sh lines 620-645 and list template hook files Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Commands to inspect the setup script and verify the template hook files that exist. The output shows only committer, commit-msg, _shared-push.sh, and _shared.sh under templates/hooks, with no templates/hooks/husky/ directory. ```bash nl -ba scripts/setup.sh | sed -n '620,645p' find templates/hooks -maxdepth 3 -type f -print ``` -------------------------------- ### Good rule organization example: intent-first Source: https://github.com/0xmariowu/agentlint/blob/main/templates/configs/rules-style.md Another example of a decision-frame rule, starting from intent and then applying constraints. ```text Start from intent (what must stay unchanged), then apply specific constraints (who, when, where). ``` -------------------------------- ### Bootstrap a TypeScript project (public repo) Source: https://github.com/0xmariowu/agentlint/blob/main/commands/setup.md Initializes a TypeScript project with public visibility, enabling additional workflows and configurations. ```bash agentlint setup --lang ts --visibility public ~/Projects/my-repo ``` -------------------------------- ### Install AgentLint CLI and Claude Code plugin Source: https://github.com/0xmariowu/agentlint/blob/main/README.md Install the agentlint CLI globally and optionally register the /al Claude Code plugin. The first command does not touch ~/.claude/; the second is opt-in and copies the /al command into ~/.claude/commands/. ```bash npm install -g agentlint-ai # CLI only — no Claude plugin yet npx agentlint-ai install # opt-in: register /al Claude Code plugin ``` -------------------------------- ### Bootstrap a Python project Source: https://github.com/0xmariowu/agentlint/blob/main/commands/setup.md Initializes a Python project with the full AI-native development stack. The target directory must be a git repository unless --init-git is explicitly provided. ```bash agentlint setup --lang python ~/Projects/my-repo ``` -------------------------------- ### Actual template files under templates/hooks Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md The actual hook template files present in the repository. There is no templates/hooks/husky/ directory, which is why the setup loop copies nothing. ```text templates/hooks/committer templates/hooks/commit-msg templates/hooks/_shared-push.sh templates/hooks/_shared.sh ``` -------------------------------- ### Add only workflows to existing project Source: https://github.com/0xmariowu/agentlint/blob/main/commands/setup.md Adds only the CI workflows to an existing project without installing hooks or templates. ```bash agentlint setup --lang python --workflows-only ~/Projects/my-repo ``` -------------------------------- ### Reproduce empty .husky with agentlint setup Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Reproduction commands that create a temporary repo, run scripts/setup.sh with --lang ts --visibility public --no-install, then check core.hooksPath and list .husky contents. Observed output shows exit=0 and only .husky with no hook files. ```bash tmp=$(mktemp -d) mkdir -p "$tmp/proj" git -C "$tmp/proj" init --initial-branch=main >/dev/null 2>&1 || git -C "$tmp/proj" init >/dev/null bash scripts/setup.sh --lang ts --visibility public --no-install "$tmp/proj" git -C "$tmp/proj" config core.hooksPath find "$tmp/proj/.husky" -maxdepth 2 -type f -print 2>/dev/null | sort ``` -------------------------------- ### Reproduction script for install verification failure Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Reproduces the install verification failure against a locally packed tarball. Packs the package, installs it globally with --ignore-scripts into a temporary prefix, then runs 'agentlint check --help'. Observed output: exit=1 and 'agentlint: scanner produced no output'. ```bash tmp=$(mktemp -d) npm pack --pack-destination "$tmp" >/tmp/al-help-pack-name.txt npm install -g --ignore-scripts "$tmp/$(cat /tmp/al-help-pack-name.txt)" --prefix "$tmp/prefix" --cache "$tmp/cache" PATH="$tmp/prefix/bin:$PATH" agentlint check --help ``` -------------------------------- ### Setup script hook copy loop Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md The loop in scripts/setup.sh that copies hook templates from $TEMPLATE_DIR/hooks/husky/ into $PROJECT/.husky/. Because the source directory does not exist, the loop copies nothing, leaving .husky empty. ```bash for hook in "$TEMPLATE_DIR/hooks/husky/"*; do [ -f "$hook" ] || continue hook_name="$(basename "$hook")" copy_template "$hook" "$PROJECT/.husky/$hook_name" ".husky/$hook_name" chmod +x "$PROJECT/.husky/$hook_name" done ``` -------------------------------- ### Canonical install verification commands from INSTALL.md Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Commands documented in INSTALL.md for verifying the agentlint installation. The first command checks the version; the second displays help for the check subcommand. The second command fails with exit=1 and 'agentlint: scanner produced no output' when run against a locally packed tarball. ```bash agentlint --version agentlint check --help ``` -------------------------------- ### AgentLint /al command output example Source: https://github.com/0xmariowu/agentlint/blob/main/README.md Example output from running /al in Claude Code, showing the score breakdown and fix plan. The output includes a score of 72/100, category ratings, and a list of fix items. ```text $ /al AgentLint — Score: 72/100 (core) Findability ██████████████░░░░░░ 7/10 Instructions ████████████████░░░░ 8/10 Workability ████████████░░░░░░░░ 6/10 Safety ██████████░░░░░░░░░░ 5/10 Continuity ██████████████░░░░░░ 7/10 Harness ████████████████████ 10/10 Deep ░░░░░░░░░░░░░░░░░░░░ n/a (opt-in) Session ░░░░░░░░░░░░░░░░░░░░ n/a (opt-in) Fix Plan (7 items): [guided] Pin 8 GitHub Actions to SHA (supply chain risk) [guided] Add .env to .gitignore (AI exposes secrets) [assisted] Generate HANDOFF.md [guided] Reduce IMPORTANT keywords (7 found, Anthropic uses 4) Select items → AgentLint fixes → re-scores → saves HTML report ``` -------------------------------- ### Show delta output example Source: https://github.com/0xmariowu/agentlint/blob/main/commands/al.md Example output showing the score delta and report path. The report is saved to the plugin data directory with a date-based filename. ```text 🏥 Score: 78 → 82/100 (+4) Findability: 8 → 9 (+1) Instructions: 9 → 9 (=) Workability: 6 → 6 (=) Continuity: 7 → 8 (+1) 📄 Report saved to ${CLAUDE_PLUGIN_DATA}/reports/2026-04-03.json ``` -------------------------------- ### Generated-Project Smoke Test Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Smoke test for `agentlint setup` with `--no-install`. Verifies hook files are created and executable. ```bash tmp=$(mktemp -d) mkdir -p "$tmp/proj" git -C "$tmp/proj" init --initial-branch=main agentlint setup --lang ts --visibility public --no-install "$tmp/proj" test -x "$tmp/proj/.husky/pre-commit" test -x "$tmp/proj/.husky/pre-push" test -x "$tmp/proj/.husky/commit-msg" ``` -------------------------------- ### Example fixer.js output Source: https://github.com/0xmariowu/agentlint/blob/main/commands/al.md Sample output from fixer.js showing cleaned references, generated CLAUDE.md, and manual items that require user action. ```text ✓ 3 projects: cleaned 12 broken references ✓ cli-tool: generated CLAUDE.md from template ℹ 2 projects: add test files (manual — see details below) ℹ 2 projects: add linter config (manual — see details below) Manual items: - my-api: no tests/ directory. Run: mkdir tests && touch tests/test_smoke.py - new-project: no tests/ directory (no code yet — skip for now) ``` -------------------------------- ### Good error message example from .husky/pre-push Source: https://github.com/0xmariowu/agentlint/blob/main/docs/internal/rules-style.md Example of a well-formed error message from this repo's .husky/pre-push hook. Includes all four parts: error, Rule, Fix, and See. ```text error: rebase on origin/main failed Rule: feature branches must be up-to-date with main before push Fix: resolve conflicts, then 'git rebase --continue' and retry push See: CLAUDE.md — Workflow section ``` -------------------------------- ### Enable SARIF upload for AgentLint Source: https://github.com/0xmariowu/agentlint/blob/main/docs/content/intro.md Adds security-events write permission and sets sarif-upload to 'true' to get findings in the Security tab and inline PR annotations. Requires Code scanning enabled (free for public repos, GHAS for private). Inline PR annotations via ::warning commands work on all repos. ```yaml permissions: contents: read security-events: write # required for SARIF upload steps: - uses: actions/checkout@v4 - uses: 0xmariowu/AgentLint@v1 with: sarif-upload: 'true' ``` -------------------------------- ### Reproduce: agentlint setup --no-install overwrites core.hooksPath Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Sets up a temporary git repo with a custom hook and core.hooksPath, then runs agentlint setup --no-install to show the silent overwrite. The output shows core.hooksPath changes from .custom-hooks to .husky. ```bash tmp=$(mktemp -d) cd "$tmp" git init -q mkdir -p .custom-hooks cat > .custom-hooks/pre-commit <<'EOF' #!/bin/bash echo "ORG-LEVEL SECURITY HOOK" >&2 exit 0 EOF chmod +x .custom-hooks/pre-commit git config core.hooksPath .custom-hooks echo "before: $(git config core.hooksPath)" agentlint setup --lang ts --no-install "$tmp" echo "after: $(git config core.hooksPath)" ``` ```text before: .custom-hooks after: .husky ``` -------------------------------- ### Current INSTALL.md Action snippet (missing checkout) Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md The canonical install snippet in INSTALL.md omits actions/checkout, causing first-use failures. Users copying it will fail immediately with fail-below: 80 or scan an empty workspace. ```yaml - uses: 0xmariowu/AgentLint@v1 with: fail-below: 80 ``` -------------------------------- ### Bad rule organization example: scanner-like list Source: https://github.com/0xmariowu/agentlint/blob/main/templates/configs/rules-style.md Shows a bad example of rule organization that causes model fatigue. ```text 15 rules with no shared ordering ``` -------------------------------- ### Bad error message example Source: https://github.com/0xmariowu/agentlint/blob/main/docs/internal/rules-style.md Example of an insufficient error message that lacks the required context. Leaves the reader without guidance on what went wrong or what to do next. ```text error: commit blocked ``` -------------------------------- ### Install Smoke Test Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Smoke test for npm install and CLI commands. Uses a temporary prefix and ignores scripts. ```bash tmp=$(mktemp -d) npm pack --pack-destination "$tmp" npm install -g "$tmp"/agentlint-ai-*.tgz --prefix "$tmp/prefix" --ignore-scripts PATH="$tmp/prefix/bin:$PATH" agentlint --version PATH="$tmp/prefix/bin:$PATH" agentlint check --help PATH="$tmp/prefix/bin:$PATH" agentlint check --project-dir --fail-below 0 printf 'score\n' | node src/reporter.js ``` -------------------------------- ### Create .github/workflows/agentlint.yml Source: https://github.com/0xmariowu/agentlint/blob/main/docs/content/intro.md Sets up the AgentLint GitHub Action to run on pull requests and pushes to main. Uses default local-only core scan and does not fail the build on score thresholds. Add 'fail-below' after the first passing run for a hard quality gate. ```yaml name: AgentLint on: pull_request: push: branches: [main] permissions: contents: read jobs: agentlint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: 0xmariowu/AgentLint@v1 ``` -------------------------------- ### Good step: Add strict-mode flag to parser Source: https://github.com/0xmariowu/agentlint/blob/main/docs/internal/rules-style.md Example of a well-formed plan step with atomic action, mechanical verify, and rollback. Used for multi-step work (3+ sequential actions or 2+ files changing in lockstep). The verify command runs a specific test suite and checks for a new test case. ```markdown ### 3. Add strict-mode flag to parser - Action: Edit src/parser/config.ts to accept `strict: boolean`, default false. - Verify: `npm test -- parser/config` passes 4 tests including new "strict flag accepted" case. - Rollback: git restore src/parser/config.ts tests/parser/config.test.ts ``` -------------------------------- ### Required test assertions for hook installation Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Tests that should assert the hook files exist and are executable, and that core.hooksPath is set. ```bash agentlint setup --lang ts --no-install test -x /.husky/pre-commit test -x /.husky/pre-push test -x /.husky/commit-msg git -C config core.hooksPath ``` -------------------------------- ### Good rule organization example: decision frame Source: https://github.com/0xmariowu/agentlint/blob/main/templates/configs/rules-style.md Shows how to phrase a rule as a decision frame, focusing on impact and intent rather than a checklist. ```text Evaluate action by impact (shared state, reversibility, validation needs), then choose one rule group. ``` -------------------------------- ### GitHub Action workflow for AgentLint Source: https://github.com/0xmariowu/agentlint/blob/main/INSTALL.md Copy-paste workflow that runs AgentLint on pull requests and pushes to main. Requires actions/checkout@v4; without it, AgentLint scans an empty workspace. @v1 is a moving tag; pin to a specific release for reproducibility. ```yaml name: AgentLint on: pull_request: push: branches: [main] permissions: contents: read jobs: agentlint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: 0xmariowu/AgentLint@v1 ``` -------------------------------- ### Update AgentLint globally via npm Source: https://github.com/0xmariowu/agentlint/blob/main/README.md Install or update the agentlint CLI globally using npm. This is the standard update method for the command-line tool. ```bash npm install -g agentlint-ai ``` -------------------------------- ### Fix plan summary output Source: https://github.com/0xmariowu/agentlint/blob/main/commands/al.md Example output of the fix plan summary. Shows grouped items by severity with fix type, check name, and project list. Use the merged items from plan.grouped.{severity}.items and list all project names from the projects array. ```text 📋 Fix Plan — 12 items 🔴 High (8 items): [auto] All references resolve — 3 projects (my-api, web-app, cli-tool) [assisted] Missing HANDOFF — my-api, web-app [guided] Missing tests — my-api, cli-tool [guided] Missing linter config — my-api, web-app [guided] No build/test commands in entry file — cli-tool 🟡 Medium (2 items): [guided] Rule specificity < 50% — web-app [guided] Entry file too short — cli-tool ⚪ Low (2 items): [guided] Entry file length — my-api [guided] Keyword density — web-app ``` -------------------------------- ### Reproduce failure with npm pack and fake readlink Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Reproduces the failure by packing the tarball, installing globally with a temporary prefix, and running the CLI with a fake readlink that rejects -f. The observed error is 'exit=1' and 'cd: ../lib/node_modules/agentlint-ai/scripts: No such file or directory'. ```bash tmp=$(mktemp -d) npm pack --pack-destination "$tmp" >/tmp/al-readlink-pack-name.txt npm install -g --ignore-scripts "$tmp/$(cat /tmp/al-readlink-pack-name.txt)" --prefix "$tmp/prefix" --cache "$tmp/cache" mkdir "$tmp/fakebin" cat > "$tmp/fakebin/readlink" <<'SH' #!/usr/bin/env bash if [ "${1:-}" = "-f" ]; then exit 1 fi /usr/bin/readlink "$@" SH chmod +x "$tmp/fakebin/readlink" cd /tmp PATH="$tmp/fakebin:/usr/bin:/bin:/usr/sbin:/sbin" "$tmp/prefix/bin/agentlint" --version ``` -------------------------------- ### Portable symlink resolver algorithm Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Example algorithm for a portable symlink resolver that resolves symlink chains, joins relative targets with dirname, and avoids relying on GNU-only readlink -f. This is the required fix for both entry scripts. ```bash resolve_self() { local source="$1" while [ -L "$source" ]; do local dir dir="$(CDPATH='' cd -- "$(dirname -- "$source")" && pwd)" local target target="$(readlink "$source")" case "$target" in /*) source="$target" ;; *) source="$dir/$target" ;; esac done CDPATH='' cd -- "$(dirname -- "$source")" && pwd } ``` -------------------------------- ### AskUserQuestion options for fix selection Source: https://github.com/0xmariowu/agentlint/blob/main/commands/al.md Example of the question presented to the user after printing the fix plan. Offers options to fix high priority only, high + medium, all items, or skip fixes and just show the report. ```text Which items to fix? 1. High priority only (Recommended) — {high_count} items 2. High + Medium — {high_count + med_count} items 3. All {total} items 4. Skip fixes, just show report ``` -------------------------------- ### Commands to test the fix Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Commands to run after installing the tarball into a temporary prefix with a fake readlink that rejects -f. All three commands must pass without readlink -f. ```bash agentlint --version agentlint check --project-dir --fail-below 0 al-scan --project-dir ``` -------------------------------- ### Verify F7: Find @ directives Source: https://github.com/0xmariowu/agentlint/blob/main/tests/accuracy/check-spec.md Searches entry file for lines starting with '@' followed by a path. Used to verify F7. ```bash grep '^@' CLAUDE.md ``` -------------------------------- ### Observed error output from failing CLI Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md The exact error output observed when the CLI fails on a system without readlink -f. The CLI entry point fails completely, preventing users from accessing the tool after global npm install. ```text cd: ../lib/node_modules/agentlint-ai/scripts: No such file or directory ``` -------------------------------- ### AgentLint score presentation output Source: https://github.com/0xmariowu/agentlint/blob/main/commands/al.md Example output of the score presentation. The (core) suffix appears when Deep/Session did not run, indicating the score is averaged over the 6 core dimensions only. Extended dimensions that didn't run show as n/a, not 0/10. ```text 🏥 AgentLint — Score: 89/100 (core) Findability ████████████████░░░░ 8/10 Instructions ██████████████████░░ 9/10 Workability ████████████░░░░░░░░ 6/10 Continuity ██████████████░░░░░░ 7/10 Safety ██████████████████░░ 9/10 Harness ████████████████████ 10/10 Deep ░░░░░░░░░░░░░░░░░░░░ n/a Session ░░░░░░░░░░░░░░░░░░░░ n/a By Project: my-api 9 ██████████████████░░ web-app 8 ████████████████░░░░ cli-tool 6 ████████████░░░░░░░░ new-project 4 ████████░░░░░░░░░░░░ ``` -------------------------------- ### Bad step: Make parser better Source: https://github.com/0xmariowu/agentlint/blob/main/docs/internal/rules-style.md Counter-example of a plan step that is not atomic because the verify is vague ('Review output') and the action is not specific. Should be split further. ```markdown ### 3. Make parser better - Action: Improve error handling. - Verify: Review output. ``` -------------------------------- ### Required fix: complete copy-paste workflow Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Replacement snippet for INSTALL.md that includes actions/checkout before AgentLint, with fail-below: 80. ```yaml name: AgentLint on: pull_request: push: branches: [main] permissions: contents: read jobs: agentlint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: 0xmariowu/AgentLint@v1 with: fail-below: 80 ``` -------------------------------- ### Final Acceptance Gate Commands Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Run these commands to verify production readiness. All must pass before treating the project as production-grade. ```bash npm test npm run lint:shell bash scripts/sanitize.sh gitleaks detect --source . --redact --no-banner --exit-code 1 npm pack --json --dry-run npm publish --dry-run --json ``` -------------------------------- ### Run unit tests Source: https://github.com/0xmariowu/agentlint/blob/main/CLAUDE.md Runs the unit tests for the project. ```bash npm test ``` -------------------------------- ### Check all version sources Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Reads version fields from package.json, release-metadata.json, plugin.json, and marketplace.json. The output shows all still say 1.1.5. ```bash node -e "const p=require('./package.json'); const m=require('./release-metadata.json'); const cp=require('./.claude-plugin/plugin.json'); const mp=require('./.claude-plugin/marketplace.json'); console.log({package:p.version, metadata:m.version, plugin:cp.version, marketplace:mp.metadata?.version, check_count:m.check_count});" ``` -------------------------------- ### Verify new release Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Commands to verify the new release after bumping to 1.1.6 and publishing. ```bash npm view agentlint-ai@1.1.6 gitHead git ls-remote --tags origin v1 v1.1.6 npm install -g agentlint-ai agentlint --version ``` -------------------------------- ### Initialize and persist config.json with module selections Source: https://github.com/0xmariowu/agentlint/blob/main/commands/al.md Creates the config directory and file if missing, prompting for the projects root (default ~/Projects) on first run. Always writes the selected scan options back to config.json so the scan and verify steps read this file instead of stale shell variables. ```bash CONFIG_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.al}" CONFIG_FILE="$CONFIG_DIR/config.json" mkdir -p "$CONFIG_DIR" if [ ! -f "$CONFIG_FILE" ]; then PROJECTS_ROOT_INPUT="${PROJECTS_ROOT_INPUT:-$HOME/Projects}" node -e ' const fs = require("fs"); const file = process.argv[1]; const projectsRoot = process.argv[2]; fs.writeFileSync(file, JSON.stringify({ projects_root: projectsRoot, modules: { core: true, deep: false, session: false } }, null, 2) + "\n"); ' "$CONFIG_FILE" "$PROJECTS_ROOT_INPUT" fi CONFIG_TMP="$(mktemp "$CONFIG_DIR/config.XXXXXX")" node -e ' const fs = require("fs"); const [file, out, core, deep, session] = process.argv.slice(1); const cfg = JSON.parse(fs.readFileSync(file, "utf8")); cfg.modules = { ...(cfg.modules || {}), core: core === "true", deep: deep === "true", session: session === "true" }; fs.writeFileSync(out, JSON.stringify(cfg, null, 2) + "\n"); ' "$CONFIG_FILE" "$CONFIG_TMP" "$RUN_CORE" "$RUN_DEEP" "$RUN_SESSION" mv "$CONFIG_TMP" "$CONFIG_FILE" ``` -------------------------------- ### Run scanner on a project Source: https://github.com/0xmariowu/agentlint/blob/main/CLAUDE.md Runs the scanner on a specified project directory. ```bash bash src/scanner.sh --project-dir ``` -------------------------------- ### Reproduce BSD-style readlink failure with simulated readlink Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Simulates a BSD/macOS readlink that rejects -f and runs agentlint --version to reproduce the failure. The observed error is 'cd: ../lib/node_modules/agentlint-ai/scripts: No such file or directory'. ```bash # 模拟 BSD/macOS readlink 不支持 -f tmp=$(mktemp -d) mkdir -p "$tmp/bin" cat > "$tmp/bin/readlink" <<'EOF' #!/bin/bash [[ "$1" == "-f" ]] && { echo "readlink: illegal option -- f" >&2; exit 1; } exec /usr/bin/readlink "$@" EOF chmod +x "$tmp/bin/readlink" PATH="$tmp/bin:$PATH" agentlint --version ``` -------------------------------- ### Action runs scanner.sh with project-dir Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md The Action executes the scanner script with the project-dir argument, writing output to a temp file. ```bash bash "${AL_ACTION_PATH}/src/scanner.sh" --project-dir "${AL_PROJECT_DIR}" > "${RUNNER_TEMP}/al-scan.jsonl" ``` -------------------------------- ### Observed version sources output Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Output from the previous command showing all version fields are 1.1.5. ```text { package: '1.1.5', metadata: '1.1.5', plugin: '1.1.5', marketplace: '1.1.5', check_count: 58 } ``` -------------------------------- ### Check published npm package details Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Shows the shasum, integrity, and gitHead of the already-published agentlint-ai@1.1.5. ```bash npm view agentlint-ai@1.1.5 dist.shasum dist.integrity gitHead ``` -------------------------------- ### Run multi-project core scan with scanner.sh Source: https://github.com/0xmariowu/agentlint/blob/main/commands/al.md Reads projects_root and module flags from config.json, then runs scanner.sh with PROJECTS_ROOT set so it auto-discovers every git repo. Creates a unique run directory under runs/ to avoid collisions between concurrent sessions; mkdir -p is required because mktemp -d fails if the parent doesn't exist. ```bash CONFIG_FILE="${CLAUDE_PLUGIN_DATA:-$HOME/.al}/config.json" PROJECTS_ROOT="$(jq -er '.projects_root' "$CONFIG_FILE")" RUN_DEEP="$(jq -r '.modules.deep // false' "$CONFIG_FILE")" RUN_SESSION="$(jq -r '.modules.session // false' "$CONFIG_FILE")" AL_DIR="${CLAUDE_PLUGIN_ROOT}" RUN_ROOT="${CLAUDE_PLUGIN_DATA:-$HOME/.al}/runs" mkdir -p "$RUN_ROOT" RUN_DIR="$(mktemp -d "$RUN_ROOT/$(date +%Y%m%d)-XXXXXX")" PROJECTS_ROOT="$PROJECTS_ROOT" bash "$AL_DIR/src/scanner.sh" > "$RUN_DIR/scan.jsonl" ``` -------------------------------- ### Action inputs with project-dir default Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md The Action's project-dir input defaults to '.', which without checkout points to an empty runner workspace. ```yaml inputs: project-dir: default: '.' ``` -------------------------------- ### Set module selection flags for config write Source: https://github.com/0xmariowu/agentlint/blob/main/commands/al.md Records the normalized module choices from Step 1 as shell variables. Core is all-or-nothing and defaults on; Deep and Session are only set true if explicitly selected. ```bash RUN_CORE=true RUN_DEEP=false # set true only if Deep Analysis was selected RUN_SESSION=false # set true only if Session Analysis was selected ``` -------------------------------- ### Run local compliance and scanner tests Source: https://github.com/0xmariowu/agentlint/blob/main/CLAUDE.md Run before pushing. Executes compliance checks (4 checks, ~1s) and scanner unit tests. Full matrix runs in CI. ```bash bash tests/test_compliance.sh && bash tests/test-scanner.sh ``` -------------------------------- ### Observed local package shasum Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Output from the previous command showing the local package shasum. ```text 261faf59e4ce52876449db8e3a266c7f29ad2510 ``` -------------------------------- ### Run all tests Source: https://github.com/0xmariowu/agentlint/blob/main/docs/content/contributing.md Run the full test suite for AgentLint. This command executes the scanner, scorer, plan generator, reporter, and fixer tests in sequence. ```bash bash tests/test-scanner.sh && node tests/test-scorer.js && node tests/test-plan-generator.js && node tests/test-reporter.js && node tests/test-fixer.js ``` -------------------------------- ### Observed npm view output Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Output from the previous command showing the published package's details. ```text dist.shasum = '182985179c6ae6afd91e9d007f596c3d4ee59346' dist.integrity = 'sha512-lK2YpoPPZPzeayNn/JOTQmjNn4LqiqzVlsI/Kjd3gMxBQPD8oBYXVrkUHgoS8pcuDkGJqk2YLAmhj6HA2W1PrA==' gitHead = '0de092b16b5ecedaa750792f74ec020bc3d6624b' ``` -------------------------------- ### Observed verify output (text) Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Observed output from the verify command, showing a 'Not Found (HTTP 404)' error. ```text gh: Not Found (HTTP 404) ``` -------------------------------- ### Run Windows smoke test locally Source: https://github.com/0xmariowu/agentlint/blob/main/tests/windows/README.md Executes the cross-platform smoke test for AgentLint using the Bash entrypoint. Requires bash, jq, git, and Node 20 or newer; on Windows use Git Bash or WSL to match CI expectations. ```bash bash tests/windows/smoke.sh ``` -------------------------------- ### Run fixer.js on filtered plan Source: https://github.com/0xmariowu/agentlint/blob/main/commands/al.md Executes fixer.js with the resolved project directory and the filtered plan. Requires $PROJECT_DIR to be set by Step 5c before running. ```bash node "$AL_DIR/src/fixer.js" --items "1,2,3" --project-dir "$PROJECT_DIR" < "$RUN_DIR/plan.filtered.json" ``` -------------------------------- ### Run session analyzer with raw snippets included Source: https://github.com/0xmariowu/agentlint/blob/main/commands/al.md Adds --include-raw-snippets to show original prompt text in the output. Use only after confirming with the user, especially if the report will leave their machine. Output is written to session.jsonl. ```bash node "$AL_DIR/src/session-analyzer.js" \ --projects-root "$PROJECTS_ROOT" \ --session-root "$HOME/.claude/projects" \ --max-sessions 30 \ --include-raw-snippets \ > "$RUN_DIR/session.jsonl" ``` -------------------------------- ### Query remote branch protection summary (bash) Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Command to fetch the remote branch protection summary for the main branch using the GitHub API. The observed output shows empty required status checks. ```bash gh api repos/0xmariowu/AgentLint/branches/main --jq '.protection' ``` -------------------------------- ### Verify F1: List entry files Source: https://github.com/0xmariowu/agentlint/blob/main/tests/accuracy/check-spec.md Lists CLAUDE.md, AGENTS.md, or .cursorrules in repo root. Used to verify F1 pass/fail. ```bash ls {CLAUDE.md,AGENTS.md,.cursorrules} 2>/dev/null ``` -------------------------------- ### Acceptance test for product fix Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Acceptance criteria for the product fix: running 'agentlint check --help' should print check-specific help and exit with code 0. The command 'echo $?' prints the exit code. ```bash agentlint check --help echo $? ``` -------------------------------- ### Run local verification checks Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Commands run locally to verify good signals before writing the report. All passed: npm test, lint:shell, pack dry-run, sanitize, gitleaks, detect-secrets, and self-scan. ```bash npm test npm run lint:shell npm pack --json --dry-run bash scripts/sanitize.sh gitleaks detect --source . --redact --no-banner --exit-code 1 git ls-files -z | xargs -0 detect-secrets scan --all-files scripts/agentlint.sh check --project-dir . --fail-below 0 ``` -------------------------------- ### Dry-run publish current tree Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Attempts to publish the current tree as 1.1.5 in dry-run mode. The output indicates publishing is blocked because 1.1.5 already exists. ```bash npm publish --dry-run --json ``` -------------------------------- ### Query repository rulesets (bash) Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Commands to query repository rulesets and branch rules for the main branch. The observed output shows only 'copilot-code-review' ruleset and 'copilot_code_review' branch rule. ```bash gh api repos/0xmariowu/AgentLint/rulesets gh api repos/0xmariowu/AgentLint/rules/branches/main ``` -------------------------------- ### Save report files Source: https://github.com/0xmariowu/agentlint/blob/main/commands/al.md Copies the verification scores and plan to the reports directory with date-based filenames. ```bash REPORT_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.al}/reports" mkdir -p "$REPORT_DIR" cp "$RUN_DIR/verify-scores.json" "$REPORT_DIR/$(date +%F).json" cp "$RUN_DIR/plan.json" "$REPORT_DIR/$(date +%F)-plan.json" ``` -------------------------------- ### Reproduce empty workspace effect Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Reproduces the empty workspace effect by scanning a temporary directory. Observed output: total_score: 35 and warning: not a git repository. ```bash tmp=$(mktemp -d) bash src/scanner.sh --project-dir "$tmp" > "$tmp/scan.jsonl" 2> "$tmp/scan.err" node src/scorer.js "$tmp/scan.jsonl" | jq '.total_score' cat "$tmp/scan.err" ``` -------------------------------- ### Expected acceptance output Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Expected output for the acceptance test: exit code 0, and the command prints check usage. ```text 0 ``` -------------------------------- ### Generate Deep tasks and process outputs per project Source: https://github.com/0xmariowu/agentlint/blob/main/commands/al.md Iterates over unique project_path values from scan.jsonl, resolves absolute paths, generates Deep tasks, and processes D1/D2/D3 checks. Requires jq, python3, node, and the deep-analyzer.js script. Produces one deep.jsonl record per (project, check) pair. ```bash : > "$RUN_DIR/deep.jsonl" REALPATH_CMD='import os,sys; print(os.path.realpath(sys.argv[1]))' PROJECT_PATHS="$( jq -r '.project_path // empty' "$RUN_DIR/scan.jsonl" \ | while IFS= read -r candidate; do [ -z "$candidate" ] && continue python3 -c "$REALPATH_CMD" "$candidate" done \ | sort -u )" printf '%s\n' "$PROJECT_PATHS" | while IFS= read -r P_DIR; do [ -z "$P_DIR" ] && continue [ ! -d "$P_DIR" ] && continue P="$(basename "$P_DIR")" P_HASH="$(node -e "console.log(require('crypto').createHash('sha1').update(process.argv[1]).digest('hex').slice(0, 8))" "$P_DIR")" PREFIX="${P}-${P_HASH}" TASKS_FILE="$RUN_DIR/${PREFIX}.deep-tasks.json" node "$AL_DIR/src/deep-analyzer.js" --project-dir "$P_DIR" > "$TASKS_FILE" for CHECK in D1 D2 D3; do CHECK_LOWER="$(printf '%s' "$CHECK" | tr '[:upper:]' '[:lower:]')" PROMPT_FILE="$RUN_DIR/${PREFIX}.${CHECK}.prompt.txt" AI_OUT="$RUN_DIR/${PREFIX}.${CHECK_LOWER}-ai.json" jq -er --arg check "$CHECK" '.tasks[] | select(.check_id == $check) | .prompt' "$TASKS_FILE" > "$PROMPT_FILE" # Spawn one sonnet subagent with the contents of $PROMPT_FILE. # Write the subagent's raw JSON-only answer to $AI_OUT. [ -s "$AI_OUT" ] || { echo "Error: missing Deep AI output for $P_DIR $CHECK: $AI_OUT" >&2 exit 1 } node "$AL_DIR/src/deep-analyzer.js" --format-result --project "$P" --project-path "$P_DIR" --check "$CHECK" < "$AI_OUT" >> "$RUN_DIR/deep.jsonl" done done ``` -------------------------------- ### Acceptance criteria commands (bash) Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Commands to verify that required status checks or equivalent ruleset requirements are enforced on the main branch. ```bash gh api repos/0xmariowu/AgentLint/branches/main --jq '.protection.required_status_checks' gh api repos/0xmariowu/AgentLint/rules/branches/main ``` -------------------------------- ### Merge scan, deep, and session JSONL files and generate scores and plan Source: https://github.com/0xmariowu/agentlint/blob/main/commands/al.md Combines scan.jsonl with optional deep.jsonl and session.jsonl into combined.jsonl, then runs scorer.js and plan-generator.js to produce scores.json and plan.json. Scoring happens once after all selected analyzers have written their JSONL. ```bash : > "$RUN_DIR/combined.jsonl" cat "$RUN_DIR/scan.jsonl" >> "$RUN_DIR/combined.jsonl" [ -f "$RUN_DIR/deep.jsonl" ] && cat "$RUN_DIR/deep.jsonl" >> "$RUN_DIR/combined.jsonl" [ -f "$RUN_DIR/session.jsonl" ] && cat "$RUN_DIR/session.jsonl" >> "$RUN_DIR/combined.jsonl" node "$AL_DIR/src/scorer.js" "$RUN_DIR/combined.jsonl" > "$RUN_DIR/scores.json" node "$AL_DIR/src/plan-generator.js" "$RUN_DIR/scores.json" > "$RUN_DIR/plan.json" ``` -------------------------------- ### Check current branch against v1.1.5 and v1 tags Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Shows the current HEAD and the v1.1.5 and v1 tag commits. The output indicates the current branch is not at v1.1.5. ```bash git rev-parse HEAD v1.1.5^{} v1^{} ``` -------------------------------- ### Verify F3: Search conditional loading patterns Source: https://github.com/0xmariowu/agentlint/blob/main/tests/accuracy/check-spec.md Searches entry file for patterns 'if.*read', 'Session Checklist', or 'checklist' (case-insensitive). Used to verify F3. ```bash grep -Ei 'if.*read|Session Checklist|checklist' CLAUDE.md ``` -------------------------------- ### Filter plan.json by selected project path Source: https://github.com/0xmariowu/agentlint/blob/main/commands/al.md Filters both the top-level items array and the display-only grouped tree by the selected project path, falling back to basename for legacy records. Writes the filtered plan to plan.filtered.json. ```bash jq --arg pp "$SELECTED_PATH" --arg p "$SELECTED_PROJECT" ' .items |= map(select( (.project_path // null) == $pp or (.project_path == null and .project == $p) )) | .grouped |= ( to_entries | map( .value.items |= map(select( ((.project_paths // []) | index($pp) != null) or (((.project_paths // []) | length) == 0 and ((.projects // []) | index($p) != null)) )) | .value.count = (.value.items | length) ) | from_entries ) | .total_items = (.items | length) ' "$RUN_DIR/plan.json" > "$RUN_DIR/plan.filtered.json" ``` -------------------------------- ### Observed v1 tag commit Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Output from the previous command showing the v1 tag commit. ```text 0de092b16b5ecedaa750792f74ec020bc3d6624b ``` -------------------------------- ### Observed commit count output Source: https://github.com/0xmariowu/agentlint/blob/main/docs/p0-production-blocker-scan-2026-04-25.md Output from the previous command showing the number of commits after v1.1.5. ```text 7 ```