robyn-config-backend-best-practices
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRobyn Config Backend Best Practices
Robyn Config 后端最佳实践
Overview and intent
概述与用途
Use this skill to work effectively with and production-oriented Robyn backend patterns.
robyn-configThis skill is optimized for four task groups:
- scaffold a new service with
robyn-config create - extend an existing service with
robyn-config add - audit and improve architecture and operational readiness
- author high-quality skill files for Robyn engineering work
Do not load every reference file by default. Load only the files required for the current task.
本skill用于指导你高效使用以及面向生产环境的Robyn后端模式。
robyn-config本skill针对四类任务场景优化:
- 使用搭建新服务
robyn-config create - 使用扩展现有服务
robyn-config add - 审计并优化架构与运维就绪性
- 为Robyn工程工作编写高质量skill文件
默认不要加载所有参考文件,仅加载当前任务所需的文件。
Fast triage workflow
快速分类工作流
- Detect project metadata in :
pyproject.toml- (
[tool.robyn-config].designorddd)mvc - (
[tool.robyn-config].ormorsqlalchemy)tortoise - (
[tool.robyn-config].package_manageroruv)poetry
- Classify requested work:
- bootstrap
- extension
- architecture or operations audit
- skill authoring
- Select references from the routing table in this file.
- Produce branch-specific guidance for design, ORM, and package manager.
- End with a validation checklist and concrete commands.
- 从中检测项目元数据:
pyproject.toml- (
[tool.robyn-config].design或ddd)mvc - (
[tool.robyn-config].orm或sqlalchemy)tortoise - (
[tool.robyn-config].package_manager或uv)poetry
- 对需求任务进行分类:
- 项目初始化
- 项目扩展
- 架构或运维审计
- skill文档编写
- 从本文档的参考路由表中选择对应参考文件。
- 针对所选架构、ORM和包管理器提供分支专属指导。
- 最终输出验证清单与具体执行命令。
Workflow A: bootstrap from robyn-config create
robyn-config create工作流A:使用robyn-config create
初始化项目
robyn-config create- Select stack options: design, ORM, package manager.
- Generate service:
bash
robyn-config create <service-name> --design <ddd|mvc> --orm <sqlalchemy|tortoise> --package-manager <uv|poetry> <destination>- Confirm output baseline:
- contains
pyproject.toml[tool.robyn-config] - layout matches selected design
src/app - lock file matches package manager (or
uv.lock)poetry.lock
- Execute ORM-specific migration bootstrap before app start.
- Run lint, type checks, and tests, then report exact failures with file paths.
- 选择技术栈选项:架构、ORM、包管理器。
- 生成服务:
bash
robyn-config create <service-name> --design <ddd|mvc> --orm <sqlalchemy|tortoise> --package-manager <uv|poetry> <destination>- 确认输出基线:
- 中包含
pyproject.toml配置[tool.robyn-config] - 目录结构与所选架构匹配
src/app - 锁文件与所选包管理器一致(或
uv.lock)poetry.lock
- 在启动应用前执行ORM专属的迁移初始化操作。
- 运行代码检查、类型校验与测试,并附带文件路径报告具体失败项。
Workflow B: evolve project with robyn-config add
robyn-config add工作流B:使用robyn-config add
演进项目
robyn-config add- Ensure target project is a project by checking
robyn-config.[tool.robyn-config] - Read optional path overrides under .
[tool.robyn-config.add] - Add module:
bash
robyn-config add <entity-name> <project-path>- Verify generated updates:
- new files in expected layer paths
- route registration inserted in the right registry file
- repository exports and tables updated
- no duplicate symbols or broken imports
- Regenerate migrations if schema changed.
- Run checks and confirm command rollback behavior if failures occur.
- 通过检查配置确认目标项目是
[tool.robyn-config]项目。robyn-config - 读取下的可选路径覆盖配置。
[tool.robyn-config.add] - 添加模块:
bash
robyn-config add <entity-name> <project-path>- 验证生成的更新内容:
- 新文件位于预期的分层路径中
- 路由注册已插入正确的注册表文件
- 仓库导出与数据表已更新
- 无重复符号或无效导入
- 若数据库 schema 变更则重新生成迁移文件。
- 运行检查,并确认失败时的命令回滚行为。
Workflow C: review and improve architecture and ops readiness
工作流C:评审与优化架构及运维就绪性
- Validate architecture boundaries for selected design.
- Validate runtime safety:
- settings and env overrides
- auth, session, CORS behavior
- transaction boundaries and error mapping
- Validate operations:
- migration startup order
- compose and local parity
- logging and debug posture
- Prioritize recommendations:
- P0 correctness and security
- P1 reliability and consistency
- P2 maintainability and performance
- Provide file-targeted, diff-ready changes.
- 验证所选架构的边界合规性。
- 验证运行时安全性:
- 配置与环境变量覆盖逻辑
- 认证、会话、CORS行为
- 事务边界与错误映射
- 验证运维就绪性:
- 迁移启动顺序
- Docker Compose与本地环境一致性
- 日志与调试模式
- 对建议进行优先级排序:
- P0:正确性与安全性
- P1:可靠性与一致性
- P2:可维护性与性能
- 提供针对具体文件、可直接生成diff的修改建议。
Workflow D: author and update skill files for Robyn engineering
工作流D:编写与更新Robyn工程相关的skill文件
- Keep concise and procedural.
SKILL.md - Put deep detail into and load on demand.
references/ - Write frontmatter with explicit trigger contexts.
- Reuse rule patterns from where useful.
react-best-practices - Validate skill structure before delivering:
- no placeholder markers
- all referenced files exist
- no extra docs such as README or changelog inside skill folder
- 保持简洁且流程化。
SKILL.md - 将详细内容放入目录,按需加载。
references/ - 编写包含明确触发场景的前置元数据。
- 在适用场景下复用中的规则模式。
react-best-practices - 交付前验证skill文件结构:
- 无占位符标记
- 所有引用文件均存在
- skill目录内无README或变更日志等额外文档
Reference routing table
参考路由表
Open only the file needed for the task:
references/robyn-config-src-analysis.md- Use for internals and generation/injection behavior.
robyn-config
- Use for
references/robyn-backend-best-practices.md- Use for prioritized engineering guidance and review criteria.
references/robyn-config-workflows.md- Use for operator playbooks and command sequences.
references/architecture-ddd-vs-mvc.md- Use for architecture selection and refactor planning.
references/orm-sqlalchemy-vs-tortoise.md- Use for ORM tradeoffs and migration/session behavior.
references/skill-authoring-patterns.md- Use for writing and validating high-quality skill markdown.
references/react-style-rule-system.md- Use for reusable rule-library design patterns and taxonomy.
仅打开当前任务所需的文件:
references/robyn-config-src-analysis.md- 用于了解内部实现与生成/注入逻辑。
robyn-config
- 用于了解
references/robyn-backend-best-practices.md- 用于获取优先级排序的工程指导与评审标准。
references/robyn-config-workflows.md- 用于获取运维操作手册与命令序列。
references/architecture-ddd-vs-mvc.md- 用于架构选型与重构规划。
references/orm-sqlalchemy-vs-tortoise.md- 用于分析ORM选型权衡与迁移/会话行为。
references/skill-authoring-patterns.md- 用于编写与验证高质量的skill文档。
references/react-style-rule-system.md- 用于复用规则库设计模式与分类体系。
Output requirements
输出要求
Always:
- Include concrete executable commands.
- Include design and ORM branch-specific instructions.
- Include package-manager-aware instructions (and
uv).poetry - Include a validation checklist covering structure, behavior, and checks.
- State assumptions explicitly when repository context is incomplete.
必须满足以下要求:
- 包含可直接执行的具体命令。
- 包含针对所选架构与ORM分支的专属说明。
- 包含适配包管理器的说明(与
uv)。poetry - 包含覆盖结构、行为与检查项的验证清单。
- 当仓库上下文不完整时,明确说明假设条件。