team-setup
Overview
is an interactive skill that guides you through setting up the team AI directives. It presents four modes, explains each option, confirms your choice, and executes the setup.
It is invoked in two ways:
- User-invoked () — anytime, to configure or check a project.
- Model-invoked by — automatically at session start when a project has no configuration (self-install), so an unconfigured project wires itself without the user knowing the command.
The skill is non-destructive: it never overwrites existing files or directories. If the target path already contains a configured team AI directives, it detects this and offers the "Already configured" mode instead.
When to Use
- Starting a new team from scratch and need a neutral team AI directives scaffold to fill in later.
- Your team already has a directives repo on GitHub and you want to clone it locally.
- You have a local team AI directives directory already (e.g., from a previous project) and want to wire it up.
- You're unsure whether the team AI directives is already configured and want a quick check.
- When the project isn't yet wired to a team AI directives (no field).
- Automatically via when it detects an unconfigured project at session start (self-install).
Decline Handling (when model-invoked by team-boot)
When
invokes this skill because the project is unconfigured, the
user may choose not to set up team AI directives right now. Handle decline
explicitly to avoid a re-prompt loop:
- If the user declines at mode selection, do not run any mode. Exit
cleanly and tell the user declined.
- Offer a persistent opt-out: "Don't ask again for this project?" On yes
(build mode only), write with
:
bash
echo '{"team_ai_directives": null}' > ".adlc/init-options.json"
This marker makes skip setup silently on every future prompt.
- In plan/read-only mode, a persistent opt-out cannot be written — the
decline is session-scoped only; tell to defer.
- Never force a mode; the setup is user-consented at every step.
Core Process
Goal
Set up a team AI directives using one of four modes.
Security: Input Validation (all modes)
Before executing any mode, validate every user-supplied value (paths, URLs, team
names). These values are interpolated into shell commands; unvalidated input is
a command-injection vector.
- Paths (, ): reject if they contain any of
, , , , , , , , , newline, or backslash.
Resolve to an absolute path with / before use.
- Team name: must match . Reject anything else.
- Clone URL (Mode 1): must start with . Reject , ,
and any non- scheme unless the user explicitly confirms the risk.
Cloning runs no code from the repo, but the cloned content is read by agents
later — only clone repositories you trust.
If any value fails validation, report which value and why, and re-ask. Never
interpolate a user value into a Python/eval source string — pass it through the
environment (see Mode 2).
Fast path: if
already contains a valid
path, skip to Mode 4 (Already Configured) — do not re-clone, re-point, or re-scaffold.
Modes at a Glance
| # | Mode | When | Details in |
|---|
| 1 | Clone from GitHub | team already has a directives repo | |
| 2 | Point to existing local path | directives dir already exists locally | |
| 3 | Scaffold new empty directives | starting a team from scratch | references/mode-scaffold.md
|
| 4 | Already configured | check / verify existing wiring | references/mode-configured.md
|
Mode 1: Clone from GitHub
Mode 2: Point to Existing Local Path
Mode 3: Scaffold New Empty team AI directives
Full walkthrough in
references/mode-scaffold.md
.
Mode 4: Already Configured
Full walkthrough in
references/mode-configured.md
.
Mode Selection Flow
-
Explore: Present the user with four options:
How would you like to set up team-ai-directives?
1) Clone from GitHub — Clone an existing repository
2) Point to existing local path — Use a team AI directives you already have
3) Scaffold new empty team AI directives — Create a fresh neutral team AI directives
4) Already configured — Check existing configuration
-
Present: For the chosen mode, explain what will happen and show details.
-
Confirm: Ask the user to confirm before executing.
-
Write/Execute: Perform the setup for the chosen mode.
Script Entry Points (deterministic, headless use)
The Mode 1/2 validation and wiring logic has ONE home — the shared helper
scripts — and is exposed as flags so headless callers (e.g.
adlc-cli team setup --directives <path>
) run the same checks without an LLM session:
scripts/bash/team-helpers.sh [--validate DIR] [--wire DIR]
scripts/powershell/team-helpers.ps1 [-Validate DIR] [-Wire DIR]
runs the Verification structure check (exit 0 when complete,
exit 1 with
lines when not).
validates, then merges
the absolute path into the project's
as
(existing keys preserved; refuses to wire an invalid
structure). Both twins behave identically. Interactive sessions still go
through Mode Selection above; the in-session path and the headless path share
the same implementation.
Post-Setup Configuration
After any mode completes successfully, update the project configuration:
- Write to
- Verify the team AI directives is accessible by running a quick health check:
{TEAM_AI_DIRECTIVES}/context_modules/constitution.md
exists
{TEAM_AI_DIRECTIVES}/.skills.json
exists and is valid JSON
- Check the convention (layout allowlist — see the Gitignore Convention Check step below).
- Inject the project-level directive — full command and managed-section contract in
references/post-setup-agents.md
.
- Install MCP config — copy-once contract (seed the project's
only when absent; an existing project file wins and is never merged into)
in
references/post-setup-mcp.md
.
Gitignore Convention Check
Verify
follows the ADLC allowlist — a fresh
must
never leave a wholesale
ignore in place (it would hide the tracked
artifacts the team model relies on):
- If contains a bare rule, replace it (and any
+ lines that conflict) with the R7 allowlist:
ignore , , ,
.adlc/team-learn-report.md
, .adlc/team-levelup-report.md
, and
, while re-including ,
, , ,
, , and
!.adlc/memory/evals/holdout.json
. The canonical rule list lives in the
workspace skill's (GITIGNORE_RULES_ALLOWLIST
,
mirrored in scripts/powershell/paths.ps1
).
- Also verify the agent-install surface rules are ignored (,
, , , , , ,
, , , ,
, , ). Note that
is deliberately not in this list: it is committed project source —
human-edited, never generated — so a entry for it is a defect
to report, not a missing rule to add; its guardrail is variable names
only, never literal secrets — indirection is the guard, not
.
- Never remove unrelated (non-ADLC) rules; only add missing allowlist rules.
- Tracked legacy files keep working — the allowlist gates only untracked
files, so no migration is required before the switch.
Common Rationalizations
| Rationalization | Why it's wrong | What to do instead |
|---|
| "I'll just clone it manually." | Manual cloning skips the wiring, so agents won't find the team AI directives. | Use Mode 1 — it clones AND configures. |
| "I already have a team AI directives directory, I'll just use it." | The directory may be incomplete (missing required files) or not wired in config. | Use Mode 2 — it validates the structure and creates the config entry. |
| "I'll just create a few files by hand." | An incomplete scaffold breaks health checks and agent discovery. | Use Mode 3 — it creates all 10 required files with valid structure. |
| "I'm sure it's already configured." | The path may be stale, moved, or the env var may point to a deleted dir. | Use Mode 4 — it validates the existing configuration. |
| "Scaffolding without a team name is fine." | The team name is used in — a blank name makes the team AI directives anonymous and harder to audit. | Always provide a team name in Mode 3. |
Red Flags
- Cloning over an existing directory — Mode 1 refuses if the destination already exists to prevent overwrites.
- Pointing to a non-existent path — Mode 2 validates the path exists before proceeding.
- Scaffolding without required dirs being writable — Mode 3 creates directories with but will fail on permission errors; check permissions first.
- Skipping the config write — without this field in , agents cannot discover the team AI directives.
- Using a relative path in — always resolve to an absolute path so the config is portable across working directories.
- Skipping in Mode 3 — a scaffolded team AI directives without git cannot be used by (branch/commit/PR flow). Mode 3 runs automatically; if you skip it, run manually before .
- Skipping the project-level AGENTS.md injection — without the
<!-- TEAM_AI_DIRECTIVES START -->
managed section in the project's , agents without event support have no session-start instruction to load team context. The config alone is insufficient — it tells skills where the team AI directives is, but nothing tells the agent to check. (For agents with event support, the session-start hook injects the orientation regardless, but AGENTS.md remains the fallback and the source of the Team Context in Use output contract.)
- Interpolating user input into Python/shell source strings — pass paths through the environment () instead; string interpolation of into a Python one-liner is a command-injection vector.
- Cloning a non- URL in Mode 1 — reject //other schemes; cloned content is read by agents later, so only clone trusted repos.
- Skipping the MCP config install — a project with no of its own is never seeded and loses access to team-declared MCP servers; a project that has one only loses the gap report (its file is never written either way).
- Accepting shell metacharacters in paths or team names — validate before interpolating into //heredocs (see Input Validation).
- Treating user decline as an error — declining setup is a valid outcome; exit cleanly, tell the user declined, and offer the opt-out marker (build mode only).
- Writing the opt-out marker in plan/read-only mode — a persistent opt-out requires a write; in plan mode the decline is session-scoped and setup defers instead.
Verification
Configuration
- — Path to the team AI directives (overrides ).
- — Project-level config file with field.
- Default fallback: relative to project root.
- / — Shared scripts used for scaffolding and path resolution.
12-Factor Alignment
Factor XI (Directives as Code) — establishes a version-controlled team directives repository.