Skip to content

P0-21 Sector Briefing Prompt + /kb:sector-briefing

P0-21 Sector Briefing Prompt + /kb:sector-briefing

Section titled “P0-21 Sector Briefing Prompt + /kb:sector-briefing”

Status: DRAFT — 2026-04-21 (S180 WP1)

Source: DECISIONS §3.1 P0-21 row (AGREE — WP2.0 verdict SHIP).

Size: 2h spec + 4h impl (per SPEC-SEQUENCE line 263).

Ships alongside: P0-22 bid-pipeline-review (sequential plugin-bundle rebuild).


The /kb:briefing command + reorient prompt give a whole-account personalised briefing (urgent items + team activity + bid status). But users working in a specific sector/domain (e.g. compliance admin, audit content, tender drafting for social housing) have no domain-scoped equivalent. They have to manually assemble: recent KB activity for that domain, sector intelligence (SI feed articles), and change reports.

P0-21 ships an MCP prompt + plugin command that tells Claude how to assemble a domain-scoped briefing using existing tools (KB search, SI summary, change reports).

  1. Users can invoke /kb:sector-briefing <domain> from Claude Code/Desktop/claude.ai and receive a structured sector briefing for that domain.
  2. The prompt assembles four sources:
    • KB content for the domain (guides + articles + Q&A)
    • SI intelligence highlights for the domain (from recent feed polls)
    • Latest change report for the domain (additions + updates + removals in recent period)
    • Outstanding governance review items scoped to the domain
  3. The command handles both connector-available and standalone modes (fallback: ask user for domain context).
  4. Existing /kb:briefing + reorient remain untouched — this is additive.
  • No new MCP tools. This P0 composes existing tools + P1-35 get_change_report (ships same session in WP6 — coordinate).
  • No persona-specific output templates (those belong in P1-34 daily-briefing).
  • No custom UI. Prompt + command only.
  • No scheduled/cron delivery (H2).

Register in lib/mcp/resources.ts inside registerPrompts() (next call after review_item at line 915). Numbered #6 in the prompt set (2 shipping in this wave, so final count post-wave = 7).

Signature:

server.registerPrompt(
'sector_briefing',
{
title: 'Sector Briefing',
description:
'Get a domain-scoped briefing covering KB content, sector intelligence, and recent change reports.',
argsSchema: {
domain: z.string().describe('Domain key (e.g. "audit-content", "social-housing-compliance") to scope the briefing'),
period_days: z.string().optional().describe('Optional: look-back window for change reports. Default 7.'),
},
},
async (args) => ({ messages: [{ role: 'user', content: { type: 'text', text: /* see §3.2 */ } }] }),
);

Argument type note. argsSchema values are ZodString not ZodNumber because MCP prompt args serialise to strings over the wire — matches existing bid_briefing / draft_response / review_item patterns. period_days stays a string; the prompt body instructs Claude to parse it as integer and default 7 on missing.

