Skip to content

Universal SEO skill for Claude Code. 26 sub-skills + 19 sub-agents covering technical SEO, E-E-A-T, schema, GEO/AEO, agent readiness (Lighthouse Agentic Browsing, WebMCP, llms.txt), backlinks, local SEO, e-commerce, international SEO, Google APIs, and PDF/Excel reporting. 9 optional extensions for live SEO data.

fix(seo-cockpit): 0.3.3 bare default site and audits found from anywhere

Agrici Daniel5febd6b2f137
diff --git a/plugins/seo-cockpit/.claude-plugin/plugin.json b/plugins/seo-cockpit/.claude-plugin/plugin.json
index eeafcdd..9956c61 100644
--- a/plugins/seo-cockpit/.claude-plugin/plugin.json
+++ b/plugins/seo-cockpit/.claude-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "seo-cockpit",
- "version": "0.3.2",
+ "version": "0.3.3",
"description": "Mods companion for claude-seo: a spend guard on paid SEO APIs, a live audit band with a receipt, an economy mode, a visual cockpit (Search Console, rankings, Core Web Vitals, audit, Maps, spend) and zero-token commands",
"author": {
"name": "Agrici Daniel"
@@ -50,6 +50,12 @@
"description": "For the Vitals and drift views of the default site: a URL or origin. Leave empty to use the site's home page.",
"default": ""
},
+ "auditsFolder": {
+ "type": "directory",
+ "title": "Audits folder",
+ "description": "Where you keep your audits (the <site>-audit/ folders /seo audit writes). The cockpit finds the shown site's audit there from any folder.",
+ "default": ""
+ },
"googleAccount": {
"type": "string",
"title": "Google account",
diff --git a/plugins/seo-cockpit/README.md b/plugins/seo-cockpit/README.md
index 4708750..cd82f43 100644
--- a/plugins/seo-cockpit/README.md
+++ b/plugins/seo-cockpit/README.md
@@ -94,6 +94,7 @@ Auto-update is off by default for third-party marketplaces. Run `claude plugin u
| Economy mode | off | Run the five Opus agents on Sonnet |
| Default site | empty | The site the cockpit opens on when a folder shows none (`claude-seo.md`, `sc-domain:claude-seo.md` or `https://claude-seo.md/`). A site chosen in a folder, or its audit, comes first |
| Page for Core Web Vitals | empty | For the Vitals and drift views. Empty uses the property's site |
+| Audits folder | empty | Where you keep your `<site>-audit/` folders. The cockpit finds the shown site's audit there from any folder |
| Google account | auto | `auto`: claude-seo's own order (its sign-in, a service account, then your gcloud account). `gcloud`: always your own account from `gcloud auth application-default login`, for properties you own |
| Google API key | empty | For Core Web Vitals (CrUX). Sensitive: kept in Claude Code's secure storage. Empty uses claude-seo's own setup |
diff --git a/plugins/seo-cockpit/hooks/register.ts b/plugins/seo-cockpit/hooks/register.ts
index efe6f0e..22d2809 100644
--- a/plugins/seo-cockpit/hooks/register.ts
+++ b/plugins/seo-cockpit/hooks/register.ts
@@ -35,6 +35,8 @@ type Ctx = {
/** Google settings from /config, handed to claude-seo's scripts only. */
googleAccount: string
googleApiKey: string
+ /** Where the person keeps their audits (`<site>-audit/` folders), found from any working folder. */
+ auditsFolder: string
/** What the person typed in the pane as the site, per working folder. */
typed: string | null
}
@@ -378,6 +380,20 @@ async function auditFor($: EngineInterface, ctx: Ctx, host: string | null): Prom
}
}
+ // The audits folder from /config: `<site>-audit/audit-data.json`, with or without www.
+ if (host !== null && ctx.auditsFolder !== '') {
+ for (const name of [`${host}-audit`, `www.${host}-audit`]) {
+ const path = joinPath(ctx.auditsFolder, name, 'audit-data.json')
+ const data = await readJson($, path)
+
+ if (data !== null) {
+ void $.store.set(`audit:${host}`, path).catch(() => undefined)
+
+ return [data, path]
+ }
+ }
+ }
+
return [null, '']
}
@@ -435,6 +451,17 @@ async function resolveHost($: EngineInterface, ctx: Ctx): Promise<void> {
ctx.pane.hostSource = source
}
+/**
+ * The Search Console property for a site. A /config value counts only when it
+ * is a real property (`sc-domain:` or a URL prefix) for that site; a bare name
+ * such as `claude-seo.md` is not a property and becomes `sc-domain:claude-seo.md`.
+ */
+function propertyFor(setting: string, host: string): string {
+ const value = setting.trim()
+
+ return hostOf(value) === host && /^(sc-domain:|https?:\/\/)/i.test(value) ? value : `sc-domain:${host}`
+}
+
/** Builds one source's model from claude-seo's own scripts and files. Free: no paid API is called. */
async function buildTab($: EngineInterface, ctx: Ctx, tab: TabId): Promise<TabModel> {
const at = stamp()
@@ -447,7 +474,7 @@ async function buildTab($: EngineInterface, ctx: Ctx, tab: TabId): Promise<TabMo
const host = ctx.pane.host
// The /config property and page apply only to the site they name; any other site uses its domain property and home page.
- const property = host === null ? '' : hostOf(ctx.site) === host ? ctx.site.trim() : `sc-domain:${host}`
+ const property = host === null ? '' : propertyFor(ctx.site, host)
const propertyArgs = property === '' ? [] : ['--property', property]
const url = host === null ? '' : hostOf(ctx.pageUrl) === host ? ctx.pageUrl : `https://${host}`
@@ -718,6 +745,7 @@ export function register(on: On, options: PluginOptions) {
pane: { view: 'overview', models: {}, loading: new Set(), host: null, hostSource: null, exported: null, isOpen: false },
typed: null,
googleAccount: typeof options.googleAccount === 'string' ? options.googleAccount : 'auto',
+ auditsFolder: typeof options.auditsFolder === 'string' ? options.auditsFolder.trim() : '',
googleApiKey: typeof options.googleApiKey === 'string' ? options.googleApiKey.trim() : '',
}
diff --git a/plugins/seo-cockpit/tests/cockpit.test.ts b/plugins/seo-cockpit/tests/cockpit.test.ts
index 53417ab..8999333 100644
--- a/plugins/seo-cockpit/tests/cockpit.test.ts
+++ b/plugins/seo-cockpit/tests/cockpit.test.ts
@@ -140,6 +140,30 @@ describe('cockpit', () => {
expect(await ui.find({ key: 'row-audit' })).toBeDefined()
})
+ test('a bare default site queries the sc-domain property, and the audits folder finds its audit', { options: { site: 'claude-seo.md', auditsFolder: '/audits' } }, async ($, on) => {
+ const world = worldOf(on, { scripts: { run: { stdout: { error: null, rows: [] } } } })
+
+ on('session.cwd', () => ({ value: '/anywhere' }))
+ on('store.get', () => ({ value: undefined }))
+ on('store.set', () => ({ value: undefined }))
+ on('fs.read', ($, e) => (e.path === '/audits/claude-seo.md-audit/audit-data.json' ? { value: AUDIT } : { deny: 'ENOENT' }))
+ on('ui.status', () => ({ value: undefined }))
+ on('ui.open', () => ({ value: { isPlaced: true } }) as never)
+ on('ui.render', () => ({ type: 'Text', props: {}, children: ['engine'] }) as never)
+ mock.clock(on)
+
+ await $.command.run(command('seo-cockpit'))
+
+ const ui = await $.ui.mount({ ...WIDE, surface: 'terminal' })
+
+ await ui.press({ key: 'refresh' })
+ // Search Console needs sc-domain:claude-seo.md; the bare name is not a property.
+ expect(world.runs.some(run => run.includes('--property sc-domain:claude-seo.md'))).toBe(true)
+ expect(world.runs.some(run => / --property claude-seo\.md/.test(run))).toBe(false)
+ await ui.press({ key: 'row-audit' })
+ expect(await ui.find({ type: 'Text', text: /85\/100/ })).toBeDefined()
+ })
+
test('a site chosen in a folder beats the default', { options: { site: 'claude-seo.md' } }, async ($, on) => {
worldOf(on)
on('session.cwd', () => ({ value: '/client' }))
diff --git a/scripts/gsc_query.py b/scripts/gsc_query.py
index 4112b0b..2a79355 100644
--- a/scripts/gsc_query.py
+++ b/scripts/gsc_query.py
@@ -254,10 +254,17 @@ def query_search_analytics(
except Exception as e:
error_str = str(e)
if "403" in error_str:
+ hint = (
+ " A domain property is written sc-domain:example.com."
+ if not site_url.startswith(("sc-domain:", "http://", "https://"))
+ else ""
+ )
result["error"] = (
- f"Permission denied for property '{site_url}'. "
- "Ensure the service account email is added as a user in "
- "Google Search Console > Settings > Users and permissions."
+ f"Permission denied for property '{site_url}'.{hint} "
+ "The signed-in Google account has no access to it: add that account "
+ "(a service account email, or your own) in Google Search Console > "
+ "Settings > Users and permissions, or use your own account with "
+ "CLAUDE_SEO_GOOGLE_AUTH=adc after gcloud auth application-default login."
)
elif "404" in error_str:
result["error"] = (