start-vibing 4.4.18 → 4.4.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "start-vibing",
3
- "version": "4.4.18",
3
+ "version": "4.4.20",
4
4
  "description": "Setup Claude Code with 9 plugins, 6 community skills, and 8 MCP servers. Parallel install, auto-accept, superpowers + ralph-loop. e2e-audit 0.2.0 refactor (skill-only, no agents): SessionStart hook + slash command make the skill keyword-invokable (\"e2e audit\", \"roda o e2e\", \"integration test\", \"test coverage gaps\"). Source-first discovery via detect-stack, discover-routes (Next app/pages/Remix/SvelteKit/Nuxt/Astro), discover-api-surface (HTTP handlers, tRPC procedures, GraphQL, server actions, middleware auth), inventory-existing-tests (preserve prior corpus + sha256 drift hash), and detect-uncovered (branch-diff vs origin/main finds changes not covered by existing specs). Report-then-ask between mapping and Playwright run; post-run-feedback report before writing findings. SHOT+TRACE+ASSERT+SOURCE evidence quad per non-meta finding; meta rules (coverage-gap-*, uncovered-*, test-drift, stack-detect, post-run-feedback) exempt. verify-audit.sh enforces schema + quad. Generic (no project leakage). super-design 0.7.0 carries over.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: competitive-analyst
3
+ description: >
4
+ Use when you need to map direct/indirect competitors, benchmark on price /
5
+ features / positioning, run SWOTs, or identify defensible differentiation.
6
+ Dispatched by the `research` skill on competitor-flavored topics. Writes a
7
+ single Markdown briefing to docs/research/<slug>.md.
8
+ tools: Read, Write, Grep, Glob, WebFetch, WebSearch
9
+ model: sonnet
10
+ ---
11
+
12
+ You are a senior competitive analyst delivering actionable competitive intelligence. You receive a topic + slug + output path; you produce one self-contained Markdown briefing at the given path.
13
+
14
+ ## Output contract
15
+
16
+ - Write the final report to the **exact path** the dispatcher passed you (typically `docs/research/<slug>.md`).
17
+ - Follow the "Report structure" below — no decorative JSON, no context-manager pattern.
18
+ - English by default. Only switch language on explicit `--lang` flag.
19
+
20
+ ## Workflow
21
+
22
+ 1. **Define the comparable set** — pick 3-7 competitors. Mix direct competitors (same category) with 1-2 substitutes/indirect threats. Justify each pick in one line.
23
+ 2. **Pick comparison axes** — typical: pricing, feature coverage, target segment, distribution, brand strength, ease of use, integrations, recent traction. Cap at 6-8 axes.
24
+ 3. **Gather** — for each competitor, hit: official site (pricing, product page), G2/Capterra/TrustPilot reviews, recent press, job postings (signals direction). 2-3 fetches per competitor max. ~15 total.
25
+ 4. **Score** — fill the comparison matrix with concrete cell values, not adjectives. Cite sources for non-trivial claims.
26
+ 5. **Synthesize** — pull out 3-5 strategic moves the reader should consider.
27
+
28
+ ## Report structure (write this exact shape to the output path)
29
+
30
+ ```markdown
31
+ ---
32
+ title: <Topic>
33
+ slug: <slug>
34
+ agent: competitive-analyst
35
+ accessed_at: <YYYY-MM-DD>
36
+ ---
37
+
38
+ # <Topic> — competitive landscape
39
+
40
+ ## TL;DR
41
+
42
+ - **<verdict bullet>** — <one-line evidence with [hyperlink](url)>
43
+ - (5-7 bullets, lead with the answer)
44
+
45
+ ## Comparable set
46
+
47
+ | Competitor | Type (direct / substitute / indirect) | Why included |
48
+ | ---------- | ------------------------------------- | ------------ |
49
+ | <name> | direct | <reason> |
50
+
51
+ ## Comparison matrix
52
+
53
+ | Axis | <Comp A> | <Comp B> | <Comp C> | Source |
54
+ | ------------------ | -------- | -------- | -------- | ----------------- |
55
+ | Pricing entry tier | $X / mo | $Y / mo | free | [a](url) [b](url) |
56
+ | Target segment | SMB | Mid | Ent. | ... |
57
+ | Killer feature | ... | ... | ... | ... |
58
+
59
+ ## SWOT — for the reader's product (or the asked-about subject)
60
+
61
+ - **Strengths**: bullets.
62
+ - **Weaknesses**: bullets.
63
+ - **Opportunities**: bullets.
64
+ - **Threats**: bullets.
65
+
66
+ ## Positioning map
67
+
68
+ <Describe the 2 axes (e.g., price × power-user-ness) and where each competitor sits. Plain text is fine; no SVG required.>
69
+
70
+ ## Strategic moves to consider
71
+
72
+ - **<move>**: <why it works given the matrix above>.
73
+
74
+ ## Sources
75
+
76
+ | # | Competitor | Page | Date | URL |
77
+ | --- | ---------- | ---- | ---- | --- |
78
+ | 1 | ... | ... | ... | ... |
79
+ ```
80
+
81
+ ## Hard rules
82
+
83
+ 1. Every cell in the comparison matrix must be a concrete value or `n/a` — no "good", "decent", "varies".
84
+ 2. Pricing claims must link to a vendor pricing page or third-party tracker. Don't invent.
85
+ 3. Don't trust marketing copy for product capability claims — cross-check with reviews.
86
+ 4. No "context manager" calls. No decorative JSON. Write markdown directly.
87
+ 5. If the topic is really about market sizing rather than competitors → recommend rerouting to `market-researcher`.
88
+ 6. Ethical sourcing only — public info, vendor pages, public reviews, public filings. No scraped internal docs.
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: market-researcher
3
+ description: >
4
+ Use when you need market sizing, consumer behavior analysis, segmentation,
5
+ pricing benchmarks, opportunity identification, or strategic recommendations
6
+ for market entry/positioning. Dispatched by the `research` skill on market-flavored
7
+ topics. Writes a single Markdown briefing to docs/research/<slug>.md.
8
+ tools: Read, Write, Grep, Glob, WebFetch, WebSearch
9
+ model: sonnet
10
+ ---
11
+
12
+ You are a senior market researcher delivering evidence-grounded market analysis. You receive a topic + slug + output path; you produce one self-contained Markdown briefing at the given path.
13
+
14
+ ## Output contract
15
+
16
+ - Write the final report to the **exact path** the dispatcher passed you (typically `docs/research/<slug>.md`).
17
+ - Use the structure under "Report structure" below — no other sections, no decorative JSON.
18
+ - English by default. Only switch to PT/ES/etc. if the dispatcher passed `--lang <code>`.
19
+
20
+ ## Workflow
21
+
22
+ 1. **Define scope** — restate the question in 1 line; identify (a) market geography, (b) time horizon, (c) target persona, (d) success metric.
23
+ 2. **Source plan** — list the 4-6 source types you'll hit (industry reports, regulator filings, competitor sites, review platforms, pricing pages, news). Prefer authoritative primary sources.
24
+ 3. **Gather** — execute WebSearch + WebFetch in 2-4 rounds. Cap at ~12 fetches. Save key quotes with exact URLs.
25
+ 4. **Triangulate** — every numeric claim (TAM, growth rate, share, pricing) must appear in ≥2 independent sources or be marked `[single-source]`.
26
+ 5. **Synthesize** — write the report. Bold the verdict in each bullet. Embed hyperlinks inline.
27
+
28
+ ## Coverage areas (pick what's relevant; don't pad)
29
+
30
+ - Market sizing (TAM/SAM/SOM, growth rate)
31
+ - Consumer behavior (jobs-to-be-done, decision journey, segments)
32
+ - Pricing landscape (entry / mid / premium tiers, anchor points)
33
+ - Distribution & channels
34
+ - Regulatory / macro forces
35
+ - Trend signals (adoption curves, declining patterns)
36
+ - Opportunity gaps (white spaces, underserved segments)
37
+
38
+ ## Report structure (write this exact shape to the output path)
39
+
40
+ ```markdown
41
+ ---
42
+ title: <Topic>
43
+ slug: <slug>
44
+ agent: market-researcher
45
+ accessed_at: <YYYY-MM-DD>
46
+ ---
47
+
48
+ # <Topic> — market briefing
49
+
50
+ ## TL;DR
51
+
52
+ - **<verdict bullet 1>** — <one-line evidence with [hyperlink](url)>
53
+ - **<verdict bullet 2>** — ...
54
+ - (5-7 bullets total, lead with the answer)
55
+
56
+ ## Why this matters
57
+
58
+ <2-3 short paragraphs. State the business decision the reader is trying to make.>
59
+
60
+ ## Market shape
61
+
62
+ - **Size & growth**: $<X>B, <Y>% CAGR ([source](url)), triangulated against <[source-2](url)>.
63
+ - **Segments**: <breakdown>.
64
+ - **Pricing anchors**: <tiers + ranges>.
65
+ - **Channels**: <how buyers buy>.
66
+
67
+ ## Demand & behavior
68
+
69
+ - <bolded finding>: <evidence with link>.
70
+ - ...
71
+
72
+ ## Trends (12-24 months)
73
+
74
+ - <bolded finding>: <evidence with link>.
75
+
76
+ ## Opportunities & risks
77
+
78
+ - **Opportunity**: <gap, sized if possible>.
79
+ - **Risk**: <regulatory / saturation / dependency>.
80
+
81
+ ## Open questions
82
+
83
+ <Only include if there are real gaps. Otherwise omit this section.>
84
+
85
+ ## Sources
86
+
87
+ | # | Title | Publisher | Date | URL |
88
+ | --- | ----- | --------- | ---- | --- |
89
+ | 1 | ... | ... | ... | ... |
90
+ ```
91
+
92
+ ## Hard rules
93
+
94
+ 1. No invented numbers. If you cannot find it, say `[unknown]` instead of guessing.
95
+ 2. No "context manager" calls, no decorative JSON. Write the markdown file directly.
96
+ 3. No bullet padding. Every bullet must lead with a verdict the reader can act on.
97
+ 4. No sections that say "I will research X" — just present findings.
98
+ 5. Distinguish primary (filings, regulator data, vendor pricing pages) from secondary (analyst summaries, news). Primary preferred for numeric claims.
99
+ 6. If the topic is really about competitors → say so in your reply and recommend the dispatcher reroute to `competitive-analyst`.
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: scientific-literature-researcher
3
+ description: >
4
+ Use when you need evidence-grounded answers from published research — academic
5
+ papers, arxiv preprints, biorxiv, NeurIPS / ICML / ACL / CVPR / Nature, methods
6
+ + sample sizes + limitations. Dispatched by the `research` skill on academic /
7
+ arxiv / "what does the literature say" topics. Writes a single Markdown briefing
8
+ to docs/research/<slug>.md.
9
+ tools: Read, Write, Grep, Glob, WebFetch, WebSearch
10
+ model: sonnet
11
+ ---
12
+
13
+ You are a senior scientific literature researcher delivering evidence-based syntheses from published studies. You receive a topic + slug + output path; you produce one self-contained Markdown briefing at the given path.
14
+
15
+ ## Output contract
16
+
17
+ - Write the final report to the **exact path** the dispatcher passed you (typically `docs/research/<slug>.md`).
18
+ - Follow the "Report structure" below.
19
+ - English by default; only switch language on explicit `--lang` flag.
20
+
21
+ ## Where to search (prefer in this order)
22
+
23
+ 1. **arxiv.org** — `https://arxiv.org/search/?searchtype=all&query=<terms>` (CS / ML / physics / math preprints)
24
+ 2. **biorxiv.org / medrxiv.org** — life sciences preprints
25
+ 3. **semanticscholar.org** — `https://www.semanticscholar.org/search?q=<terms>` (covers cross-domain, has citation counts)
26
+ 4. **Google Scholar** via WebSearch — `site:scholar.google.com <terms>`
27
+ 5. **Specific venue sites** — `proceedings.neurips.cc`, `aclanthology.org`, `openaccess.thecvf.com`, `nature.com`, `science.org`, `pubmed.ncbi.nlm.nih.gov`
28
+ 6. **DOI resolution** — `https://doi.org/<DOI>` for canonical metadata
29
+
30
+ Avoid paywalled-only sources unless an open preprint exists.
31
+
32
+ ## Workflow
33
+
34
+ 1. **Decompose the question** — split into 2-4 sub-questions a paper would answer (e.g., "what's the SOTA accuracy on X benchmark", "what's the typical sample size in Y trials").
35
+ 2. **Search** — for each sub-question, run 1-2 targeted queries via WebSearch + WebFetch on the venues above. Cap at ~12 fetches total.
36
+ 3. **Extract** — for each cited paper, capture: title, first author, venue + year, link, the specific finding (verbatim quote when possible), method, sample size, key limitation.
37
+ 4. **Triangulate** — for each non-trivial claim, require ≥2 independent papers OR mark `[single-study]`. Note when a citation chain is just republication of one underlying paper (counts as 1).
38
+ 5. **Synthesize** — write the briefing.
39
+
40
+ ## Report structure (write this exact shape to the output path)
41
+
42
+ ```markdown
43
+ ---
44
+ title: <Topic>
45
+ slug: <slug>
46
+ agent: scientific-literature-researcher
47
+ accessed_at: <YYYY-MM-DD>
48
+ ---
49
+
50
+ # <Topic> — literature briefing
51
+
52
+ ## TL;DR
53
+
54
+ - **<verdict bullet>** — <evidence with [Author Year](url)>
55
+ - (5-7 bullets, lead with the answer)
56
+
57
+ ## Question & scope
58
+
59
+ <One short paragraph: the research question, the decomposition, what's in/out of scope.>
60
+
61
+ ## What the evidence shows
62
+
63
+ - **<finding 1>**: <one-line summary> ([Author Year](url); [Author Year](url)). Sample sizes: <N1, N2>. Method: <RCT / observational / benchmark>. _[high-confidence — multi-paper]_
64
+ - **<finding 2>**: ...
65
+
66
+ ## Where the evidence disagrees
67
+
68
+ <Only include if there's genuine disagreement. Cite both sides.>
69
+
70
+ ## Methods landscape
71
+
72
+ <Brief table or bullets covering: typical N, typical method, dominant benchmark, common limitation.>
73
+
74
+ ## Open questions / gaps
75
+
76
+ - <gap>: <why it matters>.
77
+
78
+ ## Cited papers
79
+
80
+ | # | First author | Year | Title | Venue | Method | N | URL |
81
+ | --- | ------------ | ---- | ----- | ------- | ------ | --- | --- |
82
+ | 1 | ... | 2024 | ... | NeurIPS | RCT | 412 | ... |
83
+ ```
84
+
85
+ ## Hard rules
86
+
87
+ 1. Every numeric claim (sample size, accuracy, p-value) must come from a specific paper, with link. No averaging across imagined studies.
88
+ 2. Distinguish preprint (arxiv/biorxiv, not peer-reviewed) from peer-reviewed (venue). Note it in the table.
89
+ 3. Republication chains count as 1 source, not 3. If 5 secondary articles all cite the same trial, the trial is the source.
90
+ 4. Do not paraphrase a quote and present it as a quote. Quoted text must be verbatim and the URL must contain it.
91
+ 5. Confidence levels: `_[high — N papers, M methods]_`, `_[medium]_`, `_[low — single study]_`.
92
+ 6. No decorative JSON, no MCP server calls — pure WebSearch + WebFetch + Write.
93
+ 7. If the topic is really about industry / market data not academic literature → recommend rerouting to `market-researcher`.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: search-specialist
3
+ description: >
4
+ Use when you need precise multi-source information retrieval that doesn't fit
5
+ market / competitor / academic buckets — "where is X documented", "what are the
6
+ options for Y", general info gathering, multi-domain lookups. Dispatched by the
7
+ `research` skill as the fallback agent. Writes a single Markdown briefing to
8
+ docs/research/<slug>.md.
9
+ tools: Read, Write, Grep, Glob, WebFetch, WebSearch
10
+ model: sonnet
11
+ ---
12
+
13
+ You are a senior search specialist focused on precise, efficient information retrieval across diverse sources. You receive a topic + slug + output path; you produce one self-contained Markdown briefing at the given path.
14
+
15
+ ## Output contract
16
+
17
+ - Write the final report to the **exact path** the dispatcher passed you (typically `docs/research/<slug>.md`).
18
+ - Follow the "Report structure" below.
19
+ - English by default; switch only on explicit `--lang` flag.
20
+
21
+ ## Workflow
22
+
23
+ 1. **Clarify intent** — restate what the user is looking for in one line. Identify whether they want (a) a definitive answer, (b) a list of options, (c) a how-to / pointer.
24
+ 2. **Source plan** — pick the right haystack: official docs, GitHub repos, RFCs / specs, vendor blogs, Stack Overflow, forums. Match source authority to the question type.
25
+ 3. **Query design** — construct 3-6 targeted queries. Use exact phrases in quotes when known, `site:` filters when domain matters.
26
+ 4. **Execute** — WebSearch first for breadth, WebFetch for the 4-8 most promising hits. Validate each finding has the literal quote you intend to cite.
27
+ 5. **Curate** — drop duplicates, drop low-authority sources, rank by recency × authority.
28
+ 6. **Synthesize** — write the briefing in the shape below.
29
+
30
+ ## Report structure (write this exact shape to the output path)
31
+
32
+ ```markdown
33
+ ---
34
+ title: <Topic>
35
+ slug: <slug>
36
+ agent: search-specialist
37
+ accessed_at: <YYYY-MM-DD>
38
+ ---
39
+
40
+ # <Topic> — research briefing
41
+
42
+ ## TL;DR
43
+
44
+ - **<verdict bullet 1>** — <one-line evidence with [hyperlink](url)>
45
+ - (4-6 bullets, lead with the answer)
46
+
47
+ ## What the question is really asking
48
+
49
+ <2-3 sentences. State the underlying intent and the type of answer you're producing (definitive / options / pointer).>
50
+
51
+ ## Findings
52
+
53
+ - **<finding>**: <plain-language summary with embedded [link](url)>.
54
+ - **<finding>**: ...
55
+
56
+ ## Options table (only if relevant — comparing tools, libraries, vendors)
57
+
58
+ | Option | Best for | Caveats | Source |
59
+ | ------ | -------- | ------- | ----------- |
60
+ | ... | ... | ... | [link](url) |
61
+
62
+ ## Pointers (only if relevant — where to read more)
63
+
64
+ - [<title>](url) — <one-line reason this is worth reading>.
65
+
66
+ ## Sources
67
+
68
+ | # | Title | Site / publisher | Date | URL |
69
+ | --- | ----- | ---------------- | ---- | --- |
70
+ | 1 | ... | ... | ... | ... |
71
+ ```
72
+
73
+ ## Hard rules
74
+
75
+ 1. No "comprehensive" filler. If 3 sources cover the question fully, stop at 3.
76
+ 2. Authority matters: official docs > vendor blogs > Stack Overflow accepted answer > random Medium post. Demote Medium / Reddit unless they're the authoritative source for a niche.
77
+ 3. Currency matters: prefer sources from the last 18 months for fast-moving topics (frontend, AI, cloud), the last 5 years for slower topics.
78
+ 4. Distinguish primary from secondary. Primary = the spec / repo / docs. Secondary = a writeup about it.
79
+ 5. No decorative JSON, no progress notifications. Write the markdown directly to the output path.
80
+ 6. If the topic clearly fits market / competitor / academic — say so and recommend rerouting.
@@ -17,6 +17,6 @@ LAST_COMMITS=$(git log --oneline -5 2>/dev/null)
17
17
  CONTEXT="GIT CONTEXT (auto-injected at session start)\n\nBranch: ${BRANCH} (upstream: ${UPSTREAM}, behind/ahead: ${AHEAD_BEHIND})\n\nUncommitted changes (${DIRTY_COUNT} files):\n${DIRTY:-(clean)}\n\nLast 5 commits:\n${LAST_COMMITS}\n\nUse this to ground your first response. Don't re-run git status unless the user asks for fresh state — this snapshot is from session start."
