Best Practices Researcher
Research industry standards and create project documentation in one workflow.
Purpose & Scope
- Research via MCP Ref + Context7 for standards, patterns, versions
- Create 4 types of documents from research results:
- Guide: Pattern documentation (Do/Don't/When table)
- Manual: API reference (methods/params/doc links)
- ADR: Architecture Decision Record (Q&A dialog)
- Research: Investigation document answering specific question
- Return document path for linking in Stories/Tasks
Phase 0: Stack Detection
Objective: Identify project stack to filter research queries and adapt output.
Detection:
| Indicator |
Stack |
Query Prefix |
Official Docs |
*.csproj, *.sln |
.NET |
"C# ASP.NET Core" |
Microsoft docs |
package.json + tsconfig.json |
Node.js |
"TypeScript Node.js" |
MDN, npm docs |
requirements.txt, pyproject.toml |
Python |
"Python" |
Python docs, PyPI |
go.mod |
Go |
"Go Golang" |
Go docs |
Cargo.toml |
Rust |
"Rust" |
Rust docs |
build.gradle, pom.xml |
Java |
"Java" |
Oracle docs, Maven |
Usage:
- Add
query_prefix to all MCP search queries
- Link to stack-appropriate official docs
When to Use
- ln-310-story-validator detects missing documentation
- Need to document a pattern, library, or decision
- Replaces: ln-321-guide-creator, ln-322-adr-creator, ln-323-manual-creator
Input Parameters
| Parameter |
Required |
Description |
| doc_type |
Yes |
"guide" / "manual" / "adr" / "research" |
| topic |
Yes |
What to document (pattern name, package name, decision title, research question) |
| story_context |
No |
Story/Task context for relevance |
Research Tools
| Tool |
Use Case |
Query Pattern |
ref_search_documentation |
Standards, patterns, RFCs |
"[topic] RFC standard best practices 2025" |
context7__resolve-library-id |
Get library ID for docs |
libraryName="[topic]" |
context7__query-docs |
Library API, methods |
topic="[stack_prefix] [topic]" |
WebSearch |
Market, competitors, versions |
"[topic] latest 2025" or "[topic] vs alternatives" |
Time-box: 5-10 minutes for research; skip if topic is trivial
Research Methodology by Type (for doc_type="research")
| Type |
Focus |
Primary Sources |
Key Questions |
| Technical |
Solution comparison |
Docs, benchmarks, RFCs |
"Which solution fits our use-case?" |
| Market |
Industry landscape |
Reports, blogs, articles |
"What's the market size/trend?" |
| Competitor |
How others solve it |
Product pages, reviews, demos |
"What features do competitors offer?" |
| Requirements |
User needs |
Feedback, support tickets, forums |
"What do customers complain about?" |
| Feasibility |
Can we build it? |
PoC, prototypes, local tests |
"Is it technically possible?" |
| Feature Demand |
Feature viability |
Competitor features + blogs/socials + user complaints |
"Is this feature worth building?" |
Workflow by doc_type
| doc_type |
Purpose |
Research Source |
Template |
Output Path |
Words |
| guide |
Pattern with Do/Don't/When table |
ref_search (best practices) |
guide_template.md |
guides/NN-[slug].md |
300-500 |
| manual |
API/library reference |
context7__query-docs |
manual_template.md |
manuals/[pkg]-[ver].md |
300-500 |
| adr |
Architecture decision |
Dialog (5 questions) |
adr_template.md |
adrs/adr-NNN-[slug].md |
300-500 |
| research |
Investigation answering question |
See Methodology table above |
research_template.md |
research/rsh-NNN-[slug].md |
300-700 |
Common Workflow: Detect number (if needed) → Research → Generate from template → Validate (SCOPE, POSIX) → Save → Return path
Extract & Sections by doc_type:
- guide: Extract principle, 2-3 do/don'ts, sources → Sections: Principle, Our Implementation, Patterns table, Sources, Related
- manual: Extract methods, params (type/required/default), returns → Sections: Package info, Overview, Methods table, Config table, Limitations
- adr: Dialog answers → Sections: Context, Decision, Rationale, Alternatives table, Consequences, Related
- research: Findings by methodology → Sections: Question, Context, Methodology, Findings (tables!), Conclusions, Next Steps, Sources
Validation specifics: guide: patterns table present; manual: version in filename; adr: ISO date, status field; all: sources ≥2025
ADR Dialog (5 questions): Q1: Title? → Q2: Category (Strategic/Technical)? → Q3: Context? → Q4: Decision + Rationale? → Q5: Alternatives (2 with pros/cons)?
Output: File path for linking in Stories/Tasks; for ADR remind to reference in architecture.md; for Research suggest ADR if decision needed
Critical Rules
NO_CODE_EXAMPLES (ALL document types):
| Forbidden |
Allowed |
| Code snippets |
Tables (params, config, alternatives) |
| Implementation examples |
ASCII diagrams, Mermaid diagrams |
| Code blocks >1 line |
Method signatures (1 line inline) |
|
Links to official docs |
Format Priority (STRICT):
┌───────────────────────────────────────────────┐
│ 1. TABLES + ASCII diagrams ←── PRIORITY │
│ Params, Config, Alternatives, Flows │
├───────────────────────────────────────────────┤
│ 2. LISTS (enumerations only) │
│ Enumeration items, file lists, tools │
├───────────────────────────────────────────────┤
│ 3. TEXT (last resort) │
│ Only if cannot express as table │
└───────────────────────────────────────────────┘
| Content Type |
Format |
| Parameters |
Table: Name | Type | Required | Default |
| Configuration |
Table: Option | Type | Default | Description |
| Alternatives |
Table: Alt | Pros | Cons | Why Rejected |
| Patterns |
Table: Do | Don't | When |
| Workflow |
ASCII diagram: A → B → C |
Other Rules:
- Research ONCE per invocation; reuse results
- Cite sources with versions/dates (>=2025)
- One pattern per guide; one decision per ADR; one package per manual
- Preserve language (EN/RU) from story_context
- Link to stack-appropriate docs (Microsoft for .NET, MDN for JS, etc.)
- Do not create if target directory missing (warn instead)
Definition of Done
- Research completed (standards/patterns/versions extracted) - for guide/manual
- Dialog completed (5 questions answered) - for ADR
- Document generated with all required sections; no placeholders
- Standards validated (SCOPE, maintenance, POSIX)
- File saved to correct directory with proper naming
- Path returned; README updated if placeholder present
Reference Files
- Guide template:
shared/templates/guide_template.md
- Manual template:
shared/templates/manual_template.md
- ADR template:
shared/templates/adr_template.md
- Research template:
shared/templates/research_template.md
- Standards:
docs/DOCUMENTATION_STANDARDS.md (if exists)
Version: 3.0.0
Last Updated: 2025-12-23
1---2name: ln-002-best-practices-researcher3description: Research best practices via MCP Ref/Context7/WebSearch and create documentation (guide/manual/ADR/research). Single research, multiple output types.4---5
6# Best Practices Researcher
7
8Research industry standards and create project documentation in one workflow.
9
10## Purpose & Scope
11- Research via MCP Ref + Context7 for standards, patterns, versions
12- Create 4 types of documents from research results:
13 - Guide: Pattern documentation (Do/Don't/When table)
14 - Manual: API reference (methods/params/doc links)
15 - ADR: Architecture Decision Record (Q&A dialog)
16 - Research: Investigation document answering specific question
17- Return document path for linking in Stories/Tasks
18
19## Phase 0: Stack Detection
20
21**Objective**: Identify project stack to filter research queries and adapt output.
22
23**Detection:**
24
25| Indicator | Stack | Query Prefix | Official Docs |
26|-----------|-------|--------------|---------------|
27| `*.csproj`, `*.sln` | .NET | "C# ASP.NET Core" | Microsoft docs |
28| `package.json` + `tsconfig.json` | Node.js | "TypeScript Node.js" | MDN, npm docs |
29| `requirements.txt`, `pyproject.toml` | Python | "Python" | Python docs, PyPI |
30| `go.mod` | Go | "Go Golang" | Go docs |
31| `Cargo.toml` | Rust | "Rust" | Rust docs |
32| `build.gradle`, `pom.xml` | Java | "Java" | Oracle docs, Maven |
33
34**Usage:**
35- Add `query_prefix` to all MCP search queries
36- Link to stack-appropriate official docs
37
38## When to Use
39- ln-310-story-validator detects missing documentation
40- Need to document a pattern, library, or decision
41- Replaces: ln-321-guide-creator, ln-322-adr-creator, ln-323-manual-creator
42
43## Input Parameters
44
45| Parameter | Required | Description |
46|-----------|----------|-------------|
47| doc_type | Yes | "guide" / "manual" / "adr" / "research" |
48| topic | Yes | What to document (pattern name, package name, decision title, research question) |
49| story_context | No | Story/Task context for relevance |
50
51## Research Tools
52
53| Tool | Use Case | Query Pattern |
54|------|----------|---------------|
55| `ref_search_documentation` | Standards, patterns, RFCs | `"[topic] RFC standard best practices 2025"` |
56| `context7__resolve-library-id` | Get library ID for docs | `libraryName="[topic]"` |
57| `context7__query-docs` | Library API, methods | `topic="[stack_prefix] [topic]"` |
58| `WebSearch` | Market, competitors, versions | `"[topic] latest 2025"` or `"[topic] vs alternatives"` |
59
60**Time-box:** 5-10 minutes for research; skip if topic is trivial
61
62## Research Methodology by Type (for doc_type="research")
63
64| Type | Focus | Primary Sources | Key Questions |
65|------|-------|-----------------|---------------|
66| **Technical** | Solution comparison | Docs, benchmarks, RFCs | "Which solution fits our use-case?" |
67| **Market** | Industry landscape | Reports, blogs, articles | "What's the market size/trend?" |
68| **Competitor** | How others solve it | Product pages, reviews, demos | "What features do competitors offer?" |
69| **Requirements** | User needs | Feedback, support tickets, forums | "What do customers complain about?" |
70| **Feasibility** | Can we build it? | PoC, prototypes, local tests | "Is it technically possible?" |
71| **Feature Demand** | Feature viability | Competitor features + blogs/socials + user complaints | "Is this feature worth building?" |
72
73## Workflow by doc_type
74
75| doc_type | Purpose | Research Source | Template | Output Path | Words |
76|----------|---------|-----------------|----------|-------------|-------|
77| **guide** | Pattern with Do/Don't/When table | `ref_search` (best practices) | guide_template.md | `guides/NN-[slug].md` | 300-500 |
78| **manual** | API/library reference | `context7__query-docs` | manual_template.md | `manuals/[pkg]-[ver].md` | 300-500 |
79| **adr** | Architecture decision | Dialog (5 questions) | adr_template.md | `adrs/adr-NNN-[slug].md` | 300-500 |
80| **research** | Investigation answering question | See Methodology table above | research_template.md | `research/rsh-NNN-[slug].md` | 300-700 |
81
82**Common Workflow:** Detect number (if needed) → Research → Generate from template → Validate (SCOPE, POSIX) → Save → Return path
83
84**Extract & Sections by doc_type:**
85- **guide:** Extract principle, 2-3 do/don'ts, sources → Sections: Principle, Our Implementation, Patterns table, Sources, Related
86- **manual:** Extract methods, params (type/required/default), returns → Sections: Package info, Overview, Methods table, Config table, Limitations
87- **adr:** Dialog answers → Sections: Context, Decision, Rationale, Alternatives table, Consequences, Related
88- **research:** Findings by methodology → Sections: Question, Context, Methodology, Findings (tables!), Conclusions, Next Steps, Sources
89
90**Validation specifics:** guide: patterns table present; manual: version in filename; adr: ISO date, status field; all: sources ≥2025
91
92**ADR Dialog (5 questions):** Q1: Title? → Q2: Category (Strategic/Technical)? → Q3: Context? → Q4: Decision + Rationale? → Q5: Alternatives (2 with pros/cons)?
93
94**Output:** File path for linking in Stories/Tasks; for ADR remind to reference in architecture.md; for Research suggest ADR if decision needed
95
96## Critical Rules
97
98**NO_CODE_EXAMPLES (ALL document types):**
99
100| Forbidden | Allowed |
101|-----------|---------|
102| Code snippets | Tables (params, config, alternatives) |
103| Implementation examples | ASCII diagrams, Mermaid diagrams |
104| Code blocks >1 line | Method signatures (1 line inline) |
105| | Links to official docs |
106
107**Format Priority (STRICT):**
108```
109┌───────────────────────────────────────────────┐
110│ 1. TABLES + ASCII diagrams ←── PRIORITY │
111│ Params, Config, Alternatives, Flows │
112├───────────────────────────────────────────────┤
113│ 2. LISTS (enumerations only) │
114│ Enumeration items, file lists, tools │
115├───────────────────────────────────────────────┤
116│ 3. TEXT (last resort) │
117│ Only if cannot express as table │
118└───────────────────────────────────────────────┘
119```
120
121| Content Type | Format |
122|--------------|--------|
123| Parameters | Table: Name \| Type \| Required \| Default |
124| Configuration | Table: Option \| Type \| Default \| Description |
125| Alternatives | Table: Alt \| Pros \| Cons \| Why Rejected |
126| Patterns | Table: Do \| Don't \| When |
127| Workflow | ASCII diagram: `A → B → C` |
128
129**Other Rules:**
130- Research ONCE per invocation; reuse results
131- Cite sources with versions/dates (>=2025)
132- One pattern per guide; one decision per ADR; one package per manual
133- Preserve language (EN/RU) from story_context
134- Link to stack-appropriate docs (Microsoft for .NET, MDN for JS, etc.)
135- Do not create if target directory missing (warn instead)
136
137## Definition of Done
138- Research completed (standards/patterns/versions extracted) - for guide/manual
139- Dialog completed (5 questions answered) - for ADR
140- Document generated with all required sections; no placeholders
141- Standards validated (SCOPE, maintenance, POSIX)
142- File saved to correct directory with proper naming
143- Path returned; README updated if placeholder present
144
145## Reference Files
146- Guide template: `shared/templates/guide_template.md`
147- Manual template: `shared/templates/manual_template.md`
148- ADR template: `shared/templates/adr_template.md`
149- Research template: `shared/templates/research_template.md`
150- Standards: `docs/DOCUMENTATION_STANDARDS.md` (if exists)
151
152---
153**Version:** 3.0.0
154**Last Updated:** 2025-12-23