playbook/.agents/python/index.md

41 lines
1.7 KiB
Markdown
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.

# Python 代理规则集(.agents/python
本规则集用于存放 **AI/自动化代理在仓库内工作时必须遵守的规则**Python 语言专属)。
## 范围与优先级
- 作为仓库级基线规则集使用;更靠近代码目录的规则应更具体并可覆盖基线。
- 当代理规则与 `docs` 发生冲突时:
1. 安全/合规优先
2. 其次保持仓库现有一致性
## 代理工作原则
- 先理解目标与上下文,再动手改代码。
- 修改要小而清晰;避免无关重构。
- 不要引入新依赖或工具,除非明确要求。
## 子文档
- 安全与鉴权:`auth.md`
- 性能:`performance.md`
- 代码质量:`code_quality.md`
- 测试:`testing.md`
## Python 必要约定(必须遵守)
- 代码风格基线Google Python Style Guide。
- 格式化与静态检查:优先使用仓库既有配置(`pyproject.toml`、`.flake8`、`.pylintrc`、`.pre-commit-config.yaml`);不要在未沟通前切换到另一套工具链。
- import 顺序:遵守 `isort profile = google`(若启用)。
- 文档字符串Google 风格(与 `.flake8`/团队约定对齐)。
- 命名:遵循 `docs/python/style_guide.md` 中的约定;如与既有代码冲突,以局部一致性优先。
## 与开发规范的关系
- 在本仓库内:`docs/python/` 与 `docs/common/`
- 在目标项目内(若按 README 推荐的 subtree prefix `docs/standards/playbook`
- 代码风格:`docs/standards/playbook/docs/python/style_guide.md`
- 工具链:`docs/standards/playbook/docs/python/tooling.md`
- 配置说明:`docs/standards/playbook/docs/python/configuration.md`
- 提交信息:`docs/standards/playbook/docs/common/commit_message.md`