Skip to content

docs(skills): teach the AEO coach the Mentions & Sentiment tools - #1127

Merged
gkhngyk merged 4 commits into
ansvisor:mainfrom
cihan-gyk:docs/skills-mentions
Oct 22, 2026
Merged

gkhngyk merged 4 commits into
ansvisor:mainfrom
cihan-gyk:docs/skills-mentions

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

The AEO coach skills learn the Mentions & Sentiment tools. #1126 adds six MCP tools and their REST mirrors for the Mentions page, and the in-app agent already gets the reads. This brings both flavours of the skill (ansvisor-aeo-coach over MCP, ansvisor-aeo-coach-standalone over REST) up to them, so a client with the skill can answer "how is AI talking about us?" and "why did sentiment drop on Gemini?".

Merge after #1126, which adds the tools; it is stacked on #1125 → … → #1115. The branch is from main, so the diff is only the skills. Until #1126 merges, the tools described here don't exist yet.

What changes, in both skills

  • When to activate: "How is AI talking about us?", "Why did sentiment drop on Gemini?", "What does AI associate us with?".
  • The numbers that matter:
    • mentions and mention rate;
    • net sentiment, quoted signed and without a % sign, −100…+100;
    • lowSample under 20 mentions, where changes are already null;
    • sentiment is measured for the brand only.
  • Tools / endpoints: a Mentions & sentiment section with the page's filters (30 days by default) and:
MCP tool REST (under /api/mcp)
get_mentions_summary GET /mentions/summary
list_mentions GET /mentions
get_mention GET /mentions/{id}
get_mention_competitors GET /mentions/competitors
get_mentions_perception GET /mentions/perception
override_mention_sentiment (write) POST /mentions/{id}/sentiment-override
  • Workflow 10, "how is AI talking about us?":
    1. lead with net sentiment and its change;
    2. find the platform from headline.mover and platforms[], skipping low samples;
    3. quote real excerpts from list_mentions with sentiment: "negative";
    4. add competitors (sameResponseAsYou) and perception (brandTerms, biggestGap);
    5. use the report template;
    6. offer the correction, and call it only after the user confirms (it needs an admin or manager key).
  • references/sentiment-interpretation.md:
    • a Net sentiment section: reading the split, low samples, platforms 40+ points apart, corrections, brand only;
    • the "small sample" rule now names the 20-mention threshold.
  • Standalone only: error handling gets "403 on a correction: not an admin or manager".
  • skills/README.md: Mentions in what the skill does, an example question, and the correction listed among the writes.

Related issue

None. Follow-up to #1126.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. Read the Mentions & sentiment tool list, the numbers section and workflow 10 in both SKILL.md files.
  2. Check them against web/src/lib/mcp/server.ts and web/src/lib/mcp/mentions.ts on feat(mentions): read Mentions & Sentiment and correct a sentiment from the API and MCP #1126's branch: tool names, parameters and fields should match.
  3. Optionally, with feat(mentions): read Mentions & Sentiment and correct a sentiment from the API and MCP #1126 running, install the skill and ask "why did our sentiment drop on Gemini?". The answer leads with net sentiment and its change, names the platform, and quotes an excerpt.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/): not run; no web code changed
  • yarn typecheck passes (run from web/): not run; no web code changed
  • yarn format:check passes (run from web/): not run; no web code changed
  • Changes are focused — one concern per PR

Also checked:

  • Every field and parameter named here was checked against the tool descriptions and the data functions on feat(mentions): read Mentions & Sentiment and correct a sentiment from the API and MCP #1126's branch, including:
    • changes.netSentimentPoints, headline.mover, platforms[].netSentimentChange;
    • sameResponseAsYou, brandTerms[].sharePct, biggestGap;
    • the none competitor filter;
    • the 403 status.
  • npm run version:check fails as it does on main (the docker-compose images are 0.2.0 against 0.3.0). That is unrelated to this PR and left for the maintainers.

🤖 Generated with Claude Code

Both skills learn the six Mentions tools and REST endpoints from ansvisor#1126: the
numbers to quote (net sentiment, low sample, brand only), a workflow for
"why did sentiment drop on Gemini?", and the correction as a write. The
sentiment reference explains net sentiment and the README lists the new
questions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk the skills docs follow-up for #1126: both AEO coach skills learn the six Mentions tools, how to quote net sentiment and low samples, and a "why did sentiment drop on Gemini?" workflow. Docs only; please merge after #1126.

@gkhngyk

gkhngyk commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

