Agent skill

Canonical Tag

by kostja94 in kostja94/marketing-skills

When the user wants to configure canonical URLs, fix duplicate content, or consolidate URL signals.

MITAuto-check passedMarketing & SEO

Install Canonical Tag

skills CLI
$ npx skills add kostja94/marketing-skills --skill canonical-tag -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install kostja94/marketing-skills canonical-tag --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/kostja94/marketing-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/seo/technical/canonical .claude/skills/canonical-tag && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
canonical-tag
GitHub stars
1k
Token cost
~1.2k tokens
SKILL.md length
450 words
Files
1
Skills in repo
102
Repo updated
First seen
Licence
MIT

At a glance

When the user wants to configure canonical URLs, fix duplicate content, or consolidate URL signals.

  • Works in 3 steps: Site URL: Base domain → Duplicate scenarios: Multi-language,… → Framework: Next.js, React, static, etc.
  • Wants to configure canonical URLs
  • SKILL.md covers Scope (Technical SEO), Initial Assessment, Canonicalization Methods… and HTTPS & Security, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Canonical Tag is an agent skill from kostja94/marketing-skills. When the user wants to configure canonical URLs, fix duplicate content, or consolidate URL signals. Also use when the user mentions "canonical," "canonical URL," "duplicate content," "duplicate content fix," "preferred URL," or "URL consolidation." For GSC duplicates, use google-search-console.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Marketing & SEO, covering Technical SEO. It works with Google Search Console. The repository describes itself as: Agent Skills for Marketing — SEO, Social, Influencer & More. 160+ open-source skills for SEO, content, 40+ page types, paid ads, channels, and strategies. Add project context… The licence is MIT.

When your agent uses it

  • Wants to configure canonical URLs
  • Fix duplicate content
  • Consolidate URL signals
  • The user mentions canonical

Example prompts

  • “canonical,”
  • “canonical URL,”
  • “duplicate content,”
  • “/canonical-tag”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Site URL: Base domain
  2. Duplicate scenarios: Multi-language, query params, pagination, alternate URLs
  3. Framework: Next.js, React, static, etc.

What it can do on your machine

Read from SKILL.md and the folder at commit 8dd89c5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript, html, apache and nginx).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • developers.google.com
    • alignify.co

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Canonical Tag loads about 1.2k tokens when it runs. Until then it costs about 77 tokens; SKILL.md has 450 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~77
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from kostja94/marketing-skills at commit 8dd89c5, republished under its MIT licence (© kostja94). 450 words, ~1,203 tokens.

