跳到正文
cccskills
免费在 GitHub 公开

context-grounding

Forces Claude to extract exact quotes from files before making claims about them. Prevents hallucinations by grounding every statement in actual text from the codebase. Use when working with large files or unfamiliar code.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md2.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Context Grounding

Read first. Quote second. Claim third. Never skip a step.

The grounding technique

Before making any claim about code, follow this sequence:

Step 1: Read the source

Read the actual file. Don't work from memory.

Step 2: Extract the relevant quote

Pull the exact text that supports your claim. Include line numbers.

Step 3: Make your claim based on the quote

Now state what you believe, citing the quote as evidence.

Example

Wrong approach: "The auth middleware checks for JWT tokens and returns 401 if invalid." (No evidence. Could be hallucinated.)

Grounded approach: "Reading src/middleware/auth.ts:15-25, the middleware does:

const token = req.headers.authorization?.split(' ')[1];
if (!token) return res.status(401).json({ error: 'No token provided' });

So it extracts the Bearer token from the Authorization header and returns 401 if missing."

When to ground

Always ground when:

  • Answering questions about specific code behavior
  • Writing code reviews or change proposals
  • Explaining how something works
  • Describing bug causes
  • Making security assessments

Grounding for long documents

For files over 100 lines:

  1. Read the full file first to understand structure
  2. Identify the specific section relevant to the question
  3. Re-read that section carefully
  4. Extract the key lines as quotes
  5. Build your answer from those quotes

For files over 500 lines:

  1. Use Grep to find the relevant section
  2. Read just that section (use offset and limit)
  3. Extract quotes from what you read
  4. If you need more context, read surrounding sections
  5. Never make claims about sections you haven't read

The grounding test

Before sending a response, test each factual statement: "Could someone verify this by reading the file I'm referencing?"

If yes: the statement is grounded. If no: you need to add the file reference and relevant quote. If you don't have a file to reference: either find one or mark as unverified.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Complete methodology for preventing AI hallucinations. Use when accuracy is critical and you need Claude to verify before claiming, cite before asserting, and admit uncertainty instead of guessing.

中文简介正在准备中。当前显示原文说明。

a-ariff/ariff-claude-plugins142026年3月29日 更新

Transform rough ideas into solid designs through structured questioning

中文简介正在准备中。当前显示原文说明。

a-ariff/ariff-claude-plugins142026年3月29日 更新

Canvas API Connection Skill

中文简介正在准备中。当前显示原文说明。

a-ariff/ariff-claude-plugins142026年3月29日 更新

Forces every code-related claim to include file:line citations. No citation means the claim must be verified or removed. Use when building documentation, writing code reviews, or any output that others will rely on.

中文简介正在准备中。当前显示原文说明。

a-ariff/ariff-claude-plugins142026年3月29日 更新

Assign confidence scores (0-100) to every claim in a response. Helps users understand which parts are verified facts and which are educated guesses. Use when the user needs to know how much to trust each part of the answer.

中文简介正在准备中。当前显示原文说明。

a-ariff/ariff-claude-plugins142026年3月29日 更新

Verify every claim from multiple independent angles -- code, docs, tests, git history. Use when you need high confidence that something is correct before acting on it.

中文简介正在准备中。当前显示原文说明。

a-ariff/ariff-claude-plugins142026年3月29日 更新

查看 a-ariff 的全部技能

报告此技能的问题