Skill chain state detection broken: cross-branch JSONL isolation + /review not logging
- Dominant language
- TypeScript
- Stars
- 133k
- Forks
- 19.9k
- Avg merge
- 18h 46m
- Merged PRs (30d)
- 26
Description
## Problem
Skills in the gstack workflow chain cannot detect outputs from previous skills. This breaks the intended workflow state machine where each skill feeds into the next.
**Three reported failures:**
| Upstream Skill | Downstream Skill | Expected | Actual |
|---|---|---|---|
| /office-hours | /plan-ceo-review | Finds design doc | ❌ Branch-scoped filename mismatch |
| /plan-ceo-review | /plan-eng-review | Finds CEO plan + review log | ❌ No discovery code for `ceo-plans/` + JSONL is branch-isolated |
| /review | /ship | Review Readiness Dashboard shows CLEAR | ❌ /review writes no JSONL entry; dashboard doesn't recognize it |
## Root Cause
### 1. JSONL review log is branch-scoped but workflow is cross-branch
`gstack-review-log` writes to `$BRANCH-reviews.jsonl`. When skills run on different branches (e.g., `/office-hours` on `main`, then `/plan-eng-review` on `feat/my-feature`), all prior review signals are invisible because `gstack-review-read` only reads the current branch's file.
### 2. /review skill never writes to the review log
The `/review` skill (pre-landing code review) does NOT write a `"skill":"review"` or `"skill":"plan-eng-review"` entry to the JSONL. It only conditionally writes `design-review-lite` and `codex-review`.
The `/ship` Review Readiness Dashboard only looks for: `plan-ceo-review`, `plan-eng-review`, `plan-design-review`, `design-review-lite`, `codex-review`. Running `/review` leaves zero trace that `/ship` can parse → dashboard shows "Eng Review: 0 runs / NOT CLEARED" even after a full review.
### 3. plan-eng-review has no CEO plan discovery code
`plan-eng-review` only globs for `*-design-*.md` (office-hours output). It has zero code to read `~/.gstack/projects/$SLUG/ceo-plans/` where `/plan-ceo-review` writes its output.
### 4. File naming uses branch name, breaking cross-branch discovery
`office-hours` writes files named `{user}-{branch}-design-{datetime}.md`. Downstream skills glob with `*-$CURRENT_BRANCH-design-*.md`. When branches differ, the glob fails. The fallback (`*-design-*.md` sorted by mtime) is non-deterministic.
## Impact
Users must manually override the Review Readiness Dashboard gate on every `/ship` run, even when all reviews have been completed. The workflow state machine described in documentation doesn't actually work — each skill is effectively stateless with respect to its predecessors.
## Suggested Fix
1. **Make JSONL project-scoped, not branch-scoped** (or add cross-branch query capability to `gstack-review-read`)
2. **Add a review log entry to `/review`** — e.g., `{"skill":"pre-landing-review", ...}` and have `/ship` recognize it as satisfying the Eng Review gate
3. **Add CEO plan discovery to `/plan-eng-review`** — glob `ceo-plans/` directory
4. **Consider a unified skill handoff protocol** — each skill writes a standardized completion record, downstream skills query via a common API rather than ad-hoc file discovery
## Environment
- gstack version: 0.9.4.1
- Observed across multiple workflow runs on the agentflow project
Contributor guide
Assessment
This issue has not been assessed yet.