@cihan-gyk this merges cleanly, but it documents six tools (get_mentions_summary … override_mention_sentiment) and their REST routes that aren't on main yet. We'll hold it until #1126 merges, so the skills don't send clients to endpoints that return 404.

When #1126 is in, please re-check the field names against its rebased web/src/lib/mcp/mentions.ts:

  • changes.netSentimentPoints, headline.mover, platforms[].netSentimentChange, sameResponseAsYou, brandTerms[].sharePct, biggestGap.
  • If feat(mentions): count mentions and net sentiment the same way on Insights and Mentions #1226 lands first, "Mentions are responses that name the brand at least once" changes. A mention becomes every time the brand is named, and net sentiment stays over the responses that name it. Update both SKILL.md files and both sentiment-interpretation.md copies to match.

Apart from that, it looks good to merge right after #1126.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge right after #1126, with two small wording fixes. The branch is unchanged (44a90b6a), and git merge-tree onto the current main (4ac82ce5) is clean: only the 5 skills files.

Checked against #1126's final code (web/src/lib/mcp/server.ts, web/src/lib/mcp/mentions.ts, the /api/mcp/mentions/* routes):

  • The six tool names and the six REST paths match.
  • The filter parameters match: brand_id, date_from / date_to (30 days by default), platform, region, topic_id and search.
  • The list_mentions filters match: sentiment, competitor_id (with none), sort (newest / oldest / co_mentions / negative) and page. get_mention and override_mention_sentiment take id, and the override also takes sentiment and note.
  • These fields exist as written: current.sentiment.net, lowSample, changes.netSentimentPoints, headline.mover (with change), platforms[].netSentiment / netSentimentChange, sameResponseAsYou, mentionsChangePct, brandTerms[].sharePct, attributes in entities order, coMentions and biggestGap.
  • The REST correction returns 403 for a key that isn't an admin's or manager's.
  • "Mentions are responses that name the brand at least once" matches #1126 today, which counts responses naming the brand as mentions and occurrences as timesNamed.

