Token导航 LogoToken导航TokenDH.com
研究检索需要联网clawhub未标认证来源可访问clear审计通过

chain-of-density密度链

Agent Skill

chain-of-density 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

50,250

周安装

2,073

GitHub Stars

1

下载量

16,418
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:chain-of-density(密度链)
来源仓库:https://github.com/killerapp/chain-of-density
安装命令:
openclaw skills install chain-of-density
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

ClawHubOpenClaw
openclaw skills install chain-of-density

简介

使用密度链技术迭代地致密文本摘要。在压缩冗长的文档、压缩需求或在保留信息密度的同时创建执行摘要时使用。

SKILL.md

name
chain-of-density
description
Iteratively densify text summaries using Chain-of-Density technique. Use when compressing verbose documentation, condensing requirements, or creating executive summaries while preserving information density.
license
Apache-2.0
compatibility
Python 3.10+ (for text_metrics.py script via uv run)
metadata
author
agentic-insights
version
1.2
paper
From Sparse to Dense: GPT-4 Summarization with Chain of Density Prompting
arxiv
https://arxiv.org/abs/2309.04269

Chain-of-Density Summarization

Compress text through iterative entity injection following the CoD paper methodology. Each pass identifies missing entities from the source and incorporates them while maintaining identical length.

The Method

Chain-of-Density works through multiple iterations:

  1. Iteration 1: Create sparse, verbose base summary (4-5 sentences at target_words)
  2. Subsequent iterations: Each iteration:

- Identify 1-3 missing entities from SOURCE (not summary) - Rewrite summary to include them - Maintain IDENTICAL word count through compression

Key principle: Never drop entities - only add and compress.

Missing Entity Criteria

Each entity added must meet ALL 5 criteria:

CriterionDescription
RelevantTo the main story/topic
SpecificDescriptive yet concise (≤5 words)
NovelNot in the previous summary
FaithfulPresent in the source (no hallucination)
AnywhereCan be from anywhere in the source

Quick Start

  1. User provides text to summarize
  2. Orchestrate 5 iterations via cod-iteration agent
  3. Each iteration reports entities added via Missing_Entities: line
  4. Return final summary + entity accumulation history

Orchestration Pattern

Iteration 1: Sparse base (target_words, verbose filler)
     ↓ Missing_Entities: (none - establishing base)
Iteration 2: +3 entities, compress filler
     ↓ Missing_Entities: "entity1"; "entity2"; "entity3"
Iteration 3: +3 entities, compress more
     ↓ Missing_Entities: "entity4"; "entity5"; "entity6"
Iteration 4: +2 entities, tighten
     ↓ Missing_Entities: "entity7"; "entity8"
Iteration 5: +1-2 entities, final density
     ↓ Missing_Entities: "entity9"
Final dense summary (same word count, 9+ entities)

How to Orchestrate

Iteration 1 - Pass source text only:

Task(subagent_type="cod-iteration", prompt="""
iteration: 1
target_words: 80
text: [SOURCE TEXT HERE]
""")

Iterations 2-5 - Pass BOTH previous summary AND source:

Task(subagent_type="cod-iteration", prompt="""
iteration: 2
target_words: 80
text: [PREVIOUS SUMMARY HERE]
source: [ORIGINAL SOURCE TEXT HERE]
""")

Critical:

  • Invoke serially, not parallel
  • Pass SOURCE text in every iteration for entity discovery
  • Parse Missing_Entities: line to track entity accumulation

Expected Agent Output Format

The cod-iteration agent returns:

Missing_Entities: "entity1"; "entity2"; "entity3"

Denser_Summary:
[The densified summary - identical word count to previous]

Parse both parts - track entities for history, pass summary to next iteration.

Measuring Density

Use scripts/text_metrics.py for deterministic word counts:

echo "your summary text" | uv run scripts/text_metrics.py words
# Returns: word count

uv run scripts/text_metrics.py metrics "your summary text"
# Returns: {"words": N, "chars": N, "bytes": N}

Parameters

ParameterDefaultDescription
iterations5Number of density passes (paper uses 5)
target_words80Word count maintained across ALL iterations
return_historyfalseInclude intermediate summaries + entities

Note: target_words can be adjusted based on source length and desired output density.

Output Format

Minimal (default)

[Final dense summary text]

With History (return_history=true)

final_summary: |
  [Dense summary at target_words with accumulated entities]
iterations:
  - turn: 1
    missing_entities: "(none - establishing base)"
    words: 80
    summary: |
      [Sparse iteration 1]
  - turn: 2
    missing_entities: "entity1; entity2; entity3"
    words: 80
    summary: |
      [Denser iteration 2]
  # ... etc
total_entities: 9

When to Use

  • Verbose documentation exceeding 500 words
  • Requirements documents needing condensation
  • Creating executive summaries from detailed reports
  • Compressing skills that exceed recommended length

When NOT to Use

  • Legal/compliance text (precision required)
  • Tutorial content (beginners need explanation)
  • Already concise content (<300 words)
  • Specifications (don't compress specs)

Example

Source (180 words, verbose skill excerpt):

The name field is a required field that must be present in every skill.
The name field identifies the skill and must follow a specific format.
For the name field, you should use lowercase letters and hyphens only.
The name field can be 1 to 64 characters long. The description field
is also required and tells agents when to use your skill...

Iteration 1 (Sparse, 80 words):

Missing_Entities: (none - establishing base)

Denser_Summary:
This document discusses the requirements for skill configuration fields in agent systems. It covers various aspects of how fields should be formatted and what values they can contain. The document also mentions validation rules that apply to these fields and provides guidance on best practices for developers. Additionally, it includes information about both optional and required elements that need to be considered when creating new skills for the system.

Iteration 3 (After 2 passes, same 80 words):

Missing_Entities: "1-64 characters"; "lowercase alphanumeric-hyphens"; "Use when phrase"

Denser_Summary:
Skills require `name` (1-64 chars, lowercase alphanumeric-hyphens) and `description` fields with validation rules. The name identifies skills; descriptions tell agents when to invoke using "Use when..." phrases. Both fields have format constraints and best practices. Optional metadata fields provide author, version, and compatibility information for cross-platform agent discovery.

Final Iteration 5 (Same 80 words, maximum density):

Missing_Entities: "Claude Code"; "Cursor"; "GitHub Copilot"

Denser_Summary:
Required: `name` (1-64 chars, ^[a-z0-9]+(-[a-z0-9]+)*$) and `description` (1-1024 chars) with validation. Description includes "Use when..." + discovery keywords for auto-invocation. Optional: license (SPDX), compatibility, metadata (author, version, tags). Cross-platform: Claude Code, Cursor, GitHub Copilot. Name matches directory. Progressive disclosure via references/, assets/, scripts/ subdirectories.

Architecture Note

This skill implements the CoD paper methodology:

  • Skill = orchestrator (this file)
  • Agent = stateless worker (cod-iteration)
  • Script = deterministic utility (text_metrics.py)

Sub-agents cannot call other sub-agents. Only skills orchestrate via Task tool.

References

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

OpenClaw

85.08%
按下载量换算13,968

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

未展示

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills