Skip to content

feat(chat): a /prompts skill proposes prompts to add and to pause, and Prompt Portfolio Manager is ready to use (AGENTS #10) - #2145

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

gkhngyk merged 6 commits into
ansvisor:mainfrom
cihan-gyk:feature/prompts-skill

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #2144 (feature/fanout-skill, AGENTS #9). Please merge #2144 first. Until then, this PR's diff also shows #2144's commits (the /fanout skill and its merge of main). This branch adds its own commit and a merge of feature/fanout-skill.

This PR covers AGENTS plan §3 row 10 and §7 step 3. It adds the /prompts skill (Prompt portfolio) and makes ready the Prompt Portfolio Manager agent that was waiting for it. The skill is a library skill: a person types /prompts in Chat, and the agent runs it every Monday.

The skill (skills/prompts/SKILL.md)

It keeps the tracking budget on what matters, and shows the evidence for each proposal.

  • Prompts to add. Sources:

    • the brand's pending prompt suggestions;
    • sub-questions engines searched twice or more that aren't tracked;
    • Search Console queries with impressions that ask what a buyer would ask an AI engine.

    It leaves out anything a tracked prompt already asks, queries with the brand's own name or that look for one page, and anything outside the brand's topics. It writes each prompt as a person would ask an AI engine, under the topic it belongs to. It proposes ten at most, ranked by evidence (impressions, times searched, the suggestion's reason).

  • Prompts to pause. A prompt is proposed only when every condition holds:

    • it has been tracked for 8 weeks or more;
    • in both of the last two 28-day periods, its answers neither named nor cited the brand (mentions and citations 0);
    • its searches a month are unknown or among the brand's lowest.

    Ten at most, longest-tracked first.

  • Out of scope is the person's call. A prompt counts as out of scope only when the person said so, in the chat or in the agent's instructions. A prompt that only looks off-topic to the model goes under "Worth a look", with no change proposed.

  • Every change is a card.

    • Additions go through add_prompts (one call per topic), pauses through pause_prompts. These are the W2-06 tools, and each change is logged in Activity with Undo. A paused prompt keeps its history.
    • The skill never adds topics or dismisses suggestions.
    • It says when additions would go past the plan's limit.
    • It doesn't ask again for a change the person declined.
  • Output: To add, To pause, Worth a look, the tracking budget before and after, and the Undo line.

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

  • list_topics and list_prompts (active);
  • get_plan_facts (the plan's tracked-prompt limit);
  • list_prompt_suggestions (Search Console suggestions carry their query and numbers);
  • get_fanouts (sub-questions, and whether each is tracked);
  • get_gsc_queries (new, below);
  • get_prompt_performance for the last 28 days and the 28 before;
  • get_prompt_volumes.

A new read, get_gsc_queries

Until now the registry read Search Console only as total clicks (get_gsc_summary).

  • What it returns: the brand's queries with clicks, impressions and average position over the last 28 days Google reported (or the days asked, up to 90), against the same span before. Most-seen first, 25 by default and 49 at most.
  • Who can read it: area ai_traffic, every role, no plan gate (like get_gsc_summary), no MCP tool.
  • How it reads: it sums the data in the database with ae_gsc_queries (migration 00091), the function Action Center's detectors already use. That function runs with the service role and is called only once the brand is confirmed as the caller's. So it reads one row per query, not one per day.
  • A brand without Search Console connected, or with no data yet, says so.
  • Its result counts as untrusted data, because queries are outside text.

No migration.

Prompt Portfolio Manager is ready to use

  • presets/prompt-portfolio.json is now ready:
    • skill /prompts;
    • the plan's weekly trigger kept (Mondays 09:00);
    • its role kept (the AEO/GEO & Audit work area);
    • Search Console as an Optional connection, as /prompts declares it in agent-skills.ts. The skill works without it and says so.
  • prompts_skill is gone from PRESET_NEEDS and en.json, and from Seasonal Prompt Planner (e-commerce pack). That preset stays Soon, now waiting only for its seasonal demand skill.
  • Mode: Ask me first (the Soon preset had Auto). The owner requires that a skill never adds or pauses prompts without the person's click, and only Ask me first guarantees that:
    • add_prompts and pause_prompts default to "Ask (auto allowed in Full auto)", and an Admin may set them to Always.
    • In Auto, an Admin's Always would let them run without a card. In Full auto they would run by themselves.
    • Ask me first shows a card for every change, whatever the policy, Run now included. It also needs no plan gate.
    • Adding prompts uses the plan's tracked locations, and once the plan is full a paused prompt may not come back through Undo. So this agent should never change tracking on its own.

Everywhere a skill is listed

  • SKILL_ORDER and the regenerated library.json.
  • The library test's table: twenty-four (main's /setup, /fanout, then /prompts).
  • ANSVISOR_SKILLS (Search Console Optional) and chatAgents.skills.prompts.
  • skills/README.md: the row and the count.
  • scope.ts: the new read's row limit and its 28 days, next to get_fanout_gaps.
  • The eval set:
    • agent-eval.ts has a new prompt_change promise, met when the run proposes add_prompts or pause_prompts;
    • the agent, and the skill called as /prompts, must make a list and a prompt change;
    • agent-eval-data.ts answers get_gsc_queries for Brewline.
  • Tests that count skills or ready presets are updated:
    • agent form: 24 skills;
    • the / menu: 24/25;
    • Ready to use: 21 ready cards (Fan-out Gap Filler ninth, Prompt Portfolio Manager tenth, Onboarding & Help eleventh);
    • catalog: 18 Soon.
  • Connections' "Used by" for Search Console now lists /prompts too.

Help

  • help/chat/skills.md: twenty-four skills, Prompt portfolio in the list, and a Prompt portfolio section of its own on what /prompts does, placed after Fan-out gaps.
  • help/chat/agents.md: a new Prompt Portfolio Manager section, after Onboarding & Help. It covers when the agent runs, its mode, what it proposes, when it pauses, Undo, out of scope, and /prompts in Chat.
  • Every section stays within 150 words, and approved-articles.json is regenerated.

Open questions

  1. What "no movement" means for a pause. This PR takes the most conservative reading, the three conditions under Prompts to pause above. A prompt where the brand is steady (no change, but present) is kept, because pausing it would stop watching a win. If the owner wants flat-but-present prompts proposed too, the rule needs a band, for example visibility within ±2 points.
  2. What "out of scope" means. Only the person decides. The skill pauses for scope only the prompts the person, or the agent's instructions, name as out of scope. Anything that merely looks off-topic goes under "Worth a look" with no card. A topic-match rule could come later if the owner wants the agent to propose those.
  3. Search Console queries. They come from the new get_gsc_queries, plus the Search Console suggestions already in list_prompt_suggestions. The skill matches queries to tracked prompts by meaning; there's no fuzzy matching in code.
  4. Mode. Ask me first, so Full auto never adds or pauses prompts. If the owner prefers Auto, an Admin's Always on "Track prompts" or "Pause tracking" would run those changes without a card.
  5. Topics. The skill doesn't add topics, although add_topic exists. When a candidate has no fitting topic, the skill names it for the person.

Related issue

None (AGENTS plan §3 #10, §7 step 3; CHAT-13 skills; W2-06 tools).

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. With the new Chat on, as an Admin or Manager, type / in Chat. /prompts · Prompt portfolio is in the Skills group.
    • Send "/prompts Which prompts should we add, and which should we pause?".
    • The steps show the reads, including Read Search Console queries when Search Console is connected.
    • The answer has To add / To pause / Worth a look tables, and each addition or pause is a card.
    • Approve one: the prompt is added or paused, and Activity shows it with Undo.
  2. On a brand without Search Console, the answer says Search Console isn't connected and works from suggestions and fan-outs.
  3. In Agent Center › Ready to use, Prompt Portfolio Manager is ready, tenth in the list:
    • it shows /prompts, Ask me first and "Every Mon 09:00";
    • it's marked For your role for people in the AEO/GEO & Audit work area;
    • Use this agent opens New agent with Search Console as Optional.
  4. Tests: cd web && npx vitest run 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/scope.test.ts 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=prompt-portfolio SKILL_EVAL=prompts yarn vitest run src/lib/chat/agent-eval.test.ts.

Checklist

Checks were run locally with CI's commands on the pushed merge commit f2cbb85, 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,611 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
…d Prompt Portfolio Manager is ready to use (AGENTS #10)

The new library skill /prompts (Prompt portfolio) proposes prompts to
track, from the brand's prompt suggestions, untracked fan-out sub-questions
and its Search Console queries, and prompts to pause: tracked 8 weeks or
more, the brand neither named nor cited in the last two 28-day periods, and
little or unknown demand. Out of scope is only what the person says. Every
addition and pause goes through add_prompts / pause_prompts, each a card,
with Undo in Activity. A person calls it in Chat with /prompts; the Prompt
Portfolio Manager agent runs it every Monday in Ask me first, so no prompt
is ever added or paused without a click, and is now ready to use.

A new read, get_gsc_queries, lists Search Console queries with clicks,
impressions and position against the span before, summed by ae_gsc_queries
(00091) once the brand is the caller's. /prompts uses Search Console as an
Optional connection. The prompts_skill need is gone, Seasonal Prompt
Planner's included (it still waits for its seasonal skill).

Help: skills.md (twenty-two skills, the full list) and agents.md (a Prompt
Portfolio Manager 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
Stacks this branch on feature/fanout-skill (AGENTS #9), which already has
upstream/main with Onboarding & Help (ansvisor#2136). Conflicts kept all three:
/setup, /fanout, then /prompts in SKILL_ORDER and everywhere the library
is listed (24 skills); Fan-out Gap Filler, Prompt Portfolio Manager and
Onboarding & Help ready (21 ready presets, 18 Soon); both new reads' row
limits in scope.ts. Every need the three skills waited for is gone from
PRESET_NEEDS and en.json. Help: Prompt portfolio gets its own section in
skills.md, after Fan-out gaps; agents.md has the three agents' sections.

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

@cihan-gyk
cihan-gyk dismissed gkhngyk’s stale review November 5, 2026 18:49

The merge-base changed after approval.

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.

@cihan-gyk
cihan-gyk dismissed gkhngyk’s stale review November 5, 2026 18:57

The merge-base changed after approval.

@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 5d1a1e6 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