Skip to content

Commit 5377d41

Browse files
authored
chore: trim npm package — exclude docs and contributor files (#48)
* chore: unignore .ai-team/ for dev branches, update contributing guide - Removed .ai-team/ from .gitignore so team files can be committed on dev/feature branches - Updated CONTRIBUTING.md to reflect guard workflow as enforcement (not .gitignore) - Updated guard workflow error message in both live and template copies - .npmignore still excludes .ai-team/ from the published package * chore: trim npm package — exclude docs, CONTRIBUTING.md, .gitignore - Removed docs/ from package.json files allowlist (read on GitHub, not runtime) - Added CONTRIBUTING.md, .gitignore, docs/ to .npmignore (belt-and-suspenders) - Package: 82 files / 205.7kB -> 30 files / 75.1kB (63% smaller) --------- Co-authored-by: bradygaster <bradygaster@users.noreply.github.com>
1 parent 8193504 commit 5377d41

6 files changed

Lines changed: 49 additions & 40 deletions

File tree

‎.github/workflows/squad-main-guard.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ jobs:
8181
'git push',
8282
'```',
8383
'',
84-
'> ⚠️ `.ai-team/` is in `.gitignore` but files previously force-added with `git add -f`',
85-
'> remain tracked. `git rm --cached` untracks them without deleting your local copies.',
84+
'> ⚠️ `.ai-team/` is committed on `dev` and feature branches by design.',
85+
'> The guard workflow is the enforcement mechanism that keeps these files off `main` and `preview`.',
86+
'> `git rm --cached` untracks them from this PR without deleting your local copies.',
8687
];
8788
8889
core.setFailed(lines.join('\n'));

‎.gitignore‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ Thumbs.db
1010
# Node (if we add tooling later)
1111
node_modules/
1212

13-
# Squad team state (created at runtime, never committed)
14-
# ⚠️ NEVER force-add these files (git add -f .ai-team/).
15-
# Previously force-added files remain tracked even with this rule.
16-
# If tracked files leak in, remove them: git rm --cached -r .ai-team/
17-
.ai-team/
13+
# Squad team state — committed on dev and feature branches,
14+
# blocked from main/preview by squad-main-guard.yml workflow.
15+
# ⚠️ NEVER merge .ai-team/ into main or preview.
16+
# The guard workflow will fail the PR if you try.
1817

1918
# Squad Squad templates (internal, not distributed)
2019
.ai-team-templates/

‎.npmignore‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Squad Squad — team state and development files
22
# These are excluded from the distributed package.
3-
# The product ships: index.js, templates/, docs/, CHANGELOG.md, .github/agents/squad.agent.md
3+
# The product ships: index.js, templates/, CHANGELOG.md, .github/agents/squad.agent.md
44
# (also enforced by package.json "files" field)
55

66
# Squad Squad (the AI team that builds Squad)
@@ -10,13 +10,20 @@
1010
# Internal team docs (proposals, sprint plans — never shipped)
1111
team-docs/
1212

13+
# Public docs (read on GitHub, not needed at runtime)
14+
docs/
15+
1316
# Tests
1417
test/
1518

1619
# Git/repo config not needed at runtime
20+
.gitignore
1721
.gitattributes
1822
.github/workflows/
1923

24+
# Repo contributor docs (not needed by users)
25+
CONTRIBUTING.md
26+
2027
# Editor / OS
2128
.vscode/
2229
.DS_Store

‎CONTRIBUTING.md‎

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ Squad uses a three-tier branch structure to protect production and staging while
6262

