Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/kitcn/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: kitcn
description: Use for Convex/kitcn setup and feature work: cRPC, ORM, auth, React.
description: "Use for Convex/kitcn setup and feature work: cRPC, ORM, auth, React."
sources: [www/content/docs/concepts.mdx, www/content/docs/orm/index.mdx, www/content/docs/orm/schema/relations.mdx, www/content/docs/orm/schema/triggers.mdx, www/content/docs/orm/queries/aggregates.mdx, www/content/docs/orm/queries/pagination.mdx, www/content/docs/server/error-handling.mdx, www/content/docs/server/http.mdx, www/content/docs/server/middlewares.mdx, www/content/docs/server/procedures.mdx, www/content/docs/server/server-side-calls.mdx, www/content/docs/react/queries.mdx, www/content/docs/react/mutations.mdx, www/content/docs/react/infinite-queries.mdx, www/content/docs/auth/client.mdx, www/content/docs/auth/server.mdx]
---
# kitcn Core Skill (80% Path)
Expand Down
2 changes: 2 additions & 0 deletions .changeset/clean-kitcn-skill-footprint.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

## Patches

- Fix `kitcn init -t start` for TanStack Start scaffolds that use Vite
`resolve.tsconfigPaths`.
- Improve the packaged kitcn agent skill prompt and reference footprint.
299 changes: 299 additions & 0 deletions docs/plans/2026-05-29-fix-volatile-fixture-ci-gate.md

Large diffs are not rendered by default.

193 changes: 193 additions & 0 deletions docs/plans/278-fix-init-start-vite-patch-bootstrap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
# 278 fix init start vite patch bootstrap

Objective:
Fix GitHub issue #278 so `kitcn init -t start --yes` accepts the current
TanStack Start `vite.config.ts` shape, finishes kitcn/Convex/cRPC scaffold
bootstrap, installs expected package dependencies, and exits 0.

Completion threshold:
- A focused test reproduces the reported fatal error before the fix.
- The Start init path handles `resolve: { tsconfigPaths: true }` without
requiring a manual `resolve.alias` block.
- The fix has package build, fixture sync/check, autoreview, full `bun check`,
release artifact, PR, PR body audit, issue sync-back, and this goal checker
closed before `update_goal(status: complete)`.

Verification surface:
- `bun test packages/kitcn/src/cli/commands/init.test.ts`
- `bun --cwd packages/kitcn build`
- `bun run fixtures:sync`
- `bun run fixtures:check`
- `.agents/skills/autoreview/scripts/autoreview --mode local --engine claude --no-tools --no-web-search`
- `bun check`
- `gh pr view --json body`
- `node .agents/rules/autogoal/scripts/check-complete.mjs docs/plans/278-fix-init-start-vite-patch-bootstrap.md`

Constraints:
- Preserve behavior outside Start/Vite init patching.
- Keep generated fixture output generated by `fixtures:sync`.
- Use the entire current checkout for PR staging per repo instructions.
- Use the task-style PR body and sync the GitHub issue after PR creation.

Boundaries:
- Source of truth: GitHub issue #278.
- Ownership: `packages/kitcn` CLI scaffold patching for Vite config adoption.
- Allowed local changes: package code/tests, generated fixtures, changeset, and
this plan.
- Browser surface: N/A; this is CLI scaffold behavior.
- Non-goals: TanStack Start redesign, auth redesign, manual workaround docs.

Blocked condition:
Blocked only if the issue cannot be reproduced locally, final repo `check`
cannot complete after one realistic retry, or GitHub PR/issue access fails.

Task source:
- Type: GitHub issue
- Link: https://github.com/udecode/kitcn/issues/278
- Title: `init -t start`: fatal `vite.config.ts` patch failure and skipped bootstrap
- Acceptance: current TanStack Start Vite config with
`resolve: { tsconfigPaths: true }` does not throw and init reaches package
install plus kitcn/Convex/cRPC bootstrap.

Start Gates:
| Gate | Applies | Evidence |
|------|---------|----------|
| Skill analysis before edits | yes | Used repo-local `task`; used `autogoal`, `tdd`, `changeset`, and `autoreview` flows where required. |
| Active goal checked or created | yes | Active goal created for issue #278 with measurable CLI scaffold outcome. |
| Source of truth read before edits | yes | `gh issue view https://github.com/udecode/kitcn/issues/278 --comments --json number,title,body,comments,labels,state,author,url`. |
| Tracker comments and attachments read | yes | Same `gh issue view --comments`; no attachments/video. |
| Video transcript evidence required | no | N/A: issue is text-only CLI failure. |
| Existing-code research | yes | Searched package scaffold patcher, Start fixture helpers, tests, and memory for prior `kitcn init` conventions. |
| TDD decision | yes | TDD used: first focused Start init test failed with the reported error, then passed after fix. |
| Branch decision | yes | Started on `main`; create `codex/278-start-vite-tsconfig-paths` before commit/PR. |
| Release artifact decision | yes | Updated `.changeset/clean-kitcn-skill-footprint.md` for published package behavior. |
| Browser tool decision | no | N/A: CLI scaffold path; no browser surface changed. |
| Commit / PR expectation | yes | Code-changing task requires commit and PR; stage whole checkout. |
| Task-style PR body | yes | Use PR #270 emoji task format and verify via `gh pr view --json body`. |
| Tracker sync expectation | yes | Comment on issue #278 after PR exists. |
| Output budget strategy | yes | Used targeted `rg`/`sed`; accepted long command output only from required full gates. |
| Package/API pack | yes | Public package CLI behavior changed; changeset and package checks required. |

