[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AGV52SD510Y5ATHQES1AB8":3,"skill-same:01M7AGV52SD510Y5ATHQES1AB8":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M7AGV52SD510Y5ATHQES1AB8","rule-author",null,"Use when authoring, adding, or extending a skillmap detection rule — writing tree-sitter .scm queries, rule TOML metadata, or fixtures under rules\u002F, queries\u002F, fixtures\u002F. Triggers on requests like \"add a rule for X\", \"write a tree-sitter query\", \"extend capability coverage for language Y\", \"add a sink detector\", or anything touching capture roles or the rule triple.","SandeepTakasi\u002Fagentskillmap","SandeepTakasi","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F38204927?v=4","01M7AGTSDV6CR7Q8QRV10SJQWN","Sandeep","01M7AGTSEFES61T35AM0F6451X",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FSandeepTakasi\u002Fagentskillmap\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frule-author\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: rule-author\ndescription: Use when authoring, adding, or extending a skillmap detection rule — writing tree-sitter .scm queries, rule TOML metadata, or fixtures under rules\u002F, queries\u002F, fixtures\u002F. Triggers on requests like \"add a rule for X\", \"write a tree-sitter query\", \"extend capability coverage for language Y\", \"add a sink detector\", or anything touching capture roles or the rule triple.\n---\n\n# Authoring a rule triple\n\nA rule is three files, never fewer, per `docs\u002F03-rules-authoring.md`:\n\n```\nrules\u002F\u003Clanguage>\u002F\u003Crule-id>.toml        # metadata\nqueries\u002F\u003Clanguage>\u002F\u003Crule-id>.scm       # tree-sitter query\nfixtures\u002F\u003Clanguage>\u002F\u003Crule-id>\u002F\n    positive.\u003Cext>                     # must fire\n    negative.\u003Cext>                     # must NOT fire\n    expected.json                      # canonical manifest fragment\n```\n\nStart from the reference triple and copy its shape:\n`rules\u002Fpython\u002Fcredential-read.toml`, `queries\u002Fpython\u002Fcredential-read.scm`,\n`fixtures\u002Fpython\u002Fcredential-read\u002F{positive.py,negative.py,expected.json}`.\n\nEverything below is a way authors get one of those three files subtly wrong. Each item\nstates the failure it prevents, not just the rule.\n\n## The capability term is closed vocabulary\n\n`capability` in the TOML must already exist in `docs\u002F02-manifest-schema.md`'s taxonomy\ntable (`fs.read.credential`, `process.exec`, `net.egress`, …). If the capability you're\ndetecting isn't in that table, you are not writing a rule — you are proposing a\nschema-version event. Stop, don't invent a string that merely looks like it fits; a new\ntaxonomy term needs the schema bumped and `docs\u002F02-manifest-schema.md` updated first, in\nits own change.\n\n## Structural matching, not string matching\n\n`(call function: (attribute ...))` beats matching the text `open(`. A query that matches\nsource text is defeated by whitespace, aliasing (`import os as o`), or trivial\nreformatting, and it is exactly the kind of check an obfuscated payload is built to slip\npast. Tree-sitter gives you the AST — use it. Look at\n`queries\u002Fpython\u002Fcredential-read.scm`: it matches the *call shape* (`function:` +\n`arguments:` with a predicate on the callee identifier), never the literal `\"open(\"`.\n\n## Capture the smallest span, not the whole function\n\nEvidence spans are what a human reads in a PR diff. `@site` should point at the call\nexpression that is the sink, not the function it lives in. A whole-function capture forces\nevery reviewer to re-derive which line actually matters — it technically satisfies\n\"provenance\" while defeating the reason provenance exists. If you're tempted to capture a\nblock to \"be safe,\" capture the call\u002Fexpression inside it instead.\n\n## Path lists live in `[match]`, never in the query\n\nDo not write `(#match? @path \"\\\\.aws|\\\\.ssh|\\\\.netrc\")` inside the `.scm` file. Literal\nprefixes belong in the TOML's `[match].path_prefixes`, exactly like\n`rules\u002Fpython\u002Fcredential-read.toml` does it. This is invariant 7 made concrete: a\ncontributor extending coverage for a new credential path should be able to add one string\nto a TOML array and never open a `.scm` file, let alone Rust. If extending your rule's\ncoverage requires touching the query, the query encoded something that should have been\ndata.\n\n## `[captures]` maps roles, and validation runs both directions\n\nThe engine has exactly four roles — see the table in `docs\u002F03-rules-authoring.md`:\n\n| Role | Required? | Effect |\n|---|---|---|\n| `site` | required | byte span reported as the evidence span |\n| `path` | optional | filtered through `path_prefixes`, lands in `detail.paths` |\n| `host` | optional | filtered through `host_suffixes`, lands in `detail.hosts` |\n| `dynamic` | optional | target unresolved → `unresolved: computed_target`, not a capability |\n\nTwo rules, both enforced by `rules validate` (not yet built — see below):\n\n- Any capture prefixed `@_` is query-local (drives `#eq?`\u002F`#match?` predicates) and must\n  **not** appear in `[captures]`.\n- Every other capture the query produces **must** appear in `[captures]`. Validation checks\n  TOML→query and query→TOML. A capture your query emits that the TOML never declares isn't\n  a warning — it's a rule silently dropping a detection on the floor while looking like it\n  works, which is worse than not having the rule.\n\n## Dynamic targets are captured, never skipped\n\nWhen the query hits a call whose target can't be resolved statically (a variable, a\nconcatenation, a function result), do not filter it out and move on. Capture it with the\n`dynamic` role, same as the third pattern in `queries\u002Fpython\u002Fcredential-read.scm` does for\n`open(computed_expr)`. The engine turns that into an `unresolved` entry with reason\n`computed_target`. Skipping it is silence, and invariant 3 makes silence a bug, not a\nmissing feature — a scanner that says nothing because it understood nothing must be\nindistinguishable-in-symptom-but-not-in-record from one that found nothing because there\nwas nothing there.\n\n## Both fixtures are mandatory, and the negative is not invented\n\n`positive.\u003Cext>` must trigger the rule; `negative.\u003Cext>` must not, and per invariant 8 and\nthe review checklist in `docs\u002F03-rules-authoring.md`, the negative fixture should be drawn\nfrom a real bundle's code shape (e.g. the credential-read reference fixture's negative is a\ndocstring that *mentions* `~\u002F.aws\u002Fcredentials` as an example string — a real and common\npattern — rather than a synthetic near-miss). A rule with no negative fixture is an\nuntested false-positive generator; a rule whose negative fixture is contrived to be easy is\nclose to the same thing.\n\n`expected.json` records the manifest fragment each fixture should produce. Byte offsets are\nfilled in by `skillmap rules bless` once it exists — don't hand-compute them; leave the\nfields that require a running engine out, matching the shape in\n`fixtures\u002Fpython\u002Fcredential-read\u002Fexpected.json`.\n\n## What does not exist yet\n\n`skillmap rules validate` and `skillmap rules bless` are specified in\n`docs\u002F03-rules-authoring.md` and referenced throughout, but neither command exists —\nthere is no `skillmap-rules` crate yet (it lands in task T4, per `docs\u002F00-tasks.md`).\nWrite the triple to the shape those commands will eventually check by hand: query compiles\nconceptually against the grammar, captures line up with `[captures]` in both directions,\nfixtures match `expected.json`. Say so plainly if asked to \"run validation\" — do not\nfabricate a passing check.\n","# Authoring a rule triple\n\nA rule is three files, never fewer, per `docs\u002F03-rules-authoring.md`:\n\n```\nrules\u002F\u003Clanguage>\u002F\u003Crule-id>.toml        # metadata\nqueries\u002F\u003Clanguage>\u002F\u003Crule-id>.scm       # tree-sitter query\nfixtures\u002F\u003Clanguage>\u002F\u003Crule-id>\u002F\n    positive.\u003Cext>                     # must fire\n    negative.\u003Cext>                     # must NOT fire\n    expected.json                      # canonical manifest fragment\n```\n\nStart from the reference triple and copy its shape:\n`rules\u002Fpython\u002Fcredential-read.toml`, `queries\u002Fpython\u002Fcredential-read.scm`,\n`fixtures\u002Fpython\u002Fcredential-read\u002F{positive.py,negative.py,expected.json}`.\n\nEverything below is a way authors get one of those three files subtly wrong. Each item\nstates the failure it prevents, not just the rule.\n\n## The capability term is closed vocabulary\n\n`capability` in the TOML must already exist in `docs\u002F02-manifest-schema.md`'s taxonomy\ntable (`fs.read.credential`, `process.exec`, `net.egress`, …). If the capability you're\ndetecting isn't in that table, you are not writing a rule — you are proposing a\nschema-version event. Stop, don't invent a string that merely looks like it fits; a new\ntaxonomy term needs the schema bumped and `docs\u002F02-manifest-schema.md` updated first, in\nits own change.\n\n## Structural matching, not string matching\n\n`(call function: (attribute ...))` beats matching the text `open(`. A query that matches\nsource text is defeated by whitespace, aliasing (`import os as o`), or trivial\nreformatting, and it is exactly the kind of check an obfuscated payload is built to slip\npast. Tree-sitter gives you the AST — use it. Look at\n`queries\u002Fpython\u002Fcredential-read.scm`: it matches the *call shape* (`function:` +\n`arguments:` with a predicate on the callee identifier), never the literal `\"open(\"`.\n\n## Capture the smallest span, not the whole function\n\nEvidence spans are what a human reads in a PR diff. `@site` should point at the call\nexpression that is the sink, not the function it lives in. A whole-function capture forces\nevery reviewer to re-derive which line actually matters — it technically satisfies\n\"provenance\" while defeating the reason provenance exists. If you're tempted to capture a\nblock to \"be safe,\" capture the call\u002Fexpression inside it instead.\n\n## Path lists live in `[match]`, never in the query\n\nDo not write `(#match? @path \"\\\\.aws|\\\\.ssh|\\\\.netrc\")` inside the `.scm` file. Literal\nprefixes belong in the TOML's `[match].path_prefixes`, exactly like\n`rules\u002Fpython\u002Fcredential-read.toml` does it. This is invariant 7 made concrete: a\ncontributor extending coverage for a new credential path should be able to add one string\nto a TOML array and never open a `.scm` file, let alone Rust. If extending your rule's\ncoverage requires touching the query, the query encoded something that should have been\ndata.\n\n## `[captures]` maps roles, and validation runs both directions\n\nThe engine has exactly four roles — see the table in `docs\u002F03-rules-authoring.md`:\n\n| Role | Required? | Effect |\n|---|---|---|\n| `site` | required | byte span reported as the evidence span |\n| `path` | optional | filtered through `path_prefixes`, lands in `detail.paths` |\n| `host` | optional | filtered through `host_suffixes`, lands in `detail.hosts` |\n| `dynamic` | optional | target unresolved → `unresolved: computed_target`, not a capability |\n\nTwo rules, both enforced by `rules validate` (not yet built — see below):\n\n- Any capture prefixed `@_` is query-local (drives `#eq?`\u002F`#match?` predicates) and must\n  **not** appear in `[captures]`.\n- Every other capture the query produces **must** appear in `[captures]`. Validation checks\n  TOML→query and query→TOML. A capture your query emits that the TOML never declares isn't\n  a warning — it's a rule silently dropping a detection on the floor while looking like it\n  works, which is worse than not having the rule.\n\n## Dynamic targets are captured, never skipped\n\nWhen the query hits a call whose target can't be resolved statically (a variable, a\nconcatenation, a function result), do not filter it out and move on. Capture it with the\n`dynamic` role, same as the third pattern in `queries\u002Fpython\u002Fcredential-read.scm` does for\n`open(computed_expr)`. The engine turns that into an `unresolved` entry with reason\n`computed_target`. Skipping it is silence, and invariant 3 makes silence a bug, not a\nmissing feature — a scanner that says nothing because it understood nothing must be\nindistinguishable-in-symptom-but-not-in-record from one that found nothing because there\nwas nothing there.\n\n## Both fixtures are mandatory, and the negative is not invented\n\n`positive.\u003Cext>` must trigger the rule; `negative.\u003Cext>` must not, and per invariant 8 and\nthe review checklist in `docs\u002F03-rules-authoring.md`, the negative fixture should be drawn\nfrom a real bundle's code shape (e.g. the credential-read reference fixture's negative is a\ndocstring that *mentions* `~\u002F.aws\u002Fcredentials` as an example string — a real and common\npattern — rather than a synthetic near-miss). A rule with no negative fixture is an\nuntested false-positive generator; a rule whose negative fixture is contrived to be easy is\nclose to the same thing.\n\n`expected.json` records the manifest fragment each fixture should produce. Byte offsets are\nfilled in by `skillmap rules bless` once it exists — don't hand-compute them; leave the\nfields that require a running engine out, matching the shape in\n`fixtures\u002Fpython\u002Fcredential-read\u002Fexpected.json`.\n\n## What does not exist yet\n\n`skillmap rules validate` and `skillmap rules bless` are specified in\n`docs\u002F03-rules-authoring.md` and referenced throughout, but neither command exists —\nthere is no `skillmap-rules` crate yet (it lands in task T4, per `docs\u002F00-tasks.md`).\nWrite the triple to the shape those commands will eventually check by hand: query compiles\nconceptually against the grammar, captures line up with `[captures]` in both directions,\nfixtures match `expected.json`. Say so plainly if asked to \"run validation\" — do not\nfabricate a passing check.\n",{"name":5,"description":7},"main","5fbbe4101337268b45182558e528b2133f5765c9",".claude\u002Fskills\u002Frule-author","https:\u002F\u002Fgithub.com\u002FSandeepTakasi\u002Fagentskillmap","https:\u002F\u002Fgithub.com\u002FSandeepTakasi","Full stack developer","2026-08-19 15:31:29",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add SandeepTakasi\u002Fagentskillmap --skill rule-author",{"tool":37,"command":38},"bunx","bunx skills add SandeepTakasi\u002Fagentskillmap --skill rule-author",{"tool":40,"command":41},"pnpm","pnpm dlx skills add SandeepTakasi\u002Fagentskillmap --skill rule-author","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSandeepTakasi\u002Fagentskillmap\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frule-author\u002FSKILL.md",true,[],[46,53,58,65,71,78],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M7AGVXA7ZEVDDK0ECNAHKXSR","example-skill","Summarizes the project's deploy configuration.","https:\u002F\u002Fgithub.com\u002FSandeepTakasi\u002Fagentskillmap\u002Fblob\u002Fmain\u002Ffixtures\u002Fprojects\u002Fv1.1\u002F.claude\u002Fskills\u002Fexample-skill\u002FSKILL.md",[],[],{"skillNo":54,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M7AGVV1RDZT6Z6VTEWW9G4B7","https:\u002F\u002Fgithub.com\u002FSandeepTakasi\u002Fagentskillmap\u002Fblob\u002Fmain\u002Ffixtures\u002Fprojects\u002Fv1.0\u002F.claude\u002Fskills\u002Fexample-skill\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7AGVS67PQ2F9GT353PQN3NB","pdf-formatter","Formats and fills PDF forms from structured data. Use when a task mentions PDF, forms, or document layout.","https:\u002F\u002Fgithub.com\u002FSandeepTakasi\u002Fagentskillmap\u002Fblob\u002Fmain\u002Ffixtures\u002Fbundles\u002Fpdf-formatter\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7AGVQYKE1YNJNDFV5SQR7YF","no-frontmatter","https:\u002F\u002Fgithub.com\u002FSandeepTakasi\u002Fagentskillmap\u002Fblob\u002Fmain\u002Ffixtures\u002Fbundles\u002Fno-frontmatter\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7AGVPZ3R9DQWQRQX0MKY7SY","minimal","Does one small thing.","https:\u002F\u002Fgithub.com\u002FSandeepTakasi\u002Fagentskillmap\u002Fblob\u002Fmain\u002Ffixtures\u002Fbundles\u002Fminimal\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7AGVP31M8V6YHW9R0K5W7SX","malformed","Second value.","https:\u002F\u002Fgithub.com\u002FSandeepTakasi\u002Fagentskillmap\u002Fblob\u002Fmain\u002Ffixtures\u002Fbundles\u002Fmalformed-frontmatter\u002FSKILL.md",[],[]]