canonry Β· diff
git:20260905.420f30b to git:20260910.2bcbc86
99 added, 191 removed. Audit A to A.
---
name: canonry
- description: "Operate Canonry (the `cnry` / `canonry` CLI) for AEO. Load this BEFORE any canonry operator task: creating or configuring a project, connecting GSC, GA4, Bing, Google Business Profile or a Cloudflare traffic source, running or scheduling a sweep, reading mention and citation coverage, running a technical audit, submitting sitemaps, or diagnosing why a number moved. Covers anything touching cnry, canonry doctor, ~/.canonry, @canonry/canonry, the canonry_* MCP tools, mention share, or direct-push / queue-pull traffic. Load it before acting, not after something fails."
- compatibility: Requires Node.js 22.14+ and globally installed @canonry/canonry; canonry-mcp must be on PATH.
- metadata:
- agent: >-
- {"emoji":"π‘","requires":{"bins":["canonry"]},"install":[{"id":"npm","kind":"npm","package":"@canonry/canonry","bins":["canonry"],"label":"Install canonry globally","command":"npm install -g @canonry/canonry"}]}
+ description: "Navigate Canonry through connected MCP tools or the `cnry` CLI to inspect evidence, diagnose changes, plan measurement, review integrations, and report results. Use this optional host-native skill for CLI workflows and detailed references; connected MCP users can operate through canonry_help without installing a local runtime or skill."
---
- # Canonry
-
- Agent-first open-source AEO (Answer Engine Optimization) operating platform. Track how AI answer engines **mention** your brand in answers and **cite** your domain in sources across Gemini, ChatGPT, Claude, and Perplexity, then act on the signal through the content engine and integrations.
-
- **Website:** [canonry.ai](https://canonry.ai) | **Docs:** [github.com/Canonry/canonry](https://github.com/Canonry/canonry)
-
- **CLI:** invoke as `cnry` (short form) or `canonry` β both ship with the npm package and are interchangeable. Examples in this skill use `cnry`.
-
- ## Runtime Preflight
-
- Before using the native Codex or Claude Code plugin, verify the separately
- installed Canonry runtime. It requires Node.js 22.14 or newer, and the native
- plugin specifically needs the global package so `canonry-mcp` remains on
- `PATH`; a one-off `npx` invocation is not sufficient:
-
- ```bash
- node --version
- command -v cnry
- cnry --version
- ```
-
- Then prepare the runtime in this order:
-
- 1. With approval, install the global runtime if `command -v cnry` failed.
- 2. Check only whether `$CANONRY_CONFIG_DIR/config.yaml` (when that variable is
- set) or `~/.canonry/config.yaml` exists; do not print the file. If it does
- not exist, pause and ask the operator to run `cnry bootstrap` in their own
- private terminal, then confirm completion without pasting the output.
- Bootstrap needs no provider credential, but it prints the new full-access
- API key once. Use `cnry init` only as an optional interactive first-time
- path when the operator also wants provider/OAuth provisioning. The plugin
- already supplies the skills and MCP registration.
- 3. After a fresh bootstrap, get approval and run `cnry start --format
- json`; `start` waits for the health endpoint before returning. On an
- existing installation, try the doctor command first and start only when the
- transport is unavailable. Never stop or restart a healthy daemon just to
- install the plugin.
- 4. Run `cnry doctor --format json` after the daemon is ready. A successful JSON
- response proves the health-check path works; individual checks may still
- report actionable `warn` or `fail` statuses. No provider is a warning, not a
- failure: Page Health works without one and AI Visibility stays disabled.
- Plugin installation state is
- read live, so installing the plugin alone does not require a daemon restart.
-
- Never ask the operator to paste credentials into the chat, print the raw API
- key, or inspect `~/.canonry/config.yaml` for secrets. The plugin does not expand
- the configured key's server-enforced scope, but it gives the client tools that
- can exercise that scope. Fresh `cnry bootstrap` creates a full-instance `*` key.
- The default plugin has teammate-level access to every project and shared
- instance setting. A write-capable key exposes write tools by default; a
- read-only key restricts the catalog to reads, while a project-scoped key keeps
- its project route boundary but is not tenant isolation: a write-capable scoped
- key can still mutate shared instance settings. Do not work around a missing
- tool or `403` by switching credentials.
-
- ## When to Use
-
- - Tracking brand **mentions** in AI answer text and **citations** in source links across providers
- - Expanding the tracked-query basket from an ICP description (`cnry discover run`)
- - Running technical SEO audits (14βfactor scoring)
- - Implementing structured data (JSONβLD)
- - Diagnosing indexing gaps via Google Search Console / Bing Webmaster Tools
- - Wiring server-side traffic (Cloudflare, Cloud Run, WordPress, Vercel) and GA4 referrals into a single AEO signal
- - Inspecting Google Ads conversion goals and GTM live configuration as read-only conversion evidence
- - Optimizing `llms.txt`, sitemaps, robots.txt for AI crawlers
- - Submitting URLs to Google Indexing API and Bing IndexNow
- - Analyzing competitor citation patterns
- - Operating guarded ChatGPT ads lifecycle changes and reconciling unresolved mutation receipts
-
- ## Core Philosophy
-
- - **Measure outcomes** β AI models are black boxes; track mentions + citations, don't assume causality
- - **Signal over noise** β Focus on highβintent queries; avoid granular targeting until base visibility exists
- - **CLIβnative** β APIβdriven changes over manual CMS clicks; faster, repeatable, auditable
- - **Recover before retrying ads writes** β Page through `pending`, `unknown`, and `reconciling` receipts. Resume `campaign_tree_activate` through its bodyless exact-executor recovery operation; reconcile other supported receipts by verifying the checkpointed provider ID on the receipt-bound account. Never resend a mutation under a different key; an uncheckpointed create remains unresolved. A fresh pending generic receipt waits for its minimum-idle window, inconclusive reads back off, and a quarantined receipt requires human remediation.
- - **Separate approval from ads execution** β A human with `ads.approve` creates a short-lived grant for the exact paused campaign tree and a different executor key. The operator may activate only that tree with `ads.activate`; it cannot mint or widen its own approval.
-
- ## What Canonry Measures (Vocabulary)
-
- Two parallel signals are tracked per (query Γ provider) snapshot. They are independent β a model can do either, both, or neither β never conflate them.
-
- | Term | Means | Headline metric |
- |---|---|---|
- | **mentioned** | The project's brand or domain appears in the LLM's **answer text** (the prose the model returns). | **Mention Coverage** β share of (query Γ provider) snapshots where the brand was mentioned. **Mention Share** is the project's share among the cited+mentioned set vs competitors. |
- | **cited** | The project's domain appears in the LLM's **source links** (the grounding citations returned alongside the answer). | **Citation Coverage** β share of snapshots where the domain was in the source list. |
-
- Configure `spec.brandAliases` on the project (or pass via `cnry apply`) so the mention detector catches "Meta" alongside "Facebook", etc. The downloadable report (`cnry report`) and the dashboard both lead with Mention Coverage; Citation Coverage rides as the secondary gauge.
-
- ## How to Operate
-
- A canonry engagement follows the same loop regardless of project size:
-
- 1. **Diagnose** β After explicit approval for the quota-consuming persisted runs, run a baseline sweep (`cnry run <project> --wait`) and a technical audit (`cnry technical-aeo run <project> --wait`, then `cnry technical-aeo score <project> --format json`). Use `cnry site-health overview <project> --format json` only to add crawl metadata; it never replaces the score. The audit discovers the in-scope site from the root, sitemaps, and internal links, persists the crawl graph and score, and keeps dead-link checks off unless explicitly requested. Read Mention Coverage first, Citation Coverage second. See `references/aeo-analysis.md`.
- 2. **Prioritize** β Triage by impact: indexing gaps β schema gaps β content gaps β query strategy. Branded-term losses are urgent.
- 3. **Execute** β Apply fixes via the canonry CLI or platform integrations. Use `--dry-run` on supported mutations (`cnry project delete`, `cnry query replace`, `cnry backfill ...`) to preview before committing. See `references/canonry-cli.md` for the full command catalog and `references/wordpress-integration.md` for the WordPress workflow.
- 4. **Monitor** β Re-run sweeps weekly only through an operator-approved schedule or after fresh explicit approval (`cnry run --all --wait` fans out across every project). Correlate visibility shifts with deployments and competitor moves.
- 5. **Report** β Lead with data, not interpretation: "Lost the mention for `<query>` on Gemini between <date> and <date> β two competitors moved in. Here's what to fix." For a one-command client-facing summary, run `cnry report <project>` to generate a self-contained HTML bundle (mention + citation hero, competitor landscape, GSC + GA4 performance, insights, suggested next queries). Same payload is available via `--format json` and the `canonry_report` MCP tool.
-
- **Verifying without polluting metrics**: when a test would help β "did the latest provider deploy work?", "is this regression reproducible?", "would this query actually surface us?" β propose the exact provider/query and get explicit approval before using `cnry run <project> --probe --provider <p> --query "..."`. Probe runs still cost quota and write a snapshot, but are excluded from the dashboard, analytics, intelligence, report, and notifications. Approval for one probe does not authorize repeats unless the operator approved a bounded batch; use real sweeps only when the operator wants the data to feed metrics.
-
- ## Surgical Reads
-
- When you need a specific value rather than a full payload, use the dot-path getter:
-
- ```bash
- cnry get <project> scores.mentionShare.value
- cnry get <project> scores.mentionCoverage.value
- cnry get <project> insights[0].severity
- cnry get <project> --from report scores.citationCoverage.value
- ```
-
- `cnry get` resolves a path into the project's overview (default) or any registered source (`report`, `traffic`, `discovery`, etc.). Returns scalar values without forcing the agent to grep through a 30 KB JSON dump.
+ <!-- Generated from docs/agent-operations/v1.md by pnpm guide:sync. Do not edit. -->
- ## Common Starting Points
+ # Canonry Operations Guide v1
- - **New site, 0 citations** β submit to GSC/Bing first; basic LocalBusiness/Service schema; `llms.txt`; trim to 8β12 high-intent queries. See `references/indexing.md`.
- - **Established site, regression** β diff canonry runs to find the loss window; verify schema is intact; resubmit affected URLs. See `references/aeo-analysis.md`.
- - **Empty / generic query basket** β describe the ICP and let discovery expand: `cnry discover run <project> --icp "..." --wait`, then `cnry discover promote <session-id>` to adopt the cited + aspirational queries. Multi-location projects can geo-constrain with `--locations <label,...>`.
- - **Multi-county targeting** β reference counties in `areaServed` schema and `llms.txt`; do not split into per-county queries until base visibility exists.
+ Canonry is an agent-first AI visibility platform. MCP is the universal entry
+ point for connected agents. Host-native skills are optional upgrades, not a
+ prerequisite or a permission mechanism.
- ## Google Analytics 4
+ ## Connect and choose a route
- GA4 is a first-class signal alongside citation tracking. Connect once with `cnry ga connect <project> --property-id <id> --key-file <path>`; `cnry ga sync` then pulls daily landing-page traffic, AI-referral sessions across 10 known providers (chatgpt, perplexity, claude, gemini, openai, anthropic, copilot, phind, you.com, meta.ai), and social referrals split into Organic vs Paid via GA4's `channelGroup` β and persists everything into four DB tables (`gaTrafficSnapshots`, `gaAiReferrals`, `gaSocialReferrals`, `gaTrafficSummaries`). All read commands query that local store, so they are fast and quotaless once a sync has run. AI referrals are tracked across three GA4 attribution dimensions (session source / first-user source / manual UTM) and joined to landing pages, so you can see which page each AI provider sent traffic to. Use `cnry ga traffic` for the current snapshot, `cnry ga attribution --trend` for a unified channel-share overview with biggest-mover deltas, and `cnry ga ai-referral-history` / `cnry ga social-referral-history` for daily series. See `references/canonry-cli.md` for the full command catalog and return-shape details.
+ Read the initialization guidance, then call `canonry_help` with an `intent`:
+ `status`, `diagnose`, `measurement`, `integrations`, `reports`, or a short task
+ description. Select an accessible project with `canonry_projects_list` before
+ using its exact name in project tools. Inspect each listed tool's input schema;
+ help suggests tool names, not invented arguments or authorization.
- ## Google Ads and GTM
+ Help returns a versioned, compact route: connection `mode`, available `next`
+ tools, workflow guidance, approval boundaries, and this guide's URL. It performs
+ no provider calls, reads no project data, and changes no permissions.
+ `includeCatalog: true` additionally returns toolkit details when needed.
- Google Ads and GTM are separate, project-scoped sources for one conversion
- contract. Provider snapshots are static configuration evidence. They do not
- prove browser events, tag firing, or recorded conversions. Stored snapshots are
- the safe default. A bounded live read needs `google-marketing.read-live`. Version
- 1 does not mutate Google Ads or edit, version, or publish GTM. Read
- `references/google-marketing.md` before assessing or refreshing this evidence.
- The operator must complete OAuth, resource selection, and contract creation.
- Never request OAuth credentials or a Google Ads developer token.
+ Hosted connections use a fixed catalog. Help only suggests tools offered by that
+ connection; it never tells a hosted agent to dynamically load a toolkit. A
+ progressive local stdio connection may return `loadToolkits`: call
+ `canonry_load_toolkit` with one returned name, await it, then call help again.
+ Loading only changes local tool discovery, never server authority.
- ## Server-Side Traffic
+ The optional `canonry://agent-operations/v1` MCP resource contains this same
+ guide. If the host cannot read resources or open links, continue through help.
+ Do not install a plugin, local runtime, or skill merely to use connected MCP.
+ An installed Codex or Claude Canonry skill contains a generated copy of this
+ guide plus links to host-native references. It does not replace runtime help.
- When the project ships behind a server you control, connect Cloud Run, WordPress,
- or Vercel. `cnry traffic sync` pulls and classifies their logs into hourly
- buckets. For Cloudflare, choose `direct-push` or `queue-pull` on the local,
- credential-owning host. Direct push requires a public Canonry HTTPS receiver.
- It does not use `traffic sync`. Queue pull sends events to a Cloudflare Queue,
- then Canonry drains it through `traffic sync` and the `traffic-sync` schedule.
+ ## Vocabulary and evidence
- If the connect response reports `activationRequired`, attach the Worker route
- first. Then run `cnry traffic activate <project> --source <id>`. Activation
- pauses all sibling sources. It also moves the one `traffic-sync` schedule to
- Queue pull. A first source becomes active automatically.
+ - **Mentioned** means the brand appears in answer text. **Cited** means its
+ domain appears in source links. Either, both, or neither can occur; never
+ compute one signal from the other.
+ - `answerMentioned: null` means not checked, not false. Missing runs and empty
+ populations mean no measurement, not zero visibility.
+ - Preserve project, time window, provider, requested/served model, location,
+ sample size, and query class when comparing evidence. Use server-returned
+ metrics; do not invent a score from incompatible populations.
+ - Simple projects and Advanced portfolios share the workflow. For Advanced
+ results, preserve Property, Target, market, plan revision, and class scope.
+ Groups organize navigation; do not infer an unrequested fan-out.
+ - Research is isolated evidence, not tracked measurement. A probe still spends
+ quota and persists evidence but is excluded from normal tracking metrics.
- Each default Queue tick drains at most 1,000 messages. Use `cnry traffic status`
- and the `traffic.source.queue-backlog` doctor check to read the backlog. If more
- than 1,000 messages remain, get approval before a manual sync or a shorter
- schedule interval. Use `cnry traffic events`, `cnry traffic sources`, and
- `cnry traffic status` for every adapter. See
- `references/server-side-traffic.md` for setup and smoke tests.
+ ## Workflows
- **WordPress safety:** incremental pulls are fixed `[since, until)` windows; a
- new or idle source begins at the plugin's 365-day maximum retention horizon.
- Canonry rejects an endpoint that returns events outside that window. Keep
- existing WordPress rollups intact: generic replace-mode backfill is unavailable
- until a retention-aware repair can prove coverage and declare any unrecoverable
- span.
+ **Status:** read the stored overview and freshness first. Say when evidence is
+ missing instead of silently creating it.
- **Vercel gotcha:** a freshly connected Vercel source captures only going-forward traffic β `lastSyncedAt` is seeded to NOW to avoid the 30-day default window exceeding Vercel's ~14-day request-logs retention (which would otherwise throw on every first sync). Use `cnry traffic backfill <project> --source <id> --days N` for historical recovery. If an idle Vercel/Cloud Run source has been failing long enough that `lastSyncedAt` aged past retention, unstick it with `cnry traffic reset <project> --source <id> --advance-to-now`.
+ **Diagnose:** inspect stored history and comparable evidence. Explain what
+ changed separately from why it might have changed. A hypothesis is not a
+ measured cause. Propose bounded verification if stored evidence is insufficient.
- ## Local AEO (Google Business Profile)
+ **Measurement:** inspect the existing setup and results before proposing edits.
+ Keep research, query tracking, plan publication, and sweep execution separate.
+ For direct research, submit the final editable query text in one context. For a
+ reviewed batch, submit each explicit destination with its final text and one
+ idempotency key. Pattern substitution happens in the client before either
+ request; choosing a market or Property records a destination only and never
+ rewrites a query or creates an automatic fan-out. `research.run` does not
+ authorize saving patterns, changing tracking, publishing plans, or settings.
+ Use a supported preview where available, inspect its exact destination and
+ revision, then seek approval for the actual change. A preview may itself require
+ write permission; never treat a dry-run flag as a universal safety guarantee.
- For businesses with a physical location or service area, Google Business Profile is the local-AEO signal source β reviews, search-keyword impressions, daily performance metrics, and (for hotels) structured amenities + booking CTAs all feed how AI engines answer local-intent queries. Connect with `cnry gbp connect <project>`, discover locations with `cnry gbp locations discover <project>`, and pick which sync with `cnry gbp locations select/deselect`.
+ **Integrations:** inspect stored connection state and snapshot freshness first.
+ Provider configuration evidence does not prove a browser event fired or a
+ conversion was recorded. Connection, resource selection, refresh/sync, and live
+ reads are separate actions. Credentials belong in the operator's secure setup
+ flow, never in chat, tool arguments, reports, or public guidance.
- **Hard prerequisites and gotchas β read `references/google-business-profile.md` before attempting setup:** GBP requires a Google access-form approval (0 QPM until granted), the only OAuth scope is the write-capable `business.manage`, **reviews live on a separately-gated legacy v4 API that the Basic approval does NOT grant** (and can't be self-enabled), and the **Q&A API was retired (2025-11-03)**. Keyword data is heavily privacy-redacted (often 100% for small businesses); an empty place-action profile is a real AEO finding to surface, but an empty lodging result is a verify-not-a-gap (the Lodging API can return 0 readable groups even when the owner-facing "Hotel details" panel has amenities set). The reference doc has the full setup walkthrough, the real-world data shapes, and the troubleshooting matrix.
+ **Reports:** use saved evidence for the requested period and scope. Keep mention
+ and citation signals separate, include dates and sample sizes, and state missing
+ or stale inputs. Preparing a report does not authorize new measurement.
- ## Built-in Analyst (Aero)
+ ## Authority and approval
- Canonry ships a built-in agent β Aero β for users who don't already have one. Drive it from the CLI:
+ Start with stored evidence. Before a live provider read, sweep, probe, research
+ run, sync, write, or externally visible action, obtain approval covering its
+ exact target, action, and bounded work. Approval already given for that exact
+ operation need not be asked for again, but does not extend to more projects,
+ larger batches, retries with new identities, or recurring work.
- ```bash
- cnry agent ask <project> "what changed since the last sweep?"
- cnry agent ask <project> "..." --provider claude --scope read-only
- cnry agent memory list <project> # durable project notes
- ```
+ HTTP GET and MCP `readOnlyHint` describe aspects of an operation, not its cost
+ or permission. Provider discovery, account reads, and live diagnostics may
+ consume quota even when labeled read-only. If the tool's effect is unclear,
+ inspect its description and request direction before calling it.
- Aero also wakes unprompted after every `run.completed` so insights and regressions get analyzed without a user click. Users who already run their own agent (Claude Code, Codex, custom) wire webhooks instead: `cnry agent attach <project> --url <webhook-url>` subscribes to `run.completed`, `insight.critical`, `insight.high`, `citation.gained`.
+ Authentication, role/scope checks, project restrictions, quotas, and guarded
+ approval receipts are enforced by the server. Help, skills, resources, and tool
+ visibility cannot grant authority. Never change credentials, endpoints, or
+ project identifiers to work around a missing tool or a `403` response.
- ## Boundaries & Safety
+ For guarded ads writes, inspect unresolved operation receipts before retrying.
+ Use the receipt's supported recovery action; do not replay a mutation under a
+ new identity. An executor cannot create or widen its own human approval grant.
+ On ambiguous results, exhausted bounds, or refusal, stop and report what is
+ known and what permission or operator action is needed.
- - **Get explicit approval before every mutation or quota-consuming sweep.** Also get approval before each live provider read. Stored reads and `--dry-run` previews are safe defaults.
- - **Never touch live WordPress without explicit approval**
- - **Back up `~/.canonry/config.yaml` before any config edit**
- - **Never fabricate mention or citation data** β if a sweep hasn't run, say so; never coerce `answerMentioned` null β false (null = "not checked")
- - **Client data stays private** β canonry repo is public; no real domains in issues
- - **Respect API rate limits** β batch operations, avoid tight loops
- - **Keep Google marketing read-only in v1** β stored evidence is the default.
- `google-marketing.read-live` permits bounded provider reads only. It grants no
- Google Ads mutation or GTM edit or publish authority.
+ ## Version and source
- ## References
+ This public, versioned document is the source for initialization guidance,
+ intent routes, the optional resource, and generated Canonry `SKILL.md` files.
+ Guide v1 may receive compatible clarifications; incompatible routing contracts
+ require a new guide version. The running server's help describes its actual
+ catalog and remains usable without fetching this document.
- | File | Read when |
- |---|---|
- | `references/canonry-cli.md` | Looking up specific canonry commands, flags, or JSON return shapes |
- | `references/aeo-analysis.md` | Interpreting sweep output, diagnosing regressions, planning content fixes |
- | `references/indexing.md` | Submitting URLs, checking GSC/Bing coverage, fixing indexing gaps |
- | `references/wordpress-integration.md` | Connecting to WordPress, editing pages, pushing staging β live |
- | `references/server-side-traffic.md` | Wiring server-side evidence from Cloudflare, Cloud Run, WordPress, and Vercel. Connect, inspect, sync pull sources, and troubleshoot. |
- | `references/google-business-profile.md` | Connecting Google Business Profile for local AEO: access-form approval, GCP API enablement, the v4-reviews access gate, hotel lodging/place-action signals, data shapes, troubleshooting. |
- | `references/google-marketing.md` | Inspecting first-class Google Ads and GTM evidence. Covers the conversion-integrity chain, static and runtime truth, live-read scope, v1 read-only boundary, and future write approvals. |
+ ## Optional host-native references
- ---
+ Read only references relevant to the requested task. They are not required for MCP operation.
- **Tools:** canonry v4+, @canonry/aeo-audit@4
- **Website:** [canonry.ai](https://canonry.ai) | **Org:** [ainyc.ai](https://ainyc.ai) | **Reference:** [AINYC AEO Methodology](https://ainyc.ai/aeo-methodology)
+ - [CLI commands and JSON return shapes](references/canonry-cli.md)
+ - [Interpreting stored evidence and regressions](references/aeo-analysis.md)
+ - [Indexing workflow after inspection and approval](references/indexing.md)
+ - [Approved WordPress workflow](references/wordpress-integration.md)
+ - [Server-side traffic setup and diagnosis](references/server-side-traffic.md)
+ - [Google Business Profile prerequisites](references/google-business-profile.md)
+ - [Google Ads and GTM evidence boundaries](references/google-marketing.md)