SuperAPI AI Directory

trtc-chat

Agents & models

View repository

Updated 10-16 10:15

About this skill

Chat Integration Domain Skill

Preliminary Notes

  • Role: Collaborative developer, generates code according to slice best practices
  • Invocation Entry (Unique):trtc/SKILL.md After completing §-1 prompt reporting and routing, Read this file
  • Currently Supported:Chat × Web(Vue3 / tuikit-atomicx-vue3)
  • No Conference-style topic flow; throughout integration active_flow=onboarding, slice is within path references
  • Python tools:python3 -m tools.* the cwd must be skills/trtc or skills/trtc-chat(the latter contains tools/ shim, delegates to trtc);Prohibitedto execute at the user project root (to avoid the project's own tools/ preemption)

§0 Cross-IDE Execution Contract (Highest Priority)

0.0 Execution Discipline

  1. skill constraints take priority over everything: gate / phase / reporting are hard constraints and must not be bypassed
  2. Act first, speak later: when a tool call / Bash is needed, execute first, then write user-visible text
  3. Verify before proceeding: phase gates must have tool result evidence
  4. After Session writes, must READ to verify(see 08-state-config.md §8.1.3)
  5. Business state is a phase postcondition; before node execution Read 13-reporting.md. Experience data is handled exclusively by Root Dispatcher and Node Runtime
  6. User Prompt: each turn is handled only by Root reporting.py prompt --input-stdin ; this Skill does not repeatedly call the entry command, nor may it put the original text into any command parameters

0.0.1 C19/C20 Unified Recording Boundary (Highest Priority)

  • This Skill must not directly call reporting.py send、send-query、send-docs-query, nor may it construct method=event path node records.
  • Root Dispatcher calls at the user turn entry prompt --input-stdin, after determining the route calls once invoke; Hook/Host Stop is responsible for local staging, promotion, and refresh in subsequent turns.
  • references/02*~05* If old send、send-query or skill_start text still appears in it, it is all regarded as historical description and must not be executed; they must not be used to replace Root's prompt/invoke chain.
  • The first user Prompt must be staged by the entry Hook and promoted by Root invoke after the normal answer is completed; it must not wait for SDKAppID, credentials, or user selection before backfilling the first Prompt.

0.1 Unified Operation Semantics

  • Session read/write → python3 -m tools.session read / write-batch
  • KB read → python3 -m tools.kb resolve <path> → Read outputs absolute path (see 08-state-config.md §8.0;Prohibited ../knowledge-base)。Onlyused for knowledge-base entries (chat/ slices/ docs/ etc.);references/ flows/ and other skill-bundled files are Read directly,Prohibitedto go through kb resolve
  • Slice index → python3 -m tools.kb resolve chat/web/index.yaml

0.2 Evidence Rules / 0.3 Fail-Closed

Missing evidence is regarded as not executed. Blocking codes:BLOCKED: project_root_unresolved / session_not_initialized / phase_gate_not_satisfied / credential_missing / unsupported_platform / BLOCKED: dispatcher_bypass

0.4 Prohibited from Making Decisions on the User's Behalf by Default

Before obtaining user input, prohibited from defaulting to integration_mode(full/direct) or credentials.

0.5 Entry Gate (Prohibited from Bypassing Root)

❗ This file is not a dispatcher. Entry is only allowed after any one of the following conditions is met:

# Condition
1 This turn has been routed by trtc/SKILL.md to this file (normal path)
2 .trtc-session.yaml exists and product=chat or active_domain_skill=trtc-chat,and this round's Agent has already first Read ../trtc/SKILL.md and completed its §-1

if directly Read this file (without going through Root):

  1. STOP integration/triage action
  2. first Read ../trtc/SKILL.md,restart the session guard → classification → routing from §-1
  3. do not skip the dispatcher based on this file's frontmatter / description keywords

IM pure consultation (Path D):routed by Root to docs/SKILL.md,do notin this file's Step 0 run Path D ahead of time.


§1 Phase state machine

flow_state.chat.phase is the single source of truth (.trtc-session.yaml,via tools.session)。

phase allowed action
detect detection + session initialization + A.1
collect_credentials collect SDKAppID / SecretKey
collect_mode Full / Direct
scaffold scaffold
slices one slice per round
done wrap-up; new feature→Path B; maintenance→Path C

phase=done when: addition → Path B; subtraction/error → Path C.


Entry: read session state

  • status=active → continue according to active_flow / flow_state.chat.phase continue according to
  • active_flow=onboarding override detect…slices
  • status=completed → take over Path B/C/D

Step 0 — Path D pre-check

Bash python3 -m tools.kb resolve chat/web/path-d-signals.yaml → Read output path, then compare against the user sentence.

match conditions (knowledge consultation signal and):

  • no .trtc-session.yaml,or
  • product=chat and flow_state.chat.phase=done / status=completed

match → STOP this integration flow;should have been routed by Root to docs/SKILL.md。If not yet routed, Read ../trtc/SKILL.md §A then enter docs/SKILL.md。

❗ route to docs/SKILL.md after do notRead again path-d-signals.yaml(gate already completed; for what follows see docs/SKILL.md → 05-path-d-script.md D.1)。


Step 1 — project detection

READ references/01-detect-project.md + references/08-state-config.md → find root → write project_state.project_root

non-vue3 → BLOCKED: unsupported_platform


Step 1.5 — Session initialization

READ references/vue3.md(as needed).

cd "<当前 trtc skill 目录>"
# 无 session 时:
python3 -m tools.session create --product chat --platform web --intent integrate-scenario --project-root "<projectRoot>"
python3 -m tools.session write-batch --updates '{
  "active_domain_skill": "trtc-chat",
  "active_flow": "onboarding",
  "project_state": {"project_root": "<projectRoot>"},
  "flow_state": {"chat": {"phase": "detect", "chat_path": "A"}}
}' --expected-version <N>

Existing session → keep phase, only update necessary fields.


Step 2 — path triage

priority condition path
0 Step 0 knowledge consultation D (via Root → docs/SKILL.md)
1 subtraction/maintenance/error C → READ flows/maintenance.md
2 phase=done + has tuikit dependency B
3 already depends on tuikit-atomicx-vue3 B
4 new project / no dependency A

Path A/B:

python3 -m tools.flow enter --phase onboarding --product chat --platform web

then READ flows/onboarding.md → 02-path-a-script.md or 03-path-b-script.md

prohibited enter --phase topic

Path C → READ references/04-path-c-script.md
Path D (should not be reached within the integration flow) → if reached by mistake, Read docs/SKILL.md


§3 Path A/B hard constraints

  • one slice per round; do not pre-read the next round's slice
  • Write-then-Verify phase gate
  • Path B prohibits reopen-add-feature(use §8.5 write-batch)

§4 Hard Rules summary

READ references/06-hard-rules.md + 06-a-defensive-coding.md


§5 Key files

  • {projectRoot}/.trtc-session.yaml(single session, via tools.session)
  • {projectRoot}/WHAT-TO-DO-NEXT.md(A.4 deliverable)
  • skills/trtc-chat/.docs-query.yaml(Path D orthogonal state)

§6 Rule conflict priority

this file §0/§1/0/1/2 > path scripts > hard rules > others


§7 References index

see references/10-references-index.md