Skip to content

feat(propose): add /gh-issue-driven:propose command — phase-0 issue capture (#17)#54

Merged
JFK merged 6 commits intomainfrom
17-feat/new-command-gh-issue-driven-propose-phas
Apr 12, 2026
Merged

feat(propose): add /gh-issue-driven:propose command — phase-0 issue capture (#17)#54
JFK merged 6 commits intomainfrom
17-feat/new-command-gh-issue-driven-propose-phas

Conversation

@JFK
Copy link
Copy Markdown
Owner

@JFK JFK commented Apr 12, 2026

Closes #17

Summary

  • Add new /gh-issue-driven:propose command (phase 0) — a 14-step pipeline for drafting and filing GitHub issues from session context
  • Pipeline: context collection → mandatory dedup check → quality review via /claude-c-suite:ask → PM enrichment via /claude-c-suite:pm → secret detection → HITL confirmation with re-roll → gh issue create
  • State files in ~/.claude/cache/gh-issue-driven/proposals/, GC on success, retain on failure
  • Extends commands/config.md with propose.* config block and commands/status.md with proposals mode

Implementation notes

  • commands/propose.md follows the same structural patterns as start.md (frontmatter, Output language, Trust boundary, Steps, Failure modes)
  • Reuses canonical sanitizer from start.md step 8a by reference (not duplicated)
  • Reuses verdict parser contract from start.md step 11 with same green|yellow|red tokens
  • Steps 7 (review) and 8 (enrichment) are independent and can be invoked in parallel
  • context.source discriminator included for future --from-session/--from-failure extensibility
  • Secret detection (step 6a) scans for AWS keys, GitHub tokens, API keys, private key blocks, bearer tokens, connection strings — warns but does not auto-abort (HITL gate is the decision point)
  • Proposal state schema (v1) is separate from branch state schema (v2) — different lifecycle

Pre-PR review summary

  • gate2 mode: advisor-only (no binary gate configured)
  • audit: skipped
  • binary_gate: (none)
  • cso: green
  • qa-lead: green
  • cto: green
  • gate1: green via /ask
  • review provider: copilot

Full reviews are saved in the plugin cache:

  • ~/.claude/cache/gh-issue-driven/17-feat-new-command-gh-issue-driven-propose-phas.gate1.md
  • ~/.claude/cache/gh-issue-driven/17-feat-new-command-gh-issue-driven-propose-phas.gate2.md

🤖 Generated via /gh-issue-driven:ship

…apture (#17)

New command: /gh-issue-driven:propose drafts and files GitHub issues from
session context. 14-step pipeline: context collection, mandatory dedup check
via gh issue list, quality review via /claude-c-suite:ask (green/yellow/red),
PM enrichment via /claude-c-suite:pm for labels/milestone/priority, secret
detection scan, HITL confirmation with re-roll capability, then gh issue create.

- commands/propose.md: new command (560 lines)
- commands/config.md: add propose.* config block
- commands/status.md: add 'proposals' mode for /status
- README.md, README.ja.md: add /propose to commands table

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 12, 2026 08:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new phase-0 workflow (/gh-issue-driven:propose) to draft + optionally create GitHub issues from operator-provided context, and extends docs/config/status to support proposal state.

Changes:

  • Introduces commands/propose.md implementing a propose pipeline (dedup → review via /ask → PM enrichment → HITL → gh issue create).
  • Extends /gh-issue-driven:status with a proposals mode to list retained proposal state files.
  • Updates README (EN/JA) command list and adds propose.* configuration defaults.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
README.md Documents new /propose command and extends /status usage to include proposals.
README.ja.md Japanese doc parity for /propose and /status … proposals.
commands/status.md Adds $ARGUMENTS == "proposals" mode to list cached proposal JSON files.
commands/propose.md New command spec for capturing/deduping/reviewing/enriching/creating issues + proposal state schema.
commands/config.md Adds propose config block defaults.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +126 to +132
gh issue list \
--repo "$REPO_FULL_NAME" \
--search "$KEYWORDS" \
--state open \
--limit "$DEDUP_MAX" \
--json number,title,url
```
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

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

The dedup check searches only --state open, but this PR claims to close #17 whose proposed dedup step was --state all. Searching only open issues can miss previously closed duplicates and weakens the “mandatory dedup” goal; consider using --state all or documenting why closed issues are intentionally excluded.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

══════════════════════════════════════════
```

If `REVIEW_OUTPUT` is non-empty, write it verbatim to `REVIEW_MD`. Skip the write if `DRY_RUN` or if `REVIEW_OUTPUT` is empty (reviewer was skipped).
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

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

Step 9 skips writing REVIEW_MD when REVIEW_OUTPUT is empty (e.g. reviewer disabled / skill missing), but the state schema later always includes review.summary_path as a concrete path. That can leave state pointing to a non-existent file; consider writing an empty placeholder file, or set summary_path to null/omit it when no review output was persisted.

Suggested change
If `REVIEW_OUTPUT` is non-empty, write it verbatim to `REVIEW_MD`. Skip the write if `DRY_RUN` or if `REVIEW_OUTPUT` is empty (reviewer was skipped).
If `DRY_RUN` is false, always write `REVIEW_MD`. When `REVIEW_OUTPUT` is non-empty, write it verbatim. When `REVIEW_OUTPUT` is empty (for example, the reviewer was skipped or unavailable), write an empty placeholder file so any later `review.summary_path` still points to an existing file.

Copilot uses AI. Check for mistakes.
Comment on lines +371 to +374
- **green** → continue to step 11.
- **yellow** AND `YELLOW_CONFIRM` is true (default) → continue to step 11 (the HITL gate handles confirmation; the review concerns are visible from step 9's output).
- **yellow** AND `YELLOW_CONFIRM` is false → log a one-line note and continue.
- **red** AND `FORCE` is true → log a loud warning `review returned red — proceeding because 'force' flag is set` and continue to step 11.
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

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

YELLOW_CONFIRM doesn’t currently change control flow: both branches continue to step 11, and step 11 always requires explicit user confirmation to create the issue anyway. Either remove this config knob for propose, or make it meaningfully affect behavior (e.g., require an extra confirmation step only when enabled).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

Comment on lines +423 to +440
```bash
set -euo pipefail
TMPBODY=$(mktemp)
printf '%s' "$DRAFT_BODY" > "$TMPBODY"

GH_ARGS=(--repo "$REPO_FULL_NAME" --title "$DRAFT_TITLE" --body-file "$TMPBODY")

for label in "${ENRICHMENT_LABELS[@]}"; do
GH_ARGS+=(--label "$label")
done

if [ -n "${ENRICHMENT_MILESTONE:-}" ]; then
GH_ARGS+=(--milestone "$ENRICHMENT_MILESTONE")
fi

ISSUE_URL=$(gh issue create "${GH_ARGS[@]}")
rm -f "$TMPBODY"
ISSUE_NUMBER=$(echo "$ISSUE_URL" | grep -oE '[0-9]+$')
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

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

The temp-file cleanup is not guaranteed if gh issue create fails: with set -euo pipefail, the script will exit before rm -f "$TMPBODY", leaving the draft body on disk. Add a cleanup trap (or otherwise ensure deletion on all exit paths) since the draft may include sensitive data and this command explicitly does secret detection.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
JFK and others added 4 commits April 12, 2026 17:29
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot finished work on behalf of JFK April 12, 2026 08:30
@JFK JFK merged commit a69b941 into main Apr 12, 2026
@JFK JFK deleted the 17-feat/new-command-gh-issue-driven-propose-phas branch April 12, 2026 09:55
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.

new command: /gh-issue-driven:propose — phase-0 issue capture from session context

3 participants