Skip to content

feat(docs,repo): flow-pack E4 — /flow-epics command template + local install (#373)#374

Merged
w7-mgfcode merged 3 commits into
devfrom
feat/flow-pack-e4-flow-epics
Jun 1, 2026
Merged

feat(docs,repo): flow-pack E4 — /flow-epics command template + local install (#373)#374
w7-mgfcode merged 3 commits into
devfrom
feat/flow-pack-e4-flow-epics

Conversation

@w7-mgfcode
Copy link
Copy Markdown
Owner

@w7-mgfcode w7-mgfcode commented Jun 1, 2026

Summary

What the command does

/flow-epics <umbrella-N> reads the umbrella issue's Decomposition section, idempotently creates phase-ordered epic issues (Foundation → Parallel → Release gate), links them as GitHub sub-issues via the REST API (gh api ... --header "GitHub-Next-Preview: true"), and prints per-epic handoffs to base_prp:prp-create. E5 Release gate is always shown as ⏭️ SKIP (never auto-created per #373 scope).

Key implementation decisions

  • Pagination fix: gh label list truncates at 30 items — epic and flow labels live on page 2. Pre-flight check uses gh api repos/{owner}/{repo}/labels --paginate instead.
  • Write discipline: all 5 invariants encoded — dry-run echo → idempotent check (title search + GraphQL sub-issue query) → approval gate → rate-delay (sleep 1) → confirm.
  • Durable-source split: docs/flow-pack/commands/flow-epics.md is the committed contract; .claude/commands/flow/ is gitignored and regenerable.

Validation

Test plan

  • CI gates green (lint, typecheck, test, migration-check)
  • flow:flow-epics appears in available skills after local install
  • /flow-epics 368 shows correct inventory (E1–E4 linked, E5 deferred) with no writes until approved

Summary by Sourcery

Add documented command templates for the flow-pack brainstorming, umbrella, and epics commands to complete the documented flow-pack command suite.

Documentation:

  • Document the /flow-brainstorm command as a full V1→V2 planning and scoring workflow, including subagent research and logging behavior.
  • Document the /flow-umbrella command for generating validated umbrella GitHub issues from V2 ship lists with approval gates and output formatting.
  • Document the /flow-epics command for deriving, creating, and linking epic issues from an umbrella decomposition with idempotent guards and handoff steps.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jun 1, 2026

Reviewer's Guide

Adds tracked command-spec docs for the flow-pack brainstorming, umbrella-issue, and epic-creation commands, and wires /flow-epics to create and link epic issues idempotently using GitHub REST/GraphQL with stricter label/milestone checks and local regenerable command copies.

Sequence diagram for /flow-epics epic creation and linking

sequenceDiagram
  actor User
  participant flow_epics as flow_epics_command
  participant gh as GitHub_CLI
  participant api as GitHub_API

  User->>flow_epics: run /flow-epics <umbrella-N>
  flow_epics->>gh: gh issue view <N> --json number,title,body,labels,milestone
  gh->>api: GET /repos/{owner}/{repo}/issues/<N>
  api-->>gh: umbrella issue JSON
  gh-->>flow_epics: umbrella_title, body, labels, milestone

  flow_epics->>gh: gh api repos/{owner}/{repo}/labels --paginate
  gh->>api: GET /repos/{owner}/{repo}/labels (paginated)
  api-->>gh: label list
  gh-->>flow_epics: labels (must include epic, flow, feat)

  flow_epics->>gh: gh api graphql (issue.subIssues)
  gh->>api: POST /graphql (subIssues query)
  api-->>gh: subIssues nodes (existing epics)
  gh-->>flow_epics: current sub-issues

  loop for each non-SKIP epic
    flow_epics->>gh: gh issue list --search "<exact epic title>"
    gh->>api: GET /search/issues?q=<title>
    api-->>gh: candidate issue
    gh-->>flow_epics: EXISTS or NOT_FOUND, Linked?
  end

  User-->>flow_epics: review inventory table

  loop for each epic needing create
    flow_epics-->>User: echo gh issue create ... (dry-run)
    User-->>flow_epics: type 'approve' or skip
    alt approved create
      flow_epics->>gh: gh issue create --title "..." --body "..." --label epic --label flow --label feat --milestone "flow-pack-suite"
      gh->>api: POST /repos/{owner}/{repo}/issues
      api-->>gh: created epic #M
      gh-->>flow_epics: issue number M
      flow_epics->>flow_epics: sleep 1
    else skipped
      flow_epics->>flow_epics: skip create
    end
  end

  loop for each epic needing link
    flow_epics-->>User: echo gh api .../issues/<N>/sub_issues -F sub_issue_id=<M> (dry-run)
    User-->>flow_epics: type 'approve' or skip
    alt approved link
      flow_epics->>gh: gh api repos/{owner}/{repo}/issues/<N>/sub_issues -X POST -F sub_issue_id=<M> --header GitHub-Next-Preview: true
      gh->>api: POST /repos/{owner}/{repo}/issues/<N>/sub_issues
      api-->>gh: link created
      gh-->>flow_epics: OK
      flow_epics->>flow_epics: sleep 1
    else skipped
      flow_epics->>flow_epics: skip link
    end
  end

  flow_epics->>gh: gh api graphql (issue.subIssues)
  gh->>api: POST /graphql (subIssues query)
  api-->>gh: final subIssues nodes
  gh-->>flow_epics: updated sub-issues
  flow_epics-->>User: print gate result + base_prp:prp-create handoffs
Loading

File-Level Changes

Change Details Files
Document the /flow-brainstorm command as the canonical tracked contract for brainstorming initiatives into a V2 ship/defer list.
  • Introduce a full markdown spec describing objectives, inputs, outputs, and process for /flow-brainstorm.
  • Define the 3 read-only research subagents (Known Issues, Best Practices, Dependencies) and how Claude should orchestrate them in parallel.
  • Specify the 5-dimension scoring model, negotiation handling, V2 ship/defer list construction, and append-only decision log format in .flow/brainstorm-log.md.
  • Define the human approval gate, output format, and how this command hands off to /flow-umbrella.
docs/flow-pack/commands/flow-brainstorm.md
Document the /flow-umbrella command that turns a V2 ship list into a GitHub umbrella issue with a strict 7-section body and guarded creation flow.
  • Describe how /flow-umbrella reads .flow/brainstorm-log.md and .flow/state.md to derive the initiative title, V2 ship/defer items, milestone, and type label.
  • Define prerequisite checks for labels and milestones, including concrete remediation commands when anything is missing.
  • Specify an idempotent check for an existing umbrella issue with the same title and the rule for reusing vs creating a new one.
  • Codify the exact 7-field umbrella-issue body structure, dry-run echo with --body-file, approval gate semantics, creation/confirmation steps, and next-command pointer to /flow-epics.
docs/flow-pack/commands/flow-umbrella.md
Add the /flow-epics command spec that reads an umbrella’s decomposition, manages epic creation/linking via GitHub REST/GraphQL, and enforces label/milestone and idempotency invariants.
  • Define argument resolution for the umbrella issue number, including fallback to .flow/state.md and failure conditions.
  • Specify how to parse the umbrella’s Decomposition section into phase-typed epics, title patterns, skip rules, and scope extraction.
  • Replace naive label listing with a paginated GitHub labels API call and enforce presence of epic/flow/feat labels and the configured milestone before any writes.
  • Describe the GraphQL sub-issues query, idempotent inventory table, create-and-link loop with per-epic dry-run + approval gates + rate limiting, verification step, output format, and handoff to base_prp:prp-create per linked epic.
  • Clarify the durable-source split: docs/flow-pack/commands/flow-epics.md as the tracked source with a regenerable .claude/commands/flow/flow-epics.md copy.
docs/flow-pack/commands/flow-epics.md

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 41fc6160-d1c3-47b5-acfb-7b4548b03f31

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/flow-pack-e4-flow-epics

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • In the /flow-epics template, the GraphQL query hard-codes owner and repo (w7-mgfcode/ForecastLabAI); consider parameterizing these from the current git remote or gh context so the command is reusable across repositories.
  • The epic label pre-flight in /flow-epics checks specifically for epic|flow|feat, but earlier you derive the type label from the umbrella (which might not be feat); aligning this check with the computed type label would avoid falsely failing when a non-feat type is used.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the `/flow-epics` template, the GraphQL query hard-codes `owner` and `repo` (`w7-mgfcode/ForecastLabAI`); consider parameterizing these from the current git remote or `gh` context so the command is reusable across repositories.
- The epic label pre-flight in `/flow-epics` checks specifically for `epic|flow|feat`, but earlier you derive the type label from the umbrella (which might not be `feat`); aligning this check with the computed type label would avoid falsely failing when a non-`feat` type is used.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant