squad-conventions

Documents coding conventions and patterns for the Squad CLI codebase.

Updated Jun 2, 2026
One-click install
npx skills add https://github.com/codebytes/btt --skill squad-conventions-codebytes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: squad-conventions
Source: https://github.com/codebytes/btt/tree/main/.copilot/skills/squad-conventions
Command: npx skills add https://github.com/codebytes/btt --skill squad-conventions-codebytes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Contributors modifying the Squad CLI source code risk violating its core constraints—such as its zero-dependency rule or Windows compatibility requirements—without a single reference documenting the project's established patterns. ## Core Features & Use Cases - Zero-Dependency Enforcement: Documents the hard constraint that Squad uses only Node.js built-ins (fs, path, os, child_process) with no npm dependencies. - Error Handling & Testing Patterns: Defines the fatal() error pattern, ANSI color constants, and the node:test built-in test runner conventions. - File Structure & Init Semantics: Explains the .squad/ directory ownership model, skip-if-exists init idempotency, and upgrade overwrite rules. - Use Case: Before editing index.js or adding a feature to the create-squad package, load this Skill to ensure your changes use path.join(), avoid new dependencies, and route errors through fatal(). ## 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 like fs, path, os, and child_process, and nothing may be added to dependencies in package.json.

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 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. 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 never overwrite user-owned state like .squad/ content. Only the upgrade flow overwrites files, and only Squad-owned ones such as templates and the coordinator prompt.