devflow-toolkit 0.3.21__tar.gz → 0.3.22__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 (84) hide show
  1. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/CHANGELOG.md +28 -0
  2. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/PKG-INFO +47 -10
  3. devflow_toolkit-0.3.22/PUBLISHING.md +155 -0
  4. devflow_toolkit-0.3.22/README.md +149 -0
  5. devflow_toolkit-0.3.21/README.md → devflow_toolkit-0.3.22/docs/REFERENCE.md +46 -9
  6. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/pyproject.toml +4 -2
  7. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/adapters/instructions.py +2 -2
  8. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/cli.py +2 -0
  9. devflow_toolkit-0.3.22/src/devflow/commands/reopen.py +105 -0
  10. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/commands/status.py +3 -1
  11. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/spec_workflow.py +6 -0
  12. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/state/__init__.py +2 -0
  13. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/state/events.py +58 -0
  14. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/state/manager.py +103 -1
  15. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/prompts/__init__.py +12 -0
  16. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/prompts/discovery.md +1 -1
  17. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/tests/test_event_log.py +48 -0
  18. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/tests/test_spec_workflow.py +18 -0
  19. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/tests/test_state.py +86 -1
  20. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/.gitignore +0 -0
  21. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/LICENSE +0 -0
  22. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/__init__.py +0 -0
  23. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/adapters/__init__.py +0 -0
  24. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/adapters/agents.py +0 -0
  25. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/adapters/antigravity.py +0 -0
  26. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/adapters/base.py +0 -0
  27. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/adapters/claude_code.py +0 -0
  28. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/adapters/codex.py +0 -0
  29. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/adapters/detector.py +0 -0
  30. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/adapters/kiro.py +0 -0
  31. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/adapters/opencode.py +0 -0
  32. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/adapters/registry.py +0 -0
  33. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/commands/__init__.py +0 -0
  34. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/commands/approve.py +0 -0
  35. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/commands/config.py +0 -0
  36. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/commands/doctor.py +0 -0
  37. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/commands/harness.py +0 -0
  38. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/commands/init.py +0 -0
  39. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/commands/recover.py +0 -0
  40. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/commands/spec.py +0 -0
  41. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/__init__.py +0 -0
  42. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/architecture.py +0 -0
  43. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/artifacts/__init__.py +0 -0
  44. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/artifacts/errors.py +0 -0
  45. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/artifacts/models.py +0 -0
  46. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/artifacts/store.py +0 -0
  47. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/clock.py +0 -0
  48. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/config.py +0 -0
  49. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/constitution.py +0 -0
  50. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/discovery.py +0 -0
  51. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/file_types.py +0 -0
  52. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/ports.py +0 -0
  53. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/profile_manager.py +0 -0
  54. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/project.py +0 -0
  55. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/recovery.py +0 -0
  56. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/specification.py +0 -0
  57. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/state/errors.py +0 -0
  58. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/state/locator.py +0 -0
  59. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/state/lock.py +0 -0
  60. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/state/models.py +0 -0
  61. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/core/state/transitions.py +0 -0
  62. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/models/__init__.py +0 -0
  63. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/models/profile.py +0 -0
  64. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/models/project.py +0 -0
  65. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/profiles/ai-rag/constitution/ai-rag-standards.md +0 -0
  66. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/profiles/ai-rag/profile.yaml +0 -0
  67. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/profiles/base/constitution/architecture.md +0 -0
  68. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/profiles/base/constitution/code-standards.md +0 -0
  69. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/profiles/base/constitution/constitution.md +0 -0
  70. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/profiles/base/profile.yaml +0 -0
  71. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/profiles/django-backend/constitution/django-standards.md +0 -0
  72. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/profiles/django-backend/profile.yaml +0 -0
  73. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/profiles/fastapi-backend/constitution/fastapi-standards.md +0 -0
  74. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/profiles/fastapi-backend/profile.yaml +0 -0
  75. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/prompts/discovery-repair.md +0 -0
  76. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/src/devflow/prompts/spec.md +0 -0
  77. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/tests/test_cli.py +0 -0
  78. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/tests/test_discovery.py +0 -0
  79. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/tests/test_discovery_decisions.py +0 -0
  80. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/tests/test_greenfield.py +0 -0
  81. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/tests/test_hardening.py +0 -0
  82. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/tests/test_harness_adapters.py +0 -0
  83. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/tests/test_recovery.py +0 -0
  84. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.22}/tests/test_state_replay.py +0 -0
