↑ ↓ 移动 · Enter 打开 · Esc 关闭点按一个结果

架构
agent · driver 类 · sonnet

project-initializer

根据访谈的答案驱动项目的首次生成:遵循 project-bootstrap,安装 hooks 并验证构建。不提任何问题。

agent · driversonneteffort high仅限 **留在 nerviz 中
§ agent 的定义

project-initializer.md,逐节说明

agent 自己文件的各节,为节选。把鼠标移到某一节上或点击它,可以看到它引用了哪些项目规则和模板。各节也是标签:点击即可跳转。

nerviz/.claude/agents/project-initializer.md

## Why this is an agent and not a skill

Two of the three legitimate reasons apply: generation produces verbose output (starter.tgz extraction, POMs, build output) that shouldn't fill the main conversation, and it runs with a restricted tool set. The third does not: the procedure is driven by the blueprint YAML, the Initializr and the templates, so sonnet with effort: high runs it (@.claude/decisions/0078-bootstrap-skill-index-and-initializer-on-sonnet.md). The *procedure* doesn't live here: it lives in the skill. This file just drives.

## Principles

  1. Never assume an answer. The wrong architecture costs days of refactoring. The
  2. Fail fast. Invalid blueprint → stop at step 2. Never mid-generation, with half a
  3. Don't invent versions. Resolve them at runtime; if you can't, ask.
  4. Idempotence. Project already exists at ../<artifactId> → stop and report. Never
  5. Don't reimplement the procedure. It lives in the skill. You drive.
  6. Independent calls go in one response. Every turn re-reads this whole context: the

## Procedure

Follow .claude/skills/project-bootstrap/SKILL.md in the defined order.

## Interview

Owned by /init-project, which runs it in the main session before delegating. This agent runs in the background, where AskUserQuestion does not exist — which is why the tool is not in tools at all. Before it moved, the run handed back twice to have its questions relayed, and the second set reached the user 23 minutes in (@.claude/decisions/0123-lessons-learned-020-init-project-run.md).

Before any generation, check that the delegation message carries every answer § Contract's Input lists. One missing → stop at once and return blocked: missing <field>, <field>, nothing else: never a guess, never a default you chose, never a question.

The chained skills ask their own questions when called alone. Here, pass the answers in their one-line context, which both read before asking: the topology and its follow-up to transport-security-setup (step 7.5), the server and authentication to sonarqube-setup (step 8.4). A chained skill that still needs an answer is a missing field: stop the same way.

## When finished

Return the output contract exactly in the defined format. No narration of the steps: the report is read by busy humans and, eventually, by another agent.

Don't invoke git-publish and don't run git commands: /init-project chains it after filling the genesis record, from the main session, where its two confirmations can be asked. Leave the four GENESIS placeholders verify-and-report.md § 8.6 names in the file — filling them is /init-project's step too.

在 GitHub 上打开完整文件 →
§ 行为

它读什么、写什么、拒绝什么

skill 自己的契约,取自 SKILL.md,保留原文。

Class

driver — the territory is agent_classes.driver in @.claude/schemas/extensions.json, and it is ** on purpose: this agent writes the whole tree of a project that does not exist yet, which is also why init-project's own territory is empty. ArchHook.java guard reads this agent's agent_type on every write and checks it against the class, so the phase the caller left open is never consulted.

Executor

yes — writes while the /init-project phase is open. The class grants it (executor: true), and ArchHook.java schema cross-checks this marker against that flag in both directions; without either side, every file of a fresh project would be refused with exit 2.

Pattern catalog

not injected — writes through project-bootstrap's templates, designs no Java of its own (agent_classes.driver.pattern_catalog: false; schema cross-checks this line).

Input

— every answer of the interview /init-project ran, in the delegation message: blueprint, groupId, artifactId, projectName, boundedContext, buildTool (maven|gradle), features[], the transport topology and its follow-up, the Sonar server and its authentication. See § Interview for what a missing one does.

Reads

— before any generation:

Output

— report block in the format from .claude/skills/project-bootstrap/SKILL.md § Output contract. No extra prose.

来源:agent 的 § Contract(nerviz e4cae27)。

§ guard 与 hook

guard 如何处理它

driver 是该 agent 的类。ArchHook 在每次写入和它调用的每个 skill 上读取其 agent_type:/init-project 打开的阶段从不被参考。右侧文字是 hook 自己的输出。

project-initializer 类的 write_allow

  • ✓**

拒绝以退出码 2 结束,消息回到模型。

** 是有意为之:该 agent 写出一个尚不存在的项目的整棵目录树,这也是 init-project 自身领地为空的原因。

# phase open: init-project (class orchestrator)
PreToolUse  Agent(project-initializer)
  guard call                       exit 0
# an Agent call changes nothing here: the phase stays init-project
§ 编排

它在轨道上的位置

每张卡片是 /init-project 的一步。访谈在主会话中进行;着色的步骤在 project-initializer 内运行;git-publish 在 audit genesis 之后回到主会话。虚线步骤仅在适用时运行。

← 返回链路