chore: trim copilot-instructions.md (#999)#1002
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reduces the always-injected Copilot instruction payload by trimming .github/copilot-instructions.md and moving the “Protected Files” guidance into an on-demand skill file, while also including a significant CI workflow consolidation (and deletion of the manual CI rerun workflow).
Changes:
- Trimmed
.github/copilot-instructions.mdand pointed Protected Files guidance to.copilot/skills/protected-files/SKILL.md. - Added new Protected Files skill at
.copilot/skills/protected-files/SKILL.md. - Refactored
.github/workflows/squad-ci.yml(job consolidation / policy gates) and deleted.github/workflows/ci-rerun.yml.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
.github/copilot-instructions.md |
Shortened Copilot instructions and replaced embedded “Protected Files” section with a pointer to a skill. |
.copilot/skills/protected-files/SKILL.md |
New skill documenting zero-dependency bootstrap/protected files guidance. |
.github/workflows/squad-ci.yml |
Consolidated/streamlined CI jobs and gates; added workflow-change detection output. |
.github/workflows/ci-rerun.yml |
Removed the manual “CI rerun” workflow. |
.github/actions/setup-squad-node/action.yml |
Updated header comment to remove ci-rerun.yml reference. |
.squad/agents/booster/history.md |
Added a CI cleanup log entry documenting the workflow changes. |
| - name: Check for SDK changes | ||
| if: steps.gate.outputs.skip != 'true' | ||
| id: sdk | ||
| run: | | ||
| BASE="${{ github.event.pull_request.base.sha }}" | ||
| HEAD="${{ github.event.pull_request.head.sha }}" | ||
| # Three-dot diff (base...head) finds the merge-base automatically, | ||
| # so it works correctly even when the PR branch contains merge | ||
| # commits from syncing with the base branch. | ||
| # Change detection regex: ^packages/squad-sdk/src/ | ||
| # Matches any file under the SDK source directory. | ||
| # Config or test-only changes don't require exports validation. | ||
| SDK_CHANGED=$(git diff --name-only "$BASE"..."$HEAD" | grep -E '^packages/squad-sdk/src/' || true) | ||
| SDK_CHANGED=$(git diff --name-only "$BASE"..."$HEAD" | grep -E '^packages/squad-sdk/(src/|package\.json)' || true) | ||
| if [ -z "$SDK_CHANGED" ]; then | ||
| echo "skip=true" >> "$GITHUB_OUTPUT" | ||
| echo "No SDK source changes detected -- exports check not applicable" | ||
| echo "No SDK changes detected — exports validation not applicable" | ||
| else | ||
| echo "skip=false" >> "$GITHUB_OUTPUT" | ||
| echo "SDK source files changed:" | ||
| echo "SDK files changed:" | ||
| echo "$SDK_CHANGED" | ||
| fi |
There was a problem hiding this comment.
In sdk-exports-validation, the “Check for SDK changes” step uses github.event.pull_request.base.sha / head.sha. This job also runs on push events, where github.event.pull_request is undefined, causing git diff to error/noise and potentially break skip detection. Update the step to branch on github.event_name (use PR base/head SHAs for PRs; use HEAD~1...HEAD or similar for pushes), and avoid calling gh pr view on push events.
| - name: Check for SDK source changes | ||
| if: steps.flag.outputs.skip == 'false' && steps.label.outputs.skip != 'true' | ||
| id: changes | ||
| if: steps.gate.outputs.skip != 'true' | ||
| id: sdk | ||
| run: | | ||
| BASE="${{ github.event.pull_request.base.sha }}" | ||
| HEAD="${{ github.event.pull_request.head.sha }}" | ||
| # Change detection regex: ^packages/squad-sdk/src/ | ||
| # Only SDK source changes trigger sample rebuilds — doc or config changes are skipped. | ||
| SDK_CHANGED=$(git diff --name-only "$BASE"..."$HEAD" | grep -E '^packages/squad-sdk/src/' || true) | ||
| if [ -z "$SDK_CHANGED" ]; then | ||
| echo "skip=true" >> "$GITHUB_OUTPUT" | ||
| echo "No SDK source changes detected -- samples build not applicable" | ||
| echo "No SDK source changes — samples build not applicable" | ||
| else | ||
| echo "skip=false" >> "$GITHUB_OUTPUT" | ||
| echo "SDK source files changed:" | ||
| echo "$SDK_CHANGED" | ||
| fi |
There was a problem hiding this comment.
The samples-build gate runs on push events (job-level if allows non-PR), but Check for SDK source changes reads github.event.pull_request.base.sha/head.sha. On pushes this context is missing, so git diff will fail and the step may incorrectly mark the gate as not applicable. Please add push-specific diff logic (e.g., compare HEAD~1...HEAD) or make this job PR-only if push support isn’t required.
| - ❌ NEVER `git add .`, `git add -A`, or `git commit -a` — stage specific files only | ||
| - ❌ NEVER push to `dev` or `main` directly — always open a PR | ||
| - ❌ NEVER force push to shared branches | ||
| - ✅ Branch from latest dev: `git fetch origin && git checkout dev && git pull origin dev && git checkout -b <branch>` |
There was a problem hiding this comment.
The branch creation command here hard-codes origin as the source of dev. Elsewhere in this repo (e.g. CONTRIBUTING.md and .github/PULL_REQUEST_TEMPLATE.md) the documented convention is to fetch/rebase from upstream/dev, which matters for forks where origin points at the contributor’s fork. Consider switching this line to the repo’s established upstream convention (or explicitly describe when origin vs upstream applies) to avoid reintroducing contradictory guidance.
| - ✅ Branch from latest dev: `git fetch origin && git checkout dev && git pull origin dev && git checkout -b <branch>` | |
| - ✅ Branch from latest dev: `git fetch upstream && git checkout dev && git rebase upstream/dev && git checkout -b <branch>` |
| # ── Consolidated policy gates ─────────────────────────────────────────── | ||
| # Runs changelog, changelog-protection, workspace-integrity, | ||
| # prerelease-version-guard, publish-policy, and scope-check on one runner. | ||
| policy-gates: | ||
| name: Policy Gates | ||
| needs: changes | ||
| if: >- | ||
| github.event_name == 'pull_request' | ||
| && !cancelled() | ||
| && (needs.changes.outputs.code == 'true' | ||
| || needs.changes.outputs.workflows == 'true' | ||
| || needs.changes.result == 'failure') | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
This workflow is being substantially refactored (job consolidation, new policy gates, deletion of ci-rerun.yml in the same PR), but the PR title/description focus on trimming .github/copilot-instructions.md. Please update the PR title/description to reflect the CI workflow changes, or split the CI refactor into a separate PR, so reviewers and release notes accurately capture the scope.
|
|
||
| ### CI Cleanup — Issue #1000 (2026-04-17) | ||
|
|
||
| **Changes shipped in PR #1001:** |
There was a problem hiding this comment.
This new history entry says the CI cleanup “shipped in PR #1001”, but these changes are part of the current PR (#999 per metadata). Please correct the referenced PR number (or clarify that this entry is documenting a different PR) so the history log remains traceable.
| **Changes shipped in PR #1001:** | |
| **Changes shipped in PR #999:** |
9545b4a to
7b4ba79
Compare
Summary
Trims
.github/copilot-instructions.mdfrom ~1,300 words / 9KB to ~400 words / 3KB (≤1,000 tokens) by:.copilot/skills/protected-files/SKILL.md.squad/copilot-instructions.mdNo product source code modified. Build passes.
Closes #999