Next.js Stack Guide
This guide covers using Sequant with Next.js / React projects.
Detection
Section titled “Detection”Sequant automatically detects Next.js projects by looking for:
next.config.jsnext.config.mjsnext.config.tsnextinpackage.jsondependencies
Default Commands
Section titled “Default Commands”When initialized with the Next.js stack, Sequant configures these commands:
| Command | Default |
|---|---|
| Test | npm test |
| Build | npm run build |
| Lint | npm run lint |
| Dev | npm run dev |
File Patterns
Section titled “File Patterns”The workflow skills use these patterns to locate files:
| Pattern | Glob |
|---|---|
| Components | components/**/*.tsx |
| Pages/Routes | app/**/*.tsx |
| API Routes | app/api/**/*.ts |
| Tests | __tests__/**/*.test.{ts,tsx} |
Workflow Integration
Section titled “Workflow Integration”/spec Phase
Section titled “/spec Phase”During planning, Sequant will:
- Check for existing components in
components/ - Look for similar pages in
app/ - Review API patterns in
app/api/
/exec Phase
Section titled “/exec Phase”During implementation, the agent will:
- Run
npm run lintto check code style - Run
npm testfor test verification - Run
npm run buildto verify the build passes
/qa Phase
Section titled “/qa Phase”Quality review includes:
- TypeScript type checking
- ESLint validation
- Build verification
- Test coverage review
Customization
Section titled “Customization”Override commands in .claude/.local/memory/constitution.md:
## Build Commands
- Test: `npm run test:ci`- Build: `npm run build:prod`- Lint: `npm run lint:strict`Common Patterns
Section titled “Common Patterns”App Router (Next.js 13+)
Section titled “App Router (Next.js 13+)”app/├── layout.tsx├── page.tsx├── api/│ └── route.ts└── [slug]/ └── page.tsxComponents
Section titled “Components”components/├── ui/ # Reusable UI components├── forms/ # Form components└── layouts/ # Layout components-
Use Server Components by default - The agent will prefer server components unless client interactivity is needed.
-
API Routes - For data fetching, prefer server actions or API routes in
app/api/. -
Testing - Ensure Jest or Vitest is configured for the
/testphase to work properly.