Skip to content

feat(cli): ship 8 built-in skills on init/upgrade (#788)#796

Merged
tamirdresher merged 3 commits intodevfrom
squad/788-builtin-skills
Apr 4, 2026
Merged

feat(cli): ship 8 built-in skills on init/upgrade (#788)#796
tamirdresher merged 3 commits intodevfrom
squad/788-builtin-skills

Conversation

@tamirdresher
Copy link
Copy Markdown
Collaborator

@tamirdresher tamirdresher commented Apr 3, 2026

What

Ships 8 curated built-in skills with squad init and squad upgrade, covering error recovery, security, git workflow, session recovery, code review, testing discipline, and collaboration.

Why

Only 1 skill (squad-conventions) shipped previously. Users start with no earned knowledge. These 8 cover the most impactful patterns. Closes #788

How

Added 7 new skill entries to TEMPLATE_MANIFEST in templates.ts (alongside existing squad-conventions), all with overwriteOnUpgrade: true:

  • error-recovery, secret-handling, git-workflow, session-recovery
  • reviewer-protocol, test-discipline, agent-collaboration
    All template source files already exist in packages/squad-cli/templates/skills/.

Testing

  • npm run build passes
  • npm test passes (5 new tests — manifest completeness, ownership, source existence, destination format, minimum count)

Docs

  • Changeset entry (builtin-skills.md)
  • Skills doc update (will be added in follow-up commit)

Exports

N/A

Breaking Changes

None — additive. Upgrade adds new skills without overwriting user-modified ones (template copies use squad-owned flag).

Waivers

None

@tamirdresher tamirdresher requested review from Copilot and diberry April 3, 2026 18:52
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 94a00f9

⚠️ 4 item(s) to address before review

Status Check Details
Single commit 3 commits — consider squashing before review
Not in draft Ready for review
Branch up to date Up to date with dev
Copilot review No Copilot review yet — it may still be processing
Changeset present Changeset file found
Scope clean No .squad/ or docs/proposals/ files
No merge conflicts No merge conflicts
Copilot threads resolved 2 unresolved Copilot thread(s) — fix and resolve before merging
CI passing 14 check(s) still running

This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to curate and ship a set of 8 built-in Copilot skills that are installed to .copilot/skills/ during squad init and refreshed during squad upgrade, with tests and a changeset to track the release.

Changes:

  • Adds 7 new skill entries (plus the already-present squad-conventions) to TEMPLATE_MANIFEST, marked overwriteOnUpgrade: true.
  • Adds a new Vitest suite to validate the built-in skill entries in TEMPLATE_MANIFEST.
  • Adds a changeset to release @bradygaster/squad-cli as a minor version bump.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/squad-cli/src/cli/core/templates.ts Extends the template manifest to include the curated built-in skills targeting .copilot/skills/*/SKILL.md with overwrite-on-upgrade.
test/builtin-skills.test.ts Adds unit tests to assert the manifest contains the expected built-in skill entries and that template sources exist.
.changeset/builtin-skills.md Declares a minor release and documents the new built-in skills behavior.

Comment on lines +183 to +188
{
source: 'skills/error-recovery/SKILL.md',
destination: '../.copilot/skills/error-recovery/SKILL.md',
overwriteOnUpgrade: true,
description: 'Graceful error recovery patterns',
},
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says a curated set of 8 skills ships on squad init/upgrade, but squad init currently delegates to sdkInitSquad(), which copies the entire templates/skills directory into .copilot/skills when empty (so any extra skill templates included in the package will also be installed). Meanwhile, squad upgrade refreshes only the skills listed in this TEMPLATE_MANIFEST. This mismatch can leave additional installed skills stale on upgrade (or defeat the “curated 8” intent). Consider aligning init+upgrade by either copying only the curated list on init, or by ensuring the packaged templates/skills directory contains only the curated skills (or expanding the upgrade list to match what init installs).

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +6
import { TEMPLATE_MANIFEST } from '../packages/squad-cli/src/cli/core/templates.js';
import { existsSync } from 'node:fs';
import path from 'node:path';

const TEMPLATES_DIR = path.join(process.cwd(), 'packages', 'squad-cli', 'templates');
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test hard-codes process.cwd() to locate packages/squad-cli/templates. That will break if the suite is run with a different working directory (e.g., from a workspace subdir). Prefer reusing the production resolver (getTemplatesDir()) from the templates module to compute the templates root for entry.source lookups.

Suggested change
import { TEMPLATE_MANIFEST } from '../packages/squad-cli/src/cli/core/templates.js';
import { existsSync } from 'node:fs';
import path from 'node:path';
const TEMPLATES_DIR = path.join(process.cwd(), 'packages', 'squad-cli', 'templates');
import { TEMPLATE_MANIFEST, getTemplatesDir } from '../packages/squad-cli/src/cli/core/templates.js';
import { existsSync } from 'node:fs';
import path from 'node:path';
const TEMPLATES_DIR = getTemplatesDir();

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +22
describe('built-in skills in TEMPLATE_MANIFEST', () => {
const skillEntries = TEMPLATE_MANIFEST.filter(f => f.destination.includes('.copilot/skills/'));

Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests validate that TEMPLATE_MANIFEST contains the expected skill entries, but they don’t assert the end-to-end behavior described in the PR (what actually gets installed on squad init, and what gets overwritten on squad upgrade). Since init currently installs skills via the SDK templates copy logic, add an integration-style assertion (temp dir + runInit / upgrade path) that verifies the installed skill set and overwrite semantics match the curated list intent.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

🏗️ Architectural Review

⚠️ Architectural review: 1 warning(s), 1 info.

Severity Category Finding Files
🟡 warning bootstrap-area 2 file(s) in the bootstrap area (packages/squad-cli/src/cli/core/) were modified. These files must maintain zero external dependencies. Review carefully. packages/squad-cli/src/cli/core/init.ts, packages/squad-cli/src/cli/core/templates.ts
ℹ️ info template-sync Template files changed in packages/squad-cli/templates/ but not in other template locations. If these templates should stay in sync, consider updating the others too. Changed: packages/squad-cli/templates/, Unchanged: templates/, .squad-templates/, .github/workflows/

Automated architectural review — informational only.

@tamirdresher tamirdresher requested a review from bradygaster April 4, 2026 21:39
@tamirdresher tamirdresher force-pushed the squad/788-builtin-skills branch from b480f93 to e97f50e Compare April 4, 2026 21:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

🟡 Impact Analysis — PR #796

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 6
Files added 2
Files modified 4
Files deleted 0
Modules touched 4

🎯 Risk Factors

  • 6 files changed (6-20 → MEDIUM)
  • 4 modules touched (2-4 → MEDIUM)

📦 Modules Affected

root (1 file)
  • .changeset/builtin-skills.md
squad-cli (3 files)
  • packages/squad-cli/src/cli/core/init.ts
  • packages/squad-cli/src/cli/core/templates.ts
  • packages/squad-cli/templates/skills/cross-squad/SKILL.md
squad-sdk (1 file)
  • packages/squad-sdk/templates/skills/cross-squad/SKILL.md
tests (1 file)
  • test/builtin-skills.test.ts

This report is generated automatically for every PR. See #733 for details.

Copilot and others added 3 commits April 5, 2026 00:52
- Add 7 new skills to TEMPLATE_MANIFEST (error-recovery, secret-handling,
  git-workflow, session-recovery, reviewer-protocol, test-discipline,
  agent-collaboration) alongside existing squad-conventions
- All squad-owned (overwriteOnUpgrade: true)
- Upgrade adds new skills without overwriting user-modified ones
- 5 new tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rewrites the cross-squad built-in skill with Pathfinder patterns from
blog Part 8: Squad HQ, S2S protocol, Unix-style AI composition,
fleet dispatch, and cross-machine coordination.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add code comment explaining init delegates to sdkInitSquad by design
- Replace process.cwd() with __dirname for resilient path resolution in test
- Add comment clarifying these are unit tests; e2e via squad init integration

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tamirdresher tamirdresher force-pushed the squad/788-builtin-skills branch from e97f50e to 94a00f9 Compare April 4, 2026 21:52
@tamirdresher tamirdresher merged commit 53eddac into dev Apr 4, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Built-in skills bundled with squad init/upgrade

2 participants