Skip to content

Setting up a repository

A repository runs the AI SDLC by enabling the plugins and describing what is its own. Nothing is copied into it: no skill, rule or hook (SPEC.md Q-1).

1. Enable the plugins

In the repository's .claude/settings.json, so Claude Code offers them when the folder is first trusted:

{
  "extraKnownMarketplaces": {
    "<owner>": { "source": { "source": "github", "repo": "<owner>/claude" }, "autoUpdate": true }
  },
  "enabledPlugins": {
    "workflow@<owner>": true,
    "git-flow@<owner>": true,
    "dev-env@<owner>": true
  }
}

workflow brings git-flow and superpowers as dependencies. A stack plugin such as backend is added where the stack is. Access to the private marketplace and how updates arrive: setup/marketplace.md. Permissions that a plugin cannot set, such as the Gradle fragment, are added to the repository's own settings by hand.

2. Add a ## Workflow section to CLAUDE.md

The workflow skills name no project. At the start of every run they read these keys from a two-column table in the repository's CLAUDE.md:

  • the owner;
  • the process page and the board;
  • the machine gate and its reports;
  • the spec inputs and templates, and the design reference;
  • the collaboration guide and the data rule.

A skill that needs a missing key stops and names it. It never falls back to another project's value. The keys and an example: workflow-section.md (plugins/workflow/reference/workflow-section.md).

3. Say what is the repository's own

In CLAUDE.md, next to the ## Workflow section: the build and test commands, where the work streams are defined, and the working language. The specs and plans go into docs/specs/ and docs/plans/.

How the work is tracked against the architecture

A repository that keeps an architecture description writes one short section, in its own docs, on how the work relates to it. It stays in the repository, because it names that repository's architecture, its open-questions file and its SPEC.md (decided in #579; the origin is aise-feecheck-poc#416). The rules in it are generic, and a new repository can copy them:

  • The architecture fixes no delivery plan. A requirement that depends on something not yet built names that condition and applies once it holds.
  • An open question names what it blocks.
  • A "product version" is a git tag on the product.
  • Where a repository tracks overall goals as goal epics (an optional kind, still proposed in work-items.md), they refer to the architecture and to SPEC.md, never the reverse.

What of aise-feecheck-poc's docs/guides/agent-collaboration.md is generic is already described here: claims and labels in parallel-work.md and "finish on assumptions" in the workflow plugin. The issue-type table is the exception: that guide still calls itself its single copy until open decision w6 of work-items.md moves it into the workflow plugin. Its project-specific text stays in aise-feecheck-poc, which should link to these pages instead of keeping a copy of the generic parts.

4. Labels

The claim protocol and the issue types need labels:

  • agent:claimed, agent:reserved, agent:parked and agent:hold;
  • the needs:*, human:* and merge labels, owner:approved (the owner's pre-approval of an issue's pull request) and host-step;
  • assumption:open, a coordinator's working assumption waiting for the owner's review, and question:answered;
  • the issue-type labels epic, feature, bug and task.

coordinator labels lists the labels the coordinator reads or writes that a repository lacks: the agent:*, needs:*, human:*, merge and host-step labels, owner:approved, assumption:open and question:answered, but no issue-type label. coordinator labels --create creates them. scripts/tools/create-github-labels.sh creates the claim, needs:*, human:*, host-step, merge, issue-type and labs labels in all of OWNER's aise-* repositories at once, or in the one repository it is given.

5. The machine gate and CI

The machine half of the gate is the repository's own build, run from a pre-push hook and in CI. The AI reviews need GitHub Copilot review enabled for the repository. The claude-review workflow with its CLAUDE_CODE_OAUTH_TOKEN secret is optional (ci/claude-review.md).

6. Check the machine

dev-env:dev-doctor checks every machine that works on the repository: toolchain, git identity, logins, the command guard, the worktree folder.

7. The bot account

Claude sessions on the Linux hosts act on GitHub as the bot account, not as the owner. For each repository they work on:

  • The owner invites the bot as a collaborator with write access, and the bot accepts. The bot cannot create repositories under the owner's account. So creating one and connecting the first checkout (scripts/tools/connect-repo-remote.sh) stay the owner's steps.
  • The machine names the account, not the repository. On the host, the environment variable CLAUDE_GITHUB_LOGIN holds the bot's login, in the token file next to GITHUB_TOKEN (scripts/linux/set-token.sh CLAUDE_GITHUB_LOGIN). The host scripts read the same variable (setup/token-rotation.md).
    • dev-env:dev-doctor then warns when gh or the GitHub MCP token acts as another account.
    • Without the variable, it still fails when the host is the bot's and gh acts as the owner (its owner or bot mode).
  • Commits keep the identity Claude Agent with the bot's address at @lauper.net, verified on the bot, so GitHub links them to it. They are not signed.

8. Cloud sessions

A repository that cloud sessions on claude.ai work on (architecture, 7.1.5) needs a little more, because each session starts from a fresh clone on a fresh VM:

  • The Claude GitHub App installed on the repository, so sessions can clone it, push their branch, read and write issues and pull requests, and subscribe to pull request activity.
  • A SessionStart hook in the committed .claude/settings.json, so the tests, linters and hooks the gate runs are installed in every session. It runs on every start and resume, locally too. So its script exits early unless CLAUDE_CODE_REMOTE is true, and skips work already done. Tools the VM itself needs (jq, pwsh, pre-commit) belong in the cloud environment's setup script instead, which is cached. Example and limits: cloud environments.
  • The plugins. A cloud session does not install what enabledPlugins in step 1 enables. It loads what the clone carries (CLAUDE.md, .claude/rules/, .claude/skills/, hooks) and the skills enabled on claude.ai. The <owner> plugins have to come from one of those, or be installed by the environment's setup script. These lines do it. They are harmless when the marketplace or plugin is already there, and workflow brings git-flow and superpowers:

    claude plugin marketplace add &lt;owner&gt;/claude
    claude plugin install workflow@&lt;owner&gt;
    claude plugin install dev-env@&lt;owner&gt;
    

    The clone of the private marketplace goes through the session's GitHub proxy, which reaches <owner>/claude once the Claude GitHub App is installed on it. This is tested in a cloud session. Whether the setup script, which runs before the session, gets the same access is confirmed by the first session in an environment that uses it.

  • No plugin set per session. The organization's plugins (product-management, design and the others synced from claude.ai) load with the organization's default. User settings are not read there, so the baseline that keeps the intake plugins out of local coding sessions does not apply, and there is no --settings to turn them on for one session. A committed "<id>@synced": false would turn one off for every session of the repository, intake included. Plugin sets has the local side.

  • No secret in the environment variables. They are visible to everyone who uses the environment. A token that a session needs, such as one for gh in a dedicated coordinator environment (#191), is a network secret for its host.