@@ -2,6 +2,34 @@
2
2
 
3
3
  All notable changes to DevFlow Toolkit are documented in this file.
4
4
 
5
+ ## 0.3.22 - 2026-11-09
6
+
7
+ ### Added
8
+
9
+ - `devflow reopen 001` withdraws the approval of a specification so it
10
+ can be changed. It asks for confirmation (`--yes` skips it), archives
11
+ the current `spec.md` in `history/` and records a `spec_reopened`
12
+ event. The change returns to `draft`.
13
+ - `devflow reopen 001 --discovery` also marks Discovery pending and
14
+ returns the change to `awaiting_clarification`. The next Discovery
15
+ session asks the user what to add or change.
16
+ - `PUBLISHING.md` explains, step by step, how to publish a release on
17
+ TestPyPI and PyPI.
18
+
19
+ ### Changed
20
+
21
+ - `README.md` is now a short guide focused on the command flow. The full
22
+ documentation moved to `docs/REFERENCE.md`, which remains the PyPI
23
+ project description.
24
+ - `devflow status` suggests `devflow reopen` for an approved spec that
25
+ was edited, instead of `devflow doctor`.
26
+ - The generated `AGENTS.md` tells agents to ask for `devflow reopen`
27
+ instead of editing an approved spec.
28
+
29
+ ### Package
30
+
31
+ - Package version is `0.3.22`.
32
+
5
33
  ## 0.3.21 - 2026-11-09
6
34
 
7
35
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: devflow-toolkit
3
- Version: 0.3.21
3
+ Version: 0.3.22
4
4
  Summary: Specification workflow toolkit for AI-assisted software changes
5
5
  Author: DevFlow contributors
6
6
  License-Expression: MIT
@@ -32,7 +32,7 @@ Description-Content-Type: text/markdown
32
32
 
33
33
  # DevFlow Toolkit
34
34
 
35
- **Current version: `0.3.21`.**
35
+ **Current version: `0.3.22`.**
36
36
 
37
37
  DevFlow is a command-line toolkit for leading AI models and coding
38
38
  agents through specification-driven changes in real software projects.
@@ -152,7 +152,7 @@ pip install devflow-toolkit
152
152
  To install a specific built artifact instead:
153
153
 
154
154
  ```bash
155
- pip install devflow_toolkit-0.3.21-py3-none-any.whl
155
+ pip install devflow_toolkit-0.3.22-py3-none-any.whl
156
156
  ```
157
157
 
158
158
  Verify the installation:
@@ -428,7 +428,7 @@ as an architectural constraint when it is present.
428
428
 
429
429
  ### Harnesses
430
430
 
431
- | Harness | Status in 0.3.21 |
431
+ | Harness | Status in 0.3.22 |
432
432
  | --- | --- |
433
433
  | OpenCode | Verified end-to-end; interactive Discovery uses the `question` tool |
434
434
  | Antigravity | Custom agents and scoped permissions generated; `agy` loading and print mode verified |
@@ -696,13 +696,14 @@ specification that still lists open questions.
696
696
  8. If artifacts exist without workflow state, diagnose with
697
697
  `devflow doctor <id>` and repair with `devflow recover <id>`.
698
698
 
699
- Available commands in `0.3.21`:
699
+ Available commands in `0.3.22`:
700
700
 
701
701
  | Command | Status |
702
702
  | --- | --- |
703
703
  | `devflow init` | Implemented |
704
704
  | `devflow spec` | Implemented: Discovery, specification, and `--continue` |
