From spec-forge
Analyze a collection of documents to build a knowledge map, identify themes, find gaps, duplicates, conflicts, and staleness, then produce an organized analysis with improvement recommendations. Designed for document ecosystems (cross-repo docs, research collections, mixed-format doc repos) where the challenge is understanding the landscape, not auditing against code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/spec-forge:analyzeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Map, understand, and evaluate a collection of documents as a body of knowledge. Identify structure, themes, gaps, redundancies, conflicts, and staleness. Produce an actionable analysis with reorganization recommendations.
Map, understand, and evaluate a collection of documents as a body of knowledge. Identify structure, themes, gaps, redundancies, conflicts, and staleness. Produce an actionable analysis with reorganization recommendations.
| Situation | Use |
|---|---|
| Single project with docs/ and source code | /spec-forge:audit |
| Docs-only repo with mixed content | /spec-forge:analyze |
| Cross-repo documentation ecosystem | /spec-forge:analyze |
| Research notes, ideas, decision records | /spec-forge:analyze |
| API docs need checking against code | /spec-forge:audit |
| "I have a mess of docs and need to understand them" | /spec-forge:analyze |
Parse the arguments to determine what to analyze:
/spec-forge:analyze ../../aipartnerup-docs), use that as the rootdocs/ directoryUse AskUserQuestion to understand the user's goals:
Scan all documents in the target path(s):
Document type classification:
| Type | Signals |
|---|---|
vision | Mission, vision, strategy, roadmap, long-term goals |
architecture | System design, component diagrams, data flow, technical architecture |
spec | Requirements, specifications, protocols, standards, conformance |
research | Analysis, investigation, comparison, feasibility study, market research |
decision | ADR, decision record, strategy choice, trade-off analysis |
idea | Brainstorm, proposal, exploration, "what if", future thinking |
guide | How-to, tutorial, getting started, cookbook |
reference | API reference, data dictionary, glossary, type mapping |
blueprint | Master plan, project plan, implementation roadmap |
report | Status report, audit report, analysis output |
meta | README, index, navigation, table of contents |
Display the inventory:
Document Collection: {name}
Root: {path}
Total documents: {N}
Total words: ~{N}k
Directory Structure:
{dir}/ ({n} docs) — {apparent purpose}
{dir}/{subdir}/ ({n} docs) — {apparent purpose}
...
By Type:
vision: {n} docs
architecture: {n} docs
research: {n} docs
...
Group documents by what they're actually about, regardless of directory structure:
Read through all documents and identify the major themes/topics that emerge:
For each theme, list which documents contribute to it:
Theme Clusters:
"{Theme A}" — {description}
Primary: {docs that are mainly about this}
Secondary: {docs that touch on this}
Coverage: {Good / Partial / Sparse}
"{Theme B}" — {description}
Primary: ...
Secondary: ...
Coverage: ...
Build a document relationship map:
Generate a Mermaid graph showing document relationships.
Systematically compare documents for conflicts:
Look for places where two documents state contradictory facts:
For each conflict:
CONFLICT-{NNN}: {title}
Doc A: {path} — states "{claim A}" (section: {section})
Doc B: {path} — states "{claim B}" (section: {section})
Nature: {factual contradiction / naming inconsistency / version mismatch / priority conflict}
Impact: {who gets confused and how}
Resolution suggestion: {which doc is likely correct, or how to reconcile}
Look for higher-level misalignments:
Look for staleness-related contradictions:
Identify what's missing from the document collection:
Based on the themes and types identified:
Some areas may be documented but not deeply enough:
Check if all relevant audiences are served:
Find documents that overlap significantly:
For each redundancy:
REDUNDANCY-{NNN}: {title}
Documents: {list of overlapping docs}
Overlap: {what they share}
Recommendation: {merge into X / archive Y / consolidate into new doc Z}
Evaluate document freshness:
Classify each document:
Write the analysis report to {target-root}/analysis-report.md (or user-specified path).
Report format:
# Document Landscape Analysis
> Collection: {name}
> Root: {path}
> Analyzed: {date}
> Documents: {N} ({total words}k words)
## Executive Summary
{3-4 paragraphs: what this collection is about, its strengths as a knowledge base,
the most important issues found, and the top recommended actions}
## Document Map
### By Directory
| Directory | Docs | Purpose | Health |
|-----------|------|---------|--------|
| {dir} | {n} | {purpose} | {Good/Mixed/Poor} |
### By Type
| Type | Count | Key Documents |
|------|-------|---------------|
| vision | {n} | {most important ones} |
| architecture | {n} | ... |
| ... | ... | ... |
### Relationship Graph
~~~mermaid
graph LR
...
~~~
## Theme Analysis
### {Theme 1}: {name}
**Coverage**: {Good / Partial / Sparse}
**Key documents**: {list}
**Gaps**: {what's missing}
### {Theme 2}: {name}
...
## Findings
### Conflicts ({n} found)
{Ordered by severity}
#### CONFLICT-001: {title}
...
### Gaps ({n} found)
#### GAP-001: {title}
- **Area**: {theme/topic}
- **What's missing**: {description}
- **Why it matters**: {impact}
- **Recommendation**: {what to create or expand}
### Redundancies ({n} found)
#### REDUNDANCY-001: {title}
...
### Staleness ({n} documents flagged)
| Document | Status | Signals | Recommendation |
|----------|--------|---------|----------------|
| {path} | Likely stale | {signals} | {update/archive/delete} |
## Reorganization Recommendations
{If the current structure has significant issues, propose an alternative organization.
Show current structure → proposed structure side by side.
Only propose reorganization if it would meaningfully improve navigability — don't reorganize for aesthetics.}
### Current Structure
~~~
{current directory tree}
~~~
### Proposed Structure
~~~
{proposed directory tree with annotations}
~~~
### Migration Steps
1. {step — which files to move/merge/archive}
2. ...
## Priority Actions
| # | Action | Addresses | Effort | Impact |
|---|--------|-----------|--------|--------|
| 1 | {action} | CONFLICT-001, GAP-003 | {S/M/L} | {High/Med/Low} |
| 2 | {action} | REDUNDANCY-001 | {S/M/L} | {High/Med/Low} |
| ... | ... | ... | ... | ... |
Display a summary to the user:
Analysis complete: {collection-name}
Documents analyzed: {N}
Themes identified: {N}
Conflicts: {n}
Gaps: {n}
Redundancies: {n}
Stale documents: {n}
Report: {path-to-analysis-report.md}
Top 3 priority actions:
1. {action} — {impact}
2. {action} — {impact}
3. {action} — {impact}
Use AskUserQuestion to ask what to do next:
Based on user choice:
Deep dive: Read the relevant documents in full, provide a detailed analysis of the specific area, and discuss with the user.
Fix conflicts: For each conflict, read both documents in full, determine the correct information (asking the user when uncertain), and propose specific edits. Only apply edits after user approval.
Fill gaps: For identified gaps, suggest which spec-forge skill to use:
/spec-forge:tech-design/spec-forge:prd or /spec-forge:srs/spec-forge:test-cases/spec-forge:idea for explorationReorganize: Execute file moves/renames step by step, confirming with user before each destructive action (deletes, merges). Update internal links after moves.
analysis-report.md exists, note what changed since last analysisnpx claudepluginhub tercel/tercel-claude-plugins --plugin spec-forgeProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.