{"owner":"koalaman","repo":"shellcheck","hasSkills":true,"totalSkillsCount":1,"totalTokensCount":1007,"categories":["claude-rule"],"hasMcp":false,"mcpConfig":null,"found":[".claude/CLAUDE.md"],"skills":{".claude/CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Build and test commands\n\n```sh\ncabal build                          # compile\ncabal test                           # run unit tests (source of truth)\ncabal run shellcheck -- file.sh      # run on a file\ncabal run shellcheck - <<< 'cmd'     # run on inline input\n./quickrun - <<< 'cmd'               # run interpreted (fast, no recompile)\n./quicktest                          # run tests interpreted (fast, no recompile)\n./nextnumber                         # print next available SC1xxx/SC2xxx/SC3xxx code\n```\n\nFor interactive development, use `cabal repl` then `:load ShellCheck.Debug`. After editing, reload with `:r` and test with `shellcheckString \"your shell code\"`.\n\nTo inspect the AST without an interactive session:\n\n```sh\ncabal run -fdev-mode shellcheck-dev -- ast 'myshellcommand'\n```\n\nRelease binaries are built by Docker images in `builders/`. Read `.claude/rules/builders.md` before changing them or the CI workflow.\n\n## Architecture\n\nShellCheck processes shell scripts in three stages:\n\n1. **Parsing** (`Parser.hs`) — produces an AST plus warnings (SC1xxx). Parser notes (non-fatal) are buffered and discarded if parsing fails; parser problems (fatal) are always emitted.\n2. **AST Analysis** (`Analytics.hs`, `Checks/`) — walks the AST and emits warnings (SC2xxx/SC3xxx).\n3. **Output** (`Formatter/`) — formats results as TTY, JSON, GCC-style, diff, etc.\n\n### Key source files\n\n| File | Purpose |\n|---|---|\n| `src/ShellCheck/AST.hs` | Token type definitions (the AST node types) |\n| `src/ShellCheck/ASTLib.hs` | Helpers for working with AST nodes (e.g. `getLiteralString`) |\n| `src/ShellCheck/Analytics.hs` | Main analysis: `treeChecks` and `nodeChecks` lists |\n| `src/ShellCheck/AnalyzerLib.hs` | Shared utilities for check authors (`warn`, `err`, `style`, etc.) |\n| `src/ShellCheck/Checks/Commands.hs` | Per-command checks (dispatched by command name) |\n| `src/ShellCheck/Checks/ShellSupport.hs` | Shell-specific checks (dispatched by shell dialect) |\n| `src/ShellCheck/Checks/ControlFlow.hs` | Control-flow / CFG-based checks |\n| `src/ShellCheck/CFG.hs`, `CFGAnalysis.hs` | Control-flow graph construction and analysis |\n| `src/ShellCheck/Parser.hs` | The Parsec-based shell parser |\n| `src/ShellCheck/Interface.hs` | Public API types (`CheckResult`, `PositionedComment`, etc.) |\n| `src/ShellCheck/Debug.hs` | Dev helpers: `stringToAst`, `shellcheckString`, etc. |\n\n### Adding a check\n\nMost checks live in `Analytics.hs` as either:\n\n- **Node checks** — run on every AST node; append to `nodeChecks`.\n- **Tree checks** — run once on the root; append to `treeChecks`.\n\nChecks are pure functions `Parameters -> Token -> Writer [TokenComment] ()`. Use `warn`, `err`, `info`, or `style` from `AnalyzerLib.hs` to emit diagnostics.\n\nEach check should have `prop_` unit tests immediately above it:\n\n```haskell\nprop_checkFoo1 = verify   checkFoo \"bad shell code\"\nprop_checkFoo2 = verifyNot checkFoo \"good shell code\"\n```\n\n`cabal test` auto-discovers all `prop_` functions. Tests must pass before submitting.\n\nCommand-specific checks go in `Checks/Commands.hs`; shell-dialect-specific checks go in `Checks/ShellSupport.hs`.\n\n### AST conventions\n\nAlways use the sugared pattern aliases when matching or constructing AST nodes, e.g. `T_Literal id str` or `T_IoFile id op filename`. Never use the desugared internal classes like `OuterToken (Id id) (Inner_T_Literal str)` — those are GHC's internal representation and should not appear in check code.\n\n### Guidelines\n\n- Add unit tests for new and updated checks; cover both positive and negative cases.\n- Keep changes targeted — avoid sweeping refactors to propagate new data.\n- Account for equivalent command forms (e.g. `echo > foo bar` vs `echo bar > foo`).\n- Always verify `cabal test` passes cleanly.\n- Verify new and modified checks end-to-end via `cabal run shellcheck - <<< 'bad code'` (or `./quickrun`) to confirm the warning fires as expected.\n"},"files":{".claude/CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Build and test commands\n\n```sh\ncabal build                          # compile\ncabal test                           # run unit tests (source of truth)\ncabal run shellcheck -- file.sh      # run on a file\ncabal run shellcheck - <<< 'cmd'     # run on inline input\n./quickrun - <<< 'cmd'               # run interpreted (fast, no recompile)\n./quicktest                          # run tests interpreted (fast, no recompile)\n./nextnumber                         # print next available SC1xxx/SC2xxx/SC3xxx code\n```\n\nFor interactive development, use `cabal repl` then `:load ShellCheck.Debug`. After editing, reload with `:r` and test with `shellcheckString \"your shell code\"`.\n\nTo inspect the AST without an interactive session:\n\n```sh\ncabal run -fdev-mode shellcheck-dev -- ast 'myshellcommand'\n```\n\nRelease binaries are built by Docker images in `builders/`. Read `.claude/rules/builders.md` before changing them or the CI workflow.\n\n## Architecture\n\nShellCheck processes shell scripts in three stages:\n\n1. **Parsing** (`Parser.hs`) — produces an AST plus warnings (SC1xxx). Parser notes (non-fatal) are buffered and discarded if parsing fails; parser problems (fatal) are always emitted.\n2. **AST Analysis** (`Analytics.hs`, `Checks/`) — walks the AST and emits warnings (SC2xxx/SC3xxx).\n3. **Output** (`Formatter/`) — formats results as TTY, JSON, GCC-style, diff, etc.\n\n### Key source files\n\n| File | Purpose |\n|---|---|\n| `src/ShellCheck/AST.hs` | Token type definitions (the AST node types) |\n| `src/ShellCheck/ASTLib.hs` | Helpers for working with AST nodes (e.g. `getLiteralString`) |\n| `src/ShellCheck/Analytics.hs` | Main analysis: `treeChecks` and `nodeChecks` lists |\n| `src/ShellCheck/AnalyzerLib.hs` | Shared utilities for check authors (`warn`, `err`, `style`, etc.) |\n| `src/ShellCheck/Checks/Commands.hs` | Per-command checks (dispatched by command name) |\n| `src/ShellCheck/Checks/ShellSupport.hs` | Shell-specific checks (dispatched by shell dialect) |\n| `src/ShellCheck/Checks/ControlFlow.hs` | Control-flow / CFG-based checks |\n| `src/ShellCheck/CFG.hs`, `CFGAnalysis.hs` | Control-flow graph construction and analysis |\n| `src/ShellCheck/Parser.hs` | The Parsec-based shell parser |\n| `src/ShellCheck/Interface.hs` | Public API types (`CheckResult`, `PositionedComment`, etc.) |\n| `src/ShellCheck/Debug.hs` | Dev helpers: `stringToAst`, `shellcheckString`, etc. |\n\n### Adding a check\n\nMost checks live in `Analytics.hs` as either:\n\n- **Node checks** — run on every AST node; append to `nodeChecks`.\n- **Tree checks** — run once on the root; append to `treeChecks`.\n\nChecks are pure functions `Parameters -> Token -> Writer [TokenComment] ()`. Use `warn`, `err`, `info`, or `style` from `AnalyzerLib.hs` to emit diagnostics.\n\nEach check should have `prop_` unit tests immediately above it:\n\n```haskell\nprop_checkFoo1 = verify   checkFoo \"bad shell code\"\nprop_checkFoo2 = verifyNot checkFoo \"good shell code\"\n```\n\n`cabal test` auto-discovers all `prop_` functions. Tests must pass before submitting.\n\nCommand-specific checks go in `Checks/Commands.hs`; shell-dialect-specific checks go in `Checks/ShellSupport.hs`.\n\n### AST conventions\n\nAlways use the sugared pattern aliases when matching or constructing AST nodes, e.g. `T_Literal id str` or `T_IoFile id op filename`. Never use the desugared internal classes like `OuterToken (Id id) (Inner_T_Literal str)` — those are GHC's internal representation and should not appear in check code.\n\n### Guidelines\n\n- Add unit tests for new and updated checks; cover both positive and negative cases.\n- Keep changes targeted — avoid sweeping refactors to propagate new data.\n- Account for equivalent command forms (e.g. `echo > foo bar` vs `echo bar > foo`).\n- Always verify `cabal test` passes cleanly.\n- Verify new and modified checks end-to-end via `cabal run shellcheck - <<< 'bad code'` (or `./quickrun`) to confirm the warning fires as expected.\n"},"items":[{"name":"CLAUDE.md","path":".claude/CLAUDE.md","rawUrl":"https://raw.githubusercontent.com/koalaman/shellcheck/HEAD/.claude/CLAUDE.md","title":".claude - Claude Agent Guidelines & System Prompt","category":"claude-rule","format":"markdown","content":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Build and test commands\n\n```sh\ncabal build                          # compile\ncabal test                           # run unit tests (source of truth)\ncabal run shellcheck -- file.sh      # run on a file\ncabal run shellcheck - <<< 'cmd'     # run on inline input\n./quickrun - <<< 'cmd'               # run interpreted (fast, no recompile)\n./quicktest                          # run tests interpreted (fast, no recompile)\n./nextnumber                         # print next available SC1xxx/SC2xxx/SC3xxx code\n```\n\nFor interactive development, use `cabal repl` then `:load ShellCheck.Debug`. After editing, reload with `:r` and test with `shellcheckString \"your shell code\"`.\n\nTo inspect the AST without an interactive session:\n\n```sh\ncabal run -fdev-mode shellcheck-dev -- ast 'myshellcommand'\n```\n\nRelease binaries are built by Docker images in `builders/`. Read `.claude/rules/builders.md` before changing them or the CI workflow.\n\n## Architecture\n\nShellCheck processes shell scripts in three stages:\n\n1. **Parsing** (`Parser.hs`) — produces an AST plus warnings (SC1xxx). Parser notes (non-fatal) are buffered and discarded if parsing fails; parser problems (fatal) are always emitted.\n2. **AST Analysis** (`Analytics.hs`, `Checks/`) — walks the AST and emits warnings (SC2xxx/SC3xxx).\n3. **Output** (`Formatter/`) — formats results as TTY, JSON, GCC-style, diff, etc.\n\n### Key source files\n\n| File | Purpose |\n|---|---|\n| `src/ShellCheck/AST.hs` | Token type definitions (the AST node types) |\n| `src/ShellCheck/ASTLib.hs` | Helpers for working with AST nodes (e.g. `getLiteralString`) |\n| `src/ShellCheck/Analytics.hs` | Main analysis: `treeChecks` and `nodeChecks` lists |\n| `src/ShellCheck/AnalyzerLib.hs` | Shared utilities for check authors (`warn`, `err`, `style`, etc.) |\n| `src/ShellCheck/Checks/Commands.hs` | Per-command checks (dispatched by command name) |\n| `src/ShellCheck/Checks/ShellSupport.hs` | Shell-specific checks (dispatched by shell dialect) |\n| `src/ShellCheck/Checks/ControlFlow.hs` | Control-flow / CFG-based checks |\n| `src/ShellCheck/CFG.hs`, `CFGAnalysis.hs` | Control-flow graph construction and analysis |\n| `src/ShellCheck/Parser.hs` | The Parsec-based shell parser |\n| `src/ShellCheck/Interface.hs` | Public API types (`CheckResult`, `PositionedComment`, etc.) |\n| `src/ShellCheck/Debug.hs` | Dev helpers: `stringToAst`, `shellcheckString`, etc. |\n\n### Adding a check\n\nMost checks live in `Analytics.hs` as either:\n\n- **Node checks** — run on every AST node; append to `nodeChecks`.\n- **Tree checks** — run once on the root; append to `treeChecks`.\n\nChecks are pure functions `Parameters -> Token -> Writer [TokenComment] ()`. Use `warn`, `err`, `info`, or `style` from `AnalyzerLib.hs` to emit diagnostics.\n\nEach check should have `prop_` unit tests immediately above it:\n\n```haskell\nprop_checkFoo1 = verify   checkFoo \"bad shell code\"\nprop_checkFoo2 = verifyNot checkFoo \"good shell code\"\n```\n\n`cabal test` auto-discovers all `prop_` functions. Tests must pass before submitting.\n\nCommand-specific checks go in `Checks/Commands.hs`; shell-dialect-specific checks go in `Checks/ShellSupport.hs`.\n\n### AST conventions\n\nAlways use the sugared pattern aliases when matching or constructing AST nodes, e.g. `T_Literal id str` or `T_IoFile id op filename`. Never use the desugared internal classes like `OuterToken (Id id) (Inner_T_Literal str)` — those are GHC's internal representation and should not appear in check code.\n\n### Guidelines\n\n- Add unit tests for new and updated checks; cover both positive and negative cases.\n- Keep changes targeted — avoid sweeping refactors to propagate new data.\n- Account for equivalent command forms (e.g. `echo > foo bar` vs `echo bar > foo`).\n- Always verify `cabal test` passes cleanly.\n- Verify new and modified checks end-to-end via `cabal run shellcheck - <<< 'bad code'` (or `./quickrun`) to confirm the warning fires as expected.\n","isInternal":false,"tokens":1007,"sizeBytes":4042}],"systemPromptSnippet":"<yakaai_skills repo=\"koalaman/shellcheck\">\n<!-- File: .claude/CLAUDE.md (Tokens: ~1007 | Category: claude-rule) -->\n# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Build and test commands\n\n```sh\ncabal build                          # compile\ncabal test                           # run unit tests (source of truth)\ncabal run shellcheck -- file.sh      # run on a file\ncabal run shellcheck - <<< 'cmd'     # run on inline input\n./quickrun - <<< 'cmd'               # run interpreted (fast, no recompile)\n./quicktest                          # run tests interpreted (fast, no recompile)\n./nextnumber                         # print next available SC1xxx/SC2xxx/SC3xxx code\n```\n\nFor interactive development, use `cabal repl` then `:load ShellCheck.Debug`. After editing, reload with `:r` and test with `shellcheckString \"your shell code\"`.\n\nTo inspect the AST without an interactive session:\n\n```sh\ncabal run -fdev-mode shellcheck-dev -- ast 'myshellcommand'\n```\n\nRelease binaries are built by Docker images in `builders/`. Read `.claude/rules/builders.md` before changing them or the CI workflow.\n\n## Architecture\n\nShellCheck processes shell scripts in three stages:\n\n1. **Parsing** (`Parser.hs`) — produces an AST plus warnings (SC1xxx). Parser notes (non-fatal) are buffered and discarded if parsing fails; parser problems (fatal) are always emitted.\n2. **AST Analysis** (`Analytics.hs`, `Checks/`) — walks the AST and emits warnings (SC2xxx/SC3xxx).\n3. **Output** (`Formatter/`) — formats results as TTY, JSON, GCC-style, diff, etc.\n\n### Key source files\n\n| File | Purpose |\n|---|---|\n| `src/ShellCheck/AST.hs` | Token type definitions (the AST node types) |\n| `src/ShellCheck/ASTLib.hs` | Helpers for working with AST nodes (e.g. `getLiteralString`) |\n| `src/ShellCheck/Analytics.hs` | Main analysis: `treeChecks` and `nodeChecks` lists |\n| `src/ShellCheck/AnalyzerLib.hs` | Shared utilities for check authors (`warn`, `err`, `style`, etc.) |\n| `src/ShellCheck/Checks/Commands.hs` | Per-command checks (dispatched by command name) |\n| `src/ShellCheck/Checks/ShellSupport.hs` | Shell-specific checks (dispatched by shell dialect) |\n| `src/ShellCheck/Checks/ControlFlow.hs` | Control-flow / CFG-based checks |\n| `src/ShellCheck/CFG.hs`, `CFGAnalysis.hs` | Control-flow graph construction and analysis |\n| `src/ShellCheck/Parser.hs` | The Parsec-based shell parser |\n| `src/ShellCheck/Interface.hs` | Public API types (`CheckResult`, `PositionedComment`, etc.) |\n| `src/ShellCheck/Debug.hs` | Dev helpers: `stringToAst`, `shellcheckString`, etc. |\n\n### Adding a check\n\nMost checks live in `Analytics.hs` as either:\n\n- **Node checks** — run on every AST node; append to `nodeChecks`.\n- **Tree checks** — run once on the root; append to `treeChecks`.\n\nChecks are pure functions `Parameters -> Token -> Writer [TokenComment] ()`. Use `warn`, `err`, `info`, or `style` from `AnalyzerLib.hs` to emit diagnostics.\n\nEach check should have `prop_` unit tests immediately above it:\n\n```haskell\nprop_checkFoo1 = verify   checkFoo \"bad shell code\"\nprop_checkFoo2 = verifyNot checkFoo \"good shell code\"\n```\n\n`cabal test` auto-discovers all `prop_` functions. Tests must pass before submitting.\n\nCommand-specific checks go in `Checks/Commands.hs`; shell-dialect-specific checks go in `Checks/ShellSupport.hs`.\n\n### AST conventions\n\nAlways use the sugared pattern aliases when matching or constructing AST nodes, e.g. `T_Literal id str` or `T_IoFile id op filename`. Never use the desugared internal classes like `OuterToken (Id id) (Inner_T_Literal str)` — those are GHC's internal representation and should not appear in check code.\n\n### Guidelines\n\n- Add unit tests for new and updated checks; cover both positive and negative cases.\n- Keep changes targeted — avoid sweeping refactors to propagate new data.\n- Account for equivalent command forms (e.g. `echo > foo bar` vs `echo bar > foo`).\n- Always verify `cabal test` passes cleanly.\n- Verify new and modified checks end-to-end via `cabal run shellcheck - <<< 'bad code'` (or `./quickrun`) to confirm the warning fires as expected.\n</yakaai_skills>"}