[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6PSDXG1FPHJ8W541XF60EP2":3,"skill-same:01M6PSDXG1FPHJ8W541XF60EP2":121},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":14,"repositoryHtmlUrl":57,"repositoryHomepageUrl":6,"ownerHtmlUrl":58,"ownerBlogUrl":59,"ownerDescription":6,"updatedAt":60,"install":61,"resources":74},"01M6PSDXG1FPHJ8W541XF60EP2","tao-route-visual-changenet-samples",null,"Routes the weakest VCN samples (output of `tao-analyze-gaps-visual-changenet`) into per-augmentation-module subsets — one parquet for k-NN mining, one for AnomalyGen (Cosmos SDG) — based on each module's label eligibility. Use as the immediate next step after DEFT gap analysis in a VCN AOI SDA iteration.","headmktlucca-ui\u002Fneuroads-lp","headmktlucca-ui","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F247379838?v=4","01M6PDVAV6M1W96D1SR1PDF8CS","NeuroAds","01M6PDVAZ4P281GNDKD45CYTF5",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftao-route-visual-changenet-samples\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"tao route visual changenet samples","changenet","route","visual","tao","as","sda","for","standalone","K-NN","gap analysis","cosmos","NVIDIA","module","runtime","iteration","requirements","use","Bash","analysis","2026-11-10 10:12:30",false,"---\nname: tao-route-visual-changenet-samples\ndescription: Routes the weakest VCN samples (output of `tao-analyze-gaps-visual-changenet`) into per-augmentation-module\n  subsets — one parquet for k-NN mining, one for AnomalyGen (Cosmos SDG) — based on each module's label eligibility. Use as the\n  immediate next step after DEFT gap analysis in a VCN AOI SDA iteration.\nlicense: Apache-2.0\ncompatibility: Standalone — no external runtime requirements.\nmetadata:\n  author: NVIDIA Corporation\n  version: \"0.1.0\"\nallowed-tools: Read Bash\ntags:\n- data\n- routing\n- vcn\n- aoi\n- sda\n---\n\n# TAO VCN Sample Routing Skill\n\nYou are the dispatcher between gap analysis and the augmentation modules in a VCN AOI SDA pipeline. Each augmentation module can only act on labels it knows how to handle:\n\n- **k-NN Mining** can only mine real-image neighbors for labels that already exist in the **source pool CSV**. There is no point looking for `SHIFT` neighbors if the pool has no `SHIFT` rows.\n- **AnomalyGen** (Cosmos SDG) can only generate synthetic anomalies for the classes its inference pipeline supports: `PASS`, `EXCESS_SOLDER`, `MISSING`, `BRIDGE`. A weak sample with a label outside this set is unroutable to AnomalyGen.\n\nThis skill runs **once per SDA iteration immediately after gap analysis**. It splits the gap-analysis parquet into one filtered parquet per module so each module operates on its own eligible subset, and it writes a human-readable summary of the per-label routing decisions.\n\nThe work is intentionally trivial: read a parquet, do two `.isin(...)` filters, write two parquets, write one summary. The skill exists to make those decisions auditable — every label must show up in the summary with a yes\u002Fno verdict for each module so a downstream reviewer can spot when a label is silently dropped because no module accepted it.\n\n---\n\n## Inputs\n\n1. **`gaps_parquet`** — the gap-analysis output (typically `\u003Cexp_dir>\u002Frca_results\u002F\u003Ctimestamp>\u002Fgaps.parquet` from `tao-analyze-gaps-visual-changenet`). Required columns: `filepath`, `label`. Other columns (`siamese_score`, `weakness`) are preserved verbatim.\n2. **`source_pool_csv`** — VCN-format mining source pool CSV with a `label` column. Empty string or non-existent path is allowed; the mining subset will simply be empty in that case.\n3. **Output directory** — where the two routed parquets, the summary, and the report are written. Default: a timestamped folder under the gap-analysis result directory: `\u003Crca_result_dir>\u002Frouting_results\u002F\u003Ctimestamp>\u002F`.\n4. **`anomalygen_supported_labels`** *(optional)* — override the default AnomalyGen-eligible label set. Default: `{\"PASS\", \"EXCESS_SOLDER\", \"MISSING\", \"BRIDGE\"}`. **Warning:** This must stay in sync with `ANOMALYGEN_SUPPORTED_LABELS` in `mdo-kratos-workflows\u002Fpipelines\u002Fsda\u002Frouting.py` and the AnomalyGen integration's actual generator coverage. Adding a new defect class to AnomalyGen means adding it here too.\n\n---\n\n## Method\n\nThe whole skill is two `.isin(...)` masks against the uppercased label column.\n\n### Step 1 — Load and uppercase\n\n```python\ndf = pd.read_parquet(gaps_parquet)\nlabels_upper = df[\"label\"].astype(str).str.upper()\n```\n\nThe match is **case-insensitive** for both module checks. The original `label` column is preserved unchanged in the output parquets — only the comparison key is uppercased.\n\n### Step 2 — Mining subset\n\n```python\nif source_pool_csv and os.path.isfile(source_pool_csv):\n    pool_df = pd.read_csv(source_pool_csv)\n    pool_labels = {str(l).upper() for l in pool_df[\"label\"].unique()}\n    mn_mask = labels_upper.isin(pool_labels)\n    mn_df = df[mn_mask]\nelse:\n    pool_missing = True\n    pool_labels = set()\n    mn_df = df.iloc[0:0]   # empty, but with the same schema\nmn_df.to_parquet(mining_gaps_parquet, index=False)\n```\n\nIf the pool CSV is missing or empty, the mining subset is an empty DataFrame **with the same columns as the input** so downstream readers don't crash on schema mismatch. Flag this case in the summary.\n\n### Step 3 — AnomalyGen subset\n\n```python\nANOMALYGEN_SUPPORTED = {\"PASS\", \"EXCESS_SOLDER\", \"MISSING\", \"BRIDGE\"}\nag_mask = labels_upper.isin(ANOMALYGEN_SUPPORTED)\nag_df = df[ag_mask]\nag_df.to_parquet(anomalygen_gaps_parquet, index=False)\n```\n\nRows whose label is in the AnomalyGen-supported set are written verbatim to `anomalygen_gaps.parquet`. The schema matches the input parquet exactly — downstream AnomalyGen (Cosmos SDG) needs no other changes.\n\n### Step 4 — Per-label routing breakdown\n\nFor every distinct label in the input gaps parquet (uppercased), record:\n- `count` — how many rows have this label\n- `mining` — yes if the label is in `pool_labels`, otherwise no\n- `anomalygen` — yes if the label is in `ANOMALYGEN_SUPPORTED`, otherwise no\n\nA label can route to **both** modules (e.g. PASS rows route to AnomalyGen, and if the source pool also contains PASS rows they route to Mining too). A label can also route to **none** — flag those, since they are silently dropped and may signal a configuration mismatch.\n\nWrite the breakdown to `routing_summary.txt`. The format mirrors the reference component exactly:\n\n```\nWeak-sample routing summary\nTotal weak samples: \u003CN>\nMining subset:      \u003CN_mn> -> \u003Cmining_gaps_parquet>\nAnomalyGen subset:  \u003CN_ag> -> \u003Canomalygen_gaps_parquet>\n\n[If pool missing:]\nNo source pool CSV at '\u003Cpath>'; mining subset is empty.\n\nPer-label breakdown (count, mining, anomalygen):\n  PASS: 50 (mining=yes, anomalygen=yes)\n  MISSING: 32 (mining=no, anomalygen=yes)\n  SHIFT: 14 (mining=yes, anomalygen=no)\n  EXCESS_SOLDER: 9 (mining=yes, anomalygen=yes)\n  ...\n```\n\n### Step 5 — Sanity checks\n\nAfter both subsets are written, verify:\n- The sum of subset sizes is *not* required to equal `len(df)` — overlap is allowed (a label can route to both modules). What matters is that **every input row appears in at least one subset, OR appears in the \"none\" list with an explicit reason**.\n- If `len(mn_df) == 0` and `len(ag_df) == 0`, something is wrong — flag prominently in the report.\n- If an entire label group routes to no module, the `Recommended Actions` section must call this out so the user can either seed the source pool with that label or extend AnomalyGen's supported set.\n\n---\n\n## Reference Python Recipe\n\nThis is the exact computation, lifted from `mdo-kratos-workflows\u002Fpipelines\u002Fsda\u002Frouting.py`. Run as a single Python script via Bash; it produces every artifact except the report.\n\n```python\nimport os\nimport pandas as pd\n\nANOMALYGEN_SUPPORTED = {\"PASS\", \"EXCESS_SOLDER\", \"MISSING\", \"BRIDGE\"}\n\ndf = pd.read_parquet(gaps_parquet)\nlabels_upper = df[\"label\"].astype(str).str.upper()\n\n# Mining subset\npool_missing = False\nif source_pool_csv and os.path.isfile(source_pool_csv):\n    pool_df = pd.read_csv(source_pool_csv)\n    pool_labels = {str(l).upper() for l in pool_df[\"label\"].unique()}\n    mn_mask = labels_upper.isin(pool_labels)\n    mn_df = df[mn_mask]\nelse:\n    pool_missing = True\n    pool_labels = set()\n    mn_df = df.iloc[0:0]\nos.makedirs(os.path.dirname(mining_gaps_parquet) or \".\", exist_ok=True)\nmn_df.to_parquet(mining_gaps_parquet, index=False)\n\n# AnomalyGen subset\nag_mask = labels_upper.isin(ANOMALYGEN_SUPPORTED)\nag_df = df[ag_mask]\nos.makedirs(os.path.dirname(anomalygen_gaps_parquet) or \".\", exist_ok=True)\nag_df.to_parquet(anomalygen_gaps_parquet, index=False)\n\n# Per-label breakdown\nsummary_lines = [\n    \"Weak-sample routing summary\",\n    f\"Total weak samples: {len(df)}\",\n    f\"Mining subset:      {len(mn_df)} -> {mining_gaps_parquet}\",\n    f\"AnomalyGen subset:  {len(ag_df)} -> {anomalygen_gaps_parquet}\",\n    \"\",\n]\nif pool_missing:\n    summary_lines.append(f\"No source pool CSV at {source_pool_csv!r}; mining subset is empty.\")\n    summary_lines.append(\"\")\nsummary_lines.append(\"Per-label breakdown (count, mining, anomalygen):\")\nlabel_counts = labels_upper.value_counts()\nfor label, count in label_counts.items():\n    in_mn = (not pool_missing) and label in pool_labels\n    in_ag = label in ANOMALYGEN_SUPPORTED\n    summary_lines.append(\n        f\"  {label}: {count} \"\n        f\"(mining={'yes' if in_mn else 'no'}, \"\n        f\"anomalygen={'yes' if in_ag else 'no'})\"\n    )\nsummary_text = \"\\n\".join(summary_lines) + \"\\n\"\n\nos.makedirs(logs_dir, exist_ok=True)\nwith open(os.path.join(logs_dir, \"routing_summary.txt\"), \"w\", encoding=\"utf-8\") as f:\n    f.write(summary_text)\nprint(summary_text.strip())\n```\n\n---\n\n## Outputs\n\nWrite everything into a timestamped folder. The packaging hook will copy `routing_config\u002F` and `claude_session.jsonl` automatically when `Routing_Report.md` is written.\n\n```\n\u003Coutput_dir>\u002Frouting_results\u002FYYYY-MM-DD_HHMMSS\u002F\n├── Routing_Report.md           # Full routing report\n├── mining_gaps.parquet         # Subset routed to k-NN Mining\n├── anomalygen_gaps.parquet     # Subset routed to AnomalyGen (Cosmos SDG)\n├── routing_summary.txt         # Plain-text per-label breakdown\n├── routing_config\u002F             # Auto-copied by hook\n└── claude_session.jsonl        # Auto-copied by hook\n```\n\nAt the start of the run, get the real timestamp by running `date +%Y-%m-%d_%H%M%S` in Bash. If the user specifies a custom output path, use it directly but maintain the internal layout.\n\n---\n\n## Report Structure\n\nKeep the report short (400–800 words). Routing is a deterministic decision; the value is making the decisions auditable, not narrative.\n\n```\n# VCN Routing Report: \u003CIteration \u002F Experiment Name>\n\n## 1. Verdict\n- Total weak samples in: \u003CN>\n- Mining subset:     \u003CN_mn> rows  →  `mining_gaps.parquet`\n- AnomalyGen subset: \u003CN_ag> rows  →  `anomalygen_gaps.parquet`\n- Source pool present? \u003Cyes\u002Fno — and the path>\n- One-line headline: \"\u003CX> labels routed, \u003CY> labels dropped (no module accepted)\"\n\n## 2. Inputs\n| Input | Path | Notes |\n|-------|------|-------|\n| gaps_parquet     | … | rows=\u003CN>, columns=\u003Ccol list> |\n| source_pool_csv  | … | rows=\u003CM> or \"not provided\" \u002F \"missing\" |\n\n## 3. Per-Label Routing Decisions\n| Label | Count in gaps | In source pool? | Mining? | AnomalyGen? | Routed To |\n|-------|----------------|------------------|----------|--------------|-----------|\n\n(One row per distinct label in `gaps_parquet`, uppercased. `Routed To` is one of:\n`mining only`, `anomalygen only`, `mining+anomalygen`, `neither (DROPPED)`.\nUse `neither (DROPPED)` whenever no module accepted the label. Sort by count descending.)\n\n## 4. Module-Level Summaries\n### 4.1 k-NN Mining\n- Pool labels (from source_pool_csv): \u003Clist, or \"pool missing\">\n- Labels accepted from input: \u003Clist>\n- Total rows routed: \u003CN_mn>\n- Per-label row counts: \u003Cbreakdown>\n\n### 4.2 AnomalyGen (Cosmos SDG)\n- Eligible labels (configured): PASS, EXCESS_SOLDER, MISSING, BRIDGE\n- Labels accepted from input: \u003Clist>\n- Total rows routed: \u003CN_ag>\n- Per-label row counts: \u003Cbreakdown>\n\n## 5. Dropped Labels (routed to NEITHER module)\n| Label | Count | Why dropped | Suggested fix |\n|-------|-------|-------------|----------------|\n\n(Empty table is OK and means no labels were dropped. If non-empty, every row needs a\n\"why\" — typically one of: \"not in source pool AND not in AnomalyGen supported set\",\n\"source pool missing entirely AND label not in AnomalyGen set\", \"label name doesn't\nmatch any module's expected canonicalization\".)\n\n## 6. Recommended Actions\n1. **If any labels are dropped**: seed the source pool with that label, OR extend\n   `ANOMALYGEN_SUPPORTED_LABELS` (and the AnomalyGen generator coverage).\n2. **If source pool is missing**: provide `source_pool_csv` to enable the Mining branch.\n   Without it, half of the augmentation pipeline is dark.\n3. **If AnomalyGen subset is empty**: gap analysis only surfaced labels AnomalyGen cannot\n   generate; rely on Mining for this iteration, or extend the AnomalyGen integration.\n4. **If both subsets are empty**: stop the SDA iteration. Nothing downstream can run.\n```\n\n---\n\n## Execution Order\n\n1. Run `date +%Y-%m-%d_%H%M%S` to get the timestamp; create `\u003Coutput_dir>\u002Frouting_results\u002F\u003Ctimestamp>\u002F`.\n2. Run the Python recipe (Steps 1–4) to produce `mining_gaps.parquet`, `anomalygen_gaps.parquet`, and `routing_summary.txt`. Print summary stats to stdout so the script-check hook can verify it ran.\n3. Build the per-label decision table by reading both parquets and computing the routed-to verdict per label.\n4. Write `Routing_Report.md` last — writing it triggers the packaging hook, which copies session logs and skill config alongside.\n","# TAO VCN Sample Routing Skill\n\nYou are the dispatcher between gap analysis and the augmentation modules in a VCN AOI SDA pipeline. Each augmentation module can only act on labels it knows how to handle:\n\n- **k-NN Mining** can only mine real-image neighbors for labels that already exist in the **source pool CSV**. There is no point looking for `SHIFT` neighbors if the pool has no `SHIFT` rows.\n- **AnomalyGen** (Cosmos SDG) can only generate synthetic anomalies for the classes its inference pipeline supports: `PASS`, `EXCESS_SOLDER`, `MISSING`, `BRIDGE`. A weak sample with a label outside this set is unroutable to AnomalyGen.\n\nThis skill runs **once per SDA iteration immediately after gap analysis**. It splits the gap-analysis parquet into one filtered parquet per module so each module operates on its own eligible subset, and it writes a human-readable summary of the per-label routing decisions.\n\nThe work is intentionally trivial: read a parquet, do two `.isin(...)` filters, write two parquets, write one summary. The skill exists to make those decisions auditable — every label must show up in the summary with a yes\u002Fno verdict for each module so a downstream reviewer can spot when a label is silently dropped because no module accepted it.\n\n---\n\n## Inputs\n\n1. **`gaps_parquet`** — the gap-analysis output (typically `\u003Cexp_dir>\u002Frca_results\u002F\u003Ctimestamp>\u002Fgaps.parquet` from `tao-analyze-gaps-visual-changenet`). Required columns: `filepath`, `label`. Other columns (`siamese_score`, `weakness`) are preserved verbatim.\n2. **`source_pool_csv`** — VCN-format mining source pool CSV with a `label` column. Empty string or non-existent path is allowed; the mining subset will simply be empty in that case.\n3. **Output directory** — where the two routed parquets, the summary, and the report are written. Default: a timestamped folder under the gap-analysis result directory: `\u003Crca_result_dir>\u002Frouting_results\u002F\u003Ctimestamp>\u002F`.\n4. **`anomalygen_supported_labels`** *(optional)* — override the default AnomalyGen-eligible label set. Default: `{\"PASS\", \"EXCESS_SOLDER\", \"MISSING\", \"BRIDGE\"}`. **Warning:** This must stay in sync with `ANOMALYGEN_SUPPORTED_LABELS` in `mdo-kratos-workflows\u002Fpipelines\u002Fsda\u002Frouting.py` and the AnomalyGen integration's actual generator coverage. Adding a new defect class to AnomalyGen means adding it here too.\n\n---\n\n## Method\n\nThe whole skill is two `.isin(...)` masks against the uppercased label column.\n\n### Step 1 — Load and uppercase\n\n```python\ndf = pd.read_parquet(gaps_parquet)\nlabels_upper = df[\"label\"].astype(str).str.upper()\n```\n\nThe match is **case-insensitive** for both module checks. The original `label` column is preserved unchanged in the output parquets — only the comparison key is uppercased.\n\n### Step 2 — Mining subset\n\n```python\nif source_pool_csv and os.path.isfile(source_pool_csv):\n    pool_df = pd.read_csv(source_pool_csv)\n    pool_labels = {str(l).upper() for l in pool_df[\"label\"].unique()}\n    mn_mask = labels_upper.isin(pool_labels)\n    mn_df = df[mn_mask]\nelse:\n    pool_missing = True\n    pool_labels = set()\n    mn_df = df.iloc[0:0]   # empty, but with the same schema\nmn_df.to_parquet(mining_gaps_parquet, index=False)\n```\n\nIf the pool CSV is missing or empty, the mining subset is an empty DataFrame **with the same columns as the input** so downstream readers don't crash on schema mismatch. Flag this case in the summary.\n\n### Step 3 — AnomalyGen subset\n\n```python\nANOMALYGEN_SUPPORTED = {\"PASS\", \"EXCESS_SOLDER\", \"MISSING\", \"BRIDGE\"}\nag_mask = labels_upper.isin(ANOMALYGEN_SUPPORTED)\nag_df = df[ag_mask]\nag_df.to_parquet(anomalygen_gaps_parquet, index=False)\n```\n\nRows whose label is in the AnomalyGen-supported set are written verbatim to `anomalygen_gaps.parquet`. The schema matches the input parquet exactly — downstream AnomalyGen (Cosmos SDG) needs no other changes.\n\n### Step 4 — Per-label routing breakdown\n\nFor every distinct label in the input gaps parquet (uppercased), record:\n- `count` — how many rows have this label\n- `mining` — yes if the label is in `pool_labels`, otherwise no\n- `anomalygen` — yes if the label is in `ANOMALYGEN_SUPPORTED`, otherwise no\n\nA label can route to **both** modules (e.g. PASS rows route to AnomalyGen, and if the source pool also contains PASS rows they route to Mining too). A label can also route to **none** — flag those, since they are silently dropped and may signal a configuration mismatch.\n\nWrite the breakdown to `routing_summary.txt`. The format mirrors the reference component exactly:\n\n```\nWeak-sample routing summary\nTotal weak samples: \u003CN>\nMining subset:      \u003CN_mn> -> \u003Cmining_gaps_parquet>\nAnomalyGen subset:  \u003CN_ag> -> \u003Canomalygen_gaps_parquet>\n\n[If pool missing:]\nNo source pool CSV at '\u003Cpath>'; mining subset is empty.\n\nPer-label breakdown (count, mining, anomalygen):\n  PASS: 50 (mining=yes, anomalygen=yes)\n  MISSING: 32 (mining=no, anomalygen=yes)\n  SHIFT: 14 (mining=yes, anomalygen=no)\n  EXCESS_SOLDER: 9 (mining=yes, anomalygen=yes)\n  ...\n```\n\n### Step 5 — Sanity checks\n\nAfter both subsets are written, verify:\n- The sum of subset sizes is *not* required to equal `len(df)` — overlap is allowed (a label can route to both modules). What matters is that **every input row appears in at least one subset, OR appears in the \"none\" list with an explicit reason**.\n- If `len(mn_df) == 0` and `len(ag_df) == 0`, something is wrong — flag prominently in the report.\n- If an entire label group routes to no module, the `Recommended Actions` section must call this out so the user can either seed the source pool with that label or extend AnomalyGen's supported set.\n\n---\n\n## Reference Python Recipe\n\nThis is the exact computation, lifted from `mdo-kratos-workflows\u002Fpipelines\u002Fsda\u002Frouting.py`. Run as a single Python script via Bash; it produces every artifact except the report.\n\n```python\nimport os\nimport pandas as pd\n\nANOMALYGEN_SUPPORTED = {\"PASS\", \"EXCESS_SOLDER\", \"MISSING\", \"BRIDGE\"}\n\ndf = pd.read_parquet(gaps_parquet)\nlabels_upper = df[\"label\"].astype(str).str.upper()\n\n# Mining subset\npool_missing = False\nif source_pool_csv and os.path.isfile(source_pool_csv):\n    pool_df = pd.read_csv(source_pool_csv)\n    pool_labels = {str(l).upper() for l in pool_df[\"label\"].unique()}\n    mn_mask = labels_upper.isin(pool_labels)\n    mn_df = df[mn_mask]\nelse:\n    pool_missing = True\n    pool_labels = set()\n    mn_df = df.iloc[0:0]\nos.makedirs(os.path.dirname(mining_gaps_parquet) or \".\", exist_ok=True)\nmn_df.to_parquet(mining_gaps_parquet, index=False)\n\n# AnomalyGen subset\nag_mask = labels_upper.isin(ANOMALYGEN_SUPPORTED)\nag_df = df[ag_mask]\nos.makedirs(os.path.dirname(anomalygen_gaps_parquet) or \".\", exist_ok=True)\nag_df.to_parquet(anomalygen_gaps_parquet, index=False)\n\n# Per-label breakdown\nsummary_lines = [\n    \"Weak-sample routing summary\",\n    f\"Total weak samples: {len(df)}\",\n    f\"Mining subset:      {len(mn_df)} -> {mining_gaps_parquet}\",\n    f\"AnomalyGen subset:  {len(ag_df)} -> {anomalygen_gaps_parquet}\",\n    \"\",\n]\nif pool_missing:\n    summary_lines.append(f\"No source pool CSV at {source_pool_csv!r}; mining subset is empty.\")\n    summary_lines.append(\"\")\nsummary_lines.append(\"Per-label breakdown (count, mining, anomalygen):\")\nlabel_counts = labels_upper.value_counts()\nfor label, count in label_counts.items():\n    in_mn = (not pool_missing) and label in pool_labels\n    in_ag = label in ANOMALYGEN_SUPPORTED\n    summary_lines.append(\n        f\"  {label}: {count} \"\n        f\"(mining={'yes' if in_mn else 'no'}, \"\n        f\"anomalygen={'yes' if in_ag else 'no'})\"\n    )\nsummary_text = \"\\n\".join(summary_lines) + \"\\n\"\n\nos.makedirs(logs_dir, exist_ok=True)\nwith open(os.path.join(logs_dir, \"routing_summary.txt\"), \"w\", encoding=\"utf-8\") as f:\n    f.write(summary_text)\nprint(summary_text.strip())\n```\n\n---\n\n## Outputs\n\nWrite everything into a timestamped folder. The packaging hook will copy `routing_config\u002F` and `claude_session.jsonl` automatically when `Routing_Report.md` is written.\n\n```\n\u003Coutput_dir>\u002Frouting_results\u002FYYYY-MM-DD_HHMMSS\u002F\n├── Routing_Report.md           # Full routing report\n├── mining_gaps.parquet         # Subset routed to k-NN Mining\n├── anomalygen_gaps.parquet     # Subset routed to AnomalyGen (Cosmos SDG)\n├── routing_summary.txt         # Plain-text per-label breakdown\n├── routing_config\u002F             # Auto-copied by hook\n└── claude_session.jsonl        # Auto-copied by hook\n```\n\nAt the start of the run, get the real timestamp by running `date +%Y-%m-%d_%H%M%S` in Bash. If the user specifies a custom output path, use it directly but maintain the internal layout.\n\n---\n\n## Report Structure\n\nKeep the report short (400–800 words). Routing is a deterministic decision; the value is making the decisions auditable, not narrative.\n\n```\n# VCN Routing Report: \u003CIteration \u002F Experiment Name>\n\n## 1. Verdict\n- Total weak samples in: \u003CN>\n- Mining subset:     \u003CN_mn> rows  →  `mining_gaps.parquet`\n- AnomalyGen subset: \u003CN_ag> rows  →  `anomalygen_gaps.parquet`\n- Source pool present? \u003Cyes\u002Fno — and the path>\n- One-line headline: \"\u003CX> labels routed, \u003CY> labels dropped (no module accepted)\"\n\n## 2. Inputs\n| Input | Path | Notes |\n|-------|------|-------|\n| gaps_parquet     | … | rows=\u003CN>, columns=\u003Ccol list> |\n| source_pool_csv  | … | rows=\u003CM> or \"not provided\" \u002F \"missing\" |\n\n## 3. Per-Label Routing Decisions\n| Label | Count in gaps | In source pool? | Mining? | AnomalyGen? | Routed To |\n|-------|----------------|------------------|----------|--------------|-----------|\n\n(One row per distinct label in `gaps_parquet`, uppercased. `Routed To` is one of:\n`mining only`, `anomalygen only`, `mining+anomalygen`, `neither (DROPPED)`.\nUse `neither (DROPPED)` whenever no module accepted the label. Sort by count descending.)\n\n## 4. Module-Level Summaries\n### 4.1 k-NN Mining\n- Pool labels (from source_pool_csv): \u003Clist, or \"pool missing\">\n- Labels accepted from input: \u003Clist>\n- Total rows routed: \u003CN_mn>\n- Per-label row counts: \u003Cbreakdown>\n\n### 4.2 AnomalyGen (Cosmos SDG)\n- Eligible labels (configured): PASS, EXCESS_SOLDER, MISSING, BRIDGE\n- Labels accepted from input: \u003Clist>\n- Total rows routed: \u003CN_ag>\n- Per-label row counts: \u003Cbreakdown>\n\n## 5. Dropped Labels (routed to NEITHER module)\n| Label | Count | Why dropped | Suggested fix |\n|-------|-------|-------------|----------------|\n\n(Empty table is OK and means no labels were dropped. If non-empty, every row needs a\n\"why\" — typically one of: \"not in source pool AND not in AnomalyGen supported set\",\n\"source pool missing entirely AND label not in AnomalyGen set\", \"label name doesn't\nmatch any module's expected canonicalization\".)\n\n## 6. Recommended Actions\n1. **If any labels are dropped**: seed the source pool with that label, OR extend\n   `ANOMALYGEN_SUPPORTED_LABELS` (and the AnomalyGen generator coverage).\n2. **If source pool is missing**: provide `source_pool_csv` to enable the Mining branch.\n   Without it, half of the augmentation pipeline is dark.\n3. **If AnomalyGen subset is empty**: gap analysis only surfaced labels AnomalyGen cannot\n   generate; rely on Mining for this iteration, or extend the AnomalyGen integration.\n4. **If both subsets are empty**: stop the SDA iteration. Nothing downstream can run.\n```\n\n---\n\n## Execution Order\n\n1. Run `date +%Y-%m-%d_%H%M%S` to get the timestamp; create `\u003Coutput_dir>\u002Frouting_results\u002F\u003Ctimestamp>\u002F`.\n2. Run the Python recipe (Steps 1–4) to produce `mining_gaps.parquet`, `anomalygen_gaps.parquet`, and `routing_summary.txt`. Print summary stats to stdout so the script-check hook can verify it ran.\n3. Build the per-label decision table by reading both parquets and computing the routed-to verdict per label.\n4. Write `Routing_Report.md` last — writing it triggers the packaging hook, which copies session logs and skill config alongside.\n",{"name":5,"tags":44,"license":15,"metadata":49,"description":7,"allowed-tools":52,"compatibility":53},[45,46,47,48,25],"data","routing","vcn","aoi",{"author":50,"version":51},"NVIDIA Corporation","0.1.0","Read Bash","Standalone — no external runtime requirements.","main","7a940b8e5af16c95e5c190a524421d32fc7445a9",".claude\u002Fskills\u002Ftao-route-visual-changenet-samples","https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp","https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui","https:\u002F\u002Fneuroads.com.br","2026-08-12 00:42:44",{"source":8,"skillName":5,"commands":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add headmktlucca-ui\u002Fneuroads-lp --skill tao-route-visual-changenet-samples",{"tool":67,"command":68},"bunx","bunx skills add headmktlucca-ui\u002Fneuroads-lp --skill tao-route-visual-changenet-samples",{"tool":70,"command":71},"pnpm","pnpm dlx skills add headmktlucca-ui\u002Fneuroads-lp --skill tao-route-visual-changenet-samples","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftao-route-visual-changenet-samples\u002FSKILL.md",true,[75,81,85,91,95,99,103,107,111,115],{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"BENCHMARK.md","REFERENCE","参考文档",4583,"https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftao-route-visual-changenet-samples\u002FBENCHMARK.md",{"path":82,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":83,"sourceHtmlUrl":84},"evals\u002Fevals.json",873,"https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fevals\u002Fevals.json",{"path":86,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":89,"sourceHtmlUrl":90},"hooks\u002F_parse-stdin.sh","SCRIPT","脚本",1471,"https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002F_parse-stdin.sh",{"path":92,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":93,"sourceHtmlUrl":94},"hooks\u002Frouting-artifacts-check.sh",3595,"https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-artifacts-check.sh",{"path":96,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":97,"sourceHtmlUrl":98},"hooks\u002Frouting-coverage-check.sh",2893,"https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-coverage-check.sh",{"path":100,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":101,"sourceHtmlUrl":102},"hooks\u002Frouting-package.sh",2544,"https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-package.sh",{"path":104,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":105,"sourceHtmlUrl":106},"hooks\u002Frouting-script-check.sh",3173,"https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-script-check.sh",{"path":108,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":109,"sourceHtmlUrl":110},"hooks\u002Frouting-section-check.sh",3462,"https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fhooks\u002Frouting-section-check.sh",{"path":112,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":113,"sourceHtmlUrl":114},"skill-card.md",3748,"https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fskill-card.md",{"path":116,"resourceType":117,"resourceTypeDesc":118,"sizeBytes":119,"sourceHtmlUrl":120},"skill.oms.sig","OTHER","其他",6057,"https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftao-route-visual-changenet-samples\u002Fskill.oms.sig",[122,148,172,198,216,251],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":126,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":137,"publishedAt":39},"01M6PTDCZTXTGSTX4RFK901YSZ","xunit-skill","Generates xUnit.net tests in C#. Covers Fact\u002FTheory, constructor injection, IClassFixture, and FluentAssertions. Use when user mentions \"xUnit\", \"[Fact]\", \"[Theory]\", \"Assert.Equal\", \"C# xUnit\". Triggers on: \"xUnit\", \"[Fact]\", \"[Theory]\", \"Assert.Equal C#\", \"xUnit.net\".","MIT","https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fxunit-skill\u002FSKILL.md",[129,134],{"categoryNo":130,"categoryName":131,"taxonomyType":132,"taxonomyTypeDesc":133},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":135,"categoryName":136,"taxonomyType":132,"taxonomyTypeDesc":133},"01JBSEEDCAT000000000000023","Skill与智能体开发",[138,139,140,141,142,36,143,144,145,146,147],"xunit","xunit skill","testing","injection","user","tests","triggers","unit","unit-testing","C#",{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":126,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":156,"publishedAt":39},"01M6PTCB59ZTG5FTMWGPYEMMBP","xcuitest-skill","Generates XCUITest UI tests for iOS\u002FiPadOS apps in Swift. Apple's native testing framework for reliable, fast UI automation. Supports local simulators and TestMu AI cloud real devices. Use when user mentions \"XCUITest\", \"XCTest\", \"iOS UI test\", \"Swift test\", \"XCUIApplication\". Triggers on: \"XCUITest\", \"XCTest UI\", \"iOS UI test\", \"Swift UI test\", \"XCUIApplication\", \"TestMu\".","https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fxcuitest-skill\u002FSKILL.md",[154,155],{"categoryNo":130,"categoryName":131,"taxonomyType":132,"taxonomyTypeDesc":133},{"categoryNo":135,"categoryName":136,"taxonomyType":132,"taxonomyTypeDesc":133},[157,158,140,159,160,161,162,163,36,164,165,166,167,168,143,144,169,170,26,171],"xcuitest","xcuitest skill","automation","test","testing framework","ios","devices","mobile","mobile-testing","ui test","local","apple","apps","native","objective",{"skillNo":173,"name":174,"nameZh":6,"description":175,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":126,"licenseFileUrl":6,"sourceHtmlUrl":176,"categories":177,"keywords":182,"publishedAt":39},"01M6PTATMNTY9NF4J7KSR76YK6","world-builder","Create and manage generative game zones for Dorothy's Pokemon-style world. Use this skill when creating, updating, or designing game worlds via MCP tools.","https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fworld-builder\u002FSKILL.md",[178,181],{"categoryNo":179,"categoryName":180,"taxonomyType":132,"taxonomyTypeDesc":133},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":135,"categoryName":136,"taxonomyType":132,"taxonomyTypeDesc":133},[183,184,185,186,187,188,189,190,36,191,192,193,194,195,196,26,197],"builder","world","world builder","MCP","create","mcp tools","Tools","game","pokemon","manage","style","via","theme","zone","generative",{"skillNo":199,"name":200,"nameZh":6,"description":201,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":126,"licenseFileUrl":6,"sourceHtmlUrl":202,"categories":203,"keywords":206,"publishedAt":39},"01M6PT9Z92JTSQEHE1QR0NNW5F","webdriverio-skill","Generates WebdriverIO (WDIO) automation tests in JavaScript or TypeScript. Supports local and TestMu AI cloud. Use when user mentions \"WebdriverIO\", \"WDIO\", \"wdio.conf\", \"browser.url\", \"$\", \"$$\". Triggers on: \"WebdriverIO\", \"WDIO\", \"wdio\", \"browser.$\".","https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwebdriverio-skill\u002FSKILL.md",[204,205],{"categoryNo":130,"categoryName":131,"taxonomyType":132,"taxonomyTypeDesc":133},{"categoryNo":135,"categoryName":136,"taxonomyType":132,"taxonomyTypeDesc":133},[207,140,208,159,209,210,211,212,142,36,213,167,143,144,214,215],"webdriverio skill","typescript","javascript","browser","cloud","e2e","e2e-testing","URL","conf",{"skillNo":217,"name":218,"nameZh":6,"description":219,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":126,"licenseFileUrl":6,"sourceHtmlUrl":220,"categories":221,"keywords":231,"publishedAt":39},"01M6PT9NVK36ZWCQ69YXK3FR4K","web-design-guidelines","Web platform design and accessibility guidelines. Use when building web interfaces, auditing accessibility, implementing responsive layouts, or reviewing web UI code. Triggers on tasks involving HTML, CSS, web components, WCAG compliance, responsive design, or web performance.","https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fweb\u002FSKILL.md",[222,225,226],{"categoryNo":223,"categoryName":224,"taxonomyType":132,"taxonomyTypeDesc":133},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":179,"categoryName":180,"taxonomyType":132,"taxonomyTypeDesc":133},{"categoryNo":227,"categoryName":228,"taxonomyType":229,"taxonomyTypeDesc":230},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,144,250],"design","web","guidelines","web design guidelines","web design","css","performance","components","web components","tasks","code","web performance","ui","platform design","html","responsive design","responsive","platform","implementing",{"skillNo":252,"name":253,"nameZh":6,"description":254,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":126,"licenseFileUrl":6,"sourceHtmlUrl":255,"categories":256,"keywords":259,"publishedAt":39},"01M6PT9A3JKRE3X34276F2FW5R","watchos-design-guidelines","Apple Human Interface Guidelines for Apple Watch. Use when building watchOS apps, complications, or workout features. Triggers on tasks involving Watch UI, Digital Crown, glanceable interfaces, or wrist-based interactions.","https:\u002F\u002Fgithub.com\u002Fheadmktlucca-ui\u002Fneuroads-lp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwatchos\u002FSKILL.md",[257,258],{"categoryNo":179,"categoryName":180,"taxonomyType":132,"taxonomyTypeDesc":133},{"categoryNo":227,"categoryName":228,"taxonomyType":229,"taxonomyTypeDesc":230},[232,234,260,241,244,36,261,262,168,249,263,144,169,264,26,265,266],"watchos design guidelines","workout","human","watch","interface","platform-design","features"]