본문으로 건너뛰기
cccskills
무료GitHub에 공개

python-coder

Implement and refactor production Python, FastAPI, Pydantic, async, and migrations.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

sno-ai/sno-station-skills스타 883(GitHub 883 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(3)

  • SKILL.md7.3 KB
  • references/advanced-patterns.md8.6 KB
  • scripts/selftest/run-selftest.sh1.2 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Python Coder

Every development task has a finite budget including setup, tests, and reporting. Before running tests, estimate duration from available timings and identify the changed behavior or directly affected consumer. If timing is unknown, state an estimate; do not build a timing system or run a preliminary suite. Full evaluation, unit, integration, or repository suites require the owner's explicit request, never a skill, PRD, review, or default command. Remove checks that neither prove the requested main function nor expose its defects. Repeat only after a relevant change or failure. Every new security check requires the owner's explicit approval for that specific check; remove auxiliary security, assertion, hash, or bookkeeping blockers of useful work.

Write production Python that fits the current repository, stays small, and is easy to verify. Local repo instructions add project-specific detail; they do not weaken these rules.

Runtime Source of Truth

Honor the Python version declared by the user or the repository (pyproject.toml requires-python, .python-version, setup.cfg, tox.ini, CI, package metadata). Never emit syntax, stdlib APIs, or typing features newer than the target. For 3.14+ targets, prefer 3.14 idioms where they improve clarity or correctness: lazy annotations (PEP 649), InterpreterPoolExecutor (PEP 734), t-strings (PEP 750), free-threading awareness (PEP 779).

Boundaries

  • No backward compatibility by default. No legacy paths, compatibility wrappers, migration shims, dual-format support, or fallback behavior unless explicitly requested. A published external contract is the only exception, and only when the user or repo instructions confirm it is published.
  • Read before writing. Relevant exports, immediate callers, shared utilities, nearby tests, and the package's typecheck/test setup — before adding code.
  • Official docs for third-party behavior. Before changing a dependency version, or using a third-party API, SDK, CLI, or service in a way neither the PRD nor existing code already shows, read its current official documentation; for a version change, read the release notes between the two versions. Name the page and version in the report. When a PRD governs the work and lacks or contradicts that fact, add it to the PRD's execution notes.
  • Surgical changes. Touch only what the task requires. No adjacent refactoring, no speculative abstractions or configurability, no error handling for scenarios that cannot happen.
  • Deterministic code for deterministic decisions. Routing, retries, status-code handling, schema validation, parsing, and transforms belong in code, never in a model call.
  • Conflicting local patterns: pick one source of truth (by authority, recency, test coverage), state the choice, flag the other for cleanup. Never blend conventions into a third style.

Design Rules

Intent: types make illegal states unrepresentable, data structures replace branches, and every line is a liability that must earn its place.

Types

  • Zero Any. Use object + narrowing, generics, or TypedDict. cast() only at validated boundaries, with a comment saying why.
  • Literal[...] over bare str; TypedDict over dict[str, Any] — split required/optional via a required base class + total=False subclass so guaranteed keys stay guaranteed.
  • Protocol over ABC (structural typing, stub-friendly testing); class hierarchies max 1 level — favor composition.
  • @dataclass(frozen=True, slots=True) for value objects with behavior; TypedDict for data crossing boundaries (JSON, APIs, configs).
  • T | None over Optional[T]; type X = ... aliases (3.12+); typing.Self for fluent/builder methods; @overload when the return type depends on an argument; ClassVar[T] for class-level state.
  • Abstract types (Sequence/Mapping/Iterable from collections.abc) in parameters, concrete types in returns. Explicit return types on public functions.
  • from __future__ import annotations: omit on 3.14+ targets and remove it from files you edit there; on older targets follow the repo's existing annotation strategy — do not remove it opportunistically.
  • if TYPE_CHECKING: for heavy or cycle-prone imports.

Structure & errors

  • Functions under ~50 lines, max 3 indentation levels, early-return guard clauses, happy path at lowest indentation.
  • Exception hierarchies for expected errors: a base class plus narrow subclasses, so callers choose their catch specificity. Wrap only the line that can raise; never bare except:; no mutable default arguments; no magic strings/numbers (constants or Literal).
  • Resources (connections, files, locks) always via context managers or finally.
  • __all__ declares each module's public API. Pure logic in the core, side effects at the edges.
  • Replace manual counting/grouping/nested combinatoric loops with Counter, defaultdict, itertools.
  • Docstrings are contracts (preconditions, silenced errors, external failure modes), not narration; skip when nothing is non-obvious.

Async & parallelism

  • asyncio.TaskGroup over gather() — structured cancellation, no orphaned tasks.
  • CPU-bound work: InterpreterPoolExecutor over ProcessPoolExecutor (3.14+); keep threads for I/O.
  • Shared mutable state is always locked (threading.Lock / asyncio.Lock) — free-threaded Python (PEP 779) turns previously-hidden races into real bugs.

Boundaries & config

  • Keep fixed-format parsing and protocol literals in code; use existing translation resources only for text that requires localization.
  • Reuse the repository's configuration and boundary-validation approach; do not introduce a configuration framework, translation system, or startup gate for an ordinary change. Internal calls trust types.
  • SQL always via parameterized queries, HTML through the framework's escaping, log fields via extra={} — never hand-interpolated strings. T-strings (string.templatelib, 3.14+) do no escaping by themselves; use them only where the repo already has a vetted template processor for that exact sink.

Logging

  • Never print() in production code. logging.getLogger(__name__); %s formatting or extra={} — never f-strings in log calls; logger.exception for stack traces.

Verification

Before reporting done, every claim must trace to a command actually run this session:

  1. The repo's declared type checker passes with zero errors on changed files; no typing features newer than the declared runtime.
  2. Run the repo's declared check/fix command and report zero remaining errors.
  3. Search changed files for Any — confirm none; confirm annotation strategy matches the target runtime.
  4. Re-read the diff once: delete anything removable without losing correctness or clarity, and confirm every changed line traces to the request.

If a check fails, report the failure with its output — never report done with errors outstanding.

For advanced patterns (generic protocols, async generators, thread-safe singletons, custom decorators, sentinel objects), read references/advanced-patterns.md.

<!-- reminders:start --> <!-- reminders:end -->

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Answer how long agent work will take, how much longer active work needs, or what clock time applies. Estimate full AI-agent wall time, measure active progress first, and get owner-facing times from `sno report-time`. Never estimate human-developer time.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

sno-ai/sno-station-skills8832026년 10월 25일 업데이트

Prove that a reported run caused its intended real effect. Walk the executor path from entry to effect, capture one observable per hop, and report a result a no-op could not produce.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

sno-ai/sno-station-skills8832026년 10월 25일 업데이트

Give the owner one page when they come back from sleep, a meeting or a long run: what got done, what is stuck, what waits for their answer, and what it cost in quota. Use when the owner asks what happened while they were away, wants a status page, or when you finish a long stretch of work and must report it.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

sno-ai/sno-station-skills8832026년 10월 25일 업데이트

Report how many problems the two brains found: mutual review (the other model checks the work, from the peer-review records) and self-check (an agent finds its own error in its own conversation, judged by that agent's own model), side by side. Use when the owner asks whether the second agent or the reviews are worth it, or wants the week's review results.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

sno-ai/sno-station-skills8832026년 10월 25일 업데이트

charter

무료

Write, revise or review a charter: the one document that tells an executor what to deliver, what is out of bounds, what the owner already decided, and how each success check will be proven. Use when work needs a written brief before someone else does it, or when asked to write, change or check a charter.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

sno-ai/sno-station-skills8832026년 10월 25일 업데이트

Route production coding tasks from Claude Code to the user-level Codex Shell, TypeScript, Python, or Rust workflow through a direct `codex exec` run. Use for "codex-coder", "ask Codex to write code", "generate with Codex", language migrations, or mixed Shell/TypeScript/Python/Rust implementation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

sno-ai/sno-station-skills8832026년 10월 25일 업데이트

sno-ai의 스킬 모두 보기

이 스킬의 문제 신고