squad-conventions

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

2|Updated Jul 24, 2026
One-click install
npx skills add https://github.com/elbruno/ElBruno.MagenticUI --skill squad-conventions-elbruno
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: squad-conventions
Source: https://github.com/elbruno/ElBruno.MagenticUI/tree/main/.squad/templates/skills/squad-conventions
Command: npx skills add https://github.com/elbruno/ElBruno.MagenticUI --skill squad-conventions-elbruno

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Contributors modifying the Squad CLI source code risk violating its hard constraints, such as the zero-dependency rule or Windows compatibility requirements, without a single authoritative reference for project conventions. ## Core Features & Use Cases - Zero-Dependency Enforcement: Documents the hard rule that Squad uses only Node.js built-ins like fs, path, os, and child_process, with no npm dependencies allowed. - Error Handling & Testing Patterns: Defines the fatal() error pattern, ANSI color constants, and the node:test built-in runner conventions. - File Structure & Init Semantics: Explains the .squad/ directory layout, skip-if-exists init idempotency, and upgrade overwrite rules. - Use Case: Before editing index.js or adding a feature to the create-squad CLI, load this Skill to ensure your changes use path.join() for cross-platform paths and never overwrite user-owned state during init. ## Quick Start Review the Squad conventions before modifying any source file in the create-squad CLI project.

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.

What test framework does Squad use?▼

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 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. All tests must pass on every platform.

Why does Squad init skip existing files?▼

The init flow uses a skip-if-exists pattern to avoid overwriting user-owned state like .squad/ team files. Only the upgrade flow overwrites files, and only Squad-owned ones such as templates and the coordinator prompt.