This repository contains the Japan-facing QueryPie AI website.
README.md is the human-facing project guide. AI agents should read this file first for context, then follow AGENTS.md for execution rules.
- Production URL: https://querypie.ai
- Redirect domains: https://www.querypie.ai -> https://querypie.ai
- Staging URL: https://stage.querypie.ai
Registration status:
- Google Search Console: the production site is registered for the
querypie.aiproperty. - Google Analytics: production Google Analytics 4 tracking is enabled with measurement ID
G-DGKPWV2DP2.
How to check:
- Google Search Console: open the QueryPie AI Search Console property, then use Performance, URL Inspection, Indexing, and Sitemaps as needed.
- Google Analytics: open the QueryPie AI Japan GA4 report and review Traffic acquisition, Engagement, Events, and Realtime reports as needed.
This project is built with Next.js 16, React 19, TypeScript, Tailwind CSS v4, and npm.
The current public structure is:
/— top page/solutions/ai-crew/solutions/ai-dashi/solutions/as400-cobol/blog— local blog index/blog/:id/:slug— local MDX-backed blog detail, with/blog/:idredirecting to the canonical slug route/whitepapers— local whitepaper index/whitepapers/:id/:slug— local MDX-backed whitepaper detail, with/whitepapers/:idredirecting to the canonical slug route/news— local news index/use-cases— local use-case index/demo/aip— local AIP demo index/demo/acp— local ACP demo index/news/:id/:slug— local MDX-backed news detail, with/news/:idredirecting to the canonical slug route/events/:id/:slug— local event detail route/contact-us— local contact form page with stable query-string prefills and a local submit flow/about-us— local company overview page/certifications— local certifications page/resources— local resource index/introduction-deck— local introduction deck index and detail routes/glossary— local glossary index and detail routes/manuals— local manuals index and detail routes/platforms/acp— local ACP platform page/platforms/acp/integrations— local ACP integrations page/lingo/**— permanent redirect to the external Japanese Lingo website
Additional notes:
- Blog and whitepaper detail pages are rendered from local MDX under
src/content/blog/andsrc/content/whitepapers/. - Whitepaper detail pages can use the current MDX gating contract.
- The
/eventslist page is not publicly launched yet. It remains query-gated and is intentionally excluded from the top-level sitemap entry set. - Public resource hubs now include local
/resources,/introduction-deck,/glossary, and/manualspages backed by the local content loaders. - Some other top-level paths such as legal endpoints remain redirect routes to upstream QueryPie destinations.
- The catch-all missing-route flow only redirects paths that match the maintained QueryPie allowlist; other unmatched paths are logged and resolve to the local not-found flow.
Global content reconciliation runs locally on demand through the repo-local global-content-operations skill. There is no scheduled Global report GitHub Action. The skill uses the canonical querypie/corp-web-v2 and querypie/corp-web-japan repositories, validates origins, and clones missing source repositories into temporary or user-cache storage instead of assuming fixed local paths. It compares the latest Global/Japan main snapshots, performs AI baseline review, applies only user-approved Ignore decisions, validates tracking manifests, previews the final Slack Block Kit, sends the exact final payload to the test channel first, and sends that unchanged payload to production only after separate explicit approval.
Run npm run global-content:init once to load the Slack bot token and test/production channel IDs from 1Password into the main checkout’s gitignored .env.local. All worktrees reuse that file; later sends do not request 1Password again. Messages use Slack Web API and can be deleted with npm run global-content:delete-last -- test|prod.
Use repo-local skills for normal human-reviewed PR creation:
- Global-to-Japan publication — one Composite identity → content/baseline PR.
- Global content Ignore — exact or JST date-based exclusions →
ignore.jsonPR. - Content sync operator guide
- Report package README
- Durable OpenSpec contract
Both skills use a fresh report and never auto-merge. Ignore creation is for owner-approved intentional exclusions only; candidate evidence or mapping drift requires a normal reviewed baseline/content PR.
These principles apply to both humans and AI agents.
- Keep changes small, focused, and easy to review.
- Prefer structured content in
src/content/over inline copy when possible. - Keep docs, implementation, and tests aligned.
- Verify changes with the lightest command that proves correctness.
- If something is ambiguous, choose the smallest change that satisfies the request.
Core directories:
src/app/— App Router pages and redirect/API routessrc/components/— shared UI, layout, and page sectionssrc/content/— structured copy plus MDX source contentsrc/content/blog/— local blog MDX sourcesrc/content/whitepapers/— local whitepaper MDX sourcesrc/lib/— shared helpers, publication loaders, list-item derivation, and route utilitiespublic/— static assetstests/— Node-based repo verification testsscripts/deploy/— Vercel deployment scripts used by GitHub Actions
Representative files:
src/app/page.tsxsrc/app/blog/page.tsxsrc/app/blog/[id]/[slug]/page.tsxsrc/app/whitepapers/page.tsxsrc/app/whitepapers/[id]/[slug]/page.tsxsrc/app/contact-us/page.tsxsrc/app/sitemap.ts
Blog and whitepaper lists are driven from local content source files.
- Blog frontmatter is read from
src/content/blog/*.mdx. - Blog frontmatter may additionally use
hidden: trueto keep a post out of the/bloglist while preserving its local detail route, andredirectUrlto redirect local blog detail requests to another URL. - Whitepaper frontmatter is read from
src/content/whitepapers/*.mdx. - Blog list items resolve to local canonical detail routes.
- Whitepaper list items currently keep upstream
querypie.com/jahrefs for card destinations while the local detail routes exist for the new MDX-backed rendering flow. - For AI-agent execution, the repo-local publication skills are indexed in
.agents/skills/README.md. - Load
.agents/skills/mdx-publication-operations/SKILL.mdfirst for public MDX publication maintenance. - Then load the narrowest matching family wrapper from
.agents/skills/for the target content root.
Whitepaper gating contract:
- Use frontmatter
gated: trueon gated whitepaper MDX files. - Use the
<GatingCut />marker to split preview content from gated content. - The shared gating helpers live in
src/lib/publications/gating.ts. - The internal reference route for the current pattern is
/internal/whitepaper-gating-form.
Lead form delivery:
- Lead-bearing form submissions use the existing Salesforce-shaped
LEAD_MSrequest body. /contact-us/submithandles the Contact Us page./api/gating-form/unlockhandles gated whitepaper, introduction deck, PDF/download, and internal test form submissions.- Both submit paths send a fire-and-forget DeskPie Lead request through
src/lib/forms/server/deskpie-lead-delivery.ts. - DeskPie delivery is enabled only when both server-side environment variables are present:
DESKPIE_LEAD_API_ENDPOINTandDESKPIE_LEAD_API_KEY. - Keep production Vercel env pointed at the production DeskPie public lead endpoint/key, and non-production Vercel env pointed at the development DeskPie endpoint/key.
- Missing DeskPie env or delivery failures must not block the user-facing form response.
- Read this README for project context.
- Check
AGENTS.mdif you are an AI agent or need repository work rules. - If your task is publication-content work, read
.agents/skills/README.md, loadmdx-publication-operationsfirst for public MDX maintenance, then load the narrower family skill when one applies. - Use the structured content under
src/content/first when updating copy. - Run the relevant verification commands before considering a change done.
Useful commands:
npm install
npm run dev
npm run lint
npm run typecheck
npm run test
npm run test:ci
npm run buildRecommended verification before committing:
npm run test:ciRecommended verification before deployment-sensitive changes:
npm run test:ci
npm run buildGitHub Actions currently provide:
ci.yml— runsnpm run test:ciandnpm run buildon pull requests and pushes tomaine2e-stage.yml— manually runs the full hosted Playwright E2E suite against a chosen base URL, defaulting to stagedeploy-preview.yml— preview deployment workflowdeploy-staging.yml— staging deployment workflowdeploy-production.yml— production deployment workflowdelete-deploy.yml— preview deployment cleanup workflow
The repository relies on CI and hosted preview environments for normal verification. Do not assume local preview is required for every change.
Both humans and agents should remember:
src/content/is preferred for structured copy changes.- Repo-local AI agent skills belong under
.agents/skills/. .agents/skills/README.mdis the local skill index.- Publication authoring should load
.agents/skills/mdx-publication-operations/SKILL.mdfirst for public MDX maintenance, then load the narrowest matching family wrapper from.agents/skills/. npm run test:ciis the standard baseline verification step.npm run buildis required for deployment-sensitive changes.- Working rules and execution details live in
AGENTS.md.