一键导入
seed-test-chat
Bootstrap dev DB / integration tests with a fake watched chat, moderators, captcha challenges, spam messages, moderation actions. Use
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Bootstrap dev DB / integration tests with a fake watched chat, moderators, captcha challenges, spam messages, moderation actions. Use
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Bump the patch version in server/Cargo.toml or website/package.json after completing a major change. Use when the user asks to bump/release a version, or when CLAUDE.md's rule about version bumps after major changes applies.
Before a non-trivial change, list affected systems — DB schema, API contract, Telegram handlers, jobs, TS types, docs. Catch ripple effects upfront, not after CI fails. Use when planning a feature, migration, refactor, or any cross-module touch.
Self-review before push — read the diff as a reader, scan for vixen footguns (token leaks, PII, idempotency, captcha asset overwrites), run validation pipeline, no surprise files. Use before "git push", before opening a PR, or when the user says "ready to commit".
Write a git commit message for vixen-rs following the project's Conventional Commits convention. Use when the user asks to commit, create a commit, or write a commit message.
Reproduce → bisect → root cause → fix → verify. Don't speculate, don't "add more error handling" as a guess. Use when something is broken, when a test fails intermittently, when the user says "this isn't working" or "investigate why".
Write small, fast, reproducible Dockerfiles for the vixen-rs server (Rust) and website (bun) using multi-stage builds, cache mounts, distroless/alpine runtime images, and non-root users. Use when editing server/Dockerfile, website/Dockerfile, docker-compose.yml, or when the user asks to shrink an image or speed up a Docker build.
| name | seed-test-chat |
| description | Bootstrap dev DB / integration tests with a fake watched chat, moderators, captcha challenges, spam messages, moderation actions. Use |
Read first:
#[sqlx::test].server/tests/fixtures/seed.rs — small helpers, each returns the inserted row or id:
pub async fn seed_chat(pool: &PgPool, chat_id: i64, title: &str) -> Result<()> { ... }
pub async fn seed_moderator(pool: &PgPool, chat_id: i64, user_id: i64) -> Result<()> { ... }
pub async fn seed_verified_user(pool: &PgPool, chat_id: i64, user_id: i64) -> Result<()> { ... }
pub async fn seed_captcha_challenge(pool: &PgPool, chat_id: i64, user_id: i64) -> Result<Uuid> { ... }
pub async fn seed_spam_message(pool: &PgPool, chat_id: i64, hash: i64, text: &str) -> Result<()> { ... }
pub async fn seed_moderation_action(pool: &PgPool, chat_id: i64, target: i64, action: &str) -> Result<i64> { ... }
Use #[sqlx::test] for a fresh DB per test — never share state.
cargo run --bin seed-dev -- --chat-id -1001234567890 --owner 42 (binary in server/bin/seed-dev.rs) inserts one chat with one moderator. Ready for manual testing against the real bot.
i64. Use realistic supergroup IDs -1001234567890 (always negative for supergroups, leading -100).NOW() (SQL) or Utc::now() (Rust) — never local time.sqlx::query! so .sqlx/ stays in sync. The fixtures are also a sanity check on schema drift.verified_users(chat_id, user_id) and captcha_challenges(chat_id, user_id) will throw on re-seed. Use INSERT ... ON CONFLICT DO NOTHING or DELETE first when re-running locally.chats before chat_moderators / verified_users.cargo test integration.cargo run --bin seed-dev -- --chat-id -1001234567890 --owner 42, then query the DB to confirm rows.rust-testing — #[sqlx::test] patterns, mocks.add-migration — schema changes that break fixtures.