一键导入
text-summarizer
Generate extractive summaries from long text documents. Control summary length, extract key sentences, and process multiple documents.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate extractive summaries from long text documents. Control summary length, extract key sentences, and process multiple documents.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guide for adding new AI provider documentation. Use when adding documentation for a new AI provider (like OpenAI, Anthropic, etc.), including usage docs, environment variables, Docker config, and image resources. Triggers on provider documentation tasks.
Analyzes, generates, and enhances CLAUDE.md files for any project type using best practices, modular architecture support, and tech stack customization. Use when setting up new projects, improving existing CLAUDE.md files, or establishing AI-assisted development standards.
Create, review, and iterate on Claude Code skills using Anthropic's official best practices and latest API documentation. Use when creating skills, reviewing existing skills, writing skill descriptions, designing skill architecture, or when user says "create a skill", "review my skill", "skill best practices", "skill description help". Do NOT use for creating plugins, commands, agents, or hooks - use plugin-dev skills for those.
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
Install a pre-commit hook that scans .specstory/history for secrets before commits. Run when user says "set up secret scanning", "install specstory guard", "protect my history", or "check for secrets".
Analyze your SpecStory AI coding sessions in .specstory/history for yak shaving - when your initial goal got derailed into rabbit holes. Run when user says "analyze my yak shaving", "check for rabbit holes", "how distracted was I", or "yak shave score".
| name | text-summarizer |
| description | Generate extractive summaries from long text documents. Control summary length, extract key sentences, and process multiple documents. |
Create concise summaries from long text documents using extractive summarization. Identifies and extracts the most important sentences while preserving meaning.
from scripts.text_summarizer import TextSummarizer
# Summarize text
summarizer = TextSummarizer()
summary = summarizer.summarize(long_text, ratio=0.2) # 20% of original
print(summary)
# Summarize file
summary = summarizer.summarize_file("article.txt", num_sentences=5)
summarizer = TextSummarizer(
method="textrank", # textrank, lsa, frequency
language="english"
)
# By ratio (20% of original length)
summary = summarizer.summarize(text, ratio=0.2)
# By sentence count
summary = summarizer.summarize(text, num_sentences=5)
# By word count
summary = summarizer.summarize(text, max_words=100)
# Get bullet points
points = summarizer.extract_key_points(text, num_points=5)
for point in points:
print(f"• {point}")
# Summarize multiple texts
texts = [text1, text2, text3]
summaries = summarizer.summarize_batch(texts, ratio=0.2)
# Summarize files in directory
summaries = summarizer.summarize_directory("./articles/", ratio=0.3)
# Preserve original sentence order
summary = summarizer.summarize(text, preserve_order=True)
# Include title/first sentence
summary = summarizer.summarize(text, include_first=True)
# Minimum sentence length filter
summarizer.min_sentence_length = 10
# Summarize text file
python text_summarizer.py --input article.txt --ratio 0.2
# Specific sentence count
python text_summarizer.py --input article.txt --sentences 5
# Extract key points
python text_summarizer.py --input article.txt --points 5
# Batch process
python text_summarizer.py --input-dir ./docs --output-dir ./summaries --ratio 0.3
# Output to file
python text_summarizer.py --input article.txt --output summary.txt --ratio 0.2
| Argument | Description | Default |
|---|---|---|
--input | Input file path | Required |
--output | Output file path | stdout |
--input-dir | Directory of files | - |
--output-dir | Output directory | - |
--ratio | Summary ratio (0.0-1.0) | 0.2 |
--sentences | Number of sentences | - |
--words | Maximum words | - |
--points | Extract N key points | - |
--method | Algorithm to use | textrank |
--preserve-order | Keep sentence order | False |
summarizer = TextSummarizer()
article = """
[Long news article text...]
"""
# Get a 3-sentence summary
summary = summarizer.summarize(article, num_sentences=3)
print("Summary:")
print(summary)
# Get key points
points = summarizer.extract_key_points(article, num_points=5)
print("\nKey Points:")
for i, point in enumerate(points, 1):
print(f"{i}. {point}")
summarizer = TextSummarizer(method="lsa")
paper = open("research_paper.txt").read()
# Create abstract-length summary
abstract = summarizer.summarize(paper, max_words=250)
print(abstract)
summarizer = TextSummarizer()
notes = """
Meeting started at 2pm. John presented Q3 results showing 15% growth.
Sarah raised concerns about supply chain delays affecting Q4 projections.
The team discussed mitigation strategies including dual-sourcing.
Budget allocation for marketing was approved at $50k.
Next steps include vendor outreach by Friday.
Follow-up meeting scheduled for next Tuesday.
"""
summary = summarizer.summarize(notes, num_sentences=3)
points = summarizer.extract_key_points(notes, num_points=4)
print("Summary:", summary)
print("\nAction Items:")
for point in points:
print(f"• {point}")
summarizer = TextSummarizer()
import os
for filename in os.listdir("./documents"):
if filename.endswith(".txt"):
text = open(f"./documents/{filename}").read()
summary = summarizer.summarize(text, ratio=0.2)
with open(f"./summaries/{filename}", "w") as f:
f.write(summary)
print(f"Summarized: {filename}")
| Algorithm | Speed | Quality | Best For |
|---|---|---|---|
| TextRank | Medium | High | General text |
| LSA | Fast | Good | Technical docs |
| Frequency | Fast | Medium | Quick summaries |
nltk>=3.8.0
numpy>=1.24.0
scikit-learn>=1.2.0