Skip to content

feat(chat): a /fanout skill drafts answers where AI searches without you, and Fan-out Gap Filler is ready to use (AGENTS #9) - #2144

Merged
gkhngyk merged 3 commits into
ansvisor:mainfrom
cihan-gyk:feature/fanout-skill
Nov 5, 2026
Merged

gkhngyk merged 3 commits into
ansvisor:mainfrom
cihan-gyk:feature/fanout-skill

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

AGENTS plan §3 row 9 and §7 step 3: the new /fanout skill (Fan-out gaps) and the Fan-out Gap Filler agent that was waiting for it. The skill is a library skill: a person types /fanout in Chat, and the agent runs it every Monday.

The skill (skills/fanout/SKILL.md)

Before an AI engine answers a tracked prompt, it searches a few sub-questions (its query fan-out). /fanout picks the sub-questions where no answer that searched them named the brand or cited its site, most-searched first. For each one it drafts an answer-first section or FAQ entry, in the words the engines searched.

  • Evidence first: a table shows each sub-question's engines, how often it was searched, and the competitors named instead.
  • Facts: only from the brand's approved facts or the person. Anything else is a [placeholder].
  • Limits per run:
    • at most five gaps;
    • a sub-question searched only once is left out;
    • it says so when a sub-question can't be answered truthfully.
  • Saving: the sections are saved with create_draft, from the tracked prompt behind them, two drafts at most per run.
  • Measuring: it ends by saying when to check again, that is, whether the answers that search these sub-questions name the brand after the next tracking runs.
  • It never adds prompts, publishes, or promises a citation.

Data plan (the skill's "What to read"):

  • get_fanout_gaps (new, below);
  • list_ai_answers, for the prompt behind the top gaps;
  • get_brand_facts;
  • list_drafts / get_draft, so a section isn't written twice.

No connection is needed.

A new read, get_fanout_gaps

The registry had get_fanouts, which lists sub-queries but not whether the brand was in the answers that ran them.

  • The read itself: the Query Fan-outs tab's own read, with one opt-in addition. getQueryFanout(…, { presence: true }) also reads each answer's mention_count, citation_count and competitor_mentions. Per sub-query, it counts the answers that named or cited the brand, and each competitor (once per answer). The page's own call is unchanged and reads the same three columns as before.
  • What it returns: getFanoutGapsFor keeps the sub-queries with no such answer: up to 20, at most 50. For each one:
    • its engines and times searched;
    • whether it's tracked;
    • the first three tracked prompts behind it (ids, to draft from);
    • the first three competitors named.
  • Settings: area prompts, every role, the plan's platforms only (like get_fanouts), no MCP tool. Its result counts as untrusted data, because fan-out queries are outside text. It's cached like get_fanouts, until the next tracking run.

No migration.

Fan-out Gap Filler is ready to use

  • presets/fanout-gap-filler.json is now ready:
    • skills /fanout then /answerfirst, the plan's "→ /answerfirst";
    • the plan's weekly trigger kept (Mondays 09:00);
    • no connections.
  • fanout_skill is gone from PRESET_NEEDS and en.json.
  • Mode: Auto, ask before changes, unchanged from the Soon preset.
    • The agent's only change is saving a draft, which never goes live. Citation Win-back and Content Freshness, the plan's other draft-writing agents, work the same way.
    • In Auto, saving a draft still asks first unless an Admin set it to run without asking. A triggered run follows the mode for drafts.
    • Sending to a CMS and publishing stay the person's click (guardrails §1).

Everywhere a skill is listed

  • SKILL_ORDER and the regenerated library.json.
  • The library test's table: twenty-three, with main's /setup before /fanout.
  • ANSVISOR_SKILLS in agent-skills.ts (no connection), and chatAgents.skills.fanout.
  • skills/README.md: the row and the count.
  • The agents' and skills' eval set:
    • agent-eval.ts: the agent must make a draft; the skill, called as /fanout, must make a list and a draft;
    • agent-eval-data.ts answers get_fanout_gaps from the Brewline workspace's fan-outs.
  • Tests that count skills or ready presets are updated:
    • agent form: 23 skills;
    • the / menu: 23/24;
    • Ready to use: 20 ready cards, Fan-out Gap Filler ninth and Onboarding & Help tenth;
    • catalog: 19 Soon.
  • The tests that used Fan-out Gap Filler as their Soon example (Agent Center's New agent page, the catalog and Ready to use) now use Localization, which is waiting for a page-published trigger.

Help

  • help/chat/skills.md: twenty-three skills, and Fan-out gaps in the list. A Fan-out gaps section of its own explains what /fanout does, so "The Ansvisor skills" stays within 150 words.
  • help/chat/agents.md: a new Fan-out Gap Filler section covering when it runs, its mode, what it drafts, and /fanout in Chat.
  • Every section stays within 150 words, and approved-articles.json is regenerated.

Merged with main. Merged with main at 5a8de56 (#2134, #2135, #2136 Onboarding & Help with /setup, #2137), with no rebase. The conflicts kept both sides: /setup then /fanout everywhere the library is listed, and both agents ready. The /prompts PR (AGENTS #10) is stacked on this branch.

Open questions

  1. What "where the brand is absent" means, per answer. A sub-query is a gap when none of the answers whose search ran it named the brand (name or domain in the text) or cited its site, as tracking counts them. A sub-query where the brand appears in even one answer is left out. This is the strictest reading; a looser one (absent in most answers) would list more.
  2. The follow-on /answerfirst. The plan names it, but /fanout already writes its sections answer-first, so in a run /answerfirst mostly checks and tightens the saved draft. If the owner prefers one draft per run with no second pass, drop answerfirst from the preset.
  3. Mode. Auto, as for the other draft agents. Ask me first would make every Monday run wait on a card for each draft.

Related issue

None (AGENTS plan §3 #9, §7 step 3; CHAT-13 skills).

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. Chat. With the new Chat on, type / in Chat: /fanout · Fan-out gaps is in the Skills group. On a brand with Perplexity or Copilot answers, send "/fanout Which sub-questions does AI search where we are missing?". Check that:
    • the steps show Read fan-out gaps;
    • the answer has the table (sub-question, engines, times searched, named instead);
    • it offers a draft, which is saved after the card.
  2. Agent Center › Ready to use: Fan-out Gap Filler is ready and ninth, with /fanout/answerfirst, Auto, ask before changes and "Every Mon 09:00". Use this agent opens New agent filled in.
  3. Skills page: Fan-out gaps is listed under Content and Brand Visibility, with no connection needed.
  4. Tests: cd web && npx vitest run src/lib/actions/fanout.test.ts src/lib/mcp/chat-reads.test.ts src/lib/chat/skills src/lib/chat/agents src/lib/chat/agent-skills.test.ts src/lib/chat/registry src/lib/chat/testing src/lib/help.
  5. Real-model eval of the new scenarios. It costs money and was not run for this PR: cd web && env -u ANTHROPIC_BASE_URL -u ANTHROPIC_API_KEY AGENT_EVAL=fanout-gap-filler SKILL_EVAL=fanout yarn vitest run src/lib/chat/agent-eval.test.ts.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR
  • Help article updated under help/ (or no user-visible change) — see help/README.md

Checks were run locally on the pushed merge commit ad26683, with CI's commands, and all pass:

  • web format:check, typecheck, and yarn build (with CI's placeholder env);
  • lint: 0 errors, and 7 warnings, all in files this PR doesn't touch;
  • the full yarn test: 988 files, 10,606 tests passed, 1 skipped, 0 failed;
  • the skills CI job's tests: library.test.ts (19) and public-skills.test.ts (9).

This branch changes nothing in server/.


Generated by Claude Code

…you, and Fan-out Gap Filler is ready to use (AGENTS #9)

The new library skill /fanout (Fan-out gaps) takes the sub-questions AI
engines searched behind the brand's tracked answers where no answer named
the brand or cited its site, and drafts an answer-first section for each,
with the engines, times searched and competitors named as evidence. A
person calls it in Chat with /fanout; the Fan-out Gap Filler agent runs it
every Monday, then /answerfirst, in Auto, and is now ready to use.

A new read, get_fanout_gaps, gives those gaps: the Query Fan-outs tab's
own read (getQueryFanout) with an opt-in `presence` that also counts, per
sub-query, the answers that named the brand and each competitor. The page's
own read is unchanged. The fanout_skill need is gone.

Help: skills.md (twenty-two skills, the full list) and agents.md (a Fan-out
Gap Filler section).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
Brings in Onboarding & Help (ansvisor#2136, /setup as the 22nd skill), ansvisor#2134,
ansvisor#2135 and ansvisor#2137. Conflicts kept both: /setup then /fanout in SKILL_ORDER
and everywhere the library is listed (23 skills), Fan-out Gap Filler and
Onboarding & Help both ready (20 ready presets, 19 Soon). The tests that
used Fan-out Gap Filler as their Soon example now use Localization. Help:
skills.md gives Fan-out gaps a section of its own, so The Ansvisor skills
stays within 150 words.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9

@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.

LGTM.

gkhngyk
gkhngyk previously approved these changes Nov 5, 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.

LGTM.

@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.

LGTM.

@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.

LGTM.

@gkhngyk
gkhngyk merged commit aef6ef4 into ansvisor:main Nov 5, 2026
12 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.

3 participants