6363
| Branch | Purpose | Protection | Files Allowed |
6464
|--------|---------|------------|---------------|
65-
| **`dev`** | Development & integration | None | ✅ Everything |
66-
| **`feature/squad/{issue}-{slug}`** | Feature work | None — merge to dev | ✅ Everything |
65+
| **`dev`** | Development & integration | None | ✅ Everything (including `.ai-team/`) |
66+
| **`feature/squad/{issue}-{slug}`** | Feature work | None — merge to dev | ✅ Everything (including `.ai-team/`) |
6767
| **`preview`** | Staging & release candidate | Guard checks for `.ai-team/`, `team-docs/` (except blog/) | ✅ Most files — see [Protected Files](#whats-protected) |
6868
| **`main`** | Production & releases | Guard checks for `.ai-team/`, `team-docs/` (except blog/) | ✅ Most files — see [Protected Files](#whats-protected) |
6969

@@ -97,15 +97,15 @@ git push origin squad/42-auth-refresh
9797

9898
### 🚫 CRITICAL: Files Blocked from `main` and `preview`
9999

100-
These files are **runtime team state** and belong on development branches only:
100+
These files are **runtime team state** and live on `dev` and feature branches. They are committed to git and flow freely between `dev` and feature branches, but the **guard workflow** (`squad-main-guard.yml`) blocks them from reaching `main` or `preview`:
101101

102-
| Path | Reason | Merged to main? |
103-
|------|--------|-----------------|
104-
| **`.ai-team/**`** | Agent charters, routing, decisions, history, casting registry | ❌ NEVER |
105-
| **`team-docs/` (except `team-docs/blog/`** | Internal team documentation, sprint plans, notes | ❌ NEVER |
106-
| **`team-docs/blog/**`** | Public blog content | ✅ YES — blog posts are public |
102+
| Path | Reason | Committed to `dev`? | Merged to `main`/`preview`? |
103+
|------|--------|---------------------|---------------------------|
104+
| **`.ai-team/**`** | Agent charters, routing, decisions, history, casting registry | ✅ YES | ❌ NEVER — guard blocks |
105+
| **`team-docs/` (except `team-docs/blog/`** | Internal team documentation, sprint plans, notes | ✅ YES | ❌ NEVER — guard blocks |
106+
| **`team-docs/blog/**`** | Public blog content | ✅ YES | ✅ YES |
107107

108-
**Why?** `.ai-team/` contains persistent agent knowledge, routing rules, and decision history. It's internal infrastructure. If it leaks to `main`, you're shipping developer metadata as product. `team-docs/` is working notes — only blog content is publication-ready.
108+
**Why?** `.ai-team/` contains persistent agent knowledge, routing rules, and decision history. It's internal infrastructure that belongs on development branches — not in production. The guard workflow is the enforcement mechanism, not `.gitignore`. `.ai-team/` is NOT in `.gitignore` — it's a normal part of the `dev` branch. The `.npmignore` file ensures it's excluded from the published npm package.
109109

110110
### ✅ Files That Flow Freely
111111

@@ -171,7 +171,7 @@ If you accidentally (or intentionally) target `preview` or `main`, the **guard w
171171
If the guard blocks your PR because it contains `.ai-team/` or `team-docs/` files:
172172

173173
```bash
174-
# Remove .ai-team/ from git (keeps local copies safe)
174+
# Remove .ai-team/ from this PR (keeps local copies and dev branch copies safe)
175175
git rm --cached -r .ai-team/
176176
177177
# Remove team-docs/ except blog/
@@ -183,7 +183,7 @@ git commit -m "chore: remove internal team files from PR"
183183
git push
184184
```
185185

186-
The workflow will re-run and pass. Your local `.ai-team/` and `team-docs/` files remain untouched.
186+
The workflow will re-run and pass. Your local `.ai-team/` and `team-docs/` files remain untouched, and they continue to exist on `dev` normally.
187187

188188
---
189189

@@ -289,18 +289,18 @@ You don't need to add these yourself — the Lead will triage and label issues.
289289

290290
```
291291
squad/
292-
├── .ai-team/ 🚫 BLOCKED from main/preview
293-
│ ├── agents/
294-
│ │ ├── {name}/charter.md 🚫 BLOCKED
295-
│ │ └── {name}/history.md 🚫 BLOCKED
296-
│ ├── team.md 🚫 BLOCKED
297-
│ ├── routing.md 🚫 BLOCKED
298-
│ ├── decisions.md 🚫 BLOCKED
292+
├── .ai-team/ ✅ Committed on dev & feature branches
293+
│ ├── agents/ 🚫 Guard blocks from main/preview
294+
│ │ ├── {name}/charter.md 🚫 Guard blocks from main/preview
295+
│ │ └── {name}/history.md 🚫 Guard blocks from main/preview
296+
│ ├── team.md 🚫 Guard blocks from main/preview
297+
│ ├── routing.md 🚫 Guard blocks from main/preview
298+
│ ├── decisions.md 🚫 Guard blocks from main/preview
299299
│ └── ...
300300
│
301-
├── team-docs/ 🚫 BLOCKED (except blog/)
302-
│ ├── sprint-plan.md 🚫 BLOCKED
303-
│ ├── roadmap.md 🚫 BLOCKED
301+
├── team-docs/ 🚫 Guard blocks from main/preview (except blog/)
302+
│ ├── sprint-plan.md 🚫 Guard blocks from main/preview
303+
│ ├── roadmap.md 🚫 Guard blocks from main/preview
304304
│ └── blog/ ✅ ALLOWED (public content)
305305
│ └── 001-launch.md ✅ ALLOWED
306306
│
@@ -342,20 +342,22 @@ When you open a PR to `main` or `preview`, the workflow `.github/workflows/squad
342342
- ✅ **Pass:** "No forbidden paths found" — you're good to merge
343343
- ❌ **Fail:** Lists forbidden files and shows `git rm --cached` fix
344344
345-
The guard is **not a suggestion** — it's a hard stop. But it's easy to fix if it blocks you (see [Fixing a Blocked PR](#fixing-a-blocked-pr)).
345+
The guard is **not a suggestion** — it's a hard stop. This is the primary enforcement mechanism that keeps `.ai-team/` and internal `team-docs/` off `main` and `preview`. But it's easy to fix if it blocks you (see [Fixing a Blocked PR](#fixing-a-blocked-pr)).
346346
347347
---
348348
349349
## FAQ
350350
351351
### Q: I accidentally committed `.ai-team/` to my feature branch. Do I have to delete it?
352352
353-
**A:** No! `.ai-team/` is in `.gitignore`, so it won't push to GitHub unless you force-add it. Just keep your feature branch clean:
353+
**A:** Nope — `.ai-team/` files are **supposed** to be committed on `dev` and feature branches! They're part of the normal development workflow. The guard workflow (`squad-main-guard.yml`) prevents them from reaching `main` or `preview`. Just don't PR them to those branches.
354+
355+
If you're creating a PR to `main` or `preview` and the guard blocks it, remove the files from that PR only:
354356
355357
```bash
356-
git rm --cached -r .ai-team/ # Untrack if force-added
357-
git checkout dev # Switch back to dev
358-
# Your local .ai-team/ remains untouched
358+
git rm --cached -r .ai-team/ # Untrack from this PR
359+
git commit -m "chore: remove .ai-team/ from release PR"
360+
git push
359361
```
360362

361363
### Q: Can I PR to `main` directly?
@@ -364,7 +366,7 @@ git checkout dev # Switch back to dev
364366

365367
### Q: The guard blocked my PR. What now?
366368

367-
**A:** Your PR contains `.ai-team/` or `team-docs/` files that shouldn't be in `main`/`preview`. Follow [Fixing a Blocked PR](#fixing-a-blocked-pr) — it's three `git rm --cached` commands and a push. The workflow will re-run and pass.
369+
**A:** Your PR targets `main` or `preview` and contains `.ai-team/` or `team-docs/` files. These files live on `dev` and feature branches but must not reach production. Follow [Fixing a Blocked PR](#fixing-a-blocked-pr) — it's three `git rm --cached` commands and a push. The workflow will re-run and pass.
368370

369371
### Q: I want to commit `team-docs/sprint-plan.md` — can I do that?
370372

@@ -389,9 +391,9 @@ Welcome aboard. Make Squad better. 🚀
389391
## Summary: What You Need to Know
390392

391393
1. **Clone from `dev`, create `squad/{issue}-{slug}` branch, PR back to `dev`**
392-
2. **Never commit `.ai-team/` or internal `team-docs/` to `main` or `preview` — the guard will block it**
394+
2. **`.ai-team/` files are committed on `dev` and feature branches — the guard workflow blocks them from `main`/`preview`**
393395
3. **Run `npm test` before pushing**
394396
4. **Follow conventional commits (feat:, fix:, docs:, etc.)**
395-
5. **If the guard blocks your PR, run `git rm --cached` and push again**
397+
5. **If the guard blocks your PR to `main`/`preview`, run `git rm --cached` and push again**
396398

397399
That's it. Happy contributing.

‎package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"index.js",
1010
".github/agents/squad.agent.md",
1111
"templates/**/*",
12-
"docs/**/*",
1312
"CHANGELOG.md"
1413
],
1514
"scripts": {

‎templates/workflows/squad-main-guard.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ jobs:
8181
'git push',
8282
'```',
8383
'',
84-
'> ⚠️ `.ai-team/` is in `.gitignore` but files previously force-added with `git add -f`',
85-
'> remain tracked. `git rm --cached` untracks them without deleting your local copies.',
84+
'> ⚠️ `.ai-team/` is committed on `dev` and feature branches by design.',
85+
'> The guard workflow is the enforcement mechanism that keeps these files off `main` and `preview`.',
86+
'> `git rm --cached` untracks them from this PR without deleting your local copies.',
8687
];
8788
8889
core.setFailed(lines.join('\n'));

0 commit comments

Comments
 (0)