Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 44 additions & 4 deletions .github/workflows/feature-ideation.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ─────────────────────────────────────────────────────────────────────────────
# SOURCE OF TRUTH: petry-projects/.github/standards/workflows/feature-ideation.yml
# Standard: petry-projects/.github/standards/ci-standards.md#9-feature-ideation-feature-ideationyml--bmad-method-repos
# Standard: petry-projects/.github/standards/ci-standards.md#8-feature-ideation-feature-ideationyml--bmad-method-repos
# Reusable: petry-projects/.github/.github/workflows/feature-ideation-reusable.yml
#
# AGENTS — READ BEFORE EDITING:
Expand All @@ -15,6 +15,30 @@
# • If you need different behaviour, open a PR against the reusable in
# the central repo. The change will propagate everywhere on next run.
# ─────────────────────────────────────────────────────────────────────────────
#
# Feature Ideation workflow stub — for BMAD Method-enabled repos.
#
# This is a thin caller for the org-wide reusable workflow at
# petry-projects/.github/.github/workflows/feature-ideation-reusable.yml
# All ideation logic, the multi-skill pipeline, the Opus 4.6 model
# selection, and the github_token override live in the reusable workflow.
#
# To adopt:
# 1. Copy this file to .github/workflows/feature-ideation.yml in your repo.
# 2. Replace the `project_context` value with a 3-5 sentence description
# of your project, its target users, and the competitive landscape Mary
# should research. This is the only required customisation.
# 3. (Optional) Copy standards/feature-ideation-sources.md from
# petry-projects/.github to .github/feature-ideation-sources.md in your
# repo and trim/extend it for your project. Mary uses YOUR copy — not the
# central template — so each repo controls its own source list.
# Pass `sources_file: path/to/your-list.md` to the reusable workflow if
# you prefer a different location.
# 4. (Optional) Adjust the schedule cron if Friday morning UTC doesn't suit.
# 5. Ensure GitHub Discussions is enabled with an "Ideas" category.
# 6. Confirm the org-level secret CLAUDE_CODE_OAUTH_TOKEN is accessible.
#
# Standard: https://github.com/petry-projects/.github/blob/main/standards/ci-standards.md#8-feature-ideation-feature-ideationyml--bmad-method-repos
name: Feature Research & Ideation (BMAD Analyst)

on:
Expand All @@ -23,7 +47,7 @@ on:
workflow_dispatch:
inputs:
focus_area:
description: 'Optional focus area (e.g., "agent cost routing", "CI security")'
description: 'Optional focus area (e.g., "accessibility", "performance")'
required: false
type: string
research_depth:
Expand All @@ -36,10 +60,14 @@ on:
- standard
- deep
dry_run:
description: 'Skip Discussion mutations and log them to a JSONL artifact instead. Use this to smoke-test before going live.'
description: 'Skip Discussion mutations and log them to a JSONL artifact instead. Use this on a fork to smoke-test before going live.'
required: false
default: false
type: boolean
# Auto-enhance a freshly-created idea: when a new Discussion is opened in the
# Ideas category, the analyst researches and refines it in single-idea mode.
discussion:
types: [created]

permissions: {}

Expand All @@ -49,6 +77,14 @@ concurrency:

jobs:
ideate:
# On the `discussion` trigger, only run for new ideas in the Ideas category
# and skip the bot's own creations (avoids re-enhancing scheduled output;
# enhancement posts a comment, which does not re-fire `discussion: created`).
# Schedule/dispatch runs are unaffected by this guard.
if: >-
github.event_name != 'discussion' ||
(github.event.discussion.category.slug == 'ideas' &&
github.event.discussion.user.type != 'Bot')
# Permissions cascade from the calling job to the reusable workflow.
# The reusable workflow's two jobs (gather-signals + analyze) need:
# - contents: read (checkout, file reads)
Expand All @@ -64,8 +100,12 @@ jobs:
discussions: write
id-token: write
actions: read
uses: petry-projects/.github/.github/workflows/feature-ideation-reusable.yml@376a4fcb1117444595e3e702fa450873d0e54310 # v2
uses: petry-projects/.github/.github/workflows/feature-ideation-reusable.yml@897e4dede3518cdd7273b9dc63e607d0d05cbdda # v1
with:
# On the `discussion: created` trigger this carries the new Discussion's
# number → the reusable runs single-idea enhancement mode. Empty on
# schedule/dispatch → normal scan. Do not edit this line.
target_discussion: ${{ github.event.discussion.number }}
# === CUSTOMISE THIS PER REPO — the only required edit ===
project_context: |
petry-projects/.github-private is the org-level private automation
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
tests/test_idea_enhancer.bats \
tests/test_oversized_pr.bats \
tests/test_dependabot.bats \
tests/test_feature_ideation.bats \
tests/test_apply_repo_settings.bats \
tests/test_sweep_stuck_reviews.bats \
tests/test_validate_cases.bats \
Expand Down
42 changes: 42 additions & 0 deletions tests/test_feature_ideation.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bats
# Regression tests for .github/workflows/feature-ideation.yml compliance.
#
# Guards the invariants checked by the weekly org compliance audit
# (check: non-stub-feature-ideation.yml) to prevent re-filing of the
# "reusable not pinned to @v1" finding (#629).
#
# Run with: bats tests/test_feature_ideation.bats

FEATURE_IDEATION_YML=".github/workflows/feature-ideation.yml"

# Canonical reusable + v1 pin from
# petry-projects/.github/standards/workflows/feature-ideation.yml
REUSABLE="petry-projects/.github/.github/workflows/feature-ideation-reusable.yml"
V1_SHA="897e4dede3518cdd7273b9dc63e607d0d05cbdda"
# The superseded pin the audit flagged (#629).
V2_SHA="376a4fcb1117444595e3e702fa450873d0e54310"

setup() {
# Run tests from repo root so relative paths resolve correctly.
cd "$(dirname "$BATS_TEST_FILENAME")/.."
}

@test "feature-ideation.yml exists" {
[ -f "$FEATURE_IDEATION_YML" ]
}

@test "feature-ideation.yml calls the org reusable workflow" {
grep -qF "uses: ${REUSABLE}@" "$FEATURE_IDEATION_YML"
}

@test "feature-ideation.yml pins the reusable to the v1 SHA (compliance-audit check)" {
grep -qF "uses: ${REUSABLE}@${V1_SHA}" "$FEATURE_IDEATION_YML"
}

@test "feature-ideation.yml uses: line is annotated # v1" {
grep -qE "uses: ${REUSABLE}@${V1_SHA}[[:space:]]+# v1" "$FEATURE_IDEATION_YML"
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

@test "feature-ideation.yml is not pinned to the superseded v2 SHA" {
[ -f "$FEATURE_IDEATION_YML" ] && ! grep -qF "$V2_SHA" "$FEATURE_IDEATION_YML"
}
Comment thread
don-petry marked this conversation as resolved.
Loading