SKILL.md--- name: aip-user-stories description: Generate verified recipe playbooks from AIPs with PR implementations (post mode), or speculative user stories from AIPs without implementations (pre mode). Use when the user provides an AIP URL or AIP content, optionally with PR URLs and file paths. when_to_use: Trigger when the user mentions aip user stories, aip playbook, aip recipes, generate recipes from AIP, user stories for AIP, AIP guide, AIP how-to. allowed-tools: Bash(gh pr view *) Bash(gh pr diff *) Read WebFetch(domain:cwiki.apache.org) WebFetch(domain:github.com) argument-hint: <AIP-URL-or-pasted-content> [<PR-URL>...] [<file>...] license: Apache-2.0 --- <!-- SPDX-License-Identifier: Apache-2.0 https://www.apache.org/licenses/LICENSE-2.0 --> # AIP-to-User-Stories Playbook ## Invocation ``` /aip-user-stories <AIP-URL-or-pasted-content> [<PR-URL>...] [<file>...] ``` If no arguments: print this usage synopsis and stop. ## Mode Detection An argument starting with `https://cwiki.apache.org/confluence/` is the AIP URL. Arguments starting with `https://github.com/apache/airflow/pull/` are PR URLs. Other arguments are local file paths. - **PR URLs present → post-implementation mode**: generates verified recipe playbooks from actual code. - **No PR URLs → pre-implementation mode**: generates speculative user stories to help AIP authors validate design. PR URLs signal post mode and serve as **discovery hints** — starting points for finding the implementation in the codebase. They are not an exhaustive list of all PRs for the feature, and the skill must explore beyond the supplied PRs to find the full implementation. ## AIP Number Extract the AIP number from the URL path (e.g., `AIP-76` from a URL containing `/aip-76` or `/AIP-76`). If the number cannot be determined from the URL or pasted content, ask the user. ## Output Path Write the final playbook to `.claude/aip-{number}.md` where `{number}` is the extracted AIP number. If the file already exists, ask the user before overwriting. --- ## Post-Implementation Mode Source of truth: the **actual implementation** in the codebase and PRs — not the AIP specification. When the AIP proposes APIs that differ from what was implemented, the playbook follows the implementation. ### Phase 1 — Parse Separate arguments into: - **AIP source**: a URL to fetch, or pasted content already in the conversation. - **PR URLs**: GitHub pull request URLs (one or more). - **File paths**: local files (example Dags, source files, tests). AIP content can come from a URL (fetched via WebFetch) or pasted directly by the user — both are equally valid input paths. If a URL fetch returns empty or garbled content, tell the user and ask them to paste the AIP content instead. At least one PR URL is required in post mode. If none are provided but the mode was forced, ask for PR URLs. ### Phase 2 — Fetch & Discover Retrieve initial sources: - A