Skip to content

feat(create-agent-bundle): offer every compiled target in project creation - #759

Merged
ScriptedAlchemy merged 4 commits into
mainfrom
feat/745-scaffolder-host-catalog
Sep 8, 2026
Merged

feat(create-agent-bundle): offer every compiled target in project creation#759
ScriptedAlchemy merged 4 commits into
mainfrom
feat/745-scaffolder-host-catalog

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Closes #745.

amp has been a built-in compiler adapter since #729, but project creation still offered four
targets, so create-agent-bundle --targets amp failed with Unknown target "amp" for a host the
compiler builds. The scaffolder cannot import the compiler — project creation must not load the
registry, adapters, or renderer — so it now carries one small catalog of the two agent-bundle
facts it needs, and a test holds that catalog to the compiler.

What changed

packages/create-agent-bundle/src/options.ts gains hostCatalog: every built-in target, whether
agent-bundle install <host> accepts it, and the templates it cannot carry with the compiler's
own reason. targetNames includes amp. installableTargets is derived from the catalog, and
scaffold.ts reads it instead of its own hard-coded ['claude', 'codex', 'cursor'], so a
scaffolded README's install lines follow the catalog rather than a second list.

One combination is refused rather than deferred to the first build: amp with mcp-server.
Amp's MCP configuration is skill-scoped and rejects that template's compiler-owned local status
server, which agent-bundle validate --target amp reports as amp.mcp.generated-local. The
interactive prompt does not offer a refused target, and a scripted run gets a usage error naming
the templates that target can use:

$ create-agent-bundle amp-mcp --template mcp-server --targets amp
└  Target "amp" cannot be scaffolded from the mcp-server template: Amp MCP configuration is
   skill-scoped and refuses a compiler-owned local server (amp.mcp.generated-local).
   Templates for amp: minimal, or cli-tool.

Two smaller corrections ride along, both in the files this change already touches:

  • The mcp-server template summary said "one conventional src/mcp/<id>.ts entry"; the template
    ships src/mcp/status/tools/report-status.tsx with route-unit and projection pools.
  • Scaffolded READMEs now invoke npx --no-install agent-bundle. In a scaffolded project
    agent-bundle is always a local dependency, so a bare npx there can only mean an accidental
    registry fetch of an unrelated package.

Guard

packages/create-agent-bundle/tests/host-catalog.test.ts asserts the catalog's target IDs equal
createDefaultRegistry().names(), that installable matches what installHost() accepts for
each target, that every refusal names a real template and appears in --help, and that the
refused pair is rejected while minimal/cli-tool with amp resolve. Record<TargetName, …>
makes the catalog entry mandatory at compile time, so the next adapter cannot land without a
disposition.

Docs

The #754 pages that documented the gap now document the behavior, in both locales:
guide/start/quick-start, guide/start/capabilities, and the
guide/development/troubleshooting row for a target rejected at project creation.
packages/create-agent-bundle/README.md lists the five targets and the refused pair.

Changeset: patch on create-agent-bundle.

Local gate

Run on 00cea295fb, which contains current origin/main (361d27ff5e):

Command Result
pnpm build pass
pnpm typecheck pass
pnpm lint pass
pnpm test:unit pass, 0 failures
pnpm docs:site:build pass — language parity, 0 broken links / 30105 anchors
pnpm test:packed pass — 15 files, 44 tests, 0 failures
npx rstest --config rstest.packed.config.ts run packages/create-agent-bundle/tests/scaffold-packed.e2e.test.ts pass, 4/4

The packed scaffolder e2e is the end-to-end proof, not just a unit assertion: its
minimal-template case now scaffolds with --targets portable,amp, installs the packed tarballs,
runs the project's own check, and asserts the emitted
artifact/.amp/plugins/minimal-project/skills/getting-started/SKILL.md.

Also verified by hand through the real built CLI: the refused pair exits 2 with the message
above, and --template minimal --targets amp writes targets: ['amp'].

Deslop

Deslop: gpt-5.6-sol-max, 3 edits — renamed the help section from Targets: to
Unavailable combinations: (the --targets line already lists the targets), replaced a comment
that hard-coded the very list it derives, and dropped a stale "package build's host order"
comment now that ordering comes from the catalog.

Self-review

Reviewer: gpt-5.6-sol-max, then claude-fable-5-1-thinking-xhigh on the fix commit.

Finding Disposition
Blocking: templates/minimal/README.md still said the compiler "emits installable artifacts for Claude Code, Codex, and Cursor, plus a portable layout" — a skills-only Amp scaffold shipped that stale list, since this template has no install section to rewrite Fixed in d415e46cab: the sentence is target-neutral, and scaffold.test.ts asserts the scaffolded README names no host
Non-blocking: the drift markers required npx --no-install, so a README that lost the flag would pass through silently instead of being rewritten Fixed in d415e46cab: the flag is optional in the marker, always present in the rewrite
Non-blocking: no test asserted the interactive prompt hides a refused target Fixed in d415e46cab: options.test.ts inspects the options handed to multiselect
Non-blocking: stale "package build's host order" comment Fixed in d415e46cab

Re-gated after the fixes: pnpm build, pnpm typecheck, pnpm lint, pnpm test:unit
(4485 tests, 0 failures), pnpm docs:site:build, and the packed scaffolder e2e (4/4).

@changeset-bot

changeset-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b812c57

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T00:22:37.331346Z 00cea29 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Sep 8, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@759
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@759
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/rsc-markdown-stream@759
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@759

commit: b812c57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00cea295fb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

.replace(readmeInstallExample, [
comment,
...hosts.map((host) => `npx agent-bundle install ${host} --from node_modules/${packageName}`),
...hosts.map((host) => `npx --no-install agent-bundle install ${host} --from node_modules/${packageName}`),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Drop --no-install from consumer installation examples

In a clean consumer that has installed only the generated package, agent-bundle is absent because the templates declare it under devDependencies, which do not reach consumers (packages/agent-bundle/src/core/package-dependencies.ts:13-16). The npm v11 npx documentation states that --no-install is converted to --no, so these commands cancel instead of obtaining the missing CLI. Both generated READMEs present this as the command to run after publishing and installing the package, making the documented host-install flow fail unless the consumer happened to install agent-bundle separately; reserve the non-fetching form for commands run inside the scaffold or provide a runnable consumer command.

Useful? React with 👍 / 👎.

@ScriptedAlchemy
ScriptedAlchemy force-pushed the feat/745-scaffolder-host-catalog branch from 7d34b0e to b812c57 Compare September 8, 2026 00:42
@ScriptedAlchemy
ScriptedAlchemy merged commit b0b25d3 into main Sep 8, 2026
15 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the feat/745-scaffolder-host-catalog branch September 8, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2] Make scaffolding and installation guidance consume the supported host catalog; Amp is currently rejected at project creation

1 participant