squad-conventions

Documents core coding conventions and patterns for the Squad CLI codebase.

1|Updated Jul 7, 2026
One-click install
npx skills add https://github.com/seiggy/maf-copilot-studio-demo --skill squad-conventions-seiggy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: squad-conventions
Source: https://github.com/seiggy/maf-copilot-studio-demo/tree/main/.copilot/skills/squad-conventions
Command: npx skills add https://github.com/seiggy/maf-copilot-studio-demo --skill squad-conventions-seiggy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Contributors modifying the Squad CLI source code risk violating its hard constraints, such as its zero-dependency rule, Windows compatibility requirements, and init idempotency guarantees. This Skill provides the authoritative conventions needed before touching any Squad source file. ## Core Features & Use Cases - Zero-Dependency Enforcement: Documents the hard rule that Squad uses only Node.js built-ins (fs, path, os, child_process) with no npm dependencies. - Error Handling & UX Patterns: Defines the fatal() error pattern, ANSI color constants, and the skip-if-exists init flow that protects user state. - Cross-Platform Rules: Mandates path.join() for all file paths so tests pass on Windows, macOS, and Linux. - Use Case: Before adding a new feature to the Squad CLI, load these conventions to ensure your code uses node:test for tests, fatal() for errors, and never overwrites user-owned files during init. ## Quick Start Review the Squad codebase conventions before modifying any source file in the create-squad package.

Frequently Asked Questions about squad-conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle errors in the Squad CLI codebase?

All user-facing errors go through the fatal(msg) function, which prints a red ✗ prefix and exits with code 1. Never throw unhandled exceptions or print raw stack traces; a global uncaughtException handler calls fatal() as a safety net.

Can I add npm dependencies to the Squad package?

No. Squad is a zero-dependency package and this is a hard constraint, not a preference. Everything must use Node.js built-ins such as fs, path, os, and child_process, and nothing may be added to dependencies in package.json.

What test framework does Squad use for Node.js?

Squad uses the Node.js built-in test runner with node:test and node:assert/strict, with no external test frameworks. Tests live in the test/ directory and run via npm test, which executes node --test test/.

Does Squad support Windows file paths?

Yes, Squad must work on Windows, macOS, and Linux. Always use path.join() for file paths and never hardcode forward or backward slash separators, and all tests must pass on every platform.

Why does Squad init skip existing files?

The init flow uses a skip-if-exists pattern to guarantee idempotency and protect user-owned state in .squad/ from being overwritten. Only the upgrade flow overwrites files, and only Squad-owned ones like templates and the coordinator prompt.