DocsbookDocsbook
← Back to catalog
automationprorequires Docsbook MCP

docs-tune-ai-chat

Tunes the AI chat system prompt for a Docsbook workspace by analyzing negative feedback and unanswered AI questions from the last 30 days, clustering them by topic, and proposing an improved system_prompt. Requires user confirmation before applying changes.

Local install
npx docs-skills install
Try in MCP
@docsbook find_skill "docs-tune-ai-chat"

docs-tune-ai-chat — Tune AI Chat System Prompt from Real Feedback

What this skill does#

Analyzes 30 days of AI chat negative feedback and unanswered questions for a Docsbook workspace, clusters them by topic, generates an improved system_prompt suggestion, and — after the user confirms the diff — writes it back via MCP.

Requirements#

Before starting#

  1. Ask the user for the workspace (GitHub repo URL or {user}/{repo}).
  2. Verify the workspace exists and is on PRO/PRO+. If on Free — stop and tell the user to upgrade.
  3. Confirm the user wants to change the system prompt (this is a write operation).

Steps#

1. Pull negative feedback (30 days)#

Call mcp__docsbook__get_negative_feedback with:

Each item should include: the user question, the AI answer, the page context, and (where available) the user's free-text reason for the thumbs-down.

If the result is empty → skip to step 2; if step 2 is also empty → stop and tell the user there's nothing to tune yet.

2. Pull unanswered AI questions (30 days)#

Call mcp__docsbook__get_ai_unanswered with:

These are questions where the AI explicitly said "I don't know" / "not in the docs" / refused, or where retrieval returned nothing useful.

3. Cluster by topic#

Group the combined items (negative + unanswered) into 3–8 topic clusters. Use one of:

For each cluster record: label, count, sample_questions (3 max), inferred_gap (one sentence — what does the current chat fail to do here?).

4. Generate a new system_prompt suggestion#

Fetch the current system_prompt from the workspace (via the workspace settings — mcp__docsbook__get_workspace or the AI settings tool used by the current MCP build).

Then produce a minimally invasive replacement that:

5. Show the diff to the user#

Render a clear before/after comparison:

--- current system_prompt
+++ proposed system_prompt
@@ ...

Below the diff, summarize why each chunk changed, mapping additions back to the clusters from step 3 (e.g. + pricing guidance — cluster "pricing/upgrades" (14 negative + 9 unanswered)).

Ask explicitly: "Apply this new system_prompt? (yes / no / edit)"

6. Apply on confirmation#

Only after explicit yes, call:

mcp__docsbook__set_chat_system_prompt with:

Then output:


Guardrails#

Output#

Final message to the user includes:

  1. Cluster summary (table: label, count, sample question).
  2. The before/after diff.
  3. Apply / skip decision and result.
  4. Suggested re-tune date (today + 3 weeks).
View source on GitHub →Browse full catalog repo →
Keywords
aichattuningfeedbacksystem-prompt
MCP tools used
get_negative_feedbackget_ai_unansweredset_chat_system_prompt