Wording fixes, in both SKILL.md files

  1. "The changes fields are already null there" is only partly true.
    • netSentimentPoints is null on a low sample.
    • mentionRatePoints is null under 20 tracked responses.
    • mentionsPct is not gated.
    • Suggested text: "changes.netSentimentPoints is already null there, as is the mention rate's change under 20 tracked responses."
  2. biggestGap is also null when the brand or the leading competitor has under 20 mentions (#1124's low-sample rule). That's more than "when none leads by 20+ points".

If #1226 lands before this PR, update the "Mentions" definition as noted earlier.

…p is

- Only changes.netSentimentPoints is null on a low sample (and the
  mention rate's change under 20 tracked responses); mentionsPct isn't
  gated.
- biggestGap is also null when the brand or the leading competitor has
  fewer than 20 mentions (ansvisor#1124's low-sample rule).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 21, 2026
The tool description said null only when no competitor leads by 20+
points; it is also null when the brand or that competitor has fewer than
20 mentions (ansvisor#1124's low-sample rule), as the skills now say (ansvisor#1127).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk Both wording fixes are in fdbe4d3, in both SKILL.md files:

  1. "changes.netSentimentPoints is already null there, as is the mention rate's change under 20 tracked responses."
  2. biggestGap is "null when none leads by 20+ points, or when the brand or the leading competitor has fewer than 20 mentions".

#1126's tool description now says the same. Merge after #1126, as planned.

gkhngyk
gkhngyk previously approved these changes Oct 22, 2026

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Both wording fixes are in, in both SKILL.md files (fdbe4d3):

  • Only changes.netSentimentPoints is described as null on a low sample, and the mention rate's change as null under 20 tracked responses.
  • biggestGap now also states its low-sample case.

The branch merges cleanly on main and on top of #1126, and touches only the five skills files. We'll merge it right after #1126.

…swered, and mentionsPct is times named

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk updated to match #1126's switch (8cab641): timesNamed is the page's Total mentions, and changes.mentionsPct is its change. changes are taken on the prompts both windows answered (changes.basis), so the coach quotes them rather than working changes out from current/previous, and it mentions new or dropped prompts. The mention rate's change is null when either window has under 20 responses.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One wording fix before merge. The rest of 8cab641 matches #1126's final fields:

  • timesNamed;
  • changes.basis.sharedPrompts, newPrompts and droppedPrompts;
  • changes.mentionsPct as the change in times named;
  • the mention rate's change, null when either window has under 20 responses.
  1. The glossary still leads with "Mentions are responses" (skills/ansvisor-aeo-coach/SKILL.md:76, skills/ansvisor-aeo-coach-standalone/SKILL.md:79).
    • The page now calls times named Total mentions. A user who asks "how many mentions did we get?" would get current.mentions from the coach, which isn't the number on the card.
    • Fix: start the bullet with times named, e.g. "Mentions, as the page's Total mentions counts them, are every time AI names the brand (timesNamed), twice in one response included: quote this one for 'how many mentions'. mentions is the responses naming the brand at least once: the base of the mention rate, net sentiment and lowSample."
    • The "fewer than 20 mentions" lines (SKILL.md:91/:94, and references/sentiment-interpretation.md:17 and :56 in both skills) can then say "responses naming the brand".
    • If #1126 renames changes.mentionsPct, update SKILL.md:90 and :93 to match.

This merges cleanly on main (12846db) and with #1126, and it touches only the five skills files.

gkhngyk pushed a commit that referenced this pull request Oct 22, 2026
…m the API and MCP (#1126)

* feat(mentions): read Mentions & Sentiment and correct a sentiment from the API and MCP

The Mentions page's figures over the API and MCP (MS-13): summary, the
mentions list, one answer, competitors and perception, under the page's
filters, from the page's own database functions after a brand check; and
"Sentiment is wrong" as the API key's owner. Migration 00162 lets
override_mention_sentiment correct for that person when the service role
calls, still only for an admin or manager of the answer's organization. The
in-app agent gets the five reads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(mentions): say when get_mentions_perception's biggestGap is null

The tool description said null only when no competitor leads by 20+
points; it is also null when the brand or that competitor has fewer than
20 mentions (#1124's low-sample rule), as the skills now say (#1127).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(mentions): read get_mentions_summary's changes as the page's cards do

Total mentions' change is now on times named (occurrences), and every
change is taken on the prompts both windows answered (changeBasis,
00195), with the counts behind it in changes.basis. The mention rate's
change is null when either window has under 20 responses, as on the
card. Adds promptsWithMentionsPct, and timesNamed per platform and day.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Cihan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
… Total mentions

As the Overview card counts them, "mentions" are every time AI names the
brand (timesNamed): the coach quotes that for "how many mentions", and
mentions (responses naming the brand) as the base of the rate, net
sentiment and lowSample, whose 20 is responses naming the brand.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk fixed in 5e22ba0:

  • the Mentions bullet now leads with times named: "Mentions, as the page's Total mentions counts them, are every time AI names the brand (timesNamed)… quote this one for 'how many mentions'", then mentions as the responses naming the brand, the base of the mention rate, net sentiment and lowSample (SKILL.md in both skills);
  • the "fewer than 20 mentions" lines now say "responses naming the brand" (SKILL.md and references/sentiment-interpretation.md in both skills).

#1126 kept changes.mentionsPct, so those lines stay. Still only the skills files.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Ready to merge.

The wording fix is done in 5e22ba0. The glossary now leads with times named (timesNamed), the page's Total mentions. It also says mentions is the responses naming the brand, which the mention rate, net sentiment and lowSample are based on. The "under 20" lines now say "responses naming the brand" in both skills and both sentiment-interpretation.md files.

I checked the names against main's web/src/lib/mcp/mentions.ts, server.ts and the /api/mcp/mentions routes, and they all match:

  • timesNamed, mentions and sentiment.lowSample (fewer than 20 mentions);
  • changes.mentionsPct, which is times named;
  • changes.netSentimentPoints, null on a low sample;
  • the mention rate's change, null under 20 tracked responses;
  • changes.basis.sharedPrompts, newPrompts and droppedPrompts;
  • the sorts and competitor_id: none, the id parameter, and the REST paths.

Optional:

  1. skills/ansvisor-aeo-coach/SKILL.md:146-148 (and the GET /mentions/competitors row at skills/ansvisor-aeo-coach-standalone/SKILL.md:133): a competitor's mentions counts responses, not times named. The glossary now says to quote times named for "how many mentions", so add half a line here: "compare a competitor's mentions with brand.mentions from the same call, not with timesNamed". Otherwise "us vs X" could mix the two units.

Merge notes

  • Merges cleanly on current main. It changes only the five skills files.

Tested on top of main together with #1346, #1349 and #1127: web and server tests, tsc, lint and Prettier pass.

@gkhngyk
gkhngyk merged commit 5a97fee into ansvisor:main Oct 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants