smart-sourcing
Scannednpx machina-cli add skill athola/claude-night-market/smart-sourcing --openclawSmart Sourcing
Intelligent sourcing that requires citations only when the cost is justified by the value of verification.
Philosophy
Full sourcing is prohibitively expensive (10-16x token increase). Smart sourcing targets high-value claims where verification materially improves accuracy.
When to Source
REQUIRE Sources
| Claim Type | Example | Why Source |
|---|---|---|
| Version numbers | "Python 3.12 added..." | Versions change, easy to verify |
| Performance claims | "30% faster than..." | Quantitative claims need evidence |
| Security recommendations | "Use bcrypt for..." | Security advice must be current |
| API specifications | "The function accepts..." | APIs change between versions |
| Release dates | "Released in Q4 2025" | Factual, verifiable |
| Pricing/limits | "Free tier allows 1000 requests" | Business terms change |
| Deprecated features | "X was removed in version Y" | Breaking changes need verification |
DO NOT Require Sources
| Claim Type | Example | Why No Source |
|---|---|---|
| General concepts | "Async improves concurrency" | Foundational knowledge |
| Code examples | Demonstrative snippets | Illustrative, not factual claims |
| Opinion/preference | "Consider using..." | Clearly framed as suggestion |
| Common knowledge | "Git tracks changes" | Universal understanding |
| Logical derivations | "Therefore, X implies Y" | Reasoning, not factual claim |
| Syntax | "Use def for functions" | Language documentation is stable |
Decision Framework
Is this a factual claim?
├── No → No source needed
└── Yes → Would being wrong cause harm?
├── No (minor inconvenience) → No source needed
└── Yes → Is verification cost-effective?
├── No (>5k tokens for low-value claim) → State uncertainty
└── Yes → Perform web search, cite source
Implementation
Inline Citations
When sourcing is warranted:
Python 3.12 introduced `type` statement for type aliases[1].
Sources:
1. [PEP 695](https://peps.python.org/pep-0695/)
Uncertainty Markers
When sourcing isn't cost-effective but uncertainty exists:
Python 3.12 introduced the `type` statement (verify in release notes for your version).
Confidence Levels
| Confidence | Action |
|---|---|
| High (stable facts) | State directly |
| Medium (may have changed) | Add verification note |
| Low (uncertain) | Source or acknowledge uncertainty |
Token Cost Analysis
| Approach | Token Cost | Use Case |
|---|---|---|
| No sourcing | Baseline | General knowledge |
| Uncertainty marker | +5-10 tokens | Medium confidence |
| Single source | +2-5k tokens | High-value claim |
| Multiple sources | +10-20k tokens | Research tasks |
Examples
Good: Source Version-Specific Claim
User: What's new in FastAPI 0.109?
Response: FastAPI 0.109 added Pydantic v2 support as default[1] and
improved OpenAPI schema generation[2].
Sources:
1. [FastAPI Release Notes](https://fastapi.tiangolo.com/release-notes/)
2. [GitHub Release 0.109.0](https://github.com/tiangolo/fastapi/releases/tag/0.109.0)
Good: No Source for General Concept
User: How does async/await work?
Response: Async/await enables non-blocking I/O by allowing coroutines
to yield control while waiting for operations. The event loop manages
execution, resuming coroutines when their awaited operations complete.
Good: Uncertainty Marker
The connection pool default is typically 10 connections (verify in your
database driver documentation as this varies by library and version).
Integration
Works with:
conserve:response-compression- Keeps sourced responses conciseconserve:token-conservation- Weighs source cost vs valuememory-palace:research- Full sourcing for knowledge corpus
When To Use Full Sourcing
When NOT To Use
- Internal project code that doesn't need citations
- Casual conversation without factual claims
Escalate to full sourcing (accept high token cost) for:
- Knowledge corpus entries (permanent documentation)
- Security advisories (safety-critical)
- Compliance/legal claims (audit requirements)
- Research tasks (user expects thorough investigation)
For these cases, use memory-palace:research workflow which is designed for comprehensive sourcing.
Source
git clone https://github.com/athola/claude-night-market/blob/master/plugins/conserve/skills/smart-sourcing/SKILL.mdView on GitHub Overview
Smart sourcing is an optimization approach that balances accuracy with token efficiency by limiting full sourcing to high-value claims. It avoids the large token costs of blanket sourcing and uses a decision framework, inline citations, and uncertainty markers to maintain reliability where it matters most.
How This Skill Works
The skill applies a cost-benefit decision framework to each factual claim: if verification is necessary and cost-effective, it adds inline sources; if not, it may use uncertainty markers or no citation. It emphasizes token-cost awareness and provides structured guidance for inline citations, uncertainty markers, and confidence levels to ensure verifiable accuracy without unnecessary token waste.
When to Use It
- Version numbers and other verifiable factual updates (e.g., 'Python 3.12 added...').
- Performance claims (e.g., '30% faster than...').
- Security recommendations (e.g., 'Use bcrypt for...').
- API specifications (e.g., 'The function accepts...').
- Release dates, pricing/limits, or deprecated features (factual, verifiable terms).
Quick Start
- Step 1: For each factual claim, ask if verification is high-value and cost-effective.
- Step 2: If high-value, attach inline citations with sources; if uncertain, add an uncertainty marker.
- Step 3: Avoid full sourcing for general concepts; track token costs and adjust as needed.
Best Practices
- Identify high-value claims first using the decision framework, prioritizing those that impact correctness or security.
- Use inline citations for high-value, verifiable claims and provide clear source references.
- Apply uncertainty markers when verification is costly or risky, without delaying useful information.
- Monitor token costs and prefer no sourcing for general concepts or illustrative code.
- Document sources and verification notes transparently when used.
Example Use Cases
- Source a version-specific claim with sources (e.g., 'FastAPI 0.109 added Pydantic v2 support' with release notes).
- No source for a general concept like 'Async/await enables non-blocking I/O' (illustrative).
- Use an uncertainty marker when the detail varies by version (e.g., 'connection pool default is typically 10 connections—verify in your driver docs').
- Provide inline citations for API specifications or release notes (e.g., 'The function accepts X' [1], [2]).
- State uncertainty with a note if verification would be costly or uncertain (e.g., 'verify in official docs for your version').
Frequently Asked Questions
Related Skills
sql-optimization
chaterm/terminal-skills
SQL 优化与调优
tuning
chaterm/terminal-skills
--- name: tuning description: 系统调优 version: 1.0.0 author: terminal-skills tags: [performance, tuning, sysctl, kernel, optimization] --- # 系统调优 ## 概述 内核参数、文件系统、网络优化技能。 ## 内核参数调优 ### 内存管理 ```bash # /etc/sysctl.d/99-memory.conf # 减少交换倾向 vm.swappiness = 10 # 脏页刷新 vm.dirty_ratio = 20 vm.dirty_backg
claude-md-optimizer
smith-horn/product-builder-starter
Optimize oversized CLAUDE.md files using progressive disclosure. Analyzes content tiers, detects encryption constraints, creates sub-documents, and rewrites the main file with a Sub-Documentation Table. Triggers: optimize CLAUDE.md, reduce CLAUDE.md size, CLAUDE.md too long, apply progressive disclosure to CLAUDE.md
performance-optimization
JanSzewczyk/claude-plugins
Performance optimization patterns for Next.js applications. Covers bundle analysis, React rendering optimization, database query optimization, Core Web Vitals, image optimization, and caching strategies.
response-compression
athola/claude-night-market
hype, and unnecessary framing. Includes termination and directness guidelines.
Neon Egress Optimizer
openclaw/skills
Audit and optimize database queries to minimize egress (outbound data transfer) costs on Neon Postgres and other cloud databases. Use this skill whenever the user mentions high database costs, Neon billing, egress charges, slow queries, database optimization, query performance, SELECT *, overfetching, N+1 queries, caching database results, or wants to reduce data transfer from their database — even if they don't specifically say 'egress'.