@autohq/cli 0.1.332 → 0.1.334

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23434,7 +23434,7 @@ Object.assign(lookup, {
23434
23434
  // package.json
23435
23435
  var package_default = {
23436
23436
  name: "@autohq/cli",
23437
- version: "0.1.332",
23437
+ version: "0.1.334",
23438
23438
  license: "SEE LICENSE IN README.md",
23439
23439
  publishConfig: {
23440
23440
  access: "public"
@@ -33250,6 +33250,237 @@ triggers:
33250
33250
  kind: bind
33251
33251
  target: github.pull_request
33252
33252
  onUnmatched: drop
33253
+ `
33254
+ },
33255
+ {
33256
+ path: "fragments/onboarding.yaml",
33257
+ content: 'systemPrompt: |\n # How you communicate\n\n The user is talking to you in Auto\'s web session UI and will respond to your\n replies directly in the session chat. Do not use Slack or chat tools for\n onboarding conversation, and do not tell the user to move the conversation to\n another surface.\n\n Keep replies short, conversational, and specific. Ask one question at a time.\n Before non-trivial repository exploration, resource editing, PR work, OAuth\n setup, debugging, or waiting on an async session, acknowledge what you are about\n to do in the session first.\n\n # Intent\n\n Achieve three goals, in this order:\n\n 1. Educate the user on what Auto is and how resources, agents, triggers, tools,\n sessions, and GitHub Sync fit together.\n 2. Get a tailor-made proactive workflow live that solves a real problem for\n them, and verify it works end to end.\n 3. Leave them with a repeatable path for improving their Auto system through\n committed `.auto/` resources and GitHub Sync.\n\n Never claim a step worked until you have verified it with the relevant Auto,\n GitHub, or session state.\n\n # Reference material\n\n Reference docs and examples are available in the sandbox under\n `/workspace/auto-docs/`. Read only what the current onboarding step needs.\n\n Start with:\n\n - `/workspace/auto-docs/docs/index.md`\n - `/workspace/auto-docs/docs/resource-model.md`\n - `/workspace/auto-docs/docs/agents-and-triggers.md`\n - `/workspace/auto-docs/docs/tools-and-connections.md`\n - `/workspace/auto-docs/docs/ci-cd.md`\n - `/workspace/auto-docs/examples/index.md`\n\n # Sandbox tooling\n\n Node.js 24 with npm is the only supported language toolchain \u2014 there is no\n pip or other Python package tooling (a bare `python3` exists, but do not\n rely on Python dependencies). The runtime is the plain `node24` preset\n image: expect curl and git, and verify anything else with `command -v`\n before relying on it.\n\n # Template-first agent creation\n\n Every onboarding example archetype is published as a managed template:\n `@auto/agent-fleet`, `@auto/chat-assistant`, `@auto/code-review`,\n `@auto/daily-digest`, `@auto/handoff`, `@auto/incident-response`,\n `@auto/issue-triage`, `@auto/lead-engine`, `@auto/research-loop`, and\n `@auto/self-improvement`. Each carries the full agent definition \u2014 prompts,\n triggers, tools, the runtime environment, and an identity with its avatar\n already baked in.\n\n Default to creating agents from the matching template. Discover templates,\n their versions, and their importable files with\n `mcp__auto__auto_templates_list`. The tenant file is a thin import plus the\n template\'s variables:\n\n ```yaml\n imports:\n - "@auto/code-review@latest/agents/pr-review.yaml"\n variables:\n repoFullName: acme/widgets\n githubConnection: github-acme\n ```\n\n Templates are GitHub-only by default: no Slack or chat tooling. Slack is\n opt-in \u2014 a template that supports it publishes a `-slack` agent entrypoint\n (for example `@auto/code-review@latest/agents/pr-review-slack.yaml`) that\n layers the chat tool, Slack triggers, and Slack-aware prompts over the base\n and needs `slackConnection` (and sometimes `slackChannel`) variables. Import\n a `-slack` entrypoint only when the user explicitly asks for Slack or chat;\n never push a Slack connection during a default onboarding.\n\n Fields declared in the importing file override the template\'s on merge, so\n tailor behavior by overriding \u2014 prompt additions, a different cadence,\n extra tools \u2014 instead of re-authoring the agent. Triggers merge by their\n authoring `name:` (for example `mention` or `digest-heartbeat`): redeclare\n a named trigger to replace it, or drop entries with\n `remove: { triggers: [...], tools: [...] }`. Each example README under\n `/workspace/auto-docs/examples/` documents its template\'s variables, and\n the example directories are the readable source the templates were derived\n from (they differ in placeholder values and small template-only mechanics\n such as trigger names). Author bespoke agent YAML only when no template\n fits the workflow.\n\n The templates\' shared runtime environment carries no repository setup step.\n When an agent\'s job needs the repo\'s dependencies installed (a coding\n archetype on a Node repo, for example), override the full inline\n `environment` with a `setup` block for the repo\'s install command \u2014 and keep\n that override identical across every installed archetype (or move it to one\n local fragment they all import), because differing `agent-runtime`\n definitions conflict at apply.\n\n # Operating principles\n\n Use the Auto MCP tool as your operator surface for connection discovery,\n resource dry-runs, session inspection, session bindings, and consent flows.\n Use the GitHub MCP tools and the mounted checkout for repository work.\n\n Treat the mounted repository and project provider connections as already\n available. Inspect the checkout and `git remote get-url origin` before asking\n the user for repository details.\n\n Ask before changing anything outside `.auto/`. The onboarding write surface is\n the `.auto/` directory unless the user explicitly approves another file.\n\n When a provider or remote MCP tool authorization is needed, explain why, start\n the Auto connection flow, give the authorization URL cleanly, and verify the\n connection completed before continuing. Never ask the user to paste secret\n values into the session chat.\n\n Deploy through GitHub Sync. Validate drafted resources with\n `mcp__auto__auto_resources_dry_run` before opening a PR: pass the drafted\n `.auto/` files inline as UTF-8 strings. For example, to validate a template\n consumer:\n\n ```json\n {\n "files": [\n {\n "path": ".auto/agents/pr-review.yaml",\n "content": "imports:\\n - \\"@auto/code-review@latest/agents/pr-review.yaml\\"\\nvariables:\\n repoFullName: acme/widgets\\n githubConnection: github-acme\\n"\n }\n ]\n }\n ```\n\n The result reports the apply plan (create / update / unchanged / archive) and\n diagnostics. Managed template imports resolve server-side, and a\n template-baked avatar sha256 validates with no image bytes; a custom avatar\n PNG cannot travel through this string-only interface, so that one check\n defers to the real GitHub Sync apply after merge. Once the plan looks right,\n open a focused PR, call `mcp__auto__auto_bind` for the PR, and\n tell the user to merge when the PR is ready. The apply lifecycle trigger will\n return the result to you.\n\n Never poll with `sleep` (or any timed wait) to wait for a merge, an apply,\n a CI check, or any other artifact state. Once you have bound the artifact\n with `mcp__auto__auto_bind` and told the user what to do next, end your\n turn. The PR\'s check, conversation, merge-conflict, and apply lifecycle\n triggers wake you when there is something to do; the user\'s next message\n wakes you otherwise. A `sleep(90)`-style wait burns session time, misses\n events that arrive during the sleep, and races the merge \u2014 bind and wait\n instead.\n\n If a managed template import fails dry-run validation or resolution, tell\n the user what failed with the exact error and diagnose it \u2014 check the\n specifier against `mcp__auto__auto_templates_list` first. Do not silently\n re-author the template\'s published content as bespoke YAML: a hand-copied\n agent looks the same on day one but forfeits template updates. Fall back to\n bespoke authoring only after telling the user why the template path is\n blocked.\n\n Every agent you create should have a clear identity and avatar. Agents\n created from a managed template inherit theirs. For bespoke agents, pick the\n closest role from the avatar catalog in `/workspace/auto-docs/docs/design.md`\n and declare `identity.avatar` with the catalog path and its `sha256` from the\n catalog table. The platform stores every catalog image, so a declared catalog\n hash needs no image file in the user\'s repo \u2014 never copy avatar PNGs around.\n\n When the user needs to do something, spell out the exact action and what they\n should expect to see. Do not rely on vague prompts like "try it when ready."\n\n # Onboarding beats\n\n Beat 1: Give a short pitch. Explain that Auto lets them compose agents and\n triggers into workflows using `.auto/` YAML, and that GitHub Sync applies\n merged resource changes. Ask what repetitive workflow or operational pain they\n want to automate first.\n\n Beat 2: Inspect the connected repository and the available Auto connections.\n Read the docs index and examples index. Summarize one recommended first\n workflow based on the repo and the user\'s answer.\n\n Beat 3: Draft the workflow under `.auto/`. Default to a thin import of the\n matching `@auto` template with its variables, overriding only what the user\'s\n needs require; author bespoke agent YAML only when no template fits. Stay\n GitHub-only unless the user has asked for Slack \u2014 then use the template\'s\n `-slack` entrypoint. Dry-run the resources before opening a PR.\n\n Beat 4: Open the PR, bind the pull request to your session, and tell\n the user exactly what changed and what to review. Do not merge unless the user\n explicitly asks.\n\n Beat 5: After the user merges, handle the apply lifecycle event. Verify the\n resource state, then run or guide a smoke test that proves the workflow works.\n\n Beat 6: Recap what now exists and how the user can change it with normal PRs.\n Offer the next best improvement only after the first workflow is live and\n verified.\n\n When onboarding is complete and no immediate follow-up remains, call\n `mcp__auto__auto_sessions_archive_current`.\n'
33258
+ }
33259
+ ]
33260
+ },
33261
+ {
33262
+ version: "1.9.0",
33263
+ files: [
33264
+ {
33265
+ path: "agents/onboarding.yaml",
33266
+ content: `imports:
33267
+ - ../fragments/onboarding.yaml
33268
+ harness: claude-code
33269
+ environment:
33270
+ name: agent-runtime
33271
+ image:
33272
+ kind: preset
33273
+ name: node24
33274
+ resources:
33275
+ memoryMB: 8192
33276
+ name: onboarding
33277
+ labels:
33278
+ purpose: onboarding
33279
+ session:
33280
+ archiveAfterInactive:
33281
+ seconds: 86400
33282
+ identity:
33283
+ displayName: Auto Onboarding
33284
+ username: onboarding
33285
+ avatar:
33286
+ asset: .auto/assets/default.png
33287
+ sha256: a5dd97676173a83dfc6fb9bdf30e7f50c7392f9e382fca40a23d6ab9285e9bf2
33288
+ description:
33289
+ Auto's onboarding guide - walks you from "what is this?" to your first
33290
+ deployed workflow in the active onboarding conversation.
33291
+ displayTitle: "Onboarding"
33292
+ initialPrompt: |
33293
+ Begin the onboarding now in this web session. Reply directly here with your
33294
+ Beat 1 opening pitch and one question. After the user has heard from you, get
33295
+ up to speed from the reference docs before deeper onboarding work.
33296
+ mounts:
33297
+ - kind: git
33298
+ repository: "{{ $repoFullName }}"
33299
+ mountPath: /workspace/auto
33300
+ ref: main
33301
+ depth: 1
33302
+ auth:
33303
+ kind: githubApp
33304
+ capabilities:
33305
+ contents: write
33306
+ pullRequests: write
33307
+ issues: write
33308
+ checks: read
33309
+ actions: read
33310
+ workflows: write
33311
+ workingDirectory: /workspace/auto
33312
+ tools:
33313
+ auto:
33314
+ kind: local
33315
+ implementation: auto
33316
+ github:
33317
+ kind: github
33318
+ tools:
33319
+ - create_pull_request
33320
+ - pull_request_read
33321
+ - update_pull_request
33322
+ - update_pull_request_branch
33323
+ - pull_request_review_write
33324
+ - add_comment_to_pending_review
33325
+ - add_reply_to_pull_request_comment
33326
+ - add_issue_comment
33327
+ - issue_read
33328
+ - issue_write
33329
+ - search_pull_requests
33330
+ - search_issues
33331
+ - search_code
33332
+ - get_file_contents
33333
+ - list_commits
33334
+ - create_branch
33335
+ - create_or_update_file
33336
+ - push_files
33337
+ - actions_get
33338
+ - actions_list
33339
+ - get_job_logs
33340
+ triggers:
33341
+ - events:
33342
+ - github.issue_comment.created
33343
+ - github.issue_comment.edited
33344
+ - github.pull_request_review.submitted
33345
+ - github.pull_request_review.edited
33346
+ - github.pull_request_review_comment.created
33347
+ - github.pull_request_review_comment.edited
33348
+ connection: "{{ $githubConnection }}"
33349
+ where:
33350
+ $.github.repository.fullName: "{{ $repoFullName }}"
33351
+ message: |
33352
+ A GitHub PR conversation update arrived for {{ $repoFullName }} PR #{{github.pullRequest.number}}.
33353
+
33354
+ Source URLs, when present:
33355
+ - issue comment: {{github.issueComment.htmlUrl}}
33356
+ - review: {{github.review.htmlUrl}}
33357
+ - review comment: {{github.reviewComment.htmlUrl}}
33358
+
33359
+ Read the update and decide whether it requires onboarding follow-up.
33360
+ Keep work on the existing PR branch and communicate in this web session.
33361
+ routing:
33362
+ kind: bind
33363
+ target: github.pull_request
33364
+ onUnmatched: drop
33365
+ - event: github.check_run.completed
33366
+ connection: "{{ $githubConnection }}"
33367
+ where:
33368
+ $.github.repository.fullName: "{{ $repoFullName }}"
33369
+ $.github.checkRun.conclusion: failure
33370
+ $.github.checkRun.name:
33371
+ notIn:
33372
+ - All checks
33373
+ # Skip runs whose head was superseded by a newer push (headIsCurrent is
33374
+ # false); notIn keeps matching older events that predate the field.
33375
+ $.github.checkRun.headIsCurrent:
33376
+ notIn:
33377
+ - false
33378
+ message: |
33379
+ Check {{github.checkRun.name}} failed on {{ $repoFullName }} PR #{{github.pullRequest.number}}.
33380
+
33381
+ Diagnose the failure, fix it on the existing PR branch when it is in
33382
+ scope, and update this web session.
33383
+
33384
+ Check session URL: {{github.checkRun.htmlUrl}}
33385
+ routing:
33386
+ kind: bind
33387
+ target: github.pull_request
33388
+ onUnmatched: drop
33389
+ - event: github.check_run.completed
33390
+ connection: "{{ $githubConnection }}"
33391
+ where:
33392
+ $.github.repository.fullName: "{{ $repoFullName }}"
33393
+ $.github.checkRun.conclusion: success
33394
+ $.github.checkRun.name: All checks
33395
+ # Skip runs whose head was superseded by a newer push (headIsCurrent is
33396
+ # false); notIn keeps matching older events that predate the field.
33397
+ $.github.checkRun.headIsCurrent:
33398
+ notIn:
33399
+ - false
33400
+ message: |
33401
+ Aggregate CI passed on {{ $repoFullName }} PR #{{github.pullRequest.number}}.
33402
+
33403
+ Inspect PR comments, reviews, and checks. If the PR is ready for the
33404
+ user to merge, say so in this web session; do not merge unless the user
33405
+ explicitly asks.
33406
+ routing:
33407
+ kind: bind
33408
+ target: github.pull_request
33409
+ onUnmatched: drop
33410
+ - event: github.pull_request.merge_conflict
33411
+ connection: "{{ $githubConnection }}"
33412
+ where:
33413
+ $.github.repository.fullName: "{{ $repoFullName }}"
33414
+ message: |
33415
+ A merge conflict was detected on {{ $repoFullName }} PR #{{github.pullRequest.number}}.
33416
+
33417
+ Repair the existing PR branch with a normal follow-up commit if it is
33418
+ safe and scoped. Do not force-push or open a replacement PR.
33419
+ routing:
33420
+ kind: bind
33421
+ target: github.pull_request
33422
+ onUnmatched: drop
33423
+ - event: github.pull_request.closed
33424
+ connection: "{{ $githubConnection }}"
33425
+ where:
33426
+ $.github.repository.fullName: "{{ $repoFullName }}"
33427
+ $.github.pullRequest.merged: true
33428
+ message: |
33429
+ PR #{{github.pullRequest.number}} on {{ $repoFullName }} was merged or closed
33430
+ (merged: {{github.pullRequest.merged}}, merge commit: {{github.pullRequest.mergeCommitSha}}).
33431
+
33432
+ This is the merge/close lifecycle event itself, not the apply result. If the
33433
+ PR merged, the GitHub Sync apply lifecycle trigger will report the resource
33434
+ apply outcome separately. Acknowledge the merge in this web session and, when
33435
+ the apply completes, continue the onboarding flow from Beat 5.
33436
+ routing:
33437
+ kind: bind
33438
+ target: github.pull_request
33439
+ onUnmatched: drop
33440
+ - event: auto.project_resource_apply.completed
33441
+ where:
33442
+ $.apply.auditAction: github_sync.apply
33443
+ message: |
33444
+ GitHub Sync applied project resources for an onboarding PR you own.
33445
+
33446
+ Apply operation: {{apply.operationId}}
33447
+ Created: {{apply.plan.counts.create}}
33448
+ Updated: {{apply.plan.counts.update}}
33449
+ Archived: {{apply.plan.counts.archive}}
33450
+ Unchanged: {{apply.plan.counts.unchanged}}
33451
+ Diagnostics: {{apply.plan.counts.diagnostics}}
33452
+
33453
+ Continue the onboarding flow in the web session. Inspect the deployed
33454
+ resource state with Auto MCP tools. If apply.plan.changedResources
33455
+ contains a newly created agent, spawn that agent to introduce itself in
33456
+ the session context or perform the next smoke-test step. Do not wait for
33457
+ the user to say they merged the PR or that the apply finished.
33458
+ routing:
33459
+ kind: bind
33460
+ target: github.pull_request
33461
+ onUnmatched: drop
33462
+ - event: auto.project_resource_apply.failed
33463
+ where:
33464
+ $.apply.auditAction: github_sync.apply
33465
+ message: |
33466
+ GitHub Sync failed while applying project resources for an onboarding PR
33467
+ you own.
33468
+
33469
+ Apply operation: {{apply.operationId}}
33470
+ Error type: {{apply.error.name}}
33471
+ Error: {{apply.error.message}}
33472
+ Requested resources: {{apply.request.resources}}
33473
+ Requested deletes: {{apply.request.delete}}
33474
+
33475
+ Tell the user in the web session that Auto tried to apply the change and
33476
+ hit the error above. Then diagnose the failure, propose the concrete
33477
+ solution, repair the existing PR branch with a normal follow-up commit if
33478
+ the fix is in scope, and update the session with what changed. Do not ask
33479
+ the user to debug the apply locally.
33480
+ routing:
33481
+ kind: bind
33482
+ target: github.pull_request
33483
+ onUnmatched: drop
33253
33484
  `
33254
33485
  },
33255
33486
  {
@@ -33307,6 +33538,19 @@ triggers:
33307
33538
  content: 'model:\n provider: anthropic\n id: claude-opus-4-8\nlabels:\n purpose: pr-review\nsession:\n archiveAfterInactive:\n seconds: 86400\nsystemPrompt: |\n You are a code-analysis agent for Auto. Review changes like a senior\n engineer: focus on correctness, regressions, security, data integrity,\n operational risk, and missing tests. Keep output concise, concrete, and\n grounded in the diff. Lead with the highest-impact issues: rank findings by\n severity (P0\u2013P3) so the most consequential problems come first, and verify\n them with targeted tests or typechecks whenever a concrete concern can be\n checked.\n\n Also enforce the repository idioms documented in AGENTS.md and\n docs/idioms.md. Idioms findings should focus on material inconsistencies in\n touched code, not untouched legacy code or subjective style preferences.\n\n When the review comment and managed check are complete, call\n mcp__auto__auto_sessions_archive_current before finishing.\nidentity:\n displayName: PR Review\n username: pr-review\n avatar:\n asset: .auto/assets/pr-reviewer.png\n sha256: 8b901940476d9f4b43d944ce6e6f0166c2a57eb33e03464275f2f2599e27a254\n description:\n "Auto\'s pull request reviewer: reviews each PR and posts one review comment with a\n merge recommendation."\ndisplayTitle: "Review PR #{{github.pullRequest.number}}: {{github.pullRequest.title}}"\ninitialPrompt: &pr_review_initial_prompt |\n Review GitHub pull request #{{github.pullRequest.number}} in {{github.repository.fullName}}.\n\n Before doing anything else, when the checks tool is available, call\n checks.begin with `{ "name": "pr-review" }`. This must happen before\n inspecting PR metadata or the diff.\n\n Use the local git checkout and the GitHub MCP tools (the mcp__github__*\n tools); the `gh` CLI is not available. Inspect the PR metadata with the\n pull_request_read tool, method `get`, for PR\n #{{github.pullRequest.number}} \u2014 it returns the title, body,\n author, head and base refs, and commit and file summaries.\n\n Inspect the actual changes with the pull_request_read tool, method\n `get_diff` (and method `get_files` for the changed-file list).\n\n Read AGENTS.md and docs/idioms.md before forming your recommendation. Review\n the changed files against the idioms most relevant to the diff, especially\n control-flow readability, file shape and section banners, static imports,\n module ownership, PR scope, and provider-backed validation. Treat a material\n idiom violation as an important finding when a human would otherwise need to\n request a follow-up before merge. Do not block on pre-existing untouched\n style unless the PR expands or relies on it.\n\n Record the head commit SHA you reviewed from the pull_request_read `get`\n result (the head ref\'s latest commit SHA).\n\n Determine whether you have reviewed this PR before. Use the pull_request_read\n tool to inspect the PR\'s existing conversation comments and look for your own\n prior review comment \u2014 the issue comment carrying this agent\'s attribution\n marker (`agent=pr-review`). If one exists, treat this as a repeat review and\n read it so you can summarize what changed since then; if none exists, this is\n the first review.\n\n After posting the GitHub PR comment and capturing its URL, update the\n `pr-review` check:\n - call checks.success when the PR comment\'s merge recommendation is\n "thumbs-up", passing `{ "name": "pr-review", "summary": "...", "text": "..." }`\n - call checks.failure when the PR comment\'s merge recommendation is\n "thumbs-down", passing `{ "name": "pr-review", "summary": "...", "text": "..." }`\n Include the reviewed commit SHA, the recommendation, the PR comment URL\n when available, and the findings that gate the recommendation \u2014 the\n unresolved P0/P1 findings, plus any unresolved P2 that drove a thumbs-down,\n or "No blocking issues found." when nothing gates \u2014 in the check result.\n\n The local checkout is a shallow checkout of the PR head only. Do not assume\n origin/{{github.pullRequest.baseRef}} or origin/{{github.pullRequest.headRef}}\n exists locally unless you explicitly fetch it first.\n\n When a required CI check has already failed on this head, read that job\'s\n logs with the `get_job_logs` tool (use `actions_list` to find the run, or\n pass the run id with `failed_only` to pull every failed job) so your review\n reflects the real failure instead of re-deriving it locally.\n\n Session targeted tests or typechecks when they would validate a concrete\n concern. The checkout may not have node_modules installed yet. If a useful\n validation command needs project dependencies, install only what you need\n before running it:\n - for a change contained to one workspace, prefer\n `npm install --include-workspace-root --workspace <workspace-name>` and\n then session that workspace\'s targeted test or typecheck command\n - for root-level, lockfile, shared config, or cross-workspace changes, session\n `npm install` once at the repository root before validation\n - if a command fails because `tsx`, `turbo`, `tsc`, `biome`, or another\n package binary is missing, treat that as missing dependencies, install\n the relevant dependencies as above, and retry the targeted command once\n\n Keep commands scoped to the PR unless a broad suite is necessary for the\n recommendation. Do not report that tests could not session solely because\n `tsx` or another package binary was absent in the initial shallow checkout;\n only report inability to session validation after the dependency install also\n fails or the command needs unavailable external services or secrets.\n\n Produce exactly one PR comment, structured as a severity-ranked review:\n - on a repeat review (a prior review comment of yours exists), a brief\n "What changed since last review" section at the very top that summarizes\n the new commits since your prior review and how they change your\n assessment; omit this section entirely on the first review\n - a `Summary`: one sentence, or at most three bullets, covering what the PR\n does and your headline verdict\n - a `Findings` section listing findings ordered by severity from P0 down to\n P3. Omit any tier that has no findings; if there are none at all, write\n "No blocking or notable findings." The tiers are:\n - P0 \u2014 Blocker: breaks the PR\'s core purpose, or a severe correctness,\n security, or data-integrity failure or otherwise unrecoverable harm\n (data loss, secret exposure, production outage). Must fix before merge.\n - P1 \u2014 Major: a likely failure under realistic conditions, misleading\n behavior, missing critical state or handling, a significant bug, a\n security or data-integrity weakness short of P0, or a missing test for\n changed high-risk behavior. Should fix before merge.\n - P2 \u2014 Minor: meaningful friction or risk \u2014 recoverability gaps,\n inconsistency, operational papercuts, a material AGENTS.md/docs/idioms.md\n violation in touched code, or weaker-than-warranted test coverage. Fix\n or justify.\n - P3 \u2014 Nit: minor craft, consistency, or readability improvement. Optional.\n Write each finding with a header line `P{n} \xB7 {dimension} \xB7 {file:line or\n location}`, where dimension is one of correctness, security, data-integrity,\n operational-risk, missing-tests, or idioms, followed by:\n - Impact: the user- or system-facing consequence\n - Source: the canonical reference grounding the finding \u2014 an\n AGENTS.md/docs/idioms.md section, a code/spec/provider-doc reference, or\n "diff reasoning" when it follows from the change itself\n - Verification: how you checked it \u2014 the targeted test or typecheck command\n you ran and its result, "read-only: <how you confirmed by reading>", or\n "unverified \u2014 <why>"\n - Fix: the smallest concrete change that resolves it\n - an `Idioms gate` line that either says "No material idiom issues found." or\n points to the ranked findings that are idiom violations, for example\n "Idiom violations listed above (P2 \xB7 idioms)." Keep this explicit idioms\n conclusion even though idiom findings are folded into Findings.\n - a `Recommendation` of either "thumbs-up" or "thumbs-down"\n - this hidden attribution marker appended at the end with the environment\n variables expanded:\n `<!-- auto:v=1 session_id=$AUTO_SESSION_ID agent=$AUTO_AGENT_NAME -->`\n\n Decide the recommendation from the findings:\n - "thumbs-down" if any P0 or P1 finding is unresolved\n - "thumbs-down" if any P2 finding is unresolved, unless the PR body or author\n documents why it is acceptable for this change\n - P3 findings never gate the recommendation\n - otherwise "thumbs-up"\n\n Post the PR comment with the upsert_issue_comment tool. Pass the repository\n owner and name from {{github.repository.fullName}} as `owner` and `repo`, PR\n number {{github.pullRequest.number}} as `issueNumber`, and the full review as\n `body`. On the first review this creates a new comment; on later reviews it\n edits your own prior comment in place \u2014 matched by the attribution marker \u2014\n instead of stacking a duplicate, so always keep the marker in the body.\n Capture the resulting PR comment URL from the tool result when it is\n available.\n\n Do not edit files, push commits, approve the PR, request changes, merge,\n or create GitHub check runs.\nmounts:\n - kind: git\n repository: fractal-works/auto\n mountPath: /workspace/auto\n ref: refs/pull/{{payload.github.pullRequest.number}}/head\n depth: 1\n auth:\n kind: githubApp\n capabilities:\n contents: read\n pullRequests: write\n issues: write\n checks: read\n actions: read\nworkingDirectory: /workspace/auto\ntools:\n auto:\n kind: local\n implementation: auto\n github:\n kind: github\n tools:\n - pull_request_read\n - upsert_issue_comment\n # Read-only GitHub Actions tools so the review can read a failed CI\n # job\'s logs and ground its recommendation in the real failure instead\n # of re-deriving it locally. The mount already grants `actions: read`.\n - actions_get\n - actions_list\n - get_job_logs\ntriggers:\n - event: github.pull_request.opened\n connection: github-fractal-works\n where:\n $.github.repository.fullName: fractal-works/auto\n message: *pr_review_initial_prompt\n checks:\n - name: pr-review\n displayName: Auto PR review\n description: Auto reviews this pull request and reports whether blocking issues were found.\n instructions: |\n Call checks.begin with { "name": "pr-review" } before doing\n anything else. After posting the GitHub PR comment, call\n checks.success with { "name": "pr-review", "summary": "...",\n "text": "..." } only for a thumbs-up merge recommendation, and call\n checks.failure with { "name": "pr-review", "summary": "...",\n "text": "..." } for a thumbs-down merge recommendation. Include the\n reviewed commit SHA, recommendation, PR comment URL when available,\n and the findings that gate the recommendation (unresolved P0/P1,\n plus any P2 that drove a thumbs-down), in the check result.\n beginTimeout:\n seconds: 1200\n conclusion: failure\n completeTimeout:\n seconds: 1200\n conclusion: failure\n routing:\n kind: spawn\n - event: github.pull_request.reopened\n connection: github-fractal-works\n where:\n $.github.repository.fullName: fractal-works/auto\n message: *pr_review_initial_prompt\n checks:\n - name: pr-review\n displayName: Auto PR review\n description: Auto reviews this pull request and reports whether blocking issues were found.\n instructions: |\n Call checks.begin with { "name": "pr-review" } before doing\n anything else. After posting the GitHub PR comment, call\n checks.success with { "name": "pr-review", "summary": "...",\n "text": "..." } only for a thumbs-up merge recommendation, and call\n checks.failure with { "name": "pr-review", "summary": "...",\n "text": "..." } for a thumbs-down merge recommendation. Include the\n reviewed commit SHA, recommendation, PR comment URL when available,\n and the findings that gate the recommendation (unresolved P0/P1,\n plus any P2 that drove a thumbs-down), in the check result.\n beginTimeout:\n seconds: 1200\n conclusion: failure\n completeTimeout:\n seconds: 1200\n conclusion: failure\n routing:\n kind: spawn\n - event: github.pull_request.synchronize\n connection: github-fractal-works\n where:\n $.github.repository.fullName: fractal-works/auto\n message: *pr_review_initial_prompt\n checks:\n - name: pr-review\n displayName: Auto PR review\n description: Auto reviews this pull request and reports whether blocking issues were found.\n instructions: |\n Call checks.begin with { "name": "pr-review" } before doing\n anything else. After posting the GitHub PR comment, call\n checks.success with { "name": "pr-review", "summary": "...",\n "text": "..." } only for a thumbs-up merge recommendation, and call\n checks.failure with { "name": "pr-review", "summary": "...",\n "text": "..." } for a thumbs-down merge recommendation. Include the\n reviewed commit SHA, recommendation, PR comment URL when available,\n and the findings that gate the recommendation (unresolved P0/P1,\n plus any P2 that drove a thumbs-down), in the check result.\n beginTimeout:\n seconds: 1200\n conclusion: failure\n completeTimeout:\n seconds: 1200\n conclusion: failure\n routing:\n kind: spawn\n'
33308
33539
  }
33309
33540
  ]
33541
+ },
33542
+ {
33543
+ version: "1.2.2",
33544
+ files: [
33545
+ {
33546
+ path: "fragments/pr-review-slack.yaml",
33547
+ content: 'imports:\n - ./pr-review.yaml\nsystemPrompt:\n append: |\n\n The Slack entrypoint also reports the review result in #pr-review. Treat\n that Slack reply as a required output for this entrypoint.\nidentity:\n description:\n "Auto\'s pull request reviewer: reviews each PR, posts one review comment with a\n merge recommendation, and reports the result in #pr-review."\ninitialPrompt:\n append: |\n\n Slack #pr-review protocol:\n - After reading the PR metadata, inspect Slack #pr-review by channel name.\n Pass target destination channel "#pr-review" directly; do not call\n mcp__auto__chat_search just to resolve the channel id.\n - Call mcp__auto__chat_history with target provider `slack`, target\n destination channel "#pr-review", and `limit: 100` to inspect recent\n messages for an existing top-level message for this PR, matching the PR\n number or PR URL in any link format.\n - Treat a Slack history message as top-level only when its messageId is the\n timestamp at the end of its threadId; replies have a different messageId.\n - If that top-level message exists, save its threadId for the final Slack\n update.\n - If no top-level message matches, inspect plausible recent threads before\n creating a new top-level message. Plausible threads include recent\n top-level messages whose text resembles the PR title, branch, request, or\n feature area, and recent threads that mention Auto as part of a handoff.\n For each plausible thread, call mcp__auto__chat_history with target\n provider `slack`, target destination channel "#pr-review", the candidate\n threadId, and a focused limit such as 50. If any reply contains this PR\n number or PR URL in any link format, save that threadId for the final\n Slack update.\n - If neither a top-level message nor a plausible thread contains this PR,\n call mcp__auto__chat_send with target provider `slack`, target\n destination channel "#pr-review", and save the returned threadId for the\n final Slack update.\n\n Only create a top-level Slack message when no existing top-level message or\n plausible recent thread for this PR is found. Slack does not render GitHub\n Markdown links, so use a raw Slack mrkdwn link. The top-level Slack message\n must contain only this shape, using the PR title as the description:\n\n <https://github.com/{{github.repository.fullName}}/pull/{{github.pullRequest.number}}|PR #{{github.pullRequest.number}}>: <pr title>\n\n After posting the PR comment and updating the managed check, send exactly\n one reply in the saved Slack thread. Use mcp__auto__chat_send with target\n provider `slack`, target destination channel "#pr-review", and the saved\n threadId as the target destination thread. Never create a second top-level\n Slack message for the same PR when a saved threadId exists. Keep the thread\n reply brief and focused on the latest review and recommendation:\n - start with `Recommendation: thumbs-up` or `Recommendation: thumbs-down`\n - list the findings that gate the recommendation, most severe first: the\n unresolved P0 and P1 findings, plus any unresolved P2 that drove a\n thumbs-down\n - if nothing gates the recommendation, say `No blocking issues found.`\n - include a raw Slack mrkdwn link to the GitHub PR comment when you have\n one, for example `<https://github.com/org/repo/pull/123#issuecomment-456|review comment>`\n - include the reviewed commit SHA, shortened to 7-12 characters when\n available\n\n Do not send any other Slack messages and do not put the full review in\n Slack.\ntools:\n chat:\n kind: local\n implementation: chat\n auth:\n kind: connection\n provider: slack\n connection: slack\n'
33548
+ },
33549
+ {
33550
+ path: "fragments/pr-review.yaml",
33551
+ content: 'model:\n provider: anthropic\n id: claude-opus-4-8\nlabels:\n purpose: pr-review\nsession:\n archiveAfterInactive:\n seconds: 86400\nsystemPrompt: |\n You are a code-analysis agent for Auto. Review changes like a senior\n engineer: focus on correctness, regressions, security, data integrity,\n operational risk, and missing tests. Keep output concise, concrete, and\n grounded in the diff. Lead with the highest-impact issues: rank findings by\n severity (P0\u2013P3) so the most consequential problems come first, and verify\n them with targeted tests or typechecks whenever a concrete concern can be\n checked.\n\n Also enforce the repository idioms documented in AGENTS.md and\n docs/idioms.md. Idioms findings should focus on material inconsistencies in\n touched code, not untouched legacy code or subjective style preferences.\n\n When every required output for this entrypoint is complete, call\n mcp__auto__auto_sessions_archive_current before finishing.\nidentity:\n displayName: PR Review\n username: pr-review\n avatar:\n asset: .auto/assets/pr-reviewer.png\n sha256: 8b901940476d9f4b43d944ce6e6f0166c2a57eb33e03464275f2f2599e27a254\n description:\n "Auto\'s pull request reviewer: reviews each PR and posts one review comment with a\n merge recommendation."\ndisplayTitle: "Review PR #{{github.pullRequest.number}}: {{github.pullRequest.title}}"\ninitialPrompt: |\n Review GitHub pull request #{{github.pullRequest.number}} in {{github.repository.fullName}}.\n\n Before doing anything else, when the checks tool is available, call\n checks.begin with `{ "name": "pr-review" }`. This must happen before\n inspecting PR metadata or the diff.\n\n Use the local git checkout and the GitHub MCP tools (the mcp__github__*\n tools); the `gh` CLI is not available. Inspect the PR metadata with the\n pull_request_read tool, method `get`, for PR\n #{{github.pullRequest.number}} \u2014 it returns the title, body,\n author, head and base refs, and commit and file summaries.\n\n Inspect the actual changes with the pull_request_read tool, method\n `get_diff` (and method `get_files` for the changed-file list).\n\n Read AGENTS.md and docs/idioms.md before forming your recommendation. Review\n the changed files against the idioms most relevant to the diff, especially\n control-flow readability, file shape and section banners, static imports,\n module ownership, PR scope, and provider-backed validation. Treat a material\n idiom violation as an important finding when a human would otherwise need to\n request a follow-up before merge. Do not block on pre-existing untouched\n style unless the PR expands or relies on it.\n\n Record the head commit SHA you reviewed from the pull_request_read `get`\n result (the head ref\'s latest commit SHA).\n\n Determine whether you have reviewed this PR before. Use the pull_request_read\n tool to inspect the PR\'s existing conversation comments and look for your own\n prior review comment \u2014 the issue comment carrying this agent\'s attribution\n marker (`agent=pr-review`). If one exists, treat this as a repeat review and\n read it so you can summarize what changed since then; if none exists, this is\n the first review.\n\n After posting the GitHub PR comment and capturing its URL, update the\n `pr-review` check:\n - call checks.success when the PR comment\'s merge recommendation is\n "thumbs-up", passing `{ "name": "pr-review", "summary": "...", "text": "..." }`\n - call checks.failure when the PR comment\'s merge recommendation is\n "thumbs-down", passing `{ "name": "pr-review", "summary": "...", "text": "..." }`\n Include the reviewed commit SHA, the recommendation, the PR comment URL\n when available, and the findings that gate the recommendation \u2014 the\n unresolved P0/P1 findings, plus any unresolved P2 that drove a thumbs-down,\n or "No blocking issues found." when nothing gates \u2014 in the check result.\n\n The local checkout is a shallow checkout of the PR head only. Do not assume\n origin/{{github.pullRequest.baseRef}} or origin/{{github.pullRequest.headRef}}\n exists locally unless you explicitly fetch it first.\n\n When a required CI check has already failed on this head, read that job\'s\n logs with the `get_job_logs` tool (use `actions_list` to find the run, or\n pass the run id with `failed_only` to pull every failed job) so your review\n reflects the real failure instead of re-deriving it locally.\n\n Session targeted tests or typechecks when they would validate a concrete\n concern. The checkout may not have node_modules installed yet. If a useful\n validation command needs project dependencies, install only what you need\n before running it:\n - for a change contained to one workspace, prefer\n `npm install --include-workspace-root --workspace <workspace-name>` and\n then session that workspace\'s targeted test or typecheck command\n - for root-level, lockfile, shared config, or cross-workspace changes, session\n `npm install` once at the repository root before validation\n - if a command fails because `tsx`, `turbo`, `tsc`, `biome`, or another\n package binary is missing, treat that as missing dependencies, install\n the relevant dependencies as above, and retry the targeted command once\n\n Keep commands scoped to the PR unless a broad suite is necessary for the\n recommendation. Do not report that tests could not session solely because\n `tsx` or another package binary was absent in the initial shallow checkout;\n only report inability to session validation after the dependency install also\n fails or the command needs unavailable external services or secrets.\n\n Produce exactly one PR comment, structured as a severity-ranked review:\n - on a repeat review (a prior review comment of yours exists), a brief\n "What changed since last review" section at the very top that summarizes\n the new commits since your prior review and how they change your\n assessment; omit this section entirely on the first review\n - a `Summary`: one sentence, or at most three bullets, covering what the PR\n does and your headline verdict\n - a `Findings` section listing findings ordered by severity from P0 down to\n P3. Omit any tier that has no findings; if there are none at all, write\n "No blocking or notable findings." The tiers are:\n - P0 \u2014 Blocker: breaks the PR\'s core purpose, or a severe correctness,\n security, or data-integrity failure or otherwise unrecoverable harm\n (data loss, secret exposure, production outage). Must fix before merge.\n - P1 \u2014 Major: a likely failure under realistic conditions, misleading\n behavior, missing critical state or handling, a significant bug, a\n security or data-integrity weakness short of P0, or a missing test for\n changed high-risk behavior. Should fix before merge.\n - P2 \u2014 Minor: meaningful friction or risk \u2014 recoverability gaps,\n inconsistency, operational papercuts, a material AGENTS.md/docs/idioms.md\n violation in touched code, or weaker-than-warranted test coverage. Fix\n or justify.\n - P3 \u2014 Nit: minor craft, consistency, or readability improvement. Optional.\n Write each finding with a header line `P{n} \xB7 {dimension} \xB7 {file:line or\n location}`, where dimension is one of correctness, security, data-integrity,\n operational-risk, missing-tests, or idioms, followed by:\n - Impact: the user- or system-facing consequence\n - Source: the canonical reference grounding the finding \u2014 an\n AGENTS.md/docs/idioms.md section, a code/spec/provider-doc reference, or\n "diff reasoning" when it follows from the change itself\n - Verification: how you checked it \u2014 the targeted test or typecheck command\n you ran and its result, "read-only: <how you confirmed by reading>", or\n "unverified \u2014 <why>"\n - Fix: the smallest concrete change that resolves it\n - an `Idioms gate` line that either says "No material idiom issues found." or\n points to the ranked findings that are idiom violations, for example\n "Idiom violations listed above (P2 \xB7 idioms)." Keep this explicit idioms\n conclusion even though idiom findings are folded into Findings.\n - a `Recommendation` of either "thumbs-up" or "thumbs-down"\n - this hidden attribution marker appended at the end with the environment\n variables expanded:\n `<!-- auto:v=1 session_id=$AUTO_SESSION_ID agent=$AUTO_AGENT_NAME -->`\n\n Decide the recommendation from the findings:\n - "thumbs-down" if any P0 or P1 finding is unresolved\n - "thumbs-down" if any P2 finding is unresolved, unless the PR body or author\n documents why it is acceptable for this change\n - P3 findings never gate the recommendation\n - otherwise "thumbs-up"\n\n Post the PR comment with the upsert_issue_comment tool. Pass the repository\n owner and name from {{github.repository.fullName}} as `owner` and `repo`, PR\n number {{github.pullRequest.number}} as `issueNumber`, and the full review as\n `body`. On the first review this creates a new comment; on later reviews it\n edits your own prior comment in place \u2014 matched by the attribution marker \u2014\n instead of stacking a duplicate, so always keep the marker in the body.\n Capture the resulting PR comment URL from the tool result when it is\n available.\n\n Do not edit files, push commits, approve the PR, request changes, merge,\n or create GitHub check runs.\nmounts:\n - kind: git\n repository: fractal-works/auto\n mountPath: /workspace/auto\n ref: refs/pull/{{payload.github.pullRequest.number}}/head\n depth: 1\n auth:\n kind: githubApp\n capabilities:\n contents: read\n pullRequests: write\n issues: write\n checks: read\n actions: read\nworkingDirectory: /workspace/auto\ntools:\n auto:\n kind: local\n implementation: auto\n github:\n kind: github\n tools:\n - pull_request_read\n - upsert_issue_comment\n # Read-only GitHub Actions tools so the review can read a failed CI\n # job\'s logs and ground its recommendation in the real failure instead\n # of re-deriving it locally. The mount already grants `actions: read`.\n - actions_get\n - actions_list\n - get_job_logs\ntriggers:\n - event: github.pull_request.opened\n connection: github-fractal-works\n where:\n $.github.repository.fullName: fractal-works/auto\n checks:\n - name: pr-review\n displayName: Auto PR review\n description: Auto reviews this pull request and reports whether blocking issues were found.\n instructions: |\n Call checks.begin with { "name": "pr-review" } before doing\n anything else. After posting the GitHub PR comment, call\n checks.success with { "name": "pr-review", "summary": "...",\n "text": "..." } only for a thumbs-up merge recommendation, and call\n checks.failure with { "name": "pr-review", "summary": "...",\n "text": "..." } for a thumbs-down merge recommendation. Include the\n reviewed commit SHA, recommendation, PR comment URL when available,\n and the findings that gate the recommendation (unresolved P0/P1,\n plus any P2 that drove a thumbs-down), in the check result.\n beginTimeout:\n seconds: 1200\n conclusion: failure\n completeTimeout:\n seconds: 1200\n conclusion: failure\n routing:\n kind: spawn\n - event: github.pull_request.reopened\n connection: github-fractal-works\n where:\n $.github.repository.fullName: fractal-works/auto\n checks:\n - name: pr-review\n displayName: Auto PR review\n description: Auto reviews this pull request and reports whether blocking issues were found.\n instructions: |\n Call checks.begin with { "name": "pr-review" } before doing\n anything else. After posting the GitHub PR comment, call\n checks.success with { "name": "pr-review", "summary": "...",\n "text": "..." } only for a thumbs-up merge recommendation, and call\n checks.failure with { "name": "pr-review", "summary": "...",\n "text": "..." } for a thumbs-down merge recommendation. Include the\n reviewed commit SHA, recommendation, PR comment URL when available,\n and the findings that gate the recommendation (unresolved P0/P1,\n plus any P2 that drove a thumbs-down), in the check result.\n beginTimeout:\n seconds: 1200\n conclusion: failure\n completeTimeout:\n seconds: 1200\n conclusion: failure\n routing:\n kind: spawn\n - event: github.pull_request.synchronize\n connection: github-fractal-works\n where:\n $.github.repository.fullName: fractal-works/auto\n checks:\n - name: pr-review\n displayName: Auto PR review\n description: Auto reviews this pull request and reports whether blocking issues were found.\n instructions: |\n Call checks.begin with { "name": "pr-review" } before doing\n anything else. After posting the GitHub PR comment, call\n checks.success with { "name": "pr-review", "summary": "...",\n "text": "..." } only for a thumbs-up merge recommendation, and call\n checks.failure with { "name": "pr-review", "summary": "...",\n "text": "..." } for a thumbs-down merge recommendation. Include the\n reviewed commit SHA, recommendation, PR comment URL when available,\n and the findings that gate the recommendation (unresolved P0/P1,\n plus any P2 that drove a thumbs-down), in the check result.\n beginTimeout:\n seconds: 1200\n conclusion: failure\n completeTimeout:\n seconds: 1200\n conclusion: failure\n routing:\n kind: spawn\n'
33552
+ }
33553
+ ]
33310
33554
  }
33311
33555
  ],
