Files
AstrBot/openspec/config.yaml
2026-03-23 21:49:19 +08:00

45 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
schema: spec-driven
# 项目上下文
context: |
技术栈: Python 3.12, anyio (异步), FastAPI, pytest, ruff, uv
领域: 多平台 LLM 聊天机器人框架 (QQ, Telegram, Discord 等)
架构: 基于协议的系统 (LSP, MCP, ACP, ABP)
# artifact 规则
rules:
tasks:
- 任务拆分为最大2小时块
- 新功能必须编写测试
- 提交前运行 ruff 和 pytest
code:
- 使用绝对导入,前缀 `astrbot.`
- 必须有类型标注(尽量避免 Any
- 注释使用英文
commits:
- 使用 conventional commits (feat:, fix:, docs:, refactor:, test:, chore:)
# 项目最高旨意
directives:
architecture: |
新架构放在 _internal 包中,避免分支冲突。
协议系统: LSP (客户端), MCP (客户端+服务端), ACP (客户端+服务端), ABP (客户端+服务端)。
Runtime 协调协议Gateway 提供 FastAPI 后端。
Stars 是插件 - Galaxy 是星星的集合。
async_library: |
使用 anyio 作为异步库(不是 asyncio
coverage: |
必须提高覆盖率测试。
type_checking: |
代码必须通过 `uvx ty check` (astral 的 pyright)。
避免使用 Any 和 cast。
code_style: |
代码必须通过 `ruff check .` 和 `ruff format .`。
execution: |
运行 Python 脚本必须使用 `uv run`,不要用裸 python。
goal: |
最终目标:实现 ABP 协议
代码美观
类型标注完美
将现有功能迁移到新架构