{KB_SYSTEM_CONTEXT}
Assemble a sector briefing for the domain "{args.domain}" covering the last {args.period_days ?? 7} days.
Use these tools in sequence and compose a single structured briefing:
1. **Domain content inventory.**
- `list_guides(guide_type: undefined, domain_filter: "{args.domain}", published_only: true)` — guide catalogue for the domain (the tool's first positional arg is `guide_type` — pass `undefined` to skip type filtering).
- `search_knowledge_base(query: "{args.domain}", domain: "{args.domain}", limit: 10)` — recent / high-relevance items.
- `search_qa_library(query: "{args.domain}", limit: 5)` — Q&A pairs.
2. **Sector intelligence.**
- `get_intelligence_summary(period: "{args.period_days ?? 7}d", limit: 15)` — recent SI feed highlights. Filter results to entries touching the domain (by matching the domain key or its synonyms against article tags / summary text).
3. **Change report.**
- `get_change_report(period_days: {args.period_days ?? 7}, domain: "{args.domain}")` — structured additions / updates / removals for the domain. If the tool is unavailable (WP6 not yet merged), note "Change report tool not yet available" and continue.
4. **Outstanding governance items.**
- `get_governance_queue(limit: 10, domain: "{args.domain}")` — pending governance reviews for the domain. If the tool is unavailable (WP3 not yet merged), note "Governance queue tool not yet available" and continue.
Structure the briefing as:
## Sector briefing — {args.domain} — [DD/MM/YYYY]
### At a glance
- Content count: [N] guides, [M] items, [K] Q&A pairs
- Change activity ({period_days} days): [N added / N updated / N removed]
- Pending governance review: [N items]
- SI signals: [N relevant feed articles]
### What changed
[Narrative summary of change report, grouped by content_type]
### Sector intelligence
[Top 3-5 SI highlights relevant to the domain with source links]
### Governance queue
[Pending items with due dates]
### Recommendations
[Prioritised 2-4 actions]
Use UK English. DD/MM/YYYY dates. If any tool returns empty, note the gap explicitly (e.g. "No SI feeds currently cover this domain — consider seeding a starter pack.").

(System context string KB_SYSTEM_CONTEXT already defined at resources.ts:805.)

New file: .claude/plugins/knowledge-hub/1.0.0/commands/sector-briefing.md.

Follow the shape of briefing.md + bid-status.md:

Frontmatter:

---
description:
Get a domain-scoped briefing covering KB content, sector intelligence, and
recent change reports
argument-hint: '<domain>'
---

Body (compressed): STANDALONE / SUPERCHARGED banner; domain arg-parsing (no arg → ask user which domain); connector-available → invoke the sector_briefing MCP prompt via the host; no-connector → ask user to paste domain context + recent activity and compose manually. Mirror the shape of briefing.md sections: Arguments / Usage / Instructions / Tips. Reference the @content-governance skill for freshness framing + @search-strategy for KB querying.

Run bun run build:plugin after command file added. Commit the regenerated lib/mcp/plugin-bundle.ts.

The prompt references get_change_report which does not exist at prompt registration time. It ships this same session via WP6 (P1-35 subagent-driven). Merge order: WP6 branches from main, WP1 branches from main, both land sequentially. If get_change_report has not landed when sector_briefing is invoked, Claude receives “tool not found” on that step and skips it (the other 3 data sources still produce useful output). No fallback code needed in the prompt.

ACCriterion
AC-1sector_briefing prompt registered in lib/mcp/resources.ts inside registerPrompts(); MCP inventory shows 6 prompts post-WP1 (7 post-WP2).
AC-2Prompt accepts domain (required) + period_days (optional) args per §3.1.
AC-3Prompt body references all 4 data sources in §3.2 and produces output in the specified structure.
AC-4/kb:sector-briefing command file at .claude/plugins/knowledge-hub/1.0.0/commands/sector-briefing.md with shape matching briefing.md conventions.
AC-5Plugin bundle (lib/mcp/plugin-bundle.ts) regenerated via bun run build:plugin and committed.
AC-6MCP inventory regenerated (bun run generate:mcp-inventory); docs/generated/mcp-inventory.md updated.
AC-7Unit test covers prompt registration + args schema + message body asserting all 4 tool name references are present (prevent drift if tools rename).
AC-8mcp-fixture-sync.test.ts updated with new prompt name (canonical list in scripts/mcp-eval/fixtures.ts).
AC-9No change to existing reorient / bid_briefing / coverage_analysis / draft_response / review_item prompts.
AC-10bun run test green. bun lint green.

5. Implementation plan (for /planning-and-task-breakdown)

Section titled “5. Implementation plan (for /planning-and-task-breakdown)”
  1. File edits (3 files + 2 generated):
    • lib/mcp/resources.ts — add sector_briefing registration after review_item (~line 946).
    • .claude/plugins/knowledge-hub/1.0.0/commands/sector-briefing.md — new file.
    • scripts/mcp-eval/fixtures.ts — add 'sector_briefing' to prompt fixture list.
    • lib/mcp/plugin-bundle.ts — regenerated via bun run build:plugin.
    • docs/generated/mcp-inventory.md — regenerated via bun run generate:mcp-inventory.
  2. Tests (1 new file):
    • __tests__/mcp/sector-briefing-prompt.test.ts — mirrors review-item-prompt.test.ts. Assertions: registration present; args schema has domain required + period_days optional; message body contains list_guides, search_knowledge_base, search_qa_library, get_intelligence_summary, get_change_report, get_governance_queue tool-name references; uses KB_SYSTEM_CONTEXT.
  3. Commit order: resources.ts + command + fixture + test → build:plugingenerate:mcp-inventory → single commit.
  • New: __tests__/mcp/sector-briefing-prompt.test.ts — see §5.2.
  • Updated: mcp-fixture-sync.test.ts reruns and passes once fixtures include the new prompt.
  • Not required: E2E (MCP prompt invocation is exercised via Eval Layer 1 protocol tests; not adding Layer 3/4 for this prompt since it’s a simple tool-composition directive).
  • Additive only. No existing prompt / tool / resource renamed or removed.
  • Plugin bundle: callers of existing commands unaffected — sector-briefing.md is new.
  • MCP prompt registry: adding a prompt is non-breaking to existing clients.

None blocking. get_change_report dependency (§3.5) is a merge-order coordination, not a design question.

  • DECISIONS §3.1 P0-21 + §3.2 P1-34 (daily-briefing dep for consistency)
  • SPEC-SEQUENCE line 263
  • Existing prompts: lib/mcp/resources.ts:808-946
  • Existing commands: .claude/plugins/knowledge-hub/1.0.0/commands/briefing.md
  • Fixture: scripts/mcp-eval/fixtures.ts