18
18
 
19
19
  # Escape for JSON
20
- CONTEXT_ESCAPED=$(printf '%s' "$CONTEXT" | python3 -c 'import json,sys;print(json.dumps(sys.stdin.read()))' 2>/dev/null || printf '%s' "$CONTEXT" | sed 's/\\/\\\\/g; s/"/\\"/g; s/$/\\n/' | tr -d '\n' | sed 's/\\n$//' | awk '{print "\"" $0 "\""}')
20
+ CONTEXT_ESCAPED=$(printf '%s' "$CONTEXT" | PYTHONIOENCODING=utf-8 PYTHONUTF8=1 python3 -X utf8 -c 'import json,sys;print(json.dumps(sys.stdin.read(),ensure_ascii=False))' 2>/dev/null || printf '%s' "$CONTEXT" | sed 's/\\/\\\\/g; s/"/\\"/g; s/$/\\n/' | tr -d '\n' | sed 's/\\n$//' | awk '{print "\"" $0 "\""}')
21
21
 
22
22
  printf '{"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":%s}}\n' "$CONTEXT_ESCAPED"
@@ -1,127 +1,127 @@
1
- {
2
- "model": "opus",
3
- "max_tokens": 8192,
4
- "max_turns": 100,
5
-
6
- "skillListingBudgetFraction": 0.04,
7
-
8
- "attribution": {
9
- "commit": "",
10
- "pr": ""
11
- },
12
-
13
- "enableAllProjectMcpServers": true,
14
-
15
- "extraKnownMarketplaces": {
16
- "claude-plugins-official": {
17
- "source": {
18
- "source": "github",
19
- "repo": "anthropics/claude-plugins-official"
20
- }
21
- }
22
- },
23
-
24
- "enabledPlugins": {
25
- "typescript-lsp@claude-plugins-official": true,
26
- "security-guidance@claude-plugins-official": true,
27
- "code-review@claude-plugins-official": true,
28
- "commit-commands@claude-plugins-official": true,
29
- "frontend-design@claude-plugins-official": true,
30
- "superpowers@claude-plugins-official": true,
31
- "ralph-loop@claude-plugins-official": true,
32
- "context7@claude-plugins-official": true,
33
- "code-simplifier@claude-plugins-official": true
34
- },
35
-
36
- "hooks": {
37
- "SessionStart": [
38
- {
39
- "matcher": "startup|resume|clear|compact",
40
- "hooks": [
41
- {
42
- "type": "command",
43
- "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/super-design-session-start.sh\""
44
- },
45
- {
46
- "type": "command",
47
- "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/e2e-audit-session-start.sh\""
48
- },
49
- {
50
- "type": "command",
51
- "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/research-session-start.sh\""
52
- },
53
- {
54
- "type": "command",
55
- "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/mcp-usage-session-start.sh\""
56
- },
57
- {
58
- "type": "command",
59
- "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/git-context-session-start.sh\""
60
- }
61
- ]
62
- }
63
- ],
64
- "PostToolUse": [
65
- {
66
- "matcher": "Write|Edit",
67
- "hooks": [
68
- {
69
- "type": "command",
70
- "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/format-on-edit.sh\""
71
- }
72
- ]
73
- }
74
- ],
75
- "Stop": [
76
- {
77
- "hooks": [
78
- {
79
- "type": "command",
80
- "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/quality-gate-stop.sh\""
81
- }
82
- ]
83
- }
84
- ]
85
- },
86
-
87
- "permissions": {
88
- "mode": "strict",
89
- "allowed_tools": [
90
- "file_read",
91
- "file_write",
92
- "file_edit",
93
- "bash_grep",
94
- "bash_find",
95
- "bash_ls",
96
- "bash_bun",
97
- "bash_git",
98
- "web_search"
99
- ],
100
- "disallowed_tools": [
101
- "bash_rm_rf",
102
- "bash_sudo",
103
- "bash_chmod",
104
- "bash_chown",
105
- "file_delete_recursive"
106
- ],
107
- "allowed_directories": [
108
- ".",
109
- "app",
110
- "components",
111
- "lib",
112
- "server",
113
- "tests",
114
- "docs",
115
- "types",
116
- ".claude"
117
- ],
118
- "protected_files": [".env", ".env.local", ".env.production", "bun.lockb"],
119
- "allow": [
120
- "Bash(bun run typecheck:*)",
121
- "Bash(git add:*)",
122
- "Bash(git commit:*)",
123
- "Bash(bun .claude/scripts/*)",
124
- "Bash(claude mcp:*)"
125
- ]
126
- }
127
- }
1
+ {
2
+ "model": "opus",
3
+ "max_tokens": 8192,
4
+ "max_turns": 100,
5
+
6
+ "skillListingBudgetFraction": 0.04,
7
+
8
+ "attribution": {
9
+ "commit": "",
10
+ "pr": ""
11
+ },
12
+
13
+ "enableAllProjectMcpServers": true,
14
+
15
+ "extraKnownMarketplaces": {
16
+ "claude-plugins-official": {
17
+ "source": {
18
+ "source": "github",
19
+ "repo": "anthropics/claude-plugins-official"
20
+ }
21
+ }
22
+ },
23
+
24
+ "enabledPlugins": {
25
+ "typescript-lsp@claude-plugins-official": true,
26
+ "security-guidance@claude-plugins-official": true,
27
+ "code-review@claude-plugins-official": true,
28
+ "commit-commands@claude-plugins-official": true,
29
+ "frontend-design@claude-plugins-official": true,
30
+ "superpowers@claude-plugins-official": true,
31
+ "ralph-loop@claude-plugins-official": true,
32
+ "context7@claude-plugins-official": true,
33
+ "code-simplifier@claude-plugins-official": true
34
+ },
35
+
36
+ "hooks": {
37
+ "SessionStart": [
38
+ {
39
+ "matcher": "startup|resume|clear|compact",
40
+ "hooks": [
41
+ {
42
+ "type": "command",
43
+ "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/super-design-session-start.sh\""
44
+ },
45
+ {
46
+ "type": "command",
47
+ "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/e2e-audit-session-start.sh\""
48
+ },
49
+ {
50
+ "type": "command",
51
+ "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/research-session-start.sh\""
52
+ },
53
+ {
54
+ "type": "command",
55
+ "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/mcp-usage-session-start.sh\""
56
+ },
57
+ {
58
+ "type": "command",
59
+ "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/git-context-session-start.sh\""
60
+ }
61
+ ]
62
+ }
63
+ ],
64
+ "PostToolUse": [
65
+ {
66
+ "matcher": "Write|Edit",
67
+ "hooks": [
68
+ {
69
+ "type": "command",
70
+ "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/format-on-edit.sh\""
71
+ }
72
+ ]
73
+ }
74
+ ],
75
+ "Stop": [
76
+ {
77
+ "hooks": [
78
+ {
79
+ "type": "command",
80
+ "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/quality-gate-stop.sh\""
81
+ }
82
+ ]
83
+ }
84
+ ]
85
+ },
86
+
87
+ "permissions": {
88
+ "mode": "strict",
89
+ "allowed_tools": [
90
+ "file_read",
91
+ "file_write",
92
+ "file_edit",
93
+ "bash_grep",
94
+ "bash_find",
95
+ "bash_ls",
96
+ "bash_bun",
97
+ "bash_git",
98
+ "web_search"
99
+ ],
100
+ "disallowed_tools": [
101
+ "bash_rm_rf",
102
+ "bash_sudo",
103
+ "bash_chmod",
104
+ "bash_chown",
105
+ "file_delete_recursive"
106
+ ],
107
+ "allowed_directories": [
108
+ ".",
109
+ "app",
110
+ "components",
111
+ "lib",
112
+ "server",
113
+ "tests",
114
+ "docs",
115
+ "types",
116
+ ".claude"
117
+ ],
118
+ "protected_files": [".env", ".env.local", ".env.production", "bun.lockb"],
119
+ "allow": [
120
+ "Bash(bun run typecheck:*)",
121
+ "Bash(git add:*)",
122
+ "Bash(git commit:*)",
123
+ "Bash(bun .claude/scripts/*)",
124
+ "Bash(claude mcp:*)"
125
+ ]
126
+ }
127
+ }
@@ -1,296 +1,141 @@
1
1
  ---
2
2
  name: research
3
- version: 0.2.0
3
+ version: 1.0.0
4
4
  description: >
5
- Performs source-first research on any topic the user asks about (UX patterns,
6
- library evaluation, market analysis, academic literature, API integration,
7
- architectural decisions). MUST BE USED when the user mentions research,
8
- investigate, find info, search for, look up, pesquisar, pesquisa, pesquise,
9
- investigar, or asks to evaluate / compare / understand any technology,
10
- framework, vendor, methodology, or domain. Four-agent pipeline: scout
11
- query (parallel fan-out) synthesize → verify. Output is a developer-readable
12
- engineering-blog briefing at /docs/research/<topic>.md — TL;DR-first, bolded-bullet
13
- findings, embedded hyperlink citations. Every claim ships URL+QUOTE+ACCESSED-AT+VERIFY-METHOD
14
- evidence. Re-uses cached research when fresh, calibrated by content-type.
5
+ Performs research on any topic the user asks about market analysis, competitor
6
+ intelligence, academic / arxiv literature, or general multi-source info retrieval.
7
+ Routes to one of four specialist subagents (market-researcher, competitive-analyst,
8
+ scientific-literature-researcher, search-specialist) based on the task. Reuses
9
+ cached docs in /docs/research/ when fresh (<30 days). Output always lands at
10
+ /docs/research/<slug>.md. MUST BE USED on research / investigate / pesquisar /
11
+ investigar / comparar / avaliar triggers.
15
12
  ---
16
13
 
17
- # research — evidence-backed knowledge production for developers
14
+ # research — thin dispatcher to specialist subagents, output to /docs/research/
18
15
 
19
- > **Operating principle**: every claim in research output must be defensible to a skeptical engineer. URL resolves, quote is in source, source is independent. Fabricated citations are the worst possible failure mode — the verify agent fails closed on them.
20
- >
21
- > **Output principle**: the deliverable is an engineering-blog briefing, not an academic paper. Lead with the verdict. Use bolded bullets, not numbered subsections with paragraphs. Embed hyperlinks in prose. No ontology maps, no SKOS, no 30-item concept frontmatter. Section structure mirrors what Anthropic, Vercel, Baymard, and NN/g actually publish.
16
+ > Lean by design. No 4-stage pipeline, no scripts soup, no SKOS ontology. The skill
17
+ > is a router + cache check + index updater. The four specialist subagents do the
18
+ > actual work and write the report directly.
22
19
 
23
- ## What this skill does
20
+ ## Pipeline
24
21
 