Work Checklist:
- [x] Objective includes outcome, threshold, verification, constraints,
boundaries, and blocked condition.
- [x] Source classified as GitHub bug #278 with package-owned root cause.
- [x] Video evidence marked N/A because the issue is text-only.
- [x] Repo instructions and implementation patterns read before edits.
- [x] Fix landed at the owning boundary: Start/Vite config patch detection.
- [x] Release artifact recorded in `.changeset/clean-kitcn-skill-footprint.md`.
- [x] Final handoff requires PR body verification and issue sync.
- [x] Commit/PR handling recorded: whole checkout staged on branch.
- [x] Branch handling recorded: new `codex/` branch from `main`.
- [x] Local-env-rot retry policy recorded: no unexplained env failure occurred.
- [x] Workspace authority recorded: all proof ran in `/Users/zbeyens/git/better-convex`.
- [x] Output budget discipline recorded and followed.
- [x] High-risk note recorded for command-contract/package-boundary behavior.
- [x] Autoreview completed cleanly after accepted findings were fixed.
- [x] Agent-native review N/A: no `.agents`, `.claude`, `.codex`, hooks, skills,
prompts, or agent-action tooling changed.
- [x] Package/API pack recorded: CLI behavior and generated scaffold output.
- [x] Package build and fixture sync/check recorded.

Completion Gates:
| Gate | Applies | Required action | Evidence |
|------|---------|-----------------|----------|
| Named verification threshold | yes | Run named proof commands | Focused tests, package build, fixture checks, autoreview, and `bun check` passed. |
| Bug reproduced before fix | yes | Capture red test | `bun test packages/kitcn/src/cli/commands/init.test.ts -t "handleInitCommand scaffolds the start baseline with -t start"` failed with `Could not patch vite.config.ts: expected a resolve.alias block.` |
| Targeted behavior verification | yes | Run focused and full init tests | `bun test packages/kitcn/src/cli/commands/init.test.ts` passed: 53 tests, 217 expects. |
| TypeScript or typed config changed | yes | Run repo typecheck via gate | `bun check` passed, including `bun typecheck`. |
| Package exports or layout changed | yes | Build package | `bun --cwd packages/kitcn build` passed; `bun check` repeated package builds. |
| Package manifests or install graph changed | yes | Run generated fixture checks | `bun run fixtures:sync`, `bun run fixtures:check`, and `bun check` fixture lanes passed. |
| Agent rules or skills changed | no | N/A | No agent files changed. |
| Workspace authority proof | yes | Run in owning repo | All commands ran with cwd `/Users/zbeyens/git/better-convex`. |
| Browser surface changed | no | N/A | CLI behavior only. |
| Scaffold or fixture output changed | yes | Sync and check fixtures | `bun run fixtures:sync`, `bun run fixtures:check`, and `bun check` fixture lanes passed. |
| Package behavior changed | yes | Add changeset | `.changeset/clean-kitcn-skill-footprint.md` updated. |
| Docs and kitcn skill sync changed | no | N/A | No `www/**` or kitcn skill docs changed. |
| High-risk mini gate | yes | Record failure mode and proof | Risk: skipping alias patch incorrectly or double-patching Vite config. Proof: red/green init tests cover true, quoted keys, false, undefined, comment/string decoys, and fixture/runtime gates. |
| Agent-native review | no | N/A | No agent/tooling surface changed. |
| Local install corruption suspected | no | N/A | No unexplained local install corruption; normal installs happened inside fixture/scenario gates. |
| Autoreview | yes | Run until clean | Claude fallback autoreview passed clean after accepted parser/test findings were fixed. |
| Commit created | yes | Stage and commit whole checkout | Branch `codex/278-start-vite-tsconfig-paths`; commit created before PR. |
| PR create or update | yes | Push branch and open PR | PR #279: https://github.com/udecode/kitcn/pull/279. |
| Task-style PR body verified | yes | `gh pr view --json body` | `gh pr view 279 --json body,url,title,number` confirmed task-style body and auto-release block. |
| PR proof image hosting | no | N/A | No browser proof image. |
| Tracker sync-back | yes | Comment on issue #278 | Comment posted: https://github.com/udecode/kitcn/issues/278#issuecomment-4574466162. |
| Final lint | yes | Run lint fix | `bun lint:fix` passed; final `bun check` passed lint. |
| Output budget discipline | yes | Record recovery | Required gates emitted long output; continued with capped polling and summarized evidence. |
| Goal plan complete | yes | Run goal checker | `node .agents/rules/autogoal/scripts/check-complete.mjs docs/plans/278-fix-init-start-vite-patch-bootstrap.md` passed. |
| Public API / package boundary proof | yes | Source audit | Public CLI init behavior changed; no exported JS API change. |
| Release artifact classification | yes | Record artifact | Published package behavior change, changeset required. |
| Published package changeset | yes | Update `.changeset` | `.changeset/clean-kitcn-skill-footprint.md` updated for `kitcn`. |
| Package typecheck/build/test | yes | Run owning checks | `bun test`, `bun --cwd packages/kitcn build`, and `bun check` passed. |
| Fixture/scaffold generation | yes | Run sync/check | `bun run fixtures:sync`, `bun run fixtures:check`, and `bun check` fixture lanes passed. |

