Agent Skills › CanyonCodeCoreAI/canyonos › python-systems

python-systems

GitHub

指导 Python 系统服务、Worker 及 CLI 的设计与审查,聚焦并发、重试、中断处理及分布式运行时行为,强调使用原生原语确保状态一致性与恢复能力。

.agents/skills/python-systems/SKILL.md CanyonCodeCoreAI/canyonos

触发场景

设计或审查 Python 后端服务与 Worker 处理并发、重试或中断逻辑 构建 Python CLI 工具

安装

npx skills add CanyonCodeCoreAI/canyonos --skill python-systems -g -y
更多选项

非标准路径

npx skills add https://github.com/CanyonCodeCoreAI/canyonos/tree/main/.agents/skills/python-systems -g -y

不安装直接使用

npx skills use CanyonCodeCoreAI/canyonos@python-systems

指定 Agent (Claude Code)

npx skills add CanyonCodeCoreAI/canyonos --skill python-systems -a claude-code -g -y

安装 repo 全部 skill

npx skills add CanyonCodeCoreAI/canyonos --all -g -y

预览 repo 内 skill

npx skills add CanyonCodeCoreAI/canyonos --list

SKILL.md

Frontmatter
{
    "name": "python-systems",
    "description": "Design, change, or review Python services, workers, CLIs, and distributed runtime behavior. Use for process lifecycles, shared state, concurrency, recovery, configuration, and operational boundaries."
}

Python Systems

Make the system correct when work is concurrent, retried, interrupted, or run in more than one process. Prefer ordinary synchronous Python and the platform's existing primitives over a new framework or local coordination scheme.

Choose the owner before writing code

Ask in this order:

  1. Which process or boundary owns the decision, lifecycle, and recovery?
  2. Can the database, queue, lock, supervisor, or existing service make the invariant durable?
  3. Is a request-path change necessary, or can asynchronous coordination own it?

Keep request paths small. Put bookkeeping, reconciliation, aggregation, and cleanup in the durable owner rather than every request handler. Do not introduce an in-process cache, thread, identifier scheme, or retry loop when an existing owner can be extended.

Design for interruption and retries

  • Treat process memory as one replica's view. Put shared state and transitions in a durable system with an atomic operation, uniqueness constraint, or lock when they can race.
  • A multi-system operation can partially succeed. Define ordering, idempotency, and a way to recover or converge before claiming it is atomic.
  • Bound network calls and retries. Retry only transient operations that are safe to repeat; preserve the original failure when recovery is not possible.
  • Give background work explicit ownership, shutdown behavior, failure logging, and cleanup. A loop must not silently die after one failed iteration.

Keep contracts local and explicit

  • Validate input at the boundary; keep domain rules near the domain contract. Reuse authoritative schemas, configuration, logging, and process-management utilities rather than duplicating them.
  • Catch errors only to recover or translate a boundary failure. Do not turn failures into success-shaped defaults or log secrets and full request bodies.
  • Make CLI output and public errors actionable: identify the failed operation and the safe next step without exposing implementation internals.

Verify the actual boundary

Exercise the changed command, worker, service, or integration with failure and restart conditions relevant to the change. Report the checks that ran and the ones that require unavailable infrastructure.

For CanyonOS Python changes, read the repository reference before editing: it contains maintained module owners, package constraints, and area-specific commands.

版本历史

  • 49e9bd0 当前 2026-11-13 18:19

同 Skill 集合

.agents/skills/api-dev/SKILL.md
.agents/skills/architecture/SKILL.md
.agents/skills/cc-pr-review/SKILL.md
.agents/skills/code-review/SKILL.md
.agents/skills/diagnosing-bugs/SKILL.md
.agents/skills/testing/SKILL.md
.agents/skills/ui-dev/SKILL.md
skills/converting-to-canyonos/SKILL.md
skills/prompt-management/SKILL.md
skills/scaling-agents/SKILL.md

元信息

文件数
0
版本
49e9bd0
Hash
f2c26144
收录时间
2026-11-13 18:19

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-14 20:39
浙ICP备14020137号-1