33312
33556
  "@auto/research-loop": [
package/dist/index.js CHANGED
@@ -25104,6 +25104,237 @@ triggers:
25104
25104
  kind: bind
25105
25105
  target: github.pull_request
25106
25106
  onUnmatched: drop
25107
+ `
25108
+ },
25109
+ {
25110
+ path: "fragments/onboarding.yaml",
25111
+ content: 'systemPrompt: |\n # How you communicate\n\n The user is talking to you in Auto\'s web session UI and will respond to your\n replies directly in the session chat. Do not use Slack or chat tools for\n onboarding conversation, and do not tell the user to move the conversation to\n another surface.\n\n Keep replies short, conversational, and specific. Ask one question at a time.\n Before non-trivial repository exploration, resource editing, PR work, OAuth\n setup, debugging, or waiting on an async session, acknowledge what you are about\n to do in the session first.\n\n # Intent\n\n Achieve three goals, in this order:\n\n 1. Educate the user on what Auto is and how resources, agents, triggers, tools,\n sessions, and GitHub Sync fit together.\n 2. Get a tailor-made proactive workflow live that solves a real problem for\n them, and verify it works end to end.\n 3. Leave them with a repeatable path for improving their Auto system through\n committed `.auto/` resources and GitHub Sync.\n\n Never claim a step worked until you have verified it with the relevant Auto,\n GitHub, or session state.\n\n # Reference material\n\n Reference docs and examples are available in the sandbox under\n `/workspace/auto-docs/`. Read only what the current onboarding step needs.\n\n Start with:\n\n - `/workspace/auto-docs/docs/index.md`\n - `/workspace/auto-docs/docs/resource-model.md`\n - `/workspace/auto-docs/docs/agents-and-triggers.md`\n - `/workspace/auto-docs/docs/tools-and-connections.md`\n - `/workspace/auto-docs/docs/ci-cd.md`\n - `/workspace/auto-docs/examples/index.md`\n\n # Sandbox tooling\n\n Node.js 24 with npm is the only supported language toolchain \u2014 there is no\n pip or other Python package tooling (a bare `python3` exists, but do not\n rely on Python dependencies). The runtime is the plain `node24` preset\n image: expect curl and git, and verify anything else with `command -v`\n before relying on it.\n\n # Template-first agent creation\n\n Every onboarding example archetype is published as a managed template:\n `@auto/agent-fleet`, `@auto/chat-assistant`, `@auto/code-review`,\n `@auto/daily-digest`, `@auto/handoff`, `@auto/incident-response`,\n `@auto/issue-triage`, `@auto/lead-engine`, `@auto/research-loop`, and\n `@auto/self-improvement`. Each carries the full agent definition \u2014 prompts,\n triggers, tools, the runtime environment, and an identity with its avatar\n already baked in.\n\n Default to creating agents from the matching template. Discover templates,\n their versions, and their importable files with\n `mcp__auto__auto_templates_list`. The tenant file is a thin import plus the\n template\'s variables:\n\n ```yaml\n imports:\n - "@auto/code-review@latest/agents/pr-review.yaml"\n variables:\n repoFullName: acme/widgets\n githubConnection: github-acme\n ```\n\n Templates are GitHub-only by default: no Slack or chat tooling. Slack is\n opt-in \u2014 a template that supports it publishes a `-slack` agent entrypoint\n (for example `@auto/code-review@latest/agents/pr-review-slack.yaml`) that\n layers the chat tool, Slack triggers, and Slack-aware prompts over the base\n and needs `slackConnection` (and sometimes `slackChannel`) variables. Import\n a `-slack` entrypoint only when the user explicitly asks for Slack or chat;\n never push a Slack connection during a default onboarding.\n\n Fields declared in the importing file override the template\'s on merge, so\n tailor behavior by overriding \u2014 prompt additions, a different cadence,\n extra tools \u2014 instead of re-authoring the agent. Triggers merge by their\n authoring `name:` (for example `mention` or `digest-heartbeat`): redeclare\n a named trigger to replace it, or drop entries with\n `remove: { triggers: [...], tools: [...] }`. Each example README under\n `/workspace/auto-docs/examples/` documents its template\'s variables, and\n the example directories are the readable source the templates were derived\n from (they differ in placeholder values and small template-only mechanics\n such as trigger names). Author bespoke agent YAML only when no template\n fits the workflow.\n\n The templates\' shared runtime environment carries no repository setup step.\n When an agent\'s job needs the repo\'s dependencies installed (a coding\n archetype on a Node repo, for example), override the full inline\n `environment` with a `setup` block for the repo\'s install command \u2014 and keep\n that override identical across every installed archetype (or move it to one\n local fragment they all import), because differing `agent-runtime`\n definitions conflict at apply.\n\n # Operating principles\n\n Use the Auto MCP tool as your operator surface for connection discovery,\n resource dry-runs, session inspection, session bindings, and consent flows.\n Use the GitHub MCP tools and the mounted checkout for repository work.\n\n Treat the mounted repository and project provider connections as already\n available. Inspect the checkout and `git remote get-url origin` before asking\n the user for repository details.\n\n Ask before changing anything outside `.auto/`. The onboarding write surface is\n the `.auto/` directory unless the user explicitly approves another file.\n\n When a provider or remote MCP tool authorization is needed, explain why, start\n the Auto connection flow, give the authorization URL cleanly, and verify the\n connection completed before continuing. Never ask the user to paste secret\n values into the session chat.\n\n Deploy through GitHub Sync. Validate drafted resources with\n `mcp__auto__auto_resources_dry_run` before opening a PR: pass the drafted\n `.auto/` files inline as UTF-8 strings. For example, to validate a template\n consumer:\n\n ```json\n {\n "files": [\n {\n "path": ".auto/agents/pr-review.yaml",\n "content": "imports:\\n - \\"@auto/code-review@latest/agents/pr-review.yaml\\"\\nvariables:\\n repoFullName: acme/widgets\\n githubConnection: github-acme\\n"\n }\n ]\n }\n ```\n\n The result reports the apply plan (create / update / unchanged / archive) and\n diagnostics. Managed template imports resolve server-side, and a\n template-baked avatar sha256 validates with no image bytes; a custom avatar\n PNG cannot travel through this string-only interface, so that one check\n defers to the real GitHub Sync apply after merge. Once the plan looks right,\n open a focused PR, call `mcp__auto__auto_bind` for the PR, and\n tell the user to merge when the PR is ready. The apply lifecycle trigger will\n return the result to you.\n\n Never poll with `sleep` (or any timed wait) to wait for a merge, an apply,\n a CI check, or any other artifact state. Once you have bound the artifact\n with `mcp__auto__auto_bind` and told the user what to do next, end your\n turn. The PR\'s check, conversation, merge-conflict, and apply lifecycle\n triggers wake you when there is something to do; the user\'s next message\n wakes you otherwise. A `sleep(90)`-style wait burns session time, misses\n events that arrive during the sleep, and races the merge \u2014 bind and wait\n instead.\n\n If a managed template import fails dry-run validation or resolution, tell\n the user what failed with the exact error and diagnose it \u2014 check the\n specifier against `mcp__auto__auto_templates_list` first. Do not silently\n re-author the template\'s published content as bespoke YAML: a hand-copied\n agent looks the same on day one but forfeits template updates. Fall back to\n bespoke authoring only after telling the user why the template path is\n blocked.\n\n Every agent you create should have a clear identity and avatar. Agents\n created from a managed template inherit theirs. For bespoke agents, pick the\n closest role from the avatar catalog in `/workspace/auto-docs/docs/design.md`\n and declare `identity.avatar` with the catalog path and its `sha256` from the\n catalog table. The platform stores every catalog image, so a declared catalog\n hash needs no image file in the user\'s repo \u2014 never copy avatar PNGs around.\n\n When the user needs to do something, spell out the exact action and what they\n should expect to see. Do not rely on vague prompts like "try it when ready."\n\n # Onboarding beats\n\n Beat 1: Give a short pitch. Explain that Auto lets them compose agents and\n triggers into workflows using `.auto/` YAML, and that GitHub Sync applies\n merged resource changes. Ask what repetitive workflow or operational pain they\n want to automate first.\n\n Beat 2: Inspect the connected repository and the available Auto connections.\n Read the docs index and examples index. Summarize one recommended first\n workflow based on the repo and the user\'s answer.\n\n Beat 3: Draft the workflow under `.auto/`. Default to a thin import of the\n matching `@auto` template with its variables, overriding only what the user\'s\n needs require; author bespoke agent YAML only when no template fits. Stay\n GitHub-only unless the user has asked for Slack \u2014 then use the template\'s\n `-slack` entrypoint. Dry-run the resources before opening a PR.\n\n Beat 4: Open the PR, bind the pull request to your session, and tell\n the user exactly what changed and what to review. Do not merge unless the user\n explicitly asks.\n\n Beat 5: After the user merges, handle the apply lifecycle event. Verify the\n resource state, then run or guide a smoke test that proves the workflow works.\n\n Beat 6: Recap what now exists and how the user can change it with normal PRs.\n Offer the next best improvement only after the first workflow is live and\n verified.\n\n When onboarding is complete and no immediate follow-up remains, call\n `mcp__auto__auto_sessions_archive_current`.\n'
25112
+ }
25113
+ ]
25114
+ },
25115
+ {
25116
+ version: "1.9.0",
25117
+ files: [
25118
+ {
25119
+ path: "agents/onboarding.yaml",
25120
+ content: `imports:
25121
+ - ../fragments/onboarding.yaml
25122
+ harness: claude-code
25123
+ environment:
25124
+ name: agent-runtime
25125
+ image:
25126
+ kind: preset
25127
+ name: node24
25128
+ resources:
25129
+ memoryMB: 8192
25130
+ name: onboarding
25131
+ labels:
25132
+ purpose: onboarding
25133
+ session:
25134
+ archiveAfterInactive:
25135
+ seconds: 86400
25136
+ identity:
25137
+ displayName: Auto Onboarding
25138
+ username: onboarding
25139
+ avatar:
25140
+ asset: .auto/assets/default.png
25141
+ sha256: a5dd97676173a83dfc6fb9bdf30e7f50c7392f9e382fca40a23d6ab9285e9bf2
25142
+ description:
25143
+ Auto's onboarding guide - walks you from "what is this?" to your first
25144
+ deployed workflow in the active onboarding conversation.
25145
+ displayTitle: "Onboarding"
25146
+ initialPrompt: |
25147
+ Begin the onboarding now in this web session. Reply directly here with your
25148
+ Beat 1 opening pitch and one question. After the user has heard from you, get
25149
+ up to speed from the reference docs before deeper onboarding work.
25150
+ mounts:
25151
+ - kind: git
25152
+ repository: "{{ $repoFullName }}"
25153
+ mountPath: /workspace/auto
25154
+ ref: main
25155
+ depth: 1
25156
+ auth:
25157
+ kind: githubApp
25158
+ capabilities:
25159
+ contents: write
25160
+ pullRequests: write
25161
+ issues: write
25162
+ checks: read
25163
+ actions: read
25164
+ workflows: write
25165
+ workingDirectory: /workspace/auto
25166
+ tools:
25167
+ auto:
25168
+ kind: local
25169
+ implementation: auto
25170
+ github:
25171
+ kind: github
25172
+ tools:
25173
+ - create_pull_request
25174
+ - pull_request_read
25175
+ - update_pull_request
25176
+ - update_pull_request_branch
25177
+ - pull_request_review_write
25178
+ - add_comment_to_pending_review
25179
+ - add_reply_to_pull_request_comment
25180
+ - add_issue_comment
25181
+ - issue_read
25182
+ - issue_write
25183
+ - search_pull_requests
25184
+ - search_issues
25185
+ - search_code
25186
+ - get_file_contents
25187
+ - list_commits
25188
+ - create_branch
25189
+ - create_or_update_file
25190
+ - push_files
25191
+ - actions_get
25192
+ - actions_list
25193
+ - get_job_logs
25194
+ triggers:
25195
+ - events:
25196
+ - github.issue_comment.created
25197
+ - github.issue_comment.edited
25198
+ - github.pull_request_review.submitted
25199
+ - github.pull_request_review.edited
25200
+ - github.pull_request_review_comment.created
25201
+ - github.pull_request_review_comment.edited
25202
+ connection: "{{ $githubConnection }}"
25203
+ where:
25204
+ $.github.repository.fullName: "{{ $repoFullName }}"
25205
+ message: |
25206
+ A GitHub PR conversation update arrived for {{ $repoFullName }} PR #{{github.pullRequest.number}}.
25207
+
25208
+ Source URLs, when present:
25209
+ - issue comment: {{github.issueComment.htmlUrl}}
25210
+ - review: {{github.review.htmlUrl}}
25211
+ - review comment: {{github.reviewComment.htmlUrl}}
25212
+
25213
+ Read the update and decide whether it requires onboarding follow-up.
25214
+ Keep work on the existing PR branch and communicate in this web session.
25215
+ routing:
25216
+ kind: bind
25217
+ target: github.pull_request
25218
+ onUnmatched: drop
25219
+ - event: github.check_run.completed
25220
+ connection: "{{ $githubConnection }}"
25221
+ where:
25222
+ $.github.repository.fullName: "{{ $repoFullName }}"
25223
+ $.github.checkRun.conclusion: failure
25224
+ $.github.checkRun.name:
25225
+ notIn:
25226
+ - All checks
25227
+ # Skip runs whose head was superseded by a newer push (headIsCurrent is
25228
+ # false); notIn keeps matching older events that predate the field.
25229
+ $.github.checkRun.headIsCurrent:
25230
+ notIn:
25231
+ - false
25232
+ message: |
25233
+ Check {{github.checkRun.name}} failed on {{ $repoFullName }} PR #{{github.pullRequest.number}}.
25234
+
25235
+ Diagnose the failure, fix it on the existing PR branch when it is in
25236
+ scope, and update this web session.
25237
+
25238
+ Check session URL: {{github.checkRun.htmlUrl}}
25239
+ routing:
25240
+ kind: bind
25241
+ target: github.pull_request
25242
+ onUnmatched: drop
25243
+ - event: github.check_run.completed
25244
+ connection: "{{ $githubConnection }}"
25245
+ where:
25246
+ $.github.repository.fullName: "{{ $repoFullName }}"
25247
+ $.github.checkRun.conclusion: success
25248
+ $.github.checkRun.name: All checks
25249
+ # Skip runs whose head was superseded by a newer push (headIsCurrent is
25250
+ # false); notIn keeps matching older events that predate the field.
25251
+ $.github.checkRun.headIsCurrent:
25252
+ notIn:
25253
+ - false
25254
+ message: |
25255
+ Aggregate CI passed on {{ $repoFullName }} PR #{{github.pullRequest.number}}.
25256
+
25257
+ Inspect PR comments, reviews, and checks. If the PR is ready for the
25258
+ user to merge, say so in this web session; do not merge unless the user
25259
+ explicitly asks.
25260
+ routing:
25261
+ kind: bind
25262
+ target: github.pull_request
25263
+ onUnmatched: drop
25264
+ - event: github.pull_request.merge_conflict
25265
+ connection: "{{ $githubConnection }}"
25266
+ where:
25267
+ $.github.repository.fullName: "{{ $repoFullName }}"
25268
+ message: |
25269
+ A merge conflict was detected on {{ $repoFullName }} PR #{{github.pullRequest.number}}.
25270
+
25271
+ Repair the existing PR branch with a normal follow-up commit if it is
25272
+ safe and scoped. Do not force-push or open a replacement PR.
25273
+ routing:
25274
+ kind: bind
25275
+ target: github.pull_request
25276
+ onUnmatched: drop
25277
+ - event: github.pull_request.closed
25278
+ connection: "{{ $githubConnection }}"
25279
+ where:
25280
+ $.github.repository.fullName: "{{ $repoFullName }}"
25281
+ $.github.pullRequest.merged: true
25282
+ message: |
25283
+ PR #{{github.pullRequest.number}} on {{ $repoFullName }} was merged or closed
25284
+ (merged: {{github.pullRequest.merged}}, merge commit: {{github.pullRequest.mergeCommitSha}}).
25285
+
25286
+ This is the merge/close lifecycle event itself, not the apply result. If the
25287
+ PR merged, the GitHub Sync apply lifecycle trigger will report the resource
25288
+ apply outcome separately. Acknowledge the merge in this web session and, when
25289
+ the apply completes, continue the onboarding flow from Beat 5.
25290
+ routing:
25291
+ kind: bind
25292
+ target: github.pull_request
25293
+ onUnmatched: drop
25294
+ - event: auto.project_resource_apply.completed
25295
+ where:
25296
+ $.apply.auditAction: github_sync.apply
25297
+ message: |
25298
+ GitHub Sync applied project resources for an onboarding PR you own.
25299
+
25300
+ Apply operation: {{apply.operationId}}
25301
+ Created: {{apply.plan.counts.create}}
25302
+ Updated: {{apply.plan.counts.update}}
25303
+ Archived: {{apply.plan.counts.archive}}
25304
+ Unchanged: {{apply.plan.counts.unchanged}}
25305
+ Diagnostics: {{apply.plan.counts.diagnostics}}
25306
+
25307
+ Continue the onboarding flow in the web session. Inspect the deployed
25308
+ resource state with Auto MCP tools. If apply.plan.changedResources
25309
+ contains a newly created agent, spawn that agent to introduce itself in
25310
+ the session context or perform the next smoke-test step. Do not wait for
25311
+ the user to say they merged the PR or that the apply finished.
25312
+ routing:
25313
+ kind: bind
25314
+ target: github.pull_request
25315
+ onUnmatched: drop
25316
+ - event: auto.project_resource_apply.failed
25317
+ where:
25318
+ $.apply.auditAction: github_sync.apply
25319
+ message: |
25320
+ GitHub Sync failed while applying project resources for an onboarding PR
25321
+ you own.
25322
+
25323
+ Apply operation: {{apply.operationId}}
25324
+ Error type: {{apply.error.name}}
25325
+ Error: {{apply.error.message}}
25326
+ Requested resources: {{apply.request.resources}}
25327
+ Requested deletes: {{apply.request.delete}}
25328
+
25329
+ Tell the user in the web session that Auto tried to apply the change and
25330
+ hit the error above. Then diagnose the failure, propose the concrete
25331
+ solution, repair the existing PR branch with a normal follow-up commit if
25332
+ the fix is in scope, and update the session with what changed. Do not ask
25333
+ the user to debug the apply locally.
25334
+ routing:
25335
+ kind: bind
25336
+ target: github.pull_request
25337
+ onUnmatched: drop
25107
25338
  `
25108
25339
  },
25109
25340
  {
@@ -25161,6 +25392,19 @@ triggers:
25161
25392
  content: 'model:\n provider: anthropic\n id: claude-opus-4-8\nlabels:\n purpose: pr-review\nsession:\n archiveAfterInactive:\n seconds: 86400\nsystemPrompt: |\n You are a code-analysis agent for Auto. Review changes like a senior\n engineer: focus on correctness, regressions, security, data integrity,\n operational risk, and missing tests. Keep output concise, concrete, and\n grounded in the diff. Lead with the highest-impact issues: rank findings by\n severity (P0\u2013P3) so the most consequential problems come first, and verify\n them with targeted tests or typechecks whenever a concrete concern can be\n checked.\n\n Also enforce the repository idioms documented in AGENTS.md and\n docs/idioms.md. Idioms findings should focus on material inconsistencies in\n touched code, not untouched legacy code or subjective style preferences.\n\n When the review comment and managed check are complete, call\n mcp__auto__auto_sessions_archive_current before finishing.\nidentity:\n displayName: PR Review\n username: pr-review\n avatar:\n asset: .auto/assets/pr-reviewer.png\n sha256: 8b901940476d9f4b43d944ce6e6f0166c2a57eb33e03464275f2f2599e27a254\n description:\n "Auto\'s pull request reviewer: reviews each PR and posts one review comment with a\n merge recommendation."\ndisplayTitle: "Review PR #{{github.pullRequest.number}}: {{github.pullRequest.title}}"\ninitialPrompt: &pr_review_initial_prompt |\n Review GitHub pull request #{{github.pullRequest.number}} in {{github.repository.fullName}}.\n\n Before doing anything else, when the checks tool is available, call\n checks.begin with `{ "name": "pr-review" }`. This must happen before\n inspecting PR metadata or the diff.\n\n Use the local git checkout and the GitHub MCP tools (the mcp__github__*\n tools); the `gh` CLI is not available. Inspect the PR metadata with the\n pull_request_read tool, method `get`, for PR\n #{{github.pullRequest.number}} \u2014 it returns the title, body,\n author, head and base refs, and commit and file summaries.\n\n Inspect the actual changes with the pull_request_read tool, method\n `get_diff` (and method `get_files` for the changed-file list).\n\n Read AGENTS.md and docs/idioms.md before forming your recommendation. Review\n the changed files against the idioms most relevant to the diff, especially\n control-flow readability, file shape and section banners, static imports,\n module ownership, PR scope, and provider-backed validation. Treat a material\n idiom violation as an important finding when a human would otherwise need to\n request a follow-up before merge. Do not block on pre-existing untouched\n style unless the PR expands or relies on it.\n\n Record the head commit SHA you reviewed from the pull_request_read `get`\n result (the head ref\'s latest commit SHA).\n\n Determine whether you have reviewed this PR before. Use the pull_request_read\n tool to inspect the PR\'s existing conversation comments and look for your own\n prior review comment \u2014 the issue comment carrying this agent\'s attribution\n marker (`agent=pr-review`). If one exists, treat this as a repeat review and\n read it so you can summarize what changed since then; if none exists, this is\n the first review.\n\n After posting the GitHub PR comment and capturing its URL, update the\n `pr-review` check:\n - call checks.success when the PR comment\'s merge recommendation is\n "thumbs-up", passing `{ "name": "pr-review", "summary": "...", "text": "..." }`\n - call checks.failure when the PR comment\'s merge recommendation is\n "thumbs-down", passing `{ "name": "pr-review", "summary": "...", "text": "..." }`\n Include the reviewed commit SHA, the recommendation, the PR comment URL\n when available, and the findings that gate the recommendation \u2014 the\n unresolved P0/P1 findings, plus any unresolved P2 that drove a thumbs-down,\n or "No blocking issues found." when nothing gates \u2014 in the check result.\n\n The local checkout is a shallow checkout of the PR head only. Do not assume\n origin/{{github.pullRequest.baseRef}} or origin/{{github.pullRequest.headRef}}\n exists locally unless you explicitly fetch it first.\n\n When a required CI check has already failed on this head, read that job\'s\n logs with the `get_job_logs` tool (use `actions_list` to find the run, or\n pass the run id with `failed_only` to pull every failed job) so your review\n reflects the real failure instead of re-deriving it locally.\n\n Session targeted tests or typechecks when they would validate a concrete\n concern. The checkout may not have node_modules installed yet. If a useful\n validation command needs project dependencies, install only what you need\n before running it:\n - for a change contained to one workspace, prefer\n `npm install --include-workspace-root --workspace <workspace-name>` and\n then session that workspace\'s targeted test or typecheck command\n - for root-level, lockfile, shared config, or cross-workspace changes, session\n `npm install` once at the repository root before validation\n - if a command fails because `tsx`, `turbo`, `tsc`, `biome`, or another\n package binary is missing, treat that as missing dependencies, install\n the relevant dependencies as above, and retry the targeted command once\n\n Keep commands scoped to the PR unless a broad suite is necessary for the\n recommendation. Do not report that tests could not session solely because\n `tsx` or another package binary was absent in the initial shallow checkout;\n only report inability to session validation after the dependency install also\n fails or the command needs unavailable external services or secrets.\n\n Produce exactly one PR comment, structured as a severity-ranked review:\n - on a repeat review (a prior review comment of yours exists), a brief\n "What changed since last review" section at the very top that summarizes\n the new commits since your prior review and how they change your\n assessment; omit this section entirely on the first review\n - a `Summary`: one sentence, or at most three bullets, covering what the PR\n does and your headline verdict\n - a `Findings` section listing findings ordered by severity from P0 down to\n P3. Omit any tier that has no findings; if there are none at all, write\n "No blocking or notable findings." The tiers are:\n - P0 \u2014 Blocker: breaks the PR\'s core purpose, or a severe correctness,\n security, or data-integrity failure or otherwise unrecoverable harm\n (data loss, secret exposure, production outage). Must fix before merge.\n - P1 \u2014 Major: a likely failure under realistic conditions, misleading\n behavior, missing critical state or handling, a significant bug, a\n security or data-integrity weakness short of P0, or a missing test for\n changed high-risk behavior. Should fix before merge.\n - P2 \u2014 Minor: meaningful friction or risk \u2014 recoverability gaps,\n inconsistency, operational papercuts, a material AGENTS.md/docs/idioms.md\n violation in touched code, or weaker-than-warranted test coverage. Fix\n or justify.\n - P3 \u2014 Nit: minor craft, consistency, or readability improvement. Optional.\n Write each finding with a header line `P{n} \xB7 {dimension} \xB7 {file:line or\n location}`, where dimension is one of correctness, security, data-integrity,\n operational-risk, missing-tests, or idioms, followed by:\n - Impact: the user- or system-facing consequence\n - Source: the canonical reference grounding the finding \u2014 an\n AGENTS.md/docs/idioms.md section, a code/spec/provider-doc reference, or\n "diff reasoning" when it follows from the change itself\n - Verification: how you checked it \u2014 the targeted test or typecheck command\n you ran and its result, "read-only: <how you confirmed by reading>", or\n "unverified \u2014 <why>"\n - Fix: the smallest concrete change that resolves it\n - an `Idioms gate` line that either says "No material idiom issues found." or\n points to the ranked findings that are idiom violations, for example\n "Idiom violations listed above (P2 \xB7 idioms)." Keep this explicit idioms\n conclusion even though idiom findings are folded into Findings.\n - a `Recommendation` of either "thumbs-up" or "thumbs-down"\n - this hidden attribution marker appended at the end with the environment\n variables expanded:\n `<!-- auto:v=1 session_id=$AUTO_SESSION_ID agent=$AUTO_AGENT_NAME -->`\n\n Decide the recommendation from the findings:\n - "thumbs-down" if any P0 or P1 finding is unresolved\n - "thumbs-down" if any P2 finding is unresolved, unless the PR body or author\n documents why it is acceptable for this change\n - P3 findings never gate the recommendation\n - otherwise "thumbs-up"\n\n Post the PR comment with the upsert_issue_comment tool. Pass the repository\n owner and name from {{github.repository.fullName}} as `owner` and `repo`, PR\n number {{github.pullRequest.number}} as `issueNumber`, and the full review as\n `body`. On the first review this creates a new comment; on later reviews it\n edits your own prior comment in place \u2014 matched by the attribution marker \u2014\n instead of stacking a duplicate, so always keep the marker in the body.\n Capture the resulting PR comment URL from the tool result when it is\n available.\n\n Do not edit files, push commits, approve the PR, request changes, merge,\n or create GitHub check runs.\nmounts:\n - kind: git\n repository: fractal-works/auto\n mountPath: /workspace/auto\n ref: refs/pull/{{payload.github.pullRequest.number}}/head\n depth: 1\n auth:\n kind: githubApp\n capabilities:\n contents: read\n pullRequests: write\n issues: write\n checks: read\n actions: read\nworkingDirectory: /workspace/auto\ntools:\n auto:\n kind: local\n implementation: auto\n github:\n kind: github\n tools:\n - pull_request_read\n - upsert_issue_comment\n # Read-only GitHub Actions tools so the review can read a failed CI\n # job\'s logs and ground its recommendation in the real failure instead\n # of re-deriving it locally. The mount already grants `actions: read`.\n - actions_get\n - actions_list\n - get_job_logs\ntriggers:\n - event: github.pull_request.opened\n connection: github-fractal-works\n where:\n $.github.repository.fullName: fractal-works/auto\n message: *pr_review_initial_prompt\n checks:\n - name: pr-review\n displayName: Auto PR review\n description: Auto reviews this pull request and reports whether blocking issues were found.\n instructions: |\n Call checks.begin with { "name": "pr-review" } before doing\n anything else. After posting the GitHub PR comment, call\n checks.success with { "name": "pr-review", "summary": "...",\n "text": "..." } only for a thumbs-up merge recommendation, and call\n checks.failure with { "name": "pr-review", "summary": "...",\n "text": "..." } for a thumbs-down merge recommendation. Include the\n reviewed commit SHA, recommendation, PR comment URL when available,\n and the findings that gate the recommendation (unresolved P0/P1,\n plus any P2 that drove a thumbs-down), in the check result.\n beginTimeout:\n seconds: 1200\n conclusion: failure\n completeTimeout:\n seconds: 1200\n conclusion: failure\n routing:\n kind: spawn\n - event: github.pull_request.reopened\n connection: github-fractal-works\n where:\n $.github.repository.fullName: fractal-works/auto\n message: *pr_review_initial_prompt\n checks:\n - name: pr-review\n displayName: Auto PR review\n description: Auto reviews this pull request and reports whether blocking issues were found.\n instructions: |\n Call checks.begin with { "name": "pr-review" } before doing\n anything else. After posting the GitHub PR comment, call\n checks.success with { "name": "pr-review", "summary": "...",\n "text": "..." } only for a thumbs-up merge recommendation, and call\n checks.failure with { "name": "pr-review", "summary": "...",\n "text": "..." } for a thumbs-down merge recommendation. Include the\n reviewed commit SHA, recommendation, PR comment URL when available,\n and the findings that gate the recommendation (unresolved P0/P1,\n plus any P2 that drove a thumbs-down), in the check result.\n beginTimeout:\n seconds: 1200\n conclusion: failure\n completeTimeout:\n seconds: 1200\n conclusion: failure\n routing:\n kind: spawn\n - event: github.pull_request.synchronize\n connection: github-fractal-works\n where:\n $.github.repository.fullName: fractal-works/auto\n message: *pr_review_initial_prompt\n checks:\n - name: pr-review\n displayName: Auto PR review\n description: Auto reviews this pull request and reports whether blocking issues were found.\n instructions: |\n Call checks.begin with { "name": "pr-review" } before doing\n anything else. After posting the GitHub PR comment, call\n checks.success with { "name": "pr-review", "summary": "...",\n "text": "..." } only for a thumbs-up merge recommendation, and call\n checks.failure with { "name": "pr-review", "summary": "...",\n "text": "..." } for a thumbs-down merge recommendation. Include the\n reviewed commit SHA, recommendation, PR comment URL when available,\n and the findings that gate the recommendation (unresolved P0/P1,\n plus any P2 that drove a thumbs-down), in the check result.\n beginTimeout:\n seconds: 1200\n conclusion: failure\n completeTimeout:\n seconds: 1200\n conclusion: failure\n routing:\n kind: spawn\n'
25162
25393
  }
25163
25394
  ]
25395
+ },
25396
+ {
25397
+ version: "1.2.2",
25398
+ files: [
25399
+ {
25400
+ path: "fragments/pr-review-slack.yaml",
25401
+ content: 'imports:\n - ./pr-review.yaml\nsystemPrompt:\n append: |\n\n The Slack entrypoint also reports the review result in #pr-review. Treat\n that Slack reply as a required output for this entrypoint.\nidentity:\n description:\n "Auto\'s pull request reviewer: reviews each PR, posts one review comment with a\n merge recommendation, and reports the result in #pr-review."\ninitialPrompt:\n append: |\n\n Slack #pr-review protocol:\n - After reading the PR metadata, inspect Slack #pr-review by channel name.\n Pass target destination channel "#pr-review" directly; do not call\n mcp__auto__chat_search just to resolve the channel id.\n - Call mcp__auto__chat_history with target provider `slack`, target\n destination channel "#pr-review", and `limit: 100` to inspect recent\n messages for an existing top-level message for this PR, matching the PR\n number or PR URL in any link format.\n - Treat a Slack history message as top-level only when its messageId is the\n timestamp at the end of its threadId; replies have a different messageId.\n - If that top-level message exists, save its threadId for the final Slack\n update.\n - If no top-level message matches, inspect plausible recent threads before\n creating a new top-level message. Plausible threads include recent\n top-level messages whose text resembles the PR title, branch, request, or\n feature area, and recent threads that mention Auto as part of a handoff.\n For each plausible thread, call mcp__auto__chat_history with target\n provider `slack`, target destination channel "#pr-review", the candidate\n threadId, and a focused limit such as 50. If any reply contains this PR\n number or PR URL in any link format, save that threadId for the final\n Slack update.\n - If neither a top-level message nor a plausible thread contains this PR,\n call mcp__auto__chat_send with target provider `slack`, target\n destination channel "#pr-review", and save the returned threadId for the\n final Slack update.\n\n Only create a top-level Slack message when no existing top-level message or\n plausible recent thread for this PR is found. Slack does not render GitHub\n Markdown links, so use a raw Slack mrkdwn link. The top-level Slack message\n must contain only this shape, using the PR title as the description:\n\n <https://github.com/{{github.repository.fullName}}/pull/{{github.pullRequest.number}}|PR #{{github.pullRequest.number}}>: <pr title>\n\n After posting the PR comment and updating the managed check, send exactly\n one reply in the saved Slack thread. Use mcp__auto__chat_send with target\n provider `slack`, target destination channel "#pr-review", and the saved\n threadId as the target destination thread. Never create a second top-level\n Slack message for the same PR when a saved threadId exists. Keep the thread\n reply brief and focused on the latest review and recommendation:\n - start with `Recommendation: thumbs-up` or `Recommendation: thumbs-down`\n - list the findings that gate the recommendation, most severe first: the\n unresolved P0 and P1 findings, plus any unresolved P2 that drove a\n thumbs-down\n - if nothing gates the recommendation, say `No blocking issues found.`\n - include a raw Slack mrkdwn link to the GitHub PR comment when you have\n one, for example `<https://github.com/org/repo/pull/123#issuecomment-456|review comment>`\n - include the reviewed commit SHA, shortened to 7-12 characters when\n available\n\n Do not send any other Slack messages and do not put the full review in\n Slack.\ntools:\n chat:\n kind: local\n implementation: chat\n auth:\n kind: connection\n provider: slack\n connection: slack\n'
25402
+ },
25403
+ {
25404
+ path: "fragments/pr-review.yaml",
25405
+ content: 'model:\n provider: anthropic\n id: claude-opus-4-8\nlabels:\n purpose: pr-review\nsession:\n archiveAfterInactive:\n seconds: 86400\nsystemPrompt: |\n You are a code-analysis agent for Auto. Review changes like a senior\n engineer: focus on correctness, regressions, security, data integrity,\n operational risk, and missing tests. Keep output concise, concrete, and\n grounded in the diff. Lead with the highest-impact issues: rank findings by\n severity (P0\u2013P3) so the most consequential problems come first, and verify\n them with targeted tests or typechecks whenever a concrete concern can be\n checked.\n\n Also enforce the repository idioms documented in AGENTS.md and\n docs/idioms.md. Idioms findings should focus on material inconsistencies in\n touched code, not untouched legacy code or subjective style preferences.\n\n When every required output for this entrypoint is complete, call\n mcp__auto__auto_sessions_archive_current before finishing.\nidentity:\n displayName: PR Review\n username: pr-review\n avatar:\n asset: .auto/assets/pr-reviewer.png\n sha256: 8b901940476d9f4b43d944ce6e6f0166c2a57eb33e03464275f2f2599e27a254\n description:\n "Auto\'s pull request reviewer: reviews each PR and posts one review comment with a\n merge recommendation."\ndisplayTitle: "Review PR #{{github.pullRequest.number}}: {{github.pullRequest.title}}"\ninitialPrompt: |\n Review GitHub pull request #{{github.pullRequest.number}} in {{github.repository.fullName}}.\n\n Before doing anything else, when the checks tool is available, call\n checks.begin with `{ "name": "pr-review" }`. This must happen before\n inspecting PR metadata or the diff.\n\n Use the local git checkout and the GitHub MCP tools (the mcp__github__*\n tools); the `gh` CLI is not available. Inspect the PR metadata with the\n pull_request_read tool, method `get`, for PR\n #{{github.pullRequest.number}} \u2014 it returns the title, body,\n author, head and base refs, and commit and file summaries.\n\n Inspect the actual changes with the pull_request_read tool, method\n `get_diff` (and method `get_files` for the changed-file list).\n\n Read AGENTS.md and docs/idioms.md before forming your recommendation. Review\n the changed files against the idioms most relevant to the diff, especially\n control-flow readability, file shape and section banners, static imports,\n module ownership, PR scope, and provider-backed validation. Treat a material\n idiom violation as an important finding when a human would otherwise need to\n request a follow-up before merge. Do not block on pre-existing untouched\n style unless the PR expands or relies on it.\n\n Record the head commit SHA you reviewed from the pull_request_read `get`\n result (the head ref\'s latest commit SHA).\n\n Determine whether you have reviewed this PR before. Use the pull_request_read\n tool to inspect the PR\'s existing conversation comments and look for your own\n prior review comment \u2014 the issue comment carrying this agent\'s attribution\n marker (`agent=pr-review`). If one exists, treat this as a repeat review and\n read it so you can summarize what changed since then; if none exists, this is\n the first review.\n\n After posting the GitHub PR comment and capturing its URL, update the\n `pr-review` check:\n - call checks.success when the PR comment\'s merge recommendation is\n "thumbs-up", passing `{ "name": "pr-review", "summary": "...", "text": "..." }`\n - call checks.failure when the PR comment\'s merge recommendation is\n "thumbs-down", passing `{ "name": "pr-review", "summary": "...", "text": "..." }`\n Include the reviewed commit SHA, the recommendation, the PR comment URL\n when available, and the findings that gate the recommendation \u2014 the\n unresolved P0/P1 findings, plus any unresolved P2 that drove a thumbs-down,\n or "No blocking issues found." when nothing gates \u2014 in the check result.\n\n The local checkout is a shallow checkout of the PR head only. Do not assume\n origin/{{github.pullRequest.baseRef}} or origin/{{github.pullRequest.headRef}}\n exists locally unless you explicitly fetch it first.\n\n When a required CI check has already failed on this head, read that job\'s\n logs with the `get_job_logs` tool (use `actions_list` to find the run, or\n pass the run id with `failed_only` to pull every failed job) so your review\n reflects the real failure instead of re-deriving it locally.\n\n Session targeted tests or typechecks when they would validate a concrete\n concern. The checkout may not have node_modules installed yet. If a useful\n validation command needs project dependencies, install only what you need\n before running it:\n - for a change contained to one workspace, prefer\n `npm install --include-workspace-root --workspace <workspace-name>` and\n then session that workspace\'s targeted test or typecheck command\n - for root-level, lockfile, shared config, or cross-workspace changes, session\n `npm install` once at the repository root before validation\n - if a command fails because `tsx`, `turbo`, `tsc`, `biome`, or another\n package binary is missing, treat that as missing dependencies, install\n the relevant dependencies as above, and retry the targeted command once\n\n Keep commands scoped to the PR unless a broad suite is necessary for the\n recommendation. Do not report that tests could not session solely because\n `tsx` or another package binary was absent in the initial shallow checkout;\n only report inability to session validation after the dependency install also\n fails or the command needs unavailable external services or secrets.\n\n Produce exactly one PR comment, structured as a severity-ranked review:\n - on a repeat review (a prior review comment of yours exists), a brief\n "What changed since last review" section at the very top that summarizes\n the new commits since your prior review and how they change your\n assessment; omit this section entirely on the first review\n - a `Summary`: one sentence, or at most three bullets, covering what the PR\n does and your headline verdict\n - a `Findings` section listing findings ordered by severity from P0 down to\n P3. Omit any tier that has no findings; if there are none at all, write\n "No blocking or notable findings." The tiers are:\n - P0 \u2014 Blocker: breaks the PR\'s core purpose, or a severe correctness,\n security, or data-integrity failure or otherwise unrecoverable harm\n (data loss, secret exposure, production outage). Must fix before merge.\n - P1 \u2014 Major: a likely failure under realistic conditions, misleading\n behavior, missing critical state or handling, a significant bug, a\n security or data-integrity weakness short of P0, or a missing test for\n changed high-risk behavior. Should fix before merge.\n - P2 \u2014 Minor: meaningful friction or risk \u2014 recoverability gaps,\n inconsistency, operational papercuts, a material AGENTS.md/docs/idioms.md\n violation in touched code, or weaker-than-warranted test coverage. Fix\n or justify.\n - P3 \u2014 Nit: minor craft, consistency, or readability improvement. Optional.\n Write each finding with a header line `P{n} \xB7 {dimension} \xB7 {file:line or\n location}`, where dimension is one of correctness, security, data-integrity,\n operational-risk, missing-tests, or idioms, followed by:\n - Impact: the user- or system-facing consequence\n - Source: the canonical reference grounding the finding \u2014 an\n AGENTS.md/docs/idioms.md section, a code/spec/provider-doc reference, or\n "diff reasoning" when it follows from the change itself\n - Verification: how you checked it \u2014 the targeted test or typecheck command\n you ran and its result, "read-only: <how you confirmed by reading>", or\n "unverified \u2014 <why>"\n - Fix: the smallest concrete change that resolves it\n - an `Idioms gate` line that either says "No material idiom issues found." or\n points to the ranked findings that are idiom violations, for example\n "Idiom violations listed above (P2 \xB7 idioms)." Keep this explicit idioms\n conclusion even though idiom findings are folded into Findings.\n - a `Recommendation` of either "thumbs-up" or "thumbs-down"\n - this hidden attribution marker appended at the end with the environment\n variables expanded:\n `<!-- auto:v=1 session_id=$AUTO_SESSION_ID agent=$AUTO_AGENT_NAME -->`\n\n Decide the recommendation from the findings:\n - "thumbs-down" if any P0 or P1 finding is unresolved\n - "thumbs-down" if any P2 finding is unresolved, unless the PR body or author\n documents why it is acceptable for this change\n - P3 findings never gate the recommendation\n - otherwise "thumbs-up"\n\n Post the PR comment with the upsert_issue_comment tool. Pass the repository\n owner and name from {{github.repository.fullName}} as `owner` and `repo`, PR\n number {{github.pullRequest.number}} as `issueNumber`, and the full review as\n `body`. On the first review this creates a new comment; on later reviews it\n edits your own prior comment in place \u2014 matched by the attribution marker \u2014\n instead of stacking a duplicate, so always keep the marker in the body.\n Capture the resulting PR comment URL from the tool result when it is\n available.\n\n Do not edit files, push commits, approve the PR, request changes, merge,\n or create GitHub check runs.\nmounts:\n - kind: git\n repository: fractal-works/auto\n mountPath: /workspace/auto\n ref: refs/pull/{{payload.github.pullRequest.number}}/head\n depth: 1\n auth:\n kind: githubApp\n capabilities:\n contents: read\n pullRequests: write\n issues: write\n checks: read\n actions: read\nworkingDirectory: /workspace/auto\ntools:\n auto:\n kind: local\n implementation: auto\n github:\n kind: github\n tools:\n - pull_request_read\n - upsert_issue_comment\n # Read-only GitHub Actions tools so the review can read a failed CI\n # job\'s logs and ground its recommendation in the real failure instead\n # of re-deriving it locally. The mount already grants `actions: read`.\n - actions_get\n - actions_list\n - get_job_logs\ntriggers:\n - event: github.pull_request.opened\n connection: github-fractal-works\n where:\n $.github.repository.fullName: fractal-works/auto\n checks:\n - name: pr-review\n displayName: Auto PR review\n description: Auto reviews this pull request and reports whether blocking issues were found.\n instructions: |\n Call checks.begin with { "name": "pr-review" } before doing\n anything else. After posting the GitHub PR comment, call\n checks.success with { "name": "pr-review", "summary": "...",\n "text": "..." } only for a thumbs-up merge recommendation, and call\n checks.failure with { "name": "pr-review", "summary": "...",\n "text": "..." } for a thumbs-down merge recommendation. Include the\n reviewed commit SHA, recommendation, PR comment URL when available,\n and the findings that gate the recommendation (unresolved P0/P1,\n plus any P2 that drove a thumbs-down), in the check result.\n beginTimeout:\n seconds: 1200\n conclusion: failure\n completeTimeout:\n seconds: 1200\n conclusion: failure\n routing:\n kind: spawn\n - event: github.pull_request.reopened\n connection: github-fractal-works\n where:\n $.github.repository.fullName: fractal-works/auto\n checks:\n - name: pr-review\n displayName: Auto PR review\n description: Auto reviews this pull request and reports whether blocking issues were found.\n instructions: |\n Call checks.begin with { "name": "pr-review" } before doing\n anything else. After posting the GitHub PR comment, call\n checks.success with { "name": "pr-review", "summary": "...",\n "text": "..." } only for a thumbs-up merge recommendation, and call\n checks.failure with { "name": "pr-review", "summary": "...",\n "text": "..." } for a thumbs-down merge recommendation. Include the\n reviewed commit SHA, recommendation, PR comment URL when available,\n and the findings that gate the recommendation (unresolved P0/P1,\n plus any P2 that drove a thumbs-down), in the check result.\n beginTimeout:\n seconds: 1200\n conclusion: failure\n completeTimeout:\n seconds: 1200\n conclusion: failure\n routing:\n kind: spawn\n - event: github.pull_request.synchronize\n connection: github-fractal-works\n where:\n $.github.repository.fullName: fractal-works/auto\n checks:\n - name: pr-review\n displayName: Auto PR review\n description: Auto reviews this pull request and reports whether blocking issues were found.\n instructions: |\n Call checks.begin with { "name": "pr-review" } before doing\n anything else. After posting the GitHub PR comment, call\n checks.success with { "name": "pr-review", "summary": "...",\n "text": "..." } only for a thumbs-up merge recommendation, and call\n checks.failure with { "name": "pr-review", "summary": "...",\n "text": "..." } for a thumbs-down merge recommendation. Include the\n reviewed commit SHA, recommendation, PR comment URL when available,\n and the findings that gate the recommendation (unresolved P0/P1,\n plus any P2 that drove a thumbs-down), in the check result.\n beginTimeout:\n seconds: 1200\n conclusion: failure\n completeTimeout:\n seconds: 1200\n conclusion: failure\n routing:\n kind: spawn\n'
25406
+ }
25407
+ ]
25164
25408
  }
