Skip to content

Commit 93642ce

Browse files
authored
chore: add agent skills for product usage and maintenance [no-ci] (#153)
## Summary Adds 8 agent-agnostic skills under `.agents/skills/` following the [skills.sh](https://skills.sh) convention. Discoverable by OpenCode, Claude Code, Codex, Cursor, and 40+ other agent tools via `npx skills`. ## What's included **7 product usage skills** — one per Deepgram product, each with authentication, quick-start (real rust code from `examples/`), key parameters, layered API references, gotchas, and sibling-skill routing: | Skill | Endpoint | Notes | |---|---|---| | `using-speech-to-text` | `/v1/listen` | REST + WSS | | `using-text-to-speech` | `/v1/speak` | REST + WSS | | `using-text-intelligence` | `/v1/read` | REST only | | `using-audio-intelligence` | `/v1/listen` w/ analytics | REST primary, WSS subset | | `using-voice-agent` | `agent.deepgram.com/v1/agent/converse` | WSS full-duplex | | `using-conversational-stt` | `/v2/listen` | Flux models, turn detection | | `using-management-api` | `/v1/projects`, `/v1/models`, etc. | Management + agent configs | **1 maintainer skill**: - `maintaining-rust-sdk` — SDK-specific maintenance workflow ## Layered API references Every skill cites: 1. In-repo reference 2. OpenAPI: `https://developers.deepgram.com/openapi.yaml` 3. AsyncAPI: `https://developers.deepgram.com/asyncapi.yaml` 4. Context7: `/llmstxt/developers_deepgram_llms_txt` 5. Product-specific doc pages ## How to use ```bash # List all skills npx skills add deepgram/deepgram-rust-sdk --list # Install one skill to the active agent npx skills add deepgram/deepgram-rust-sdk --skill using-speech-to-text # Install all 8 to a specific agent (global) npx skills add deepgram/deepgram-rust-sdk -g -a claude-code ``` ## Verification `npx skills add . --list` finds 8 skills with valid frontmatter. Sibling PRs in the other Deepgram SDKs: python, js, java, go, rust, swift, kotlin, dotnet, browser.
1 parent d1d0b2f commit 93642ce

8 files changed

Lines changed: 1039 additions & 0 deletions

File tree

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
name: deepgram-rust-audio-intelligence
3+
description: Use when implementing Deepgram audio intelligence from the Rust SDK, especially when intelligence features are attached to STT Options and batch responses instead of a separate audio-intelligence module.
4+
---
5+
6+
# Using Deepgram Audio Intelligence (Rust SDK)
7+
8+
Use this skill when the user wants transcript plus enrichment from audio, not a standalone text analysis request.
9+
10+
## When to use this product
11+
12+
- Running summarization, topics, intents, sentiments, entity detection, paragraphs, search, diarization, or utterances against audio.
13+
- Explaining that the Rust crate exposes these features through STT `Options`, not a separate `audio_intelligence` module.
14+
15+
## Authentication
16+
17+
Audio intelligence rides on the `listen` feature because it is implemented through prerecorded transcription.
18+
19+
```toml
20+
[dependencies]
21+
deepgram = { version = "0.9.2", default-features = false, features = ["listen"] }
22+
tokio = { version = "1", features = ["full"] }
23+
```
24+
25+
```rust
26+
let dg = deepgram::Deepgram::new(std::env::var("DEEPGRAM_API_KEY")?)?;
27+
```
28+
29+
## Quick start
30+
31+
## Quick start: prerecorded audio + intelligence flags
32+
33+
```rust
34+
use deepgram::{
35+
common::{
36+
audio_source::AudioSource,
37+
options::{Language, Options},
38+
},
39+
Deepgram,
40+
};
41+
use tokio::fs::File;
42+
43+
#[tokio::main]
44+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
45+
let api_key = std::env::var("DEEPGRAM_API_KEY")?;
46+
let dg = Deepgram::new(&api_key)?;
47+
48+
let file = File::open("examples/audio/bueller.wav").await?;
49+
let source = AudioSource::from_buffer_with_mime_type(file, "audio/wav");
50+
51+
let options = Options::builder()
52+
.language(Language::en_US)
53+
.punctuate(true)
54+
.detect_entities(true)
55+
.intents(true)
56+
.sentiment(true)
57+
.topics(true)
58+
.summarize(true)
59+
.paragraphs(true)
60+
.utterances(true)
61+
.diarize(true)
62+
.build();
63+
64+
let response = dg.transcription().prerecorded(source, &options).await?;
65+
66+
println!("transcript: {}", response.results.channels[0].alternatives[0].transcript);
67+
println!("summary: {:?}", response.results.summary);
68+
println!("topics: {:?}", response.results.topics);
69+
println!("intents: {:?}", response.results.intents);
70+
println!("sentiments: {:?}", response.results.sentiments);
71+
println!("entities: {:?}", response.results.channels[0].alternatives[0].entities);
72+
Ok(())
73+
}
74+
```
75+
76+
## Key parameters
77+
78+
- Intelligence flags on `common::options::OptionsBuilder`: `detect_entities`, `intents`, `sentiment`, `topics`, `summarize`, `paragraphs`, `utterances`, `diarize`, `search`, `keywords`, `keyterms`, `multichannel`.
79+
- Result locations:
80+
- `response.results.summary`
81+
- `response.results.topics`
82+
- `response.results.intents`
83+
- `response.results.sentiments`
84+
- `response.results.channels[0].alternatives[0].entities`
85+
- `response.results.channels[0].alternatives[0].paragraphs`
86+
- `response.results.utterances`
87+
- `response.results.channels[0].search`
88+
89+
## API reference (layered)
90+
91+
1. **In-repo**
92+
- `src/common/options.rs`
93+
- `src/common/batch_response.rs`
94+
- `src/listen/rest.rs`
95+
- `examples/transcription/rest/prerecorded_from_file.rs`
96+
2. **OpenAPI**
97+
- Raw spec: `https://developers.deepgram.com/openapi.yaml`
98+
- Endpoint reference: `https://developers.deepgram.com/reference/speech-to-text/listen-pre-recorded`
99+
3. **AsyncAPI**
100+
- Usually not the primary source for full audio-intelligence response shapes in this crate
101+
- Raw spec: `https://developers.deepgram.com/asyncapi.yaml`
102+
4. **Context7**
103+
- `/llmstxt/developers_deepgram_llms_txt`
104+
5. **Product docs**
105+
- `https://developers.deepgram.com/docs/audio-intelligence`
106+
107+
## Gotchas
108+
109+
1. **No separate Rust module exists.** Audio intelligence is expressed as STT options plus prerecorded response fields.
110+
2. **Use prerecorded for full coverage.** The richest typed results live in `common::batch_response`; live `StreamResponse` does not expose the same intelligence objects.
111+
3. **Response fields are nested.** Some features live on `results`, others under `channels[...].alternatives[...]`.
112+
4. **Feature availability varies by API mode.** The crate shares one `Options` builder, but not every flag is equally meaningful for live streaming.
113+
114+
## Example files in this repo
115+
116+
- `examples/transcription/rest/prerecorded_from_file.rs`
117+
- `examples/transcription/rest/prerecorded_from_url.rs`
118+
- `examples/transcription/rest/callback.rs`
119+
120+
## Central product skills
121+
122+
For cross-language Deepgram product knowledge — the consolidated API reference, documentation finder, focused runnable recipes, third-party integration examples, and MCP setup — install the central skills:
123+
124+
```bash
125+
npx skills add deepgram/skills
126+
```
127+
128+
This SDK ships language-idiomatic code skills; `deepgram/skills` ships cross-language product knowledge (see `api`, `docs`, `recipes`, `examples`, `starters`, `setup-mcp`).
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
---
2+
name: deepgram-rust-conversational-stt
3+
description: Use when implementing Deepgram Flux conversational STT from the Rust SDK, including flux_request APIs, turn events, FluxResponse handling, and turn-detection tuning for voice-agent-style pipelines.
4+
---
5+
6+
# Using Deepgram Conversational STT (Rust SDK)
7+
8+
Use this skill for Deepgram Flux, the crate's supported turn-based conversational streaming path.
9+
10+
## When to use this product
11+
12+
- Building turn-based STT for voice-agent pipelines.
13+
- Handling `TurnEvent::{StartOfTurn, EndOfTurn, EagerEndOfTurn, TurnResumed, Update}`.
14+
- Tuning end-of-turn behavior with `eot_threshold`, `eager_eot_threshold`, and `eot_timeout_ms`.
15+
16+
## Authentication
17+
18+
Flux is under the `listen` feature.
19+
20+
```toml
21+
[dependencies]
22+
deepgram = { version = "0.9.2", default-features = false, features = ["listen"] }
23+
tokio = { version = "1", features = ["full"] }
24+
futures = "0.3"
25+
```
26+
27+
```rust
28+
let dg = deepgram::Deepgram::new(std::env::var("DEEPGRAM_API_KEY")?)?;
29+
```
30+
31+
## Quick start
32+
33+
```rust
34+
use std::{io::Write, time::Duration};
35+
36+
use deepgram::{
37+
common::{
38+
flux_response::{FluxResponse, TurnEvent},
39+
options::{Encoding, Model, Options},
40+
},
41+
Deepgram,
42+
};
43+
use futures::stream::StreamExt;
44+
45+
static PATH_TO_FILE: &str = "examples/audio/sample-mono.wav";
46+
static AUDIO_CHUNK_SIZE: usize = 18_063;
47+
static FRAME_DELAY: Duration = Duration::from_millis(100);
48+
49+
#[tokio::main]
50+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
51+
let api_key = std::env::var("DEEPGRAM_API_KEY")?;
52+
let dg = Deepgram::new(&api_key)?;
53+
54+
let options = Options::builder()
55+
.model(Model::FluxGeneralEn)
56+
.eot_threshold(0.75)
57+
.eot_timeout_ms(5000)
58+
.keyterms(["activate", "cancel"])
59+
.build();
60+
61+
let mut results = dg
62+
.transcription()
63+
.flux_request_with_options(options)
64+
.encoding(Encoding::Linear32)
65+
.sample_rate(44100)
66+
.file(PATH_TO_FILE, AUDIO_CHUNK_SIZE, FRAME_DELAY)
67+
.await?;
68+
69+
println!("Flux Request ID: {}", results.request_id());
70+
while let Some(result) = results.next().await {
71+
match result? {
72+
FluxResponse::Connected { request_id, sequence_id } => {
73+
println!("Connected: {request_id} (seq: {sequence_id})");
74+
}
75+
FluxResponse::TurnInfo { event, turn_index, transcript, end_of_turn_confidence, .. } => {
76+
match event {
77+
TurnEvent::StartOfTurn => println!("▶ [Turn {turn_index}] START"),
78+
TurnEvent::EndOfTurn => println!("✓ [Turn {turn_index}] END ({end_of_turn_confidence:.2}): {transcript}"),
79+
TurnEvent::Update => {
80+
if !transcript.is_empty() {
81+
print!("\r[Turn {turn_index}] UPDATE: {transcript}");
82+
std::io::stdout().flush().unwrap();
83+
}
84+
}
85+
_ => {}
86+
}
87+
}
88+
FluxResponse::FatalError { code, description, .. } => {
89+
eprintln!("{code}: {description}");
90+
break;
91+
}
92+
FluxResponse::Unknown(value) => println!("unknown: {value}"),
93+
}
94+
}
95+
96+
Ok(())
97+
}
98+
```
99+
100+
## Key parameters
101+
102+
- Entrypoints: `flux_request()`, `flux_request_with_options(options)`.
103+
- Flux transport builder fields: `encoding`, `sample_rate`, then `.file(...)`, `.stream(...)`, or `.handle().await?`.
104+
- Flux-specific tuning in shared `OptionsBuilder`: `model(Model::FluxGeneralEn)`, `eot_threshold`, `eager_eot_threshold`, `eot_timeout_ms`, `keyterms`.
105+
- Main response type: `common::flux_response::FluxResponse`.
106+
107+
## API reference (layered)
108+
109+
1. **In-repo**
110+
- `src/listen/flux.rs`
111+
- `src/common/flux_response.rs`
112+
- `src/common/options.rs`
113+
- `examples/transcription/flux/simple_flux.rs`
114+
- `tests/flux_unknown_messages.rs`
115+
- `tests/flux_e2e.rs`
116+
2. **OpenAPI**
117+
- Raw spec: `https://developers.deepgram.com/openapi.yaml`
118+
- Endpoint reference: `https://developers.deepgram.com/reference/speech-to-text/listen-flux`
119+
3. **AsyncAPI**
120+
- Raw spec: `https://developers.deepgram.com/asyncapi.yaml`
121+
- Flux channel docs are surfaced from the same product reference page above
122+
4. **Context7**
123+
- `/llmstxt/developers_deepgram_llms_txt`
124+
5. **Product docs**
125+
- `https://developers.deepgram.com/docs/stt/getting-started`
126+
127+
## Gotchas
128+
129+
1. **Flux is English-only in this crate's model surface.** The default supported model is `Model::FluxGeneralEn`.
130+
2. **Real-time pacing matters even more than standard streaming.** The example warns that bad chunk size / delay values can break turn detection.
131+
3. **Unknown events are intentional.** `FluxResponse::Unknown` and `TurnEvent::Unknown` are there for forward compatibility; handle them instead of assuming exhaustiveness.
132+
4. **Use Flux for turn-taking, not full agent control.** If you need TTS replies, prompts, or tool calls, that is Voice Agent territory and not a typed Rust SDK surface yet.
133+
134+
## Example files in this repo
135+
136+
- `examples/transcription/flux/simple_flux.rs`
137+
- `examples/transcription/flux/simple_flux_token.rs`
138+
- `examples/transcription/flux/microphone_flux.rs`
139+
- `tests/flux_unknown_messages.rs`
140+
- `tests/flux_e2e.rs`
141+
142+
## Central product skills
143+
144+
For cross-language Deepgram product knowledge — the consolidated API reference, documentation finder, focused runnable recipes, third-party integration examples, and MCP setup — install the central skills:
145+
146+
```bash
147+
npx skills add deepgram/skills
148+
```
149+
150+
This SDK ships language-idiomatic code skills; `deepgram/skills` ships cross-language product knowledge (see `api`, `docs`, `recipes`, `examples`, `starters`, `setup-mcp`).
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
name: deepgram-rust-maintaining-sdk
3+
description: Use when maintaining the Deepgram Rust SDK itself: feature flags, examples, tests, cargo fmt/clippy/build/test, CHANGELOG updates, crate releases, and adding new endpoints without Fern workflows.
4+
---
5+
6+
# Maintaining Deepgram Rust SDK
7+
8+
Use this skill when changing the SDK itself rather than consuming it.
9+
10+
## When to use this skill
11+
12+
- Adding or updating API surfaces under `src/`.
13+
- Changing feature flags, examples, tests, or docs.
14+
- Preparing a release to crates.io.
15+
- Auditing the repo's current hand-maintained conventions.
16+
17+
## Authentication
18+
19+
Not applicable for repository maintenance.
20+
21+
## Quick start
22+
23+
## Quick start: local verification loop
24+
25+
```sh
26+
cargo fmt --all
27+
cargo clippy --all-targets --all-features -- -D warnings
28+
cargo build --all-features
29+
cargo test --all-features
30+
```
31+
32+
## Quick start: feature-aware development
33+
34+
- Default features are `manage`, `listen`, and `speak`.
35+
- `listen` pulls in WebSocket dependencies.
36+
- If you add a module, decide whether it belongs behind a Cargo feature and wire examples accordingly in `Cargo.toml`.
37+
38+
## Key parameters
39+
40+
- Core files:
41+
- `Cargo.toml`
42+
- `src/lib.rs`
43+
- `src/`
44+
- `examples/`
45+
- `tests/`
46+
- `CHANGELOG.md`
47+
- `CONTRIBUTING.md`
48+
- Current quality gates:
49+
- `cargo fmt`
50+
- `cargo clippy`
51+
- `cargo build`
52+
- `cargo test`
53+
- Contribution rules from `CONTRIBUTING.md`:
54+
- PRs should target `dev`, not `main`
55+
- tests must be complete and pass
56+
- commit messages must be descriptive
57+
- include a test for bug fixes
58+
59+
## API reference (layered)
60+
61+
1. **In-repo**
62+
- `README.md`
63+
- `CONTRIBUTING.md`
64+
- `CHANGELOG.md`
65+
- `Cargo.toml`
66+
- `src/lib.rs`
67+
- `examples/README.md`
68+
2. **OpenAPI**
69+
- `https://developers.deepgram.com/openapi.yaml`
70+
3. **AsyncAPI**
71+
- `https://developers.deepgram.com/asyncapi.yaml`
72+
4. **Context7**
73+
- `/llmstxt/developers_deepgram_llms_txt`
74+
5. **Product docs**
75+
- `https://developers.deepgram.com/reference/`
76+
- `https://docs.rs/deepgram/latest/deepgram/`
77+
78+
## Gotchas
79+
80+
1. **This SDK is not Fern-generated.** Do not describe or assume any Fern regeneration workflow.
81+
2. **Match existing hand-maintained module patterns.** Add new product surfaces with explicit modules, option structs, response structs, examples, and feature gating where appropriate.
82+
3. **Update examples and tests with new APIs.** This repo treats example programs and integration tests as part of the public developer experience.
83+
4. **Keep `CHANGELOG.md` honest.** Follow the existing Keep a Changelog + SemVer style already used in the repo.
84+
5. **Release flow is branch-sensitive.** `main` is release-oriented; normal contribution PRs target `dev`.
85+
6. **If you publish a release, verify crate metadata first.** Ensure `version`, features, examples, and changelog all line up before `cargo publish`.
86+
87+
## Example files in this repo
88+
89+
- `examples/README.md`
90+
- `examples/transcription/`
91+
- `examples/speak/rest/`
92+
- `examples/manage/`
93+
- `tests/flux_unknown_messages.rs`
94+
- `tests/flux_e2e.rs`

0 commit comments

Comments
 (0)