705
705
  | `devflow approve <id>` (stage `spec` by default) | Implemented |
706
+ | `devflow reopen <id>` | Implemented: withdraw a spec approval to change it |
706
707
  | `devflow status <id>` | Implemented |
707
708
  | `devflow doctor <id>` | Implemented: read-only diagnostics |
708
709
  | `devflow recover <id>` | Implemented: register existing artifacts |
@@ -928,7 +929,7 @@ devflow approve 001
928
929
  ```
929
930
 
930
931
  Approval is explicit and binds the decision to the current artifact
931
- digests. For a `0.3.21` change it binds `spec.md`, `discovery.yaml` and,
932
+ digests. For a `0.3.22` change it binds `spec.md`, `discovery.yaml` and,
932
933
  when a manifest applies, the architecture manifest digest. Repeating the
933
934
  same approval is a no-op. If an artifact changes after validation,
934
935
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -939,7 +940,7 @@ and names the pending questions and assumptions. Approval also rejects a
939
940
  specification whose section 7 still lists open questions. Legacy `0.2.0`
940
941
  changes without `discovery.yaml` remain approvable with a warning.
941
942
 
942
- Only the `spec` stage is available in `0.3.21`, so `--stage` is optional
943
+ Only the `spec` stage is available in `0.3.22`, so `--stage` is optional
943
944
  and defaults to `spec`. `--stage plan` and `--stage review` are
944
945
  rejected. There are no `plan`, `implement` or
945
946
  `review` commands in this release.
@@ -967,6 +968,41 @@ The generated `AGENTS.md` (or `CLAUDE.md`) tells the agent to:
967
968
  this step. Discovery and specification prompts skip it to save tokens;
968
969
  the specification still lists it in section 9.
969
970
 
971
+ ### Reopen an approved specification
972
+
973
+ An approved specification is a contract. To change it, reopen it first;
974
+ editing `spec.md` directly only marks it `stale`.
975
+
976
+ ```bash
977
+ devflow reopen 001 # fix or extend the spec text yourself
978
+ devflow reopen 001 --discovery # add or change decisions with the agent
979
+ ```
980
+
981
+ `reopen` asks for confirmation (skip it with `--yes`), copies the
982
+ current `spec.md` into `history/`, records a `spec_reopened` event and
983
+ withdraws the approval. The previous approval stays in `events.jsonl`;
984
+ nothing is deleted.
985
+
986
+ Without `--discovery`, the change returns to `draft`:
987
+
988
+ ```bash
989
+ # edit spec.md
990
+ devflow spec --continue 001 # validates and registers your edited spec
991
+ devflow approve 001
992
+ ```
993
+
994
+ With `--discovery`, the change returns to `awaiting_clarification` and
995
+ Discovery is marked pending:
996
+
997
+ ```bash
998
+ devflow spec --continue 001 # Discovery session: tell the agent what changes
999
+ devflow spec --continue 001 # writes the new spec
1000
+ devflow approve 001
1001
+ ```
1002
+
1003
+ Only an approved spec can be reopened, and only while the change is in
1004
+ `spec_approved`.
1005
+
970
1006
  ## Generated files
971
1007
 
972
1008
  ```text
@@ -1006,12 +1042,13 @@ DevFlow rebuilds or rejects it rather than trusting it.
1006
1042
 
1007
1043
  ```text
1008
1044
  generated -> validated -> approved
1009
- | |
1010
- +-> rejected +-> stale
1045
+ | | |
1046
+ +-> rejected +-> stale +-> reopen -> validated
1011
1047
  ```
1012
1048
 
1013
1049
  - An approval stores the artifact kind and its SHA-256 digest.
1014
- - Editing an approved artifact makes it stale.
1050
+ - Editing an approved artifact makes it stale. Use `devflow reopen` to
1051
+ withdraw the approval and change it on purpose.
1015
1052
  - A stale, unvalidated or orphan artifact cannot be approved.
1016
1053
  - Semantic validation rejects malformed or inconsistent histories.
1017
1054
  - Artifact and state writes are atomic; a failed write does not leave a
@@ -0,0 +1,155 @@
1
+ # Cómo publicar una versión en PyPI
2
+
3
+ Guía paso a paso para publicar `devflow-toolkit` en **TestPyPI** (prueba)
4
+ y luego en **PyPI** (real). Todos los comandos se ejecutan desde la raíz
5
+ del repositorio.
6
+
7
+ ```text
8
+ rama → tests → versión → commit → build → TestPyPI → probar → PyPI → push
9
+ ```
10
+
11
+ ## Antes de empezar (solo la primera vez)
12
+
13
+ 1. Ten cuenta en [pypi.org](https://pypi.org) y en
14
+ [test.pypi.org](https://test.pypi.org). Son cuentas separadas.
15
+ 2. En cada sitio crea un **API token** (Account settings → API tokens).
16
+ 3. Guarda los tokens en `.pypirc`, en la raíz del repositorio:
17
+
18
+ ```ini
19
+ [distutils]
20
+ index-servers =
21
+ pypi
22
+ testpypi
23
+
24
+ [pypi]
25
+ username = __token__
26
+ password = pypi-XXXXXXXX
27
+
28
+ [testpypi]
29
+ repository = https://test.pypi.org/legacy/
30
+ username = __token__
31
+ password = pypi-YYYYYYYY
32
+ ```
33
+
34
+ ```bash
35
+ chmod 600 .pypirc
36
+ ```
37
+
38
+ `.pypirc` ya está en `.gitignore`. **Nunca lo subas a git.**
39
+
40
+ 4. Instala las herramientas de desarrollo:
41
+
42
+ ```bash
43
+ python -m venv .venv
44
+ source .venv/bin/activate
45
+ pip install -e ".[dev]"
46
+ ```
47
+
48
+ ## 1. Crea una rama
49
+
50
+ ```bash
51
+ git switch -c feat/mi-cambio
52
+ ```
53
+
54
+ ## 2. Comprueba que todo pasa
55
+
56
+ ```bash
57
+ .venv/bin/pytest -q
58
+ .venv/bin/ruff check src tests
59
+ ```
60
+
61
+ No sigas si algo falla.
62
+
63
+ ## 3. Sube la versión
64
+
65
+ PyPI **no acepta dos veces la misma versión**. Cambia el número (por
66
+ ejemplo `0.3.22` → `0.3.23`) en:
67
+
68
+ | Archivo | Qué cambiar |
69
+ | --- | --- |
70
+ | `pyproject.toml` | `version = "0.3.23"` |
71
+ | `README.md` | `Current version: 0.3.23` |
72
+ | `docs/REFERENCE.md` | Todas las menciones de la versión anterior |
73
+ | `CHANGELOG.md` | Nueva sección `## 0.3.23 - AAAA-MM-DD` arriba |
74
+
75
+ Atajo para los dos primeros documentos:
76
+
77
+ ```bash
78
+ sed -i 's/0\.3\.22/0.3.23/g' README.md docs/REFERENCE.md
79
+ ```
80
+
81
+ ## 4. Haz commit
82
+
83
+ ```bash
84
+ git add -A
85
+ git commit -m "describe el cambio y versión 0.3.23"
86
+ ```
87
+
88
+ ## 5. Construye el paquete
89
+
90
+ ```bash
91
+ .venv/bin/python -m build
92
+ .venv/bin/twine check dist/*0.3.23*
93
+ ```
94
+
95
+ Se crean dos archivos en `dist/`: un `.whl` y un `.tar.gz`. `twine check`
96
+ debe decir `PASSED` en ambos.
97
+
98
+ ## 6. Publica en TestPyPI
99
+
100
+ ```bash
101
+ .venv/bin/twine upload --config-file .pypirc -r testpypi dist/*0.3.23*
102
+ ```
103
+
104
+ Usa siempre `dist/*0.3.23*` para no subir versiones viejas que sigan en
105
+ `dist/`.
106
+
107
+ ## 7. Prueba la instalación desde TestPyPI
108
+
109
+ ```bash
110
+ python3 -m venv /tmp/prueba
111
+ /tmp/prueba/bin/pip install --no-cache-dir \
112
+ --index-url https://test.pypi.org/simple/ \
113
+ --extra-index-url https://pypi.org/simple/ \
114
+ devflow-toolkit==0.3.23
115
+ /tmp/prueba/bin/devflow version
116
+ rm -rf /tmp/prueba
117
+ ```
118
+
119
+ Debe mostrar `DevFlow v0.3.23`. Si dice que no encuentra la versión,
120
+ espera uno o dos minutos y repite: TestPyPI tarda en actualizar su
121
+ índice.
122
+
123
+ ## 8. Publica en PyPI
124
+
125
+ Solo si el paso 7 funcionó:
126
+
127
+ ```bash
128
+ .venv/bin/twine upload --config-file .pypirc -r pypi dist/*0.3.23*
129
+ ```
130
+
131
+ La página queda en `https://pypi.org/project/devflow-toolkit/0.3.23/`.
132
+
133
+ ## 9. Sube la rama
134
+
135
+ ```bash
136
+ git push -u origin feat/mi-cambio
137
+ ```
138
+
139
+ Abre un Pull Request en GitHub para unirla a `main`.
140
+
141
+ ## Errores frecuentes
142
+
143
+ | Mensaje | Qué hacer |
144
+ | --- | --- |
145
+ | `File already exists` | Esa versión ya se publicó. Sube el número (paso 3) y repite. |
146
+ | `403 Forbidden` / `Invalid API token` | El token de `.pypirc` está mal o es del sitio equivocado (PyPI y TestPyPI usan tokens distintos). |
147
+ | `No matching distribution found` en el paso 7 | TestPyPI aún no actualizó el índice. Espera y repite. |
148
+ | `twine check` falla | Revisa el formato Markdown del archivo `readme` indicado en `pyproject.toml`. |
149
+
150
+ ## Bueno saber
151
+
152
+ - La descripción larga que se ve en PyPI sale del archivo indicado en
153
+ `readme` de `pyproject.toml` (hoy `docs/REFERENCE.md`).
154
+ - Una versión publicada no se puede reemplazar ni reutilizar, aunque la
155
+ borres. Por eso se prueba primero en TestPyPI.
@@ -0,0 +1,149 @@
1
+ # DevFlow Toolkit
2
+
3
+ DevFlow is a command-line tool that makes AI coding agents work from an
4
+ approved specification instead of a vague chat request.
5
+
6
+ - **You decide first.** The agent asks the questions that matter
7
+ (Discovery) and writes a specification (`spec.md`). You approve it.
8
+ - **The agent builds what was approved.** Nothing more, nothing less.
9
+ - **Everything stays in your repository.** Decisions, the spec and its
10
+ approval live in `.devflow/`, so any agent or teammate can pick up
11
+ the work.
12
+
13
+ Current version: `0.3.22` · Python 3.11+ · Linux and macOS
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ pip install devflow-toolkit
19
+ devflow version
20
+ ```
21
+
22
+ You also need an AI agent installed on your machine, for example
23
+ [OpenCode](https://opencode.ai) or Claude Code.
24
+
25
+ ## The flow
26
+
27
+ ```text
28
+ devflow init once per project
29
+ │
30
+ devflow spec "your change" Discovery: the agent asks, you answer
31
+ │
32
+ devflow spec --continue 001 repeat until the spec is written
33
+ │
34
+ devflow approve 001 you approve the spec
35
+ │
36
+ "Implement .devflow/specs/001-…/spec.md" ask your agent to build it
37
+
38
+ Need to change an approved spec? devflow reopen 001
39
+ Not sure what comes next? devflow status 001
40
+ ```
41
+
42
+ ## Step by step
43
+
44
+ ### 1. Set up the project (once)
45
+
46
+ ```bash
47
+ cd my-project
48
+ devflow init --harness opencode --language es
49
+ ```
50
+
51
+ `--harness` is the agent DevFlow will open (`opencode`, `claude-code`,
52
+ `codex`, `antigravity`, `kiro`). `--language` is the language of the
53
+ questions and the spec.
54
+
55
+ ### 2. Describe the change
56
+
57
+ ```bash
58
+ devflow spec "Add a contact form"
59
+ ```
60
+
61
+ DevFlow opens a chat with the agent. Answer its questions. When the
62
+ agent says Discovery is done, **exit the chat** (for example `/exit`).
63
+ DevFlow then checks the answers on your machine, without spending
64
+ tokens.
65
+
66
+ ### 3. Continue until the spec is written
67
+
68
+ ```bash
69
+ devflow spec --continue 001
70
+ ```
71
+
72
+ Each command opens at most one chat. Run it again if there are pending
73
+ questions, and once more to write `spec.md`. Exit the chat only after
74
+ the agent says `spec.md` is written.
75
+
76
+ Prefer one command for both phases? Add `--auto` to the first command:
77
+ `devflow spec "Add a contact form" --auto`.
78
+
79
+ ### 4. Review and approve
80
+
81
+ Read `.devflow/specs/001-…/spec.md`, then:
82
+
83
+ ```bash
84
+ devflow approve 001
85
+ ```
86
+
87
+ ### 5. Implement
88
+
89
+ Open your agent normally (not through DevFlow) and ask:
90
+
91
+ ```text
92
+ Implement .devflow/specs/001-add-a-contact-form/spec.md
93
+ ```
94
+
95
+ The `AGENTS.md` file created by `devflow init` tells the agent to check
96
+ the approval, follow your code standards, build only the listed
97
+ requirements and report every acceptance criterion.
98
+
99
+ ### 6. Change an approved spec (if needed)
100
+
101
+ ```bash
102
+ devflow reopen 001 # you edit spec.md yourself
103
+ devflow reopen 001 --discovery # the agent asks about the new decisions
104
+ ```
105
+
106
+ Then run `devflow spec --continue 001` and approve again. The previous
107
+ version is kept in `history/`.
108
+
109
+ ## Everyday commands
110
+
111
+ | Command | What it does |
112
+ | --- | --- |
113
+ | `devflow init` | Prepare the project and the agent integration |
114
+ | `devflow spec "…"` | Start a change with Discovery |
115
+ | `devflow spec --continue 001` | Resume Discovery or write the spec |
116
+ | `devflow approve 001` | Approve the spec |
117
+ | `devflow reopen 001` | Withdraw the approval to change the spec |
118
+ | `devflow status 001` | Show where the change is and the next command |
119
+
120
+ ## When something looks wrong
121
+
122
+ `devflow status 001` always ends with a `Next:` line. If it suggests
123
+ `devflow doctor 001`, run it: `doctor` explains the problem and, when
124
+ possible, suggests `devflow recover 001` to register files that were
125
+ written outside the normal flow.
126
+
127
+ ## Good to know
128
+
129
+ - **Validation is free.** DevFlow checks Discovery and the spec with
130
+ local Python code; it does not call the model to do it.
131
+ - **Fewer wasted tokens.** Questions are cheap; rewriting code after a
132
+ misunderstanding is expensive. An approved spec avoids most of those
133
+ rewrites.
134
+ - **Small changes don't need DevFlow.** Use it when a change involves
135
+ decisions: new features, integrations, refactors.
136
+ - **Without a chat.** `--mode non-interactive` runs the agent in the
137
+ background. It cannot ask questions, so use it once decisions are
138
+ made.
139
+
140
+ ## Learn more
141
+
142
+ - [Full reference](docs/REFERENCE.md): every command, option, file and
143
+ rule.
144
+ - [Changelog](CHANGELOG.md)
145
+ - [How to publish a release](PUBLISHING.md)
146
+
147
+ ## License
148
+
149
+ MIT
@@ -1,6 +1,6 @@
1
1
  # DevFlow Toolkit
2
2
 
3
- **Current version: `0.3.21`.**
3
+ **Current version: `0.3.22`.**
4
4
 
5
5
  DevFlow is a command-line toolkit for leading AI models and coding
6
6
  agents through specification-driven changes in real software projects.
@@ -120,7 +120,7 @@ pip install devflow-toolkit
120
120
  To install a specific built artifact instead:
121
121
 
122
122
  ```bash
123
- pip install devflow_toolkit-0.3.21-py3-none-any.whl
123
+ pip install devflow_toolkit-0.3.22-py3-none-any.whl
124
124
  ```
125
125
 
126
126
  Verify the installation:
@@ -396,7 +396,7 @@ as an architectural constraint when it is present.
396
396
 
397
397
  ### Harnesses
398
398
 
399
- | Harness | Status in 0.3.21 |
399
+ | Harness | Status in 0.3.22 |
400
400
  | --- | --- |
401
401
  | OpenCode | Verified end-to-end; interactive Discovery uses the `question` tool |
402
402
  | Antigravity | Custom agents and scoped permissions generated; `agy` loading and print mode verified |
@@ -664,13 +664,14 @@ specification that still lists open questions.
664
664
  8. If artifacts exist without workflow state, diagnose with
665
665
  `devflow doctor <id>` and repair with `devflow recover <id>`.
666
666
 
667
- Available commands in `0.3.21`:
667
+ Available commands in `0.3.22`:
668
668
 
669
669
  | Command | Status |
670
670
  | --- | --- |
671
671
  | `devflow init` | Implemented |
672
672
  | `devflow spec` | Implemented: Discovery, specification, and `--continue` |
673
673
  | `devflow approve <id>` (stage `spec` by default) | Implemented |
674
+ | `devflow reopen <id>` | Implemented: withdraw a spec approval to change it |
674
675
  | `devflow status <id>` | Implemented |
675
676
  | `devflow doctor <id>` | Implemented: read-only diagnostics |
676
677
  | `devflow recover <id>` | Implemented: register existing artifacts |
@@ -896,7 +897,7 @@ devflow approve 001
896
897
  ```
897
898
 
898
899
  Approval is explicit and binds the decision to the current artifact
899
- digests. For a `0.3.21` change it binds `spec.md`, `discovery.yaml` and,
900
+ digests. For a `0.3.22` change it binds `spec.md`, `discovery.yaml` and,
900
901
  when a manifest applies, the architecture manifest digest. Repeating the
901
902
  same approval is a no-op. If an artifact changes after validation,
902
903
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -907,7 +908,7 @@ and names the pending questions and assumptions. Approval also rejects a
907
908
  specification whose section 7 still lists open questions. Legacy `0.2.0`
908
909
  changes without `discovery.yaml` remain approvable with a warning.
909
910
 
910
- Only the `spec` stage is available in `0.3.21`, so `--stage` is optional
911
+ Only the `spec` stage is available in `0.3.22`, so `--stage` is optional
911
912
  and defaults to `spec`. `--stage plan` and `--stage review` are
912
913
  rejected. There are no `plan`, `implement` or
913
914
  `review` commands in this release.
@@ -935,6 +936,41 @@ The generated `AGENTS.md` (or `CLAUDE.md`) tells the agent to:
935
936
  this step. Discovery and specification prompts skip it to save tokens;
936
937
  the specification still lists it in section 9.
937
938
 
939
+ ### Reopen an approved specification
940
+
941
+ An approved specification is a contract. To change it, reopen it first;
942
+ editing `spec.md` directly only marks it `stale`.
943
+
944
+ ```bash
945
+ devflow reopen 001 # fix or extend the spec text yourself
946
+ devflow reopen 001 --discovery # add or change decisions with the agent
947
+ ```
948
+
949
+ `reopen` asks for confirmation (skip it with `--yes`), copies the
950
+ current `spec.md` into `history/`, records a `spec_reopened` event and
951
+ withdraws the approval. The previous approval stays in `events.jsonl`;
952
+ nothing is deleted.
953
+
954
+ Without `--discovery`, the change returns to `draft`:
955
+
956
+ ```bash
957
+ # edit spec.md
958
+ devflow spec --continue 001 # validates and registers your edited spec
959
+ devflow approve 001
960
+ ```
961
+
962
+ With `--discovery`, the change returns to `awaiting_clarification` and
963
+ Discovery is marked pending:
964
+
965
+ ```bash
966
+ devflow spec --continue 001 # Discovery session: tell the agent what changes
967
+ devflow spec --continue 001 # writes the new spec
968
+ devflow approve 001
969
+ ```
970
+
971
+ Only an approved spec can be reopened, and only while the change is in
972
+ `spec_approved`.
973
+
938
974
  ## Generated files
939
975
 
940
976
  ```text
@@ -974,12 +1010,13 @@ DevFlow rebuilds or rejects it rather than trusting it.
974
1010
 
975
1011
  ```text
976
1012
  generated -> validated -> approved
977
- | |
978
- +-> rejected +-> stale
1013
+ | | |
1014
+ +-> rejected +-> stale +-> reopen -> validated
979
1015
  ```
980
1016
 
981
1017
  - An approval stores the artifact kind and its SHA-256 digest.
982
- - Editing an approved artifact makes it stale.
1018
+ - Editing an approved artifact makes it stale. Use `devflow reopen` to
1019
+ withdraw the approval and change it on purpose.
983
1020
  - A stale, unvalidated or orphan artifact cannot be approved.
984
1021
  - Semantic validation rejects malformed or inconsistent histories.
985
1022
  - Artifact and state writes are atomic; a failed write does not leave a
@@ -4,9 +4,9 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "devflow-toolkit"
7
- version = "0.3.21"
7
+ version = "0.3.22"
8
8
  description = "Specification workflow toolkit for AI-assisted software changes"
9
- readme = "README.md"
9
+ readme = "docs/REFERENCE.md"
10
10
  license = "MIT"
11
11
  license-files = ["LICENSE"]
12
12
  requires-python = ">=3.11"
@@ -69,6 +69,8 @@ include = [
69
69
  "/src/devflow",
70
70
  "/tests",
71
71
  "/CHANGELOG.md",
72
+ "/docs",
73
+ "/PUBLISHING.md",
72
74
  "/LICENSE",
73
75
  "/README.md",
74
76
  "/pyproject.toml",
@@ -178,8 +178,8 @@ def render_agent_instructions(
178
178
  "Out of Scope.",
179
179
  "5. Add or update tests for every `AC-XXX` and report each one as "
180
180
  "met or not met.",
181
- f"6. Do not edit files under `{specs_dir}/`; editing an approved "
182
- "spec makes its approval stale.",
181
+ f"6. Do not edit files under `{specs_dir}/`. To change an "
182
+ "approved spec, the user runs `devflow reopen NNN`.",
183
183
  "7. If the spec is ambiguous, wrong or conflicts with the code, "
184
184
  "stop and ask. Scope changes need a new `devflow spec`.",
185
185
  "",
@@ -11,6 +11,7 @@ from devflow.commands.doctor import doctor as doctor_command
11
11
  from devflow.commands.harness import harness_app
12
12
  from devflow.commands.init import init as init_command
13
13
  from devflow.commands.recover import recover as recover_command
14
+ from devflow.commands.reopen import reopen as reopen_command
14
15
  from devflow.commands.spec import spec as spec_command
15
16
  from devflow.commands.status import status as status_command
16
17
 
@@ -26,6 +27,7 @@ console = Console()
26
27
  app.command("init")(init_command)
27
28
  app.command("spec")(spec_command)
28
29
  app.command("approve")(approve_command)
30
+ app.command("reopen")(reopen_command)
29
31
  app.command("status")(status_command)
30
32
  app.command("doctor")(doctor_command)
31
33
  app.command("recover")(recover_command)