Skip to content

feat(workflows): experimental GSD workflow suite (gsd-*) — port from open-gsd/gsd-core#1986

Open
uinstinct wants to merge 3 commits into
coleam00:devfrom
uinstinct:feat/gsd-experimental-workflows
Open

feat(workflows): experimental GSD workflow suite (gsd-*) — port from open-gsd/gsd-core#1986
uinstinct wants to merge 3 commits into
coleam00:devfrom
uinstinct:feat/gsd-experimental-workflows

Conversation

@uinstinct

@uinstinct uinstinct commented Jun 12, 2026

Copy link
Copy Markdown

Summary

  • Problem: Users who want GSD-style structured development (discuss→plan→execute→verify→ship) on Archon had to use the GSD CLI. This ports the core GSD loop to Archon workflows so it runs natively.
  • Why it matters: Brings the GSD methodology to Archon's workflow engine with human-in-the-loop gates, .planning/ state tracking, and per-task atomic commits.
  • What changed: 11 experimental workflow YAMLs (.archon/workflows/experimental/gsd-*.yaml) plus 10 shared role command files (.archon/commands/gsd/gsd-*.md) and a .planning/.gitignore.
  • What did not change: Existing workflows, bundled defaults, engine code, discovery depth. These are opt-in experimental workflows — promotion to bundled defaults is gated on real-world full cycles (Port GSD framework to Archon workflows (experimental/gsd/) #1696).

UX Journey

Before

User                      GSD CLI
────                      ───────
/gsd:new-project ───────▶ runs gsd-tools, spawns agents
/gsd:discuss-phase 1 ───▶ runs gsd-tools, spawns agents
...                        (separate tool, separate UX)

After

User                      Archon
────                      ──────
archon workflow run ─────▶ workflow engine resolves DAG
  gsd-new-project          bash guard → loop (interactive) → prompt (agents) → loop → prompt → approval → bash
                           .planning/ state accumulates on live checkout
archon workflow run ─────▶ discovers prior phase state, continues
  gsd-execute-phase 1      fresh_context loop picks plans, executes, verifies
                           all commits atomic per task, GSD-style messages

Architecture Diagram

Before

(Nothing — GSD workflows didn't exist in Archon)

After

.archon/workflows/experimental/gsd-*.yaml  ──▶ workflow engine (loader + DAG executor)
  [+ gsd-map-codebase]                           │
  [+ gsd-new-project]                            │ bash nodes: mkdir, git add/commit
  [+ gsd-discuss-phase]                          │ loop nodes: interactive questioning, fresh_context execution
  [+ gsd-plan-phase]                             │ prompt nodes: inline agents (codebase-mapper, planner, etc.)
  [+ gsd-execute-phase]                          │ approval nodes: capture_response + on_reject
  [+ gsd-verify-work]                            ▼
  [+ gsd-ship]                             .planning/  (in-repo state, committed to git)
  [+ gsd-complete-milestone]               .planning/.gitignore (scratch exclusions)
  [+ gsd-new-milestone]
  [+ gsd-quick]                     .archon/commands/gsd/gsd-*.md  ──▶ read by agents
  [+ gsd-debug]                       [+ gsd-codebase-mapper]          (role prompts, no frontmatter)
                                      [+ gsd-project-researcher]
                                      [+ gsd-research-synthesizer]
                                      [+ gsd-roadmapper]
                                      [+ gsd-phase-researcher]
                                      [+ gsd-planner]
                                      [+ gsd-plan-checker]
                                      [+ gsd-executor]
                                      [+ gsd-verifier]
                                      [+ gsd-debugger]

Connection inventory:

From To Status Notes
gsd-map-codebase workflow gsd-codebase-mapper role new inline agent reads role file
gsd-new-project workflow gsd-project-researcher, gsd-research-synthesizer, gsd-roadmapper roles new inline agents read role files
gsd-execute-phase loop gsd-executor, gsd-verifier roles new model instructed to read role files (no agents: on loops)
all gsd-* workflows .planning/ state new bash nodes write, prompt/loop nodes read

Label Snapshot

  • Risk: risk: low
  • Size: size: L
  • Scope: workflows
  • Module: workflows:experimental

Change Metadata

  • Change type: feature
  • Primary scope: workflows

Linked Issue

Validation Evidence

# All 11 gsd-* workflows validate with zero errors, zero warnings:
bun run cli validate workflows
# Results: 54 valid, 1 with errors (pre-existing archon-smart-pr-review), 16 with warnings (all pre-existing)

# All 11 discovered and listed:
bun run cli workflow list
# Shows all 11 gsd-* workflows

# Format check passes:
bun run format:check
# All matched files use Prettier code style!

# Type-check: only pre-existing errors in copilot/provider.ts, zero from our changes
bun run type-check

# Bundled checks pass (experimental files don't affect bundling):
bun run check:bundled && bun run check:bundled-skill && bun run check:bundled-schema
  • Evidence provided: CLI validate output above shows all 11 gsd-* as ok with zero issues.
  • Intentionally skipped: full bun run validate (pre-existing pi-vendor-map staleness halts pipeline); bun run lint (pre-existing OOM); bun run test (no TypeScript changes, YAML/MD only).

Security Impact

  • New permissions/capabilities? No
  • New external network calls? No
  • Secrets/tokens handling changed? No
  • File system access scope changed? No (workflows operate within the target repo's .planning/ and staging area, same as existing workflows)

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Database migration needed? No

Human Verification

  • Verified scenarios:
    • All 11 workflows pass cli validate workflows with zero errors and zero warnings
    • All 11 workflows are discovered by cli workflow list
    • YAML schema compliance: bash nodes, prompt nodes with inline agents, loop nodes (interactive + fresh_context), approval nodes with capture_response and on_reject — all validate
    • .planning/.gitignore created with correct exclusion patterns
  • Edge cases checked:
    • Loop nodes correctly omit agents: field (not supported) — models are instructed to read role files instead
    • Approval nodes use correct approval: schema with capture_response and on_reject
    • worktree: { enabled: false } on all 11 workflows
    • requires: [github] only on gsd-ship
    • interactive: true correctly set on 7 workflows, omitted on 4
  • What was not verified:
    • Full end-to-end execution cycle requiring AI agent availability (would need Claude/Codex SDK running)
    • gsd-ship PR creation (requires GitHub remote + authentication)
    • Cross-runtime PI provider swap (YAML header documents it, not tested)

Side Effects / Blast Radius

  • Affected subsystems/workflows: None. These are new, opt-in experimental files. No existing code modified.
  • Potential unintended effects: None. The files are only loaded when explicitly invoked by name (gsd-*). They don't affect bundled defaults or existing workflows.
  • Guardrails/monitoring for early detection: cli validate workflows catches schema issues at load time. Workflow discovery errors are surfaced in cli workflow list.

Rollback Plan

  • Fast rollback command/path: git revert <commit> — single commit, no schema migrations, no code changes.
  • Feature flags or config toggles: None needed. Users opt in by copying the files to their repo.
  • Observable failure symptoms: Workflow not found (Unknown workflow: gsd-*) if files are missing. YAML validation errors if schema violations.

Risks and Mitigations

  • Risk: Users expect GSD CLI feature parity (--auto, --batch, TDD mode, etc.)
    • Mitigation: Every YAML header documents exactly what GSD flags/modes were dropped. The workflows cover the default interactive path only.
  • Risk: .planning/ state conflicts between concurrent runs
    • Mitigation: Workflows run with worktree.enabled: false and mutates_checkout defaults to true (serialized). Users are expected to branch before execute, as in GSD's own model.
  • Risk: Role command files reference tools/patterns not available in Archon's provider environment
    • Mitigation: All gsd-tools calls replaced with direct instructions (read/edit files, git add/commit). Role files are plain markdown consumed via read-instruction — no runtime dependency.

Deviations from Issue #1696

  1. Flat placement: .archon/workflows/experimental/gsd-*.yaml instead of experimental/gsd/*.yaml. Reason: workflow discovery deliberately caps at depth 1 (workflow-discovery.ts:89). A subdirectory would be silently skipped. The depth cap is intentional and documented — not a bug to fix in this PR.

  2. No isolation worktrees: All 11 workflows run with worktree.enabled: false. The issue's user-flow sketch mentioned verify-work running "in an isolation worktree," but .planning/ state and unpushed execute commits would not be present in a fresh worktree. GSD's own model has users branch manually before execute — ship pushes that branch. Same model here.

  3. gsd-quick + gsd-debug: Two additional workflows beyond the issue's 9 core commands (per user request in the issue thread).

  4. Promotion criteria: These are experimental — not bundled defaults. Promotion to .archon/workflows/defaults/ is gated on N real-world full cycles, tracked in Port GSD framework to Archon workflows (experimental/gsd/) #1696.

Summary by CodeRabbit

  • Documentation

    • Added an experimental GSD workflow suite and comprehensive command specs for project init, research & synthesis, planning, execution, verification, debugging, codebase mapping, roadmapping, milestone management, quick/ship flows, and supporting agents.
  • Chores

    • Added ignore rules for workflow scratch files.
    • Updated changelog documenting the new experimental GSD workflows.

…open-gsd/gsd-core

Closes coleam00#1696

11 workflows porting the GSD core loop: map-codebase, new-project, discuss/plan/execute/verify phases, ship, complete-milestone, new-milestone, plus quick and debug.
10 shared role prompts in .archon/commands/gsd/ for agent context.

Placed flat as .archon/workflows/experimental/gsd-*.yaml (not in a subdirectory) because workflow discovery deliberately caps at depth 1 (workflow-discovery.ts:89).
All workflows run with worktree.enabled: false — .planning/ state + built code must persist across the execute→verify→ship runs.
.planning/.gitignore excludes GSD scratch files.
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 457c60a3-9f7b-471b-ac4d-b5b7929ce7de

📥 Commits

Reviewing files that changed from the base of the PR and between 2286f05 and 0c25763.

📒 Files selected for processing (12)
  • .archon/workflows/experimental/gsd-complete-milestone.yaml
  • .archon/workflows/experimental/gsd-debug.yaml
  • .archon/workflows/experimental/gsd-discuss-phase.yaml
  • .archon/workflows/experimental/gsd-execute-phase.yaml
  • .archon/workflows/experimental/gsd-map-codebase.yaml
  • .archon/workflows/experimental/gsd-new-milestone.yaml
  • .archon/workflows/experimental/gsd-new-project.yaml
  • .archon/workflows/experimental/gsd-plan-phase.yaml
  • .archon/workflows/experimental/gsd-quick.yaml
  • .archon/workflows/experimental/gsd-ship.yaml
  • .archon/workflows/experimental/gsd-verify-work.yaml
  • CHANGELOG.md
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • .archon/workflows/experimental/gsd-debug.yaml
  • .archon/workflows/experimental/gsd-ship.yaml
  • .archon/workflows/experimental/gsd-quick.yaml
  • .archon/workflows/experimental/gsd-complete-milestone.yaml

📝 Walkthrough

Walkthrough

Ports the GSD methodology into Archon: adds role command specs, interactive workflows for map→discuss→plan→execute→verify→ship, supporting utilities (debug/quick/milestone), and .planning state artifacts with approval gates and commit protocols.

Changes

Experimental GSD Workflow Suite

Layer / File(s) Summary
Role specifications and contracts
.archon/commands/gsd/gsd-codebase-mapper.md, gsd-debugger.md, gsd-executor.md, gsd-phase-researcher.md, gsd-plan-checker.md, gsd-planner.md, gsd-project-researcher.md, gsd-research-synthesizer.md, gsd-roadmapper.md, gsd-verifier.md
Markdown command specs define GSD roles, templates, input/output contracts, verification rules, and hard behavioral constraints.
Project initialization & mapping
.archon/workflows/experimental/gsd-map-codebase.yaml, gsd-new-project.yaml, .planning/.gitignore
gsd-map-codebase runs focused mappers to create .planning/codebase/* docs with post-checks; gsd-new-project handles interactive project discovery, research, requirements scoping, and ROADMAP/STATE generation; .planning/.gitignore adds scratch exclusions.
Core GSD phase lifecycle
.archon/workflows/experimental/gsd-discuss-phase.yaml, gsd-plan-phase.yaml, gsd-execute-phase.yaml, gsd-verify-work.yaml, gsd-ship.yaml
Workflows implement phase lifecycle: capture context (*-CONTEXT.md), produce adversarial plans (*-PLAN.md), execute tasks one-unit-per-iteration with per-task commits (*-SUMMARY.md), run UAT and gap plans (*-UAT.md), and assemble PRs and update .planning/STATE.md.
Supporting workflows and milestones
.archon/workflows/experimental/gsd-quick.yaml, gsd-debug.yaml, gsd-new-milestone.yaml, gsd-complete-milestone.yaml, CHANGELOG.md
Quick-mode plan→execute→ship flow, scientific-method debugger with persistent .planning/debug/{slug}.md sessions, milestone creation/archiving workflows, and changelog entry documenting the suite.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • coleam00/Archon#1310: Workflow worktree handling and isolation changes referenced by new experimental workflows.

Poem

🐰 I hopped through specs and YAML trees,
Phases stitched like puzzle keys,
Map, discuss, plan, execute, verify, ship—
A pitter-patter development trip,
Archon now holds the GSD breeze.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

@uinstinct

Copy link
Copy Markdown
Author

@Wirasm If we can merge this it will be awesome. GSD is a core workflow to many projects

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.archon/workflows/experimental/gsd-execute-phase.yaml (1)

261-341: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Subshell variable assignment won't persist — PHASE_DIR will always be empty.

Lines 271-273 attempt to set PHASE_DIR inside a while loop in a pipeline:

PHASE_DIR=$(ls -d .planning/phases/*/ 2>/dev/null | sort -V | while read d; do
  if [ -f "${d}VERIFICATION.md" ]; then PHASE_DIR="$d"; fi
done)

The while loop runs in a subshell (due to the pipe), so the PHASE_DIR="$d" assignment doesn't persist. Additionally, the command substitution captures stdout, but nothing is printed — the assignment is silent. Result: PHASE_DIR is always empty.

Suggested fix
       if [ -z "$PHASE_NUM" ]; then
         # Best-effort: find the highest-numbered phase dir with a VERIFICATION.md
-        PHASE_DIR=$(ls -d .planning/phases/*/ 2>/dev/null | sort -V | while read d; do
-          if [ -f "${d}VERIFICATION.md" ]; then PHASE_DIR="$d"; fi
-        done)
-        if [ -n "$PHASE_DIR" ]; then
+        PHASE_DIR=""
+        for d in $(ls -d .planning/phases/*/ 2>/dev/null | sort -V); do
+          if [ -f "${d}VERIFICATION.md" ]; then
+            PHASE_DIR="$d"
+          fi
+        done
+        if [ -n "$PHASE_DIR" ]; then
           PHASE_NUM=$(basename "$PHASE_DIR" | grep -oE '^[0-9]+')
         fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.archon/workflows/experimental/gsd-execute-phase.yaml around lines 261 -
341, The PHASE_DIR assignment inside the pipeline/subshell (the "ls -d ... |
sort -V | while read d; do ... PHASE_DIR=\"$d\"; done") won't persist because
the while runs in a subshell and nothing is printed for command substitution;
replace that pipeline with a non-subshell iteration (e.g., a for loop or while
reading via process substitution) that directly assigns PHASE_DIR in the current
shell, or write the matched directory to stdout for capture, so the block that
sets PHASE_DIR when ARGUMENTS/PHASE_NUM is empty correctly produces a value.
.archon/workflows/experimental/gsd-verify-work.yaml (1)

286-315: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Bash node cannot access previous node outputs via dot notation.

Lines 289-293 attempt to reference guard node outputs in a bash script:

DIR=$guard.output.PHASE_DIR
PHASE_BASE=$guard.output.PHASE_BASE
...
UAT_FILE=$guard.output.UAT_FILE

In bash, $guard is an undefined variable (empty), so these lines evaluate to:

  • DIR=.output.PHASE_DIR (literal string)
  • PHASE_BASE=.output.PHASE_BASE
  • etc.

The route node needs to re-derive these values from the filesystem or receive them through a different mechanism (e.g., environment variables set by the workflow engine).

Suggested fix
   - id: route
     depends_on: [uat]
     bash: |
-      DIR=$guard.output.PHASE_DIR
-      PHASE_BASE=$guard.output.PHASE_BASE
-
-      # Count failures from UAT summary
-      UAT_FILE=$guard.output.UAT_FILE
+      # Re-derive phase directory (same logic as guard node)
+      if [ -n "$ARGUMENTS" ]; then
+        PHASE_NUM="$ARGUMENTS"
+        case ${`#PHASE_NUM`} in
+          1) PAD="0${PHASE_NUM}" ;;
+          *) PAD="${PHASE_NUM}" ;;
+        esac
+        DIR=$(ls -d .planning/phases/${PAD}-* 2>/dev/null | head -1)
+        [ -z "$DIR" ] && DIR=$(ls -d .planning/phases/${PHASE_NUM}-* 2>/dev/null | head -1)
+      else
+        DIR=$(find .planning/phases/ -maxdepth 2 -name "*-SUMMARY.md" 2>/dev/null | sort -t/ -k3,3 | tail -1 | xargs dirname)
+      fi
+
+      PHASE_BASE=$(basename "$DIR")
+      UAT_FILE="$DIR/${PHASE_BASE}-UAT.md"
+
+      # Count failures from UAT summary
       FAILED=$(grep -c '| FAIL ' "$UAT_FILE" 2>/dev/null || echo 0)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.archon/workflows/experimental/gsd-verify-work.yaml around lines 286 - 315,
