Skip to content

Commit 77ffb33

Browse files
rrrutledgeclaude
andcommitted
Add analyze-innersource-video Claude Code skill
Adds a Claude Code skill that analyzes an InnerSource Commons community call video against this repo's pattern library: it fetches the talk's transcript and metadata, surveys adjacent patterns, and categorizes the talk's content into Known Instance candidates, clarifications to an existing pattern, or genuinely new pattern candidates - applying a "uniquely InnerSource" filter to screen out generic engineering advice that isn't specific to cross-team, cross-org contribution dynamics. The skill always proposes and asks for confirmation before editing any pattern file or opening a PR - it never auto-commits. This was already used manually to produce the Thales Group Known Instance PR (InnerSourceCommons#909); this commit is the first time the skill itself is checked into the repo rather than living only on one contributor's machine. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent ab1fa17 commit 77ffb33

1 file changed

Lines changed: 178 additions & 0 deletions

File tree

  • .claude/skills/analyze-innersource-video
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
---
2+
name: analyze-innersource-video
3+
description: Analyze an InnerSource conference talk or community video on YouTube and relate it to the InnerSourcePatterns library. Identifies which existing patterns the talk instantiates (Known Instance candidates), where it suggests clarifications to an existing pattern, and whether it justifies drafting a new pattern. Use when given a YouTube URL of an InnerSource-related video and asked to relate it to this repo's pattern library.
4+
---
5+
6+
# Analyze InnerSource Video
7+
8+
## When to use
9+
10+
The user provides a YouTube URL of an InnerSource talk and asks you to compare it to the patterns in this repo. Goals: surface known instances, propose surgical clarifications to existing patterns, and identify genuinely new InnerSource pattern candidates.
11+
12+
## Default behavior
13+
14+
**Propose, never auto-edit.** Always present analysis and use `AskUserQuestion` to confirm direction before making file changes. Never commit or PR without explicit confirmation.
15+
16+
## Workflow
17+
18+
### Step 1 — Fetch transcript and metadata
19+
20+
**Transcript** — use the `youtube-transcript-api` Python library (already available; pip-installable if not). Do *not* try `WebFetch` on YouTube watch pages — it returns only the footer.
21+
22+
Write a script to `.tmp/fetch_transcript.py`:
23+
24+
```python
25+
from youtube_transcript_api import YouTubeTranscriptApi
26+
27+
video_id = "<VIDEO_ID>"
28+
api = YouTubeTranscriptApi()
29+
transcript = api.fetch(video_id)
30+
with open(".tmp/transcript_raw.txt", "w", encoding="utf-8") as f:
31+
for s in transcript:
32+
f.write(f"[{s.start:.1f}] {s.text}\n")
33+
```
34+
35+
Then collapse it to a flat readable form in `.tmp/transcript_flat.txt` (strip timestamps, join, normalize whitespace).
36+
37+
**Metadata** — use `yt-dlp` via `python -m yt_dlp` (the `yt-dlp` binary may not be on PATH on Windows even when the package is installed). Write `.tmp/fetch_metadata.py`:
38+
39+
```python
40+
import json, yt_dlp
41+
opts = {"quiet": True, "skip_download": True, "no_warnings": True}
42+
with yt_dlp.YoutubeDL(opts) as ydl:
43+
info = ydl.extract_info("<URL>", download=False)
44+
keys = ["title", "uploader", "channel", "upload_date", "duration", "description", "tags"]
45+
out = {k: info.get(k) for k in keys}
46+
with open(".tmp/video_metadata.json", "w", encoding="utf-8") as f:
47+
json.dump(out, f, ensure_ascii=False, indent=2)
48+
print(out["title"]); print(out["channel"]); print(out["description"])
49+
```
50+
51+
**The description usually contains speaker name and affiliation when the transcript does not** — this is the single most important reason to fetch metadata even when you have the transcript. Speakers often introduce themselves with just a first name or nickname.
52+
53+
**Fallback for title + channel only:** the YouTube oEmbed endpoint (`https://www.youtube.com/oembed?url=<URL>&format=json`) works through `WebFetch`.
54+
55+
### Step 2 — Summarize the talk
56+
57+
Produce a brief synthesis covering:
58+
59+
- **Title** (from metadata, not from the transcript's spoken title — they often differ)
60+
- **Speaker** — full name from the description; note any nickname the speaker uses in the talk
61+
- **Organization** — from the description
62+
- **Channel / event** — typically the InnerSource Commons channel; the description often names a specific summit or webinar
63+
- **Upload date** — useful for citation
64+
- **Core thesis** in one or two sentences
65+
- **Main artifacts / frameworks** the speaker introduces (named structures, checklists, blueprints, mantras)
66+
- **Memorable lines** — verbatim quotes can become useful in the pattern's Known Instance description
67+
68+
### Step 3 — Survey adjacent patterns
69+
70+
Extract every pattern's title + patlet via a small script (write to `.tmp/extract_patlets.py`). Read the resulting file in full — you want the patlet, not just the title, to judge relevance.
71+
72+
Then pick the 3–6 patterns whose patlets sit closest to the talk's theme and read those in full. Don't rely solely on patlets to judge a match: the talk's content may overlap meaningfully with parts of a pattern that the patlet doesn't surface.
73+
74+
### Step 4 — Categorize the talk's content
75+
76+
For each substantive point in the talk, assign it to one of:
77+
78+
**A. Known Instance candidate** — the talk validates, exemplifies, or vividly re-derives an existing pattern's solution. The right action: add a citation under the pattern's `## Known Instances` section.
79+
80+
**B. Clarification candidate** — the talk surfaces a real gap or vagueness in an existing pattern. The right action: a small, surgical edit that fills the gap without reframing the pattern. Bias toward additions over rewrites; bias toward concrete guidance over editorial framing.
81+
82+
**C. New pattern candidate** — the talk presents a problem/solution pair that no existing pattern covers. The right action: propose drafting a new pattern using the AI-assisted prompt in `meta/pattern-drafts-with-ai.md`.
83+
84+
### Step 5 — Apply the "uniquely InnerSource" filter
85+
86+
**This is the most important judgment call and the easiest mistake to make.** A talk can contain genuinely good engineering advice that is *not* uniquely InnerSource. Examples that look like new patterns but probably aren't:
87+
88+
- "Treat docs like code" — general dev advice; well-trodden outside InnerSource.
89+
- "Write better READMEs" — general OSS / dev advice.
90+
- "Use linters / CI / automation" — general engineering.
91+
92+
What *is* uniquely InnerSource — the signal you're looking for:
93+
94+
- It addresses the specific dynamic of **contributors who are not on the host team** (no shared context, no shared OKRs, no shared manager).
95+
- It addresses **cross-team collaboration friction** inside one company (Trusted Committers, escalation, ownership ambiguity, dual-line-management tension).
96+
- It addresses **incentive misalignment** between a developer's team goals and contributing to a shared project.
97+
- It addresses **scaling InnerSource adoption** across an organization (ambassadors, ISPO, governance levels).
98+
99+
If the talk's central insight would be equally at home in a generic "good engineering" talk, it is not new-pattern material. It may still be a Known Instance or a clarification.
100+
101+
### Step 6 — Present analysis
102+
103+
Present a clear, three-part writeup to the user:
104+
105+
1. **Talk summary** (5–10 lines: speaker, org, thesis, blueprint)
106+
2. **Mapping to existing patterns** with confidence labels (strong match, partial match, tangential)
107+
3. **Candidate actions** organized as: Known Instances to add, clarifications to make, new pattern candidates (with the "uniquely InnerSource" filter applied)
108+
109+
Then use `AskUserQuestion` to confirm which actions to take. **Do not edit any file before this confirmation.** If the user is non-committal ("you decide"), make a confident recommendation in your own voice rather than asking again.
110+
111+
### Step 7 — Apply chosen actions
112+
113+
**For Known Instance citations:**
114+
115+
- Match the existing style of that pattern's Known Instances section — typically `* **<Organization>** - <one-or-two-sentence description>` with the URL inline.
116+
- The lead bold should be the speaker's *organization*, not "Community talk" or similar meta-labels — the existing entries are all organizational, so use the same convention. If you cannot find an organization, ask the user before defaulting to a placeholder.
117+
- Quote a memorable line or describe the framework concisely. Cite the YouTube link.
118+
119+
**For clarifications:**
120+
121+
- Stay surgical. Prefer adding a new subsection or bullet over rewriting an existing one.
122+
- If the change touches the pattern's templates (e.g. `templates/README-template.md`), edit those too.
123+
- Cross-link to other related patterns when distinguishing what the talk adds vs. what's already covered (e.g. distinguishing a contributor-facing system map from ADRs).
124+
125+
**For new patterns:**
126+
127+
- Use the prompt in `meta/pattern-drafts-with-ai.md` as the basis for drafting.
128+
- File name: lowercase, hyphenated, matching the title. Place in `patterns/1-initial/`.
129+
- Set Status to `Initial`, Known Instances to the talk itself, Author to TBD, omit Acknowledgments.
130+
- Be honest about what evidence the talk provides — one talk is one data point, not proof a pattern is widely applicable.
131+
132+
### Step 8 — Git workflow
133+
134+
- **Always branch off `main`**, not whichever branch the user is currently on. Confirm with `git status` and `git branch --show-current` first.
135+
- **One concern per PR** when possible: a Known Instance citation, a pattern clarification, and a new pattern draft are three separate concerns and may deserve separate PRs.
136+
- Match the repo's commit message style: sentence-case subject, no conventional-commit prefix (check `git log --oneline -5` for recent style).
137+
- Write the commit message body to `.tmp/commit_msg.txt` and use `git commit -F` (per user's no-heredocs rule).
138+
- Open the PR against `InnerSourceCommons/InnerSourcePatterns` upstream `main` (the user's fork is `origin`).
139+
- Include a `## Test plan` checklist in the PR body — the repo's convention.
140+
- Ask the user before pushing/PRing rather than auto-proceeding.
141+
142+
## Anti-patterns to avoid
143+
144+
- Don't use `WebFetch` on YouTube watch pages — it returns only the footer. Use `youtube-transcript-api` and `yt-dlp` instead.
145+
- Don't trust the spoken introduction for the speaker's organization — get it from the video description.
146+
- Don't add a Known Instance entry labeled "Community talk" or similar generic placeholder — the convention is to lead with the speaker's organization.
147+
- Don't propose "Treat docs like code" or similar generic-engineering ideas as new InnerSource patterns. Apply the Step 5 filter.
148+
- Don't bundle multiple PRs into one commit on the same branch — separate concerns deserve separate PRs.
149+
- Don't auto-commit or auto-push without confirmation from the user, even on "high confidence" calls — community library content warrants a human in the loop.
150+
- Don't write the commit message via heredoc — write to `.tmp/commit_msg.txt` and use `git commit -F`.
151+
152+
## Output format for the user-facing analysis
153+
154+
Structure the final writeup as:
155+
156+
```
157+
## Video summary
158+
<5–10 lines>
159+
160+
## How it maps to the existing pattern library
161+
162+
### Strong match — Known Instance candidate
163+
**[Pattern Name](patterns/.../file.md)**
164+
<why this talk is a known instance>
165+
166+
### Partial / adjacent match
167+
**[Pattern Name](patterns/.../file.md)**
168+
<what overlaps, what differs>
169+
170+
### Candidate new patterns
171+
**Candidate A — "<name>"**
172+
<problem/solution; "uniquely InnerSource" rationale or honest reason it's borderline>
173+
174+
## Recommendation
175+
<which actions to take, in confident voice>
176+
```
177+
178+
Then `AskUserQuestion` to confirm.

0 commit comments

Comments
 (0)