Skip to content

feat(docs,repo): flow-pack E1 foundation — /flow-prime + tracked contract + rule (#369)#370

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

feat(docs,repo): flow-pack E1 foundation — /flow-prime + tracked contract + rule (#369)#370
w7-mgfcode merged 3 commits into
devfrom
feat/flow-pack-e1-foundation

Conversation

@w7-mgfcode
Copy link
Copy Markdown
Owner

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

Links

What this PR does

Implements the E1 foundation of the flow: command suite — the tracked durable source of truth and the first command (/flow-prime), installed locally per the durable-source split convention. No E2–E5 work was performed.

Files committed (tracked — 4 files)

File Purpose
docs/flow-pack-methodology.md Durable contract: Mermaid pipeline, invariants, 7-field umbrella contract, FLAI mapping table, durable-source split, fresh-clone recovery, portability manifest
docs/flow-pack/commands/flow-prime.md Canonical /flow-prime command template (source of truth)
PRPs/PRP-flow-pack-E1-foundation.md PRP that drove this implementation
.gitignore Added .flow/ to the local session artifacts section

Local install files — intentionally NOT committed

.claude/ is gitignored in this repo (see CLAUDE.md → Learnings), so the following files were written to disk for the current session but are not tracked and do not appear in this PR:

  • .claude/commands/flow/flow-prime.md — runtime install, byte-copy of the tracked template
  • .claude/rules/umbrella-issue.md — local agent contract

Recovery: on a fresh clone, run cp docs/flow-pack/commands/*.md .claude/commands/flow/ to regenerate the local install. Documented in docs/flow-pack-methodology.md § Fresh-clone recovery.

Durable-source split

Layer Location Committed?
Durable contract + command templates docs/flow-pack/** ✅ tracked (this PR)
Local runtime install .claude/commands/flow/*.md ❌ gitignored, regenerable
Local agent rule .claude/rules/umbrella-issue.md ❌ gitignored, regenerable

Validation summary

  • ✅ Level 1 — all 4 files present; both .claude/** files confirmed gitignored; diff -q between tracked template and local install = empty
  • ✅ Level 2 — fresh-clone recovery simulation: rm local install → cp from tracked template → diff empty
  • ✅ Level 3 — provenance headers in all 4 created files; key sections present in methodology doc and rule
  • ✅ Final checklist — E2–E5 absent; uv.lock / docker-compose.lan.yml never staged; no app/backend/frontend runtime code changed

Scope confirmation

  • ❌ No app/ backend code changed
  • ❌ No frontend/ code changed
  • ❌ No Alembic migrations added
  • ❌ No E2–E5 commands created
  • ❌ No GitHub issues created by this PR
  • ✅ Markdown-only change — ruff / mypy / pyright / pytest gates unaffected

Summary by Sourcery

Add the foundational documentation and specification for the new flow: command suite, including the /flow-prime command and durable-source split.

Enhancements:

  • Establish the durable-source split between tracked docs under docs/flow-pack/** and regenerable local .claude/** runtime artifacts.
  • Ignore local .flow/ working-state artifacts via .gitignore to keep the durable source and local state cleanly separated.

Documentation:

  • Document the flow-pack methodology, including the multi-stage pipeline, invariants, umbrella and epic contracts, and portability guidance.
  • Add canonical documentation for the /flow-prime command, defining its objective, delegated responsibilities, workflow, and output format.
  • Introduce a PRP describing the flow-pack E1 foundation scope, success criteria, implementation plan, and validation steps.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jun 1, 2026

Reviewer's Guide

Introduces the foundational documentation and contracts for the new flow: command suite, including a durable flow-pack methodology spec, a canonical /flow-prime command template, the PRP that defines the E1 foundation scope, and an update to .gitignore to ensure local flow state remains untracked.

Sequence diagram for /flow-prime baseline capture process

sequenceDiagram
    actor User
    participant flow_prime as flow-prime
    participant core_piv_loop_prime as core_piv_loop:prime
    participant gh_cli as gh_CLI
    participant FS as Filesystem

    User->>flow_prime: run /flow-prime $ARGUMENTS
    flow_prime->>core_piv_loop_prime: core_piv_loop:prime
    core_piv_loop_prime-->>flow_prime: project overview

    flow_prime->>gh_cli: gh issue list / milestone list / label list / pr list / release list
    gh_cli-->>flow_prime: GitHub state

    flow_prime->>FS: ls .claude/commands/ .claude/rules/ .github/workflows/ .claude/hooks/
    flow_prime->>FS: read .flow/state.md (if exists)
    flow_prime->>FS: write updated .flow/state.md (workflow map + you-are-here)

    flow_prime-->>User: baseline captured status + next command pointer (/flow-brainstorm)
Loading

File-Level Changes

Change Details Files
Add durable flow-pack methodology contract as the source of truth for the flow: command suite
  • Create a methodology document describing the end-to-end flow-pack pipeline with a Mermaid diagram and narrative for each stage
  • Define global invariants for flow commands and agents (approval gating, hierarchy-as-data, research agent count, score bands, umbrella/epic contracts)
  • Specify umbrella and epic issue body contracts, including required sections and labels
  • Document GitHub REST/GraphQL usage for sub-issue hierarchy management
  • Provide a ForecastLabAI-specific mapping from methodology stages to concrete commands/skills and identify how to port the flow to other repos
  • Define the durable-source split between tracked docs and local .claude/** runtime plus a fresh-clone recovery procedure
docs/flow-pack-methodology.md
Define the canonical /flow-prime command template and behavior as tracked documentation
  • Add a markdown command spec for /flow-prime with objective, process, and output format sections
  • Explicitly require delegation to core_piv_loop:prime for codebase priming to avoid reimplementation
  • Specify how to gather GitHub state, inventory local commands/rules/workflows, and synthesize a current-workflow-map and you-are-here snapshot
  • Describe how /flow-prime must read/update .flow/state.md while preserving existing sections
  • Define gate conditions for "baseline captured" and the required next-command pointer format
docs/flow-pack/commands/flow-prime.md
Capture the implementation blueprint and validation criteria for the E1 foundation as a PRP
  • Document the goal and scope of E1, focusing on establishing a tracked durable contract plus a single /flow-prime command and rule
  • List success criteria and explicit non-goals (no E2–E5 commands, no runtime code or GitHub issues created)
  • Provide a task breakdown for creating methodology docs, command templates, local installs, and gitignore updates
  • Describe validation levels for file presence, durable-source split, fresh-clone recovery, and /flow-prime smoke testing
  • Record constraints, known gotchas, and final validation/anti-pattern checklists for reviewers and future epics
PRPs/PRP-flow-pack-E1-foundation.md
Ensure local flow working state is not committed by default
  • Update .gitignore to treat .flow/ as a local session/working-state directory alongside existing .claude/ ignores
  • Aligns ignore rules with the documented durable-source split so that only docs/flow-pack/** are tracked sources of truth
.gitignore

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: 9ea55e7c-7b7b-4730-b64e-b39546f3e3c6

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-e1-foundation

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 found 3 issues, and left some high level feedback:

  • In the /flow-prime spec, consider defining explicit delimiters (e.g., HTML comments or unique markers) around the Current-workflow-map and You-are-here snapshot sections in .flow/state.md so that future implementations can reliably update those sections without relying on brittle ##-header matching.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the `/flow-prime` spec, consider defining explicit delimiters (e.g., HTML comments or unique markers) around the `Current-workflow-map` and `You-are-here snapshot` sections in `.flow/state.md` so that future implementations can reliably update those sections without relying on brittle `##`-header matching.

## Individual Comments

### Comment 1
<location path="docs/flow-pack-methodology.md" line_range="119-122" />
<code_context>
+
+## Invariants
+
+Every flow: command and every agent enforces these; violations must be flagged, not silently
+bypassed:
+
</code_context>
<issue_to_address>
**issue (typo):** Use plural verb form here for correct subject–verb agreement.

Because the subject is plural ("Every flow: command and every agent"), the verb should be plural as well:

> Every flow: command and every agent enforce these; violations must be flagged, not silently bypassed:

```suggestion
## Invariants

Every flow: command and every agent enforce these; violations must be flagged, not silently
bypassed:
```
</issue_to_address>

### Comment 2
<location path="docs/flow-pack-methodology.md" line_range="90" />
<code_context>
+
+1. Creates the umbrella GitHub issue with the **7-field body contract** (see § Umbrella contract).
+2. Attaches labels `umbrella` + `flow` and the project milestone.
+3. Dry-run echos the issue body; waits for approval before writing.
+4. Prints gate + next-command pointer: `→ Next: /flow-epics`.
+
</code_context>
<issue_to_address>
**issue (typo):** Correct the spelling of "echos" to "echoes".

> Dry-run echoes the issue body; waits for approval before writing.

```suggestion
3. Dry-run echoes the issue body; waits for approval before writing.
```
</issue_to_address>

### Comment 3
<location path="PRPs/PRP-flow-pack-E1-foundation.md" line_range="221-224" />
<code_context>
+# In a Claude Code session, run the command and confirm it produces the two artifacts:
+#   - a current-workflow-map (existing commands/skills/rules/workflows)
+#   - a you-are-here snapshot (branch, version, open issues, gap)
+# and writes/append .flow/state.md. Confirm it ends by printing the next-command pointer.
+# (No automated assertion — this is an interactive command; verify the output sections exist.)
+```
</code_context>
<issue_to_address>
**suggestion (typo):** Clarify "writes/append" phrasing for grammatical correctness.

The phrase "writes/append .flow/state.md" is ungrammatical. Please rephrase, e.g.:

> and writes or appends to `.flow/state.md`.

This keeps the intent while reading more naturally.

```suggestion
#   - a current-workflow-map (existing commands/skills/rules/workflows)
#   - a you-are-here snapshot (branch, version, open issues, gap)
# and writes or appends to `.flow/state.md`. Confirm it ends by printing the next-command pointer.
# (No automated assertion — this is an interactive command; verify the output sections exist.)
```
</issue_to_address>

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.

Comment on lines +119 to +122
## Invariants

Every flow: command and every agent enforces these; violations must be flagged, not silently
bypassed:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

issue (typo): Use plural verb form here for correct subject–verb agreement.

Because the subject is plural ("Every flow: command and every agent"), the verb should be plural as well:

Every flow: command and every agent enforce these; violations must be flagged, not silently bypassed:

Suggested change
## Invariants
Every flow: command and every agent enforces these; violations must be flagged, not silently
bypassed:
## Invariants
Every flow: command and every agent enforce these; violations must be flagged, not silently
bypassed:

Comment thread docs/flow-pack-methodology.md Outdated
Comment thread PRPs/PRP-flow-pack-E1-foundation.md
@w7-mgfcode w7-mgfcode merged commit a921ecb into dev Jun 1, 2026
8 checks passed
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