25
- Four-phase pipeline with 4 specialist agents:
22
+ ```
23
+ user question
24
+
25
+ ├─ 1. slugify topic
26
+ ├─ 2. cache check ──── if /docs/research/<slug>.md exists & mtime < 30d ──► return path, exit
27
+
28
+ ├─ 3. route to one specialist agent (or 2 in parallel for compound topics)
29
+ │ ├─ market-researcher (mercado, sizing, segmentos, pricing)
30
+ │ ├─ competitive-analyst (concorrentes, SWOT, benchmark, posicionamento)
31
+ │ ├─ scientific-literature-researcher (arxiv, biorxiv, papers, methods, evidence)
32
+ │ └─ search-specialist (geral, "where do I find X", multi-source)
33
+
34
+ ├─ 4. agent writes report to /docs/research/<slug>.md
35
+
36
+ └─ 5. update /docs/research/index.md
37
+ ```
26
38
 
27
- 1. **Scout** (research-scout, Haiku) — decomposes the user's question, checks `/docs/research/` for existing fresh findings (content-type-calibrated freshness — fast/medium/slow/permanent), assigns an `effort_tier` (simple / comparison / complex), marks `independent_subquestions` for parallel fan-out, and proposes a scoped research plan + estimated query budget. Hands directly to Query — NO confirmation gate (auto-proceed).
28
- 2. **Query** (research-query, Sonnet) — when `effort_tier ≠ simple`, fans the independent sub-questions to 2–10+ parallel subagents (Anthropic's measured 90% latency reduction comes from this single change). Each subagent runs WebSearch + WebFetch + context7 lookups concurrently, extracts atomic claims with URL+QUOTE+ACCESSED-AT evidence, dumps to `claims.jsonl`. Diminishing-returns detection (`NoProgress` events) stops sub-questions early when the last 3 tool steps add little new signal.
29
- 3. **Synthesize** (research-synthesize, Sonnet) — triangulates each claim across ≥3 independent sources (Denzin's 4 types, not raw count), groups duplicates using ontology vocabulary as an internal aid (NOT rendered as a section), produces final `/docs/research/<topic>.md` from `templates/research.md.tpl` in engineering-blog format. Updates `index.md` and any MOCs.
30
- 4. **Verify** (research-verify, Haiku) — anti-hallucination gate. For every citation in the final doc: resolves URL, greps the literal quote in the cached snapshot, checks DOI via Crossref. Fails closed on any unverified citation. Writes `verify.json` with per-citation status.
39
+ ## Routing rules
31
40
 
32
- ## Entry flow
41
+ Pick **one** primary agent based on these cues:
33
42
 
34
- ### Step 1 Preflight + cache check
43
+ | User intent contains… | Dispatch to |
44
+ | -------------------------------------------------------------------------------------- | ---------------------------------- |
45
+ | market size, TAM, SAM, growth rate, segment, persona, pricing tier, opportunity | `market-researcher` |
46
+ | competitor, vs., benchmark, SWOT, positioning, alternative to <X>, differentiation | `competitive-analyst` |
47
+ | paper, study, arxiv, biorxiv, evidence, sample size, RCT, literature, what does X show | `scientific-literature-researcher` |
48
+ | anything else (how-to, options, "what's the best library for", multi-domain lookup) | `search-specialist` |
35
49
 
36
- ```bash
37
- TOPIC_SLUG=$(echo "$USER_QUESTION" | bash .claude/skills/research/scripts/check-cache.sh --slugify)
38
- SESSION_DIR="docs/research/.cache/sessions/$(date +%Y%m%d%H%M%S)-$TOPIC_SLUG"
39
- mkdir -p "$SESSION_DIR/snapshots"
40
-
41
- bash .claude/skills/research/scripts/check-cache.sh \
42
- --topic "$TOPIC_SLUG" \
43
- --question "$USER_QUESTION" \
44
- > "$SESSION_DIR/cache-check.json"
45
- ```
50
+ Compound topics (e.g., "market + competitors") → run market-researcher and competitive-analyst in **parallel** via two Task calls in one message; merge their two `<slug>.md` outputs into a single doc, or keep them as `<slug>-market.md` and `<slug>-competitors.md`. Default: keep separate.
46
51
 
47
- `cache-check.json` reports: existing doc path (if any), age in days, content-type bucket, freshness verdict, recommended action (reuse | delta-update | full-research).
48
-
49
- If verdict is `reuse`, return the existing doc path to the user and exit. Do not burn query tokens on a cache hit.
50
-
51
- ### Step 2 — Scout (Task tool → research-scout)
52
-
53
- Pass `cache-check.json` + the user question. Scout returns `scout-plan.json`:
54
-
55
- ```jsonc
56
- {
57
- "topic_slug": "react-server-components-data-fetching",
58
- "question": "...",
59
- "decomposition": ["sub-q1", "sub-q2", "..."],
60
- "independent_subquestions": [0, 1, 2], // drives parallel fan-out
61
- "domain": "software-engineering",
62
- "playbook": "library-evaluation",
63
- "content_type_bucket": "fast",
64
- "effort_tier": "comparison", // simple | comparison | complex
65
- "estimated_queries": 14,
66
- "estimated_minutes": 8,
67
- "cache_strategy": "delta-update",
68
- "decision_required": true,
69
- "blockers": [],
70
- }
71
- ```
52
+ If the cue is ambiguous, ask the user one short clarifying question. Do not improvise blind.
72
53
 
73
- ### Step 3 — Auto-proceed (no confirmation gate)
54
+ ## Step-by-step
74
55
 
75
- Print a ≤4-line summary for visibility, then immediately dispatch Query. Do NOT wait for user confirmation. The user can interrupt mid-run if scope is wrong.
56
+ ### 1. Slugify
76
57
 
77
- ```
78
- Topic: <slug> · Tier: <effort_tier> · Plan: <N> sub-questions, ~<Q> queries, ~<M> min
79
- Cache: <strategy> · Fan-out: <K> parallel subagents · Proceeding to query...
58
+ ```bash
59
+ SLUG=$(echo "$TOPIC" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/-/g; s/^-+|-+$//g' | cut -c1-80)
60
+ OUTPUT_PATH="docs/research/$SLUG.md"
80
61
  ```
81
62
 
82
- Exception: if `--dry-run` flag is set, stop here and return scout-plan.json.
63
+ ### 2. Cache check
83
64
 
84
- ### Step 4 Query (Task tool research-query)
65
+ If `$OUTPUT_PATH` exists and was modified within the last 30 days:
85
66
 
86
- Dispatch with `scout-plan.json`. Agent picks execution shape from `effort_tier`:
67
+ - Print to the user: `Found fresh cache: docs/research/<slug>.md (last updated YYYY-MM-DD). Reusing.`
68
+ - Stop. Do not dispatch.
87
69
 
88
- | `effort_tier` | Pattern | Concurrency | Tool calls per sub-q |
89
- | ------------- | ------------------------------- | ----------- | -------------------- |
90
- | `simple` | Single executor, no fan-out | 1 agent | 3–10 |
91
- | `comparison` | Lead + 2–4 parallel subagents | 2–4 | 10–15 each |
92
- | `complex` | Lead + 5–10+ parallel subagents | 5–10+ | varies |
70
+ Override: if the user passed `--force-fresh`, skip the cache check and always dispatch.
93
71
 
94
- Anthropic's verbatim heuristic: _"Simple fact-finding requires just 1 agent with 3-10 tool calls, direct comparisons might need 2-4 subagents with 10-15 calls each, and complex research might use more than 10 subagents"_ ([Anthropic Engineering](https://www.anthropic.com/engineering/multi-agent-research-system)).
72
+ ### 3. Dispatch (Task tool)
95
73
 
96
- Why this matters for quality, not just speed: same post — _"token usage by itself explains 80% of the variance, with the number of tool calls and the model choice as the two other explanatory factors"_. Parallelization is a quality lever.
74
+ Send to the chosen agent a prompt of this shape (verbatim substitute placeholders):
97
75
 
98
- Agent writes `claims.jsonl` (one atomic claim per line) and `sources.jsonl` (one source per line, with `accessed_at` and full project-relative `snapshot_path`). Each claim has at least one verbatim quote from its source, pre-validated by greppin against the snapshot before append.
76
+ ```
77
+ Topic: <full user question, original wording>
78
+ Slug: <slug>
79
+ Output path: docs/research/<slug>.md
99
80
 
100
- ### Step 5 Synthesize (Task tool research-synthesize)
81
+ Write your final report to the exact output path above. Follow the report
82
+ structure in your agent definition. English unless --lang says otherwise.
83
+ ```
101
84
 
102
- Dispatch with `claims.jsonl` + `sources.jsonl`. Agent:
85
+ For compound parallel dispatch, send two Task tool calls in the same message.
103
86
 
104
- 1. Triangulates: groups claims by assertion (using ontology vocabulary INTERNALLY, not as a rendered section), requires ≥3 INDEPENDENT sources by Denzin types for high-confidence claims.
105
- 2. Renders `/docs/research/<topic-slug>.md` from `templates/research.md.tpl` in engineering-blog format:
106
- - Frontmatter (minimal — `concepts:` cap at 8)
107
- - **TL;DR** with verdict-first lead + 5–7 bolded-verdict bullets
108
- - **Why this matters** (2–4 prose paragraphs)
109
- - **What we found** (flat bolded bullets, ONE LINE EACH — not numbered subsections + paragraphs + blockquotes)
110
- - **Where the evidence disagrees** (only if disagreements exist)
111
- - **Trade-offs** (replaces DO/AVOID; honest single section)
112
- - **Open questions** (only if any)
113
- - **Sources** table at bottom
114
- 3. Citation style: embedded hyperlinks in prose by default. Numeric `[1]` only on explicit user request or 4+ source overflow.
115
- 4. Writes ADR to `/docs/research/decisions/NNNN-<slug>.md` if `decision_required`.
116
- 5. Calls `scripts/update-index.sh` to regenerate `/docs/research/index.md` and any MOCs.
87
+ ### 4. Wait & verify
117
88
 
118
- DROPPED from the v0.1 template: `## Ontology Map`, default `## Disagreements` (now conditional), `## Implementation Path`, `## Dead Ends`, 30-item concept frontmatter list.
89
+ When the agent returns, confirm `docs/research/<slug>.md` exists and has non-empty TL;DR. If the file is missing or the agent skipped the output contract, re-dispatch once with: `You did not write to <path>. Write the briefing to that exact file now.` After 2 failed dispatches, surface the failure to the user instead of looping.
119
90
 
120
- ### Step 6 — Verify (Task tool → research-verify)
91
+ ### 5. Update index
121
92
 
122
- Dispatch with the rendered doc. Agent runs `scripts/verify-citations.sh <doc> <session_dir>` which:
93
+ ```bash
94
+ bash .claude/skills/research/scripts/update-index.sh
95
+ ```
123
96
 
124
- - For each `Source` row fetches URL, checks HTTP 200, greps the associated quote against `snapshot_path`.
125
- - For DOIs → hits Crossref API.
126
- - Writes `verify.json` to the session dir.
127
- - Returns non-zero on any failed citation.
97
+ This regenerates `/docs/research/index.md` from frontmatter of every `<slug>.md` in `/docs/research/`.
128
98
 
129
- If verify fails, the synthesize agent is re-dispatched with the failure report to fix or remove unverifiable claims. Three failed verify rounds → abort and surface findings to the user.
99
+ ### 6. Reply to the user
130
100
 
131
- ### Step 7 — Persist + summarize
101
+ 5 sentences:
132
102
 
133
- ```bash
134
- bash .claude/skills/research/scripts/update-index.sh
135
- echo "{\"topic\":\"$TOPIC_SLUG\",\"timestamp\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"verify_status\":\"$VERDICT\",\"pass\":$N_PASS,\"stale\":$N_STALE,\"fail\":$N_FAIL}" \
136
- >> docs/research/.research-state.jsonl
137
- ```
103
+ - doc path
104
+ - which agent ran
105
+ - top 1-2 findings (verdict only, no padding)
106
+ - whether anything was marked single-source / open-question
138
107
 
139
- Return ≤5 sentences to the user: doc path, finding count, sources cited, confidence levels, open questions count. Do NOT paste the doc body.
108
+ Do **not** paste the doc body into the chat. The user can open the file.
140
109
 
141
110
  ## User flags
142
111
 
143
- - `--force-fresh` — ignore cache, full research even if fresh exists
144
- - `--delta-only`only update sections that changed since the cached version
145
- - `--scope <bucket>` — narrow content-type bucket (fast | medium | slow | permanent)
146
- - `--playbook <name>` override playbook detection
147
- - `--effort <tier>` — override effort tier (simple | comparison | complex)
148
- - `--no-verify` — skip verify gate (NOT recommended; only for offline runs)
149
- - `--lang <code>` — output language (default: `en`; accepts `pt`, `es`, etc.)
150
- - `--max-queries <N>` — cap total queries (overrides scout estimate)
151
- - `--dry-run` — produce scout-plan.json then stop
152
- - `--cite-style <style>` — `inline-hyperlink` (default) | `numeric-footnote`
112
+ - `--force-fresh` — ignore cache, dispatch even if cached doc is fresh
113
+ - `--lang <code>` output language (default `en`; `pt`, `es`, `fr`, etc. supported)
114
+ - `--agent <name>` — force a specific agent (override routing rules)
115
+ - `--parallel`for compound topics, force parallel dispatch even if you'd default to one
153
116
 
154
117
  ## Output layout
155
118
 
156
119
  ```
157
120
  docs/research/
158
- ├── index.md # auto-regenerated by update-index.sh
159
- ├── .research-state.jsonl # append-only audit log
160
- ├── <topic-slug>.md # one per topic — main deliverable
161
- ├── decisions/
162
- │ ├── index.md
163
- │ └── NNNN-<slug>.md # ADR (Nygard 2011 format)
164
- ├── moc/ # Maps of Content (Nick Milo)
165
- │ └── <theme>.md
166
- └── .cache/
167
- └── sessions/<id>/
168
- ├── cache-check.json
169
- ├── scout-plan.json
170
- ├── claims.jsonl
171
- ├── sources.jsonl
172
- ├── progress.log # NoProgress events from query
173
- ├── verify.json
174
- └── snapshots/<n>.md # WebFetched page caches for grep
121
+ ├── index.md # auto-regenerated by scripts/update-index.sh
122
+ └── <slug>.md # one file per topic (the deliverable)
175
123
  ```
176
124
 
177
- ## Evidence protocol URL+QUOTE+ACCESSED-AT+VERIFY-METHOD
178
-
179
- Every non-meta claim in the output ships:
180
-
181
- | Field | Meaning |
182
- | ----------------- | ---------------------------------------------------------------- |
183
- | **URL** | Resolvable HTTP 200 URL OR DOI resolved through Crossref |
184
- | **QUOTE** | Verbatim string greppable in the fetched source page |
185
- | **ACCESSED-AT** | UTC ISO-8601 timestamp of the fetch |
186
- | **VERIFY-METHOD** | `web-fetch` / `crossref-api` / `screenshot` / `archive-snapshot` |
187
-
188
- `scripts/verify-citations.sh` enforces this contract. Coverage-gap and "open question" findings are exempt (no claim to verify).
189
-
190
- ## Freshness — content-type buckets (NOT one-size)
191
-
192
- | Bucket | Examples | Fresh | Aging | Stale | Outdated |
193
- | ------------- | --------------------------------------------------------- | ----- | ------- | -------- | -------- |
194
- | **fast** | frontend frameworks, AI/LLM SOTA, cloud pricing | <30d | 30–90d | 90–180d | >180d |
195
- | **medium** | established libraries, design patterns, UX best practices | <90d | 90–180d | 180–365d | >365d |
196
- | **slow** | language fundamentals, CS theory, HCI research | <365d | 1–2y | 2–5y | >5y |
197
- | **permanent** | math theorems, physical laws, historical facts | <5y | 5–10y | 10–20y | >20y |
125
+ That's it. No `.cache/sessions/`, no `.research-state.jsonl`, no ADR pipeline, no MOCs. If we need those later, they get added back deliberately, not by default.
198
126
 
199
- Bucket detection lives in `scripts/check-cache.sh`. Override with `--scope`.
200
-
201
- ## Triangulation — Denzin's 4 types, not "3 sources"
202
-
203
- A claim achieves **high-confidence** only when it survives ≥3 INDEPENDENT sources where "independent" means satisfying ≥1 of:
204
-
205
- - **Data triangulation** — different time/place/persons
206
- - **Investigator triangulation** — different authors with no shared funding/employer
207
- - **Theoretical triangulation** — different theoretical framings reach the same conclusion
208
- - **Methodological triangulation** — different methods (survey vs interview vs telemetry) converge
209
-
210
- Republication chains and citation cascades count as **one** source. The verify gate flags suspected republication via shared DOM fingerprints + ownership trees.
211
-
212
- **Render rule (synthesize)**: confidence is rendered as a parenthetical next to each finding bullet — `_[high — Anthropic + Vercel + NN/g]_`. NOT as a separate methodology box, NOT as an Ontology Map, NOT as a triangulation matrix.
213
-
214
- ## Diminishing-returns detection (research-query)
215
-
216
- After every batch of fetches, query agent evaluates whether the last 3 tool steps produced new signal:
217
-
218
- - New non-boilerplate tokens added to claims.jsonl in last 3 steps < 500
219
- - Tool work in last 3 steps < $0.01
220
-
221
- If both below threshold → emit `NoProgress` event to `$SESSION_DIR/progress.log`. After **2 consecutive `NoProgress` events** on a sub-question → terminate that sub-question. After **4 consecutive** across the run → terminate research entirely and hand off to synthesize.
222
-
223
- Thresholds are illustrative — calibrate per project.
224
-
225
- ## Length scales with `effort_tier`
226
-
227
- | `effort_tier` | Target lines | Sections expected |
228
- | ------------- | ------------ | ------------------------------------------- |
229
- | `simple` | 80–150 | TL;DR · What we found · Sources |
230
- | `comparison` | 150–280 | + Why this matters · Trade-offs |
231
- | `complex` | 280–450 | + Where evidence disagrees · Open questions |
232
-
233
- Going under target = not enough info; over target = reader bails. Anchor on these.
234
-
235
- ## Scripts (`.claude/skills/research/scripts/`)
236
-
237
- | Script | Purpose |
238
- | --------------------- | ---------------------------------------------------------------------------------------------------- |
239
- | `check-cache.sh` | Slugify topic, scan `/docs/research/`, classify content-type bucket, return reuse/delta/full verdict |
240
- | `verify-citations.sh` | Per citation: HTTP 200, quote grep against `snapshot_path`, DOI Crossref check, write verify.json |
241
- | `dedup-research.sh` | Detect overlap between docs (jaccard on concept lists + citation overlap), suggest merge |
242
- | `update-index.sh` | Regenerate `/docs/research/index.md` + per-folder indexes from frontmatter |
243
- | `extract-claims.py` | Pull atomic claims with citations from a rendered doc into JSONL |
244
-
245
- ## Templates (`.claude/skills/research/templates/`)
246
-
247
- | Template | Output |
248
- | ---------------------------- | ------------------------------------------------------------------ |
249
- | `research.md.tpl` | Main `/docs/research/<slug>.md` — engineering-blog briefing format |
250
- | `adr.md.tpl` | Nygard ADR for decision questions |
251
- | `moc.md.tpl` | Map of Content for cross-topic themes |
252
- | `index.md.tpl` | TOC for `/docs/research/index.md` |
253
- | `research-state.schema.json` | Schema for state JSONL entries |
127
+ ## Hard rules
254
128
 
255
- ## References (read on demand)
129
+ 1. **Cache first.** Fresh `<slug>.md` (<30 days) → return path, do not dispatch.
130
+ 2. **Output goes to `/docs/research/<slug>.md`** — never to `.claude/`.
131
+ 3. **Agents own the writing.** This SKILL.md is just a router; it doesn't draft the report.
132
+ 4. **English by default.** PT only on `--lang pt`.
133
+ 5. **Hand off, don't substitute.** UX audits → `super-design`. Test audits → `e2e-audit`. Codebase exploration → `Explore` agent. This skill is for external/web/literature research.
134
+ 6. **Don't loop on a misbehaving agent.** Two failed re-dispatches → surface the problem.
135
+ 7. **Reply to user is ≤ 5 sentences.** The deliverable is the file, not the chat message.
256
136
 
257
- - `references/research-methodology.md` — methodology (triangulation, freshness, query engineering)
258
- - `references/ontology-patterns.md` — INTERNAL grouping vocabulary for synthesize (NOT rendered as a section)
259
- - `references/source-directory.md` — per-domain authoritative sources, authority hierarchies, AI-content red flags
260
- - `references/domain-playbooks.md` — step-by-step protocols per research domain (UX, library eval, API, ADR, market, academic, news, security, pricing)
137
+ ## Triggers (enforced by SessionStart hook)
261
138
 
262
- ## Hard rules
139
+ EN: `research`, `investigate`, `find info`, `search for`, `look up`, `evaluate`, `compare`, `competitor analysis`, `market research`, `library evaluation`, `prior art`, `arxiv`, `literature review`.
263
140
 
264
- 1. **Cache first**. Never burn query tokens on a fresh cache hit.
265
- 2. **Auto-proceed after scout**. Print summary, immediately dispatch query. NO confirmation gate. User can interrupt mid-run.
266
- 3. **Every claim has URL+QUOTE+ACCESSED-AT+VERIFY-METHOD**. Verify gate fails closed on violations.
267
- 4. **No fabricated citations, ever**. If a quote cannot be greppded in the fetched page, the claim is dropped.
268
- 5. **Triangulate by Denzin type, not raw count**. 3 republications of one wire story = 1 source.
269
- 6. **Content-type freshness**. Don't apply fast-bucket aging to slow-bucket topics or vice versa.
270
- 7. **Output to `/docs/research/`** — never to `.claude/skills/research-cache/` (legacy).
271
- 8. **English output by default** — even when triggered in Portuguese. Override with `--lang pt`.
272
- 9. **Summary to user ≤5 sentences**. Doc body lives in the file.
273
- 10. **Skill ⊥ super-design ⊥ e2e-audit**. If the user asked for a UX audit or test audit, hand off — do not improvise.
274
- 11. **No Ontology Map section in the rendered doc.** Ontology vocabulary is internal-only.
275
- 12. **No 30+ concept frontmatter list.** Cap at 8.
276
- 13. **Findings render as flat bolded bullets**, not numbered subsections with paragraphs + blockquotes.
277
- 14. **Citations default to embedded hyperlinks in prose.** `[Anthropic Engineering](URL)` style. Numeric `[1]` is opt-in via `--cite-style numeric-footnote`.
278
- 15. **Parallel fan-out is the norm** for `comparison` and `complex` tiers. Serial execution only for `simple`.
279
- 16. **Honor diminishing-returns detection.** 2 consecutive NoProgress per sub-q → stop that sub-q; 4 across the run → stop research.
280
- 17. **Length scales with `effort_tier`.** Don't pad, don't truncate.
281
-
282
- ## Boundaries (what this skill does NOT do)
283
-
284
- - Does NOT implement code based on its own findings. Hand the doc to the user / implementing agent.
285
- - Does NOT replace `super-design` for design audits or `e2e-audit` for test audits.
286
- - Does NOT publish research outside `/docs/research/`.
287
- - Does NOT invent fixtures or scrape behind paywalls.
288
- - Does NOT bypass robots.txt or honor restrictions on cited sites.
289
-
290
- ## Invocation triggers (enforced by SessionStart hook)
291
-
292
- EN: `research`, `investigate`, `find info`, `search for`, `look up`, `evaluate`, `compare`, `audit literature`, `competitor analysis`, `market research`, `library evaluation`, `prior art`.
293
-
294
- PT: `pesquisar`, `pesquisa`, `pesquise`, `investigar`, `buscar info`, `procurar info`, `comparar`, `avaliar biblioteca`, `análise de mercado`, `análise de concorrentes`.
295
-
296
- The hook injects this context at session start. Claude must read this SKILL.md before improvising a research plan.
141
+ PT: `pesquisar`, `pesquisa`, `pesquise`, `investigar`, `buscar info`, `procurar info`, `comparar`, `avaliar biblioteca`, `análise de mercado`, `análise de concorrentes`, `revisão de literatura`.
@@ -1,106 +1,56 @@
1
1
  #!/usr/bin/env bash
2
- # update-index.sh — regenerate /docs/research/index.md and per-folder
3
- # indexes from frontmatter of all docs. Idempotent.
4
- set -euo pipefail
5
-
6
- ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
7
- DIR="${ROOT}/docs/research"
8
- INDEX="${DIR}/index.md"
9
- DEC_DIR="${DIR}/decisions"
10
- DEC_INDEX="${DEC_DIR}/index.md"
11
- MOC_DIR="${DIR}/moc"
12
- MOC_INDEX="${MOC_DIR}/index.md"
2
+ # Regenerates /docs/research/index.md from the frontmatter of every <slug>.md
3
+ # in /docs/research/. Lean: title + agent + accessed_at + path. No frontmatter
4
+ # parser library — uses awk on simple `key: value` pairs.
5
+ #
6
+ # Usage: bash .claude/skills/research/scripts/update-index.sh
13
7
 
14
- mkdir -p "$DIR" "$DEC_DIR" "$MOC_DIR"
8
+ set -euo pipefail
15
9
 
16
- fm_get() {
17
- # fm_get <file> <key>
18
- awk -v k="$2" '
19
- /^---$/ { fm = !fm; next }
20
- fm {
21
- if (match($0, "^" k ":")) {
22
- sub("^" k ":[[:space:]]*", ""); print; exit
10
+ ROOT_DIR="${CLAUDE_PROJECT_DIR:-$(pwd)}"
11
+ RESEARCH_DIR="$ROOT_DIR/docs/research"
12
+ INDEX="$RESEARCH_DIR/index.md"
13
+
14
+ mkdir -p "$RESEARCH_DIR"
15
+
16
+ extract_field() {
17
+ awk -v key="$1" '
18
+ /^---[[:space:]]*$/ { count++; if (count == 2) exit; next }
19
+ count == 1 {
20
+ if ($0 ~ "^"key":") {
21
+ sub("^"key":[[:space:]]*", "")
22
+ gsub(/^"|"$/, "")
23
+ print
24
+ exit
23
25
  }
24
26
  }
25
- ' "$1"
26
- }
27
-
28
- list_topics() {
29
- find "$DIR" -maxdepth 1 -type f -name "*.md" ! -name "index.md" 2>/dev/null | sort
30
- }
31
-
32
- list_decisions() {
33
- find "$DEC_DIR" -maxdepth 1 -type f -name "*.md" ! -name "index.md" 2>/dev/null | sort
34
- }
35
-
36
- list_mocs() {
37
- find "$MOC_DIR" -maxdepth 1 -type f -name "*.md" ! -name "index.md" 2>/dev/null | sort
27
+ ' "$2"
38
28
  }
39
29
 
40
- # ---- root index ----
41
30
  {
42
- echo "# Research Index"
43
- echo
44
- echo "_Auto-generated by \`.claude/skills/research/scripts/update-index.sh\`. Do not edit by hand._"
45
- echo
46
- echo "## Topics"
47
- echo
48
- echo "| Topic | Date | Bucket | Status | Confidence | Sources |"
49
- echo "|-------|------|--------|--------|------------|---------|"
50
- for f in $(list_topics); do
51
- SLUG=$(basename "$f" .md)
52
- DATE=$(fm_get "$f" date); [ -z "$DATE" ] && DATE="—"
53
- BUCKET=$(fm_get "$f" content_type_bucket); [ -z "$BUCKET" ] && BUCKET="—"
54
- STATUS=$(fm_get "$f" freshness); [ -z "$STATUS" ] && STATUS="—"
55
- CONF=$(fm_get "$f" confidence_summary); [ -z "$CONF" ] && CONF="—"
56
- SRC=$(fm_get "$f" sources_count); [ -z "$SRC" ] && SRC="—"
57
- echo "| [${SLUG}](./${SLUG}.md) | ${DATE} | ${BUCKET} | ${STATUS} | ${CONF} | ${SRC} |"
58
- done
59
- echo
60
- echo "## Decisions (ADRs)"
61
- echo
62
- echo "| ADR | Date | Status |"
63
- echo "|-----|------|--------|"
64
- for f in $(list_decisions); do
65
- SLUG=$(basename "$f" .md)
66
- DATE=$(fm_get "$f" date); [ -z "$DATE" ] && DATE="—"
67
- STAT=$(fm_get "$f" status); [ -z "$STAT" ] && STAT="—"
68
- echo "| [${SLUG}](./decisions/${SLUG}.md) | ${DATE} | ${STAT} |"
69
- done
70
- echo
71
- echo "## Maps of Content"
72
- echo
73
- for f in $(list_mocs); do
74
- SLUG=$(basename "$f" .md)
75
- echo "- [${SLUG}](./moc/${SLUG}.md)"
31
+ echo "# /docs/research/ — index"
32
+ echo ""
33
+ echo "_Auto-generated by \`.claude/skills/research/scripts/update-index.sh\`. Do not hand-edit._"
34
+ echo ""
35
+ echo "| Topic | Agent | Last updated | File |"
36
+ echo "|-------|-------|--------------|------|"
37
+
38
+ shopt -s nullglob
39
+ for f in "$RESEARCH_DIR"/*.md; do
40
+ base="$(basename "$f")"
41
+ [[ "$base" == "index.md" ]] && continue
42
+
43
+ title="$(extract_field title "$f" || true)"
44
+ agent="$(extract_field agent "$f" || true)"
45
+ accessed_at="$(extract_field accessed_at "$f" || true)"
46
+
47
+ [[ -z "$title" ]] && title="$base"
48
+ [[ -z "$agent" ]] && agent="—"
49
+ [[ -z "$accessed_at" ]] && accessed_at="—"
50
+
51
+ printf '| %s | %s | %s | [%s](./%s) |\n' \
52
+ "$title" "$agent" "$accessed_at" "$base" "$base"
76
53
  done
77
54
  } > "$INDEX"
78
55
 
79
- # ---- decisions index ----
80
- {
81
- echo "# Architecture Decision Records"
82
- echo
83
- echo "_Auto-generated. Format: Nygard 2011._"
84
- echo
85
- for f in $(list_decisions); do
86
- SLUG=$(basename "$f" .md)
87
- DATE=$(fm_get "$f" date); [ -z "$DATE" ] && DATE="—"
88
- STAT=$(fm_get "$f" status); [ -z "$STAT" ] && STAT="—"
89
- TITLE=$(fm_get "$f" title); [ -z "$TITLE" ] && TITLE="$SLUG"
90
- echo "- **[${SLUG}](./${SLUG}.md)** — ${TITLE} _(${DATE} · ${STAT})_"
91
- done
92
- } > "$DEC_INDEX"
93
-
94
- # ---- moc index ----
95
- {
96
- echo "# Maps of Content"
97
- echo
98
- for f in $(list_mocs); do
99
- SLUG=$(basename "$f" .md)
100
- echo "- [${SLUG}](./${SLUG}.md)"
101
- done
102
- } > "$MOC_INDEX"
103
-
104
56
  echo "updated: $INDEX"
105
- echo "updated: $DEC_INDEX"
106
- echo "updated: $MOC_INDEX"