Agent Skills › CanyonCodeCoreAI/canyonos › python-systems

python-systems

GitHub

指导 Python 系统级开发,涵盖服务、CLI 及分布式运行时行为设计。强调进程生命周期管理、并发控制、重试机制、状态一致性及故障恢复,倡导使用原生同步特性而非引入新框架,确保系统在中断和重启场景下的正确性。

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

Trigger Scenarios

涉及 Python 后端服务或 Worker 的设计与重构 处理分布式系统中的并发、重试、中断或恢复逻辑 审查 Python CLI 工具或后台任务的边界与错误处理

Install

npx skills add CanyonCodeCoreAI/canyonos --skill python-systems -g -y
More Options

Non-standard path

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

Use without installing

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.

Version History

  • 49e9bd0 Current 2026-11-13 18:19

Same Skill Collection

.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

Metadata

Files
0
Version
49e9bd0
Hash
f2c26144
Indexed
2026-11-13 18:19

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-14 03:24
浙ICP备14020137号-1