Phase / pass table:
| Phase | Status | Evidence | Next |
|-------|--------|----------|------|
| Intake and source read | complete | Issue #278 read via `gh issue view`; source classified. | implementation |
| Implementation | complete | Vite config scanner and Start scaffold helper updated; generated fixtures synced. | verification |
| Verification | complete | Focused tests, package build, fixture checks, autoreview, and `bun check` passed. | commit / PR |
| Commit / PR / tracker sync | complete | PR #279 opened and issue #278 comment posted. | closeout |
| Closeout | complete | Goal checker passed after PR/tracker evidence was inserted. | final response |

Findings:
- Root cause: `patchInitReactViteConfigContent` only understood an alias block
or plugin-call path handling, not Vite's `resolve.tsconfigPaths` option.

Decisions and tradeoffs:
- Implemented a small comment/string-aware object scanner instead of a broad
regex so the patcher can distinguish real config properties from comments,
strings, nested objects, false/undefined values, and quoted keys.
- Kept `resolve.tsconfigPaths: true` as the durable Start scaffold shape instead
of adding `vite-tsconfig-paths` back to generated Start fixtures.

Implementation notes:
- `packages/kitcn/src/cli/backend-core.ts` now detects enabled
`resolve.tsconfigPaths` in `defineConfig({ ... })` and `export default { ... }`.
- `packages/kitcn/src/cli/test-utils.ts` mirrors current TanStack Start output.
- `packages/kitcn/src/cli/commands/init.test.ts` covers red path, skip path,
patch path, quoted keys, disabled/undefined values, and config decoys.

Review fixes:
- Autoreview finding: broad `tsconfigPaths` regex. Fixed with scoped scanner.
- Autoreview finding: nested resolve values. Fixed and tested.
- Autoreview finding: comments/strings and quoted keys. Fixed and tested.
- Autoreview finding: false/undefined values. Fixed and tested.

Error attempts:
| Error / failed attempt | Count | Next different move | Resolution |
|------------------------|-------|---------------------|------------|
| Codex autoreview engine hung silently | 2 | Use Claude fallback without tools/web | Claude fallback produced actionable review; final fallback pass was clean. |

Verification evidence:
- Red repro: focused Start init test failed before the fix with the issue error.
- `bun test packages/kitcn/src/cli/commands/init.test.ts`: 53 pass, 0 fail.
- `bun lint:fix`: passed; final `bun check` lint passed.
- `bun --cwd packages/kitcn build`: passed.
- `bun run fixtures:sync`: passed.
- `bun run fixtures:check`: passed.
- Autoreview: clean, no accepted/actionable findings.
- `bun check`: passed.

Final handoff contract:
- Commit line: branch `codex/278-start-vite-tsconfig-paths` contains the fix
commit and this closeout evidence.
- PR line: https://github.com/udecode/kitcn/pull/279
- Issue / tracker line: https://github.com/udecode/kitcn/issues/278#issuecomment-4574466162
- Confidence line: high; the reported failure is covered by red/green tests and
generated fixture/runtime proof.
- Flow table:
- Reproduced: focused Start init test failed before fix; browser N/A.
- Verified: focused tests, fixture checks, runtime scenarios, and `bun check`
passed; browser N/A.

Reboot status:
Current task state is complete through verification, branch, commit, push, PR
creation/body audit, issue comment, final plan evidence, and goal checker. The
remaining action is marking the active goal complete after this final plan update
is pushed.

Open risks:
None known. Browser proof is intentionally N/A because the defect is a CLI
scaffold patch failure.
4 changes: 2 additions & 2 deletions fixtures/next-auth/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# env files
.env*.local
# env files (can opt-in for committing if needed)
.env*

