Skip to content

Commit 50824da

Browse files
docs: align README, skills, and CURSOR_PROMPTS with v4.6 cycle and gate v3.
Updates install tree, workflow diagram, limitations, slash command, and role skills to match cycle start/enter-builder handoff. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent c7c15e1 commit 50824da

12 files changed

Lines changed: 117 additions & 46 deletions

File tree

.cursor/commands/graphstack.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# GraphStack — start Orchestrator
22

3-
1. Execute **Activation** in `orchestrator/ORCHESTRATOR.md` exactly as written (including step **1a**).
4-
2. Greet using the scripted format from that section.
5-
3. Wait for user input (`Activation` wait step). If the user already embedded their goal in the same message as this command, proceed with that goal immediately after greeting.
3+
1. Execute **Activation** in `orchestrator/ORCHESTRATOR.md` exactly (full parallel read batch: TOKEN_OPTIMIZER, GRAPH_REPORT, BRIEF, doing/, STATE).
4+
2. Greet using the scripted format from step 8.
5+
3. **First-turn routing (step 9):** If the user already embedded a task goal in this message → greet briefly, enter **[ARCHITECT MODE]** immediately (no code on turn 1). If the message is empty → greet and wait.

.cursor/skills/architect/ARCHITECT.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,18 @@ User says "new project" → Do not proceed — signal Orchestrator to use
129129

130130
## Handoff to Builder
131131

132+
At session start (if Orchestrator has not already):
133+
134+
```bash
135+
python -m graphstack cycle start <task-id> "<objective one-liner>"
136+
```
137+
132138
When brief is ready:
133139

134-
1. Write `handoff/BRIEF.md`
135-
2. Create the GNAP board task:
140+
1. Write `handoff/BRIEF.md` with **Status: Ready for Builder**
141+
2. Announce handoff (Orchestrator runs `cycle enter-builder` before Builder writes code):
136142
```bash
137-
python -m graphstack board new <task-id> "<objective one-liner>"
143+
python -m graphstack cycle enter-builder <task-id>
138144
```
139145
3. Announce:
140146
```

.cursor/skills/bootstrapper/BOOTSTRAPPER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ If a graph already exists, the Orchestrator uses the Architect instead — not y
4242
6. Wait for approval. Revise if needed.
4343
4444
7. Write the first brief (Cycle 1) to handoff/BRIEF.md.
45-
Create the board task: python -m graphstack board new cycle-1-[module] [module name]
45+
Create the cycle task: python -m graphstack cycle start cycle-1-[module] "[module name]"
4646
4747
8. Announce handoff:
4848
"[BOOTSTRAPPER → BUILDER]

.cursor/skills/builder/BUILDER.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ When activated, execute this sequence exactly:
2626
python -m graphstack board new [brief-slug] [brief objective]
2727
→ If 2+ matches: list them and ask user which to claim
2828
29-
4. Claim the task:
30-
python -m graphstack board claim <task-id> builder
29+
4. Enter builder role (preferred — sets board claim + STATE.json for gate v3):
30+
python -m graphstack cycle enter-builder <task-id>
31+
# Fallback if task already in doing/: board claim <task-id> builder
32+
# + state set --role builder --task <task-id>
3133
32-
5. Update machine-readable state (Orchestrator already confirmed the brief —
33-
do NOT ask the user again):
34-
python -m graphstack state set --role builder --task <task-id>
34+
5. Verify STATE.json shows role=builder before any code edit (gate denies otherwise)
3535
3636
6. Report once, then start building immediately:
3737
"[BUILDER MODE] Task: [task-id] | Criteria: [N] | Files: [list]"

README.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ One prompt starts the entire lifecycle — from blank repo to production.
1414

1515
</div>
1616

17-
> **v4.5 highlights:** Published on [PyPI](https://pypi.org/project/MertCapkin_GraphStack/) as **`MertCapkin_GraphStack`**, one-command bootstrap, `board reopen` / `list-done`. Plus v4.4 `graph query` + `init`, v4.3 gate. See [CHANGELOG.md](CHANGELOG.md).
17+
> **v4.6 highlights:** `graphstack cycle` (start / enter-builder), **gate v3** (role=builder for edits, strict ship/review), expanded `alwaysApply` rules, hook **merge** on install. See [CHANGELOG.md](CHANGELOG.md).
1818
1919
---
2020

@@ -255,9 +255,9 @@ Step 2 — every session (minimal typing):
255255
Example natural-language kickoff:
256256
"Add rate limiting to login."
257257
258-
[ARCHITECT] reads graph (not raw files) → scopes change → writes BRIEF.md
258+
[ARCHITECT] cycle start → reads graph → scopes change → writes BRIEF.md
259259
↓ auto
260-
[BUILDER] reads briefqueries graph for deps → builds exactly the brief
260+
[BUILDER] cycle enter-builderreads brief → builds exactly the brief
261261
↓ auto
262262
[REVIEWER] checks criteria → inspects graph neighbors for side effects
263263
↓ auto (loops to Builder if rejected, max 3×)
@@ -332,12 +332,12 @@ GraphStack is a **workflow protocol** (markdown + handoff files), not a runtime
332332

333333
| Topic | Reality |
334334
|-------|---------|
335-
| Role automation | Prompts alone cannot guarantee discipline. v4.3+ **`graphstack gate`** + v4.4 Cursor **`preToolUse`**. Hooks block commits and (on Cursor/Claude) code writes without a claimed task; `afterFileEdit` on Cursor remains advisory-only backup. |
335+
| Role automation | Prompts + **gate v3 (v4.6)**: code edits require `STATE.json role=builder` and a task in `doing/`. **`graphstack cycle`** binds board + state. Strict mode (`GRAPHSTACK_GATE=strict`) also enforces ship/review before code commits. `afterFileEdit` on Cursor remains advisory-only backup. |
336336
| Token savings | The table above is **estimated**, not guaranteed. Small repos or undisciplined sessions may use **more** tokens than unstructured chat. |
337337
| Knowledge graph | Value appears on **20+ file** codebases with module boundaries. Meta-repos full of markdown produce noisy graphs — use `.graphifyignore` (included in this repo). |
338338
| Setup | Graphify + `pip install MertCapkin_GraphStack` + `graphstack init` — or one bootstrap command. See [PyPI](https://pypi.org/project/MertCapkin_GraphStack/). |
339339

340-
**v4.1 helpers:** `graphstack doctor` (health report) and `graphstack validate` (exit code for CI). Use `--strict` before Builder handoff; use `--fail-stale-graph` in CI after code changes.
340+
**Health checks:** `graphstack doctor` and `graphstack validate` (exit code for CI). v4.6 adds handoff sync + `hooks.json` checks. Use `--strict` before Builder handoff; use `--fail-stale-graph` in CI after code changes.
341341

342342
```bash
343343
graphstack doctor
@@ -391,7 +391,7 @@ Requires `graphify` on PATH (`pip install -r requirements.txt`). Agents should p
391391

392392
## Process Gate (`graphstack gate`)
393393

394-
v4.3+ adds **mechanical enforcement** so Architect → Builder → Reviewer steps are harder to skip silently. v4.4 extends Cursor with `preToolUse` blocking.
394+
**Gate v3 (v4.6)** adds role-aware enforcement so Architect → Builder → Reviewer steps are harder to skip silently. Cursor `preToolUse` blocks edits before they land; use **`graphstack cycle`** for the mechanical handoff steps.
395395

396396
| Rule | What it blocks | Cursor | Claude Code |
397397
|------|----------------|--------|-------------|
@@ -414,7 +414,7 @@ GRAPHSTACK_GATE=off # emergency bypass (one session)
414414
GRAPHSTACK_GATE=strict # R4–R6 + fail-closed on hook errors
415415
```
416416

417-
**Install** writes `.cursor/hooks.json` and `.claude/settings.json` with OS-specific shim commands (`scripts/gate-hook.ps1` on Windows, `scripts/gate-hook.sh` on macOS/Linux). By default hooks **fail open** if Python is missing — use `GRAPHSTACK_GATE=strict` for teams that prefer blocking over availability.
417+
**Install** writes or **merges** `.cursor/hooks.json` and `.claude/settings.json` with OS-specific shim commands (`scripts/gate-hook.ps1` on Windows, `scripts/gate-hook.sh` on macOS/Linux). By default hooks **fail open** if Python is missing — use `GRAPHSTACK_GATE=strict` for teams that prefer blocking over availability.
418418

419419
> **Framework repo note:** This GitHub repo ships `handoff/` as **templates** (empty brief, no `done/` tasks). Your installed project fills those files during real work. Before contributing here, reset handoff — see [CONTRIBUTING.md](CONTRIBUTING.md).
420420
@@ -424,7 +424,8 @@ GRAPHSTACK_GATE=strict # R4–R6 + fail-closed on hook errors
424424

425425
```
426426
your-project/
427-
├── .cursor/rules/graphstack.mdc ← always-active rules (Cursor auto-loads)
427+
├── .cursor/rules/graphstack.mdc ← always-active rules v4.6 (Cursor auto-loads)
428+
├── .cursor/hooks.json ← process gate (merged on reinstall)
428429
├── .cursor/commands/graphstack.md ← `/graphstack` Cursor slash-command bootstrapper
429430
├── orchestrator/
430431
│ ├── ORCHESTRATOR.md ← state machine: all transitions
@@ -439,7 +440,8 @@ your-project/
439440
├── handoff/
440441
│ ├── BRIEF.md ← Architect → Builder
441442
│ ├── REVIEW.md ← Reviewer + QA findings (append-only)
442-
│ ├── STATE.md ← session state for resuming
443+
│ ├── STATE.md ← human session log (append-only)
444+
│ ├── STATE.json ← machine state for gate hooks
443445
│ ├── BOOTSTRAP.md ← cross-cycle project memory
444446
│ └── board/
445447
│ ├── todo/ ← tasks waiting to be claimed
@@ -460,7 +462,12 @@ your-project/
460462
│ ├── hook.py ← post-commit graph-update logic
461463
│ ├── platform_utils.py ← OS detection, Python finder, encoding-safe echo
462464
│ ├── cli.py ← entry point dispatcher
463-
│ ├── validate.py ← layout / brief / graph checks
465+
│ ├── validate.py ← layout / brief / graph / hooks checks
466+
│ ├── gate.py ← process gate (R1–R6)
467+
│ ├── state.py ← handoff/STATE.json
468+
│ ├── cycle.py ← cycle start / enter-builder
469+
│ ├── brief_utils.py ← shared BRIEF/REVIEW helpers
470+
│ ├── graph.py ← graphify query wrappers
464471
│ ├── run.py ← shell runner with compaction
465472
│ ├── compact/ ← git / pytest / generic compactors
466473
│ └── tests/ ← pytest suite
@@ -498,6 +505,16 @@ bash scripts/board.sh log
498505

499506
#### Cross-platform (any shell with Python)
500507

508+
**Preferred — full cycle handoff (v4.6):**
509+
510+
```bash
511+
python -m graphstack cycle start add-oauth "Add OAuth login with GitHub"
512+
# Architect writes handoff/BRIEF.md → Status: Ready for Builder
513+
python -m graphstack cycle enter-builder add-oauth
514+
```
515+
516+
**Low-level board (still supported):**
517+
501518
```bash
502519
python -m graphstack board status
503520
python -m graphstack board new add-oauth Add OAuth login with GitHub
@@ -506,7 +523,7 @@ python -m graphstack board complete add-oauth
506523
python -m graphstack board log
507524
python -m graphstack run -- git status
508525
python -m graphstack doctor
509-
python -m graphstack validate --fail-stale-graph
526+
python -m graphstack validate --strict --fail-stale-graph
510527
```
511528

512529
Every board operation is a git commit. `git log handoff/board/` shows who did what, when.

docs/CURSOR_PROMPTS.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# GraphStack v4 — Cursor Prompts & Setup Guide
1+
# GraphStack v4.6 — Cursor Prompts & Setup Guide
22

33
---
44

@@ -89,6 +89,16 @@ Resume from last session.
8989

9090
Architect → Builder → Reviewer → QA → Ship zinciri kullanıcı etkileşimi olmadan yürür.
9191

92+
**v4.6 mekanik handoff (gate ile uyumlu):**
93+
94+
```bash
95+
python -m graphstack cycle start my-feature "Hedefin tek cümle özeti"
96+
# Architect handoff/BRIEF.md yazar → Status: Ready for Builder
97+
python -m graphstack cycle enter-builder my-feature
98+
```
99+
100+
Kod edit gate'i `role=builder` ve `doing/` task olmadan **engeller**. Takım modu: `GRAPHSTACK_GATE=strict`.
101+
92102
---
93103

94104
## 🚀 Sıfırdan Yeni Proje (Bootstrap Modu)
@@ -172,9 +182,18 @@ Run the pre-ship checklist for task [task-id].
172182

173183
---
174184

175-
## 📋 Board Komutları (Terminal)
185+
## 📋 Cycle + Board (Terminal)
186+
187+
**Önerilen (v4.6)** — board + STATE + BRIEF tek adımda:
188+
189+
```bash
190+
python -m graphstack cycle start my-feature "OAuth login ekle"
191+
python -m graphstack cycle enter-builder my-feature
192+
python -m graphstack doctor
193+
python -m graphstack validate --strict
194+
```
176195

177-
Üç biçim de eşdeğerdir. Shell tercihinize göre seçin.
196+
**Düşük seviye board** — üç biçim eşdeğerdir:
178197

179198
**macOS / Linux (bash):**
180199
```bash
@@ -209,7 +228,9 @@ python -m graphstack board log
209228

210229
- Her Orchestrator döngüsünde mümkünse **yeni bir Cursor chat** aç — context temiz kalır
211230
- Cursor slash menüsünde **`/graphstack`** kullanarak Orchestrator açılışını netleştir
212-
- `.cursor/rules/graphstack.mdc` otomatik yüklenir, elle okutman gerekmiyor
231+
- `.cursor/rules/graphstack.mdc` (v4.6) otomatik yüklenir — Activation checklist içerir
232+
- Kod yazmadan önce: `cycle enter-builder` veya `doctor` ile handoff senkronunu kontrol et
233+
- `.cursor/hooks.json` yoksa gate devre dışı — `graphstack install` veya reinstall ile merge et
213234
- Grafı büyük değişikliklerden sonra güncelle: `/graphify --update`
214-
- `handoff/STATE.md` dosyasını silme — oturum geçmişin orada
235+
- `handoff/STATE.md` ve `STATE.json` dosyalarını silme — oturum geçmişi / gate burada
215236
- `handoff/board/` klasörünü commit'le — ekip arkadaşların board'u görsün
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# GraphStack — start Orchestrator
22

3-
1. Execute **Activation** in `orchestrator/ORCHESTRATOR.md` exactly as written (including step **1a**).
4-
2. Greet using the scripted format from that section.
5-
3. Wait for user input (`Activation` wait step). If the user already embedded their goal in the same message as this command, proceed with that goal immediately after greeting.
3+
1. Execute **Activation** in `orchestrator/ORCHESTRATOR.md` exactly (full parallel read batch: TOKEN_OPTIMIZER, GRAPH_REPORT, BRIEF, doing/, STATE).
4+
2. Greet using the scripted format from step 8.
5+
3. **First-turn routing (step 9):** If the user already embedded a task goal in this message → greet briefly, enter **[ARCHITECT MODE]** immediately (no code on turn 1). If the message is empty → greet and wait.

scripts/graphstack/assets/.cursor/skills/architect/ARCHITECT.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,18 @@ User says "new project" → Do not proceed — signal Orchestrator to use
129129

130130
## Handoff to Builder
131131

132+
At session start (if Orchestrator has not already):
133+
134+
```bash
135+
python -m graphstack cycle start <task-id> "<objective one-liner>"
136+
```
137+
132138
When brief is ready:
133139

134-
1. Write `handoff/BRIEF.md`
135-
2. Create the GNAP board task:
140+
1. Write `handoff/BRIEF.md` with **Status: Ready for Builder**
141+
2. Announce handoff (Orchestrator runs `cycle enter-builder` before Builder writes code):
136142
```bash
137-
python -m graphstack board new <task-id> "<objective one-liner>"
143+
python -m graphstack cycle enter-builder <task-id>
138144
```
139145
3. Announce:
140146
```

scripts/graphstack/assets/.cursor/skills/bootstrapper/BOOTSTRAPPER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ If a graph already exists, the Orchestrator uses the Architect instead — not y
4242
6. Wait for approval. Revise if needed.
4343
4444
7. Write the first brief (Cycle 1) to handoff/BRIEF.md.
45-
Create the board task: python -m graphstack board new cycle-1-[module] [module name]
45+
Create the cycle task: python -m graphstack cycle start cycle-1-[module] "[module name]"
4646
4747
8. Announce handoff:
4848
"[BOOTSTRAPPER → BUILDER]

scripts/graphstack/assets/.cursor/skills/builder/BUILDER.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ When activated, execute this sequence exactly:
2626
python -m graphstack board new [brief-slug] [brief objective]
2727
→ If 2+ matches: list them and ask user which to claim
2828
29-
4. Claim the task:
30-
python -m graphstack board claim <task-id> builder
29+
4. Enter builder role (preferred — sets board claim + STATE.json for gate v3):
30+
python -m graphstack cycle enter-builder <task-id>
31+
# Fallback if task already in doing/: board claim <task-id> builder
32+
# + state set --role builder --task <task-id>
3133
32-
5. Update machine-readable state (Orchestrator already confirmed the brief —
33-
do NOT ask the user again):
34-
python -m graphstack state set --role builder --task <task-id>
34+
5. Verify STATE.json shows role=builder before any code edit (gate denies otherwise)
3535
3636
6. Report once, then start building immediately:
3737
"[BUILDER MODE] Task: [task-id] | Criteria: [N] | Files: [list]"

0 commit comments

Comments
 (0)