bootstrap
Use when starting a new project, onboarding to an existing project, or setting up the harness for the first time. Detects project type, tech stack, and generates project-specific configuration.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 7
- Forks
- 2
01 前言 Front Matter
- name
- bootstrap
- phase
- understand
- requires
- []
- standalone
- true
- description
- Use when starting a new project, onboarding to an existing project, or setting up the harness for the first time. Detects project type, tech stack, and generates project-specific configuration.
- enforcement
- advisory
- disable-model-invocation
- true
02 资源文件 10
- 参考文档agents/openai.yaml43 B
- 其他templates/adr.md.template34 B
- 其他templates/AGENTS.md.template37 B
- 其他templates/claude-settings.json.template48 B
- 其他templates/CLAUDE.md.template37 B
- 其他templates/claudeignore.template40 B
- 其他templates/env.example.template39 B
- 其他templates/env.local.template37 B
- 参考文档templates/pull_request_template.md43 B
- 其他templates/styleguide.md.template41 B
03 SKILL.md 正文
Purpose
Detects the target project's type, tech stack, and structure, then generates a project-specific CLAUDE.md that references the harness skills. Sets up project directories for pipeline state, memory, and documentation artifacts.
Works for both new projects (empty or freshly scaffolded) and existing projects (with code, tests, and history already in place).
Path resolution: every templates/* path referenced below is relative to this skill's own
directory (bootstrap/templates/). Every tech-context/* path is relative to the harness root (the
directory containing skills/, tech-context/, and HARNESS.md); resolve it by following the
symlink at your own skill path, e.g. readlink <skills-dir>/bootstrap →
<harness-root>/skills/bootstrap, then go up two directories.
Practices
1. Determine Bootstrap Mode
| Indicator | Mode (bootstrap_mode value) |
|---|---|
| Empty directory or no project files | new — scaffold first (Step 1b) |
| Project files exist but no harness artifacts | fresh — full harness setup |
.memory/ or .docs/ exist but some missing |
partial — fill gaps only |
| All harness artifacts exist | re-bootstrap — update detection, re-run smoke test |
Also check maturity: 50+ commits = mature, 5+ model files = substantial, existing specs = assess coverage, existing CLAUDE.md = preserve, don't overwrite.
Persist the detected mode into .pipeline/conduct-state.json under the key
bootstrap_mode with one of the four string values above (new, fresh, partial,
re-bootstrap). This MUST happen before any downstream step dispatches, because the
conductor uses the value to skip steps that have no material to act on — notably
assess, which is skipped when mode is new (no codebase yet = nothing for the 9
specialists to evaluate). If the value is missing or unrecognized, the conductor
defaults to running every step, so a missing write silently loses the optimization but
never breaks the flow.
1b. Scaffold New Project (New Mode Only)
- Ask for or infer framework from user prompt
- Scaffold:
rails new . --api --database=postgresql --skip-bundle(or equivalent) - Install dependencies, add test framework if missing (rspec-rails, jest, pytest)
- Configure database — detect port conflicts before writing docker-compose.yml
- Set up .gitignore before first commit (vendor/bundle, node_modules, tmp, log)
- Initialize git if not already a repo:
git init -b main(force the default branch tomaineven on older git that defaults tomaster). The seed commit, remote wiring, and first push are handled later in Step 10a — after the smoke test — so the initial commit captures a working scaffold.
Worktree Compatibility: All infrastructure must support parallel worktrees sharing
a single set of Docker services. See Step 1c for the .env boundary pattern that enforces this.
1b.1. Initialize Project Config
Managed refresh exception (engine-dispatched only)
When the engine dispatches bootstrap as a managed refresh, it has already validated that the
<!-- ai-conductor:session-command-context=prohibition -->
project configuration is initialized. Skip the configuration interview and operator identity
sections entirely. Do not run ai-conductor config read, ai-conductor config init,
ai-conductor config set, or registration commands; preserve the established configuration
byte-for-byte and continue with the artifact refresh. The engine's managed-refresh instruction,
not a model inference from the project files, is the authority for this exception. An unmarked
operator-run bootstrap follows the ordinary initialization procedure below.
<!-- /ai-conductor:session-command-context -->
<!-- ai-conductor:session-command-context=operator-only -->
For every bootstrap mode, confirm the project is a git repository before continuing:
git rev-parse --is-inside-work-tree. If it is not, initialize it with git init -b main
as described in Step 1b. Then invoke the deterministic, idempotent project-config writer. In
interactive mode, first check whether .ai-conductor/config.yml already exists. When it does, read
each decidable key with ai-conductor config read <key>, print already set: <key> = <value> for
each, ask none of these questions, and still invoke config init below so its normal no-clobber
result is surfaced. Otherwise ask one question at a time:
test_suite.verification.mode— Controls: whether verification runs the aggregate suite or a selected-test command. Allowed:aggregateorscoped. Default:aggregate. Changing it:scopeduses the configured scoped command for selected tests. Record with--test-suite-mode <aggregate|scoped>.test_suite.verification.drift_budget— Controls: tolerated test-suite input drift. Allowed:strictortolerant. Default:strict. Changing it:tolerantpermits up to 20 source paths and unlimited additional inputs. Record with--test-suite-drift-budget <strict|tolerant>.test_suite.command— Controls: the aggregate test command the pre-SHIP gate invokes. Allowed: one non-empty, single-line project command. Default: infer one from project tooling:package.jsonscripts.test→ its package-manager test command;pyproject.tomlorpytest.ini→pytest;GemfileorRakefile→bundle exec rake;go.mod→go test ./...;Cargo.toml→cargo test. Changing it: records the project's authoritative aggregate suite. Record with--test-suite-command <command>. When no command can be inferred and the answer is empty, re-ask; never recordnpm testas an uninferred answer.test_suite.scoped_command— Ask only whentest_suite.verification.modeisscoped. Controls: the selected-test command that receives{selectors}. Allowed: one non-empty, single-line project command containing{selectors}. Default: no default; this command is required for scoped verification. Changing it: changes how selected tests run. Record with--test-suite-scoped-command <command>.
For a closed-set answer outside its allowed values, restate the allowed values, re-ask the same question, and record nothing. For a free-text empty or multi-line answer, re-ask and record nothing. Record all accepted answers through this single writer invocation only:
ai-conductor config init --test-suite-mode <aggregate|scoped> --test-suite-drift-budget <strict|tolerant> --test-suite-command <command> [--test-suite-scoped-command <command> when scoped]
In auto mode, do not prompt; record the strict preset with aggregate verification:
ai-conductor config init --test-suite-mode aggregate --test-suite-drift-budget strict
Never hand-author .ai-conductor/config.yml and never copy a config from the harness checkout.
If the config already exists, the command preserves it byte-for-byte and succeeds. Surface any
other non-zero exit before continuing.
1b.2. Operator Identity
Interactive mode only: read the current value with ai-conductor config read spec_owner. If it is
already set, report already set: spec_owner = <value> and do not ask again. When it is empty, ask
for the operator identity, offering gh api user -q .login as the default when available; record an
accepted answer only with ai-conductor config set spec_owner <login>. An empty submission is not a
decline: re-ask it and restate the option to decline. Never edit a configuration file or record a
placeholder identity.
If identity remains unresolved (no value, no gh login, or the operator declines), print Operator identity unresolved: engineer land, spec handoff, and daemon builds will refuse until it is set.
Mark bootstrap setup incomplete rather than successful. In auto mode, skip this section entirely:
ask no identity question and make no config set call.
<!-- /ai-conductor:session-command-context -->
1c. Generate Infrastructure Boundary Files
Infrastructure splits into two layers:
- Shared: Docker services (database, Redis, message queue) run ONCE regardless of worktree count
- Worktree-specific: Database name, Redis namespace, app port differ per worktree
Generate these files:
.env.example— fromtemplates/env.example.template. Committed to version control. Shows all required env vars with placeholder values. Replace{{DB_ENGINE}},{{DB_DEFAULT_PORT}},{{APP_DEFAULT_PORT}}, and{{FRAMEWORK_ENV_VAR}}based on stack detection from Step 2..env— copy.env.examplewith real default values filled in. Gitignored. This is the working env file developers use locally..env.local— fromtemplates/env.local.template. Gitignored. Contains worktree-specific overrides:WORKTREE_DB_SUFFIX,REDIS_NAMESPACE,PORT. For the main worktree, use_mainsuffix. For feature worktrees, derive from branch slug.
If .env, .env.example, or .env.local already exists, do NOT overwrite.
Add to .gitignore (idempotent):
.env.env.local.env.local.*.env.*.local
Boot sequence:
# 1. Start shared infrastructure (once)
docker compose up -d
# 2. .env.local is pre-generated with worktree-specific values (automatic)
# 3. Start the app (reads .env then .env.local overrides)
{{DEV_COMMAND}}
Stack-specific variable mapping:
| Stack | DB Engine Var | Default DB Port | Default App Port | Framework Env Var |
|---|---|---|---|---|
| Rails+PostgreSQL | POSTGRES |
5432 | 3000 | RAILS_ENV |
| Rails+MySQL | MYSQL |
3306 | 3000 | RAILS_ENV |
| Node/Express | POSTGRES |
5432 | 3000 | NODE_ENV |
| Django | POSTGRES |
5432 | 8000 | DJANGO_SETTINGS_MODULE |
| Phoenix | POSTGRES |
5432 | 4000 | MIX_ENV |
Verification: App boots successfully reading .env + .env.local. A second worktree
with different .env.local values can run simultaneously without port or namespace conflicts.
2. Detect Project Type
Scan project root for indicators (first match per category):
Language/Framework: Gemfile+rails→Rails, package.json+next→Next.js, package.json+express→Express, pyproject.toml+django→Django, Cargo.toml→Rust, go.mod→Go
Database: database.yml+postgresql→PostgreSQL, +mysql→MySQL, +sqlite→SQLite
Test Framework: .rspec→RSpec, test/*_test.rb→Minitest, jest.config→Jest, pytest.ini→pytest
Frontend: app/views/→server-rendered, app/javascript/→JS frontend, package.json+react/vue/svelte→SPA, none→API-only
Process Manager: Procfile.dev+overmind.yml→Overmind, Procfile.dev→Foreman/Overmind,
Procfile+foreman→Foreman, bin/dev→bin/dev script, none→bare commands.
Determines {{DEV_COMMAND}} in generated files: overmind start, foreman start -f Procfile.dev,
bin/dev, or stack default (bin/rails server, npm start, etc.).
3. Load Tech-Context
Match detected stack to tech-context/ (e.g., Rails+PostgreSQL → tech-context/rails-postgres/).
Note in CLAUDE.md so skills reference session-loaded context.
3b. Generate .claudeignore
Generate from templates/claudeignore.template. Remove stack-irrelevant sections (e.g., Rails
sections for Node projects). If .claudeignore already exists, do NOT overwrite.
3c. Generate PR Template
Copy templates/pull_request_template.md to .github/pull_request_template.md.
Create .github/ directory if it doesn't exist. If a PR template already exists, do NOT overwrite.
The template contains [feature_description], [story_count], and [branch] placeholders
that conduct fills in when creating the PR.
3d. Generate Claude Code Settings
Generate .claude/settings.json in two parts: permissions (3d-i) and a pre-PR lint hook
(3d-ii). The file is project-scoped — per-user overrides belong in
.claude/settings.local.json (gitignored).
3d-i. Permissions
Copy templates/claude-settings.json.template to .claude/settings.json. Its Read(**),
Edit(**), and Write(**) patterns are relative to the project, so the generated file
remains valid when the repository is moved or checked out as a worktree. Create the
.claude/ directory if it doesn't exist.
The generated file scopes Read/Edit/Write permission to the entire project tree (including
dotfiles under .claude/, .pipeline/, .docs/, .memory/, .github/, etc.) so that
downstream skills don't block on permission prompts when they touch harness artifacts.
Relative patterns keep the permissions portable across machines and worktrees.
If .claude/settings.json already exists, do NOT overwrite it — skip to 3d-ii and merge
the hook block only if the hook is missing.
3d-ii. Pre-PR Lint Hook
Linting is deterministic — it should never consume model tokens. This step wires a
PreToolUse hook that runs the project's lint command before any gh pr create
invocation; a non-zero exit code blocks the PR until the user (or Claude) fixes the lint
failure. TDD, pipeline, and code-review skills do NOT invoke the linter themselves;
this hook is the single source of lint enforcement.
Detect the lint command from project signals (first match wins, but combine if multiple apply — e.g. Node+TS gets both scripts):
| Signal | Lint Command |
|---|---|
package.json has scripts.lint |
npm run lint |
tsconfig.json exists |
npx tsc --noEmit (AND above, joined with &&) |
biome.json / biome.jsonc |
npx biome check . |
.eslintrc* without a scripts.lint entry |
npx eslint . |
Gemfile contains rubocop |
bundle exec rubocop |
Gemfile contains sorbet-runtime |
bundle exec srb tc (AND rubocop if also present) |
pyproject.toml lists ruff |
ruff check |
pyproject.toml lists mypy |
mypy . (AND ruff if also present) |
Cargo.toml |
cargo clippy --all-targets -- -D warnings |
go.mod |
go vet ./... |
If multiple commands apply, chain them with && — the hook fails fast on the first
non-zero exit. If nothing matches, ask the user: "What command lints/type-checks this
project? (leave blank to skip the pre-PR lint gate)". In auto mode, skip the hook when
detection fails rather than prompting.
Write the hook into .claude/settings.json (merge with the permissions from 3d-i —
do not overwrite):
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "<detected or user-provided lint command>",
"if": "Bash(gh pr create*)",
"timeout": 300,
"statusMessage": "Running pre-PR lint gate"
}
]
}
]
}
}
The if: "Bash(gh pr create*)" filter means the hook only fires when Claude actually
tries to open a PR — every other Bash call is untouched, so the hook has zero runtime
cost during regular development.
Idempotence: If a PreToolUse hook with if: "Bash(gh pr create*)" already exists
in .claude/settings.json, do NOT add a duplicate. Re-running bootstrap should be safe;
users who want to change the lint command can edit the existing hook directly.
User override at any time — the hook lives in .claude/settings.json and is a
regular config value. Users may edit the command, bump the timeout, or remove the hook
entirely without re-running bootstrap.
4. Analyze Existing Code (Existing Projects Only)
This step performs a structural scan only — file counts, directory layout, test framework detection. Deep analysis of security, architecture, testing strategy, dependencies, and code health has moved to /assess.
Skip for new/fresh projects. Build an inventory:
- Codebase: models, controllers, services, jobs — count source and test files
- Test coverage: inspect test files and existing coverage reports; identify files with no specs
without executing tests. The
test_suitestep owns configured suite verification. - Architecture: routes, patterns (service objects, concerns), auth approach, existing docs
- In-flight work: open PRs/issues (
gh pr list,gh issue list), TODO comments - Git history:
git log --oneline -20,git shortlog -sn --no-merges
Present inventory summary to user before proceeding.
4b. Draft As-Built Stories (Existing Projects Only)
If a recent assessment report exists (.docs/decisions/technical-assessment-*.md), reference its findings as additional context for story drafting.
Priority order for story sources:
.docs/plans/*.md— if existing plans exist, derive stories from them first. Plans represent intended behavior more accurately than code inspection. Each plan phase becomes a story group..pipeline/bootstrap-inventory.md— supplement with test coverage gaps and untested files.- Code scan — last resort if neither plans nor inventory exist.
Generate DRAFT stories for what exists. One file per feature area (or per plan phase) with
happy paths from plan tasks or routes/tests. Negative paths left as TODO — /stories fills them in.
Mark as Status: DRAFT and [AS-BUILT]. In-flight work gets [PLANNED] marker with
issue/PR reference. Bootstrap does NOT validate stories — the normal flow handles that:
/bootstrap → /stories (review drafts) → /conflict-check → normal flow
4c. Document Existing Architectural Decisions (Existing Projects Only)
If a recent assessment report exists, defer to /assess's architecture findings for deeper analysis. Bootstrap ADRs capture only what is observable in code — the assessment provides the judgment layer.
Surface implicit decisions as ADRs in .docs/decisions/ using templates/adr.md.template.
Detect: framework+version, database, auth approach, API format, test framework, background jobs, key architecture-shaping libraries.
Rules:
- Only document what's observable in code — don't invent rationale
- Use
Status: Observed(inferred, not explicitly decided) - One short ADR per decision. Don't duplicate existing ADRs.
5. Set Up Project Directories
<!-- ai-conductor:session-command-context=operator-only -->
.memory/ is set up by the harness, not by this skill. ai-conductor memory setup <dir>
runs before any bootstrap sub-step. This creates a canonical
per-project store at ~/.ai-conductor/memory/<key>/harness/ and makes .memory/ a symlink to
it (adr-2026-06-29-shared-memory-store-placement-and-durability). If .memory/ already exists as a real directory (legacy), it is migrated via
copy-verify-swap before the symlink is created (adr-2026-06-29-safe-reversible-memory-migration). Do NOT create or mkdir .memory/
yourself — it will already be a symlink when this skill runs.
<!-- /ai-conductor:session-command-context -->
Create if missing (idempotent): .pipeline/ (audit-trail/), .worktrees/, .docs/ (specs/,
complexity/, stories/, conflicts/, architecture/, decisions/, plans/, intake/). These
are the full set of .docs/ subdirectories the conductor and daemon read/write across the SDLC
— keep this list in parity with them.
Add to .gitignore (idempotent — don't duplicate):
.pipeline/— runtime state, not source.daemon/— daemon pidfile + activity log (daemon.log), not source.worktrees/— git worktrees for parallel feature development.memory— no trailing slash. It's always a symlink (see above), and git's trailing-slash gitignore patterns match real directories only, not symlinks-to-directories —.memory/looks right but silently fails to match, which would let a machine-local symlink (its target embeds the operator's absolute home path) get committed. The harness's memory setup also writes this rule to the repository's sharedinfo/exclude, so projects that never ran bootstrap are covered; the.gitignoreentry makes it visible to contributors..env— local environment (not committed;.env.exampleis the committed reference).env.local— worktree-specific environment overrides
6. Generate or Update Agent Instructions
- Fresh/no CLAUDE.md: Generate from
templates/CLAUDE.md.template(includes repository-harness reference) - Existing CLAUDE.md: Verify it references the repository harness documentation. If missing, append the reference block. Never overwrite user content. Behavioral rules live in the harness documentation, not in the project CLAUDE.md.
- Fresh/no AGENTS.md: Generate from
templates/AGENTS.md.template. This gives Codex the harness entry point while keeping the skills themselves user-scoped at~/.agents/skills/. - Existing AGENTS.md: Verify it references the repository harness documentation; append the Codex harness reference block if needed. Preserve all operator content and append the AGENTS.md reference exactly once: repeated initialization is idempotent. Update AGENTS.md atomically; if the update cannot be completed safely, leave the original content intact and report an actionable AGENTS.md error rather than creating a partial file. Never overwrite user content.
When both host files are present, preserve and update CLAUDE.md and AGENTS.md independently:
add only the missing harness reference and never normalize away operator-authored content. Validate
that each host keeps its own invocation syntax (Claude /skill-name, Codex $skill-name) while
both point to the same shared harness contract and lifecycle gates. If either file
contradicts that contract, report the host and the conflicting instruction before completing
initialization.
6b. Suggest Host Parallelism Settings
The pipeline runs up to X independent tasks at once, where X = min(3, free sub-agent slots on the host). Check each installed host's slot setting and suggest a change only where it would cap the pipeline below 3 parallel tasks. These settings are operator-level, outside the project: show the exact change and ask, and never edit them without the operator's approval.
-
Codex:
~/.codex/config.tomlsets sub-agents per session with[agents] max_threads. The default leaves exactly 3, so any other active sub-agent leaves the pipeline fewer. Suggest:[agents] max_threads = 6 -
Claude Code:
CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS(default 20, Claude Code v2.1.217 or later) caps concurrent Agent-tool sub-agents. Suggest a change only if it is set below 4, for example underenvin~/.claude/settings.json.
For Codex, ~/.agents/skills/ is the active current catalog; treat the former
~/.codex/skills/ location as legacy migration material only. Never describe it as the active
discovery location or ask an operator to recreate it.
7. Bootstrap Memory (Existing Projects Only)
Seed .memory/ from existing code. Use detection from Steps 4 and 4c — don't re-scan.
- decisions/ — architectural choices (from 4c ADRs)
- patterns/ — service object conventions, controller patterns, test patterns
- gotchas/ — reverts/hotfixes in git history, files changed 5+ times recently
- context/ — domain entities and relationships from models
Update .memory/index.md. Report: "Bootstrapped memory with N decisions, M patterns, K gotchas."
7b. Generate Architecture Diagrams
Run the architecture-diagram workflow to generate initial C4 diagrams from the codebase scan
(Claude /architecture-diagram; Codex $architecture-diagram).
Use the inventory from Step 4 — don't re-scan.
Output: .docs/architecture/ with system-context.md, containers.md, components.md, erd.md,
and up to 5 sequence diagrams for primary request flows.
For new/fresh projects, generate skeleton diagrams with placeholder components from the scaffold output. These will be populated as the design develops.
Present diagrams to user for validation before proceeding.
8. Frontend Styleguide (Projects with Frontend Only)
If frontend detected, generate from templates/styleguide.md.template to
.docs/decisions/styleguide.md. If styleguide already exists, reference it instead.
Skip for API-only projects.
9. MCP Integration Setup
Offer MCP server configuration based on project:
- GitHub: if git remote exists, configure
gh copilot mcpin settings - Issue tracker: if user mentions Linear/Jira, help configure appropriate MCP
- Browser automation (full-stack only): configure
@modelcontextprotocol/server-puppeteerfor manual-test automation. Skip for API-only (curl suffices).
For full-stack projects, GitHub and browser automation MCP are expected — configure them unless the user explicitly declines. For API-only projects, MCP is optional.
10. Smoke Test
Verify the project works: database connects, test framework runs, app loads without errors. Report failures before proceeding — a broken foundation wastes all downstream effort.
10a. Initialize Git, Configure Remote & First Push
Applies to new and fresh projects. Skip for partial/re-bootstrap —
those already have history and a remote. Run AFTER the smoke test (Step 10) so the
seed commit captures a scaffold that actually boots.
-
Repo + default branch. Confirm the repo exists (
git rev-parse --is-inside-work-tree); if not,git init -b main. Ensure the current branch is the default name (main, unless the operator'sinit.defaultBranchgit config says otherwise) — on older git that started onmaster, rename withgit branch -m main. -
Seed commit (only if there is no history yet). If
git rev-parse HEADfails (no commits), stage everything honoring.gitignoreand make ONE initial commit. Never amend, re-commit, or rewrite an existing history.git add -A git commit -m "chore: initial project scaffold (harness bootstrap)"If a commit already exists (a
freshproject that came with history), skip the seed commit and keep its history intact. -
Remote (
origin). Checkgit remote get-url origin:- Already set — leave it untouched. Never rewrite a remote the user configured.
- Missing, and
ghis authenticated (gh auth statusexits 0) — offer to create a GitHub repo and wireoriginin one step. Confirm the repo name (default: the project directory name) and visibility (private by default):
{"operation":"repository.create","repository":"OWNER/REPOSITORY","resource":{"kind":"repository"},"context":{"actor":"OPERATOR"},"payload":{"title":"bootstrap","body":"private"}}Save that exact request as
request.json, confirm the one-time prompt, then runai-conductor github-operation --request-file request.json.--source=.attachesoriginto this repo without pushing yet.- Missing, no
gh(or the user declines GitHub) — ask for a remote URL. If given:git remote add origin <url>. If the user has no remote yet, skip the remote and push, and note it — the repo is fully valid locally and a remote can be added later. Do not block bootstrap on this. - Auto mode — if
ghis authenticated, create a private repo named after the directory without prompting; otherwise skip remote + push (never block).
-
Push & set upstream — only when an
originremote exists:{"operation":"remote-ref.push","repository":"OWNER/REPOSITORY","resource":{"kind":"remote-ref","ref":"refs/heads/main"},"context":{"actor":"OPERATOR"}}Save it as
push-request.json, confirm the one-time initial-publication prompt, and runai-conductor github-operation --request-file push-request.json. After it succeeds, rungit branch --set-upstream-to=origin/main. This records the upstream so latergit push/git pullandgh pr creatework without extra flags. If the push is rejected because the remote already has commits (the user pointedoriginat a non-empty repo), do NOT force — stop and surface it for the user to reconcile. -
Verify.
git remote -vlistsorigin,git rev-parse --abbrev-ref --symbolic-full-name @{u}resolves toorigin/main, andgit statusis clean.
Branch-policy note: this seed commit on main is the one sanctioned
direct-to-main commit — a brand-new repo has no branch to PR into. From here on,
all harness work happens on feature branches/worktrees and merges via PR (the repository harness
branch policy). The pre-PR lint hook (Step 3d-ii) and a remote are now both in place,
so the very first feature can open a PR end-to-end.
10b. Auto-Register in the Project Registry
After onboarding completes, register this project in the harness project registry
(~/.ai-conductor/registry.json) so daemons and cross-project tooling can discover it.
Run the single-writer registry command — it is idempotent (canonical-path dedup) and
preserves status provenance (a project previously scaffolded by conduct create keeps its
created status rather than being downgraded to registered):
conduct register .
Honor $AI_CONDUCTOR_REGISTRY if set (tests and alternate installs point it elsewhere). A
non-zero exit means the registry write failed — surface it; do not silently continue. Re-running
bootstrap is safe: the same canonical path resolves to one record.
Worktree exception: conduct register refuses (non-zero exit, no write) when . is a
LINKED git worktree (e.g. a daemon feature worktree under a project's .worktrees/) rather than
a repo's primary checkout — that path is a subdirectory of an already-registered project, not an
independent one, and registering it would leave a permanent ghost entry once the worktree is
cleaned up post-ship. This specific refusal is expected and NOT a failure to surface: skip step
10b silently when it occurs. Any other non-zero exit (unwritable registry, corrupt file) is still
a real failure and must be surfaced.
11. Recommend Next Steps
| Mode | Recommendation |
|---|---|
| Fresh | /conduct → /explore → /prd → /stories → normal flow |
| Existing (first harness setup) | /stories (review drafts) → /conflict-check → normal flow |
| Existing (new feature) | /explore → /prd → /stories (new + review drafts) → normal flow |
| Existing (improve coverage) | /stories (fill TODOs) → /plan → /tdd → /finish |
| Existing (onboarding) | /conduct --status — read inventory and memory |
Verification
- [ ] Bootstrap mode correctly determined <!-- ai-conductor:session-command-context=operator-only -->
- [ ] Project config initialized via
ai-conductor config initafter git exists <!-- /ai-conductor:session-command-context --> - [ ] Project type detected from file indicators
- [ ] Tech-context loaded if matching stack found
- [ ] Existing code analyzed with inventory presented (if existing project)
- [ ] As-built stories drafted (if existing project)
- [ ] Existing architectural decisions documented as ADRs (if existing project)
- [ ] .memory/ created and seeded (if existing project)
- [ ] .docs/ subdirectories created
- [ ]
.github/pull_request_template.mdcreated (if not already present) - [ ]
.claude/settings.jsoncreated with project-scoped Read/Edit/Write permissions (if not already present) - [ ] CLAUDE.md generated or appended — never overwritten
- [ ]
.env.examplegenerated with shared/worktree-specific boundary sections - [ ]
.envgenerated from.env.examplewith real defaults - [ ]
.env.localgenerated with worktree-specific overrides - [ ]
.pipeline/,.daemon/,.worktrees/,.memory(no trailing slash),.env, and.env.localadded to.gitignore - [ ] Process manager detected (or noted as absent)
- [ ] Smoke test passed
- [ ] Git initialized on
mainwith a seed commit (new/fresh projects) - [ ]
originremote configured viagh repo createor a user-provided URL — or explicitly skipped with a note (new/fresh projects) - [ ] First push set upstream to
origin/mainwhen a remote exists (new/fresh projects) - [ ] Project auto-registered via
conduct register .(idempotent; honors$AI_CONDUCTOR_REGISTRY) - [ ] Architecture diagrams generated in
.docs/architecture/ - [ ] MCP integration offered
04 同仓库更多 Skills
build-review-dependency-hygiene
Judge whether a feature diff adds unnecessary, insufficiently pinned, or license-incompatible dependencies.
writing-system-tests
Use BEFORE implementing any feature that has stories in .docs/stories/ — generates failing acceptance specs from acceptance criteria as the RED phase of TDD. Generates HTTP/request-level acceptance tests for headless/API projects, end-to-end UI tests for projects with a frontend, using the project's own test framework and directory conventions.
verify-claims
Use only when an active workflow is about to rely on a nontrivial factual claim or assumption for a spec, plan, ADR, finding, or code decision. Do not invoke for casual questions, status reports, restatements, or trivially verifiable mechanics.
tdd
Use when implementing any feature or bugfix. Five-step cycle: RED → DOMAIN → GREEN → DOMAIN → COMMIT. Enforces test-first development with domain integrity review at every phase boundary.
stories
Use only within active engineer/conduct DECIDE after architecture approval, when a committed `.docs/stories` acceptance artifact is required. Do not invoke for general user-story examples, requirements discussion, or direct implementation requests.
stack-land
Use when an operator needs to land reviewed manual changes on the correct closed child of a stacked feature. Operator-invoked only: inspect ownership, propose the safe child with evidence, and require confirmation before opening the landing.