[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6E5RPCBBVV8295QK90TZCYJ":3,"skill-same:01M6E5RPCBBVV8295QK90TZCYJ":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":13,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":43,"install":44,"resources":57},"01M6E5RPCBBVV8295QK90TZCYJ","board-audit",null,"Periodic project-board drift check — detect orphan issues and sync the Wave field from labels","parametrization\u002F2real-team-framework","parametrization","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1111097?v=4","01M6E5MC117M94CEXKX3C96PPX","01M6E5MC7YWG5N3VV4792VFK85",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fintake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fboard-audit\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31],"audit","board","board audit","sync","repos","issues","check","periodic","drift","project","drift check","orphan","detect","org","2026-11-10 10:12:30",false,"---\nname: board-audit\ndescription: Periodic project-board drift check — detect orphan issues and sync the Wave field from labels\nargs: (none — runs against project 2 and all 8 org repos)\n---\n\nDetect drift between GitHub Project 2 (the Cross-Repo Wave Plan board) and the actual issue\u002FPR state across all 8 `noorinalabs` repos. Two failure modes are gated:\n\n1. **Orphan detection** — issues that exist but are NOT on the project board (invisible to any planning pass that reads the board).\n2. **Wave-field drift** — issues whose wave label (`wave-{X}` or grandfathered `p{N}-wave-{M}`) disagrees with the project's `Wave` single-select field.\n\nCloses main#199.\n\n> See [`.claude\u002Fteam\u002Flifecycle.md`](..\u002F..\u002Fteam\u002Flifecycle.md) § Wave Lifecycle for the canonical skill order and preconditions.\n\n## Background\n\nOn 2026-04-23 a manual audit found **72 of 193 open issues (37%) missing from project 2**. Root cause: Hook 13 (`auto_add_issue_to_board.py`) only catches `gh issue create` calls in active sessions — bot-created, manual-UI-created, and pre-hook-13 issues all drift off the board silently.\n\nDecision (owner, 2026-04-25): **labels are canonical for phase\u002Fwave assignment; the Wave field is a derived projection**. This skill is the sync mechanism. Per `feedback_enforcement_hierarchy.md`, this is skill-tier enforcement; Option B (a daily cron + Hook 13 extension) is deferred unless drift recurs after this skill ships.\n\n## Invocation patterns\n\n- **Manual** — orchestrator runs `\u002Fboard-audit` ad-hoc when board drift is suspected.\n- **Wired into `\u002Fwave-kickoff`** — runs once before label-application so kickoff sees a current board.\n- **Wired into `\u002Fwave-retro`** — runs once before retro-emit so the retro reads from a current board.\n- **Wired into `\u002Fsession-start` step 5** — drift report shown during session orientation.\n\n## Pre-requisite — Wave-field options exist\n\nThe project's `Wave` single-select field MUST have an option for every active wave. Option-name grammar (#810, matching `_wave_label_parse.wave_label_to_option_name`):\n\n- new phase-agnostic label `wave-{X}` → option `W{X}` (e.g. `wave-16` → `W16`)\n- grandfathered legacy label `p{N}-wave-{M}` → option `P{N}W{M}` (e.g. `P3W9`)\n- placeholder label `wave-x` → option `WX` (\"Wave (TBD)\")\n\nOwner adds new options via the Project Settings → Fields → Wave UI (or `gh project field-create` with project-edit scope).\n\nIf an option is missing for a label encountered during sync (e.g., issues labeled `wave-16` but no `W16` option, or legacy `p3-wave-10` but no `P3W10`), the skill reports the missing options and skips those issues' field-sync (does NOT block; orphan detection still runs).\n\n## Instructions\n\n### 0. Run `\u002Fontology-librarian` (mandatory)\n\nPer Hook 15 (`enforce_librarian_consulted`). The board-audit work edits no source — but Hook 15 fires on Edit\u002FWrite regardless, and this skill MAY surface findings that get filed as issues (a `gh issue create` doesn't trigger Hook 15, but the librarian is cheap and lets the orchestrator decide whether to file).\n\n```bash\n\u002Fontology-librarian board-audit drift orphan project field-sync\n```\n\n### 1. Fetch all open issues (with labels) across the 8 org repos\n\nFetch `url` **and** `labels` in one call per repo. The labels feed Step 4's drift\ndetection **in memory** — there is NO per-board-item `gh issue view` later (#888 defect 2).\nEach call is wrapped in a `timeout` and skip-and-warns rather than hanging the whole\naudit on a single stalled `gh` call (#888 defect 3 — the org-wide loop hung at the 2-min\nmark twice, though each repo returns in \u003C0.4 s alone).\n\n```bash\n# Literal repo list in the `for` (NOT `for repo in $SCALAR`) — under zsh an unquoted\n# scalar is not word-split, so a \"$REPOS\"-string would collapse to one bogus iteration\n# (#759). A literal word-list is split correctly in both bash and zsh.\n: > \u002Ftmp\u002Fissue-labels.tsv      # url \\t expected-Wave-option (computed from the wave label)\n: > \u002Ftmp\u002Fall-issue-urls.txt    # every open issue url across the org\n\nfor repo in noorinalabs-main noorinalabs-isnad-graph noorinalabs-user-service \\\n            noorinalabs-deploy noorinalabs-design-system noorinalabs-landing-page \\\n            noorinalabs-data-acquisition noorinalabs-isnad-ingest-platform; do\n  # Per-call timeout: one stalled call must not hang the whole audit (#888 defect 3).\n  # `timeout` exits 124 on stall → the `if !` branch warns and `continue`s.\n  if ! timeout 45 gh issue list --repo \"noorinalabs\u002F$repo\" --state open \\\n         --limit 500 --json url,labels > \"\u002Ftmp\u002Fissues-$repo.json\" 2>\u002Fdev\u002Fnull; then\n    echo \"WARN: gh issue list for $repo stalled\u002Ffailed — skipping (audit continues)\" >&2\n    continue\n  fi\n\n  # url + the highest-numbered wave label, mapped to its expected Wave-field option:\n  #   wave-{X}  -> W{X}      p{N}-wave-{M} -> P{N}W{M}      wave-x -> WX\n  # Ties on multiple wave labels (rare, transitional) resolve to highest-numbered, matching\n  # the issue body's \"highest-numbered wins\" rule. Issues with no wave label are omitted here.\n  jq -r '.[]\n         | .url as $u\n         | ([.labels[].name\n             | select(test(\"^wave-[0-9]+$\") or test(\"^p[0-9]+-wave-[0-9]+$\") or . == \"wave-x\")]\n            | sort_by(if . == \"wave-x\" then -1 else (capture(\"(?\u003Cn>[0-9]+)$\").n | tonumber) end)\n            | last) as $lbl\n         | select($lbl != null)\n         | ($lbl\n            | if . == \"wave-x\" then \"WX\"\n              elif startswith(\"wave-\") then \"W\" + ltrimstr(\"wave-\")\n              else (capture(\"p(?\u003Cn>[0-9]+)-wave-(?\u003Cm>[0-9]+)\") | \"P\\(.n)W\\(.m)\")\n              end) as $opt\n         | \"\\($u)\\t\\($opt)\"' \"\u002Ftmp\u002Fissues-$repo.json\" >> \u002Ftmp\u002Fissue-labels.tsv\n\n  jq -r '.[].url' \"\u002Ftmp\u002Fissues-$repo.json\" >> \u002Ftmp\u002Fall-issue-urls.txt\n  printf '  %s: done\\n' \"$repo\"          # progress flush — unbuffered, per-repo\ndone\n\necho \"Open issues across org: $(wc -l \u003C \u002Ftmp\u002Fall-issue-urls.txt | tr -d ' ')\"\necho \"Issues carrying a wave label: $(wc -l \u003C \u002Ftmp\u002Fissue-labels.tsv | tr -d ' ')\"\n```\n\n`--limit 500` is intentional — the default 30 truncates silently per memory `feedback_gh_pr_edit_silent_noop` family. Adjust upward if any single repo crosses 500 open issues (unlikely but capture as an annunaki event if hit).\n\n### 2. Fetch all items on project 2 (paginated — connections cap at 100)\n\n**`items(first: …)` MUST be ≤ 100.** GitHub's GraphQL API caps every connection's\n`first:` at 100 — `first: 500` errors with *\"Requesting 500 records on the connection\nexceeds the `first` limit of 100 records\"* and returns **0 nodes**, which downstream\nreads as \"every issue is an orphan\" (#888 defect 1; project 2 had 1394 items at the\nP7W19 run, so this is not an edge case). Page with `first: 100` + a `$endCursor` cursor\nvar + `pageInfo { hasNextPage endCursor }`, let `gh api graphql --paginate` walk the\npages, then merge them with `jq -s`.\n\n```bash\n# `--paginate` re-runs the query with $endCursor for each page (it keys off\n# `pageInfo.endCursor` — the cursor var MUST be named endCursor). It emits one JSON\n# document per page on stdout; `jq -s` (Step below) slurps them into one array.\ngh api graphql --paginate -f org=noorinalabs -F project=2 -f query='\nquery($org: String!, $project: Int!, $endCursor: String) {\n  organization(login: $org) {\n    projectV2(number: $project) {\n      id\n      items(first: 100, after: $endCursor) {\n        pageInfo { hasNextPage endCursor }\n        nodes {\n          id\n          content {\n            __typename\n            ... on Issue { url number repository { name } state }\n            ... on PullRequest { url number repository { name } state }\n          }\n          fieldValues(first: 30) {\n            nodes {\n              __typename\n              ... on ProjectV2ItemFieldSingleSelectValue {\n                name\n                field { ... on ProjectV2SingleSelectField { name } }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}' > \u002Ftmp\u002Fboard-items-pages.json\n\n# Merge the per-page documents into the single-object shape downstream jq expects:\n# `.data.organization.projectV2.{id,items.nodes[]}`. `jq -s` slurps the page stream\n# into an array; we flatten every page's nodes[] and keep page 0's project id (stable\n# across pages). Works whether there were 1 page or 14.\njq -s '{ data: { organization: { projectV2: {\n          id: .[0].data.organization.projectV2.id,\n          items: { nodes: [ .[].data.organization.projectV2.items.nodes[] ] }\n        } } } }' \u002Ftmp\u002Fboard-items-pages.json > \u002Ftmp\u002Fboard-items.json\n\necho \"Board items fetched: $(jq '.data.organization.projectV2.items.nodes | length' \u002Ftmp\u002Fboard-items.json)\"\n```\n\nSave raw to `\u002Ftmp\u002F` (or `.claude\u002Fscratch\u002F`) for downstream parsing. A board-item count\nof **0** here is a red flag (the over-cap symptom) — investigate before treating every\nissue as an orphan, never run the apply steps off a zero-item fetch.\n\n### 3. Detect orphans\n\n```bash\n# Build set of URLs on the board\nBOARD_URLS=$(jq -r '.data.organization.projectV2.items.nodes[] | .content.url \u002F\u002F empty' \u002Ftmp\u002Fboard-items.json | sort -u)\n\n# Set of URLs found in repo issue lists (collected to a file in Step 1)\nISSUE_URLS=$(sort -u \u002Ftmp\u002Fall-issue-urls.txt)\n\n# Orphans = issues NOT on the board\nORPHANS=$(comm -23 \u003C(echo \"$ISSUE_URLS\") \u003C(echo \"$BOARD_URLS\"))\n\nORPHAN_COUNT=$(echo \"$ORPHANS\" | grep -c . || true)\necho \"Orphan issues (in repo, missing from board): $ORPHAN_COUNT\"\necho \"$ORPHANS\" | head -20\n```\n\n### 4. Detect Wave-field drift\n\nDrift is computed **entirely in memory** by cross-referencing two maps already on disk —\nno per-board-item `gh issue view` (#888 defect 2; the old loop was ~1394 serial network\ncalls). The expected Wave-field option per issue comes from `\u002Ftmp\u002Fissue-labels.tsv` (built\nin Step 1 from the bulk `--json url,labels` fetch, grammar `wave-{X}` → `W{X}`,\n`p{N}-wave-{M}` → `P{N}W{M}`, `wave-x` → `WX`); the board's actual Wave-field value comes\nfrom the Step-2 GraphQL response. A single hash-join `awk` matches them by URL.\n\n```bash\n# Board side: url \\t item_id \\t current-Wave-field (from the merged Step-2 response).\njq -r '.data.organization.projectV2.items.nodes[]\n       | select(.content.url != null)\n       | \"\\(.content.url)\\t\\(.id)\\t\\(\n           ([.fieldValues.nodes[]\n             | select(.__typename == \"ProjectV2ItemFieldSingleSelectValue\")\n             | select(.field.name == \"Wave\")\n             | .name] | first \u002F\u002F \"(unset)\")\n         )\"' \u002Ftmp\u002Fboard-items.json > \u002Ftmp\u002Fboard-wave-values.tsv\n\n# In-memory hash join (NO network): first file builds url -> expected-option, second\n# file (board) is streamed and annotated with the expected option (or \"(unset)\" when the\n# issue carries no wave label \u002F isn't an open issue — e.g. a PR or closed item).\n# NB: the map array is `want`, NOT `exp` — `exp` is awk's built-in exponential fn and\n# using it as an array name is a syntax error.\nawk -F'\\t' '\n  NR==FNR { want[$1] = $2; next }                # \u002Ftmp\u002Fissue-labels.tsv : url -> W{X}\n  { e = ($1 in want) ? want[$1] : \"(unset)\";\n    print $1 \"\\t\" $3 \"\\t\" e }                     # url \\t current_wave \\t expected\n' \u002Ftmp\u002Fissue-labels.tsv \u002Ftmp\u002Fboard-wave-values.tsv > \u002Ftmp\u002Fboard-drift-join.tsv\n\n# Bucket the join rows (see #427 for the regression that motivated the split):\n#   DRIFT      — actionable rows where a mutation will change board state.\n#   NOOP_COUNT — no wave label AND Wave field already (unset). Functionally\n#                `(unset) → (clear)`; the apply step's clearProjectV2ItemFieldValue is a\n#                no-op against an already-cleared field. Counted separately so the operator\n#                sees \"audit is clean\" even when the no-op equivalence class is non-empty;\n#                MUST stay out of DRIFT so Step 7 doesn't emit redundant clear mutations and\n#                Step 5's gate doesn't over-report.\n# DRIFT rows carry REAL tab separators (`$'\\t'`, not the literal backslash-t that a\n# double-quoted \"\\t\" would store) so Step 7's `while IFS=$'\\t' read` actually splits them.\nDRIFT=()\nNOOP_COUNT=0\nwhile IFS=$'\\t' read -r url current_wave expected; do\n  [ -n \"$url\" ] || continue\n  if [ \"$expected\" != \"(unset)\" ]; then\n    if [ \"$current_wave\" != \"$expected\" ]; then\n      DRIFT+=(\"$url\"$'\\t'\"$current_wave\"$'\\t'\"$expected\")\n    fi\n  elif [ \"$current_wave\" != \"(unset)\" ]; then\n    # No wave label but Wave field is populated — should clear.\n    DRIFT+=(\"$url\"$'\\t'\"$current_wave\"$'\\t'\"(clear)\")\n  else\n    # No wave label AND Wave field already (unset) — already in desired state.\n    NOOP_COUNT=$((NOOP_COUNT + 1))\n  fi\ndone \u003C \u002Ftmp\u002Fboard-drift-join.tsv\n\necho \"Actionable Wave-field drift:        ${#DRIFT[@]}\"\necho \"No-op equivalents (unset == clear): ${NOOP_COUNT}\"\nprintf '%s\\n' \"${DRIFT[@]}\" | head -30\n```\n\n\"Multiple wave labels (rare, transitional)\" — Step 1's `sort_by(... | tonumber) | last`\ntakes the highest-numbered, matching the issue body's \"highest-numbered wins\" rule.\n\n### 5. Confirmation gate (mandatory)\n\nPrint the drift report and PAUSE for explicit user confirmation before mutating anything. Sample report shape:\n\n```\nBoard audit results:\n- Orphan issues:                       12 (in repo, missing from board)\n- Actionable Wave-field drift:          7 (label and Wave field disagree; mutation will change state)\n- No-op equivalents (unset == clear): 83 (functional duplicates; skipped by apply, shown for visibility)\n- Missing Wave-field options:           0 (P3W9, P3W10 all present)\n\nOrphan issues:\n  https:\u002F\u002Fgithub.com\u002Fnoorinalabs\u002Fnoorinalabs-main\u002Fissues\u002F250\n  ...\n\nActionable Wave-field drift:\n  https:\u002F\u002Fgithub.com\u002Fnoorinalabs\u002Fnoorinalabs-main\u002Fissues\u002F123    P3W7 -> P3W9\n  https:\u002F\u002Fgithub.com\u002Fnoorinalabs\u002Fnoorinalabs-deploy\u002Fissues\u002F87   P2W10 -> (clear)\n  ...\n\nProceed with bulk-add and bulk-sync? [y\u002FN]\n```\n\nThe confirmation gate is keyed off the **actionable** drift count (`${#DRIFT[@]}`) plus the orphan count. No-op equivalents never appear under \"Actionable Wave-field drift\" and never gate the prompt — the apply step would skip them anyway, per the Step 4 forensic note.\n\nThe user MUST type `y` to proceed. Any other answer aborts with `BLOCK: user declined; no mutations made`.\n\n### 6. Bulk-add orphans\n\n```bash\n# `while read` over the newline-list, NOT `for url in $ORPHANS` — zsh does not\n# word-split an unquoted scalar, so the whole list would collapse into one bogus\n# iteration (#759, same class as main#688). The `[ -n ]` guard preserves the\n# zero-iteration-on-empty behaviour `for` gives when $ORPHANS is empty.\nwhile IFS= read -r url; do\n  [ -n \"$url\" ] || continue\n  gh project item-add 2 --owner noorinalabs --url \"$url\" || \\\n    echo \"WARN: failed to add $url\"\ndone \u003C\u003C\u003C \"$ORPHANS\"\n```\n\nPer memory `feedback_gh_pr_edit_silent_noop` family, `gh project item-add` can silently no-op — `gh` is being deprecated for project-classic operations (see `pull-requests.md § gh pr edit projects-classic deprecation`). If the bulk-add appears to succeed but the orphan count doesn't drop on the next audit run, fall back to the GraphQL `addProjectV2ItemById` mutation:\n\n```bash\ngh api graphql -f query='\nmutation($project: ID!, $content: ID!) {\n  addProjectV2ItemById(input: {projectId: $project, contentId: $content}) {\n    item { id }\n  }\n}' -f project=\"$PROJECT_NODE_ID\" -f content=\"$ISSUE_NODE_ID\"\n```\n\n(Project and issue node IDs come from the step-2 query.)\n\n### 7. Bulk-sync Wave field via GraphQL\n\nFor each drift row, run `updateProjectV2ItemFieldValue` with the option ID of the expected Wave value:\n\n```bash\n# One-time per session: fetch Wave-field option IDs.\ngh api graphql -f query='\nquery {\n  organization(login: \"noorinalabs\") {\n    projectV2(number: 2) {\n      field(name: \"Wave\") {\n        ... on ProjectV2SingleSelectField {\n          id\n          options { id name }\n        }\n      }\n    }\n  }\n}' > \u002Ftmp\u002Fwave-options.json\n\nWAVE_FIELD_ID=$(jq -r '.data.organization.projectV2.field.id' \u002Ftmp\u002Fwave-options.json)\ndeclare -A WAVE_OPTION_IDS\nwhile IFS=$'\\t' read -r name id; do\n  # Unquoted subscript on assignment — zsh keeps quotes *inside* a subscript as\n  # part of the key (`WAVE_OPTION_IDS[\"$name\"]=` would store key `\"P6W1\"`, with\n  # the quotes, so later `${WAVE_OPTION_IDS[$expected]}` lookups miss). Bash\n  # strips them; the unquoted form is correct in both. Keys are wave names\n  # (no spaces), so no word-split risk. (zsh-safety, #759)\n  WAVE_OPTION_IDS[$name]=$id\ndone \u003C \u003C(jq -r '.data.organization.projectV2.field.options[] | \"\\(.name)\\t\\(.id)\"' \u002Ftmp\u002Fwave-options.json)\n\n# Project node ID — same response.\nPROJECT_NODE_ID=$(jq -r '...path to project.id...' \u002Ftmp\u002Fboard-items.json)\n\n# Per drift row, set the Wave field.\nwhile IFS=$'\\t' read -r url current expected; do\n  ITEM_ID=$(jq -r --arg u \"$url\" '.data.organization.projectV2.items.nodes[]\n                                  | select(.content.url == $u) | .id' \\\n              \u002Ftmp\u002Fboard-items.json)\n  OPTION_ID=\"${WAVE_OPTION_IDS[$expected]:-}\"\n\n  if [ \"$expected\" = \"(clear)\" ]; then\n    # Clear the field — pass null value.\n    gh api graphql -f query='\nmutation($project: ID!, $item: ID!, $field: ID!) {\n  clearProjectV2ItemFieldValue(input: {projectId: $project, itemId: $item, fieldId: $field}) {\n    projectV2Item { id }\n  }\n}' -f project=\"$PROJECT_NODE_ID\" -f item=\"$ITEM_ID\" -f field=\"$WAVE_FIELD_ID\" \\\n      || echo \"WARN: clear failed for $url\"\n  elif [ -n \"$OPTION_ID\" ]; then\n    gh api graphql -f query='\nmutation($project: ID!, $item: ID!, $field: ID!, $option: String!) {\n  updateProjectV2ItemFieldValue(input: {\n    projectId: $project, itemId: $item, fieldId: $field,\n    value: {singleSelectOptionId: $option}\n  }) { projectV2Item { id } }\n}' -f project=\"$PROJECT_NODE_ID\" -f item=\"$ITEM_ID\" \\\n   -f field=\"$WAVE_FIELD_ID\" -f option=\"$OPTION_ID\" \\\n      || echo \"WARN: sync failed for $url\"\n  else\n    echo \"WARN: no Wave option for $expected; add it to project 2 (Settings → Fields → Wave → Add option) and rerun\"\n  fi\ndone \u003C\u003C\u003C \"$(printf '%s\\n' \"${DRIFT[@]}\")\"\n```\n\n### 8. Read-back verify\n\nRe-run step 2 (board fetch) and re-compute step 3 (orphans) + step 4 (drift). Success criterion is **actionable drift == 0** AND **orphan count == 0** — the `NOOP_COUNT` bucket is expected to be non-zero on a healthy board (any issue intentionally left unlabeled lives here) and MUST NOT fail the read-back. If actionable drift or orphans are non-zero post-sync, surface to the user — the gh \u002F GraphQL mutations may have silently no-op'd per the projects-classic deprecation family.\n\n### 9. Report\n\n```\nBoard audit complete:\n- Orphans added: {count} (was {pre} → board now has {post} items)\n- Wave fields synced: {count} (pre-actionable-drift: {pre} → post-actionable-drift: {post})\n- No-op equivalents (unset == clear): {count} (informational; unchanged by sync)\n- Missing Wave-field options: {list, if any}\n- Read-back actionable drift remaining: {count}\n```\n\nIf read-back actionable drift > 0, raise a warning and link to charter `pull-requests.md § gh pr edit projects-classic deprecation` (the same silent-no-op family). A non-zero no-op count is normal and does NOT warrant escalation.\n\n## Acceptance criteria status (per main#199)\n\n- [x] Skill `\u002Fboard-audit` exists at `.claude\u002Fskills\u002Fboard-audit\u002FSKILL.md`.\n- [x] Skill detects orphans across all 8 repos and project 2 (steps 1-3).\n- [x] Skill detects wave label (`wave-{X}` \u002F grandfathered `p{N}-wave-{M}`) \u002F Wave-field drift (step 4).\n- [x] Skill bulk-adds orphans with user confirmation (steps 5-6).\n- [x] Skill bulk-syncs Wave field via GraphQL `updateProjectV2ItemFieldValue` mutation (step 7).\n- [ ] Project 2 Wave-field options extended with `P2W10` + `P3W1`+ — **OWNER ACTION REQUIRED** (one-time per phase; not a code change).\n- [x] Skill wired into `\u002Fwave-kickoff` and `\u002Fwave-retro` — added in this PR via SKILL.md cross-refs (callers update sequentially when next invoked).\n- [x] Skill referenced from `\u002Fsession-start` step 5 — added in this PR via SKILL.md cross-refs.\n- [x] Charter `issues.md` (or `skills.md`) documents the labels-canonical rule — added in this PR via `skills.md § Cross-repo-status.json upsert pattern` companion section + a one-line note in `issues.md`.\n\n## Out of scope (deliberately)\n\n- Daily cron (issue body Option B) — deferred unless drift recurs after this skill ships.\n- Auto-add via Hook 13 extension — Hook 13 catches in-session creates; extending it to cron-style cross-repo scans is the Option B path, deferred for the same reason.\n- Wave-field option auto-creation — `gh project field-create` requires project-edit scope; one-time owner action.\n\n## Skill-authoring notes — GitHub API access patterns\n\nThese are the footguns this skill hit (main#888, surfaced during the P7W19 `\u002Fboard-audit`\nrun). Any skill that queries the GitHub GraphQL or REST APIs over a growing collection\nshould heed them:\n\n- **GraphQL connections cap at 100 — always paginate.** Every GraphQL *connection*\n  (`items`, `nodes`, `issues`, …) rejects `first:` > 100 with a hard error and returns\n  zero rows. Use `first: 100` + `pageInfo { hasNextPage endCursor }` + a `$endCursor`\n  query var + `gh api graphql --paginate`, then merge pages with `jq -s`. Never raise\n  `first:` to \"fit the dataset\" — that is the over-cap regression (Step 2).\n- **Derive in memory; don't loop network calls per row.** If you already have the data in\n  a bulk response (or can get it in one `gh … --json` call per repo), cross-reference it\n  in memory (an `awk`\u002F`jq` hash join) rather than an `O(collection)` per-item `gh view`\n  loop (Step 1 + Step 4).\n- **Wrap each external call in a `timeout` and skip-and-warn.** A single stalled `gh`\u002FHTTP\n  call must not hang a whole multi-repo sweep; bound it and continue (Step 1).\n\nA cheap regression lint for the first item ships at\n[`.claude\u002Flib\u002Flint_skill_graphql_pagination.py`](..\u002F..\u002Flib\u002Flint_skill_graphql_pagination.py):\nit flags `first: \u003Cn≥100>` inside a `gh api graphql` block across `.claude\u002Fskills\u002F**\u002F*.md`.\nRun it over the skills tree with:\n\n```bash\npython3 .claude\u002Flib\u002Flint_skill_graphql_pagination.py .claude\u002Fskills\u002F**\u002F*.md\n```\n\nWiring it into pre-commit\u002FCI is a deliberate follow-up (it is not yet a blocking gate); its\ndetection logic is covered by `.claude\u002Flib\u002Ftests\u002Ftest_lint_skill_graphql_pagination.py`.\n\n## Promotion provenance\n\nMemory `feedback_wave_planning_from_board.md` (2026-04-23 — the 37% drift discovery) → owner decision 2026-04-25 (labels canonical, Wave field derived) → this skill. Originating issue: main#199. Sibling-of: main#286 (hookify \u002Fwave-kickoff Steps 7+8, which depends on a current board); main#196 (\u002Fwave-scope, which depends on a current board). Class: same family as #286 — automation of cross-repo bookkeeping that decayed via in-band-repair patterns.\n","Detect drift between GitHub Project 2 (the Cross-Repo Wave Plan board) and the actual issue\u002FPR state across all 8 `noorinalabs` repos. Two failure modes are gated:\n\n1. **Orphan detection** — issues that exist but are NOT on the project board (invisible to any planning pass that reads the board).\n2. **Wave-field drift** — issues whose wave label (`wave-{X}` or grandfathered `p{N}-wave-{M}`) disagrees with the project's `Wave` single-select field.\n\nCloses main#199.\n\n> See [`.claude\u002Fteam\u002Flifecycle.md`](..\u002F..\u002Fteam\u002Flifecycle.md) § Wave Lifecycle for the canonical skill order and preconditions.\n\n## Background\n\nOn 2026-04-23 a manual audit found **72 of 193 open issues (37%) missing from project 2**. Root cause: Hook 13 (`auto_add_issue_to_board.py`) only catches `gh issue create` calls in active sessions — bot-created, manual-UI-created, and pre-hook-13 issues all drift off the board silently.\n\nDecision (owner, 2026-04-25): **labels are canonical for phase\u002Fwave assignment; the Wave field is a derived projection**. This skill is the sync mechanism. Per `feedback_enforcement_hierarchy.md`, this is skill-tier enforcement; Option B (a daily cron + Hook 13 extension) is deferred unless drift recurs after this skill ships.\n\n## Invocation patterns\n\n- **Manual** — orchestrator runs `\u002Fboard-audit` ad-hoc when board drift is suspected.\n- **Wired into `\u002Fwave-kickoff`** — runs once before label-application so kickoff sees a current board.\n- **Wired into `\u002Fwave-retro`** — runs once before retro-emit so the retro reads from a current board.\n- **Wired into `\u002Fsession-start` step 5** — drift report shown during session orientation.\n\n## Pre-requisite — Wave-field options exist\n\nThe project's `Wave` single-select field MUST have an option for every active wave. Option-name grammar (#810, matching `_wave_label_parse.wave_label_to_option_name`):\n\n- new phase-agnostic label `wave-{X}` → option `W{X}` (e.g. `wave-16` → `W16`)\n- grandfathered legacy label `p{N}-wave-{M}` → option `P{N}W{M}` (e.g. `P3W9`)\n- placeholder label `wave-x` → option `WX` (\"Wave (TBD)\")\n\nOwner adds new options via the Project Settings → Fields → Wave UI (or `gh project field-create` with project-edit scope).\n\nIf an option is missing for a label encountered during sync (e.g., issues labeled `wave-16` but no `W16` option, or legacy `p3-wave-10` but no `P3W10`), the skill reports the missing options and skips those issues' field-sync (does NOT block; orphan detection still runs).\n\n## Instructions\n\n### 0. Run `\u002Fontology-librarian` (mandatory)\n\nPer Hook 15 (`enforce_librarian_consulted`). The board-audit work edits no source — but Hook 15 fires on Edit\u002FWrite regardless, and this skill MAY surface findings that get filed as issues (a `gh issue create` doesn't trigger Hook 15, but the librarian is cheap and lets the orchestrator decide whether to file).\n\n```bash\n\u002Fontology-librarian board-audit drift orphan project field-sync\n```\n\n### 1. Fetch all open issues (with labels) across the 8 org repos\n\nFetch `url` **and** `labels` in one call per repo. The labels feed Step 4's drift\ndetection **in memory** — there is NO per-board-item `gh issue view` later (#888 defect 2).\nEach call is wrapped in a `timeout` and skip-and-warns rather than hanging the whole\naudit on a single stalled `gh` call (#888 defect 3 — the org-wide loop hung at the 2-min\nmark twice, though each repo returns in \u003C0.4 s alone).\n\n```bash\n# Literal repo list in the `for` (NOT `for repo in $SCALAR`) — under zsh an unquoted\n# scalar is not word-split, so a \"$REPOS\"-string would collapse to one bogus iteration\n# (#759). A literal word-list is split correctly in both bash and zsh.\n: > \u002Ftmp\u002Fissue-labels.tsv      # url \\t expected-Wave-option (computed from the wave label)\n: > \u002Ftmp\u002Fall-issue-urls.txt    # every open issue url across the org\n\nfor repo in noorinalabs-main noorinalabs-isnad-graph noorinalabs-user-service \\\n            noorinalabs-deploy noorinalabs-design-system noorinalabs-landing-page \\\n            noorinalabs-data-acquisition noorinalabs-isnad-ingest-platform; do\n  # Per-call timeout: one stalled call must not hang the whole audit (#888 defect 3).\n  # `timeout` exits 124 on stall → the `if !` branch warns and `continue`s.\n  if ! timeout 45 gh issue list --repo \"noorinalabs\u002F$repo\" --state open \\\n         --limit 500 --json url,labels > \"\u002Ftmp\u002Fissues-$repo.json\" 2>\u002Fdev\u002Fnull; then\n    echo \"WARN: gh issue list for $repo stalled\u002Ffailed — skipping (audit continues)\" >&2\n    continue\n  fi\n\n  # url + the highest-numbered wave label, mapped to its expected Wave-field option:\n  #   wave-{X}  -> W{X}      p{N}-wave-{M} -> P{N}W{M}      wave-x -> WX\n  # Ties on multiple wave labels (rare, transitional) resolve to highest-numbered, matching\n  # the issue body's \"highest-numbered wins\" rule. Issues with no wave label are omitted here.\n  jq -r '.[]\n         | .url as $u\n         | ([.labels[].name\n             | select(test(\"^wave-[0-9]+$\") or test(\"^p[0-9]+-wave-[0-9]+$\") or . == \"wave-x\")]\n            | sort_by(if . == \"wave-x\" then -1 else (capture(\"(?\u003Cn>[0-9]+)$\").n | tonumber) end)\n            | last) as $lbl\n         | select($lbl != null)\n         | ($lbl\n            | if . == \"wave-x\" then \"WX\"\n              elif startswith(\"wave-\") then \"W\" + ltrimstr(\"wave-\")\n              else (capture(\"p(?\u003Cn>[0-9]+)-wave-(?\u003Cm>[0-9]+)\") | \"P\\(.n)W\\(.m)\")\n              end) as $opt\n         | \"\\($u)\\t\\($opt)\"' \"\u002Ftmp\u002Fissues-$repo.json\" >> \u002Ftmp\u002Fissue-labels.tsv\n\n  jq -r '.[].url' \"\u002Ftmp\u002Fissues-$repo.json\" >> \u002Ftmp\u002Fall-issue-urls.txt\n  printf '  %s: done\\n' \"$repo\"          # progress flush — unbuffered, per-repo\ndone\n\necho \"Open issues across org: $(wc -l \u003C \u002Ftmp\u002Fall-issue-urls.txt | tr -d ' ')\"\necho \"Issues carrying a wave label: $(wc -l \u003C \u002Ftmp\u002Fissue-labels.tsv | tr -d ' ')\"\n```\n\n`--limit 500` is intentional — the default 30 truncates silently per memory `feedback_gh_pr_edit_silent_noop` family. Adjust upward if any single repo crosses 500 open issues (unlikely but capture as an annunaki event if hit).\n\n### 2. Fetch all items on project 2 (paginated — connections cap at 100)\n\n**`items(first: …)` MUST be ≤ 100.** GitHub's GraphQL API caps every connection's\n`first:` at 100 — `first: 500` errors with *\"Requesting 500 records on the connection\nexceeds the `first` limit of 100 records\"* and returns **0 nodes**, which downstream\nreads as \"every issue is an orphan\" (#888 defect 1; project 2 had 1394 items at the\nP7W19 run, so this is not an edge case). Page with `first: 100` + a `$endCursor` cursor\nvar + `pageInfo { hasNextPage endCursor }`, let `gh api graphql --paginate` walk the\npages, then merge them with `jq -s`.\n\n```bash\n# `--paginate` re-runs the query with $endCursor for each page (it keys off\n# `pageInfo.endCursor` — the cursor var MUST be named endCursor). It emits one JSON\n# document per page on stdout; `jq -s` (Step below) slurps them into one array.\ngh api graphql --paginate -f org=noorinalabs -F project=2 -f query='\nquery($org: String!, $project: Int!, $endCursor: String) {\n  organization(login: $org) {\n    projectV2(number: $project) {\n      id\n      items(first: 100, after: $endCursor) {\n        pageInfo { hasNextPage endCursor }\n        nodes {\n          id\n          content {\n            __typename\n            ... on Issue { url number repository { name } state }\n            ... on PullRequest { url number repository { name } state }\n          }\n          fieldValues(first: 30) {\n            nodes {\n              __typename\n              ... on ProjectV2ItemFieldSingleSelectValue {\n                name\n                field { ... on ProjectV2SingleSelectField { name } }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}' > \u002Ftmp\u002Fboard-items-pages.json\n\n# Merge the per-page documents into the single-object shape downstream jq expects:\n# `.data.organization.projectV2.{id,items.nodes[]}`. `jq -s` slurps the page stream\n# into an array; we flatten every page's nodes[] and keep page 0's project id (stable\n# across pages). Works whether there were 1 page or 14.\njq -s '{ data: { organization: { projectV2: {\n          id: .[0].data.organization.projectV2.id,\n          items: { nodes: [ .[].data.organization.projectV2.items.nodes[] ] }\n        } } } }' \u002Ftmp\u002Fboard-items-pages.json > \u002Ftmp\u002Fboard-items.json\n\necho \"Board items fetched: $(jq '.data.organization.projectV2.items.nodes | length' \u002Ftmp\u002Fboard-items.json)\"\n```\n\nSave raw to `\u002Ftmp\u002F` (or `.claude\u002Fscratch\u002F`) for downstream parsing. A board-item count\nof **0** here is a red flag (the over-cap symptom) — investigate before treating every\nissue as an orphan, never run the apply steps off a zero-item fetch.\n\n### 3. Detect orphans\n\n```bash\n# Build set of URLs on the board\nBOARD_URLS=$(jq -r '.data.organization.projectV2.items.nodes[] | .content.url \u002F\u002F empty' \u002Ftmp\u002Fboard-items.json | sort -u)\n\n# Set of URLs found in repo issue lists (collected to a file in Step 1)\nISSUE_URLS=$(sort -u \u002Ftmp\u002Fall-issue-urls.txt)\n\n# Orphans = issues NOT on the board\nORPHANS=$(comm -23 \u003C(echo \"$ISSUE_URLS\") \u003C(echo \"$BOARD_URLS\"))\n\nORPHAN_COUNT=$(echo \"$ORPHANS\" | grep -c . || true)\necho \"Orphan issues (in repo, missing from board): $ORPHAN_COUNT\"\necho \"$ORPHANS\" | head -20\n```\n\n### 4. Detect Wave-field drift\n\nDrift is computed **entirely in memory** by cross-referencing two maps already on disk —\nno per-board-item `gh issue view` (#888 defect 2; the old loop was ~1394 serial network\ncalls). The expected Wave-field option per issue comes from `\u002Ftmp\u002Fissue-labels.tsv` (built\nin Step 1 from the bulk `--json url,labels` fetch, grammar `wave-{X}` → `W{X}`,\n`p{N}-wave-{M}` → `P{N}W{M}`, `wave-x` → `WX`); the board's actual Wave-field value comes\nfrom the Step-2 GraphQL response. A single hash-join `awk` matches them by URL.\n\n```bash\n# Board side: url \\t item_id \\t current-Wave-field (from the merged Step-2 response).\njq -r '.data.organization.projectV2.items.nodes[]\n       | select(.content.url != null)\n       | \"\\(.content.url)\\t\\(.id)\\t\\(\n           ([.fieldValues.nodes[]\n             | select(.__typename == \"ProjectV2ItemFieldSingleSelectValue\")\n             | select(.field.name == \"Wave\")\n             | .name] | first \u002F\u002F \"(unset)\")\n         )\"' \u002Ftmp\u002Fboard-items.json > \u002Ftmp\u002Fboard-wave-values.tsv\n\n# In-memory hash join (NO network): first file builds url -> expected-option, second\n# file (board) is streamed and annotated with the expected option (or \"(unset)\" when the\n# issue carries no wave label \u002F isn't an open issue — e.g. a PR or closed item).\n# NB: the map array is `want`, NOT `exp` — `exp` is awk's built-in exponential fn and\n# using it as an array name is a syntax error.\nawk -F'\\t' '\n  NR==FNR { want[$1] = $2; next }                # \u002Ftmp\u002Fissue-labels.tsv : url -> W{X}\n  { e = ($1 in want) ? want[$1] : \"(unset)\";\n    print $1 \"\\t\" $3 \"\\t\" e }                     # url \\t current_wave \\t expected\n' \u002Ftmp\u002Fissue-labels.tsv \u002Ftmp\u002Fboard-wave-values.tsv > \u002Ftmp\u002Fboard-drift-join.tsv\n\n# Bucket the join rows (see #427 for the regression that motivated the split):\n#   DRIFT      — actionable rows where a mutation will change board state.\n#   NOOP_COUNT — no wave label AND Wave field already (unset). Functionally\n#                `(unset) → (clear)`; the apply step's clearProjectV2ItemFieldValue is a\n#                no-op against an already-cleared field. Counted separately so the operator\n#                sees \"audit is clean\" even when the no-op equivalence class is non-empty;\n#                MUST stay out of DRIFT so Step 7 doesn't emit redundant clear mutations and\n#                Step 5's gate doesn't over-report.\n# DRIFT rows carry REAL tab separators (`$'\\t'`, not the literal backslash-t that a\n# double-quoted \"\\t\" would store) so Step 7's `while IFS=$'\\t' read` actually splits them.\nDRIFT=()\nNOOP_COUNT=0\nwhile IFS=$'\\t' read -r url current_wave expected; do\n  [ -n \"$url\" ] || continue\n  if [ \"$expected\" != \"(unset)\" ]; then\n    if [ \"$current_wave\" != \"$expected\" ]; then\n      DRIFT+=(\"$url\"$'\\t'\"$current_wave\"$'\\t'\"$expected\")\n    fi\n  elif [ \"$current_wave\" != \"(unset)\" ]; then\n    # No wave label but Wave field is populated — should clear.\n    DRIFT+=(\"$url\"$'\\t'\"$current_wave\"$'\\t'\"(clear)\")\n  else\n    # No wave label AND Wave field already (unset) — already in desired state.\n    NOOP_COUNT=$((NOOP_COUNT + 1))\n  fi\ndone \u003C \u002Ftmp\u002Fboard-drift-join.tsv\n\necho \"Actionable Wave-field drift:        ${#DRIFT[@]}\"\necho \"No-op equivalents (unset == clear): ${NOOP_COUNT}\"\nprintf '%s\\n' \"${DRIFT[@]}\" | head -30\n```\n\n\"Multiple wave labels (rare, transitional)\" — Step 1's `sort_by(... | tonumber) | last`\ntakes the highest-numbered, matching the issue body's \"highest-numbered wins\" rule.\n\n### 5. Confirmation gate (mandatory)\n\nPrint the drift report and PAUSE for explicit user confirmation before mutating anything. Sample report shape:\n\n```\nBoard audit results:\n- Orphan issues:                       12 (in repo, missing from board)\n- Actionable Wave-field drift:          7 (label and Wave field disagree; mutation will change state)\n- No-op equivalents (unset == clear): 83 (functional duplicates; skipped by apply, shown for visibility)\n- Missing Wave-field options:           0 (P3W9, P3W10 all present)\n\nOrphan issues:\n  https:\u002F\u002Fgithub.com\u002Fnoorinalabs\u002Fnoorinalabs-main\u002Fissues\u002F250\n  ...\n\nActionable Wave-field drift:\n  https:\u002F\u002Fgithub.com\u002Fnoorinalabs\u002Fnoorinalabs-main\u002Fissues\u002F123    P3W7 -> P3W9\n  https:\u002F\u002Fgithub.com\u002Fnoorinalabs\u002Fnoorinalabs-deploy\u002Fissues\u002F87   P2W10 -> (clear)\n  ...\n\nProceed with bulk-add and bulk-sync? [y\u002FN]\n```\n\nThe confirmation gate is keyed off the **actionable** drift count (`${#DRIFT[@]}`) plus the orphan count. No-op equivalents never appear under \"Actionable Wave-field drift\" and never gate the prompt — the apply step would skip them anyway, per the Step 4 forensic note.\n\nThe user MUST type `y` to proceed. Any other answer aborts with `BLOCK: user declined; no mutations made`.\n\n### 6. Bulk-add orphans\n\n```bash\n# `while read` over the newline-list, NOT `for url in $ORPHANS` — zsh does not\n# word-split an unquoted scalar, so the whole list would collapse into one bogus\n# iteration (#759, same class as main#688). The `[ -n ]` guard preserves the\n# zero-iteration-on-empty behaviour `for` gives when $ORPHANS is empty.\nwhile IFS= read -r url; do\n  [ -n \"$url\" ] || continue\n  gh project item-add 2 --owner noorinalabs --url \"$url\" || \\\n    echo \"WARN: failed to add $url\"\ndone \u003C\u003C\u003C \"$ORPHANS\"\n```\n\nPer memory `feedback_gh_pr_edit_silent_noop` family, `gh project item-add` can silently no-op — `gh` is being deprecated for project-classic operations (see `pull-requests.md § gh pr edit projects-classic deprecation`). If the bulk-add appears to succeed but the orphan count doesn't drop on the next audit run, fall back to the GraphQL `addProjectV2ItemById` mutation:\n\n```bash\ngh api graphql -f query='\nmutation($project: ID!, $content: ID!) {\n  addProjectV2ItemById(input: {projectId: $project, contentId: $content}) {\n    item { id }\n  }\n}' -f project=\"$PROJECT_NODE_ID\" -f content=\"$ISSUE_NODE_ID\"\n```\n\n(Project and issue node IDs come from the step-2 query.)\n\n### 7. Bulk-sync Wave field via GraphQL\n\nFor each drift row, run `updateProjectV2ItemFieldValue` with the option ID of the expected Wave value:\n\n```bash\n# One-time per session: fetch Wave-field option IDs.\ngh api graphql -f query='\nquery {\n  organization(login: \"noorinalabs\") {\n    projectV2(number: 2) {\n      field(name: \"Wave\") {\n        ... on ProjectV2SingleSelectField {\n          id\n          options { id name }\n        }\n      }\n    }\n  }\n}' > \u002Ftmp\u002Fwave-options.json\n\nWAVE_FIELD_ID=$(jq -r '.data.organization.projectV2.field.id' \u002Ftmp\u002Fwave-options.json)\ndeclare -A WAVE_OPTION_IDS\nwhile IFS=$'\\t' read -r name id; do\n  # Unquoted subscript on assignment — zsh keeps quotes *inside* a subscript as\n  # part of the key (`WAVE_OPTION_IDS[\"$name\"]=` would store key `\"P6W1\"`, with\n  # the quotes, so later `${WAVE_OPTION_IDS[$expected]}` lookups miss). Bash\n  # strips them; the unquoted form is correct in both. Keys are wave names\n  # (no spaces), so no word-split risk. (zsh-safety, #759)\n  WAVE_OPTION_IDS[$name]=$id\ndone \u003C \u003C(jq -r '.data.organization.projectV2.field.options[] | \"\\(.name)\\t\\(.id)\"' \u002Ftmp\u002Fwave-options.json)\n\n# Project node ID — same response.\nPROJECT_NODE_ID=$(jq -r '...path to project.id...' \u002Ftmp\u002Fboard-items.json)\n\n# Per drift row, set the Wave field.\nwhile IFS=$'\\t' read -r url current expected; do\n  ITEM_ID=$(jq -r --arg u \"$url\" '.data.organization.projectV2.items.nodes[]\n                                  | select(.content.url == $u) | .id' \\\n              \u002Ftmp\u002Fboard-items.json)\n  OPTION_ID=\"${WAVE_OPTION_IDS[$expected]:-}\"\n\n  if [ \"$expected\" = \"(clear)\" ]; then\n    # Clear the field — pass null value.\n    gh api graphql -f query='\nmutation($project: ID!, $item: ID!, $field: ID!) {\n  clearProjectV2ItemFieldValue(input: {projectId: $project, itemId: $item, fieldId: $field}) {\n    projectV2Item { id }\n  }\n}' -f project=\"$PROJECT_NODE_ID\" -f item=\"$ITEM_ID\" -f field=\"$WAVE_FIELD_ID\" \\\n      || echo \"WARN: clear failed for $url\"\n  elif [ -n \"$OPTION_ID\" ]; then\n    gh api graphql -f query='\nmutation($project: ID!, $item: ID!, $field: ID!, $option: String!) {\n  updateProjectV2ItemFieldValue(input: {\n    projectId: $project, itemId: $item, fieldId: $field,\n    value: {singleSelectOptionId: $option}\n  }) { projectV2Item { id } }\n}' -f project=\"$PROJECT_NODE_ID\" -f item=\"$ITEM_ID\" \\\n   -f field=\"$WAVE_FIELD_ID\" -f option=\"$OPTION_ID\" \\\n      || echo \"WARN: sync failed for $url\"\n  else\n    echo \"WARN: no Wave option for $expected; add it to project 2 (Settings → Fields → Wave → Add option) and rerun\"\n  fi\ndone \u003C\u003C\u003C \"$(printf '%s\\n' \"${DRIFT[@]}\")\"\n```\n\n### 8. Read-back verify\n\nRe-run step 2 (board fetch) and re-compute step 3 (orphans) + step 4 (drift). Success criterion is **actionable drift == 0** AND **orphan count == 0** — the `NOOP_COUNT` bucket is expected to be non-zero on a healthy board (any issue intentionally left unlabeled lives here) and MUST NOT fail the read-back. If actionable drift or orphans are non-zero post-sync, surface to the user — the gh \u002F GraphQL mutations may have silently no-op'd per the projects-classic deprecation family.\n\n### 9. Report\n\n```\nBoard audit complete:\n- Orphans added: {count} (was {pre} → board now has {post} items)\n- Wave fields synced: {count} (pre-actionable-drift: {pre} → post-actionable-drift: {post})\n- No-op equivalents (unset == clear): {count} (informational; unchanged by sync)\n- Missing Wave-field options: {list, if any}\n- Read-back actionable drift remaining: {count}\n```\n\nIf read-back actionable drift > 0, raise a warning and link to charter `pull-requests.md § gh pr edit projects-classic deprecation` (the same silent-no-op family). A non-zero no-op count is normal and does NOT warrant escalation.\n\n## Acceptance criteria status (per main#199)\n\n- [x] Skill `\u002Fboard-audit` exists at `.claude\u002Fskills\u002Fboard-audit\u002FSKILL.md`.\n- [x] Skill detects orphans across all 8 repos and project 2 (steps 1-3).\n- [x] Skill detects wave label (`wave-{X}` \u002F grandfathered `p{N}-wave-{M}`) \u002F Wave-field drift (step 4).\n- [x] Skill bulk-adds orphans with user confirmation (steps 5-6).\n- [x] Skill bulk-syncs Wave field via GraphQL `updateProjectV2ItemFieldValue` mutation (step 7).\n- [ ] Project 2 Wave-field options extended with `P2W10` + `P3W1`+ — **OWNER ACTION REQUIRED** (one-time per phase; not a code change).\n- [x] Skill wired into `\u002Fwave-kickoff` and `\u002Fwave-retro` — added in this PR via SKILL.md cross-refs (callers update sequentially when next invoked).\n- [x] Skill referenced from `\u002Fsession-start` step 5 — added in this PR via SKILL.md cross-refs.\n- [x] Charter `issues.md` (or `skills.md`) documents the labels-canonical rule — added in this PR via `skills.md § Cross-repo-status.json upsert pattern` companion section + a one-line note in `issues.md`.\n\n## Out of scope (deliberately)\n\n- Daily cron (issue body Option B) — deferred unless drift recurs after this skill ships.\n- Auto-add via Hook 13 extension — Hook 13 catches in-session creates; extending it to cron-style cross-repo scans is the Option B path, deferred for the same reason.\n- Wave-field option auto-creation — `gh project field-create` requires project-edit scope; one-time owner action.\n\n## Skill-authoring notes — GitHub API access patterns\n\nThese are the footguns this skill hit (main#888, surfaced during the P7W19 `\u002Fboard-audit`\nrun). Any skill that queries the GitHub GraphQL or REST APIs over a growing collection\nshould heed them:\n\n- **GraphQL connections cap at 100 — always paginate.** Every GraphQL *connection*\n  (`items`, `nodes`, `issues`, …) rejects `first:` > 100 with a hard error and returns\n  zero rows. Use `first: 100` + `pageInfo { hasNextPage endCursor }` + a `$endCursor`\n  query var + `gh api graphql --paginate`, then merge pages with `jq -s`. Never raise\n  `first:` to \"fit the dataset\" — that is the over-cap regression (Step 2).\n- **Derive in memory; don't loop network calls per row.** If you already have the data in\n  a bulk response (or can get it in one `gh … --json` call per repo), cross-reference it\n  in memory (an `awk`\u002F`jq` hash join) rather than an `O(collection)` per-item `gh view`\n  loop (Step 1 + Step 4).\n- **Wrap each external call in a `timeout` and skip-and-warn.** A single stalled `gh`\u002FHTTP\n  call must not hang a whole multi-repo sweep; bound it and continue (Step 1).\n\nA cheap regression lint for the first item ships at\n[`.claude\u002Flib\u002Flint_skill_graphql_pagination.py`](..\u002F..\u002Flib\u002Flint_skill_graphql_pagination.py):\nit flags `first: \u003Cn≥100>` inside a `gh api graphql` block across `.claude\u002Fskills\u002F**\u002F*.md`.\nRun it over the skills tree with:\n\n```bash\npython3 .claude\u002Flib\u002Flint_skill_graphql_pagination.py .claude\u002Fskills\u002F**\u002F*.md\n```\n\nWiring it into pre-commit\u002FCI is a deliberate follow-up (it is not yet a blocking gate); its\ndetection logic is covered by `.claude\u002Flib\u002Ftests\u002Ftest_lint_skill_graphql_pagination.py`.\n\n## Promotion provenance\n\nMemory `feedback_wave_planning_from_board.md` (2026-04-23 — the 37% drift discovery) → owner decision 2026-04-25 (labels canonical, Wave field derived) → this skill. Originating issue: main#199. Sibling-of: main#286 (hookify \u002Fwave-kickoff Steps 7+8, which depends on a current board); main#196 (\u002Fwave-scope, which depends on a current board). Class: same family as #286 — automation of cross-repo bookkeeping that decayed via in-band-repair patterns.\n",{"args":37,"name":5,"description":7},"(none — runs against project 2 and all 8 org repos)","main","53ec1032b93d41533a48603e8fae7a92f56cc66c","intake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fboard-audit","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework","https:\u002F\u002Fgithub.com\u002Fparametrization","2026-09-21 01:06:30",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add parametrization\u002F2real-team-framework --skill board-audit",{"tool":50,"command":51},"bunx","bunx skills add parametrization\u002F2real-team-framework --skill board-audit",{"tool":53,"command":54},"pnpm","pnpm dlx skills add parametrization\u002F2real-team-framework --skill board-audit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fintake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fboard-audit\u002FSKILL.md",true,[58],{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"resources\u002Fimplementation-playbook.md","REFERENCE","参考文档",14903,"https:\u002F\u002Fgithub.com\u002Fagency-black\u002FSkills\u002Fblob\u002Fmain\u002Fvector-index-tuning\u002Fresources\u002Fimplementation-playbook.md",[65,87,104,120,135,148],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":32},"01M6E5VG1R7FF1025BZAV6BDTS","wave-wrapup","Finalize a wave — PR review, merge sequencing, issue cleanup, worktree cleanup, and handoff to retro","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fintake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fwave-wrapup\u002FSKILL.md",[],[72,73,74,75,76,77,78,79,80,81,82,83,84,85,86],"wave wrapup","wrapup","review","handoff","merge","pr review","pr","cleanup","worktree","retro","team","issue","worktree cleanup","name","sequencing",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":32},"01M6E5V9GDF75GV4YD2WPSH912","wave-start","Initialize a new wave — worktree cleanup, branch creation, label setup, status file update","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fintake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fwave-start\u002FSKILL.md",[],[94,95,96,79,97,80,98,82,99,100,101,84,102,85,103],"wave start","start","setup","update","file","branch","file update","initialize","creation","status",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":32},"01M6E5V4VXEJ39V87VHN1A3AW9","wave-scope","Reconcile declared-vs-labeled wave scope between \u002Fwave-retro and \u002Fwave-kickoff — collect dispositions, fold in retro carry-forwards and memory must-includes, and refresh the meta-issue","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fintake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fwave-scope\u002FSKILL.md",[],[111,112,113,114,115,81,116,117,118,83,119],"wave scope","scope","memory","collect","Meta","refresh","reconcile","Fold","kickoff",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":32},"01M6E5TZNPGG5EXZEN1FKJJT6K","wave-retro","Automated wave retrospective — PR analysis, assessments, trust matrix updates, feedback log, charter change proposals","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fintake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fwave-retro\u002FSKILL.md",[],[127,81,128,129,78,130,131,82,132,133,134,85],"wave retro","log","change","retrospective","analysis","feedback","proposals","trust",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":32},"01M6E5TR8XB3Z10A9SD4ZYNV45","wave-kickoff","Automated wave planning — branch creation, label management, issue labeling, kickoff comments, and execution plan","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fintake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fwave-kickoff\u002FSKILL.md",[],[142,119,143,83,102,85,144,82,145,99,146,147],"wave kickoff","management","plan","execution","planning","execution plan",{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":154,"publishedAt":32},"01M6E5TMZAFB6MTVYT750FZDVY","wave-audit","Audit open issues against merged PRs — find and close orphaned issues with proper comments","https:\u002F\u002Fgithub.com\u002Fparametrization\u002F2real-team-framework\u002Fblob\u002Fmain\u002Fintake\u002Fnoorinalabs-2026-06\u002Fcandidates\u002Fskills\u002Fwave-audit\u002FSKILL.md",[],[18,155,156,157,158,23],"wave audit","close","find","open"]