Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计通过

content-retrieval内容检索

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

264

周安装

11

GitHub Stars

21

下载量

88
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:content-retrieval(内容检索)
来源仓库:https://github.com/thapaliyabikendra/ai-artifacts
仓库路径:skills/content-retrieval
安装命令:
npx skills add https://github.com/thapaliyabikendra/ai-artifacts --skill content-retrieval
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/thapaliyabikendra/ai-artifacts --skill content-retrieval

简介

高效检索项目内文档内容,避免全文读取,提升处理速度。

  • 支持按标题、行数与上下文精准定位所需信息。content-retrieval 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 适用于代码库、文档系统与知识库的查询场景。
  • 提供多级检索策略,从存在性检查到深度阅读全覆盖。
  • 显著降低信息获取延迟,优化 Agent 工作效率。

SKILL.md

Content Retrieval Protocol

Token-efficient retrieval system using markdown-native section detection.

Summary

Core Principle: Never read a full file when partial content suffices.

Choose retrieval depth by need:

  • Exists? → Grep (files_with_matches)
  • Count? → Grep (count)
  • Lookup? → Grep (-C:2)
  • Overview? → Read (limit:40)
  • Section? → Grep heading → Read (offset, limit)
  • Full? → Read (justify first)

Quick Reference

Depth Levels

LevelNeedMethodLines
L0Exists?Grep(output: files_with_matches)~1
L1Count?Grep(output: count)~1
L2Lookup valueGrep(pattern, -C:2)~5
L3OverviewRead(limit: 40)~40
L4SectionGrep heading → Read(offset, limit)~50
L5FullRead() - justify firstAll

Decision Tree

What do I need?
├─ Does X exist? ──────────► L0: Grep files_with_matches
├─ How many X? ────────────► L1: Grep count
├─ What is X's value? ─────► L2: Grep with context
├─ What does X do? ────────► L3: Read limit:40
├─ How to use X for Y? ────► L4: Section extraction
└─ Implement X fully? ─────► L5: Full read (target only)

Tool Selection

ScenarioToolParameters
Check skill existsGrepoutput: files_with_matches
Count matchesGrepoutput: count
Get specific rowGreppattern, -C: 0-2
Read frontmatterReadlimit: 25
Read frontmatter+summaryReadlimit: 40
Extract sectionReadoffset: N, limit: 50
Full understandingRead(no limit)

Section Extraction

How Sections Work (Markdown-Native)

Sections are defined by headings and horizontal rules:

## Section A
Content...

---                    ← Section A ends here (horizontal rule)

## Section B           ← Or section ends at next same-level heading
Content...

No custom markers needed. Standard markdown structure.

Extraction Algorithm

1. Grep("^## Section Name$", file)     → line 15
2. Grep("^---|^## ", file, offset: 16) → next break at line 30
3. Read(file, offset: 15, limit: 15)   → lines 15-30

Section End Detection

A section ends at the first of:

  1. --- (horizontal rule)
  2. ## (same-level heading)
  3. # (higher-level heading)
  4. EOF (end of file)

Examples

# Extract Summary section
Grep("^## Summary$", file) → line 20
Grep("^---|^## ", file, offset: 21) → line 28
Read(file, offset: 20, limit: 8)

# Extract Quick Reference section
Grep("^## Quick Reference$", file) → line 30
Grep("^---|^## ", file, offset: 31) → line 55
Read(file, offset: 30, limit: 25)

Retrieval Protocol

Rule 1: Start at Lowest Depth

WRONG: Read entire SKILL-INDEX.md to find one skill
RIGHT: Grep("skill-name", SKILL-INDEX.md, -C:1)

WRONG: Read 5 skill files to understand what they do
RIGHT: Read each with limit:40 (frontmatter + summary)

WRONG: Read entire agent file to check if it has a skill
RIGHT: Grep("skills:.*skill-name", agent.md)

Rule 2: Index First, Files Second

1. Check index file (SKILL-INDEX.md, AGENT-INDEX.md)
2. Extract needed info via grep
3. Only read source file if index insufficient

Rule 3: Frontmatter Contains Metadata

