Skip to content

Add AGENTS.md and stop stale route types from failing typecheck - #87

Merged
t3dotgg merged 2 commits into
mainfrom
t3code/fix-ci-and-agent-workflow
Sep 25, 2026
Merged

t3dotgg merged 2 commits into
mainfrom
t3code/fix-ci-and-agent-workflow

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Agents on this repo kept hitting two problems:

  • next dev writes AGENTS.md and CLAUDE.md into any checkout that does not have its agent-rules block. These files showed up as stray changes in agent worktrees.
  • A temporary route for a screenshot leaves stale route types in .next/dev/types after you delete it. Then pnpm typecheck fails with Cannot find module '.../page.js'. This caused false failures two times.

Fix

  • Adds AGENTS.md with project facts: where marker logic and tests go, the pnpm pin, env setup, fixture routes, and PR rules. It includes the exact block that Next 16.3.6 writes, so next dev leaves the file alone. CLAUDE.md only imports @AGENTS.md.
  • Screenshot fixture routes go in src/app/fixtures/<name>/page.tsx. That folder is gitignored, so a fixture cannot deploy.
  • pnpm typecheck is now rm -rf .next/dev/types && next typegen && tsc --noEmit. It rebuilds route types from the current routes before it checks.

The CI part of the original task was already done in #85, so ci.yaml does not change here.

Checks

  • Ran next dev with an agent detected. It did not change AGENTS.md or create other files.
  • Added a fixture route, ran next dev, and deleted the route. Bare tsc then fails, and pnpm typecheck passes. pnpm build is not affected by stale dev types.
  • pnpm typecheck, pnpm lint, pnpm test (38 passed), and pnpm build pass locally.

Made by Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated project validation to refresh generated types before checking for type errors.
    • Added guidance for managing temporary screenshot fixtures and checking project requirements.
  • Documentation
    • Clarified development setup and configuration guidance. No end-user-facing features or behavior changes are included.

next dev wrote AGENTS.md and CLAUDE.md into every checkout that lacked
its agent-rules block. AGENTS.md now holds project facts plus that
block, so next dev leaves it alone.

Screenshot fixture routes go in the gitignored src/app/fixtures/.
pnpm typecheck now deletes .next/dev/types and runs next typegen, so a
deleted route no longer fails it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
markerthing Ready Ready Preview Sep 25, 2026 6:20am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 91d0e6ee-7d54-4585-aaf5-af6f01fa4986

📥 Commits

Reviewing files that changed from the base of the PR and between 4b485d7 and 8c9e0e7.

📒 Files selected for processing (4)
  • .gitignore
  • AGENTS.md
  • CLAUDE.md
  • package.json

Included review availability: 9 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.


Walkthrough

The pull request adds repository guidance, excludes temporary screenshot routes from Git, and updates the typecheck script to generate Next.js types before running TypeScript checks.

Changes

Repository workflow

Layer / File(s) Summary
Repository guidance and screenshot fixtures
AGENTS.md, CLAUDE.md, .gitignore
AGENTS.md documents repository practices. CLAUDE.md references it, and .gitignore excludes /src/app/fixtures/.
Next.js type generation in typecheck
package.json
The typecheck script clears .next/dev/types, runs next typegen, and then runs tsc --noEmit.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 8c9e0

The typecheck command clears stale development types and regenerates production route types. No merge-blocking issue is established.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes both primary changes: adding AGENTS.md and preventing stale route types from causing typecheck failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds agent documentation and fixes typecheck to clean stale types.

The PR appears safe to merge; no outstanding or new actionable findings remain.

Reviews (2) · Last reviewed commit: "Say that a local build still includes fi..."

Comment thread AGENTS.md Outdated
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@t3dotgg

t3dotgg commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

Note

🤖 Claude Opus 5.5 responding on behalf of Theo

@greptileai review

@t3dotgg
t3dotgg merged commit b514530 into main Sep 25, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 8c9e0e7f Deployed Sep 25, 2026 by vercel[bot]
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