agentleFS
en-dash-consultingen-dash-consulting/n-seo/.claude/skills/n-seo-add-site/SKILL.md

n-seo-add-site

Skill1 starsChanged 3 months agoMITView on GitHub

Add one site to an n-seo instance correctly — the Search Console property form, gscHost, the numeric GA4 id, a brand regex, and the two access grants. Use whenever someone wants a new site tracked.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask for whatever you cannot see, and do not guess any of them.

    line 19
  2. Very specific:

    If Search Console's Add-user dialog rejects a service-account address on a domain property, the fallback is the Site Verification API and a …

    line 85
  3. Very specific:

    Delete the entry. Its data/ stays until removed.

    line 123

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add a site

One entry in n-seo.config.json. There are no per-script site lists, so this is the only edit. docs/ADDING-A-SITE.md is the reference; this is the order to do it in.

E=<engine checkout>/bin/n-seo.mjs
I=<instance dir>

1. Collect four facts

Ask for whatever you cannot see, and do not guess any of them.

The property, exactly as Search Console shows it. This is where most mistakes happen:

In Search ConsolegscProperty
Domain property example.comsc-domain:example.com
URL-prefix propertyhttps://www.example.com/ — scheme and trailing slash included

Whether the property covers more than this site. A sc-domain: property covers every subdomain and both protocols. So:

  • One site on its own domain property → gscHost can be omitted.
  • Several sites sharing one domain property → every entry gets the same gscProperty and a different gscHost. The pull happens once per property; each site's rows are filtered by gscHost when read.
  • The site serves on www and the apex redirects → gscHost is www.example.com even though host is example.com. Getting this wrong means the probe and the metadata audit look at the wrong hostname and the site silently shows no data.

The numeric GA4 property id. GA4 → Admin → Property details → Property ID, nine or ten digits. It is not the G-XXXXXXX measurement id. Leave ga4Property empty for a site with no analytics; it will still be probed and pulled from Search Console.

A brand regex. Case-insensitive, matching what people type when they mean this site by name, used for the branded/generic split on /insights. For example.com something like example|exmpl. Omit it only if the site has no brand terms — a site with a gscProperty and no brand counts all of its traffic as generic, which quietly skews that split.

2. Add the entry

Append to sites in $I/n-seo.config.json:

{
  "host": "docs.example.com",
  "label": "docs",
  "gscProperty": "sc-domain:example.com",
  "gscHost": "docs.example.com",
  "ga4Property": "987654321",
  "brand": "example|exmpl",
  "repo": "../example-docs",
  "hosting": "GitHub Pages"
}

label, repo and hosting are display-only. Keep the JSON valid — the dashboard falls back to the last good config and logs a parse error otherwise.

3. Grant access to the service account

Both consoles, using the service-account email (node $E doctor --instance "$I" prints it, or read client_email from the key file):

  • Search Console → the new property → Settings → Users and permissions → Add user → Full.
  • GA4 → Admin → Property access management → Viewer. If the service account is already Viewer at the account level, a new property under that account inherits it and there is nothing to do.

On metadata auth the same grants apply to the runtime service account.

If Search Console's Add-user dialog rejects a service-account address on a domain property, the fallback is the Site Verification API and a DNS TXT record, described in docs/SETUP-GOOGLE.md.

4. Verify

node $E doctor --instance "$I"

The new property must appear under search console with a permission level, and its GA4 id must resolve. A missing property means the grant has not landed yet (give it a few minutes) or the property string does not match.

Then let the next scheduled run pick it up, or run it now:

node $E daily --instance "$I"

5. Confirm it landed

  • The sites strip on / lists it.
  • /site/<host> exists and the probe pills render.
  • /trends shows it — a brand-new site gets a flat "no traffic recorded yet" row rather than being silently absent, so an empty row is a connected site, not a broken one.

Zero rows from Search Console on a new site is correct, not a fault: there is no search history yet.

Optional: watch a page

watchPages is a flat list of URLs whose numbers appear in every daily-log entry. Add pages you are about to change so the log tracks them.

Removing a site

Delete the entry. Its data/ stays until removed. Backlog items for that host in config/backlog.json still render on /actions — retire them with the Retire button or via POST /api/backlog/<id>/retire.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.