Skip to content

Feat/fleet init - #2

Merged
MohammedAlkindi merged 2 commits into
mainfrom
feat/fleet-init
Jul 19, 2026
Merged

Feat/fleet init#2
MohammedAlkindi merged 2 commits into
mainfrom
feat/fleet-init

Conversation

@MohammedAlkindi

@MohammedAlkindi MohammedAlkindi commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added fleet init to set up repository configuration, agent guidance, and the packaged Claude Code skill.
    • Added --force and --json options for controlled overwrites and machine-readable results.
    • Initialization is safely repeatable and preserves existing user content.
    • Malformed agent-guidance markers are detected without overwriting files.
  • Documentation

    • Updated the quickstart, command reference, architecture documentation, and changelog with the new setup workflow.

The Claude Code skill shipped in 0.3.0, but installing it was a manual
copy documented in the README, so the convention that makes Switchyard
work usually never reached the agents that needed it. The tools report
state; they cannot convey that checking belongs before the edit, and an
agent that finds no spawn tool and was never told why falls back to a
raw `git worktree add` — the untracked state this project exists to
prevent.

fleet init writes the exclude entry, a starter .fleetrc.json wired to
the config schema, the skill into .claude/skills/, and a protocol block
into AGENTS.md so agents that do not read Claude skills learn the
convention too.

Ownership decides overwrite behavior: .fleetrc.json is the user's file
and needs --force, while the skill and the AGENTS.md block are
package-managed and refresh on every run, making re-running init the
upgrade path. Marker delimiters keep the AGENTS.md rewrite scoped to
our own region; a broken marker pair is an error rather than a guess,
since guessing where the user's content ends risks eating it.

ensureFleetExcluded now reports whether it wrote, so init can tell
"already ignored" from "just ignored it" instead of always claiming the
former.
Records the reasoning the code cannot carry: why two hand-maintained
texts beat one generated from the other, why AGENTS.md beats per-tool
detection, and why claims are deferred a second time — they are
advisory, so they only pay off once agents reliably follow the first
convention, which is what init establishes.

Also replaces the README's manual-copy instructions, which are now the
thing init exists to remove.
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 57a55760-fe87-4df1-ba1b-5fa7e065cb23

📥 Commits

Reviewing files that changed from the base of the PR and between b3edd01 and 904a6e2.

📒 Files selected for processing (10)
  • CHANGELOG.md
  • README.md
  • docs/architecture.md
  • docs/design/2026-07-19-v0.4-init.md
  • src/cli.ts
  • src/commands/init.ts
  • src/lib/git.ts
  • src/lib/protocol.ts
  • tests/init.test.ts
  • tests/package.test.ts

📝 Walkthrough

Walkthrough

Adds fleet init with locked, idempotent setup of fleet configuration, agent protocol documentation, Claude Code skill files, and git exclusions. The command supports force and JSON modes, exposes initialization results, and includes CLI wiring, tests, packaging checks, and documentation.

Changes

Fleet initialization

Layer / File(s) Summary
Protocol and initialization contract
docs/design/..., src/lib/protocol.ts
Defines managed AGENTS.md markers, packaged skill resolution, artifact ownership, idempotent updates, malformed-marker errors, and locking requirements.
Initialization execution and CLI integration
src/commands/init.ts, src/lib/git.ts, src/cli.ts, tests/*
Adds locked fleet init execution, config and skill installation, AGENTS.md updates, git exclusion handling, --force/--json, result reporting, and behavioral coverage.
User-facing documentation and release notes
README.md, docs/architecture.md, CHANGELOG.md
Documents the new command, setup workflow, managed artifacts, overwrite rules, and release notes.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant InitCommand
  participant MutationLock
  participant RepositoryFiles
  participant ProtocolHelpers
  CLI->>InitCommand: run fleet init with options
  InitCommand->>MutationLock: acquire init lock
  InitCommand->>RepositoryFiles: update exclude and config artifacts
  InitCommand->>ProtocolHelpers: read packaged skill and upsert AGENTS.md block
  ProtocolHelpers-->>InitCommand: initialized artifact content
  InitCommand-->>CLI: return InitResult or JSON output
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/fleet-init

Comment @coderabbitai help to get the list of available commands.

@MohammedAlkindi
MohammedAlkindi merged commit 3193d19 into main Jul 19, 2026
12 of 13 checks passed
@MohammedAlkindi
MohammedAlkindi deleted the feat/fleet-init branch July 19, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant