stream
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStream — skill router + execution flow
Stream — 技能路由与执行流程
Rules: Read once per session — every non-negotiable rule is stated there, nowhere else.
RULES.mdThis file is the single entrypoint: intent classification, conditional context detection, and module pointers.
规则: 每次会话请阅读一次 —— 所有不可协商的规则都在此文件中,别处无相关内容。
RULES.md此文件是唯一入口:用于意图分类、条件上下文检测和模块指向。
Step 0: Intent classifier (mandatory first — never skip)
步骤0:意图分类器(必须首先执行,切勿跳过)
Before any tool call, decide the track from the user's input alone — no probes, no fetches, no CLI checks. The classifier is deterministic: scan the input for the signals below in order.
在调用任何工具之前,仅根据用户输入确定追踪路径——无需探测、抓取或CLI检查。分类器是确定性的:按顺序扫描输入中的以下信号。
Signals → track
信号 → 追踪路径
| Signal in user input | Track | Skip CLI gate? |
|---|---|---|
Explicit SDK/framework token: | D — Docs search | Yes |
| Words "docs" or "documentation" | D | Yes |
| "How do I {X} in {framework}?", "How does {hook/component/method} work?", "What does {SDK thing} do?" | D | Yes |
| Operational verbs + Stream noun: "list calls", "show channels", "any flagged", "find users", "check {anything}" | B — CLI / data query | No |
| B | No |
| "Build me a … app", "scaffold", "create a new …" + Stream product, in an empty/new directory | A — Builder (new app) | No |
| "Add Chat/Video/Feeds to this app", "integrate Stream into" — existing project | E — Builder (enhance) | No |
| "Install the CLI", "set up stream" with no project context | C — Bootstrap | n/a |
| Operational verb wrapped in how-to phrasing (e.g. "how do I list my calls?" — docs or CLI) | Ask one disambiguator | Defer |
| 用户输入中的信号 | 追踪路径 | 是否跳过CLI验证? |
|---|---|---|
明确的SDK/框架标识: | D — 文档搜索 | 是 |
| 包含“docs”或“documentation”字样 | D | 是 |
| 句式为“How do I {X} in {framework}?”、“How does {hook/component/method} work?”、“What does {SDK thing} do?” | D | 是 |
| 操作动词 + Stream名词:“list calls”、“show channels”、“any flagged”、“find users”、“check {anything}” | B — CLI / 数据查询 | 否 |
字面CLI调用: | B | 否 |
| “Build me a … app”、“scaffold”、“create a new …” + Stream产品,且处于空目录/新目录中 | A — 构建器(新应用) | 否 |
| “Add Chat/Video/Feeds to this app”、“integrate Stream into” — 针对现有项目 | E — 构建器(增强现有应用) | 否 |
| “Install the CLI”、“set up stream”且无项目上下文 | C — 初始化引导 | 不适用 |
| 操作动词包裹在“How-to”句式中(例如“how do I list my calls?” —— 文档或CLI均可) | 询问一个歧义消除问题 | 延迟处理 |
Disambiguation flow
歧义消除流程
If the input fits more than one row (typically operational verb + how-to phrasing), ask one short question and wait. Do not probe, fetch, or gate before the answer.
Want me to look up the SDK method (docs) or run it now via CLI?
After the answer arrives, route as if the user had given that signal directly.
如果输入符合多行条件(通常是操作动词 + How-to句式),请提出一个简短问题并等待回复。在得到回复前,请勿探测、抓取或进行验证。
您希望我查找SDK方法(文档)还是现在通过CLI执行该操作?
收到回复后,按照用户给出的信号直接路由。
After classification
分类完成后
- Always (first invocation in conversation) → run Project signals. Cheap local probe; populates session context for every track.
- Track D → skip the CLI gate and CLI + credentials probes. Consume project signals, then go to .
docs-search.md - Tracks A, B, C, E → run the CLI gate then CLI + credentials, then the track. Project signals inform the one-line status and routing.
- Bare with no args → list the available tracks briefly and wait for input.
/stream
- 始终(会话中的首次调用) → 运行项目信号探测。这是本地轻量探测;会为所有追踪路径填充会话上下文。
- 追踪路径D → 跳过CLI验证和CLI + 凭证探测。利用项目信号,然后跳转至****。
docs-search.md - 追踪路径A、B、C、E → 运行CLI验证,然后运行CLI + 凭证探测,再进入对应追踪路径。项目信号会影响单行状态显示和路由。
- 仅输入且无参数 → 简要列出可用的追踪路径并等待输入。
/stream
Project signals (always — once per session)
项目信号探测(始终执行——每次会话一次)
A local-only probe. No CLI binary, no network, no gate. Both Track D and tracks A/B/C/E consume the result, so it's worth running once on the first invocation regardless of which track was picked.
bash
bash -c 'echo "=== PKG ==="; grep -oE "\"(stream-chat[^\"]*|@stream-io/[^\"]*)\": *\"[^\"]*\"" package.json 2>/dev/null; echo "=== NEXT ==="; test -f package.json && grep -q "\"next\"" package.json && echo "NEXTJS" || echo "NO_NEXT"; echo "=== NATIVE ==="; ls pubspec.yaml go.mod requirements.txt pyproject.toml Podfile build.gradle 2>/dev/null; echo "=== EMPTY ==="; test -z "$(ls -A 2>/dev/null)" && echo "EMPTY_CWD" || echo "NON_EMPTY"'Do NOT use ( = exit-on-error): returns exit 1 when it finds no matches, which aborts the entire probe and leaves you with partial output. Same applies to every other probe in this file.
bash -ce-egrepThis gives you:
- PKG: Stream npm packages with versions (e.g. ) — empty if none
"stream-chat-react": "^14.2.0" - NEXT: if
NEXTJSis innext, elsepackage.jsonNO_NEXT - NATIVE: Names of non-npm project files present (Flutter, Go, Python, iOS, Android)
- EMPTY: if cwd is empty, else
EMPTY_CWDNON_EMPTY
Hold the result in conversation context. Don't re-run unless:
- A scaffold (Track A) or install (Track E) completed and added new packages
- The user changed directory mid-conversation
- A signal you need is missing (e.g., Track D needs a version and was empty earlier — re-probe one specific file)
PKG
Don't print this result as a heading. Use it internally; surface a signal only when it changes what you say to the user (e.g., "I see Chat React v14 — looking up v14 docs.").
这是仅本地执行的探测。无需CLI二进制文件、无需网络、无需验证。追踪路径D和A/B/C/E都会使用探测结果,因此无论选择哪个追踪路径,首次调用时都值得运行一次。
bash
bash -c 'echo "=== PKG ==="; grep -oE "\"(stream-chat[^\"]*|@stream-io/[^\"]*)\": *\"[^\"]*\"" package.json 2>/dev/null; echo "=== NEXT ==="; test -f package.json && grep -q "\"next\"" package.json && echo "NEXTJS" || echo "NO_NEXT"; echo "=== NATIVE ==="; ls pubspec.yaml go.mod requirements.txt pyproject.toml Podfile build.gradle 2>/dev/null; echo "=== EMPTY ==="; test -z "$(ls -A 2>/dev/null)" && echo "EMPTY_CWD" || echo "NON_EMPTY"'请勿使用(表示遇到错误即退出):当未找到匹配项时会返回退出码1,这会终止整个探测并导致输出不完整。此文件中的所有其他探测也遵循此规则。
bash -ce-egrep探测结果包含:
- PKG: 带版本号的Stream npm包(例如)——无匹配时为空
"stream-chat-react": "^14.2.0" - NEXT: 如果中包含
package.json则返回next,否则返回NEXTJSNO_NEXT - NATIVE: 存在的非npm项目文件名称(Flutter、Go、Python、iOS、Android)
- EMPTY: 当前目录为空则返回,否则返回
EMPTY_CWDNON_EMPTY
将结果保存在会话上下文中。仅在以下情况重新运行:
- 脚手架(追踪路径A)或安装(追踪路径E)完成并添加了新包
- 用户在会话中途切换了目录
- 需要的信号缺失(例如,追踪路径D需要版本号但之前的为空——重新探测特定文件)
PKG
请勿将此结果作为标题打印。仅在内部使用;仅当结果会改变您对用户说的内容时才展示(例如“我看到您使用的是Chat React v14——正在查找v14版本的文档。”)。
CLI gate (tracks A, B, C, E only)
CLI验证(仅适用于追踪路径A、B、C、E)
Track D skips this step. For all other tracks: verify the executable is installed and runnable before any further work.
stream- Run:
bash
bash -c 'command -v stream >/dev/null 2>&1 && stream --version || echo "NOT_FOUND"' - If the output is or either command fails: stop here. Do not proceed to the credentials probe, builder,
NOT_FOUND, credential checks, or SDK wiring. Followstream api(explain what the CLI is, ask the user once for permission to install, then run the install — needs network approval). Do not suggest continuing scaffold/CLI work without the binary; only after the user declines install may you offer read-only help frombootstrap.mdper bootstrap, or hand the user back to Track D for documentation questions.sdk.md - If succeeds: continue to the credentials probe.
stream --version
追踪路径D跳过此步骤。对于其他所有追踪路径:在进行后续操作前,先验证**可执行文件**已安装且可运行。
stream- 运行:
bash
bash -c 'command -v stream >/dev/null 2>&1 && stream --version || echo "NOT_FOUND"' - 如果输出为或任一命令失败: 在此停止。请勿继续进行凭证探测、构建器操作、
NOT_FOUND调用、凭证检查或SDK配置。遵循**stream api(解释CLI是什么,询问用户一次是否允许安装,然后执行安装——需要网络权限)。请勿建议在没有二进制文件的情况下继续脚手架/CLI操作;仅当用户拒绝安装时,才可根据引导步骤提供来自bootstrap.md**的只读帮助,或引导用户返回追踪路径D进行文档查询。sdk.md - 如果执行成功: 继续进行凭证探测。
stream --version
CLI + credentials probe (tracks A, B, C, E only)
CLI + 凭证探测(仅适用于追踪路径A、B、C、E)
Run this single probe to confirm the CLI works and credentials are available. Project signals are already in context from the earlier local probe — don't repeat them here.
bash
bash -c 'echo "=== CLI ==="; command -v stream 2>/dev/null; stream --version 2>/dev/null || echo "NOT_FOUND"; echo "=== CONFIG ==="; stream config list 2>/dev/null || echo "NO_CONFIG"'This gives you:
- CLI state: installed or not (should already be OK after the CLI gate)
- Config state: CLI configured () or not (
cli-configured)NO_CONFIG
.envPreToolUse.envbash -c.envstream envAuth check (run only on tracks A/B/E that need to make calls):
stream apiThe probe above does NOT verify you're logged in — succeeds even when unauthenticated. Run one auth-requiring call, unpiped so the exit code surfaces:
stream config listbash
stream api OrganizationReadDo not pipe through // on this probe — the pipeline exit code is the last command's, which masks the auth failure. If output volume is a concern, redirect: .
headtailjqstream api OrganizationRead >/dev/null 2>&1; echo "exit=$?"- Exit 0 → authenticated, continue. (Bonus: the output is reusable for Step 2's "check existing orgs".)
- Exit 2 / "not authenticated" → immediately run as its own Bash invocation (required for browser PKCE — never chain with
stream auth loginor wrap inside a heredoc). Do not ask the user first.&& - If hangs past ~60s or the user reports a stuck browser state → run
stream auth loginto clear stale state, then retrystream auth logoutonce. If the second attempt also hangs, stop and ask the user to complete login manually (they can typestream auth loginto run it in-session).! stream auth login
Show a one-line status combining project signals and CLI + credentials:
✓ Stream CLI v0.1.0 · app-a3f7b201 (Feeds + Chat) · Next.js + Chat React v14 · ~/stream-tv✓ Stream CLI v0.1.0 · configured via CLI · no local project✓ Stream CLI v0.1.0 · no credentials · empty dir (ready to scaffold)- (only if the CLI gate was skipped in error — do not route onward; go back and run it)
✗ Stream CLI not found — see bootstrap.md to install
运行此单个探测以确认CLI可用且凭证已就绪。项目信号已从之前的本地探测存入上下文——请勿在此重复。
bash
bash -c 'echo "=== CLI ==="; command -v stream 2>/dev/null; stream --version 2>/dev/null || echo "NOT_FOUND"; echo "=== CONFIG ==="; stream config list 2>/dev/null || echo "NO_CONFIG"'探测结果包含:
- CLI状态: 是否已安装(通过CLI验证后应该已就绪)
- 配置状态: CLI已配置()或未配置(
cli-configured)NO_CONFIG
此处特意不检查文件。许多沙箱配置会安装钩子,阻止任何引用的bash命令——包括在包装器内的命令——这会导致整个探测静默失败。对于追踪路径A(新应用)和E(增强现有应用),您要么通过创建新的(任务B),要么在已有的项目中工作;项目信号探测会告知您是否处于现有项目中。
.envPreToolUse.envbash -cstream env.env.env权限检查(仅在需要调用的追踪路径A/B/E中运行):
stream api上述探测不会验证您是否已登录——即使未认证,也会执行成功。运行一个需要权限的调用,不要通过管道传递,以便显示退出码:
stream config listbash
stream api OrganizationRead在此探测中请勿通过//进行管道传递——管道的退出码是最后一个命令的退出码,这会掩盖权限失败。如果担心输出量,可以重定向:。
headtailjqstream api OrganizationRead >/dev/null 2>&1; echo "exit=$?"- 退出码0 → 已认证,继续。(额外收获:输出可用于步骤2的“检查现有组织”。)
- 退出码2 / “未认证” → 立即单独调用(浏览器PKCE要求——切勿用
stream auth login链式调用或包裹在 heredoc 中)。无需先询问用户。&& - 如果运行超过约60秒仍未响应,或用户报告浏览器状态卡住 → 运行
stream auth login清除过期状态,然后重试stream auth logout一次。如果第二次尝试仍卡住,请停止并要求用户手动完成登录(他们可以在会话中输入stream auth login来运行该命令)。! stream auth login
展示结合项目信号和CLI + 凭证状态的单行状态信息:
✓ Stream CLI v0.1.0 · app-a3f7b201 (Feeds + Chat) · Next.js + Chat React v14 · ~/stream-tv✓ Stream CLI v0.1.0 · 通过CLI配置 · 无本地项目✓ Stream CLI v0.1.0 · 无凭证 · 空目录(可进行脚手架搭建)- (仅当CLI验证被错误跳过时显示——请勿继续路由;返回并重新运行验证)
✗ Stream CLI未找到 —— 请查看bootstrap.md进行安装
Install
安装
Skill pack: (skills.sh) — markdown only, does not install the binary.
npx skills add GetStream/agent-skillsstreamstreambootstrap.mdlatest.jsoninstall.shstreambootstrap.mdlatest.jsoninstall.shModule map
模块映射
Step 0 picks the track. Each Track section below has the full prerequisites and phase table — this is just the at-a-glance map.
| Track | Module(s) |
|---|---|
| A — Build new app | |
| B — CLI / data query | |
| C — Bootstrap | |
| D — Docs search (no CLI gate) | |
| E — Enhance existing app | |
| SDK wiring inside A/E | |
Reference blueprints (load only after the user names the product, used by Tracks A and E):
| Product | Header (setup + gotchas) | Full blueprints (load per component) |
|---|---|---|
| Chat | | |
| Feeds | | |
| Video | | |
| Moderation | | |
步骤0选择追踪路径。以下每个追踪路径部分都包含完整的先决条件和阶段表——此部分仅为概览映射。
| 追踪路径 | 模块 |
|---|---|
| A — 构建新应用 | |
| B — CLI / 数据查询 | |
| C — 初始化引导 | |
| D — 文档搜索(无需CLI验证) | |
| E — 增强现有应用 | |
| A/E中的SDK配置 | |
参考蓝图(仅在用户指定产品后加载,供追踪路径A和E使用):
| 产品 | 头部文件(设置 + 注意事项) | 完整蓝图(按组件加载) |
|---|---|---|
| Chat | | |
| Feeds | | |
| Video | | |
| Moderation | | |
Cross-track follow-ups (use judgment)
跨追踪路径后续操作(酌情处理)
The tracks share a single skill so a result from one can naturally enable an action in another. Surface a follow-up offer when it genuinely helps the user — not as boilerplate on every turn.
- D → B: A docs answer that names a runnable operation can offer "want me to run that now via CLI?" (only if read-safe or clearly operational intent).
- B → D: A CLI result that has a relevant docs page can offer "want the page that explains this?" (link only — don't fetch unprompted).
- A/E → D: After scaffold or integration completes, mention that the SDK + version is preloaded and ask-anything is available.
- D → A/E: A docs answer that describes a setup-heavy flow can mention scaffold / integrate is available — without running it.
Do not auto-execute a cross-track action. Offer, then wait for the user to confirm. The track switch happens through the user's reply, which re-enters Step 0.
所有追踪路径共享同一个技能,因此一个路径的结果自然可以触发另一个路径的操作。当确实对用户有帮助时再提供后续操作建议——不要在每次交互都作为模板内容。
- D → B: 如果文档答案提到了可执行操作,可以询问“是否需要我现在通过CLI执行该操作?”(仅适用于只读操作或明确的操作意图)。
- B → D: 如果CLI结果有相关文档页面,可以询问“是否需要查看解释此内容的文档页面?”(仅提供链接——请勿未经请求抓取内容)。
- A/E → D: 脚手架或集成完成后,告知用户SDK + 版本已预加载,可随时提问。
- D → A/E: 如果文档答案描述了一个设置复杂的流程,可以提及提供脚手架/集成服务——但不要自动执行。
请勿自动执行跨追踪路径操作。先提供建议,然后等待用户确认。追踪路径切换通过用户的回复完成,回复会重新进入步骤0。
Track A — Build new app (empty directory)
追踪路径A — 构建新应用(空目录)
Full detail: Steps 0–7 in ; Step 4 UI in .
builder.mdbuilder-ui.md| Phase | Name | What you do |
|---|---|---|
| A1 | CLI gate + context probe | Run the CLI gate then CLI + credentials. Show one-line status. If CLI missing, install via |
| A2 | Execute | Immediately start |
Anti-patterns: running skills install before scaffold; building a moderation review queue in the app.
详细内容: **中的步骤0–7;**中的步骤4 UI部分。
builder.mdbuilder-ui.md| 阶段 | 名称 | 操作内容 |
|---|---|---|
| A1 | CLI验证 + 上下文探测 | 运行CLI验证,然后运行CLI + 凭证探测。展示单行状态信息。如果CLI缺失,在进入A2前通过** |
| A2 | 执行 | 立即启动 |
反模式: 在脚手架搭建前安装技能;在应用中构建内容审核队列。
Track B — CLI / data queries
追踪路径B — CLI / 数据查询
Module: .
cli.mdPrerequisite: Complete the CLI gate — the CLI must be installed before running queries or credential resolution.
streamCredential resolution (do this before any call):
stream api- in cwd has
.env→ credentials are local. Mention which app you're querying if you can determine it.STREAM_API_KEY - No → check
.envfor configured org/app → use those. Mention: "Querying configured app:stream config list."<app-name> - Nothing → tell the user: "No Stream credentials found. Run to connect, or
stream auth logininto a project with acd.".env
| Phase | Name | What you do | WAIT? |
|---|---|---|---|
| B1 | Resolve credentials | Run credential resolution above — silently if | Only if no credentials found |
| B2 | Execute | | — |
模块: .
cli.md先决条件: 完成CLI验证——运行查询或凭证解析前必须安装CLI。
stream凭证解析(在任何调用前执行):
stream api- 当前目录下的****包含
.env→ 凭证为本地凭证。如果可以确定,说明您正在查询哪个应用。STREAM_API_KEY - 无文件 → 检查
.env中的已配置组织/应用 → 使用这些配置。说明:“正在查询已配置的应用:stream config list。”<app-name> - 无任何凭证 → 告知用户:“未找到Stream凭证。请运行进行连接,或切换到包含
stream auth login文件的项目目录。”.env
| 阶段 | 名称 | 操作内容 | 是否等待? |
|---|---|---|---|
| B1 | 解析凭证 | 执行上述凭证解析——如果 | 仅在未找到凭证时等待 |
| B2 | 执行 | 先运行 | — |
Track C — Bootstrap (install CLI / skill)
追踪路径C — 初始化引导(安装CLI / 技能)
Module: .
bootstrap.md| Phase | Name | What you do | WAIT? |
|---|---|---|---|
| C1 | Explain | What | User confirms |
| C2 | Install | Follow bootstrap (binary + | As needed |
模块: .
bootstrap.md| 阶段 | 名称 | 操作内容 | 是否等待? |
|---|---|---|---|
| C1 | 说明 | 解释 | 等待用户确认 |
| C2 | 安装 | 遵循引导步骤(安装二进制文件 + | 根据需要等待 |
Track D — Docs search (no CLI gate)
追踪路径D — 文档搜索(无需CLI验证)
Module: .
docs-search.mdThe full docs-search engine: SDK identification (explicit input → project signals → keyword inference), slug resolution, framework-index fetch, page fetch, cited answer. All honesty rules and URL-grounding rules live in — read it before answering.
llms.txtdocs-search.md| Phase | Name | What you do |
|---|---|---|
| D1 | Identify SDK | Explicit input wins; otherwise consume project signals (PKG / NATIVE already in context); fall back to keyword tiers (Step 1c in |
| D2 | Resolve slug | Fetch |
| D3 | Fetch + answer | Fetch the framework index (verbatim URLs), pick the right page, fetch it, quote and cite |
Track D never invokes Write, Edit, npm, scaffold tools, or . If the user asks for action mid-conversation, offer to switch tracks (D → B/A/E) and re-enter Step 0.
Bash(stream *)模块: .
docs-search.md完整的文档搜索引擎:SDK识别(明确输入 → 项目信号 → 关键词推断)、路径解析、框架索引抓取、页面抓取、引用式回答。所有诚信规则和URL锚定规则都在中——回答前请阅读。
llms.txtdocs-search.md| 阶段 | 名称 | 操作内容 |
|---|---|---|
| D1 | 识别SDK | 明确输入优先;否则使用项目信号(PKG / NATIVE已在上下文中);最后回退到关键词层级( |
| D2 | 解析路径 | 每次会话抓取一次 |
| D3 | 抓取 + 回答 | 抓取框架索引(原始URL),选择正确页面,抓取内容,引用并标注来源 |
追踪路径D永远不会调用写入、编辑、npm、脚手架工具或。如果用户在会话中途请求操作,可提供切换追踪路径(D → B/A/E)的选项,然后重新进入步骤0。
Bash(stream *)Track E — Enhance existing app
追踪路径E — 增强现有应用
For adding Stream products to an existing Next.js project. Uses references files and SDK patterns but skips scaffold entirely.
Prerequisite: Complete the CLI gate — install the CLI before npm installs, setup, or token routes that depend on CLI-backed config.
streamstream api用于向现有Next.js项目添加Stream产品。使用参考文件和SDK模式,但完全跳过脚手架步骤。
先决条件: 完成CLI验证——在npm安装、设置或依赖CLI配置的令牌路由前,必须安装CLI。
stream apistreamE1: Audit the existing project
E1:审计现有项目
Before writing any code, understand what's already in place:
- Packages: Check for
package.json,stream-chat,stream-chat-react,@stream-io/video-react-sdk.@stream-io/node-sdk - Auth: Does the app already have a route? If so, extend it with the new product's token — don't create a second token route.
/api/token - Credentials: Check for with
.env/STREAM_API_KEY. If missing, run credential resolution (Track B).STREAM_API_SECRET - UI framework: Confirm Tailwind, Shadcn, or whatever the project uses. Do not install Shadcn or change the styling setup unless the user asks.
- Directory structure: Note whether the project uses or
app/— match the existing convention.src/app/
在编写任何代码前,先了解现有项目的情况:
- 包: 检查中是否包含
package.json、stream-chat、stream-chat-react、@stream-io/video-react-sdk。@stream-io/node-sdk - 权限: 应用是否已有路由?如果有,扩展该路由以返回新产品的令牌——不要创建第二个令牌路由。
/api/token - 凭证: 检查是否存在包含/
STREAM_API_KEY的STREAM_API_SECRET文件。如果缺失,执行追踪路径B中的凭证解析。.env - UI框架: 确认项目使用的是Tailwind、Shadcn或其他框架。除非用户要求,否则不要安装Shadcn或更改样式设置。
- 目录结构: 注意项目使用的是还是
app/——遵循现有约定。src/app/
E2: Install + configure
E2:安装 + 配置
- Install only the new SDKs: (RULES.md › Package manager).
npm install <new-packages> --legacy-peer-deps - Configure via CLI: run setup commands from the relevant (App Integration → Setup). For example, Feeds needs feed groups created; Moderation needs blocklist + config.
references/<Product>.md - Import CSS if the product needs it (Chat: , Video:
stream-chat-react/dist/css/v2/index.css).@stream-io/video-react-sdk/dist/css/styles.css
- 仅安装新的SDK:(RULES.md › 包管理器)。
npm install <new-packages> --legacy-peer-deps - 通过CLI配置: 运行相关中的设置命令(应用集成 → 设置)。例如,Feeds需要创建信息流组;Moderation需要创建黑名单 + 配置。
references/<Product>.md - 导入CSS(如果产品需要):Chat需导入,Video需导入
stream-chat-react/dist/css/v2/index.css。@stream-io/video-react-sdk/dist/css/styles.css
E3: Integrate
E3:集成
- Token route: Extend the existing to return the new product's token alongside existing ones. Follow
/api/tokenfor server-side instantiation patterns.sdk.md - API routes: Add product-specific routes from the relevant (App Integration → API Routes). Feeds needs several (
references/<Product>.md,/api/feed/get, etc.); Chat and Video typically only need the token route./api/feed/post - Components: Load the relevant sections and build components using the existing project's patterns and styling conventions — not the builder-ui.md defaults.
references/<Product>-blueprints.md - State: If the app already manages user state (auth context, session), wire Stream tokens into that — don't add a separate Login Screen unless the app has no auth.
- 令牌路由: 扩展现有路由,使其在返回现有令牌的同时返回新产品的令牌。遵循
/api/token中的服务器端实例化模式。sdk.md - API路由: 添加相关中的产品特定路由(应用集成 → API路由)。Feeds需要多个路由(
references/<Product>.md、/api/feed/get等);Chat和Video通常只需要令牌路由。/api/feed/post - 组件: 加载相关中的部分内容,并使用现有项目的模式和样式约定构建组件——不要使用builder-ui.md中的默认设置。
references/<Product>-blueprints.md - 状态: 如果应用已管理用户状态(权限上下文、会话),将Stream令牌接入该状态——除非应用无权限系统,否则不要添加单独的登录界面。
E4: Verify
E4:验证
Run and fix any errors.
npx next build运行并修复所有错误。
npx next buildKey constraints
关键约束
- Do not re-scaffold, re-initialize Shadcn, install frontend skills, or modify /
globals.css.layout.tsx - Do not overwrite or restructure existing files — add new files alongside them.
- Do not change the existing auth flow. Adapt Stream's token generation to fit the app's existing auth, not the other way around.
- If the project uses a different package manager (yarn, pnpm), match what it already uses — the npm-only rule applies to new scaffolds, not existing projects.
- 请勿重新搭建脚手架、重新初始化Shadcn、安装前端技能或修改/
globals.css。layout.tsx - 请勿覆盖或重构现有文件——在现有文件旁添加新文件。
- 请勿更改现有权限流程。调整Stream的令牌生成以适配应用的现有权限系统,而非反过来。
- 如果项目使用其他包管理器(yarn、pnpm),遵循现有包管理器的使用规则——仅npm规则适用于新脚手架项目,不适用于现有项目。
Paths (portable)
路径(可移植)
| What | Where |
|---|---|
| Reference headers | |
| Reference blueprints | |
| Docs search engine | |
| CLI endpoint index | |
| Skill modules | |
| 内容 | 路径 |
|---|---|
| 参考头部文件 | |
| 参考蓝图 | |
| 文档搜索引擎 | |
| CLI端点索引 | 运行 |
| 技能模块 | |
Tooling (all hosts)
工具(所有主机)
Loading: This file () + + files named by the routing table for the task. Track D loads only; tracks A/B/C/E load their respective modules.
SKILL.mdRULES.mddocs-search.mdBatching: One per builder phase where possible (never — aborts on any non-zero exit, including finding nothing). stays its own invocation for browser PKCE — never chain with or wrap in a heredoc.
bash -c-ce-egrepstream auth login&&Support: If the user asks for support or how to contact someone, direct them to getstream.io/contact.
加载: 此文件() + + 任务路由表中指定名称的文件。追踪路径D仅加载;追踪路径A/B/C/E加载各自的模块。
SKILL.mdRULES.mddocs-search.md批量处理: 尽可能在每个构建阶段使用一个命令(切勿使用——会在任何非零退出码时终止,包括未找到匹配项的情况)。需单独调用以支持浏览器PKCE——切勿用链式调用或包裹在 heredoc 中。
bash -c-ce-egrepstream auth login&&支持: 如果用户请求支持或询问如何联系相关人员,请引导他们访问getstream.io/contact。