{"skills":[{"name":"Test when neighbouring skills activate","description":"Grade recorded skill selections against labelled requests, including cases where a second skill wrongly activates on the same wording.","content":"# Test when neighbouring skills activate\n\nGrade recorded skill selections against labelled requests, including cases where a second skill wrongly activates on the same wording.\n\n## When to use this skill\n\n- Someone is adding a skill next to similar ones and wants to know whether prompts route to the right one.\n- Users report that the wrong skill loads, or two skills load, for a common request.\n- A skill description is being revised and someone wants a before-and-after check on labelled prompts.\n\n## When not to use it\n\n- Judging the quality of the work done once a skill loaded. Use the paired skill evaluation skill.\n- Installation problems, such as a skill missing from the catalogue altogether. Check the client's skill locations and loading diagnostics first.\n- Rewriting the descriptions. This skill grades routing; its findings feed a separate description edit.\n\n## What you need\n\n- A skill catalogue or pair of neighbouring descriptions, a labelled prompt set and the actual activation trace for each prompt.\n- For each prompt specify every acceptable set of active skills, including the empty set for a true negative. Distinguish observed no activation from an absent trace.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- What is the labelled prompt set, and for each prompt which sets of skills are acceptable, including an empty set where no skill should load?\n- How was activation captured: a tool-call log, a file-read trace or the client's debug output? A model mentioning a skill is not evidence that it loaded.\n- Which prompts are being held back to check a later description change?\n\n## Method\n\n1. Write or review prompts in users' own words around each boundary: the right task in indirect wording, similar vocabulary with a different deliverable, a request that genuinely needs both skills, and a request that needs neither. The Agent Skills guide suggests about 20, half that should trigger and half near-misses that should not.\n2. Label every acceptable set of skills for each prompt before looking at any trace.\n3. Read activation from the trace: which SKILL.md files were loaded or which activation calls were made. A good answer, or a mention of a skill's name, is not proof of activation. If capture failed, mark the prompt unobserved.\n4. Compare the observed set with each acceptable set as sets, ignoring order. A match with any acceptable set passes.\n5. If no acceptable set matches, compare with the one needing the fewest additions and removals, breaking ties by input order. A required skill that did not load is missing; an unwanted skill that loaded is extra. A substitution shows both.\n6. Count passing and observed prompts. Activation varies between runs, so where possible run each prompt several times; the guide suggests three runs and a trigger-rate threshold of 0.5.\n7. Group repeated errors by the shared phrase or concept that caused them, and keep the held-out prompts unused until a revised description is ready to test.\n\n## Checks before you deliver\n\n- Treating every multi-skill selection as a collision unfairly penalises prompts that need both capabilities.\n- Scoring no trace as no activation flatters negative prompts and fabricates misses on positive ones.\n- Negative prompts with no shared vocabulary, such as a weather question, which test nothing about the boundary.\n- Fixing a failure by pasting the failed prompt's keywords into the description, which overfits to the test set.\n- Judging from a single run per prompt when activation varies from run to run.\n\n## How to present the result\n\nStart with the score: prompts passed out of prompts observed, and how many were unobserved. Then a table: prompt ID, result, missing skills and extra skills. Group mismatches by the overlapping phrase that caused them, and finish with the boundary each pair of descriptions needs to state, as input for a description edit.\n\n## Worked example\n\n**Request:** Grade each routing trace. Brackets show sets of skill slugs; braces separate accepted alternatives.\n\n**Supplied material:**\n\n```text\nP1 'Have we paid this supplier bill?' accept [bank-match]; trace [bank-match,invoice-check].\nP2 'Did the tradesperson charge what we agreed?' accept [invoice-check]; trace [bank-match].\nP3 'Write a thank-you note' accept []; trace [] (captured).\n```\n\n**Answer:** Only the thank-you note routed correctly. The supplier-payment request loaded an unnecessary invoice checker. The tradesperson\u2019s price check loaded the bank matcher and missed the invoice checker it needed.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nReturn prompts in supplied order as rows with id, result ('pass', 'mismatch' or 'unobserved'), missing and extra as alphabetically sorted skill slugs. Unobserved rows have empty arrays. Return passed and observed as counts of passing and observed prompts. Treat selections as sets.\n\n## Sources\n\n- [Agent Skills: optimising skill descriptions](https:\/\/agentskills.io\/skill-creation\/optimizing-descriptions): Recommends about 20 labelled queries with near-miss negatives, checking whether the agent loaded SKILL.md, running each query several times against a trigger-rate threshold, and keeping a validation split to avoid overfitting the description.\n- [Agent Skills: how to add skills support to your agent](https:\/\/agentskills.io\/client-implementation\/adding-skills-support): Separates disclosure of the skill catalogue from activation, which happens when the model reads SKILL.md or calls an activation tool. That activation record is the evidence this skill grades.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/test-skill-trigger-collisions\n","scope":"contextual","trigger_keywords":["Test when neighbouring skills activate","test-skill-trigger-collisions","test skill trigger collisions","Will my new skill clash with similar ones and pick up the wrong requests?","Will my new skill clash with similar ones and pick up the wrong requests","overlapping skill triggers","skill trigger collision","which skill should trigger"],"is_private":true,"is_active":true,"scripts":[{"name":"test-skill-trigger-collisions-check","description":"Compare a saved JSON answer with a published test. Pass tests\/case-1\/expected.json (or another case) and the path to your answer.","language":"python","filename":"test-skill-trigger-collisions-check.py","content":"from pathlib import Path\nimport runpy\n\nrunpy.run_path(str(Path(__file__).parent \/ 'tests' \/ 'check.py'), run_name='__main__')\n","supporting_files":[{"path":"SKILL.md","content":"---\nname: test-skill-trigger-collisions\ndescription: \"Grade which skills an agent actually loaded for each labelled test prompt, finding missed activations and neighbouring skills that wrongly trigger on shared words. Use when someone is tuning skill descriptions, adding a skill beside similar ones or checking routing in a skill library.\"\nlicense: CC-BY-4.0\nmetadata:\n  author: Raq.com\n  version: \"2026-11-22\"\n  homepage: https:\/\/skills.raq.com\/skills\/test-skill-trigger-collisions\n---\n\n# Test when neighbouring skills activate\n\nGrade recorded skill selections against labelled requests, including cases where a second skill wrongly activates on the same wording.\n\n## When to use this skill\n\n- Someone is adding a skill next to similar ones and wants to know whether prompts route to the right one.\n- Users report that the wrong skill loads, or two skills load, for a common request.\n- A skill description is being revised and someone wants a before-and-after check on labelled prompts.\n\n## When not to use it\n\n- Judging the quality of the work done once a skill loaded. Use the paired skill evaluation skill.\n- Installation problems, such as a skill missing from the catalogue altogether. Check the client's skill locations and loading diagnostics first.\n- Rewriting the descriptions. This skill grades routing; its findings feed a separate description edit.\n\n## What you need\n\n- A skill catalogue or pair of neighbouring descriptions, a labelled prompt set and the actual activation trace for each prompt.\n- For each prompt specify every acceptable set of active skills, including the empty set for a true negative. Distinguish observed no activation from an absent trace.\n\n## Ask before you start\n\nIf any of these are missing or unclear, ask before doing the work.\n\n- What is the labelled prompt set, and for each prompt which sets of skills are acceptable, including an empty set where no skill should load?\n- How was activation captured: a tool-call log, a file-read trace or the client's debug output? A model mentioning a skill is not evidence that it loaded.\n- Which prompts are being held back to check a later description change?\n\n## Method\n\n1. Write or review prompts in users' own words around each boundary: the right task in indirect wording, similar vocabulary with a different deliverable, a request that genuinely needs both skills, and a request that needs neither. The Agent Skills guide suggests about 20, half that should trigger and half near-misses that should not.\n2. Label every acceptable set of skills for each prompt before looking at any trace.\n3. Read activation from the trace: which SKILL.md files were loaded or which activation calls were made. A good answer, or a mention of a skill's name, is not proof of activation. If capture failed, mark the prompt unobserved.\n4. Compare the observed set with each acceptable set as sets, ignoring order. A match with any acceptable set passes.\n5. If no acceptable set matches, compare with the one needing the fewest additions and removals, breaking ties by input order. A required skill that did not load is missing; an unwanted skill that loaded is extra. A substitution shows both.\n6. Count passing and observed prompts. Activation varies between runs, so where possible run each prompt several times; the guide suggests three runs and a trigger-rate threshold of 0.5.\n7. Group repeated errors by the shared phrase or concept that caused them, and keep the held-out prompts unused until a revised description is ready to test.\n\n## Checks before you deliver\n\n- Treating every multi-skill selection as a collision unfairly penalises prompts that need both capabilities.\n- Scoring no trace as no activation flatters negative prompts and fabricates misses on positive ones.\n- Negative prompts with no shared vocabulary, such as a weather question, which test nothing about the boundary.\n- Fixing a failure by pasting the failed prompt's keywords into the description, which overfits to the test set.\n- Judging from a single run per prompt when activation varies from run to run.\n\n## How to present the result\n\nStart with the score: prompts passed out of prompts observed, and how many were unobserved. Then a table: prompt ID, result, missing skills and extra skills. Group mismatches by the overlapping phrase that caused them, and finish with the boundary each pair of descriptions needs to state, as input for a description edit.\n\n## Worked example\n\n**Request:** Grade each routing trace. Brackets show sets of skill slugs; braces separate accepted alternatives.\n\n**Supplied material:**\n\n```text\nP1 'Have we paid this supplier bill?' accept [bank-match]; trace [bank-match,invoice-check].\nP2 'Did the tradesperson charge what we agreed?' accept [invoice-check]; trace [bank-match].\nP3 'Write a thank-you note' accept []; trace [] (captured).\n```\n\n**Answer:** Only the thank-you note routed correctly. The supplier-payment request loaded an unnecessary invoice checker. The tradesperson\u2019s price check loaded the bank matcher and missed the invoice checker it needed.\n\n## Structured output for tests\n\nFor an ordinary job, answer in the format above and point back to the supplied evidence. Use this structure only for the test cases published with this skill, or when someone asks for structured JSON.\n\nReturn prompts in supplied order as rows with id, result ('pass', 'mismatch' or 'unobserved'), missing and extra as alphabetically sorted skill slugs. Unobserved rows have empty arrays. Return passed and observed as counts of passing and observed prompts. Treat selections as sets.\n\n## Sources\n\n- [Agent Skills: optimising skill descriptions](https:\/\/agentskills.io\/skill-creation\/optimizing-descriptions): Recommends about 20 labelled queries with near-miss negatives, checking whether the agent loaded SKILL.md, running each query several times against a trigger-rate threshold, and keeping a validation split to avoid overfitting the description.\n- [Agent Skills: how to add skills support to your agent](https:\/\/agentskills.io\/client-implementation\/adding-skills-support): Separates disclosure of the skill catalogue from activation, which happens when the model reads SKILL.md or calls an activation tool. That activation record is the evidence this skill grades.\n\nTest cases and an answer checker for this skill: https:\/\/skills.raq.com\/skills\/test-skill-trigger-collisions\n"},{"path":"LICENSE.txt","content":"Original Raq.com instructions and synthetic examples: CC BY 4.0.\nhttps:\/\/creativecommons.org\/licenses\/by\/4.0\/\nAttribution: Raq.com, https:\/\/skills.raq.com\/skills\/test-skill-trigger-collisions\nReferenced third-party materials retain their own terms.\n"},{"path":"examples\/worked-example.md","content":"# The word \u2018invoice\u2019 is shared\n\nGrade each routing trace. Brackets show sets of skill slugs; braces separate accepted alternatives.\n\n## Supplied material\n\nP1 'Have we paid this supplier bill?' accept [bank-match]; trace [bank-match,invoice-check].\nP2 'Did the tradesperson charge what we agreed?' accept [invoice-check]; trace [bank-match].\nP3 'Write a thank-you note' accept []; trace [] (captured).\n\n## Worked answer\n\nOnly the thank-you note routed correctly. The supplier-payment request loaded an unnecessary invoice checker. The tradesperson\u2019s price check loaded the bank matcher and missed the invoice checker it needed.\n\n## Reasoning\n\nP1 found the right skill but unnecessarily loaded another. P2 exhibits both a missed activation and an unwanted one.\n"},{"path":"tests\/check.py","content":"\"\"\"Check a saved agent answer locally with Python 3 (standard library only).\"\"\"\nimport json\nimport math\nimport sys\nfrom pathlib import Path\n\n\ndef compare(expected, actual, path=\"$\", accepted=None):\n    if isinstance(expected, bool) or isinstance(actual, bool):\n        if expected is not actual:\n            yield path\n    elif isinstance(expected, (int, float)) and isinstance(actual, (int, float)):\n        if not math.isclose(expected, actual, rel_tol=0, abs_tol=1e-8):\n            yield path\n    elif isinstance(expected, dict) and isinstance(actual, dict):\n        for key in sorted(set(expected) | set(actual)):\n            if key not in expected or key not in actual:\n                yield f\"{path}.{key}\"\n            elif not any(\n                not list(compare(option, actual[key]))\n                for option in (accepted or {}).get(key, [])\n            ):\n                yield from compare(expected[key], actual[key], f\"{path}.{key}\")\n    elif isinstance(expected, list) and isinstance(actual, list):\n        if len(expected) != len(actual):\n            yield f\"{path} (length)\"\n        for i, (left, right) in enumerate(zip(expected, actual)):\n            yield from compare(left, right, f\"{path}[{i}]\")\n    elif type(expected) != type(actual) or expected != actual:\n        yield path\n\n\ndef main():\n    if len(sys.argv) != 3:\n        raise SystemExit(\"Usage: python3 check.py expected.json answer.json\")\n    try:\n        expected, actual = [json.loads(Path(p).read_text(encoding=\"utf-8\")) for p in sys.argv[1:]]\n        alternatives = Path(sys.argv[1]).with_name(\"accepted.json\")\n        accepted = json.loads(alternatives.read_text(encoding=\"utf-8\")) if alternatives.is_file() else {}\n    except (ValueError, OSError) as error:\n        raise SystemExit(str(error))\n    differences = list(compare(expected, actual, accepted=accepted))\n    if differences:\n        raise SystemExit(\"Different fields: \" + \", \".join(differences))\n    print(\"Pass\")\n\n\nif __name__ == \"__main__\":\n    main()\n"},{"path":"tests\/README.md","content":"Give your agent SKILL.md and one request.txt in a fresh session. Keep the expected answer aside. Save the reply as answer.json, then run this from the tests folder:\n\n    python3 check.py case-1\/expected.json answer.json\n\nEach case also has an explanation. Where accepted.json exists, the checker accepts the alternatives listed there.\n"},{"path":"tests\/case-1\/request.txt","content":"Grade each routing trace. Brackets show sets of skill slugs; braces separate accepted alternatives.\nReturn only the JSON specified in SKILL.md for this test.\n\nP1 'Have we paid this supplier bill?' accept [bank-match]; trace [bank-match,invoice-check].\nP2 'Did the tradesperson charge what we agreed?' accept [invoice-check]; trace [bank-match].\nP3 'Write a thank-you note' accept []; trace [] (captured).\n"},{"path":"tests\/case-1\/expected.json","content":"{\n    \"prompts\": [\n        {\n            \"id\": \"P1\",\n            \"result\": \"mismatch\",\n            \"missing\": [],\n            \"extra\": [\n                \"invoice-check\"\n            ]\n        },\n        {\n            \"id\": \"P2\",\n            \"result\": \"mismatch\",\n            \"missing\": [\n                \"invoice-check\"\n            ],\n            \"extra\": [\n                \"bank-match\"\n            ]\n        },\n        {\n            \"id\": \"P3\",\n            \"result\": \"pass\",\n            \"missing\": [],\n            \"extra\": []\n        }\n    ],\n    \"passed\": 1,\n    \"observed\": 3\n}\n"},{"path":"tests\/case-1\/explanation.txt","content":"P1 found the right skill but unnecessarily loaded another. P2 exhibits both a missed activation and an unwanted one.\n"},{"path":"tests\/case-2\/request.txt","content":"Score these against the declared acceptable routes.\nReturn only the JSON specified in SKILL.md for this test.\n\nQ1 accept [sheet-compare] OR [csv-compare]; trace [csv-compare].\nQ2 accept [sheet-compare,csv-clean]; trace missing (recorder offline).\nQ3 accept [csv-clean,sheet-compare]; trace [sheet-compare,csv-clean].\n"},{"path":"tests\/case-2\/expected.json","content":"{\n    \"prompts\": [\n        {\n            \"id\": \"Q1\",\n            \"result\": \"pass\",\n            \"missing\": [],\n            \"extra\": []\n        },\n        {\n            \"id\": \"Q2\",\n            \"result\": \"unobserved\",\n            \"missing\": [],\n            \"extra\": []\n        },\n        {\n            \"id\": \"Q3\",\n            \"result\": \"pass\",\n            \"missing\": [],\n            \"extra\": []\n        }\n    ],\n    \"passed\": 2,\n    \"observed\": 2\n}\n"},{"path":"tests\/case-2\/explanation.txt","content":"Q1 has two permissible implementations. Q2 provides no observation to grade.\n"}],"is_active":true,"is_approved":false}]}]}