From efa43aca5554ed00bd1784ea0e9bcb12f48e0e86 Mon Sep 17 00:00:00 2001 From: Joe Amditis Date: Sat, 2 May 2026 20:52:02 -0400 Subject: [PATCH] Add copilot-globals sync mechanism (closes #59) Hoists Joe's user-level review rules out of every project's .github/copilot-instructions.md (which were pushing 3 repos past the 4k Copilot-read cap) into a path-scoped .github/instructions/globals.instructions.md file synced from a single source. - scripts/sync-copilot-globals.py reads ~/.claude/copilot-globals.md (hand-curated source) and writes .github/instructions/globals.instructions.md into each repo listed in scripts/sync-targets.txt. Supports --dry-run, --only NAME filter, and --source / --targets overrides for testing. Idempotent (re-runs report 'unchanged'). - scripts/sync-targets.txt: subscribed repos, one absolute path per line, '#' for comments, '~' expansion. Initially just tools/. - .github/instructions/globals.instructions.md: generated output. Has applyTo: "**" frontmatter so Copilot's PR reviewer reads it on every PR. Contains writing style, banned words, AI-attribution rule, and code-quality basics. - .github/copilot-instructions.md: removed the now-redundant 'Global rules to flag' section (down from 2886 to 2845 chars; ~1700 chars freed for project-specific bug classes). Tightened the favicon/OG rule to scope to resource-kit/docs/**/*.html (the actual deployed surface), exempting _archive/**. - CLAUDE.md: documents the sync workflow, where the source lives, and the explicit rule that no project's CLAUDE.md is sliced for the Copilot cap. CLAUDE.md remains single source of truth for primary coding assistants. The next 3 PRs (rosen-frontend, class, houseofjawn-bot) add those repos to sync-targets.txt and slim their copilot-instructions.md files the same way. --- .github/copilot-instructions.md | 12 +- .github/instructions/globals.instructions.md | 29 +++++ CLAUDE.md | 24 ++++ scripts/sync-copilot-globals.py | 128 +++++++++++++++++++ scripts/sync-targets.txt | 16 +++ 5 files changed, 200 insertions(+), 9 deletions(-) create mode 100644 .github/instructions/globals.instructions.md create mode 100755 scripts/sync-copilot-globals.py create mode 100644 scripts/sync-targets.txt diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 913ef2a..a0af98f 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -2,18 +2,12 @@ Project context, architecture, and conventions live in [CLAUDE.md](../CLAUDE.md). Both this file and CLAUDE.md are read by Copilot code review (cap ~4,000 chars each). This file lists the rules worth named attention on every PR. -## Global rules to flag - -These are Joe's user-level conventions from `~/.claude/CLAUDE.md`, restated here because Copilot's PR review bot does not read user-level files. - -- **Sentence case** in UI text, headings, comments, prose, and commit messages. Code identifiers follow language conventions: camelCase (JS), kebab-case (CSS class names), snake_case (Python). The rule is about not writing English prose in Title Case, not about overriding language naming conventions. -- **No emojis** in source code, log messages, comments, commits, PR bodies, or any output. Plain text only. -- **No AI-authorship attribution.** Never include "Generated with Claude Code", `Co-Authored-By: Claude` trailers, or any "AI-assisted"/"Generated by"-style notes in PR bodies, commit trailers, code comments, or committed docs. Mentioning model/company names in technical documentation (including this file's anti-slop guidance) is fine — the ban is on AI authorship credits. -- **Banned words / anti-slop.** Replace or delete (this list is a review reference and is exempt from its own rule): *comprehensive, sophisticated, robust, transformative, leveraging, seamlessly, innovative, cutting-edge, state-of-the-art, holistic, synergy, ecosystem, paradigm, empower*. -- **Every public-facing HTML page must include the favicon link tag** `` (use a relative path from each subdirectory) and full OG/Twitter meta tags: `og:title`, `og:description`, `og:type`, `og:url`, `og:image` (1200x630), `og:image:width=1200`, `og:image:height=630`, `twitter:card=summary_large_image`, `twitter:title`, `twitter:description`, `twitter:image`. Missing favicons are a security signal — automated scanners flag pages without them. +User-level globals (sentence case, no emojis, banned words, no AI-authorship attribution, code-quality basics) live in [`.github/instructions/globals.instructions.md`](instructions/globals.instructions.md), generated from `~/.claude/copilot-globals.md` by `scripts/sync-copilot-globals.py`. Don't restate them here. ## Project-specific bug classes to flag +- **Every deployed HTML page** under `resource-kit/docs/**/*.html` (the GitHub Pages source) must include the favicon link tag `` (relative path from each subdirectory) and full OG/Twitter meta tags: `og:title`, `og:description`, `og:type`, `og:url`, `og:image` (1200x630), `og:image:width=1200`, `og:image:height=630`, `twitter:card=summary_large_image`, `twitter:title`, `twitter:description`, `twitter:image`. Files outside `resource-kit/docs/` (including `_archive/**`) are not deployed and exempt. + - **No hardcoded API keys or secrets.** Static-site repo, no server. Any inline key in HTML/JS is a leak. - **Event listeners attached to the wrong scope.** The sidebar and modal in the LLM Advisor live OUTSIDE `#llm-tool-advisor-container`. Listeners attached only to the main container miss those elements. - **Generic class names inside SVG `