opencode-skills-collection 4.0.69 → 4.0.70
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/bundled-skills/.antigravity-install-manifest.json +39 -1
- package/bundled-skills/api-integration-architect/SKILL.md +241 -0
- package/bundled-skills/apify-generate-output-schema/SKILL.md +438 -0
- package/bundled-skills/apify-integration-development/SKILL.md +168 -0
- package/bundled-skills/apify-integration-development/references/ai-framework-package.md +158 -0
- package/bundled-skills/apify-integration-development/references/ai-harness-plugin.md +192 -0
- package/bundled-skills/apify-integration-development/references/sdk-integration.md +236 -0
- package/bundled-skills/apify-integration-development/references/workflow-automation.md +163 -0
- package/bundled-skills/architecture-review/README.md +42 -0
- package/bundled-skills/architecture-review/SKILL.md +77 -0
- package/bundled-skills/architecture-review/examples.md +11 -0
- package/bundled-skills/architecture-review/reference/best-practices.md +7 -0
- package/bundled-skills/architecture-review/reference/capabilities.md +20 -0
- package/bundled-skills/architecture-review/reference/fallbacks.md +11 -0
- package/bundled-skills/architecture-review/reference/graph.md +15 -0
- package/bundled-skills/architecture-review/reference/mcp.md +14 -0
- package/bundled-skills/architecture-review/reference/workflow.md +15 -0
- package/bundled-skills/architecture-review/templates/architecture-review.md +21 -0
- package/bundled-skills/code-review-sensei/SKILL.md +177 -0
- package/bundled-skills/codebase-onboarding/README.md +42 -0
- package/bundled-skills/codebase-onboarding/SKILL.md +77 -0
- package/bundled-skills/codebase-onboarding/examples.md +11 -0
- package/bundled-skills/codebase-onboarding/reference/best-practices.md +7 -0
- package/bundled-skills/codebase-onboarding/reference/capabilities.md +20 -0
- package/bundled-skills/codebase-onboarding/reference/fallbacks.md +11 -0
- package/bundled-skills/codebase-onboarding/reference/graph.md +15 -0
- package/bundled-skills/codebase-onboarding/reference/mcp.md +14 -0
- package/bundled-skills/codebase-onboarding/reference/workflow.md +15 -0
- package/bundled-skills/codebase-onboarding/templates/repository-onboarding.md +21 -0
- package/bundled-skills/connection-auth-rules/SKILL.md +199 -0
- package/bundled-skills/connection-auth-rules/fetch_schema.py +320 -0
- package/bundled-skills/dependency-analysis/README.md +42 -0
- package/bundled-skills/dependency-analysis/SKILL.md +76 -0
- package/bundled-skills/dependency-analysis/examples.md +11 -0
- package/bundled-skills/dependency-analysis/reference/best-practices.md +7 -0
- package/bundled-skills/dependency-analysis/reference/capabilities.md +20 -0
- package/bundled-skills/dependency-analysis/reference/fallbacks.md +11 -0
- package/bundled-skills/dependency-analysis/reference/graph.md +15 -0
- package/bundled-skills/dependency-analysis/reference/mcp.md +14 -0
- package/bundled-skills/dependency-analysis/reference/workflow.md +15 -0
- package/bundled-skills/dependency-analysis/templates/dependency-review.md +21 -0
- package/bundled-skills/devops-pipeline-builder/SKILL.md +200 -0
- package/bundled-skills/eas-app-stores/SKILL.md +197 -0
- package/bundled-skills/eas-app-stores/agents/openai.yaml +4 -0
- package/bundled-skills/eas-app-stores/references/app-store-metadata.md +497 -0
- package/bundled-skills/eas-app-stores/references/ios-app-store.md +376 -0
- package/bundled-skills/eas-app-stores/references/native-ios.md +167 -0
- package/bundled-skills/eas-app-stores/references/play-store.md +244 -0
- package/bundled-skills/eas-app-stores/references/testflight.md +62 -0
- package/bundled-skills/eas-app-stores/references/workflows.md +120 -0
- package/bundled-skills/eas-hosting/SKILL.md +448 -0
- package/bundled-skills/eas-hosting/agents/openai.yaml +4 -0
- package/bundled-skills/eas-observe/SKILL.md +75 -0
- package/bundled-skills/eas-observe/agents/openai.yaml +4 -0
- package/bundled-skills/eas-observe/references/metrics.md +98 -0
- package/bundled-skills/eas-observe/references/queries.md +403 -0
- package/bundled-skills/eas-observe/references/setup.md +476 -0
- package/bundled-skills/eas-observe/references/third-party.md +136 -0
- package/bundled-skills/eas-simulator/SKILL.md +251 -0
- package/bundled-skills/eas-simulator/agents/openai.yaml +4 -0
- package/bundled-skills/eas-simulator/references/controllers.md +135 -0
- package/bundled-skills/eas-simulator/references/run-your-app.md +240 -0
- package/bundled-skills/eas-simulator/references/troubleshooting.md +47 -0
- package/bundled-skills/eas-workflows/SKILL.md +119 -0
- package/bundled-skills/eas-workflows/agents/openai.yaml +4 -0
- package/bundled-skills/eas-workflows/scripts/fetch.js +109 -0
- package/bundled-skills/expo-animation/LICENSE +21 -0
- package/bundled-skills/expo-animation/RECIPES.md +385 -0
- package/bundled-skills/expo-animation/SKILL.md +295 -0
- package/bundled-skills/expo-animation/agents/openai.yaml +4 -0
- package/bundled-skills/fact-check-x-unified/SKILL.md +178 -0
- package/bundled-skills/fact-check-x-unified/agents/openai.yaml +4 -0
- package/bundled-skills/fact-check-x-unified/references/acceptance-criteria.md +44 -0
- package/bundled-skills/fact-check-x-unified/references/contracts.md +39 -0
- package/bundled-skills/fact-check-x-unified/scripts/common.py +31 -0
- package/bundled-skills/fact-check-x-unified/scripts/fact_check_x.py +1832 -0
- package/bundled-skills/fact-check-x-unified/scripts/trusted_search_config.py +324 -0
- package/bundled-skills/fact-check-x-unified/tests/anchor_downgrade_test.py +90 -0
- package/bundled-skills/fact-check-x-unified/tests/multi_platform_test.py +369 -0
- package/bundled-skills/fact-check-x-unified/tests/smoke_test.py +740 -0
- package/bundled-skills/fact-check-x-unified/tests/stage_checkpoint_test.py +103 -0
- package/bundled-skills/fact-check-x-unified/tests/trusted_search_config_test.py +156 -0
- package/bundled-skills/gpt-taste/SKILL.md +8 -1
- package/bundled-skills/hf-cli/SKILL.md +263 -0
- package/bundled-skills/huggingface-community-evals/SKILL.md +228 -0
- package/bundled-skills/huggingface-community-evals/examples/.env.example +3 -0
- package/bundled-skills/huggingface-community-evals/examples/USAGE_EXAMPLES.md +101 -0
- package/bundled-skills/huggingface-community-evals/scripts/inspect_eval_uv.py +104 -0
- package/bundled-skills/huggingface-community-evals/scripts/inspect_vllm_uv.py +306 -0
- package/bundled-skills/huggingface-community-evals/scripts/lighteval_vllm_uv.py +297 -0
- package/bundled-skills/huggingface-datasets/SKILL.md +130 -0
- package/bundled-skills/jev-social/SKILL.md +182 -0
- package/bundled-skills/longbridge-derivatives/SKILL.md +117 -0
- package/bundled-skills/longbridge-derivatives/references/option.md +36 -0
- package/bundled-skills/longbridge-derivatives/references/options-advanced.md +101 -0
- package/bundled-skills/longbridge-derivatives/references/options-pnl.md +74 -0
- package/bundled-skills/longbridge-derivatives/references/options-strategy.md +82 -0
- package/bundled-skills/longbridge-derivatives/references/options-volatility.md +70 -0
- package/bundled-skills/longbridge-derivatives/references/warrant.md +12 -0
- package/bundled-skills/longbridge-quant/SKILL.md +151 -0
- package/bundled-skills/longbridge-quant/references/correlation.md +51 -0
- package/bundled-skills/longbridge-quant/references/execution-model.md +68 -0
- package/bundled-skills/longbridge-quant/references/factor-research.md +95 -0
- package/bundled-skills/longbridge-quant/references/factor-screen.md +101 -0
- package/bundled-skills/longbridge-quant/references/hedging.md +136 -0
- package/bundled-skills/longbridge-quant/references/ml-strategy.md +77 -0
- package/bundled-skills/longbridge-quant/references/multifactor.md +68 -0
- package/bundled-skills/longbridge-quant/references/pairs-trading.md +61 -0
- package/bundled-skills/longbridge-quant/references/quant-cli.md +133 -0
- package/bundled-skills/longbridge-quant/references/quant-stats.md +150 -0
- package/bundled-skills/longbridge-quant/references/seasonality.md +50 -0
- package/bundled-skills/longbridge-quant/references/strategy-optimizer.md +68 -0
- package/bundled-skills/longbridge-quant/references/volatility-strategy.md +52 -0
- package/bundled-skills/longbridge-research/SKILL.md +187 -0
- package/bundled-skills/longbridge-research/references/company-profile.md +96 -0
- package/bundled-skills/longbridge-research/references/company-tearsheet.md +82 -0
- package/bundled-skills/longbridge-research/references/competitive-analysis.md +81 -0
- package/bundled-skills/longbridge-research/references/consensus.md +92 -0
- package/bundled-skills/longbridge-research/references/coverage-initiation.md +76 -0
- package/bundled-skills/longbridge-research/references/defi-yield.md +60 -0
- package/bundled-skills/longbridge-research/references/finance-calendar.md +165 -0
- package/bundled-skills/longbridge-research/references/financial-planning.md +77 -0
- package/bundled-skills/longbridge-research/references/forecast-eps.md +39 -0
- package/bundled-skills/longbridge-research/references/fund-holder.md +44 -0
- package/bundled-skills/longbridge-research/references/hkipo-analysis.md +101 -0
- package/bundled-skills/longbridge-research/references/industry-peers.md +46 -0
- package/bundled-skills/longbridge-research/references/industry-rank.md +62 -0
- package/bundled-skills/longbridge-research/references/insider-trades.md +48 -0
- package/bundled-skills/longbridge-research/references/institution-rating.md +62 -0
- package/bundled-skills/longbridge-research/references/investment-ideas.md +69 -0
- package/bundled-skills/longbridge-research/references/investment-proposal.md +95 -0
- package/bundled-skills/longbridge-research/references/investors.md +87 -0
- package/bundled-skills/longbridge-research/references/onchain.md +70 -0
- package/bundled-skills/longbridge-research/references/post-investment.md +76 -0
- package/bundled-skills/longbridge-research/references/shareholder.md +72 -0
- package/bundled-skills/longbridge-research/references/short-positions.md +50 -0
- package/bundled-skills/longbridge-research/references/short-trades.md +50 -0
- package/bundled-skills/longbridge-research/references/stock-research.md +61 -0
- package/bundled-skills/longbridge-research/references/thesis-tracker.md +64 -0
- package/bundled-skills/makepad-2-0-animation/SKILL.md +318 -0
- package/bundled-skills/makepad-2-0-animation/references/animator-reference.md +433 -0
- package/bundled-skills/makepad-2-0-dsl/SKILL.md +492 -0
- package/bundled-skills/makepad-2-0-dsl/references/dsl-syntax-reference.md +511 -0
- package/bundled-skills/makepad-2-0-dsl/references/extended-guide.md +56 -0
- package/bundled-skills/makepad-2-0-dsl/references/property-system.md +757 -0
- package/bundled-skills/makepad-2-0-events/SKILL.md +497 -0
- package/bundled-skills/makepad-2-0-events/references/event-patterns.md +802 -0
- package/bundled-skills/makepad-2-0-events/references/extended-guide.md +590 -0
- package/bundled-skills/makepad-2-0-layout/SKILL.md +499 -0
- package/bundled-skills/makepad-2-0-layout/references/extended-guide.md +243 -0
- package/bundled-skills/makepad-2-0-layout/references/layout-patterns.md +881 -0
- package/bundled-skills/makepad-2-0-widgets/SKILL.md +261 -0
- package/bundled-skills/makepad-2-0-widgets/references/widget-advanced.md +648 -0
- package/bundled-skills/makepad-2-0-widgets/references/widget-catalog.md +547 -0
- package/bundled-skills/meeting-distiller-pro/SKILL.md +120 -0
- package/bundled-skills/monte-carlo-analyze-root-cause/SKILL.md +12 -1
- package/bundled-skills/monte-carlo-asset-health/SKILL.md +12 -1
- package/bundled-skills/monte-carlo-context-detection/SKILL.md +170 -0
- package/bundled-skills/monte-carlo-context-detection/references/signal-definitions.md +46 -0
- package/bundled-skills/remotion-captions/SKILL.md +57 -0
- package/bundled-skills/remotion-captions/agents/openai.yaml +7 -0
- package/bundled-skills/remotion-captions/assets/remotion-icon.svg +4 -0
- package/bundled-skills/remotion-captions/display-captions.md +190 -0
- package/bundled-skills/remotion-captions/import-srt-captions.md +73 -0
- package/bundled-skills/remotion-captions/transcribe-captions.md +70 -0
- package/bundled-skills/remotion-create/SKILL.md +106 -0
- package/bundled-skills/remotion-create/agents/openai.yaml +7 -0
- package/bundled-skills/remotion-create/assets/remotion-icon.svg +4 -0
- package/bundled-skills/remotion-create/tailwind.md +11 -0
- package/bundled-skills/remotion-create/video-layout.md +9 -0
- package/bundled-skills/remotion-docs/SKILL.md +67 -0
- package/bundled-skills/remotion-docs/agents/openai.yaml +7 -0
- package/bundled-skills/remotion-docs/assets/remotion-icon.svg +4 -0
- package/bundled-skills/remotion-interactivity/SKILL.md +270 -0
- package/bundled-skills/remotion-interactivity/agents/openai.yaml +7 -0
- package/bundled-skills/remotion-interactivity/assets/remotion-icon.svg +4 -0
- package/bundled-skills/remotion-render/SKILL.md +48 -0
- package/bundled-skills/remotion-render/agents/openai.yaml +7 -0
- package/bundled-skills/remotion-render/assets/remotion-icon.svg +4 -0
- package/bundled-skills/remotion-render/transparent-videos.md +106 -0
- package/bundled-skills/saas-pricing-strategist/SKILL.md +169 -0
- package/bundled-skills/score-eval/SKILL.md +35 -0
- package/bundled-skills/writing-guidelines/SKILL.md +60 -0
- package/package.json +1 -1
- package/skills_index.json +980 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: Curated upstream guidance for Monte Carlo Asset Health; use when the workflow matches the user goal.
|
|
2
3
|
name: monte-carlo-asset-health
|
|
3
|
-
description: Check the health of a data table/asset using Monte Carlo. Activates on "how is table X", "check health of X", "is X healthy", "status of X", "check on X table", or any health/status question about a data asset.
|
|
4
4
|
risk: critical
|
|
5
5
|
source: https://github.com/monte-carlo-data/mc-agent-toolkit/tree/main/skills/asset-health
|
|
6
6
|
source_repo: monte-carlo-data/mc-agent-toolkit
|
|
@@ -9,6 +9,9 @@ date_added: 2026-07-01
|
|
|
9
9
|
license: Apache-2.0
|
|
10
10
|
license_source: https://github.com/monte-carlo-data/mc-agent-toolkit/blob/main/LICENSE
|
|
11
11
|
---
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- Use when the user goal matches this upstream workflow.
|
|
12
15
|
|
|
13
16
|
# Monte Carlo Asset Health Skill
|
|
14
17
|
|
|
@@ -193,6 +196,14 @@ Only include recommendations derivable from collected data:
|
|
|
193
196
|
- Active alerts that need acknowledgment or investigation
|
|
194
197
|
- Do NOT recommend specific monitor types — that is outside this skill's scope
|
|
195
198
|
|
|
199
|
+
|
|
200
|
+
## Examples
|
|
201
|
+
|
|
202
|
+
```text
|
|
203
|
+
User: Apply this skill to my current task.
|
|
204
|
+
Assistant: Follow the workflow in this skill, cite limitations, and ask before risky steps.
|
|
205
|
+
```
|
|
206
|
+
|
|
196
207
|
## Limitations
|
|
197
208
|
|
|
198
209
|
- Use this skill only when the task clearly matches its upstream source and local project context.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monte-carlo-context-detection
|
|
3
|
+
description: Route data-related requests to the right Monte Carlo skill or workflow.
|
|
4
|
+
USE WHEN alerts, incidents, data broken, stale, coverage gaps, data quality, or
|
|
5
|
+
any ambiguous data observability request.
|
|
6
|
+
when_to_use: 'Invoke for ambiguous or incomplete data-observability requests that
|
|
7
|
+
don''t clearly name a specific skill.
|
|
8
|
+
|
|
9
|
+
Example triggers: "something is wrong with my data", "I have alerts firing", "check
|
|
10
|
+
my pipelines", "what should I monitor?", "my data looks off".
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
CRITICAL on vague first turns: ALWAYS ask 1–3 targeted clarifying questions FIRST
|
|
14
|
+
(what symptom? which table/warehouse? when did it start?). Do NOT call Monte Carlo
|
|
15
|
+
MCP tools (get_alerts, search, get_table, etc.) on turn 1 until the user has named
|
|
16
|
+
a specific table, warehouse, or alert. Calling tools prematurely on a vague prompt
|
|
17
|
+
wastes turns and frustrates the user.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
Do NOT invoke when the user''s intent clearly matches a single existing skill (e.g.
|
|
21
|
+
"check health of orders table" → asset-health; "create a volume monitor on X" →
|
|
22
|
+
monitoring-advisor).
|
|
23
|
+
|
|
24
|
+
'
|
|
25
|
+
bucket: Agent-routing
|
|
26
|
+
version: 1.0.0
|
|
27
|
+
source_repo: monte-carlo-data/mc-agent-toolkit
|
|
28
|
+
source_type: community
|
|
29
|
+
source: community
|
|
30
|
+
date_added: '2026-09-21'
|
|
31
|
+
risk: unknown
|
|
32
|
+
---
|
|
33
|
+
## When to Use
|
|
34
|
+
- Use when this upstream workflow matches the user's stated goal.
|
|
35
|
+
- Use when the task requires the procedures documented in this skill.
|
|
36
|
+
|
|
37
|
+
# Monte Carlo Context Detection
|
|
38
|
+
|
|
39
|
+
This skill determines which Monte Carlo skill or workflow best fits the user's current context. It activates reactively for ambiguous or multi-step data-related messages, gathers signals, and routes to the right skill or workflow.
|
|
40
|
+
|
|
41
|
+
> **Monte Carlo tool routing (required):** Always call Monte Carlo MCP tools through this plugin's
|
|
42
|
+
> bundled server, whose fully-qualified tool names are
|
|
43
|
+
> `mcp__plugin_mc-agent-toolkit_monte-carlo-mcp__<tool>` (e.g.
|
|
44
|
+
> `mcp__plugin_mc-agent-toolkit_monte-carlo-mcp__get_alerts`). Bare tool names used in this skill
|
|
45
|
+
> (`get_alerts`, `search`, `get_table`, …) refer to that bundled server. If the session also has a
|
|
46
|
+
> separately-configured `monte-carlo-mcp` server, do **not** route to it — it may point at a
|
|
47
|
+
> different endpoint or credentials.
|
|
48
|
+
|
|
49
|
+
Reference file for signal definitions: `references/signal-definitions.md` (relative to this file). Read it before routing.
|
|
50
|
+
|
|
51
|
+
## When to activate this skill
|
|
52
|
+
|
|
53
|
+
This skill is activated by the CLAUDE.md routing table when:
|
|
54
|
+
|
|
55
|
+
- The user's message relates to data quality, alerts, incidents, coverage, or Monte Carlo — but doesn't clearly match a single skill in the routing table
|
|
56
|
+
- The user's intent is ambiguous or could span multiple skills
|
|
57
|
+
- The user asks a broad question like "help me with my data" or "what's going on?"
|
|
58
|
+
|
|
59
|
+
## When NOT to activate this skill
|
|
60
|
+
|
|
61
|
+
- A skill or workflow is already active in the conversation — the active skill owns the conversation, do not intercept
|
|
62
|
+
- The user's message clearly matches a single skill in the CLAUDE.md routing table — route directly, no need for context detection
|
|
63
|
+
- The user is editing a dbt model — defer to the `prevent` skill which auto-activates via hooks
|
|
64
|
+
- The user's message is not data-related at all
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Workflow: Reactive Routing
|
|
69
|
+
|
|
70
|
+
This skill is purely reactive — it activates for ambiguous or multi-step data-related messages and routes them.
|
|
71
|
+
|
|
72
|
+
Follow these steps in order.
|
|
73
|
+
|
|
74
|
+
### Step 0: Fast-path clear intent (stop early if matched)
|
|
75
|
+
|
|
76
|
+
Before doing anything else, check whether the user's message unambiguously matches a single existing skill. If so, **skip the rest of this workflow** and immediately load that skill — do NOT read `references/signal-definitions.md`, do NOT make API probes.
|
|
77
|
+
|
|
78
|
+
| Clear user intent | Skill to load immediately |
|
|
79
|
+
|---|---|
|
|
80
|
+
| "Check health of [named table]" / "status of [named table]" | `../asset-health/SKILL.md` |
|
|
81
|
+
| "Create a [monitor type] on [named table]" | `../monitoring-advisor/SKILL.md` |
|
|
82
|
+
| "Investigate alert on [named table]" / "why is [named table] stale/broken?" | `../incident-response/SKILL.md` |
|
|
83
|
+
| "What should I monitor?" / "where are my coverage gaps?" | `../proactive-monitoring/SKILL.md` |
|
|
84
|
+
| "Instrument my agent" / "set up Monte Carlo tracing on [named framework] agent" / "setting up an agent" | `../instrument-agent/SKILL.md` |
|
|
85
|
+
|
|
86
|
+
Context-detection is for **ambiguous** requests only. If the request is clear, routing through this skill wastes turns and tokens.
|
|
87
|
+
|
|
88
|
+
If no clear match, proceed to Step 1.
|
|
89
|
+
|
|
90
|
+
### Step 1: Categorize intent
|
|
91
|
+
|
|
92
|
+
Read `references/signal-definitions.md` for the full signal catalog. Determine which category the user's message falls into:
|
|
93
|
+
|
|
94
|
+
| Category | Signals | Example messages |
|
|
95
|
+
|----------|---------|-----------------|
|
|
96
|
+
| **Specific asset** | User mentions a table name, or has a `.sql` model file open in their IDE | "what's wrong with stg_payments?", "check this table" |
|
|
97
|
+
| **Active incident** | Keywords: alert, broken, stale, failing, incident, triage, wrong data | "I have alerts firing", "data looks wrong", "something broke" |
|
|
98
|
+
| **Coverage/monitoring** | Keywords: monitor, coverage, gaps, unmonitored, what should I watch | "what should I monitor?", "where are my gaps?" |
|
|
99
|
+
| **Agent instrumentation** | Keywords: instrument, set up tracing, set up Monte Carlo tracing, setting up an agent. Often mentions an AI framework (LangChain, LangGraph, OpenAI, Anthropic, CrewAI, Bedrock, SageMaker, Vertex AI) | "instrument my agent", "set up MC tracing on my LangGraph agent", "setting up an agent" |
|
|
100
|
+
| **General/exploratory** | No clear category, broad question | "help me with data quality", "what can Monte Carlo do?" |
|
|
101
|
+
|
|
102
|
+
### Step 2: Gather scope (only if needed)
|
|
103
|
+
|
|
104
|
+
- **Specific asset known** (from file context or user mention) → proceed to Step 3
|
|
105
|
+
- **Active incident, no scope** → ask: "Want me to check recent alerts? Any specific time range or severity?"
|
|
106
|
+
- **Coverage/monitoring, no scope** → ask: "Which warehouse should I look at, or should I check across all?"
|
|
107
|
+
- **General/exploratory** → present the categories: "I can help with: (1) investigating active alerts or data issues, (2) analyzing monitoring coverage and creating monitors, or (3) checking the health of specific tables. What are you looking for?"
|
|
108
|
+
|
|
109
|
+
### Step 3: Scoped API probe (when scope is available)
|
|
110
|
+
|
|
111
|
+
Only make API calls when you have enough context to scope them:
|
|
112
|
+
|
|
113
|
+
- **Specific asset** → call `get_alerts` with the table's MCON or name filter, and `get_monitors` for that table
|
|
114
|
+
- **Active incident with scope** → call `get_alerts` with the user's time range / severity filters
|
|
115
|
+
- **Coverage/monitoring** → skip API probe, route directly to proactive monitoring workflow (it handles its own API calls)
|
|
116
|
+
- **If MCP tool calls fail** (auth not configured) → skip API, fall back to conversation intent alone
|
|
117
|
+
|
|
118
|
+
**Always scope MCP calls tightly.** Unscoped `get_alerts`, `search`, or `get_monitors` on large accounts can return hundreds of results, overflow the tool-result token limit, spill to disk, and force expensive chunk reads — burning user tokens and risking workflow failure. Minimum scoping:
|
|
119
|
+
|
|
120
|
+
- `get_alerts` → time filter (`created_after`, default last 7 days) + at least one of `warehouse`, `table_names`, `severity`
|
|
121
|
+
- `search` → needed to resolve a table name to its MCON (`get_table` requires MCON). ALWAYS pass `limit` (e.g. 5), the table name as `query`, and filter by `warehouse_uuid` or `database`/`schema`. `warehouse_types` alone ("snowflake") matches thousands of tables. Disambiguation rules when multiple matches return:
|
|
122
|
+
1. If the user named a warehouse (e.g. "analytics-snowflake") → auto-pick the match whose `warehouse_display_name` matches and proceed. Do NOT stop to ask.
|
|
123
|
+
2. If the user named a database/schema → auto-pick the match in that database/schema.
|
|
124
|
+
3. If one match is flagged `is_key_asset: true` and others aren't → auto-pick the key asset.
|
|
125
|
+
4. Only ask the user to disambiguate when none of the above resolve it.
|
|
126
|
+
- `get_monitors` → always filter by `mcons` (table MCON) or `warehouse_uuid`
|
|
127
|
+
|
|
128
|
+
If you don't have enough scope, ask the user before calling.
|
|
129
|
+
|
|
130
|
+
### Step 4: Route
|
|
131
|
+
|
|
132
|
+
Based on the combined signals from Steps 1-3:
|
|
133
|
+
|
|
134
|
+
| Combined signals | Confidence | Action |
|
|
135
|
+
|-----------------|------------|--------|
|
|
136
|
+
| Active alerts found + incident intent | High | **Auto-activate** incident response workflow: read and follow `../incident-response/SKILL.md` |
|
|
137
|
+
| Coverage intent + data project detected | High | **Auto-activate** proactive monitoring workflow: read and follow `../proactive-monitoring/SKILL.md` |
|
|
138
|
+
| User asks to create a specific monitor (type + table known) | High | **Auto-activate** monitoring-advisor: read and follow `../monitoring-advisor/SKILL.md` |
|
|
139
|
+
| Table mentioned + "health" / "status" / "check" intent | High | **Auto-activate** asset-health: read and follow `../asset-health/SKILL.md` |
|
|
140
|
+
| Agent instrumentation intent (instrument / set up tracing / setting up an agent) + Python codebase context | High | **Auto-activate** instrument-agent: read and follow `../instrument-agent/SKILL.md` |
|
|
141
|
+
| Ambiguous or conflicting signals | Low | **Suggest** options and wait for user to choose |
|
|
142
|
+
|
|
143
|
+
**High confidence = auto-activate.** Load the target skill's SKILL.md and begin executing it immediately. Do not ask for confirmation.
|
|
144
|
+
|
|
145
|
+
**Low confidence = suggest.** Present 2-3 options with brief descriptions and let the user choose. Example:
|
|
146
|
+
|
|
147
|
+
> "Based on what you've described, I can:
|
|
148
|
+
> 1. **Investigate alerts** — triage and fix active data issues (incident response workflow)
|
|
149
|
+
> 2. **Improve monitoring** — find coverage gaps and create monitors (proactive monitoring workflow)
|
|
150
|
+
>
|
|
151
|
+
> Which would be most helpful?"
|
|
152
|
+
|
|
153
|
+
### Prevent guardrail
|
|
154
|
+
|
|
155
|
+
If the user is **actively editing** a dbt model file (making code changes, not just viewing or asking about it) and the `prevent` skill's hooks are active, do NOT route to any other skill. Instead respond:
|
|
156
|
+
|
|
157
|
+
> "The prevent skill will automatically handle impact assessment for dbt model changes via its pre-edit hooks. No additional routing needed."
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
## Examples
|
|
161
|
+
|
|
162
|
+
```text
|
|
163
|
+
User: Apply this skill to my current task.
|
|
164
|
+
Assistant: Follow the workflow in this skill, cite limitations, and ask before risky steps.
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Limitations
|
|
168
|
+
|
|
169
|
+
- Imported upstream skill; verify credentials, permissions, and safety boundaries before execution.
|
|
170
|
+
- Does not replace environment-specific validation, testing, or maintainer review.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Signal Definitions
|
|
2
|
+
|
|
3
|
+
This file documents each signal used by the context detection skill, its source,
|
|
4
|
+
reliability, and what it maps to. Update this file when adding a new skill or
|
|
5
|
+
workflow to the routing system.
|
|
6
|
+
|
|
7
|
+
## Workspace Signals (detected via file system)
|
|
8
|
+
|
|
9
|
+
| Signal | Detection method | Reliability | Meaning |
|
|
10
|
+
|--------|-----------------|-------------|---------|
|
|
11
|
+
| `dbt_project.yml` exists | Glob from workspace root | High | This is a dbt project — `prevent` skill is relevant for model edits |
|
|
12
|
+
| `montecarlo.yml` exists | Glob from workspace root | High | Monte Carlo monitors-as-code is configured — monitoring skills are relevant |
|
|
13
|
+
| User has a `.sql` model file open | IDE context / file path in conversation | High | Specific table context available — extract table name from filename |
|
|
14
|
+
|
|
15
|
+
## Conversation Signals (detected from user message)
|
|
16
|
+
|
|
17
|
+
| Signal | Keywords / patterns | Maps to |
|
|
18
|
+
|--------|-------------------|---------|
|
|
19
|
+
| Incident intent | "alert", "broken", "stale", "failing", "incident", "triage", "wrong data", "data issue" | Incident response workflow |
|
|
20
|
+
| Coverage intent | "monitor", "coverage", "gaps", "unmonitored", "what should I watch", "what should I monitor" | Proactive monitoring workflow |
|
|
21
|
+
| Specific monitor creation | "create a monitor", "add a freshness check", "set up validation" + specific table | monitoring-advisor (direct) |
|
|
22
|
+
| Table health | "health", "status", "check on", "how is table X" + specific table | asset-health (direct) |
|
|
23
|
+
| Storage/cost | "cost", "storage", "unused tables", "zombie tables" | storage-cost-analysis (direct) |
|
|
24
|
+
| Performance | "slow", "performance", "expensive query", "pipeline taking long" | performance-diagnosis (direct) |
|
|
25
|
+
| Validation notebook | "validation notebook", "generate validation", "compare baseline" | generate-validation-notebook (direct) |
|
|
26
|
+
| Push ingestion | "push ingestion", "metadata collector", "lineage collector" | push-ingestion (direct) |
|
|
27
|
+
| Agent instrumentation | "instrument my agent", "instrument", "set up tracing", "set up Monte Carlo tracing", "setting up an agent", "add MC tracing" | instrument-agent (direct) |
|
|
28
|
+
| Agent alert / trace investigation | "agent alert", "eval score drop", "agent trace", "agent conversation", "why is my agent failing" | troubleshoot-agent-traces (direct) |
|
|
29
|
+
| Agent reinforcement / fix | "fix my agent", "reinforce my agent", "improve my agent's health", "what should I fix in my agent", "open a PR for my agent" | reinforce-agent (direct) |
|
|
30
|
+
|
|
31
|
+
## API Signals (detected via scoped MCP tool calls)
|
|
32
|
+
|
|
33
|
+
These signals are only gathered when a specific table or scope is known. Never
|
|
34
|
+
call these without scope.
|
|
35
|
+
|
|
36
|
+
| Signal | MCP tool call | What it returns | Maps to |
|
|
37
|
+
|--------|--------------|-----------------|---------|
|
|
38
|
+
| Active alerts on table | `get_alerts` with table filter | Unresolved alerts for the specific table | Incident response workflow (if alerts found) |
|
|
39
|
+
| Monitor coverage on table | `get_monitors` with table MCON | Existing monitors for the table | Informs whether to suggest coverage analysis |
|
|
40
|
+
|
|
41
|
+
## Routing Priority
|
|
42
|
+
|
|
43
|
+
1. **Prevent guardrail** — If user is editing a dbt model, `prevent` owns the session. Do not route.
|
|
44
|
+
2. **Active skill** — If a skill or workflow is already active, do not re-route. The active skill owns the conversation.
|
|
45
|
+
3. **High-confidence match** — Auto-activate the matched skill/workflow.
|
|
46
|
+
4. **Low-confidence match** — Suggest options, let user choose.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: remotion-captions
|
|
3
|
+
description: Transcribing, displaying and animating captions
|
|
4
|
+
version: 4.0.526
|
|
5
|
+
source_repo: remotion-dev/skills
|
|
6
|
+
source_type: official
|
|
7
|
+
source: remotion-dev
|
|
8
|
+
date_added: '2026-09-21'
|
|
9
|
+
risk: unknown
|
|
10
|
+
---
|
|
11
|
+
## When to Use
|
|
12
|
+
- Use when this upstream workflow matches the user's stated goal.
|
|
13
|
+
- Use when the task requires the procedures documented in this skill.
|
|
14
|
+
|
|
15
|
+
All captions must be processed in JSON. The captions must use the [`Caption`](https://www.remotion.dev/docs/captions/caption.md) type which is the following:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import type { Caption } from "@remotion/captions";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This is the definition:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
type Caption = {
|
|
25
|
+
text: string;
|
|
26
|
+
startMs: number;
|
|
27
|
+
endMs: number;
|
|
28
|
+
timestampMs: number | null;
|
|
29
|
+
confidence: number | null;
|
|
30
|
+
pageBreakAfter?: boolean;
|
|
31
|
+
};
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Generating captions
|
|
35
|
+
|
|
36
|
+
To transcribe video and audio files to generate captions, load the [transcribe-captions.md file for more instructions.
|
|
37
|
+
|
|
38
|
+
## Displaying captions
|
|
39
|
+
|
|
40
|
+
To display captions in your video, load the [display-captions.md file for more instructions.
|
|
41
|
+
|
|
42
|
+
## Importing captions
|
|
43
|
+
|
|
44
|
+
To import captions from a .srt file, load the [import-srt-captions.md file for more instructions.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## Examples
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
User: Apply this skill to my current task.
|
|
51
|
+
Assistant: Follow the workflow in this skill, cite limitations, and ask before risky steps.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Limitations
|
|
55
|
+
|
|
56
|
+
- Imported upstream skill; verify credentials, permissions, and safety boundaries before execution.
|
|
57
|
+
- Does not replace environment-specific validation, testing, or maintainer review.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: '/remotion-captions'
|
|
3
|
+
short_description: 'Transcribe, display, and animate captions'
|
|
4
|
+
icon_small: './assets/remotion-icon.svg'
|
|
5
|
+
icon_large: './assets/remotion-icon.svg'
|
|
6
|
+
brand_color: '#0B84F3'
|
|
7
|
+
default_prompt: '$remotion-captions: Transcribe my video and display captions'
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="100" height="100" viewBox="20 30 363 363" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<title>Remotion</title>
|
|
3
|
+
<path d="M148.332 92.9015C143.307 93.1742 139.259 93.9713 135.179 95.5236C133.144 96.2893 129.809 97.957 127.973 99.1108C120.295 103.925 114.443 111.162 111.391 119.584C110.782 121.252 109.136 126.57 108.076 130.23C101.018 154.7 97.0112 181.456 96.1511 209.776C96.0148 214.286 96.0148 225.026 96.1511 229.463C96.728 248.237 98.5216 265.187 101.773 282.472C103.095 289.468 105.213 298.866 106.44 303.135C108.947 311.809 114.065 319.193 121.344 324.605C126.221 328.234 131.759 330.668 137.895 331.863C140.853 332.44 144.755 332.702 147.629 332.514C151.604 332.251 159.491 331.192 165.9 330.049C194.786 324.899 221.469 315.679 245.666 302.485C260.99 294.125 274.09 285.074 286.729 274.092C299.326 263.163 310.066 251.405 319.516 238.21C321.708 235.158 322.81 233.375 323.911 231.131C326.743 225.341 328.075 219.583 328.064 213.143C328.064 207.143 326.932 201.815 324.488 196.361C323.313 193.728 322.191 191.84 319.674 188.253C310.402 175.048 300.112 163.542 287.568 152.361C268.122 135.034 245.026 120.822 219.235 110.302C213.644 108.026 208.138 106.022 201.509 103.851C187.475 99.2681 170.106 95.2929 155.411 93.3105C153.104 92.9959 149.968 92.8176 148.332 92.9015Z" fill="#0B84F3"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: display-captions
|
|
3
|
+
description: Displaying captions in Remotion with TikTok-style pages and word highlighting
|
|
4
|
+
metadata:
|
|
5
|
+
tags: captions, subtitles, display, tiktok, highlight
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Displaying captions in Remotion
|
|
9
|
+
|
|
10
|
+
This guide explains how to display captions in Remotion, assuming you already have captions in the [`Caption`](https://www.remotion.dev/docs/captions/caption) format.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
Read [Transcribing audio](transcribe-captions.md) for how to generate captions.
|
|
15
|
+
|
|
16
|
+
First, the [`@remotion/captions`](https://www.remotion.dev/docs/captions) package needs to be installed.
|
|
17
|
+
If it is not installed, use the following command:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx remotion add @remotion/captions
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Fetching captions
|
|
24
|
+
|
|
25
|
+
First, fetch your captions JSON file. Use [`useDelayRender()`](https://www.remotion.dev/docs/use-delay-render) to hold the render until the captions are loaded:
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { useState, useEffect, useCallback } from "react";
|
|
29
|
+
import { AbsoluteFill, staticFile, useDelayRender } from "remotion";
|
|
30
|
+
import type { Caption } from "@remotion/captions";
|
|
31
|
+
|
|
32
|
+
export const MyComponent: React.FC = () => {
|
|
33
|
+
const [captions, setCaptions] = useState<Caption[] | null>(null);
|
|
34
|
+
const { delayRender, continueRender, cancelRender } = useDelayRender();
|
|
35
|
+
const [handle] = useState(() => delayRender());
|
|
36
|
+
|
|
37
|
+
const fetchCaptions = useCallback(async () => {
|
|
38
|
+
try {
|
|
39
|
+
// Assuming captions.json is in the public/ folder.
|
|
40
|
+
const response = await fetch(staticFile("captions123.json"));
|
|
41
|
+
const data = await response.json();
|
|
42
|
+
setCaptions(data);
|
|
43
|
+
continueRender(handle);
|
|
44
|
+
} catch (e) {
|
|
45
|
+
cancelRender(e);
|
|
46
|
+
}
|
|
47
|
+
}, [continueRender, cancelRender, handle]);
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
fetchCaptions();
|
|
51
|
+
}, [fetchCaptions]);
|
|
52
|
+
|
|
53
|
+
if (!captions) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<AbsoluteFill>
|
|
59
|
+
{/* Render captions here */}
|
|
60
|
+
</AbsoluteFill>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Creating pages
|
|
66
|
+
|
|
67
|
+
Use `createTikTokStyleCaptions()` to group captions into pages. The `combineTokensWithinMilliseconds` option controls how many words appear at once:
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import { useMemo } from "react";
|
|
71
|
+
import { createTikTokStyleCaptions } from "@remotion/captions";
|
|
72
|
+
import type { Caption } from "@remotion/captions";
|
|
73
|
+
|
|
74
|
+
// How often captions should switch (in milliseconds)
|
|
75
|
+
// Higher values = more words per page
|
|
76
|
+
// Lower values = fewer words (more word-by-word)
|
|
77
|
+
const SWITCH_CAPTIONS_EVERY_MS = 1200;
|
|
78
|
+
|
|
79
|
+
const { pages } = useMemo(() => {
|
|
80
|
+
return createTikTokStyleCaptions({
|
|
81
|
+
captions,
|
|
82
|
+
combineTokensWithinMilliseconds: SWITCH_CAPTIONS_EVERY_MS,
|
|
83
|
+
});
|
|
84
|
+
}, [captions]);
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
If a caption has `pageBreakAfter: true`, the current page ends after that caption and the next caption starts a new page.
|
|
88
|
+
|
|
89
|
+
## Rendering with Sequences
|
|
90
|
+
|
|
91
|
+
Map over the pages and render each one in a `<Sequence>`. Calculate the start frame and duration from the page timing:
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
import { Sequence, useVideoConfig, AbsoluteFill } from "remotion";
|
|
95
|
+
import type { TikTokPage } from "@remotion/captions";
|
|
96
|
+
|
|
97
|
+
const CaptionedContent: React.FC = () => {
|
|
98
|
+
const { fps } = useVideoConfig();
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<AbsoluteFill>
|
|
102
|
+
{pages.map((page, index) => {
|
|
103
|
+
const nextPage = pages[index + 1] ?? null;
|
|
104
|
+
const startFrame = (page.startMs / 1000) * fps;
|
|
105
|
+
const endFrame = Math.min(
|
|
106
|
+
nextPage ? (nextPage.startMs / 1000) * fps : Infinity,
|
|
107
|
+
startFrame + (SWITCH_CAPTIONS_EVERY_MS / 1000) * fps,
|
|
108
|
+
);
|
|
109
|
+
const durationInFrames = endFrame - startFrame;
|
|
110
|
+
|
|
111
|
+
if (durationInFrames <= 0) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<Sequence
|
|
117
|
+
key={index}
|
|
118
|
+
from={startFrame}
|
|
119
|
+
durationInFrames={durationInFrames}
|
|
120
|
+
>
|
|
121
|
+
<CaptionPage page={page} />
|
|
122
|
+
</Sequence>
|
|
123
|
+
);
|
|
124
|
+
})}
|
|
125
|
+
</AbsoluteFill>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## White-space preservation
|
|
131
|
+
|
|
132
|
+
The captions are whitespace sensitive. You should include spaces in the `text` field before each word. Use `whiteSpace: "pre"` to preserve the whitespace in the captions.
|
|
133
|
+
|
|
134
|
+
## Separate component for captions
|
|
135
|
+
|
|
136
|
+
Put captioning logic in a separate component.
|
|
137
|
+
Make a new file for it.
|
|
138
|
+
|
|
139
|
+
## Word highlighting
|
|
140
|
+
|
|
141
|
+
A caption page contains `tokens` which you can use to highlight the currently spoken word:
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
import { AbsoluteFill, useCurrentFrame, useVideoConfig } from "remotion";
|
|
145
|
+
import type { TikTokPage } from "@remotion/captions";
|
|
146
|
+
|
|
147
|
+
const HIGHLIGHT_COLOR = "#39E508";
|
|
148
|
+
|
|
149
|
+
const CaptionPage: React.FC<{ page: TikTokPage }> = ({ page }) => {
|
|
150
|
+
const frame = useCurrentFrame();
|
|
151
|
+
const { fps } = useVideoConfig();
|
|
152
|
+
|
|
153
|
+
// Current time relative to the start of the sequence
|
|
154
|
+
const currentTimeMs = (frame / fps) * 1000;
|
|
155
|
+
// Convert to absolute time by adding the page start
|
|
156
|
+
const absoluteTimeMs = page.startMs + currentTimeMs;
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<AbsoluteFill style={{ justifyContent: "center", alignItems: "center" }}>
|
|
160
|
+
<div style={{ fontSize: 80, fontWeight: "bold", whiteSpace: "pre" }}>
|
|
161
|
+
{page.tokens.map((token, tokenIndex) => {
|
|
162
|
+
const isActive =
|
|
163
|
+
token.fromMs <= absoluteTimeMs && token.toMs > absoluteTimeMs;
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
<span
|
|
167
|
+
key={`${token.fromMs}-${tokenIndex}`}
|
|
168
|
+
style={{ color: isActive ? HIGHLIGHT_COLOR : "white" }}
|
|
169
|
+
>
|
|
170
|
+
{token.text}
|
|
171
|
+
</span>
|
|
172
|
+
);
|
|
173
|
+
})}
|
|
174
|
+
</div>
|
|
175
|
+
</AbsoluteFill>
|
|
176
|
+
);
|
|
177
|
+
};
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Display captions alongside video content
|
|
181
|
+
|
|
182
|
+
By default, put the captions alongside the video content, so the captions are in sync.
|
|
183
|
+
For each video, make a new captions JSON file.
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
<AbsoluteFill>
|
|
187
|
+
<Video src={staticFile("video.mp4")} />
|
|
188
|
+
<CaptionPage page={page} />
|
|
189
|
+
</AbsoluteFill>
|
|
190
|
+
```
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: import-srt-captions
|
|
3
|
+
description: Importing .srt subtitle files into Remotion using @remotion/captions
|
|
4
|
+
metadata:
|
|
5
|
+
tags: captions, subtitles, srt, import, parse
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Importing .srt subtitles into Remotion
|
|
9
|
+
|
|
10
|
+
If you have an existing `.srt` subtitle file, you can import it into Remotion using `parseSrt()` from `@remotion/captions`.
|
|
11
|
+
|
|
12
|
+
If you don't have a .srt file, read [Transcribing audio](transcribe-captions.md) for how to generate captions instead.
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
First, the @remotion/captions package needs to be installed.
|
|
17
|
+
If it is not installed, use the following command:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx remotion add @remotion/captions # If project uses npm
|
|
21
|
+
bunx remotion add @remotion/captions # If project uses bun
|
|
22
|
+
yarn remotion add @remotion/captions # If project uses yarn
|
|
23
|
+
pnpm exec remotion add @remotion/captions # If project uses pnpm
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Reading an .srt file
|
|
27
|
+
|
|
28
|
+
Use `staticFile()` to reference an `.srt` file in your `public` folder, then fetch and parse it:
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { useState, useEffect, useCallback } from "react";
|
|
32
|
+
import { AbsoluteFill, staticFile, useDelayRender } from "remotion";
|
|
33
|
+
import { parseSrt } from "@remotion/captions";
|
|
34
|
+
import type { Caption } from "@remotion/captions";
|
|
35
|
+
|
|
36
|
+
export const MyComponent: React.FC = () => {
|
|
37
|
+
const [captions, setCaptions] = useState<Caption[] | null>(null);
|
|
38
|
+
const { delayRender, continueRender, cancelRender } = useDelayRender();
|
|
39
|
+
const [handle] = useState(() => delayRender());
|
|
40
|
+
|
|
41
|
+
const fetchCaptions = useCallback(async () => {
|
|
42
|
+
try {
|
|
43
|
+
const response = await fetch(staticFile("subtitles.srt"));
|
|
44
|
+
const text = await response.text();
|
|
45
|
+
const { captions: parsed } = parseSrt({ input: text });
|
|
46
|
+
setCaptions(parsed);
|
|
47
|
+
continueRender(handle);
|
|
48
|
+
} catch (e) {
|
|
49
|
+
cancelRender(e);
|
|
50
|
+
}
|
|
51
|
+
}, [continueRender, cancelRender, handle]);
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
fetchCaptions();
|
|
55
|
+
}, [fetchCaptions]);
|
|
56
|
+
|
|
57
|
+
if (!captions) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<AbsoluteFill>
|
|
63
|
+
{/* Use captions here */}
|
|
64
|
+
</AbsoluteFill>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Remote URLs are also supported - you can `fetch()` a remote file via URL instead of using `staticFile()`.
|
|
70
|
+
|
|
71
|
+
## Using imported captions
|
|
72
|
+
|
|
73
|
+
Once parsed, the captions are in the `Caption` format and can be used with all `@remotion/captions` utilities.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: transcribe-captions
|
|
3
|
+
description: Transcribing audio to generate captions in Remotion
|
|
4
|
+
metadata:
|
|
5
|
+
tags: captions, transcribe, whisper, audio, speech-to-text
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Transcribing audio
|
|
9
|
+
|
|
10
|
+
To transcribe audio to generate captions in Remotion, you can use the [`transcribe()`](https://www.remotion.dev/docs/install-whisper-cpp/transcribe) function from the [`@remotion/install-whisper-cpp`](https://www.remotion.dev/docs/install-whisper-cpp) package.
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
First, the @remotion/install-whisper-cpp package needs to be installed.
|
|
15
|
+
If it is not installed, use the following command:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx remotion add @remotion/install-whisper-cpp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Transcribing
|
|
22
|
+
|
|
23
|
+
Make a Node.js script to download Whisper.cpp and a model, and transcribe the audio.
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import path from "path";
|
|
27
|
+
import {
|
|
28
|
+
downloadWhisperModel,
|
|
29
|
+
installWhisperCpp,
|
|
30
|
+
transcribe,
|
|
31
|
+
toCaptions,
|
|
32
|
+
} from "@remotion/install-whisper-cpp";
|
|
33
|
+
import fs from "fs";
|
|
34
|
+
|
|
35
|
+
const to = path.join(process.cwd(), "whisper.cpp");
|
|
36
|
+
|
|
37
|
+
await installWhisperCpp({
|
|
38
|
+
to,
|
|
39
|
+
version: "1.5.5",
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
await downloadWhisperModel({
|
|
43
|
+
model: "medium.en",
|
|
44
|
+
folder: to,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Convert the audio to a 16KHz wav file first if needed:
|
|
48
|
+
// import {execSync} from 'child_process';
|
|
49
|
+
// execSync('ffmpeg -i /path/to/audio.mp4 -ar 16000 /path/to/audio.wav -y');
|
|
50
|
+
|
|
51
|
+
const whisperCppOutput = await transcribe({
|
|
52
|
+
model: "medium.en",
|
|
53
|
+
whisperPath: to,
|
|
54
|
+
whisperCppVersion: "1.5.5",
|
|
55
|
+
inputPath: "/path/to/audio123.wav",
|
|
56
|
+
tokenLevelTimestamps: true,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Optional: Apply our recommended postprocessing
|
|
60
|
+
const { captions } = toCaptions({
|
|
61
|
+
whisperCppOutput,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// Write it to the public/ folder so it can be fetched from Remotion
|
|
65
|
+
fs.writeFileSync("captions123.json", JSON.stringify(captions, null, 2));
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Transcribe each clip individually and create multiple JSON files.
|
|
69
|
+
|
|
70
|
+
See [Displaying captions](display-captions.md) for how to display the captions in Remotion.
|