galangal-orchestrate 0.2.29__tar.gz → 0.6.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. galangal_orchestrate-0.6.3/PKG-INFO +759 -0
  2. galangal_orchestrate-0.6.3/README.md +723 -0
  3. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/docs/local-development/README.md +54 -0
  4. galangal_orchestrate-0.6.3/docs/local-development/architecture.md +241 -0
  5. galangal_orchestrate-0.6.3/docs/local-development/cli-commands.md +411 -0
  6. galangal_orchestrate-0.6.3/docs/local-development/configuration.md +445 -0
  7. galangal_orchestrate-0.6.3/docs/local-development/extending.md +473 -0
  8. galangal_orchestrate-0.6.3/docs/local-development/prompt-system.md +365 -0
  9. galangal_orchestrate-0.6.3/docs/local-development/state-management.md +291 -0
  10. galangal_orchestrate-0.6.3/docs/local-development/validation-system.md +407 -0
  11. galangal_orchestrate-0.6.3/docs/local-development/workflow-pipeline.md +324 -0
  12. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/__init__.py +1 -1
  13. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/cli.py +131 -0
  14. galangal_orchestrate-0.6.3/src/galangal/commands/approve.py +196 -0
  15. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/commands/complete.py +49 -14
  16. galangal_orchestrate-0.6.3/src/galangal/commands/github.py +369 -0
  17. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/commands/init.py +2 -0
  18. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/commands/pause.py +5 -11
  19. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/commands/resume.py +6 -11
  20. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/commands/skip.py +10 -40
  21. galangal_orchestrate-0.6.3/src/galangal/commands/start.py +408 -0
  22. galangal_orchestrate-0.6.3/src/galangal/commands/stats.py +155 -0
  23. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/commands/status.py +8 -1
  24. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/config/defaults.py +39 -0
  25. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/config/loader.py +10 -0
  26. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/config/schema.py +54 -0
  27. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/core/artifacts.py +60 -0
  28. galangal_orchestrate-0.6.3/src/galangal/core/metrics.py +264 -0
  29. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/core/state.py +150 -12
  30. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/core/tasks.py +72 -0
  31. galangal_orchestrate-0.6.3/src/galangal/core/utils.py +116 -0
  32. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/core/workflow/__init__.py +0 -1
  33. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/core/workflow/core.py +33 -4
  34. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/core/workflow/pause.py +12 -1
  35. galangal_orchestrate-0.6.3/src/galangal/core/workflow/tui_runner.py +1329 -0
  36. galangal_orchestrate-0.6.3/src/galangal/github/__init__.py +31 -0
  37. galangal_orchestrate-0.6.3/src/galangal/github/client.py +417 -0
  38. galangal_orchestrate-0.6.3/src/galangal/github/images.py +325 -0
  39. galangal_orchestrate-0.6.3/src/galangal/github/issues.py +286 -0
  40. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/logging.py +27 -1
  41. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/prompts/builder.py +75 -48
  42. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/prompts/defaults/pm.md +26 -0
  43. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/prompts/defaults/qa.md +21 -1
  44. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/prompts/defaults/review.md +20 -0
  45. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/prompts/defaults/security.md +17 -5
  46. galangal_orchestrate-0.6.3/src/galangal/prompts/defaults/test.md +91 -0
  47. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/results.py +17 -0
  48. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/ui/console.py +5 -0
  49. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/ui/tui/adapters.py +17 -0
  50. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/ui/tui/app.py +228 -234
  51. galangal_orchestrate-0.6.3/src/galangal/ui/tui/mixins.py +194 -0
  52. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/ui/tui/modals.py +79 -193
  53. galangal_orchestrate-0.6.3/src/galangal/ui/tui/styles/app.tcss +86 -0
  54. galangal_orchestrate-0.6.3/src/galangal/ui/tui/styles/modals.tcss +197 -0
  55. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/ui/tui/types.py +4 -5
  56. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/ui/tui/widgets.py +21 -2
  57. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/validation/runner.py +183 -94
  58. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/tests/test_commands.py +48 -56
  59. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/tests/test_validation_runner.py +89 -38
  60. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/tests/test_workflow_core.py +3 -3
  61. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/tests/test_workflow_integration.py +7 -5
  62. galangal_orchestrate-0.2.29/PKG-INFO +0 -302
  63. galangal_orchestrate-0.2.29/README.md +0 -266
  64. galangal_orchestrate-0.2.29/src/galangal/commands/approve.py +0 -187
  65. galangal_orchestrate-0.2.29/src/galangal/commands/start.py +0 -191
  66. galangal_orchestrate-0.2.29/src/galangal/core/workflow/tui_runner.py +0 -761
  67. galangal_orchestrate-0.2.29/src/galangal/prompts/defaults/test.md +0 -59
  68. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/.github/workflows/publish.yml +0 -0
  69. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/.gitignore +0 -0
  70. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/LICENSE +0 -0
  71. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/docs/local-development/versioning.md +0 -0
  72. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/docs/pypi/RELEASE.md +0 -0
  73. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/pyproject.toml +0 -0
  74. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/__main__.py +0 -0
  75. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/ai/__init__.py +0 -0
  76. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/ai/base.py +0 -0
  77. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/ai/claude.py +0 -0
  78. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/ai/gemini.py +0 -0
  79. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/commands/__init__.py +0 -0
  80. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/commands/list.py +0 -0
  81. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/commands/prompts.py +0 -0
  82. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/commands/reset.py +0 -0
  83. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/commands/switch.py +0 -0
  84. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/config/__init__.py +0 -0
  85. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/core/__init__.py +0 -0
  86. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/exceptions.py +0 -0
  87. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/prompts/__init__.py +0 -0
  88. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/prompts/defaults/benchmark.md +0 -0
  89. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/prompts/defaults/contract.md +0 -0
  90. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/prompts/defaults/design.md +0 -0
  91. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/prompts/defaults/dev.md +0 -0
  92. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/prompts/defaults/docs.md +0 -0
  93. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/prompts/defaults/migration.md +0 -0
  94. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/prompts/defaults/pm_questions.md +0 -0
  95. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/prompts/defaults/preflight.md +0 -0
  96. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/ui/__init__.py +0 -0
  97. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/ui/tui/__init__.py +0 -0
  98. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/ui/tui/entry.py +0 -0
  99. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/src/galangal/validation/__init__.py +0 -0
  100. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/tests/__init__.py +0 -0
  101. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/tests/conftest.py +0 -0
  102. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/tests/test_ai_claude.py +0 -0
  103. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/tests/test_config.py +0 -0
  104. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/tests/test_discovery_qa.py +0 -0
  105. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/tests/test_results.py +0 -0
  106. {galangal_orchestrate-0.2.29 → galangal_orchestrate-0.6.3}/tests/test_tui.py +0 -0
@@ -0,0 +1,759 @@
1
+ Metadata-Version: 2.4
2
+ Name: galangal-orchestrate
3
+ Version: 0.6.3
4
+ Summary: AI-driven development workflow orchestrator
5
+ Project-URL: Homepage, https://github.com/Galangal-Media/galangal-orchestrate
6
+ Project-URL: Repository, https://github.com/Galangal-Media/galangal-orchestrate
7
+ Project-URL: Issues, https://github.com/Galangal-Media/galangal-orchestrate/issues
8
+ Author: Galangal Media
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: ai,claude,development,orchestrator,workflow
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Software Development
22
+ Classifier: Topic :: Software Development :: Quality Assurance
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: pydantic>=2.0.0
25
+ Requires-Dist: pyyaml>=6.0
26
+ Requires-Dist: rich>=13.0.0
27
+ Requires-Dist: structlog>=24.0.0
28
+ Requires-Dist: textual>=0.40.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: mypy>=1.0.0; extra == 'dev'
31
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
32
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
33
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
34
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # Galangal Orchestrate
38
+
39
+ **Turn AI coding assistants into structured development workflows.**
40
+
41
+ Galangal Orchestrate wraps [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI to execute a deterministic, multi-stage development pipeline. Instead of open-ended AI coding sessions, you get a structured workflow with approval gates, validation, and automatic rollback.
42
+
43
+ ## Why Use This?
44
+
45
+ When you ask an AI to "add user authentication", you get whatever the AI decides to build. With Galangal:
46
+
47
+ 1. **PM Stage** - AI writes requirements, you approve before any code is written
48
+ 2. **Design Stage** - AI proposes architecture, you approve the approach
49
+ 3. **Dev Stage** - AI implements according to approved specs
50
+ 4. **Test Stage** - AI writes tests, validation ensures they pass
51
+ 5. **QA Stage** - AI verifies requirements are met
52
+ 6. **Review Stage** - AI reviews its own code for issues
53
+ 7. **Docs Stage** - AI updates documentation
54
+
55
+ If anything fails, the workflow automatically rolls back to the appropriate fix point with context about what went wrong.
56
+
57
+ ## Requirements
58
+
59
+ - Python 3.10+
60
+ - [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) installed (`claude` command available)
61
+ - Claude Pro or Max subscription
62
+ - Git
63
+
64
+ ## Installation
65
+
66
+ ```bash
67
+ # With pip
68
+ pip install galangal-orchestrate
69
+
70
+ # With pipx (recommended for CLI tools)
71
+ pipx install galangal-orchestrate
72
+ ```
73
+
74
+ ## Quick Start
75
+
76
+ ```bash
77
+ # Initialize in your project
78
+ cd your-project
79
+ galangal init
80
+
81
+ # Start a task
82
+ galangal start "Add user authentication with JWT tokens"
83
+
84
+ # Resume after a break
85
+ galangal resume
86
+
87
+ # Check current status
88
+ galangal status
89
+ ```
90
+
91
+ ## Workflow Stages
92
+
93
+ | Stage | Purpose | Output |
94
+ |-------|---------|--------|
95
+ | **PM** | Requirements & planning | SPEC.md, PLAN.md, STAGE_PLAN.md |
96
+ | **DESIGN** | Architecture design | DESIGN.md |
97
+ | **PREFLIGHT** | Environment validation | PREFLIGHT_REPORT.md |
98
+ | **DEV** | Implementation | Code changes |
99
+ | **MIGRATION*** | Database migration checks | MIGRATION_REPORT.md |
100
+ | **TEST** | Test implementation | TEST_PLAN.md |
101
+ | **CONTRACT*** | API contract validation | CONTRACT_REPORT.md |
102
+ | **QA** | Quality assurance | QA_REPORT.md |
103
+ | **BENCHMARK*** | Performance validation | BENCHMARK_REPORT.md |
104
+ | **SECURITY** | Security review | SECURITY_CHECKLIST.md |
105
+ | **REVIEW** | Code review | REVIEW_NOTES.md |
106
+ | **DOCS** | Documentation | DOCS_REPORT.md |
107
+
108
+ *Conditional stages - skipped automatically if not relevant
109
+
110
+ ## Task Types
111
+
112
+ Choose the right workflow for your task:
113
+
114
+ | Type | Stages | When to Use |
115
+ |------|--------|-------------|
116
+ | **Feature** | All stages | New functionality |
117
+ | **Bug Fix** | PM → DEV → TEST → QA | Fixing bugs |
118
+ | **Refactor** | PM → DESIGN → DEV → TEST | Code restructuring |
119
+ | **Chore** | PM → DEV → TEST | Config, dependencies |
120
+ | **Docs** | PM → DOCS | Documentation only |
121
+ | **Hotfix** | PM → DEV → TEST | Critical fixes |
122
+
123
+ The PM stage can further customize which stages run based on task analysis.
124
+
125
+ ## Interactive Controls
126
+
127
+ During workflow execution:
128
+
129
+ | Key | Action | Description |
130
+ |-----|--------|-------------|
131
+ | `^Q` | Quit | Pause and exit (resume later with `galangal resume`) |
132
+ | `^I` | Interrupt | Stop current stage, give feedback, rollback to DEV |
133
+ | `^N` | Skip | Skip current stage, advance to next |
134
+ | `^B` | Back | Go back to previous stage |
135
+ | `^E` | Edit | Pause for manual editing, press Enter to resume |
136
+
137
+ ### Interrupt with Feedback (^I)
138
+
139
+ When you see the AI doing something wrong mid-stage:
140
+ 1. Press `^I` to interrupt immediately
141
+ 2. Enter feedback describing what needs to be fixed
142
+ 3. Workflow rolls back to DEV with your feedback as context
143
+ 4. A `ROLLBACK.md` artifact is created for the AI to reference
144
+
145
+ ### Manual Edit Pause (^E)
146
+
147
+ Need to make a quick fix yourself?
148
+ 1. Press `^E` to pause
149
+ 2. Make edits in your editor
150
+ 3. Press Enter to resume the current stage
151
+
152
+ ## PM-driven Stage Planning
153
+
154
+ After analyzing your task, the PM stage outputs a `STAGE_PLAN.md` recommending which optional stages to run or skip:
155
+
156
+ ```markdown
157
+ # Stage Plan
158
+
159
+ ## Recommendations
160
+ | Stage | Action | Reason |
161
+ |-------|--------|--------|
162
+ | MIGRATION | skip | No database changes detected |
163
+ | CONTRACT | skip | Internal refactor, no API changes |
164
+ | SECURITY | run | Handling user authentication input |
165
+ | BENCHMARK | skip | UI-only changes, no performance impact |
166
+ ```
167
+
168
+ The progress bar updates dynamically to show only relevant stages.
169
+
170
+ ## Commands
171
+
172
+ | Command | Description |
173
+ |---------|-------------|
174
+ | `galangal init` | Initialize in current project |
175
+ | `galangal start "desc"` | Start new task |
176
+ | `galangal list` | List all tasks |
177
+ | `galangal switch <name>` | Switch active task |
178
+ | `galangal status` | Show task status |
179
+ | `galangal resume` | Continue active task |
180
+ | `galangal pause` | Pause for break |
181
+ | `galangal approve` | Approve plan |
182
+ | `galangal approve-design` | Approve design |
183
+ | `galangal skip-design` | Skip design stage |
184
+ | `galangal skip-to <stage>` | Jump to stage |
185
+ | `galangal complete` | Finalize & create PR |
186
+ | `galangal reset` | Delete active task |
187
+ | `galangal github setup` | Set up GitHub integration |
188
+ | `galangal github issues` | List galangal-labeled issues |
189
+ | `galangal github run` | Process issues automatically |
190
+
191
+ ## GitHub Integration
192
+
193
+ Galangal can create tasks directly from GitHub issues, automatically downloading screenshots and inferring task types from labels.
194
+
195
+ ### Quick Setup
196
+
197
+ ```bash
198
+ # 1. Install GitHub CLI (if not already installed)
199
+ # macOS:
200
+ brew install gh
201
+
202
+ # Windows:
203
+ winget install GitHub.cli
204
+
205
+ # Linux: See https://cli.github.com
206
+
207
+ # 2. Authenticate
208
+ gh auth login
209
+
210
+ # 3. Set up GitHub integration (creates labels)
211
+ galangal github setup
212
+ ```
213
+
214
+ ### How It Works
215
+
216
+ 1. Add the `galangal` label to any GitHub issue you want to work on
217
+ 2. Run `galangal start` and select "GitHub issue" as the task source
218
+ 3. Galangal will:
219
+ - Download any screenshots from the issue body
220
+ - Infer the task type from issue labels
221
+ - Create a task linked to the issue
222
+ - Mark the issue as "in-progress"
223
+
224
+ When you complete the task with `galangal complete`, a PR is created that automatically closes the linked issue.
225
+
226
+ ### Batch Processing
227
+
228
+ Process all galangal-labeled issues automatically:
229
+
230
+ ```bash
231
+ # List issues that would be processed
232
+ galangal github run --dry-run
233
+
234
+ # Process all issues headlessly
235
+ galangal github run
236
+ ```
237
+
238
+ ### Issue Screenshots
239
+
240
+ Screenshots embedded in GitHub issues (using `![](url)` syntax) are automatically:
241
+ - Downloaded to `galangal-tasks/<task>/screenshots/`
242
+ - Passed to the AI during PM, Design, and Dev stages
243
+ - Available for the AI to view using Claude's Read tool
244
+
245
+ This is especially useful for bug reports with screenshots or design mockups.
246
+
247
+ ### Label Configuration
248
+
249
+ Galangal maps GitHub labels to task types. The defaults are:
250
+
251
+ | Task Type | Labels |
252
+ |-----------|--------|
253
+ | bug_fix | `bug`, `bugfix` |
254
+ | feature | `enhancement`, `feature` |
255
+ | docs | `documentation`, `docs` |
256
+ | refactor | `refactor` |
257
+ | chore | `chore`, `maintenance` |
258
+ | hotfix | `hotfix`, `critical` |
259
+
260
+ Customize in `.galangal/config.yaml`:
261
+
262
+ ```yaml
263
+ github:
264
+ # Label that triggers galangal to pick up issues
265
+ pickup_label: galangal
266
+
267
+ # Label added when work starts
268
+ in_progress_label: in-progress
269
+
270
+ # Custom label colors (hex without #)
271
+ label_colors:
272
+ galangal: "7C3AED"
273
+ in-progress: "FCD34D"
274
+
275
+ # Map your labels to task types
276
+ label_mapping:
277
+ bug:
278
+ - bug
279
+ - bugfix
280
+ - defect # Add your custom labels
281
+ feature:
282
+ - enhancement
283
+ - feature
284
+ - new-feature
285
+ docs:
286
+ - documentation
287
+ - docs
288
+ refactor:
289
+ - refactor
290
+ - tech-debt
291
+ chore:
292
+ - chore
293
+ - maintenance
294
+ - dependencies
295
+ hotfix:
296
+ - hotfix
297
+ - critical
298
+ - urgent
299
+ ```
300
+
301
+ ### GitHub Commands
302
+
303
+ | Command | Description |
304
+ |---------|-------------|
305
+ | `galangal github setup` | Create required labels, show setup instructions |
306
+ | `galangal github setup --help-install` | Show detailed gh CLI installation instructions |
307
+ | `galangal github check` | Verify gh CLI installation and authentication |
308
+ | `galangal github issues` | List issues with galangal label |
309
+ | `galangal github issues --label <name>` | List issues with custom label |
310
+ | `galangal github run` | Process all labeled issues headlessly |
311
+ | `galangal github run --dry-run` | Preview without processing |
312
+
313
+ ## Configuration
314
+
315
+ After `galangal init`, customize `.galangal/config.yaml`. Here's a complete reference:
316
+
317
+ ```yaml
318
+ # =============================================================================
319
+ # PROJECT CONFIGURATION
320
+ # =============================================================================
321
+ project:
322
+ # Project name (displayed in logs and prompts)
323
+ name: "My Project"
324
+
325
+ # Default approver name for plan/design approvals (auto-fills signoff prompts)
326
+ approver_name: "Jane Smith"
327
+
328
+ # Technology stacks in your project
329
+ # Helps AI understand your codebase structure
330
+ stacks:
331
+ - language: python
332
+ framework: fastapi # Optional: framework name
333
+ root: backend/ # Optional: subdirectory for this stack
334
+ - language: typescript
335
+ framework: vite
336
+ root: frontend/
337
+
338
+ # =============================================================================
339
+ # TASK STORAGE
340
+ # =============================================================================
341
+ # Directory where task state and artifacts are stored
342
+ tasks_dir: galangal-tasks
343
+
344
+ # Git branch naming pattern ({task_name} is replaced with sanitized task name)
345
+ branch_pattern: "task/{task_name}"
346
+
347
+ # =============================================================================
348
+ # STAGE CONFIGURATION
349
+ # =============================================================================
350
+ stages:
351
+ # Stages to always skip (regardless of task type or PM recommendations)
352
+ skip:
353
+ - BENCHMARK
354
+ - CONTRACT
355
+
356
+ # Default timeout for each stage in seconds (4 hours default)
357
+ timeout: 14400
358
+
359
+ # Maximum retries per stage before rollback (default: 5)
360
+ max_retries: 5
361
+
362
+ # =============================================================================
363
+ # VALIDATION CONFIGURATION
364
+ # Each stage can have validation commands, checks, and skip conditions
365
+ # =============================================================================
366
+ validation:
367
+ # Preflight checks run before DEV stage
368
+ preflight:
369
+ timeout: 300 # Timeout for each check in seconds
370
+ checks:
371
+ - name: "Git status clean"
372
+ command: "git status --porcelain"
373
+ expect_empty: true # Pass if output is empty
374
+ warn_only: false # If true, warn but don't fail
375
+ - name: "Node modules exist"
376
+ path_exists: "node_modules" # Check if path exists
377
+ - name: "Dependencies installed"
378
+ command: "npm ls --depth=0"
379
+ warn_only: true
380
+
381
+ # Migration stage validation
382
+ migration:
383
+ # Skip if no migration files changed
384
+ skip_if:
385
+ no_files_match:
386
+ - "migrations/**"
387
+ - "**/migrations/**"
388
+ - "alembic/**"
389
+ timeout: 600
390
+ commands:
391
+ - name: "Run migrations"
392
+ command: "python manage.py migrate --check"
393
+ timeout: 300 # Override timeout for this command
394
+ optional: false # If true, don't fail if command fails
395
+ allow_failure: false # If true, report but don't block
396
+
397
+ # Test stage validation
398
+ test:
399
+ timeout: 600
400
+ commands:
401
+ - name: "Unit tests"
402
+ command: "pytest tests/unit"
403
+ - name: "Integration tests"
404
+ command: "pytest tests/integration"
405
+ optional: true # Don't fail if integration tests missing
406
+
407
+ # Contract stage (API compatibility)
408
+ contract:
409
+ skip_if:
410
+ no_files_match: "openapi.yaml"
411
+ timeout: 300
412
+ commands:
413
+ - name: "Validate OpenAPI spec"
414
+ command: "openapi-spec-validator openapi.yaml"
415
+
416
+ # QA stage validation
417
+ qa:
418
+ timeout: 3600
419
+ commands:
420
+ - name: "Lint"
421
+ command: "./scripts/lint.sh"
422
+ timeout: 600
423
+ - name: "Type check"
424
+ command: "mypy src/"
425
+ timeout: 600
426
+ # Marker-based validation (for AI output verification)
427
+ artifact: "QA_REPORT.md"
428
+ pass_marker: "## PASS"
429
+ fail_marker: "## FAIL"
430
+
431
+ # Security stage validation
432
+ security:
433
+ timeout: 1800
434
+ commands:
435
+ - name: "Security scan"
436
+ command: "bandit -r src/"
437
+ allow_failure: true # Report issues but don't block
438
+ artifacts_required:
439
+ - "SECURITY_CHECKLIST.md"
440
+
441
+ # Review stage validation
442
+ review:
443
+ timeout: 1800
444
+ artifact: "REVIEW_NOTES.md"
445
+ pass_marker: "APPROVED"
446
+ fail_marker: "REJECTED"
447
+
448
+ # Docs stage validation
449
+ docs:
450
+ timeout: 900
451
+ artifacts_required:
452
+ - "DOCS_REPORT.md"
453
+
454
+ # =============================================================================
455
+ # AI BACKEND CONFIGURATION
456
+ # =============================================================================
457
+ ai:
458
+ # Default backend to use
459
+ default: claude
460
+
461
+ # Available backends
462
+ backends:
463
+ claude:
464
+ command: claude
465
+ args:
466
+ - "-p"
467
+ - "{prompt}"
468
+ - "--output-format"
469
+ - "stream-json"
470
+ - "--verbose"
471
+ max_turns: 200 # Maximum conversation turns per stage
472
+
473
+ # Use different backends for specific stages
474
+ stage_backends:
475
+ # qa: gemini # Use Gemini for QA stage (when supported)
476
+
477
+ # =============================================================================
478
+ # DOCUMENTATION CONFIGURATION
479
+ # =============================================================================
480
+ docs:
481
+ # Directory for changelog entries
482
+ changelog_dir: docs/changelog
483
+
484
+ # Directory for security audit reports
485
+ security_audit: docs/security
486
+
487
+ # Directory for general documentation
488
+ general: docs
489
+
490
+ # Toggle documentation updates
491
+ update_changelog: true # Update changelog in DOCS stage
492
+ update_security_audit: true # Create security reports in SECURITY stage
493
+ update_general_docs: true # Update general docs in DOCS stage
494
+
495
+ # =============================================================================
496
+ # PULL REQUEST CONFIGURATION
497
+ # =============================================================================
498
+ pr:
499
+ # Base branch for PRs (e.g., main, develop)
500
+ base_branch: main
501
+
502
+ # Add @codex review to PR body for automated review
503
+ codex_review: false
504
+
505
+ # =============================================================================
506
+ # STRUCTURED LOGGING
507
+ # =============================================================================
508
+ logging:
509
+ # Enable structured logging to file
510
+ enabled: true
511
+
512
+ # Log level: debug, info, warning, error
513
+ level: info
514
+
515
+ # Log file path (JSON Lines format for easy parsing)
516
+ file: logs/galangal.jsonl
517
+
518
+ # Output format: true for JSON, false for pretty console format
519
+ json_format: true
520
+
521
+ # Also output to console (stderr)
522
+ console: false
523
+
524
+ # =============================================================================
525
+ # TASK TYPE SETTINGS
526
+ # Per-task-type overrides
527
+ # =============================================================================
528
+ task_type_settings:
529
+ bugfix:
530
+ skip_discovery: true # Skip the PM discovery Q&A for bugfixes
531
+ hotfix:
532
+ skip_discovery: true
533
+
534
+ # =============================================================================
535
+ # PROMPT CONTEXT
536
+ # Additional context injected into AI prompts
537
+ # =============================================================================
538
+
539
+ # Global context added to ALL stage prompts
540
+ prompt_context: |
541
+ ## Project Conventions
542
+ - Use repository pattern for data access
543
+ - API responses use api_success() / api_error() helpers
544
+ - All errors should be logged with context
545
+
546
+ ## Testing Standards
547
+ - Unit tests go in tests/unit/
548
+ - Integration tests go in tests/integration/
549
+ - Use pytest fixtures for test data
550
+
551
+ # Per-stage context (merged with global context)
552
+ stage_context:
553
+ dev: |
554
+ ## Development Environment
555
+ - Run `npm run dev` for hot reload
556
+ - Database: PostgreSQL on localhost:5432
557
+ - Redis: localhost:6379
558
+
559
+ test: |
560
+ ## Test Setup
561
+ - Use vitest for frontend unit tests
562
+ - Use pytest for backend tests
563
+ - Mock external APIs in tests
564
+
565
+ security: |
566
+ ## Security Requirements
567
+ - All user input must be validated
568
+ - Use parameterized queries (no raw SQL)
569
+ - Secrets must use environment variables
570
+ ```
571
+
572
+ ## Customizing Prompts
573
+
574
+ Galangal uses a layered prompt system:
575
+
576
+ 1. **Base prompts** - Built-in, language-agnostic prompts
577
+ 2. **Project prompts** - Your customizations in `.galangal/prompts/`
578
+
579
+ ### Supplement Mode (Recommended)
580
+
581
+ Add project-specific content that gets prepended to the base prompt:
582
+
583
+ ```markdown
584
+ <!-- .galangal/prompts/dev.md -->
585
+
586
+ ## Project CLI Scripts
587
+
588
+ - `./scripts/test.sh` - Run all tests
589
+ - `./scripts/lint.sh` - Run linter
590
+
591
+ ## Patterns to Follow
592
+
593
+ - Always use `api_success()` for responses
594
+ - Never use raw SQL queries
595
+
596
+ # BASE
597
+ ```
598
+
599
+ The `# BASE` marker inserts the default prompt at that location.
600
+
601
+ ### Override Mode
602
+
603
+ To completely replace a base prompt, omit the `# BASE` marker:
604
+
605
+ ```markdown
606
+ <!-- .galangal/prompts/preflight.md -->
607
+
608
+ # Custom Preflight
609
+
610
+ This completely replaces the default preflight prompt.
611
+
612
+ [Your custom instructions...]
613
+ ```
614
+
615
+ ### Available Prompt Files
616
+
617
+ Create any of these in `.galangal/prompts/`:
618
+
619
+ | File | Stage |
620
+ |------|-------|
621
+ | `pm.md` | Requirements & planning |
622
+ | `design.md` | Architecture design |
623
+ | `preflight.md` | Environment checks |
624
+ | `dev.md` | Implementation |
625
+ | `test.md` | Test writing |
626
+ | `qa.md` | Quality assurance |
627
+ | `security.md` | Security review |
628
+ | `review.md` | Code review |
629
+ | `docs.md` | Documentation |
630
+
631
+ ## Troubleshooting
632
+
633
+ ### Debug Mode
634
+
635
+ When something goes wrong and you need to see what happened:
636
+
637
+ ```bash
638
+ # Enable debug logging (writes to logs/galangal_debug.log)
639
+ galangal --debug start "task description"
640
+ galangal --debug resume
641
+
642
+ # Alternative: set environment variable
643
+ GALANGAL_DEBUG=1 galangal start "task description"
644
+ ```
645
+
646
+ Debug mode creates two log files:
647
+ - `logs/galangal_debug.log` - Human-readable debug trace with timestamps
648
+ - `logs/galangal.jsonl` - Structured JSON logs for programmatic analysis
649
+
650
+ **Example debug log:**
651
+ ```
652
+ [14:32:15.123] GitHub integration failed: HTTPError: 401 Unauthorized
653
+ [14:32:15.124] Traceback:
654
+ File "/path/to/start.py", line 138, in task_creation_thread
655
+ check = ensure_github_ready()
656
+ ...
657
+ ```
658
+
659
+ ### Structured Logging Configuration
660
+
661
+ Enable structured logging in `.galangal/config.yaml`:
662
+
663
+ ```yaml
664
+ logging:
665
+ enabled: true # Enable logging
666
+ level: debug # debug, info, warning, error
667
+ file: logs/galangal.jsonl
668
+ json_format: true # JSON for parsing, false for console format
669
+ console: false # Also output to stderr
670
+ ```
671
+
672
+ ### Tests Hang at TEST Stage
673
+
674
+ Test frameworks must run non-interactively. Common issues:
675
+
676
+ **Playwright** - HTML reporter blocks by default:
677
+ ```bash
678
+ # Use non-blocking reporter
679
+ npx playwright test --reporter=list
680
+
681
+ # Or set environment variable
682
+ PLAYWRIGHT_HTML_OPEN=never npx playwright test
683
+
684
+ # Or in playwright.config.ts:
685
+ # reporter: [['html', { open: 'never' }]]
686
+ ```
687
+
688
+ **Jest/Vitest** - Watch mode blocks:
689
+ ```bash
690
+ # Wrong (blocks):
691
+ npm test -- --watch
692
+
693
+ # Correct:
694
+ npm test
695
+ ```
696
+
697
+ **Cypress** - Interactive mode blocks:
698
+ ```bash
699
+ # Wrong (blocks):
700
+ cypress open
701
+
702
+ # Correct:
703
+ cypress run
704
+ ```
705
+
706
+ **General rule**: Use CI-friendly commands that exit automatically. Avoid watch mode, interactive mode, or any GUI that waits for user input.
707
+
708
+ ### TEST Stage Loops Indefinitely
709
+
710
+ If the TEST stage keeps retrying instead of rolling back to DEV:
711
+ 1. Ensure your TEST_PLAN.md has a clear `**Status:** PASS` or `**Status:** FAIL` line
712
+ 2. If tests fail due to implementation bugs, the AI should report FAIL (not try to fix the code)
713
+ 3. Check that test commands exit with proper exit codes (0 for success, non-zero for failure)
714
+
715
+ ### "Galangal has not been initialized" Error
716
+
717
+ Run `galangal init` in your project root before using other commands.
718
+
719
+ ### Task Exits Without Error Message
720
+
721
+ If a task quits unexpectedly with no visible error:
722
+
723
+ 1. **Enable debug mode** and re-run:
724
+ ```bash
725
+ galangal --debug start "your task"
726
+ ```
727
+
728
+ 2. **Check the debug log** for the actual error:
729
+ ```bash
730
+ tail -50 logs/galangal_debug.log
731
+ ```
732
+
733
+ 3. **Common causes**:
734
+ - GitHub authentication failed (run `gh auth status`)
735
+ - Network timeout fetching issues
736
+ - Missing permissions for the repository
737
+ - Invalid issue number or no issues with `galangal` label
738
+
739
+ ### GitHub Integration Fails Silently
740
+
741
+ If `galangal start` from a GitHub issue exits without creating a task:
742
+
743
+ ```bash
744
+ # Check GitHub CLI is working
745
+ gh auth status
746
+ gh repo view
747
+
748
+ # Try with debug mode
749
+ galangal --debug start --issue 123
750
+ ```
751
+
752
+ Check `logs/galangal_debug.log` for specific errors like:
753
+ - `401 Unauthorized` - Re-authenticate with `gh auth login`
754
+ - `404 Not Found` - Issue doesn't exist or wrong repo
755
+ - `No issues with 'galangal' label` - Add the label to an issue first
756
+
757
+ ## License
758
+
759
+ MIT License - see LICENSE file.