# typescript
*.tsbuildinfo
Expand Down
5 changes: 5 additions & 0 deletions fixtures/next-auth/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- BEGIN:nextjs-agent-rules -->
# This is NOT the Next.js you know

This version has breaking changes β€” APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
<!-- END:nextjs-agent-rules -->
4 changes: 0 additions & 4 deletions fixtures/next-auth/next.config.mjs

This file was deleted.

5 changes: 5 additions & 0 deletions fixtures/next-auth/next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { NextConfig } from "next"

const nextConfig: NextConfig = {}

export default nextConfig
31 changes: 15 additions & 16 deletions fixtures/next-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,33 @@
"convex": "1.38.0",
"hono": "4.12.9",
"kitcn": "workspace:*",
"lucide-react": "^1.16.0",
"next": "16.1.7",
"lucide-react": "^1.17.0",
"next": "16.2.6",
"next-themes": "^0.4.6",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react": "19.2.4",
"react-dom": "19.2.4",
"shadcn": "latest",
"superjson": "^2.2.6",
"tailwind-merge": "^3.6.0",
"tw-animate-css": "^1.4.0",
"zod": "^4.3.6"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@tailwindcss/postcss": "^4.2.1",
"@types/node": "^25.5.0",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"eslint": "^9.39.4",
"eslint-config-next": "16.1.7",
"prettier": "^3.8.1",
"prettier-plugin-tailwindcss": "^0.7.2",
"postcss": "^8",
"tailwindcss": "^4.2.1",
"typescript": "^5.9.3",
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "16.2.6",
"prettier": "^3.8.3",
"prettier-plugin-tailwindcss": "^0.8.0",
"tailwindcss": "^4",
"typescript": "^5",
"@types/bun": "latest",
"@concavejs/cli": "latest"
},
"name": "kitcn-template-next-auth",
"packageManager": "bun@1.3.12",
"private": true,
"scripts": {
"dev": "next dev --turbopack --port 3005",
Expand Down
1 change: 0 additions & 1 deletion fixtures/next-auth/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
"@tailwindcss/postcss": {},
Expand Down
3 changes: 2 additions & 1 deletion fixtures/next-auth/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"name": "next"
}
],
"baseUrl": ".",
"paths": {
"@/*": [
"./*"
Expand Down Expand Up @@ -89,8 +88,10 @@
},
"include": [
"next-env.d.ts",
"next.config.ts",
"**/*.ts",
"**/*.tsx",
"**/*.mts",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
Expand Down
4 changes: 2 additions & 2 deletions fixtures/next/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# env files
.env*.local
# env files (can opt-in for committing if needed)
.env*

# typescript
*.tsbuildinfo
Expand Down
5 changes: 5 additions & 0 deletions fixtures/next/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- BEGIN:nextjs-agent-rules -->
# This is NOT the Next.js you know

This version has breaking changes β€” APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
<!-- END:nextjs-agent-rules -->
4 changes: 0 additions & 4 deletions fixtures/next/next.config.mjs

This file was deleted.

5 changes: 5 additions & 0 deletions fixtures/next/next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { NextConfig } from "next"

const nextConfig: NextConfig = {}

export default nextConfig
31 changes: 15 additions & 16 deletions fixtures/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,33 @@
"convex": "1.38.0",
"hono": "4.12.9",
"kitcn": "workspace:*",
"lucide-react": "^1.16.0",
"next": "16.1.7",
"lucide-react": "^1.17.0",
"next": "16.2.6",
"next-themes": "^0.4.6",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react": "19.2.4",
"react-dom": "19.2.4",
"shadcn": "latest",
"superjson": "^2.2.6",
"tailwind-merge": "^3.6.0",
"tw-animate-css": "^1.4.0",
"zod": "^4.3.6"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@tailwindcss/postcss": "^4.2.1",
"@types/node": "^25.5.0",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"eslint": "^9.39.4",
"eslint-config-next": "16.1.7",
"prettier": "^3.8.1",
"prettier-plugin-tailwindcss": "^0.7.2",
"postcss": "^8",
"tailwindcss": "^4.2.1",
"typescript": "^5.9.3",
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "16.2.6",
"prettier": "^3.8.3",
"prettier-plugin-tailwindcss": "^0.8.0",
"tailwindcss": "^4",
"typescript": "^5",
"@types/bun": "latest",
"@concavejs/cli": "latest"
},
"name": "kitcn-template-next",
"packageManager": "bun@1.3.12",
"private": true,
"scripts": {
"dev": "next dev --turbopack --port 3005",
Expand Down
1 change: 0 additions & 1 deletion fixtures/next/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
"@tailwindcss/postcss": {},
Expand Down
Loading
Loading