330e437f08
Sync the AGENTS.md hierarchy to current code state:
Drift fixes in 11 existing files
- Root: 2026-05-20 commit 39aadbf9f, ~2167 TS files, 120 barrel index.ts,
57 src/hooks dirs, 297 (179 non-test) src/shared files, 11 OpenCode hook
handlers in plugin-interface.ts, packages list adds ast-grep-mcp + rules-core,
first-prompt-watchdog 206 LOC, parent-wake-notifier 587 LOC
- src/AGENTS.md: file counts, plugin-interface handler count
- src/shared/AGENTS.md: title + counts 278/170 -> 297/179
- src/hooks/AGENTS.md: 57 dirs, note unwired WIP (task-reminder,
hashline-edit-diff-enhancer)
- src/features/AGENTS.md: module map with NON-TEST counts + sub-AGENTS.md
column, 7 modules without sub-doc
- src/features/background-agent/AGENTS.md: add 12 newer files (parent-wake-
notifier 587 LOC, loop-detector, error-classifier, fallback-retry-handler,
process-cleanup, subagent-spawn-limits, session-status-classifier,
compaction-aware-message-resolver, etc.)
- src/plugin/AGENTS.md: 11 handlers, add system-transform.ts + command-
execute-before.ts + build-team-idle-wake-hint-client.ts
- src/config/AGENTS.md: note schema/internal/permission.ts
- src/cli/AGENTS.md: 8 commands including 'version'
- src/plugin-handlers/AGENTS.md, packages/web/AGENTS.md: date bump
New AGENTS.md in 4 directories
- packages/AGENTS.md: index of 15 packages (11 platform binaries + 2 MCP
packages + rules-core + web), role map, conventions
- docs/AGENTS.md: WHERE TO LOOK table for 19 docs across 6 subdirs
- .opencode/AGENTS.md: 5 skills + 4 slash commands + relationship to .agents/
- .agents/AGENTS.md: superset migration target (9 skills + 4 commands)
96 lines
5.2 KiB
Markdown
96 lines
5.2 KiB
Markdown
# packages/web/ — Marketing Site (Next.js + Cloudflare Workers)
|
|
|
|
**Generated:** 2026-05-20
|
|
|
|
## OVERVIEW
|
|
|
|
Public-facing marketing site for oh-my-opencode / oh-my-openagent. Next.js 15 (App Router) deployed to Cloudflare Workers via [@opennextjs/cloudflare](https://opennext.js.org/cloudflare). Independent of the npm plugin — its own `package.json`, `bun.lock`, and `tsconfig.json`.
|
|
|
|
## STACK
|
|
|
|
| Layer | Choice |
|
|
| -------------- | ----------------------------------------------------------------------------------- |
|
|
| Framework | Next.js 15.5 (App Router, RSC) |
|
|
| Runtime target | Cloudflare Workers (`compatibility_flags: ["nodejs_compat"]`) |
|
|
| Adapter | `@opennextjs/cloudflare` (build → `.open-next/worker.js`) |
|
|
| Styling | Tailwind v4 (`@tailwindcss/postcss`) + shadcn/ui (`components.json`) |
|
|
| i18n | `next-intl` with `app/[locale]/...` routing; 4 locales (en/ja/ko/zh) in `messages/` |
|
|
| Animation | `motion` (Framer Motion v12) |
|
|
| E2E | Playwright (`e2e/*.spec.ts`) |
|
|
| Lint/Format | ESLint flat config + Prettier (Tailwind plugin) |
|
|
|
|
## STRUCTURE
|
|
|
|
```
|
|
packages/web/
|
|
├── app/[locale]/ # localized routes (App Router)
|
|
├── components/ # shared UI primitives + shadcn-generated
|
|
├── lib/ # utility helpers (cn, etc.)
|
|
├── messages/{en,ja,ko,zh}.json # i18n strings
|
|
├── i18n/ # next-intl request/routing config
|
|
├── middleware.ts # next-intl middleware
|
|
├── public/ # static assets (largest dir, ~4 MB)
|
|
├── e2e/ # Playwright tests
|
|
├── scripts/prepare-build.mjs # purges .next/cache/fetch-cache before build
|
|
├── next.config.ts
|
|
├── open-next.config.ts
|
|
├── wrangler.toml # worker name + compatibility settings
|
|
├── playwright.config.ts
|
|
├── eslint.config.mjs
|
|
├── postcss.config.mjs
|
|
├── tsconfig.json
|
|
├── components.json # shadcn config
|
|
└── package.json
|
|
```
|
|
|
|
## SCRIPTS
|
|
|
|
```bash
|
|
# from packages/web/ directory
|
|
bun install
|
|
bun run dev # next dev (local Node.js)
|
|
bun run lint # biome lint + eslint
|
|
bun run lint:fix
|
|
bun run format # prettier --write
|
|
bun run format:check
|
|
bun run type-check # tsgo --noEmit
|
|
bun run build # next build (Node target — for sanity)
|
|
bun run preview # opennextjs-cloudflare build + preview locally
|
|
bun run deploy # opennextjs-cloudflare build + deploy to Cloudflare
|
|
bun run test:e2e # playwright test
|
|
bun run cf-typegen # regenerate cloudflare-env.d.ts from wrangler.toml bindings
|
|
```
|
|
|
|
## CI/CD
|
|
|
|
| Workflow | Trigger | What |
|
|
| ---------------------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
| `.github/workflows/web-ci.yml` | push/PR to master/dev that touches `packages/web/**` | format check, lint, type-check, next build, opennextjs-cloudflare build |
|
|
| `.github/workflows/web-deploy.yml` | push to master that touches `packages/web/**` OR manual dispatch | full deploy via `cloudflare/wrangler-action@v3` |
|
|
|
|
**Required secrets** (must be configured in repo settings before deploy works):
|
|
|
|
- `CLOUDFLARE_API_TOKEN` — token with `Workers Scripts: Edit` permission
|
|
- `CLOUDFLARE_ACCOUNT_ID` — Cloudflare account ID
|
|
|
|
A `web-production` GitHub environment is referenced by the deploy workflow so deploys can be gated behind required reviewers / wait timers if desired.
|
|
|
|
## RELATIONSHIP TO npm PACKAGE
|
|
|
|
The npm package `oh-my-opencode` ships only `dist/`, `bin/`, and `postinstall.mjs` (see root `package.json` `files` field). `packages/web/` is **not** included in any npm publish — it is exclusively a separate Cloudflare deployment target.
|
|
|
|
Root `bun test` ignores `packages/web/**` through `bunfig.toml` so `packages/web/e2e/*.spec.ts` does not pollute plugin tests.
|
|
|
|
## CONVENTIONS
|
|
|
|
- **No path aliases globally** in the omo project, but `packages/web/` is a Next.js app where `@/*` aliases are the framework default. Keep `@/*` confined to packages/web/.
|
|
- Use the existing shadcn primitives in `components/ui/` rather than installing new UI libs.
|
|
- All user-facing copy goes through `messages/{locale}.json`; never hardcode strings in components.
|
|
- Format with prettier before commit — `web-ci.yml` enforces `format:check`.
|
|
|
|
## ANTI-PATTERNS
|
|
|
|
- Never run `npm install` in `packages/web/`. Use `bun install` only. (Root `.gitignore` already blocks `package-lock.json`.)
|
|
- Never commit `.next/`, `.open-next/`, `.wrangler/`, `node_modules/` (covered by `packages/web/.gitignore`).
|
|
- Never deploy locally with `bun run deploy` against production — use the GitHub Actions workflow so Cloudflare credentials live in one place.
|