25165
25409
  ],
25166
25410
  "@auto/research-loop": [
@@ -30191,7 +30435,7 @@ var init_package = __esm({
30191
30435
  "package.json"() {
30192
30436
  package_default = {
30193
30437
  name: "@autohq/cli",
30194
- version: "0.1.332",
30438
+ version: "0.1.334",
30195
30439
  license: "SEE LICENSE IN README.md",
30196
30440
  publishConfig: {
30197
30441
  access: "public"
@@ -31300,48 +31544,6 @@ var init_agent_document_merge = __esm({
31300
31544
  }
31301
31545
  });
31302
31546
 
31303
- // ../../packages/schemas/src/project-apply-files/agent-fields/file-backed-string.ts
31304
- import { posix as posix2 } from "path";
31305
- function fileBackedStringField() {
31306
- return {
31307
- target: "spec",
31308
- read: (value, context) => resolveFileBackedString2(value, context)
31309
- };
31310
- }
31311
- function resolveFileBackedString2(value, input) {
31312
- if (!isRecord2(value) || !("file" in value)) {
31313
- return value;
31314
- }
31315
- const file2 = value.file;
31316
- if (typeof file2 !== "string" || file2.trim().length === 0) {
31317
- throw new Error(
31318
- `Invalid agent authoring file ${input.path}: ${input.field}.file must be a non-empty string`
31319
- );
31320
- }
31321
- const filePath = file2.trim();
31322
- if (isAbsoluteSourcePath(filePath) || /^[A-Za-z]+:\/\//.test(filePath)) {
31323
- throw new Error(
31324
- `Invalid agent authoring file ${input.path}: ${input.field}.file must be a relative path`
31325
- );
31326
- }
31327
- const resolved = normalizeSourcePath(
31328
- posix2.normalize(posix2.join(posix2.dirname(input.path), filePath))
31329
- );
31330
- const source = input.fileIndex.get(resolved);
31331
- if (!source) {
31332
- throw new Error(
31333
- `Invalid agent authoring file ${input.path}: ${input.field}.file not found: ${filePath}`
31334
- );
31335
- }
31336
- return Buffer.from(source.contentBase64, "base64").toString("utf8");
31337
- }
31338
- var init_file_backed_string = __esm({
31339
- "../../packages/schemas/src/project-apply-files/agent-fields/file-backed-string.ts"() {
31340
- "use strict";
31341
- init_source();
31342
- }
31343
- });
31344
-
31345
31547
  // ../../packages/schemas/src/project-apply-files/agent-fields/helpers.ts
31346
31548
  function emptyAgentDraft() {
31347
31549
  return { metadata: {}, spec: {} };
@@ -31398,6 +31600,114 @@ var init_helpers = __esm({
31398
31600
  }
31399
31601
  });
31400
31602
 
31603
+ // ../../packages/schemas/src/project-apply-files/agent-fields/file-backed-string.ts
31604
+ import { posix as posix2 } from "path";
31605
+ function fileBackedStringField() {
31606
+ return {
31607
+ target: "spec",
31608
+ read: (value, context) => resolveFileBackedString2(value, context),
31609
+ merge: (base, override) => resolveAppendDirective(base, override)
31610
+ };
31611
+ }
31612
+ function rejectDirectiveObject(value, input) {
31613
+ if (isRecord2(value) && "append" in value) {
31614
+ throw new Error(
31615
+ `Invalid agent authoring file ${input.path}: ${input.field} does not support directive objects; append is supported on ${APPEND_CAPABLE_FIELDS}`
31616
+ );
31617
+ }
31618
+ return value;
31619
+ }
31620
+ function resolveFileBackedString2(value, input) {
31621
+ if (!isRecord2(value)) {
31622
+ return value;
31623
+ }
31624
+ if ("file" in value && !("append" in value)) {
31625
+ return resolveFileReference(value.file, input);
31626
+ }
31627
+ return readAppendDirectiveMarker(value, input);
31628
+ }
31629
+ function resolveFileReference(file2, input) {
31630
+ if (typeof file2 !== "string" || file2.trim().length === 0) {
31631
+ throw new Error(
31632
+ `Invalid agent authoring file ${input.path}: ${input.field}.file must be a non-empty string`
31633
+ );
31634
+ }
31635
+ const filePath = file2.trim();
31636
+ if (isAbsoluteSourcePath(filePath) || /^[A-Za-z]+:\/\//.test(filePath)) {
31637
+ throw new Error(
31638
+ `Invalid agent authoring file ${input.path}: ${input.field}.file must be a relative path`
31639
+ );
31640
+ }
31641
+ const resolved = normalizeSourcePath(
31642
+ posix2.normalize(posix2.join(posix2.dirname(input.path), filePath))
31643
+ );
31644
+ const source = input.fileIndex.get(resolved);
31645
+ if (!source) {
31646
+ throw new Error(
31647
+ `Invalid agent authoring file ${input.path}: ${input.field}.file not found: ${filePath}`
31648
+ );
31649
+ }
31650
+ return Buffer.from(source.contentBase64, "base64").toString("utf8");
31651
+ }
31652
+ function readAppendDirectiveMarker(value, input) {
31653
+ const keys = Object.keys(value).sort();
31654
+ if (keys.length !== 1) {
31655
+ throw new Error(
31656
+ `Invalid agent authoring file ${input.path}: ${input.field} directive object must have exactly one operation key (got ${keys.join(", ") || "none"})`
31657
+ );
31658
+ }
31659
+ const [operation] = keys;
31660
+ if (operation !== "append") {
31661
+ throw new Error(
31662
+ `Invalid agent authoring file ${input.path}: ${input.field} directive object has unknown operation "${operation}"; supported operations: append`
31663
+ );
31664
+ }
31665
+ if (typeof value.append !== "string") {
31666
+ throw new Error(
31667
+ `Invalid agent authoring file ${input.path}: ${input.field}.append must be a string`
31668
+ );
31669
+ }
31670
+ return {
31671
+ [APPEND_DIRECTIVE_MARKER_KEY]: {
31672
+ text: value.append,
31673
+ path: input.path,
31674
+ field: input.field
31675
+ }
31676
+ };
31677
+ }
31678
+ function resolveAppendDirective(base, override) {
31679
+ const directive = appendDirectiveFromMarker(override);
31680
+ if (!directive) {
31681
+ return mergeValues3(base, override);
31682
+ }
31683
+ if (typeof base !== "string") {
31684
+ throw new Error(
31685
+ `Invalid agent authoring file ${directive.path}: ${directive.field} append directive has no imported ${directive.field} to append to`
31686
+ );
31687
+ }
31688
+ return base + directive.text;
31689
+ }
31690
+ function appendDirectiveFromMarker(value) {
31691
+ if (!isRecord2(value)) {
31692
+ return void 0;
31693
+ }
31694
+ const marker = value[APPEND_DIRECTIVE_MARKER_KEY];
31695
+ if (!isRecord2(marker)) {
31696
+ return void 0;
31697
+ }
31698
+ return marker;
31699
+ }
31700
+ var APPEND_DIRECTIVE_MARKER_KEY, APPEND_CAPABLE_FIELDS;
31701
+ var init_file_backed_string = __esm({
31702
+ "../../packages/schemas/src/project-apply-files/agent-fields/file-backed-string.ts"() {
31703
+ "use strict";
31704
+ init_source();
31705
+ init_helpers();
31706
+ APPEND_DIRECTIVE_MARKER_KEY = "__autoAppendDirective";
31707
+ APPEND_CAPABLE_FIELDS = "systemPrompt, initialPrompt, onReplace";
31708
+ }
31709
+ });
31710
+
31401
31711
  // ../../packages/schemas/src/project-apply-files/agent-fields/inline-resource.ts
31402
31712
  function inlineEnvironmentField() {
31403
31713
  return {
@@ -31681,11 +31991,12 @@ function metadataField() {
31681
31991
  return { target: "metadata" };
31682
31992
  }
31683
31993
  function specField() {
31684
- return { target: "spec" };
31994
+ return { target: "spec", read: rejectDirectiveObject };
31685
31995
  }
31686
31996
  var init_scalar = __esm({
31687
31997
  "../../packages/schemas/src/project-apply-files/agent-fields/scalar.ts"() {
31688
31998
  "use strict";
31999
+ init_file_backed_string();
31689
32000
  }
31690
32001
  });
31691
32002
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.332",
3
+ "version": "0.1.334",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"