The bash step in the route node is incorrectly trying to read previous node
outputs via "$guard.output.PHASE_DIR", "$guard.output.PHASE_BASE" and
"$guard.output.UAT_FILE" (these are not valid shell variables); update the route
node to obtain those values correctly by either reading the produced files from
the PHASE_DIR on disk or accepting them via environment variables passed into
the bash step by the workflow engine — replace uses of DIR, PHASE_BASE and
UAT_FILE to derive values from the filesystem (e.g., find or fixed paths under
the workspace/PHASE_DIR) or from explicitly exported env vars (e.g., PHASE_DIR,
PHASE_BASE, UAT_FILE) so the script references real shell variables like
$PHASE_DIR, $PHASE_BASE and $UAT_FILE instead of $guard.output.*.
🧹 Nitpick comments (2)
.archon/commands/gsd/gsd-verifier.md (1)

93-99: 💤 Low value

Bash basename syntax issue in documentation example.

The basename command only accepts a single suffix argument. The pattern $(basename "$artifact" .tsx? .ts) won't work as intended — basename will treat .tsx? as the suffix and ignore .ts.

Since this is specification documentation showing conceptual verification commands, consider clarifying the intent or fixing the example:

Suggested clarification
 **Level 3 — Wiring:**
 ```bash
 # Imported?
-grep -r "import.*$(basename "$artifact" .tsx? .ts)" src/ --include="*.ts" --include="*.tsx" 2>/dev/null
+# Strip extension to get component name (handle .ts, .tsx, .js, .jsx)
+COMPONENT=$(basename "$artifact" | sed 's/\.\(tsx\?\|jsx\?\|ts\|js\)$//')
+grep -r "import.*$COMPONENT" src/ --include="*.ts" --include="*.tsx" 2>/dev/null
 # Used beyond imports?
-grep -r "$(basename "$artifact" .tsx? .ts)" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | grep -v "import"
+grep -r "$COMPONENT" src/ --include="*.ts" --include="*.tsx" 2>/dev/null | grep -v "import"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.archon/commands/gsd/gsd-verifier.md around lines 93 - 99, The example uses
incorrect basename usage: replace the single-call basename pattern `$(basename
"$artifact" .tsx? .ts)` with a small shell step that strips extensions into a
variable (e.g., compute COMPONENT from basename and remove .ts/.tsx/.js/.jsx via
a sed or parameter expansion), then reuse that COMPONENT in the two grep
commands; specifically, create COMPONENT from basename("$artifact") with
extension removal (or use `${artifact%.*}`/sed), then use grep -r
"import.*$COMPONENT" ... and grep -r "$COMPONENT" ... | grep -v "import" so both
the import check and usage check reference the same cleaned component name
instead of the invalid basename call.
.archon/commands/gsd/gsd-roadmapper.md (1)

51-55: 💤 Low value

Consider adding language identifiers to fenced code blocks.

The code blocks at lines 51-55 and 105-111 are missing language identifiers. While these are conceptual examples rather than executable code, adding a language identifier (e.g., text or markdown) improves consistency and helps syntax highlighters.

Suggested fix
-```
+```text
 Phase 1: All database models ← Too coupled
-```
+```text
 AUTH-01 → Phase 2

Also applies to: 105-111

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.archon/commands/gsd/gsd-roadmapper.md around lines 51 - 55, Add language
identifiers to the fenced code blocks that currently show conceptual lines like
"Phase 1: All database models ← Too coupled" and "AUTH-01 → Phase 2" by
replacing the plain backtick fences with fences that include a language (e.g.,
use ```text or ```markdown) so syntax highlighters render them consistently;
update both occurrences (the block containing the "Phase 1..." text and the
block containing "AUTH-01 → Phase 2") to include the chosen language identifier.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.archon/workflows/experimental/gsd-complete-milestone.yaml:
- Around line 346-375: The workflow currently instructs creation at
`.planning/MILESTONES.md` but stages `MILESTONES.md` at repo root, causing an
uncommitted file; pick one canonical path (prefer the repo-root `MILESTONES.md`
to match staging behavior), update the "Step 7: Update MILESTONES.md"
instructions and any template/header text to reference `MILESTONES.md` (not
`.planning/MILESTONES.md`), and ensure subsequent staging/commit steps and any
other occurrences (the later block around the staging list currently adding
`MILESTONES.md`) consistently use that same `MILESTONES.md` path.

In @.archon/workflows/experimental/gsd-debug.yaml:
- Around line 73-79: The slug derivation (SLUG) can collide or become empty due
to truncation and non-alphanumeric collapse; change the generation to append a
stable short fingerprint so filenames are unique and still human-readable: keep
the sanitized base (from ARGUMENTS) but if it is empty use a safe fallback
token, then append a short hash or short timestamp+random suffix (e.g., first 8
chars of sha256(ARGUMENTS) or epoch+rand) to form the final SLUG, and update
references to .planning/debug/$SLUG.md; ensure the sanitization step still
collapses non-alnum to hyphens and the final result is truncated only after the
hash is appended so collisions are avoided.

In @.archon/workflows/experimental/gsd-execute-phase.yaml:
- Around line 79-91: The shell glob is missing a directory separator between the
directory variable and the pattern: update the glob usages that reference
PHASE_DIR and d so they match files inside the directory (e.g., ensure the
pattern inserts a "/" between PHASE_DIR and *-PLAN.md and likewise between d and
*-PLAN.md). Fix all ls calls and the ls used in the Plan Inventory loop that use
"$PHASE_DIR"*-PLAN.md and the earlier "$d"*-PLAN.md so they correctly expand to
files inside the target directory rather than concatenating the name and the
pattern.

In @.archon/workflows/experimental/gsd-new-milestone.yaml:
- Around line 364-375: Don’t derive the next phase from the working tree
(.planning/phases) in this block (PHASE_DIR / PHASE_NUM); instead determine
NEXT_PHASE from the archived milestone data (e.g., use an existing archived
milestone variable or compute from the archived milestone’s last phase) and only
fall back to 1 if no archived milestone info exists; update the echo lines and
the suggested command to use gsd-discuss-phase $NEXT_PHASE so the workflow
continues numbering from the archived milestone rather than assuming phase 1
when no local phase dirs exist.

In @.archon/workflows/experimental/gsd-new-project.yaml:
- Around line 405-444: The roadmap node in the workflow conflicts with the
gsd-roadmapper.md role file which instructs the roadmapper to commit; update
gsd-roadmapper.md (the Commit section) to make committing conditional or remove
the automatic commit so it honors the workflow’s approval gate: either change
the Commit steps into a conditional (e.g., only commit when an explicit flag/ENV
like COMMIT_AFTER_APPROVAL is set) or replace the commit commands with
instructions to stage/save files for later (e.g., “write files but do not
commit; finalize node will commit”), and document the new expected behavior in
gsd-roadmapper.md so the roadmap agent (roadmapper role) and the finalize node
remain consistent.

In @.archon/workflows/experimental/gsd-plan-phase.yaml:
- Around line 238-251: The sed is being run against the full "Next: ..." string
so it never matches; instead extract the phase basename from PHASE_DIR and
derive the numeric prefix. Replace the pipeline that echoes "Next: ..." with
logic that captures the basename (using ${PHASE_DIR##*/}) into a variable (e.g.,
BASENAME) and then either use parameter expansion to get the phase number
(PHASE_NUM=${BASENAME%%-*}) or run sed against just the basename (echo
"${BASENAME}" | sed 's/^\([0-9][0-9]\).*/\1/'); then print the "Next: archon
workflow run gsd-execute-phase $PHASE_NUM" message. Ensure you update the line
that currently uses echo "Next: ... ${PHASE_DIR##*/}" | sed 's/^\(..\)-.*/\1/'
to the corrected extraction and echo.

In @.archon/workflows/experimental/gsd-ship.yaml:
- Line 82: The VSTATUS assignment uses GNU-only grep with -P; replace the
command that sets VSTATUS (currently using grep -oP 'status:\s*\K\S+' "$VFILE")
with a portable alternative (for example an awk or sed pipeline) that extracts
the first non-space token after "status:" from VFILE and preserves the existing
fallback (|| echo "unknown"); update the VSTATUS assignment to use that portable
extraction and still redirect errors to /dev/null as before.

---

Outside diff comments:
In @.archon/workflows/experimental/gsd-execute-phase.yaml:
- Around line 261-341: The PHASE_DIR assignment inside the pipeline/subshell
(the "ls -d ... | sort -V | while read d; do ... PHASE_DIR=\"$d\"; done") won't
persist because the while runs in a subshell and nothing is printed for command
substitution; replace that pipeline with a non-subshell iteration (e.g., a for
loop or while reading via process substitution) that directly assigns PHASE_DIR
in the current shell, or write the matched directory to stdout for capture, so
the block that sets PHASE_DIR when ARGUMENTS/PHASE_NUM is empty correctly
produces a value.

In @.archon/workflows/experimental/gsd-verify-work.yaml:
- Around line 286-315: The bash step in the route node is incorrectly trying to
read previous node outputs via "$guard.output.PHASE_DIR",
"$guard.output.PHASE_BASE" and "$guard.output.UAT_FILE" (these are not valid
shell variables); update the route node to obtain those values correctly by
either reading the produced files from the PHASE_DIR on disk or accepting them
via environment variables passed into the bash step by the workflow engine —
replace uses of DIR, PHASE_BASE and UAT_FILE to derive values from the
filesystem (e.g., find or fixed paths under the workspace/PHASE_DIR) or from
explicitly exported env vars (e.g., PHASE_DIR, PHASE_BASE, UAT_FILE) so the
script references real shell variables like $PHASE_DIR, $PHASE_BASE and
$UAT_FILE instead of $guard.output.*.

---

Nitpick comments:
In @.archon/commands/gsd/gsd-roadmapper.md:
- Around line 51-55: Add language identifiers to the fenced code blocks that
currently show conceptual lines like "Phase 1: All database models ← Too
coupled" and "AUTH-01 → Phase 2" by replacing the plain backtick fences with
fences that include a language (e.g., use ```text or ```markdown) so syntax
highlighters render them consistently; update both occurrences (the block
containing the "Phase 1..." text and the block containing "AUTH-01 → Phase 2")
to include the chosen language identifier.

In @.archon/commands/gsd/gsd-verifier.md:
- Around line 93-99: The example uses incorrect basename usage: replace the
single-call basename pattern `$(basename "$artifact" .tsx? .ts)` with a small
shell step that strips extensions into a variable (e.g., compute COMPONENT from
basename and remove .ts/.tsx/.js/.jsx via a sed or parameter expansion), then
reuse that COMPONENT in the two grep commands; specifically, create COMPONENT
from basename("$artifact") with extension removal (or use `${artifact%.*}`/sed),
then use grep -r "import.*$COMPONENT" ... and grep -r "$COMPONENT" ... | grep -v
"import" so both the import check and usage check reference the same cleaned
component name instead of the invalid basename call.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 39a9f52b-f9ee-475c-94fe-4c704d27a561

📥 Commits

Reviewing files that changed from the base of the PR and between ece2a68 and 01f9279.

📒 Files selected for processing (23)
  • .archon/commands/gsd/gsd-codebase-mapper.md
  • .archon/commands/gsd/gsd-debugger.md
  • .archon/commands/gsd/gsd-executor.md
  • .archon/commands/gsd/gsd-phase-researcher.md
  • .archon/commands/gsd/gsd-plan-checker.md
  • .archon/commands/gsd/gsd-planner.md
  • .archon/commands/gsd/gsd-project-researcher.md
  • .archon/commands/gsd/gsd-research-synthesizer.md
  • .archon/commands/gsd/gsd-roadmapper.md
  • .archon/commands/gsd/gsd-verifier.md
  • .archon/workflows/experimental/gsd-complete-milestone.yaml
  • .archon/workflows/experimental/gsd-debug.yaml
  • .archon/workflows/experimental/gsd-discuss-phase.yaml
  • .archon/workflows/experimental/gsd-execute-phase.yaml
  • .archon/workflows/experimental/gsd-map-codebase.yaml
  • .archon/workflows/experimental/gsd-new-milestone.yaml
  • .archon/workflows/experimental/gsd-new-project.yaml
  • .archon/workflows/experimental/gsd-plan-phase.yaml
  • .archon/workflows/experimental/gsd-quick.yaml
  • .archon/workflows/experimental/gsd-ship.yaml
  • .archon/workflows/experimental/gsd-verify-work.yaml
  • .planning/.gitignore
  • CHANGELOG.md

Comment thread .archon/workflows/experimental/gsd-complete-milestone.yaml
Comment thread .archon/workflows/experimental/gsd-debug.yaml Outdated
Comment thread .archon/workflows/experimental/gsd-execute-phase.yaml Outdated
Comment thread .archon/workflows/experimental/gsd-new-milestone.yaml Outdated
Comment thread .archon/workflows/experimental/gsd-new-project.yaml
Comment thread .archon/workflows/experimental/gsd-plan-phase.yaml
Comment thread .archon/workflows/experimental/gsd-ship.yaml Outdated
Shell-script correctness fixes in the gsd-* workflow bash nodes and role docs:

- gsd-execute-phase: add the missing `/` in the PLAN globs so they match
  files inside the phase dir (not siblings); replace the lost-subshell
  PHASE_DIR assignment in the report node with a current-shell for-loop.
- gsd-verify-work: the guard now emits a single JSON object on stdout
  (diagnostics → stderr) so the engine resolves $guard.output.FIELD in the
  uat prompt and route node. A schemaless bash producer with non-JSON output
  throws OutputRefError on .FIELD access, which previously failed uat.
- gsd-plan-phase: derive the phase number via basename + grep instead of a
  sed pattern that never matched the "Next: ..." string.
- gsd-ship: replace GNU-only `grep -oP \K` with portable awk plus an explicit
  ${VSTATUS:-unknown} default.
- gsd-debug: collision-safe slug (<=21-char base + 8-hex git fingerprint) with
  an empty-input guard for punctuation-only descriptions.
- gsd-complete-milestone: canonical repo-root MILESTONES.md (matches staging).
- gsd-new-milestone: derive the first phase from the freshly written ROADMAP.md
  rather than the highest existing phase dir.
- gsd-roadmapper.md: stop committing (callers commit after their approval gate);
  add a `text` language to the two bare code fences.
- gsd-verifier.md: fix the basename extension-stripping example (single sed -E).

All 11 gsd-* workflows remain schema-valid and prettier-clean; bash nodes
verified against fixtures.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.archon/workflows/experimental/gsd-plan-phase.yaml (1)

242-242: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

GNU-only find -printf may break on macOS/BSD.

The -printf '%h\n' option is a GNU extension not available in BSD/macOS find. Consider using a POSIX-portable alternative:

-      PHASE_DIR=$(find .planning/phases -name '*-PLAN.md' -printf '%h\n' 2>/dev/null | sort -u | tail -1)
+      PHASE_DIR=$(find .planning/phases -name '*-PLAN.md' 2>/dev/null | xargs -I{} dirname {} | sort -u | tail -1)

Or using a shell loop:

PHASE_DIR=$(find .planning/phases -name '*-PLAN.md' 2>/dev/null | while read f; do dirname "$f"; done | sort -u | tail -1)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.archon/workflows/experimental/gsd-plan-phase.yaml at line 242, The command
that sets PHASE_DIR uses GNU-only find -printf '%h\n' which fails on BSD/macOS;
update the PHASE_DIR assignment to use a POSIX-portable sequence instead (call
find without -printf and pipe the results through dirname or a while-read loop,
then sort -u and tail -1) so PHASE_DIR is derived from the parent directory of
the latest '*-PLAN.md' in .planning/phases; edit the line that defines PHASE_DIR
to replace the -printf usage with the portable pipeline (e.g., find ... | xargs
-n1 dirname | sort -u | tail -1 or find ... | while read f; do dirname "$f";
done | sort -u | tail -1) ensuring error redirection (2>/dev/null) is preserved.
🧹 Nitpick comments (1)
.archon/workflows/experimental/gsd-debug.yaml (1)

261-262: 💤 Low value

Archive git mv source path has redundant mkdir -p.

Line 261 runs mkdir -p .planning/debug but the session file is already at .planning/debug/{slug}.md (created by the setup node and used throughout). The mkdir is harmless but unnecessary. More importantly, verify the paths are consistent:

  • Line 261: mkdir -p .planning/debug && git mv .planning/debug/{slug}.md .planning/debug/resolved/

The mkdir -p .planning/debug should be mkdir -p .planning/debug/resolved if the intent is to ensure the destination exists (though setup already creates it at line 64).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.archon/workflows/experimental/gsd-debug.yaml around lines 261 - 262, The
git mv command is creating a resolved/ destination but the mkdir used before it
is for .planning/debug (mkdir -p .planning/debug && git mv
.planning/debug/{slug}.md .planning/debug/resolved/); update this to ensure the
destination exists by changing the mkdir to mkdir -p .planning/debug/resolved or
remove the mkdir entirely if the setup step already creates
.planning/debug/resolved; confirm the command around the git mv that moves
.planning/debug/{slug}.md to .planning/debug/resolved/ uses the same paths
consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.archon/workflows/experimental/gsd-plan-phase.yaml:
- Line 242: The command that sets PHASE_DIR uses GNU-only find -printf '%h\n'
which fails on BSD/macOS; update the PHASE_DIR assignment to use a
POSIX-portable sequence instead (call find without -printf and pipe the results
through dirname or a while-read loop, then sort -u and tail -1) so PHASE_DIR is
derived from the parent directory of the latest '*-PLAN.md' in .planning/phases;
edit the line that defines PHASE_DIR to replace the -printf usage with the
portable pipeline (e.g., find ... | xargs -n1 dirname | sort -u | tail -1 or
find ... | while read f; do dirname "$f"; done | sort -u | tail -1) ensuring
error redirection (2>/dev/null) is preserved.

---

Nitpick comments:
In @.archon/workflows/experimental/gsd-debug.yaml:
- Around line 261-262: The git mv command is creating a resolved/ destination
but the mkdir used before it is for .planning/debug (mkdir -p .planning/debug &&
git mv .planning/debug/{slug}.md .planning/debug/resolved/); update this to
ensure the destination exists by changing the mkdir to mkdir -p
.planning/debug/resolved or remove the mkdir entirely if the setup step already
creates .planning/debug/resolved; confirm the command around the git mv that
moves .planning/debug/{slug}.md to .planning/debug/resolved/ uses the same paths
consistently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f2b79376-20d7-47a2-ae60-27f65fa2bdc5

📥 Commits

Reviewing files that changed from the base of the PR and between 01f9279 and 2286f05.

📒 Files selected for processing (9)
  • .archon/commands/gsd/gsd-roadmapper.md
  • .archon/commands/gsd/gsd-verifier.md
  • .archon/workflows/experimental/gsd-complete-milestone.yaml
  • .archon/workflows/experimental/gsd-debug.yaml
  • .archon/workflows/experimental/gsd-execute-phase.yaml
  • .archon/workflows/experimental/gsd-new-milestone.yaml
  • .archon/workflows/experimental/gsd-plan-phase.yaml
  • .archon/workflows/experimental/gsd-ship.yaml
  • .archon/workflows/experimental/gsd-verify-work.yaml
✅ Files skipped from review due to trivial changes (1)
  • .archon/commands/gsd/gsd-verifier.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • .archon/workflows/experimental/gsd-ship.yaml
  • .archon/commands/gsd/gsd-roadmapper.md
  • .archon/workflows/experimental/gsd-new-milestone.yaml
  • .archon/workflows/experimental/gsd-complete-milestone.yaml
  • .archon/workflows/experimental/gsd-execute-phase.yaml

Every work-producing experimental GSD workflow now ensures a non-base
branch, pushes it, and creates or updates a pull request:

- Phase-scoped (discuss/plan/execute/verify) ensure a gsd/phase-NN
  branch and open a draft PR; report/route run after publish.
- Project-level (map-codebase, new-project, new-milestone,
  complete-milestone) ensure a date-stamped gsd/* branch and open a
  ready-for-review PR; complete-milestone gains a branch node ahead of
  archive.
- gsd-ship edits + marks ready an existing PR instead of skipping it,
  and refuses to ship from the base branch.
- gsd-quick / gsd-debug ship their work as a PR.

All except gsd-debug (diagnose-only, must stay usable without GitHub)
declare requires: [github]. Branch logic leaves an existing feature
branch untouched and fails fast on the base branch when no phase arg is
given. Headers, descriptions, and the coleam00#1696 CHANGELOG entry updated.
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.

Port GSD framework to Archon workflows (experimental/gsd/)

1 participant