All files have metadata in first 20 lines:

---
name: identifier
description: "one-line summary"
layer: 1-4
keywords: [searchable, terms]
---

To get metadata: Read(file, limit: 20)

Rule 4: Headings Define Sections

Standard markdown headings define extractable sections:

## Summary          ← Grep target
Brief description.

---

## Quick Reference  ← Grep target
| Col | Col |

To extract section: Grep heading → find end → Read range

Rule 5: Full Read Only for Targets

Full read justified when:

  • File is the TARGET being modified/implemented
  • L3 read confirmed full content needed
  • Creating comprehensive documentation
  • Debugging requires full context

QMD File Structure

Standard Layout

---
name: identifier
description: "One-line (< 100 chars)"
layer: 1-4
keywords: [grep, targets]
---

# Title

## Summary

2-3 sentences. Key purpose.

---

## Quick Reference

| Pattern | Usage |
|---------|-------|

---

## Patterns

### Pattern 1
Content...

### Pattern 2
Content...

---

## Related

- [link](path)

Reserved Headings

HeadingPurposeRequired
## SummaryQuick understanding (L3)Yes
## Quick ReferenceLookup tables (L2-L3)Yes
## PatternsImplementation detailsFor skills
## ScopeDoes/Does NOTFor agents
## RelatedCross-referencesRecommended

Frontmatter Schema

---
# Required
name: string           # Identifier (grep target)
description: string    # One-line (< 100 chars)
layer: number          # 1=foundation, 2=framework, 3=feature, 4=workflow

# Recommended
keywords: string[]     # Grep targets
depends_on: string[]   # Prerequisites
complements: string[]  # Often-used-with

# Optional
used_by: string[]      # Agents/commands using this
tech_stack: string[]   # Technologies
auto_apply: boolean    # Auto-trigger on match
---

Index File Format

Grep-Optimized Tables

## Master Index

| Name | L | Keywords | Path |
|------|---|----------|------|
| skill-a | 2 | key1,key2 | skills/skill-a/SKILL.md |
| skill-b | 1 | key3,key4 | skills/skill-b/SKILL.md |

---

## Lookup by Keyword

| Keyword | Skills |
|---------|--------|
| entity | abp-framework, abp-entity, domain-modeling |

Grep usage:

Grep("skill-a", INDEX.md, output: content, -C: 0)
→ | skill-a | 2 | key1,key2 | skills/skill-a/SKILL.md |

Examples

Example 1: Analyze Agent

Old approach (2,434 lines):

Read(AGENT-QUICK-REF.md)        → 127 lines
Read(abp-developer.md)          → 144 lines
Read(SKILL-INDEX.md)            → 337 lines
Read(3 skill files)             → 1,283 lines

Protocol approach (~265 lines):

Read(abp-developer.md)                    → 108 lines (target)
Grep("abp-developer", AGENT-INDEX.md)     → 1 line
Grep(skills from agent, SKILL-INDEX.md)   → 11 lines
Read(3 skills, limit:40 each)             → 120 lines

Savings: 89%

Example 2: Check Skill Exists

# L0: Just check existence
Grep("^name: xunit-testing", .claude/skills, output: files_with_matches)
→ .claude/skills/xunit-testing-patterns/SKILL.md

Example 3: Extract Section

# L4: Section extraction (markdown-native)
Grep("^## Quick Reference$", skill.md) → line 30
Grep("^---|^## ", skill.md, offset: 31) → line 55
Read(skill.md, offset: 30, limit: 25)
→ Just the Quick Reference section

Checklist

For File Authors

  • Frontmatter under 20 lines
  • description is one line, under 100 chars
  • keywords include grep targets
  • ## Summary section present (2-3 sentences)
  • ## Quick Reference has lookup tables
  • --- separators between major sections
  • No critical info buried deep

For Consumers

  • Check index before reading files
  • Use appropriate depth level (L0-L5)
  • Start with L0-L2, escalate if needed
  • Full read only for target files

Related

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.39%
按下载量换算31

Claude

28.34%
按下载量换算25

Cursor

18.15%
按下载量换算16

Gemini CLI

9.22%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills