[template]
name = "gstack-startup"
version = "0.1.0"
description = "Full SDLC team for startup repos"
detect = ["Cargo.toml"]

[template.roles.planner]
default_runtime = "claude-code"
description = "Breaks work into steps, produces structured plans"

[template.roles.implementer]
default_runtime = "claude-code"
description = "Writes code, commits, pushes"

[template.roles.tester]
default_runtime = "claude-code"
description = "Writes and runs tests"

[template.roles.reviewer]
default_runtime = "codex"
description = "Reviews diffs for correctness and style"

[template.roles.docs-release]
default_runtime = "claude-code"
description = "Updates docs and changelog"

# ── config below ──
[workspace]
name = "{{project_name}}"
description = "Full SDLC team — generated from gstack-startup template"

[defaults]
worktree = true

[roles]
planner = "claude-code"
implementer = "claude-code"
tester = "claude-code"
reviewer = "codex"
docs-release = "claude-code"

[[agent]]
name = "planner"
role = "planner"
scope = "docs/**"
prompt = "You own planning and design."

[[agent]]
name = "implementer"
role = "implementer"
scope = "src/**"
prompt = "You own implementation. Commit and push when done."

[[agent]]
name = "tester"
role = "tester"
scope = "src/**"
prompt = "You write and run tests."

[[agent]]
name = "reviewer"
role = "reviewer"
prompt = "You review PRs for correctness and style."

[[agent]]
name = "docs-release"
role = "docs-release"
prompt = "You update docs, changelog, and version."

# ─── Interactive SDLC with gstack artifact flow ───
# Human-in-the-loop workflow: each gstack skill is interactive.
# Tutti automates the artifact handoff between steps, not the skill execution.

[[workflow]]
name = "sdlc-gstack"
description = "Interactive SDLC with gstack skill artifact flow: design → review → implement → test → ship"

[[workflow.step]]
id = "ensure_planner"
type = "ensure_running"
agent = "planner"

[[workflow.step]]
id = "ensure_implementer"
type = "ensure_running"
agent = "implementer"

[[workflow.step]]
id = "ensure_tester"
type = "ensure_running"
agent = "tester"

[[workflow.step]]
id = "design"
type = "prompt"
agent = "planner"
text = "/office-hours"
wait_timeout_secs = 3600
startup_grace_secs = 120
artifact_glob = "~/.gstack/projects/{slug}/*-design-*.md"
artifact_name = "design_doc"

[[workflow.step]]
id = "eng_review"
type = "prompt"
agent = "planner"
text = "/plan-eng-review"
wait_timeout_secs = 3600
startup_grace_secs = 60
inject_files = ["{{output.design_doc.path}}"]
artifact_glob = "~/.gstack/projects/{slug}/*-test-plan-*.md"
artifact_name = "test_plan"

[[workflow.step]]
id = "implement_code"
type = "prompt"
agent = "implementer"
text = "Read the design doc and test plan in your .tutti/artifacts/ directory. Implement the approved design. Commit and push when done."
wait_for_idle = true
wait_timeout_secs = 7200
startup_grace_secs = 120
inject_files = ["{{output.design_doc.path}}", "{{output.test_plan.path}}"]

[[workflow.step]]
id = "validate"
type = "command"
run = "cd .tutti/worktrees/implementer && cargo test --quiet"
fail_mode = "closed"

[[workflow.step]]
id = "qa"
type = "prompt"
agent = "tester"
text = "/review"
wait_for_idle = true
wait_timeout_secs = 3600
startup_grace_secs = 60
inject_files = ["{{output.test_plan.path}}"]

[[workflow.step]]
id = "ship"
type = "prompt"
agent = "planner"
text = "/ship"
wait_for_idle = true
wait_timeout_secs = 1800
startup_grace_secs = 60
