Citation System logo

Citation System

Community
kangarooking
citation-system

当系统提示需要设计引用格式、信息溯源机制、来源标注系统时调用。适用于文档问答、搜索增强生成(RAG)、代码引用、浏览器辅助等需要让用户追溯信息来源的场景。不适用于纯创作类输出(如故事、诗歌),不适用于无需溯源的常识问答,也不适用于注入防御(虽然两者都涉及内容可信度)。

Overview

Publisherkangarooking
Repositorysystem-prompt-skills
Skill namecitation-system
Stars
213
Forks
45
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by kangarooking on GitHub. Read the source before you install it.

Installation

Install the Citation System AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/kangarooking/system-prompt-skills/tree/main/citation-system
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/kangarooking/system-prompt-skills.git /tmp/system-prompt-skills
mkdir -p .claude/skills
cp -r /tmp/system-prompt-skills/citation-system .claude/skills/citation-system
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Citation System in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Citation System on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Citation System is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

引用与归属系统设计

R — 原文 (Reading)

各厂商采用多样化的内联引用格式:Claude Web 使用 Markdown 锚点链接([text](<citation:comment:{id}>)),GPT-4o 文件搜索采用 【msg_idx:search_idx†source】,NotebookLM 实现逐句引用加段落索引 [i],Warp 使用 XML 结构 <citations><document>,Meta AI 实现实体标签 【entity_hint-...】。核心模式:内联标记、引用保留规则、来源可审计响应。

I — 方法论骨架 (Interpretation)

  1. 内联标记格式:在生成文本中直接嵌入来源标记,用户无需滚动至文末即可定位引用源。
  2. 格式一致性:整个系统提示中严格使用一种引用格式,不混用多种标记语法。
  3. 引用保留规则:在改写、总结、翻译等二次处理中,原始引用标记必须完整保留,不得丢失或篡改。
  4. 来源可审计性:每个事实性声明都必须有可追溯的引用,外部信息(非系统知识库)必须显式标注。
  5. 实体引用系统:除文档引用外,可扩展支持人物、地点、组织等实体的标记与链接。
  6. 日期消歧:对相对时间表达("昨天"、"上周")进行绝对日期解析,消除歧义。

A1 — 案例分析 (Past Application)

案例: GPT-4o 文件搜索的强制引用机制

  • 问题: 用户上传多份文档后提问,模型可能编造不存在于文档中的内容,或混淆内容来源。
  • 设计模式的使用: GPT-4o 要求所有基于文档的回答必须包含 【msg_idx:search_idx†source】 格式引用。引用不是可选装饰,而是强制性输出组成部分。未找到引用时不得声称信息来源于文档。
  • 结论: 将引用从"建议行为"升级为"强制约束",显著降低了文档问答中的幻觉率。

案例: Warp 的 XML 结构化引用

  • 问题: 终端命令辅助场景中,用户需要精确知道命令参数的文档来源,但传统脚注格式在终端中可读性差。
  • 设计模式的使用: Warp 采用 XML 结构 <citations><document> 元素,将引用与工具名隔离——引用指向文档本身而非工具调用过程,避免暴露内部实现。
  • 结论: 引用系统的设计应适配输出媒介特性,且引用目标应指向信息源而非系统内部过程。

A2 — 触发场景 (Future Trigger) ★

用户在什么情境下需要?

  1. 构建文档问答系统,需要让用户验证每个答案的来源
  2. 设计搜索增强生成(RAG)系统提示,需要强制引用检索结果
  3. 开发代码辅助工具,需要将建议关联到代码库中的具体位置
  4. 实现多源信息整合系统,需要区分不同来源的贡献

语言信号

  • "需要标注信息来源"
  • "用户应该能追溯每个结论的出处"
  • "如何防止模型编造引用"
  • "引用格式应该怎么设计"
  • "需要保留原始引用标记"

与相邻 skill 的区分

  • 与 injection-defense 区别:注入防御关注内容是否可信/可执行,引用系统关注内容来自哪里、如何标注
  • 与 mobile-adaptation 区别:移动适配关注引用在狭小屏幕上的展示优化,引用系统关注引用的格式与保留规则

E — 可执行步骤 (Execution)

  1. 步骤 1:定义引用标记语法 - 完成标准:选择一种内联标记格式(方括号标注如 【source†Lline】、Markdown 锚点、或 XML 元素),明确定义每个字段含义(消息索引、搜索索引、行号范围),并编写格式示例。
  2. 步骤 2:编写强制引用规则 - 完成标准:在系统提示中声明"所有基于外部来源的事实性声明必须附带引用",定义无引用时的回退行为(明确声明无法确认来源),禁止编造不存在的引用。
  3. 步骤 3:设计引用保留策略 - 完成标准:规定在改写、总结、翻译等二次处理场景中,原始引用标记的保留方式——直接保留原文标记、或重新映射到新上下文位置,确保引用链不中断。
  4. 步骤 4:实现外部信息标记 - 完成标准:定义"外部信息"(非系统知识库中的信息)的显式标记方式,如 NotebookLM 要求外部信息必须标注"此信息不在提供的来源中"。
  5. 步骤 5:添加引用完整性校验 - 完成标准:在系统提示中设置自检规则——输出前验证所有引用标记格式正确、所有事实性声明均有引用、引用中的索引和行号在有效范围内。

B — 边界 (Boundary) ★

不要在以下情况使用

  • 纯创作类输出(故事、诗歌、创意写作),不需要事实溯源
  • 常识性问答,信息属于公共知识无需标注来源
  • 实时对话场景中引用会严重打断交流节奏的轻量交互
  • 系统内部日志或调试信息,面向开发者而非终端用户

常见失败模式

  • 编造引用:模型生成格式正确但指向不存在位置的引用标记,需要格式校验与来源存在性双重约束
  • 引用堆积:为每个句子都添加引用导致输出碎片化、可读性下降,应仅对事实性声明引用
  • 引用丢失:在多轮对话的总结、改写中原始引用被清除,需要明确的保留规则
  • 格式混用:同一系统中出现多种引用格式(如脚注与内联标记并存),增加解析复杂度

Frequently asked questions

What does the Citation System AI skill do?

当系统提示需要设计引用格式、信息溯源机制、来源标注系统时调用。适用于文档问答、搜索增强生成(RAG)、代码引用、浏览器辅助等需要让用户追溯信息来源的场景。不适用于纯创作类输出(如故事、诗歌),不适用于无需溯源的常识问答,也不适用于注入防御(虽然两者都涉及内容可信度)。

Why use Citation System on TypingMind?

Because you install it once and use it with any model. Citation System is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Citation System in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/kangarooking/system-prompt-skills/tree/main/citation-system. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Citation System?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Citation System?

As many as you like. As long as a model supports skills, you can use Citation System with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Citation System AI skill free?

Yes. It is published on GitHub by kangarooking under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