@erclx/canon 4.54.0 → 4.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/claude/.claude-plugin/plugin.json +1 -1
- package/claude/skills/canon-cli/SKILL.md +8 -1
- package/claude/skills/claude-autoship/SKILL.md +17 -1
- package/claude/skills/claude-orchestrate/references/orchestrator-dispatch.md +17 -7
- package/claude/skills/claude-worktree/SKILL.md +9 -3
- package/claude/skills/context-draft/REQUIREMENT.md +37 -0
- package/claude/skills/context-draft/SKILL.md +59 -0
- package/claude/skills/create-skill/REQUIREMENT.md +1 -1
- package/claude/skills/create-standard/SKILL.md +1 -1
- package/claude/skills/index-lookup/REQUIREMENT.md +35 -0
- package/claude/skills/index-lookup/SKILL.md +42 -0
- package/claude/skills/setup-init/SKILL.md +2 -1
- package/claude/skills/wireframe-draft/REQUIREMENT.md +38 -0
- package/claude/skills/wireframe-draft/SKILL.md +64 -0
- package/claude/skills/youtube-transcripts/SKILL.md +1 -1
- package/docs/agents/index.md +1 -1
- package/docs/agents/tasks.md +27 -1
- package/docs/target-projects.md +1 -1
- package/docs/workflow/ai-workflow.md +15 -12
- package/package.json +1 -1
- package/src/claude/cases/authoring.ts +10 -0
- package/src/claude/cases/misc.ts +4 -0
- package/src/commands/tasks.ts +97 -0
- package/src/gate/measures.ts +73 -0
- package/src/gate/stages.ts +11 -0
- package/src/tasks/answers.ts +42 -11
- package/src/tasks/branch.ts +78 -0
- package/src/web/readme-citations.ts +90 -0
- package/standards/branch.md +3 -1
- package/tooling/claude/seeds/.claude/hooks/index-reminder.sh +1 -1
- package/tooling/nextjs/configs/eslint.config.js +90 -0
- package/tooling/nextjs/configs/next.config.ts +10 -0
- package/tooling/nextjs/configs/playwright.config.ts +27 -0
- package/tooling/nextjs/configs/vitest.config.ts +28 -0
- package/tooling/nextjs/manifest.toml +19 -0
- package/tooling/nextjs/reference.md +47 -0
- package/tooling/nextjs/seeds/.cspell/tech-stack.txt +3 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import path from 'node:path'
|
|
2
|
+
|
|
3
|
+
import { defineConfig } from 'vitest/config'
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
resolve: {
|
|
7
|
+
alias: {
|
|
8
|
+
'@': path.resolve(__dirname, 'src'),
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
test: {
|
|
12
|
+
environment: 'jsdom',
|
|
13
|
+
globals: true,
|
|
14
|
+
setupFiles: ['src/test/setup.ts'],
|
|
15
|
+
passWithNoTests: true,
|
|
16
|
+
exclude: [
|
|
17
|
+
'**/node_modules/**',
|
|
18
|
+
'**/.next/**',
|
|
19
|
+
'**/e2e/**',
|
|
20
|
+
'**/.{idea,git,cache,output,temp}/**',
|
|
21
|
+
],
|
|
22
|
+
coverage: {
|
|
23
|
+
provider: 'v8',
|
|
24
|
+
reporter: ['text', 'json', 'html'],
|
|
25
|
+
exclude: ['node_modules/', 'src/test/setup.ts', 'e2e/'],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[stack]
|
|
2
|
+
name = "nextjs"
|
|
3
|
+
extends = "web"
|
|
4
|
+
runtime = "bun"
|
|
5
|
+
scaffold = "bunx create-next-app@latest {{name}} --typescript --tailwind --eslint --app --src-dir --import-alias \"@/*\" --use-bun --skip-install --disable-git --no-agents-md --yes"
|
|
6
|
+
|
|
7
|
+
[dependencies.dev]
|
|
8
|
+
packages = [
|
|
9
|
+
"next",
|
|
10
|
+
"@tailwindcss/postcss",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
[scripts]
|
|
14
|
+
"preview" = "WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && next start --port $((3000 + WORKTREE_PORT_OFFSET))"
|
|
15
|
+
"typecheck" = "next typegen && tsc --noEmit"
|
|
16
|
+
|
|
17
|
+
[scripts.override]
|
|
18
|
+
"dev" = "WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && next dev --port $((3000 + WORKTREE_PORT_OFFSET))"
|
|
19
|
+
"screenshot" = "PREVIEW_PORT=$(bash scripts/worktree-port.sh 3000) && export PREVIEW_PORT && bash scripts/screenshot.sh"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Tooling nextjs reference
|
|
2
|
+
|
|
3
|
+
> Extends: `web`. Apply web stack first.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The nextjs stack covers Next.js + TypeScript projects using the App Router. It ships golden configs for `next.config.ts`, `vitest.config.ts` (plain `defineConfig`, no bundler merge), `playwright.config.ts` (build-then-preview), and an `eslint.config.js` that extends the web layer's config with `.next` ignores and an App Router override. Shared web tooling (ESLint base, screenshot template, VS Code, CI, verify script) comes from the `web` layer.
|
|
8
|
+
|
|
9
|
+
## Scaffold checklist
|
|
10
|
+
|
|
11
|
+
1. Scaffold with `bunx create-next-app@latest <name> --typescript --tailwind --eslint --app --src-dir --import-alias "@/*" --use-bun --skip-install --disable-git --no-agents-md --yes`. `--no-agents-md` skips the scaffold-time `AGENTS.md`/`CLAUDE.md` write, which otherwise duplicates the root `CLAUDE.md`.
|
|
12
|
+
2. Install web tooling: `canon tooling sync web . --write`
|
|
13
|
+
3. Install nextjs configs: `canon tooling sync nextjs . --write`
|
|
14
|
+
4. Extend the `ci` and `development` context entries under `.claude/context/` per the web reference's extend sections plus the nextjs rows below.
|
|
15
|
+
5. Run `bun run lint:fix` then `bun run check`.
|
|
16
|
+
|
|
17
|
+
## What ships as golden configs
|
|
18
|
+
|
|
19
|
+
- `next.config.ts`: `agentRules: false` stops Next from regenerating `AGENTS.md`/`CLAUDE.md` on every run, which would otherwise compete with the root `CLAUDE.md`. `turbopack.root: import.meta.dirname` pins the workspace root, silencing Next's multi-lockfile inference warning in any checkout carrying more than one lockfile above the project, a worktree included.
|
|
20
|
+
- `vitest.config.ts`: plain `defineConfig`, no `mergeConfig` or `getViteConfig` since Next has no Vite config to merge from. jsdom, globals, setup file, `passWithNoTests: true`, v8 coverage, `.next/**` in test excludes.
|
|
21
|
+
- `playwright.config.ts`: all browsers, `webServer` runs `bun run build && bun run preview` on port `3000` plus `WORKTREE_PORT_OFFSET`, `reuseExistingServer: false`. `DIST_PREBUILT` drops the `build` half, matching the astro stack's flag.
|
|
22
|
+
- `eslint.config.js`: overrides the web layer with `.next` and `next-env.d.ts` added to `globalIgnores`, keeping `react-hooks`/`react-refresh` since this stack still ships React components. `react-refresh/only-export-components` is `off` for `src/app/**`, since route and layout files export non-component values the rule would otherwise flag.
|
|
23
|
+
|
|
24
|
+
## Port
|
|
25
|
+
|
|
26
|
+
Next has no config-file port hook, unlike `astro.config.mjs`'s `server.port` or `vite.config.ts`'s `server.port`. The `${base} + WORKTREE_PORT_OFFSET` formula is computed twice instead of once: in `playwright.config.ts` as a JS expression, and in `[scripts.override]` for `dev` and `preview` as shell arithmetic passed to `next`'s own `--port` flag. Default port is `3000`, Next's own default.
|
|
27
|
+
|
|
28
|
+
## Typecheck
|
|
29
|
+
|
|
30
|
+
`typecheck` runs `next typegen && tsc --noEmit`. The App Router's route-level types (`LayoutProps`, `PageProps`) are generated into `.next/types/`, gitignored and absent from a fresh checkout, and `tsc` fails on them unresolved without the typegen step first.
|
|
31
|
+
|
|
32
|
+
## No golden `tsconfig.json`
|
|
33
|
+
|
|
34
|
+
`create-next-app`'s own default `tsconfig.json` needs no changes beyond project-specific path aliases, so a golden copy here would ship nothing the scaffold does not already write.
|
|
35
|
+
|
|
36
|
+
## Development docs (extend)
|
|
37
|
+
|
|
38
|
+
Append to the `## Scripts` table:
|
|
39
|
+
|
|
40
|
+
| `bun run dev` | Start the Next dev server on port 3000, plus this worktree's port offset. |
|
|
41
|
+
| `bun run build` | Build the production bundle. |
|
|
42
|
+
| `bun run preview` | Serve the built bundle locally, on port 3000 plus the worktree offset. |
|
|
43
|
+
| `bun run typecheck` | Run `next typegen` then `tsc --noEmit`. |
|
|
44
|
+
|
|
45
|
+
## CI docs (extend)
|
|
46
|
+
|
|
47
|
+
In `.claude/context/ci.md`, the Typecheck row's assertion reads: `` `next typegen && tsc --noEmit` passes ``.
|