|
| 1 | +--- |
| 2 | +name: implementation-strategy |
| 3 | +description: Decide how to implement runtime and API changes in openai-agents-python before editing code. Use when a task changes exported APIs, runtime behavior, serialized state, tests, or docs and you need to choose the compatibility boundary, whether shims or migrations are warranted, and when unreleased interfaces can be rewritten directly. |
| 4 | +--- |
| 5 | + |
| 6 | +# Implementation Strategy |
| 7 | + |
| 8 | +## Overview |
| 9 | + |
| 10 | +Use this skill before editing code when the task changes runtime behavior or anything that might look like a compatibility concern. The goal is to keep implementations simple while protecting real released contracts. |
| 11 | + |
| 12 | +## Quick start |
| 13 | + |
| 14 | +1. Identify the surface you are changing: released public API, unreleased branch-local API, internal helper, persisted schema, wire protocol, CLI/config/env surface, or docs/examples only. |
| 15 | +2. Determine the latest release boundary: |
| 16 | + ```bash |
| 17 | + BASE_TAG="$(.agents/skills/final-release-review/scripts/find_latest_release_tag.sh origin 'v*' 2>/dev/null || git tag -l 'v*' --sort=-v:refname | head -n1)" |
| 18 | + echo "$BASE_TAG" |
| 19 | + ``` |
| 20 | +3. Judge breaking-change risk against that latest release tag, not against unreleased branch churn or post-tag changes already on `main`. |
| 21 | +4. Prefer the simplest implementation that satisfies the current task. Update callers, tests, docs, and examples directly instead of preserving superseded unreleased interfaces. |
| 22 | +5. Add a compatibility layer only when there is a concrete released consumer or durable external state that requires it, or when the user explicitly asks for a migration path. |
| 23 | + |
| 24 | +## Compatibility boundary rules |
| 25 | + |
| 26 | +- Released public API or documented external behavior: preserve compatibility or provide an explicit migration path. |
| 27 | +- Persisted schema, serialized state, wire protocol, CLI flags, environment variables, and externally consumed config: treat as compatibility-sensitive even if the implementation is local. |
| 28 | +- Python-specific durable surfaces such as `RunState`, session persistence, exported dataclass constructor order, and documented model/provider configuration should be treated as compatibility-sensitive when they were part of the latest release tag. |
| 29 | +- Interface changes introduced only on the current branch: not a compatibility target. Rewrite them directly. |
| 30 | +- Interface changes present on `main` but added after the latest release tag: not a semver breaking change by themselves. Rewrite them directly unless they already define durable external state. |
| 31 | +- Internal helpers, private types, same-branch tests, fixtures, and examples: update them directly instead of adding adapters. |
| 32 | + |
| 33 | +## Default implementation stance |
| 34 | + |
| 35 | +- Prefer deletion or replacement over aliases, overloads, shims, feature flags, and dual-write logic when the old shape is unreleased. |
| 36 | +- Do not preserve a confusing abstraction just because it exists in the current branch diff. |
| 37 | +- If review feedback claims a change is breaking, verify it against the latest release tag and actual external impact before accepting the feedback. |
| 38 | +- If a change truly crosses the latest released contract boundary, call that out explicitly in the ExecPlan, release notes context, and user-facing summary. |
| 39 | + |
| 40 | +## When to stop and confirm |
| 41 | + |
| 42 | +- The change would alter behavior shipped in the latest release tag. |
| 43 | +- The change would modify durable external data, protocol formats, or serialized state. |
| 44 | +- The user explicitly asked for backward compatibility, deprecation, or migration support. |
| 45 | + |
| 46 | +## Output expectations |
| 47 | + |
| 48 | +When this skill materially affects the implementation approach, state the decision briefly in your reasoning or handoff, for example: |
| 49 | + |
| 50 | +- `Compatibility boundary: latest release tag v0.x.y; branch-local interface rewrite, no shim needed.` |
| 51 | +- `Compatibility boundary: released RunState schema; preserve compatibility and add migration coverage.` |
0 commit comments