protected-files

A set of rules for bootstrap files that run before a command-line tool loads its main software libraries. These files must use no npm packages or SDK code.

In plain words
What is it for?
It identifies protected files, blocks unsafe imports and refactors, and guides developers toward zero-dependency implementations.
Why use it?
It prevents startup crashes caused by early utility files importing code that is not available until later initialization.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/bradygaster/squad/protected-files
Any agent
npx skills add bradygaster/squad --skill protected-files
Clone the repo
git clone --depth 1 https://github.com/bradygaster/squad

Made for: Claude Code, Codex.

Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 695 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00017 $0.00695
Opus 5 $0.00009 $0.00347
Sonnet 5 $0.00003 $0.00139
Haiku 4.5 $0.00002 $0.00069

Measured 3d ago against content hash f0029a535d72, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

protected-files scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

| `packages/squad-cli/src/cli/core/gh-cli.ts` | GitHub CLI wrapper — uses only `node:child_process` and `node:util` |
.copilot/skills/protected-files/SKILL.md · 54 lines

How it starts

The opening of the file, as written. The whole thing — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context

The CLI (squad-cli) has bootstrap utilities that run before the Squad SDK is loaded. If these files import SDK code (e.g., FSStorageProvider, anything from squad-sdk), the CLI breaks at startup — no helpful error, just a crash.

This skill applies when:

  • Touching any file in packages/squad-cli/src/cli/core/
  • Running sweeping refactors (e.g., "convert all fs calls to StorageProvider")
  • Adding new bootstrap utilities

Protected File List

File Purpose
packages/squad-cli/src/cli/core/detect-squad-dir.ts Finds .squad/ directory at startup — runs before SDK init
packages/squad-cli/src/cli/core/errors.ts Error classes (SquadError, fatal()) — used by all CLI entry points
packages/squad-cli/src/cli/core/gh-cli.ts GitHub CLI wrapper — uses only node:child_process and node:util
packages/squad-cli/src/cli/core/output.ts Color/emoji console output — pure ANSI codes, zero imports
packages/squad-cli/src/cli/core/history-split.ts Separates portable knowledge from project data — pure string logic

Rules

  • NEVER convert these files to use FSStorageProvider, StorageProvider, or any SDK abstraction
  • NEVER add import or require statements referencing packages outside node:* built-ins
  • ONLY use node:fs, node:path, node:child_process, node:util, and other Node.js built-in modules
  • DO check this list before sweeping refactors
  • LOOK for — zero dependencies markers in file headers as a signal

SDK/CLI Package Boundary

The packages/squad-cli/src/cli/core/ directory contains a mix of early-startup bootstrap utilities and later SDK-dependent modules. The protected list above is the authoritative set of zero-dependency bootstrap files. If you need to add SDK imports to another core/ file, verify it is not in the protected list and confirm the SDK is loaded at that point in the startup sequence.

Anti-Patterns

  • Converting all fs calls to StorageProvider without checking this list first
  • Adding import { X } from '@bradygaster/squad-sdk' to a bootstrap file
  • Assuming every file in core/ can safely import SDK code

Read the full file on GitHub · 54 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 54 lines · 17 tokens per session scan A f0029a535d72

Subscribe to this mod's changes

protected-files is a skill published in the GitHub repository bradygaster/squad (3,150 stars, last pushed yesterday), licensed MIT. It adds 17 tokens to every session and 695 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories