devflow-toolkit 0.3.14__tar.gz → 0.3.15__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 (78) hide show
  1. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/CHANGELOG.md +27 -0
  2. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/PKG-INFO +34 -11
  3. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/README.md +33 -10
  4. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/pyproject.toml +1 -1
  5. devflow_toolkit-0.3.15/src/devflow/adapters/antigravity.py +282 -0
  6. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/adapters/opencode.py +18 -3
  7. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/adapters/registry.py +2 -0
  8. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/cli.py +1 -1
  9. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/commands/approve.py +1 -1
  10. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/commands/harness.py +2 -1
  11. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/commands/init.py +2 -1
  12. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/commands/spec.py +1 -1
  13. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/config.py +4 -0
  14. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/spec_workflow.py +1 -0
  15. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/prompts/__init__.py +32 -0
  16. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/prompts/discovery.md +1 -1
  17. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/tests/test_harness_adapters.py +119 -1
  18. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/.gitignore +0 -0
  19. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/LICENSE +0 -0
  20. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/__init__.py +0 -0
  21. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/adapters/__init__.py +0 -0
  22. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/adapters/agents.py +0 -0
  23. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/adapters/base.py +0 -0
  24. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/adapters/claude_code.py +0 -0
  25. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/adapters/codex.py +0 -0
  26. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/adapters/detector.py +0 -0
  27. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/adapters/instructions.py +0 -0
  28. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/adapters/kiro.py +0 -0
  29. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/commands/__init__.py +0 -0
  30. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/commands/doctor.py +0 -0
  31. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/commands/recover.py +0 -0
  32. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/commands/status.py +0 -0
  33. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/__init__.py +0 -0
  34. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/architecture.py +0 -0
  35. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/artifacts/__init__.py +0 -0
  36. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/artifacts/errors.py +0 -0
  37. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/artifacts/models.py +0 -0
  38. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/artifacts/store.py +0 -0
  39. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/clock.py +0 -0
  40. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/constitution.py +0 -0
  41. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/discovery.py +0 -0
  42. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/ports.py +0 -0
  43. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/profile_manager.py +0 -0
  44. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/project.py +0 -0
  45. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/recovery.py +0 -0
  46. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/specification.py +0 -0
  47. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/state/__init__.py +0 -0
  48. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/state/errors.py +0 -0
  49. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/state/events.py +0 -0
  50. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/state/locator.py +0 -0
  51. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/state/lock.py +0 -0
  52. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/state/manager.py +0 -0
  53. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/state/models.py +0 -0
  54. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/core/state/transitions.py +0 -0
  55. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/models/__init__.py +0 -0
  56. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/models/profile.py +0 -0
  57. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/models/project.py +0 -0
  58. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/profiles/ai-rag/constitution/ai-rag-standards.md +0 -0
  59. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/profiles/ai-rag/profile.yaml +0 -0
  60. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/profiles/base/constitution/architecture.md +0 -0
  61. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/profiles/base/constitution/code-standards.md +0 -0
  62. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/profiles/base/constitution/constitution.md +0 -0
  63. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/profiles/base/profile.yaml +0 -0
  64. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/profiles/django-backend/constitution/django-standards.md +0 -0
  65. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/profiles/django-backend/profile.yaml +0 -0
  66. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/profiles/fastapi-backend/constitution/fastapi-standards.md +0 -0
  67. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/profiles/fastapi-backend/profile.yaml +0 -0
  68. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/prompts/spec.greenfield.md +0 -0
  69. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/src/devflow/prompts/spec.md +0 -0
  70. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/tests/test_cli.py +0 -0
  71. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/tests/test_discovery.py +0 -0
  72. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/tests/test_event_log.py +0 -0
  73. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/tests/test_greenfield.py +0 -0
  74. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/tests/test_hardening.py +0 -0
  75. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/tests/test_recovery.py +0 -0
  76. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/tests/test_spec_workflow.py +0 -0
  77. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/tests/test_state.py +0 -0
  78. {devflow_toolkit-0.3.14 → devflow_toolkit-0.3.15}/tests/test_state_replay.py +0 -0
@@ -2,6 +2,33 @@
2
2
 
3
3
  All notable changes to DevFlow Toolkit are documented in this file.
4
4
 
5
+ ## 0.3.15 - 2026-11-05
6
+
7
+ ### Added
8
+
9
+ - Google Antigravity (`agy`) is now a supported harness. `devflow init
10
+ --harness antigravity` generates `AGENTS.md` and the custom agents
11
+ `.agents/agents/devflow-spec.md` and
12
+ `.agents/agents/devflow-spec-readonly.md`, and adds them to the
13
+ managed `.gitignore` block. Interactive runs use the writable agent
14
+ with `ask_question` enabled; non-interactive runs use the read-only
15
+ agent in print mode.
16
+ - Antigravity permissions scope project reads and `.devflow/specs`
17
+ writes, and deny commands, web access and MCP servers. The inline
18
+ `--settings` payload also trusts the project workspace so the CLI does
19
+ not stop at the trust prompt.
20
+
21
+ ### Changed
22
+
23
+ - Interactive OpenCode Discovery now explicitly tells the generated
24
+ `devflow-spec` agent to call the `question` tool for every pending
25
+ question and every assumption acceptance instead of asking in
26
+ free-form prose.
27
+ - The Discovery prompt names the structured question tool for OpenCode
28
+ (`question`) and Antigravity (`ask_question`). Codex and Claude Code
29
+ prompt text is unchanged.
30
+ - Package version is `0.3.15`.
31
+
5
32
  ## 0.3.14 - 2026-11-05
6
33
 
7
34
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: devflow-toolkit
3
- Version: 0.3.14
3
+ Version: 0.3.15
4
4
  Summary: Specification workflow toolkit for AI-assisted software changes
5
5
  Author: DevFlow contributors
6
6
  License-Expression: MIT
@@ -42,7 +42,7 @@ anyone starts implementing it. DevFlow owns the workflow state; the
42
42
  selected agent harness is only the execution backend that drafts the
43
43
  specification.
44
44
 
45
- This is the `0.3.14` MVP. It implements the **discovery and
45
+ This is the `0.3.15` MVP. It implements the **discovery and
46
46
  specification stages only**. It supports two specification contexts:
47
47
  **Existing Project** (the default) and **Greenfield**. It is not a
48
48
  complete SDD platform and does not include planning, implementation or
@@ -101,9 +101,10 @@ identity for the project:
101
101
  - A POSIX operating system (Linux or macOS). Windows is not tested and is
102
102
  not supported in this release, because the workflow locks require
103
103
  `fcntl`.
104
- - For agent-generated specifications: OpenCode installed and
105
- authenticated on `PATH`. OpenCode is the only harness verified
106
- end-to-end for this release.
104
+ - For agent-generated specifications: OpenCode or Google Antigravity
105
+ (`agy`) installed and authenticated on `PATH`. OpenCode is verified
106
+ end-to-end; Antigravity agent loading and print mode are verified
107
+ locally.
107
108
  - Git is not required. DevFlow does not initialize a repository, commit
108
109
  files or run destructive commands.
109
110
 
@@ -118,7 +119,7 @@ pip install devflow-toolkit
118
119
  To install a specific built artifact instead:
119
120
 
120
121
  ```bash
121
- pip install devflow_toolkit-0.3.14-py3-none-any.whl
122
+ pip install devflow_toolkit-0.3.15-py3-none-any.whl
122
123
  ```
123
124
 
124
125
  Verify the installation:
@@ -155,6 +156,7 @@ Common options:
155
156
 
156
157
  ```bash
157
158
  devflow init --harness opencode --mode non-interactive
159
+ devflow init --harness antigravity --mode interactive
158
160
  devflow init --profile django-backend --name my-service
159
161
  devflow init --project-mode greenfield
160
162
  devflow init --language es
@@ -297,9 +299,10 @@ as an architectural constraint when it is present.
297
299
 
298
300
  ### Harnesses
299
301
 
300
- | Harness | Status in 0.3.14 |
302
+ | Harness | Status in 0.3.15 |
301
303
  | --- | --- |
302
- | OpenCode | Verified end-to-end in non-interactive mode |
304
+ | OpenCode | Verified end-to-end; interactive Discovery uses the `question` tool |
305
+ | Antigravity | Custom agents and scoped permissions generated; `agy` loading and print mode verified |
303
306
  | Codex | Integration files are generated, but not verified for this release |
304
307
  | Claude Code | Integration files are generated, but not verified for this release |
305
308
  | Kiro | Integration files are generated, but not verified for this release |
@@ -316,6 +319,26 @@ its native `AskUserQuestion` dialog. Both adapters fall back to numbered
316
319
  text options if the installed harness does not expose a structured
317
320
  question tool.
318
321
 
322
+ OpenCode and Antigravity receive an explicit instruction to call their
323
+ structured question tool for every pending Discovery question and for
324
+ every assumption acceptance. OpenCode's tool is `question`; Antigravity's
325
+ tool is `ask_question`. The instruction is injected only for those
326
+ harnesses, so the Codex and Claude Code prompts are unchanged.
327
+
328
+ For Antigravity, DevFlow generates `AGENTS.md` and custom agents under
329
+ `.agents/agents/`. Interactive runs use the writable `devflow-spec`
330
+ agent with `agy --settings <json> --agent devflow-spec
331
+ --prompt-interactive <prompt>`. Non-interactive runs use the read-only
332
+ `devflow-spec-readonly` agent with `agy --settings <json> --agent
333
+ devflow-spec-readonly --print --output-format text <prompt>`. Project
334
+ reads are allowed, writes are scoped to `.devflow/specs` in interactive
335
+ mode, and commands, web access and MCP servers are denied. The alias
336
+ `agy` is accepted for `--harness`.
337
+
338
+ To configure Discovery in Spanish, pass `--language es` to `init`, or to
339
+ a single `spec` run. The conversation and the stored question text use
340
+ the selected language.
341
+
319
342
  For OpenCode, DevFlow generates `AGENTS.md`, `opencode.json` and the
320
343
  agents under `.opencode/agents/`. The project-level `opencode.json` can
321
344
  also select the model used by the agent, for example:
@@ -480,7 +503,7 @@ specification that still lists open questions.
480
503
  8. If artifacts exist without workflow state, diagnose with
481
504
  `devflow doctor <id>` and repair with `devflow recover <id>`.
482
505
 
483
- Available commands in `0.3.14`:
506
+ Available commands in `0.3.15`:
484
507
 
485
508
  | Command | Status |
486
509
  | --- | --- |
@@ -672,7 +695,7 @@ devflow approve 001 --stage spec
672
695
  ```
673
696
 
674
697
  Approval is explicit and binds the decision to the current artifact
675
- digests. For a `0.3.14` change it binds `spec.md`, `discovery.yaml` and,
698
+ digests. For a `0.3.15` change it binds `spec.md`, `discovery.yaml` and,
676
699
  when a manifest applies, the architecture manifest digest. Repeating the
677
700
  same approval is a no-op. If an artifact changes after validation,
678
701
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -683,7 +706,7 @@ and names the pending questions and assumptions. Approval also rejects a
683
706
  specification whose section 7 still lists open questions. Legacy `0.2.0`
684
707
  changes without `discovery.yaml` remain approvable with a warning.
685
708
 
686
- Only the `spec` stage is available in `0.3.14`. `--stage plan` and
709
+ Only the `spec` stage is available in `0.3.15`. `--stage plan` and
687
710
  `--stage review` are rejected. There are no `plan`, `implement` or
688
711
  `review` commands in this release.
689
712
 
@@ -10,7 +10,7 @@ anyone starts implementing it. DevFlow owns the workflow state; the
10
10
  selected agent harness is only the execution backend that drafts the
11
11
  specification.
12
12
 
13
- This is the `0.3.14` MVP. It implements the **discovery and
13
+ This is the `0.3.15` MVP. It implements the **discovery and
14
14
  specification stages only**. It supports two specification contexts:
15
15
  **Existing Project** (the default) and **Greenfield**. It is not a
16
16
  complete SDD platform and does not include planning, implementation or
@@ -69,9 +69,10 @@ identity for the project:
69
69
  - A POSIX operating system (Linux or macOS). Windows is not tested and is
70
70
  not supported in this release, because the workflow locks require
71
71
  `fcntl`.
72
- - For agent-generated specifications: OpenCode installed and
73
- authenticated on `PATH`. OpenCode is the only harness verified
74
- end-to-end for this release.
72
+ - For agent-generated specifications: OpenCode or Google Antigravity
73
+ (`agy`) installed and authenticated on `PATH`. OpenCode is verified
74
+ end-to-end; Antigravity agent loading and print mode are verified
75
+ locally.
75
76
  - Git is not required. DevFlow does not initialize a repository, commit
76
77
  files or run destructive commands.
77
78
 
@@ -86,7 +87,7 @@ pip install devflow-toolkit
86
87
  To install a specific built artifact instead:
87
88
 
88
89
  ```bash
89
- pip install devflow_toolkit-0.3.14-py3-none-any.whl
90
+ pip install devflow_toolkit-0.3.15-py3-none-any.whl
90
91
  ```
91
92
 
92
93
  Verify the installation:
@@ -123,6 +124,7 @@ Common options:
123
124
 
124
125
  ```bash
125
126
  devflow init --harness opencode --mode non-interactive
127
+ devflow init --harness antigravity --mode interactive
126
128
  devflow init --profile django-backend --name my-service
127
129
  devflow init --project-mode greenfield
128
130
  devflow init --language es
@@ -265,9 +267,10 @@ as an architectural constraint when it is present.
265
267
 
266
268
  ### Harnesses
267
269
 
268
- | Harness | Status in 0.3.14 |
270
+ | Harness | Status in 0.3.15 |
269
271
  | --- | --- |
270
- | OpenCode | Verified end-to-end in non-interactive mode |
272
+ | OpenCode | Verified end-to-end; interactive Discovery uses the `question` tool |
273
+ | Antigravity | Custom agents and scoped permissions generated; `agy` loading and print mode verified |
271
274
  | Codex | Integration files are generated, but not verified for this release |
272
275
  | Claude Code | Integration files are generated, but not verified for this release |
273
276
  | Kiro | Integration files are generated, but not verified for this release |
@@ -284,6 +287,26 @@ its native `AskUserQuestion` dialog. Both adapters fall back to numbered
284
287
  text options if the installed harness does not expose a structured
285
288
  question tool.
286
289
 
290
+ OpenCode and Antigravity receive an explicit instruction to call their
291
+ structured question tool for every pending Discovery question and for
292
+ every assumption acceptance. OpenCode's tool is `question`; Antigravity's
293
+ tool is `ask_question`. The instruction is injected only for those
294
+ harnesses, so the Codex and Claude Code prompts are unchanged.
295
+
296
+ For Antigravity, DevFlow generates `AGENTS.md` and custom agents under
297
+ `.agents/agents/`. Interactive runs use the writable `devflow-spec`
298
+ agent with `agy --settings <json> --agent devflow-spec
299
+ --prompt-interactive <prompt>`. Non-interactive runs use the read-only
300
+ `devflow-spec-readonly` agent with `agy --settings <json> --agent
301
+ devflow-spec-readonly --print --output-format text <prompt>`. Project
302
+ reads are allowed, writes are scoped to `.devflow/specs` in interactive
303
+ mode, and commands, web access and MCP servers are denied. The alias
304
+ `agy` is accepted for `--harness`.
305
+
306
+ To configure Discovery in Spanish, pass `--language es` to `init`, or to
307
+ a single `spec` run. The conversation and the stored question text use
308
+ the selected language.
309
+
287
310
  For OpenCode, DevFlow generates `AGENTS.md`, `opencode.json` and the
288
311
  agents under `.opencode/agents/`. The project-level `opencode.json` can
289
312
  also select the model used by the agent, for example:
@@ -448,7 +471,7 @@ specification that still lists open questions.
448
471
  8. If artifacts exist without workflow state, diagnose with
449
472
  `devflow doctor <id>` and repair with `devflow recover <id>`.
450
473
 
451
- Available commands in `0.3.14`:
474
+ Available commands in `0.3.15`:
452
475
 
453
476
  | Command | Status |
454
477
  | --- | --- |
@@ -640,7 +663,7 @@ devflow approve 001 --stage spec
640
663
  ```
641
664
 
642
665
  Approval is explicit and binds the decision to the current artifact
643
- digests. For a `0.3.14` change it binds `spec.md`, `discovery.yaml` and,
666
+ digests. For a `0.3.15` change it binds `spec.md`, `discovery.yaml` and,
644
667
  when a manifest applies, the architecture manifest digest. Repeating the
645
668
  same approval is a no-op. If an artifact changes after validation,
646
669
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -651,7 +674,7 @@ and names the pending questions and assumptions. Approval also rejects a
651
674
  specification whose section 7 still lists open questions. Legacy `0.2.0`
652
675
  changes without `discovery.yaml` remain approvable with a warning.
653
676
 
654
- Only the `spec` stage is available in `0.3.14`. `--stage plan` and
677
+ Only the `spec` stage is available in `0.3.15`. `--stage plan` and
655
678
  `--stage review` are rejected. There are no `plan`, `implement` or
656
679
  `review` commands in this release.
657
680
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "devflow-toolkit"
7
- version = "0.3.14"
7
+ version = "0.3.15"
8
8
  description = "Specification workflow toolkit for AI-assisted software changes"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -0,0 +1,282 @@
1
+ """Google Antigravity (``agy``) harness adapter."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ from pathlib import Path
7
+ from typing import Any
8
+
9
+ import yaml
10
+
11
+ from devflow.adapters.base import (
12
+ FileChange,
13
+ HarnessAdapter,
14
+ Invocation,
15
+ RunContext,
16
+ SetupContext,
17
+ SetupResult,
18
+ )
19
+ from devflow.adapters.instructions import (
20
+ MANAGED_MARKER,
21
+ render_agent_instructions,
22
+ write_gitignore_entries,
23
+ write_text_managed,
24
+ )
25
+
26
+ INTERACTIVE_AGENT = "devflow-spec"
27
+ READONLY_AGENT = "devflow-spec-readonly"
28
+
29
+ _READ_TOOLS = ["read_file"]
30
+ _WRITE_TOOLS = ["write_file"]
31
+ _QUESTION_TOOLS = ["ask_question"]
32
+
33
+
34
+ class AntigravityAdapter(HarnessAdapter):
35
+ """Generate Antigravity custom agents and invoke ``agy``."""
36
+
37
+ name = "antigravity"
38
+ display_name = "Antigravity"
39
+ executable = "agy"
40
+
41
+ def setup(self, context: SetupContext) -> SetupResult:
42
+ changes: list[FileChange] = []
43
+ warnings: list[str] = []
44
+ ignored: list[str] = []
45
+
46
+ instructions = render_agent_instructions(
47
+ project=context.project,
48
+ profiles=list(context.profiles),
49
+ constitution_files=list(context.constitution_files),
50
+ config=context.config,
51
+ )
52
+ result = write_text_managed(
53
+ context.root / "AGENTS.md",
54
+ instructions,
55
+ root=context.root,
56
+ )
57
+ changes.append(FileChange(path=result.path, status=result.status))
58
+ if result.status != "skipped":
59
+ ignored.append("AGENTS.md")
60
+ else:
61
+ warnings.append(
62
+ "AGENTS.md contains unmanaged content and was left untouched."
63
+ )
64
+
65
+ agents_directory = context.root / ".agents" / "agents"
66
+ interactive = write_text_managed(
67
+ agents_directory / f"{INTERACTIVE_AGENT}.md",
68
+ self._render_agent(
69
+ name=INTERACTIVE_AGENT,
70
+ description=(
71
+ "DevFlow specification agent. Reads the project, asks "
72
+ "clarifying questions and writes only DevFlow specs."
73
+ ),
74
+ context=context,
75
+ interactive=True,
76
+ ),
77
+ root=context.root,
78
+ )
79
+ changes.append(
80
+ FileChange(path=interactive.path, status=interactive.status)
81
+ )
82
+ if interactive.status != "skipped":
83
+ ignored.append(f".agents/agents/{INTERACTIVE_AGENT}.md")
84
+ else:
85
+ warnings.append(
86
+ f"Existing .agents/agents/{INTERACTIVE_AGENT}.md is unmanaged "
87
+ "and was left untouched."
88
+ )
89
+
90
+ readonly = write_text_managed(
91
+ agents_directory / f"{READONLY_AGENT}.md",
92
+ self._render_agent(
93
+ name=READONLY_AGENT,
94
+ description=(
95
+ "Read-only DevFlow specification agent. Returns a complete "
96
+ "specification without modifying the project."
97
+ ),
98
+ context=context,
99
+ interactive=False,
100
+ ),
101
+ root=context.root,
102
+ )
103
+ changes.append(
104
+ FileChange(path=readonly.path, status=readonly.status)
105
+ )
106
+ if readonly.status != "skipped":
107
+ ignored.append(f".agents/agents/{READONLY_AGENT}.md")
108
+ else:
109
+ warnings.append(
110
+ f"Existing .agents/agents/{READONLY_AGENT}.md is unmanaged "
111
+ "and was left untouched."
112
+ )
113
+
114
+ if ignored:
115
+ gitignore = write_gitignore_entries(context.root, ignored)
116
+ changes.append(
117
+ FileChange(path=gitignore.path, status=gitignore.status)
118
+ )
119
+
120
+ return SetupResult(changes=tuple(changes), warnings=tuple(warnings))
121
+
122
+ def build_run(self, context: RunContext) -> Invocation:
123
+ root = context.root
124
+ settings = json.dumps(
125
+ self._settings(context),
126
+ separators=(",", ":"),
127
+ )
128
+ if context.mode == "interactive":
129
+ argv = (
130
+ self.executable,
131
+ "--settings",
132
+ settings,
133
+ "--agent",
134
+ INTERACTIVE_AGENT,
135
+ "--prompt-interactive",
136
+ context.prompt,
137
+ )
138
+ return Invocation(argv=argv, cwd=root, interactive=True)
139
+
140
+ argv = (
141
+ self.executable,
142
+ "--settings",
143
+ settings,
144
+ "--agent",
145
+ READONLY_AGENT,
146
+ "--output-format",
147
+ "text",
148
+ "--print",
149
+ context.prompt,
150
+ )
151
+ return Invocation(argv=argv, cwd=root, interactive=False)
152
+
153
+ def permission_warnings(
154
+ self,
155
+ context: RunContext,
156
+ ) -> tuple[str, ...]:
157
+ warnings: list[str] = []
158
+ if not context.permissions.allow_project_read:
159
+ warnings.append(
160
+ "Project reads are disabled; Antigravity cannot inspect the "
161
+ "codebase. DevFlow will use deterministic analysis."
162
+ )
163
+ if context.mode == "interactive" and (
164
+ context.permissions.allow_source_code_changes
165
+ ):
166
+ warnings.append(
167
+ "Antigravity can write anywhere in the project because source "
168
+ "code changes are allowed. The specification prompt still "
169
+ "forbids implementing the change."
170
+ )
171
+ if context.mode == "non-interactive" and (
172
+ context.permissions.allow_source_code_changes
173
+ ):
174
+ warnings.append(
175
+ "Antigravity print mode is read-only, so source code changes "
176
+ "are not granted for this run."
177
+ )
178
+ return tuple(warnings)
179
+
180
+ def _settings(self, context: RunContext) -> dict[str, Any]:
181
+ root = str(context.root)
182
+ allow: list[str] = []
183
+ deny: list[str] = []
184
+
185
+ if context.permissions.allow_project_read:
186
+ allow.append(f"read_file({root})")
187
+
188
+ if context.mode == "interactive":
189
+ if context.permissions.allow_source_code_changes:
190
+ allow.append(f"write_file({root})")
191
+ allow.append("command(*)")
192
+ elif context.permissions.allow_spec_write:
193
+ specs = str(Path(root) / ".devflow" / "specs")
194
+ allow.append(f"write_file({specs})")
195
+
196
+ if not context.permissions.allow_source_code_changes or (
197
+ context.mode != "interactive"
198
+ ):
199
+ deny.append("command(*)")
200
+ deny.extend(["read_url(*)", "execute_url(*)", "mcp(*)"])
201
+
202
+ if context.mode != "interactive" or not (
203
+ context.permissions.allow_spec_write
204
+ or context.permissions.allow_source_code_changes
205
+ ):
206
+ deny.append(f"write_file({root})")
207
+
208
+ return {
209
+ "trustedWorkspaces": [root],
210
+ "permissions": {"allow": allow, "deny": deny},
211
+ }
212
+
213
+ def _render_agent(
214
+ self,
215
+ *,
216
+ name: str,
217
+ description: str,
218
+ context: SetupContext,
219
+ interactive: bool,
220
+ ) -> str:
221
+ tools = list(_READ_TOOLS)
222
+ if interactive:
223
+ if (
224
+ context.permissions.allow_spec_write
225
+ or context.permissions.allow_source_code_changes
226
+ ):
227
+ tools.extend(_WRITE_TOOLS)
228
+ tools.extend(_QUESTION_TOOLS)
229
+ frontmatter = yaml.safe_dump(
230
+ {
231
+ "name": name,
232
+ "description": description,
233
+ "mainAgent": True,
234
+ "subagent": False,
235
+ "model": "inherit",
236
+ "commandExecutionPolicy": "sandbox" if interactive else "off",
237
+ "tools": tools,
238
+ },
239
+ sort_keys=False,
240
+ allow_unicode=True,
241
+ ).strip()
242
+
243
+ body = [
244
+ MANAGED_MARKER,
245
+ "# System Prompt",
246
+ "",
247
+ "You are the DevFlow specification agent for this project.",
248
+ "",
249
+ "Follow `AGENTS.md` and the project constitution. Analyze the "
250
+ "existing code before writing.",
251
+ "",
252
+ "Write only under `.devflow/specs/`. Never modify application "
253
+ "source code while generating a specification.",
254
+ "",
255
+ ]
256
+ if interactive:
257
+ body.extend(
258
+ [
259
+ "During interactive Discovery, call the `ask_question` tool for "
260
+ "every pending question and every assumption acceptance. "
261
+ "Present the recorded options in the dialog instead of asking "
262
+ "in free-form prose, and wait for the user's selection before "
263
+ "recording an answer.",
264
+ "",
265
+ ]
266
+ )
267
+ else:
268
+ body.extend(
269
+ [
270
+ "This run is non-interactive. Do not ask questions and do not "
271
+ "write files. Return the complete result as your final message.",
272
+ "",
273
+ ]
274
+ )
275
+ body.extend(
276
+ [
277
+ "The complete task, target path and output contract are provided "
278
+ "in the user prompt for each run.",
279
+ "",
280
+ ]
281
+ )
282
+ return f"---\n{frontmatter}\n---\n\n" + "\n".join(body)
@@ -190,10 +190,25 @@ class OpenCodeAdapter(HarnessAdapter):
190
190
  "Write only under `.devflow/specs/`. Never modify application "
191
191
  "source code while generating a specification.",
192
192
  "",
193
- "The complete task, target path and output contract are provided "
194
- "in the user prompt for each run.",
195
- "",
196
193
  ]
194
+ if interactive:
195
+ body.extend(
196
+ [
197
+ "During interactive Discovery, call the `question` tool for "
198
+ "every pending question and every assumption acceptance. "
199
+ "Present the recorded options in the dialog instead of asking "
200
+ "in free-form prose, and wait for the user's selection before "
201
+ "recording an answer.",
202
+ "",
203
+ ]
204
+ )
205
+ body.extend(
206
+ [
207
+ "The complete task, target path and output contract are provided "
208
+ "in the user prompt for each run.",
209
+ "",
210
+ ]
211
+ )
197
212
  return f"---\n{frontmatter}\n---\n\n" + "\n".join(body)
198
213
 
199
214
  def _permissions(
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from devflow.adapters.antigravity import AntigravityAdapter
5
6
  from devflow.adapters.base import HarnessAdapter
6
7
  from devflow.adapters.claude_code import ClaudeCodeAdapter
7
8
  from devflow.adapters.codex import CodexAdapter
@@ -16,6 +17,7 @@ def _create_registry() -> dict[str, HarnessAdapter]:
16
17
  OpenCodeAdapter(),
17
18
  ClaudeCodeAdapter(),
18
19
  KiroAdapter(),
20
+ AntigravityAdapter(),
19
21
  ]
20
22
  return {adapter.name: adapter for adapter in adapters}
21
23
 
@@ -35,7 +35,7 @@ def version() -> None:
35
35
  try:
36
36
  current_version = package_version("devflow-toolkit")
37
37
  except PackageNotFoundError:
38
- current_version = "0.3.14"
38
+ current_version = "0.3.15"
39
39
  console.print(f"DevFlow v{current_version}")
40
40
 
41
41
 
@@ -57,7 +57,7 @@ def _approve(spec_id: str, path: Path, stage: str) -> None:
57
57
  normalized = stage.strip().lower()
58
58
  if normalized != "spec":
59
59
  msg = (
60
- f"Stage '{stage}' is not available in DevFlow 0.3.14. "
60
+ f"Stage '{stage}' is not available in DevFlow 0.3.15. "
61
61
  "Only the 'spec' stage can be approved."
62
62
  )
63
63
  raise UnsupportedStageError(msg)
@@ -55,7 +55,8 @@ def resolve_harness(
55
55
  if not names:
56
56
  msg = (
57
57
  "No supported agent harness was found on PATH. Install a harness "
58
- "(codex, opencode, claude-code or kiro) or pass --harness none / "
58
+ "(codex, opencode, claude-code, kiro or antigravity) or pass "
59
+ "--harness none / "
59
60
  "--no-agent to use deterministic static analysis explicitly."
60
61
  )
61
62
  raise ConfigError(msg)
@@ -76,7 +76,8 @@ def init(
76
76
  None,
77
77
  "--harness",
78
78
  help=(
79
- "Agent harness: auto, codex, opencode, claude-code, kiro or none."
79
+ "Agent harness: auto, codex, opencode, claude-code, kiro, "
80
+ "antigravity or none."
80
81
  ),
81
82
  ),
82
83
  mode: Optional[str] = typer.Option(
@@ -68,7 +68,7 @@ def spec(
68
68
  "--harness",
69
69
  help=(
70
70
  "Agent harness for this run: auto, codex, opencode, claude-code, "
71
- "kiro or none."
71
+ "kiro, antigravity or none."
72
72
  ),
73
73
  ),
74
74
  mode: Optional[str] = typer.Option(
@@ -48,11 +48,15 @@ SUPPORTED_HARNESSES = (
48
48
  "opencode",
49
49
  "claude-code",
50
50
  "kiro",
51
+ "antigravity",
51
52
  "none",
52
53
  )
53
54
  EXECUTION_MODES = ("interactive", "non-interactive")
54
55
 
55
56
  _HARNESS_ALIASES = {
57
+ "agy": "antigravity",
58
+ "antigravity": "antigravity",
59
+ "anti-gravity": "antigravity",
56
60
  "claude": "claude-code",
57
61
  "claude_code": "claude-code",
58
62
  "claude-code": "claude-code",
@@ -710,6 +710,7 @@ class SpecWorkflow:
710
710
  context_path=self._relative(config, context_path),
711
711
  discovery_path=self._relative(config, discovery_path),
712
712
  harness_name=adapter.display_name,
713
+ harness_id=adapter.name,
713
714
  execution_mode=execution_mode,
714
715
  permissions=config.permissions,
715
716
  language=language,
@@ -103,9 +103,13 @@ def build_discovery_prompt(
103
103
  execution_mode: str,
104
104
  permissions: AgentPermissions,
105
105
  language: str = "en",
106
+ harness_id: str = "",
106
107
  ) -> str:
107
108
  """Render the interactive discovery prompt for any harness."""
108
109
  template = load_prompt("discovery.md")
110
+ question_note = _question_tool_note(harness_id, execution_mode)
111
+ if question_note:
112
+ question_note = f"## Structured Questions\n\n{question_note}\n\n"
109
113
  replacements = {
110
114
  "request": request,
111
115
  "project_name": project_name,
@@ -119,6 +123,7 @@ def build_discovery_prompt(
119
123
  execution_mode,
120
124
  permissions,
121
125
  ),
126
+ "question_tool_note": question_note,
122
127
  "permission_summary": _permission_summary(permissions),
123
128
  }
124
129
  rendered = template
@@ -159,6 +164,33 @@ def _discovery_language_note(language: str) -> str:
159
164
  )
160
165
 
161
166
 
167
+ _QUESTION_TOOLS = {
168
+ "opencode": "question",
169
+ "antigravity": "ask_question",
170
+ }
171
+
172
+
173
+ def _question_tool_note(harness_id: str, execution_mode: str) -> str:
174
+ """Name the structured question tool for harnesses that expose one."""
175
+ tool = _QUESTION_TOOLS.get((harness_id or "").strip().lower())
176
+ if tool is None:
177
+ return ""
178
+ if execution_mode != "interactive":
179
+ return (
180
+ f"This harness exposes a structured question tool named `{tool}`, "
181
+ "but it is unavailable in non-interactive runs. Report every "
182
+ "pending question in your final message instead of asking it."
183
+ )
184
+ return (
185
+ f"This harness exposes a structured question tool named `{tool}`. "
186
+ f"You must call `{tool}` for every pending Discovery question and for "
187
+ "every assumption acceptance instead of asking in free-form prose. "
188
+ "Put the recorded options in the tool, add a free-form or Other "
189
+ "choice when the tool supports it, and wait for the user's selection "
190
+ "before recording anything."
191
+ )
192
+
193
+
162
194
  def _discovery_mode_instructions(
163
195
  discovery_path: str,
164
196
  execution_mode: str,
@@ -146,7 +146,7 @@ Update `updated_at` whenever the file changes. Set `status` to
146
146
  `awaiting_clarification` while any question is unanswered or any
147
147
  assumption is unaccepted, and to `complete` only when nothing remains.
148
148
 
149
- ## Conversation Rules
149
+ {{question_tool_note}}## Conversation Rules
150
150
 
151
151
  - When your harness provides a structured question or multiple-choice
152
152
  tool, use it for every question and for assumption acceptance. Put the
@@ -14,6 +14,7 @@ from typer.testing import CliRunner
14
14
 
15
15
  spec_module = importlib.import_module("devflow.commands.spec")
16
16
 
17
+ from devflow.adapters.antigravity import AntigravityAdapter
17
18
  from devflow.adapters.base import RunContext
18
19
  from devflow.adapters.claude_code import ClaudeCodeAdapter
19
20
  from devflow.adapters.codex import CodexAdapter
@@ -24,7 +25,12 @@ from devflow.adapters.detector import (
24
25
  from devflow.cli import app
25
26
  from devflow.commands import harness as harness_module
26
27
  from devflow.commands.harness import resolve_harness
27
- from devflow.core.config import AgentPermissions, ConfigError
28
+ from devflow.core.config import (
29
+ AgentPermissions,
30
+ ConfigError,
31
+ canonical_harness_name,
32
+ )
33
+ from devflow.prompts import build_discovery_prompt
28
34
 
29
35
  runner = CliRunner()
30
36
 
@@ -322,6 +328,8 @@ def test_opencode_integration_scopes_edits_to_specs(
322
328
  rule["action"] == "question" and rule["effect"] == "allow"
323
329
  for rule in permissions
324
330
  )
331
+ assert "call the `question` tool" in agent
332
+ assert "assumption acceptance" in agent
325
333
 
326
334
  readonly = (
327
335
  tmp_path / ".opencode" / "agents" / "devflow-spec-readonly.md"
@@ -333,6 +341,116 @@ def test_opencode_integration_scopes_edits_to_specs(
333
341
  rule["action"] == "question" and rule["effect"] == "deny"
334
342
  for rule in readonly_frontmatter["permissions"]
335
343
  )
344
+ assert "call the `question` tool" not in readonly
345
+
346
+
347
+ def test_antigravity_generates_agents_and_ignores_files(
348
+ tmp_path: Path,
349
+ ) -> None:
350
+ _project(tmp_path)
351
+ result = _init(tmp_path, "--harness", "antigravity")
352
+
353
+ assert result.exit_code == 0, result.output
354
+ assert (tmp_path / "AGENTS.md").is_file()
355
+ interactive = (
356
+ tmp_path / ".agents" / "agents" / "devflow-spec.md"
357
+ ).read_text(encoding="utf-8")
358
+ readonly = (
359
+ tmp_path / ".agents" / "agents" / "devflow-spec-readonly.md"
360
+ ).read_text(encoding="utf-8")
361
+ interactive_frontmatter = yaml.safe_load(
362
+ interactive.split("---", 2)[1]
363
+ )
364
+ readonly_frontmatter = yaml.safe_load(
365
+ readonly.split("---", 2)[1]
366
+ )
367
+
368
+ assert interactive_frontmatter["name"] == "devflow-spec"
369
+ assert interactive_frontmatter["mainAgent"] is True
370
+ assert "ask_question" in interactive_frontmatter["tools"]
371
+ assert "write_file" in interactive_frontmatter["tools"]
372
+ assert "call the `ask_question` tool" in interactive
373
+ assert "write_file" not in readonly_frontmatter["tools"]
374
+ assert "read_file" in readonly_frontmatter["tools"]
375
+
376
+ content = (tmp_path / ".gitignore").read_text(encoding="utf-8")
377
+ for entry in (
378
+ "/AGENTS.md",
379
+ "/.agents/agents/devflow-spec.md",
380
+ "/.agents/agents/devflow-spec-readonly.md",
381
+ ):
382
+ assert entry in content
383
+ assert "\n/.agents\n" not in content
384
+
385
+
386
+ def test_antigravity_builds_scoped_interactive_invocation(
387
+ tmp_path: Path,
388
+ ) -> None:
389
+ context = _run_context(tmp_path, mode="interactive")
390
+ invocation = AntigravityAdapter().build_run(context)
391
+ argv = invocation.argv
392
+
393
+ assert invocation.interactive is True
394
+ assert argv[0] == "agy"
395
+ assert argv[argv.index("--agent") + 1] == "devflow-spec"
396
+ assert argv[argv.index("--prompt-interactive") + 1] == "prompt"
397
+ settings = json.loads(argv[argv.index("--settings") + 1])
398
+ assert settings["trustedWorkspaces"] == [str(tmp_path)]
399
+ allow = settings["permissions"]["allow"]
400
+ assert f"read_file({tmp_path})" in allow
401
+ assert f"write_file({tmp_path / '.devflow' / 'specs'})" in allow
402
+ assert "command(*)" in settings["permissions"]["deny"]
403
+ assert f"write_file({tmp_path})" not in settings["permissions"]["deny"]
404
+
405
+
406
+ def test_antigravity_print_mode_is_read_only(
407
+ tmp_path: Path,
408
+ ) -> None:
409
+ context = _run_context(tmp_path)
410
+ invocation = AntigravityAdapter().build_run(context)
411
+ argv = invocation.argv
412
+
413
+ assert invocation.interactive is False
414
+ assert argv[argv.index("--agent") + 1] == "devflow-spec-readonly"
415
+ assert argv[argv.index("--output-format") + 1] == "text"
416
+ assert argv[argv.index("--print") + 1] == "prompt"
417
+ assert argv.index("--output-format") < argv.index("--print")
418
+ settings = json.loads(argv[argv.index("--settings") + 1])
419
+ assert not any(
420
+ rule.startswith("write_file(")
421
+ for rule in settings["permissions"]["allow"]
422
+ )
423
+ assert f"write_file({tmp_path})" in settings["permissions"]["deny"]
424
+
425
+
426
+ def test_opencode_and_antigravity_discovery_prompts_name_question_tool(
427
+ tmp_path: Path,
428
+ ) -> None:
429
+ def prompt(harness_id: str, name: str) -> str:
430
+ return build_discovery_prompt(
431
+ request="Add a health endpoint",
432
+ project_name="demo",
433
+ context_path=".devflow/specs/001/context.md",
434
+ discovery_path=".devflow/specs/001/discovery.yaml",
435
+ harness_name=name,
436
+ harness_id=harness_id,
437
+ execution_mode="interactive",
438
+ permissions=AgentPermissions(),
439
+ )
440
+
441
+ opencode = prompt("opencode", "OpenCode")
442
+ antigravity = prompt("antigravity", "Antigravity")
443
+ codex = prompt("codex", "Codex")
444
+
445
+ assert "## Structured Questions" in opencode
446
+ assert "call `question`" in opencode
447
+ assert "call `ask_question`" in antigravity
448
+ assert "## Structured Questions" not in codex
449
+ assert "ask_question" not in codex
450
+
451
+
452
+ def test_antigravity_accepts_agy_alias() -> None:
453
+ assert canonical_harness_name("agy") == "antigravity"
336
454
 
337
455
 
338
456
  def test_kiro_uses_steering_and_readonly_agent(