Download SKILL.mdSave it as .claude/skills/canonical-tag/SKILL.md (or your agent's skills folder).
name
canonical-tag
description
When the user wants to configure canonical URLs, fix duplicate content, or consolidate URL signals. Also use when the user mentions "canonical," "canonical URL," "duplicate content," "duplicate content fix," "preferred URL," or "URL consolidation." For GSC duplicates, use google-search-console.
metadata.version
1.0.1

SEO Technical: Canonical

Guides canonical tag configuration to consolidate duplicate content and declare preferred URLs.

When invoking: On first use, if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On subsequent use or when the user asks to skip, go directly to the main output.

Scope (Technical SEO)

  • Duplicate site versions: HTTPS vs HTTP; www vs non-www; trailing slash (/page vs /page/) — choose one, 301 redirect others
  • Duplicate content: Canonical tags; consolidate and 301 to preferred URL
  • HTTPS: SSL/TLS; secure connection; ranking signal since 2014

Initial Assessment

Project context: Read root contextus.md when present and load only the modules relevant to this task. Without Contextus, use available project material or user-provided facts and ask for missing information; do not create a parallel context system.

Identify:

  1. Site URL: Base domain
  2. Duplicate scenarios: Multi-language, query params, pagination, alternate URLs
  3. Framework: Next.js, React, static, etc.

Canonicalization Methods (Choose by Scenario)

MethodWhenStrength
301 redirectPreferred; server can redirectStrongest — permanent redirect
Canonical tagCannot redirect (e.g. params, pagination)Strong — HTML signal
robots.txtBlock non-canonical pathsWeak — advisory only

Use 301 for HTTP→HTTPS, www variants, trailing slash. Use canonical for params, pagination, UTM.

HTTPS & Security

HTTPS is a ranking signal (Google, 2014). Users and crawlers should access only the HTTPS version.

RequirementAction
SSL/TLS certificateInstall valid certificate; use Let's Encrypt for free
301 redirectHTTP → HTTPS; all HTTP requests redirect to HTTPS
Mixed contentNo HTTP resources on HTTPS pages; fix mixed content warnings
HSTSOptional; Strict-Transport-Security header for repeat visitors

WWW vs non-WWW: Choose one preferred version; 301 redirect the other. See canonical rules above.

Show full SKILL.md (172 more words)Show less

When to Use Canonical

  • Multi-language: Each language version has its own canonical; use hreflang with canonical
  • Same content, multiple URLs: Params, pagination, tracking params, www vs non-www, trailing slash (/page vs /page/)
  • Self-referencing: Canonical should point to self or the preferred version
  • Avoid chain canonical: A→B→C is invalid

Rules

RuleNote
Absolute URLInclude https://
ConsistencyMust match current page URL or the chosen preferred version
No chainsA→B→C is invalid

Implementation Patterns

Next.js (metadata)
tsx
export const metadata = {
  alternates: {
    canonical: "https://example.com/page-slug",
    languages: {
      zh: "https://example.com/zh/page-slug",
      en: "https://example.com/page-slug",
      "x-default": "https://example.com/page-slug",
    },
  },
};
HTML (generic)
html
<link rel="canonical" href="https://example.com/page-slug" />
Server Redirects (301)

Apache (.htaccess):

apache
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Nginx:

nginx
return 301 https://$host$request_uri;

Relationship to Other Technical SEO

  • Sitemap: URLs in sitemap should match canonical
  • IndexNow: Submit canonical URLs

Output Format

  • url-structure: URL hierarchy and format; canonical handles duplicate variants (HTTPS, www, trailing slash)
  • localization-strategy: hreflang + canonical for multi-language
  • xml-sitemap: Sitemap URLs should match canonical
  • indexnow: Submit canonical URLs
  • google-search-console: Find duplicate content in Coverage report
  • indexing: Resolve indexing issues
  • site-crawlability: Crawl budget; redirect chains; canonical reduces duplicate crawl waste

© kostja94, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/seo/technical/canonical of kostja94/marketing-skills.

Open the folder on GitHubat commit 8dd89c5

Compare with similar skills

Canonical Tag next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Canonical Tag compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Canonical Tag this skillkostja94/marketing-skills1k—~1.2kAutomated safety check: PassMIT
Google SEO APIsAgriciDaniel/claude-seo19k1 repos~4.2kAutomated safety check: PassMIT
SEO Coachakseolabs-seo/seo-coach146—~2.8kAutomated safety check: PassNone
SEO Setupalisamadiii/Portfolio180—~1.7kAutomated safety check: PassNone
Google Search SEO Guidelittleben/awesomeAgentskills1892 repos~4.2kAutomated safety check: PassMIT
SEO Googleseranking/seo-skills161—~4.8kAutomated safety check: PassMIT

Similar skills

  • Google SEO APIs

    AgriciDaniel/claude-seo

    Pulls real Google data for SEO work: Search Console, PageSpeed Insights, CrUX field data, the Indexing API and GA4 organic traffic, through /seo google commands.

    19k GitHub starsUsed in 1 repo~4.2k tokens
    Marketing & SEOAuto-check passed
  • SEO Coach

    akseolabs-seo/seo-coach

    Beginner-first SEO coaching for people who want to learn by doing one safe, verifiable step at a time.

    146 GitHub stars~2.8k tokensUpdated 1 mo ago
    Marketing & SEOAuto-check passed
  • SEO Setup

    alisamadiii/Portfolio

    Full SEO/metadata setup and audit for client websites (Astro, Next.js, any static site).

    180 GitHub stars~1.7k tokensUpdated 4 days ago
    Marketing & SEOAuto-check passed
  • Google Search SEO Guide

    littleben/awesomeAgentskills

    Answers Google Search optimization questions from reference files covering crawling, indexing, structured data, Search Console and site visibility, drawn from Google's documentation.

    189 GitHub starsUsed in 2 repos~4.2k tokens
    Marketing & SEOAuto-check passed
  • SEO Google

    seranking/seo-skills

    Direct access to Google's own SEO data via Search Console (Search Analytics, URL Inspection, Sitemaps), PageSpeed Insights v5, CrUX field data with 25-week history, Indexing API v3, GA4 organic…

    161 GitHub stars~4.8k tokensUpdated 3 mo ago
    Marketing & SEOAuto-check passed
  • Geo Meta Tags Audit

    thedaviddias/Front-End-Checklist

    Audits and fixes geo.region, geo.placename and geo.position meta tags on regional pages, noting where they help (Bing) and where they do not (Google).

    74k GitHub stars~763 tokensUpdated 5 days ago
    Marketing & SEOAuto-check passed

More from kostja94/marketing-skills

All 102 skills in this repo
  • Grokipedia Recommendations

    kostja94/marketing-skills

    When the user wants to add recommendations, links, or content to Grokipedia.

    1k GitHub starsUsed in 1 repo~4.2k tokens
    Auto-check passed
  • AI Traffic Tracking

    kostja94/marketing-skills

    When the user wants to track AI search traffic in GA4 or GSC.

    1k GitHub stars~959 tokensUpdated 5 days ago
    Auto-check passed
  • Analytics Tracking

    kostja94/marketing-skills

    When the user wants to set up, audit, or optimize analytics tracking (GA4, events, conversions).

    1k GitHub stars~1.5k tokensUpdated 5 days ago
    Auto-check passed
  • Brand Visual Generator

    kostja94/marketing-skills

    When the user wants to define, audit, or apply visual identity (typography, colors, spacing, design tokens, frontend aesthetics).

    1k GitHub stars~3k tokensUpdated 5 days ago
    Auto-check passed
  • Content Strategy

    kostja94/marketing-skills

    When the user wants to plan content for SEO, create content calendar, or build topic clusters.

    1k GitHub stars~1.8k tokensUpdated 5 days ago
    Auto-check passed
  • Favicon Generator

    kostja94/marketing-skills

    When the user wants to implement, optimize, or audit favicon and app icons.

    1k GitHub stars~1.3k tokensUpdated 5 days ago
    Auto-check passed

Categories

Questions about Canonical Tag

What does Canonical Tag do?

When the user wants to configure canonical URLs, fix duplicate content, or consolidate URL signals. Canonical Tag is an agent skill from kostja94/marketing-skills. When the user wants to configure canonical URLs, fix duplicate content, or consolidate URL signals.

When should I use Canonical Tag?

Canonical Tag fits situations like: wants to configure canonical URLs; fix duplicate content; consolidate URL signals; the user mentions canonical.

How do I install Canonical Tag in Claude Code?

Run `npx skills add kostja94/marketing-skills --skill canonical-tag -a claude-code`. Or copy the skill folder (skills/seo/technical/canonical in kostja94/marketing-skills) into .claude/skills/canonical-tag in your project. Claude Code loads it when a task matches its description.

How do I install Canonical Tag in Codex?

Run `npx skills add kostja94/marketing-skills --skill canonical-tag -a codex`. Or copy the skill folder (skills/seo/technical/canonical in kostja94/marketing-skills) into .agents/skills/canonical-tag in your project. Codex loads it when a task matches its description.

Can I use Canonical Tag in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kostja94/marketing-skills --skill canonical-tag -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/canonical-tag, .gemini/skills/canonical-tag, .github/skills/canonical-tag and .opencode/skills/canonical-tag in your project.

What does Canonical Tag need to run?

SKILL.md names no scripts, command-line tools or credentials: Canonical Tag is instructions for the agent only.

Does Canonical Tag access the network?

SKILL.md names 2 domains. As links in the text: developers.google.com and alignify.co. This is read from the text; nothing was executed.

Is Canonical Tag safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Canonical Tag use?

Canonical Tag is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Canonical Tag use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Canonical Tag?

Skills that share tags, products or a category with Canonical Tag: Google SEO APIs (AgriciDaniel/claude-seo, 19k stars), SEO Coach (akseolabs-seo/seo-coach, 146 stars), SEO Setup (alisamadiii/Portfolio, 180 stars) and Google Search SEO Guide (littleben/awesomeAgentskills, 189 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Canonical Tag?

kostja94 (a GitHub user) maintains it in kostja94/marketing-skills, which has 1,025 GitHub stars. The repository holds 102 skills in this directory. The repository was last updated on October 6, 2026.

Source: kostja94/marketing-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.