Skip to content

Full-stack monorepo preset, packkit.json provenance, agent tool steering#14

Merged
DanMat merged 2 commits into
mainfrom
feat/fullstack-monorepo
Jul 21, 2026
Merged

Full-stack monorepo preset, packkit.json provenance, agent tool steering#14
DanMat merged 2 commits into
mainfrom
feat/fullstack-monorepo

Conversation

@DanMat

@DanMat DanMat commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Three items from the field review, plus a bug the testing turned up.

Full-stack monorepo preset

fullstack (alias fs), or --monorepo-layout fullstack:

apps/web         React + Vite
apps/server      Hono API — also serves the web build in production
packages/shared  types + helpers both sides import

The reviewer's sharpest complaint was scaffolding pieces separately and merging them by hand. The parts already existed (node-service, react-app) — the composition didn't. Vite proxies /api to the server so requests are same-origin in dev exactly as in production (no CORS, no environment-specific base URL), and turbo dev builds shared before either app starts, so a changed shared type surfaces as a type error on both sides rather than at runtime.

The existing monorepo preset is untouched and stays the default layout.

This is why generating isn't verifying

I installed the generated workspace and ran the real toolchain instead of eyeballing the file list. It failed, twice:

  • No @types/reactturbo typecheck failed with TS7016/TS7026 on every JSX element.
  • A test script with no test files → vitest exits 1, so turbo test failed.

Both are exactly the "subtly wrong" plumbing a scaffolder is supposed to eliminate. Fixed, then re-verified end to end:

BUILD      3 successful, 3 total
TYPECHECK  4 successful, 4 total
TEST       4 successful, 4 total   (shared, server, web — all pass)

And the production claim in the README was checked rather than assumed — NODE_ENV=production node dist/index.js serves /api/health as JSON and / as the built web app, one process, one port.

packkit.json provenance

Records generator version, preset, and only settings that differ from the defaults, so it reads as the decisions someone made rather than a dump of every option. Packkit previously left no trace, so a project couldn't say what it started from — this is the prerequisite for any future packkit upgrade.

Deliberately no timestamps or machine details: generation stays a pure function of the config, so the same config produces the same bytes. There's a test for that.

Agent tool steering

MCP descriptions now push agents to packkit_schema first and frame packkit_preview as the structure-preview step. The reviewer asked for preview_project_structure "as a default pre-scaffold step" — that tool exists, as packkit_preview. Them not finding it was the finding.

Also

The MCP scaffold path now writes a lockfile before pushing, matching the CLI. Without it, a repo created through MCP failed its first CI run.

48 tests pass.

🤖 Generated with Claude Code

DanMat and others added 2 commits July 21, 2026 19:40
Three items from the field review of a real project built with Packkit.

Full-stack monorepo (`fullstack`, alias `fs`): apps/web (React+Vite),
apps/server (Hono), packages/shared. The pieces already existed as
standalone presets — what was missing was the composition. Both apps
import the shared package, Vite proxies /api to the server so requests
are same-origin in dev exactly as in production, and the server serves
the web build in production so one process covers the whole app. The
existing `monorepo` preset is unchanged and remains the default layout.

Verified by generating it, installing, and running the real toolchain
rather than eyeballing the output. That caught two things templates get
subtly wrong: missing @types/react (turbo typecheck failed on every JSX
element) and a test script with no test files (vitest exits 1). Both
fixed; build, typecheck and tests are green across all three packages,
and the production server was confirmed serving both /api/health and the
built web app on one port.

packkit.json records the generator version, preset, and only the
settings that differ from the defaults, so a project can finally answer
"what did I start from?" — the prerequisite for any future upgrade
command. No timestamps or machine details: generation stays a pure
function of the config, so the same config yields the same bytes.

MCP tool descriptions now point agents at packkit_schema first and
describe packkit_preview as the structure-preview step. The reviewer
asked for a "preview_project_structure" tool that already existed under
a name they never found; the misremembering was the finding.

Also fixes the MCP scaffold path to write a lockfile before pushing,
matching the CLI — without it a created repo fails its first CI run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Every preset but the new one was covered, and it is the most complex —
three packages, a workspace, and a dev story with two servers. Verified
locally: install, typecheck, lint, build, test, and `turbo dev` bringing
up Vite on 5173 and Hono on 3000 together.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DanMat
DanMat merged commit e0ec56a into main Jul 21, 2026
32 checks passed
@DanMat
DanMat deleted the feat/fullstack-monorepo branch July 21, 2026 23:46
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.

1 participant