devflow-toolkit 0.3.21__tar.gz → 0.3.23__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.23}/CHANGELOG.md +63 -0
  2. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/PKG-INFO +99 -10
  3. devflow_toolkit-0.3.23/PUBLISHING.md +155 -0
  4. devflow_toolkit-0.3.23/README.md +158 -0
  5. devflow_toolkit-0.3.21/README.md → devflow_toolkit-0.3.23/docs/REFERENCE.md +98 -9
  6. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/pyproject.toml +4 -2
  7. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/adapters/instructions.py +2 -2
  8. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/cli.py +2 -0
  9. devflow_toolkit-0.3.23/src/devflow/commands/reopen.py +105 -0
  10. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/commands/status.py +30 -9
  11. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/discovery.py +142 -1
  12. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/spec_workflow.py +36 -8
  13. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/specification.py +70 -6
  14. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/state/__init__.py +2 -0
  15. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/state/events.py +58 -0
  16. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/state/manager.py +103 -1
  17. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/prompts/__init__.py +35 -5
  18. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/prompts/discovery.md +59 -4
  19. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/prompts/spec.md +9 -4
  20. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/tests/test_discovery_decisions.py +138 -0
  21. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/tests/test_event_log.py +48 -0
  22. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/tests/test_spec_workflow.py +134 -0
  23. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/tests/test_state.py +137 -1
  24. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/.gitignore +0 -0
  25. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/LICENSE +0 -0
  26. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/__init__.py +0 -0
  27. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/adapters/__init__.py +0 -0
  28. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/adapters/agents.py +0 -0
  29. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/adapters/antigravity.py +0 -0
  30. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/adapters/base.py +0 -0
  31. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/adapters/claude_code.py +0 -0
  32. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/adapters/codex.py +0 -0
  33. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/adapters/detector.py +0 -0
  34. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/adapters/kiro.py +0 -0
  35. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/adapters/opencode.py +0 -0
  36. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/adapters/registry.py +0 -0
  37. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/commands/__init__.py +0 -0
  38. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/commands/approve.py +0 -0
  39. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/commands/config.py +0 -0
  40. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/commands/doctor.py +0 -0
  41. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/commands/harness.py +0 -0
  42. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/commands/init.py +0 -0
  43. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/commands/recover.py +0 -0
  44. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/commands/spec.py +0 -0
  45. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/__init__.py +0 -0
  46. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/architecture.py +0 -0
  47. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/artifacts/__init__.py +0 -0
  48. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/artifacts/errors.py +0 -0
  49. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/artifacts/models.py +0 -0
  50. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/artifacts/store.py +0 -0
  51. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/clock.py +0 -0
  52. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/config.py +0 -0
  53. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/constitution.py +0 -0
  54. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/file_types.py +0 -0
  55. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/ports.py +0 -0
  56. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/profile_manager.py +0 -0
  57. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/project.py +0 -0
  58. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/recovery.py +0 -0
  59. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/state/errors.py +0 -0
  60. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/state/locator.py +0 -0
  61. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/state/lock.py +0 -0
  62. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/state/models.py +0 -0
  63. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/core/state/transitions.py +0 -0
  64. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/models/__init__.py +0 -0
  65. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/models/profile.py +0 -0
  66. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/models/project.py +0 -0
  67. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/profiles/ai-rag/constitution/ai-rag-standards.md +0 -0
  68. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/profiles/ai-rag/profile.yaml +0 -0
  69. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/profiles/base/constitution/architecture.md +0 -0
  70. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/profiles/base/constitution/code-standards.md +0 -0
  71. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/profiles/base/constitution/constitution.md +0 -0
  72. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/profiles/base/profile.yaml +0 -0
  73. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/profiles/django-backend/constitution/django-standards.md +0 -0
  74. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/profiles/django-backend/profile.yaml +0 -0
  75. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/profiles/fastapi-backend/constitution/fastapi-standards.md +0 -0
  76. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/profiles/fastapi-backend/profile.yaml +0 -0
  77. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/src/devflow/prompts/discovery-repair.md +0 -0
  78. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/tests/test_cli.py +0 -0
  79. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/tests/test_discovery.py +0 -0
  80. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/tests/test_greenfield.py +0 -0
  81. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/tests/test_hardening.py +0 -0
  82. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/tests/test_harness_adapters.py +0 -0
  83. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/tests/test_recovery.py +0 -0
  84. {devflow_toolkit-0.3.21 → devflow_toolkit-0.3.23}/tests/test_state_replay.py +0 -0
@@ -2,6 +2,69 @@
2
2
 
3
3
  All notable changes to DevFlow Toolkit are documented in this file.
4
4
 
5
+ ## 0.3.23 - 2026-11-09
6
+
7
+ ### Added
8
+
9
+ - Level-based Discovery. The spec covers level 1 (essential behavior
10
+ with existing tools plus basic security). Every question can offer a
11
+ `next_level` option with a short explanation, and advanced decisions
12
+ are recorded in a new `deferred` list instead of being asked now.
13
+ - Suggested next specifications: deferred items and every unchosen
14
+ `next_level` option. They appear in the Decision Context, in
15
+ `devflow status`, in the `Next:` line after approval and in `spec.md`
16
+ section `10.1`, which DevFlow writes itself with a ready-to-run
17
+ `devflow spec "..."` command.
18
+ - A readiness check before Discovery closes, so the specification agent
19
+ does not find new decisions.
20
+
21
+ ### Changed
22
+
23
+ - In an interactive run, the specification agent checks for missing
24
+ decisions before writing. If one is missing, it appends the question
25
+ to `discovery.yaml` and stops without writing `spec.md`, instead of
26
+ writing a full spec that DevFlow discards.
27
+ - Security decisions are still always asked and never assumed; the
28
+ prompt now asks for a recommended basic option and a one-sentence
29
+ explanation.
30
+
31
+ ### Fixed
32
+
33
+ - Nested bullets under an open question in section 7 stay part of that
34
+ question instead of becoming separate questions without context.
35
+
36
+ ### Package
37
+
38
+ - Package version is `0.3.23`.
39
+
40
+ ## 0.3.22 - 2026-11-09
41
+
42
+ ### Added
43
+
44
+ - `devflow reopen 001` withdraws the approval of a specification so it
45
+ can be changed. It asks for confirmation (`--yes` skips it), archives
46
+ the current `spec.md` in `history/` and records a `spec_reopened`
47
+ event. The change returns to `draft`.
48
+ - `devflow reopen 001 --discovery` also marks Discovery pending and
49
+ returns the change to `awaiting_clarification`. The next Discovery
50
+ session asks the user what to add or change.
51
+ - `PUBLISHING.md` explains, step by step, how to publish a release on
52
+ TestPyPI and PyPI.
53
+
54
+ ### Changed
55
+
56
+ - `README.md` is now a short guide focused on the command flow. The full
57
+ documentation moved to `docs/REFERENCE.md`, which remains the PyPI
58
+ project description.
59
+ - `devflow status` suggests `devflow reopen` for an approved spec that
60
+ was edited, instead of `devflow doctor`.
61
+ - The generated `AGENTS.md` tells agents to ask for `devflow reopen`
62
+ instead of editing an approved spec.
63
+
64
+ ### Package
65
+
66
+ - Package version is `0.3.22`.
67
+
5
68
  ## 0.3.21 - 2026-11-09
6
69
 
7
70
  ### 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.23
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.23`.**
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.23-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.23 |
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 |
@@ -683,6 +683,58 @@ appends the question to `discovery.yaml`, and returns the change to
683
683
  specification is generated. `devflow approve` rejects a
684
684
  specification that still lists open questions.
685
685
 
686
+ In an interactive run the specification agent checks for missing
687
+ decisions **before** writing. If one is missing, it appends the question
688
+ to `discovery.yaml` and stops without writing `spec.md`, so no tokens are
689
+ spent on a document that would be discarded. When an agent lists
690
+ questions in section 7, nested bullets stay part of the same question.
691
+
692
+ ### Level-based Discovery
693
+
694
+ Discovery builds the solution level by level instead of solving
695
+ everything at once:
696
+
697
+ 1. **Level 1 first.** The spec covers the essential behavior, built with
698
+ the tools the project already has, plus basic and obvious security.
699
+ 2. **Security is always asked, never assumed.** Basic security decisions
700
+ are explicit questions with a recommended option and a short
701
+ explanation, so the user learns them by answering.
702
+ 3. **Every question offers a next level.** One option takes the decision
703
+ one level further. It is recorded in `next_level`:
704
+
705
+ ```yaml
706
+ options:
707
+ - "Token valid until logout (basic)"
708
+ - "Token that expires after 24 hours"
709
+ next_level:
710
+ option: "Token that expires after 24 hours"
711
+ why: "Limits the damage if a token leaks."
712
+ ```
713
+
714
+ If the user chooses it, the answer uses that exact text. If not,
715
+ DevFlow treats it as a suggestion for a later specification.
716
+ 4. **No deeper than this level.** More advanced decisions found along
717
+ the way, and parts of a large request left for later, are recorded in
718
+ `deferred`:
719
+
720
+ ```yaml
721
+ deferred:
722
+ - title: "Limit failed login attempts"
723
+ why: "Protects accounts from password guessing."
724
+ question_id: Q2
725
+ ```
726
+
727
+ 5. **Readiness check.** Before closing, the agent confirms a decision
728
+ exists for every flow, interface, stored data, error case and level-1
729
+ security measure, and asks what is missing in the same round.
730
+
731
+ DevFlow collects `deferred` items and every unchosen `next_level` into
732
+ **suggested next specifications**. They appear in the Decision Context,
733
+ in `devflow status`, after approval in the `Next:` line, and in
734
+ `spec.md` section `10.1 Suggested next specifications`. DevFlow writes
735
+ that subsection itself, with a ready-to-run `devflow spec "..."` command
736
+ for each item; the agent does not write it.
737
+
686
738
  ## Workflow
687
739
 
688
740
  1. Initialize the project with `devflow init`.
@@ -696,13 +748,14 @@ specification that still lists open questions.
696
748
  8. If artifacts exist without workflow state, diagnose with
697
749
  `devflow doctor <id>` and repair with `devflow recover <id>`.
698
750
 
699
- Available commands in `0.3.21`:
751
+ Available commands in `0.3.23`:
700
752
 
701
753
  | Command | Status |
702
754
  | --- | --- |
703
755
  | `devflow init` | Implemented |
704
756
  | `devflow spec` | Implemented: Discovery, specification, and `--continue` |
705
757
  | `devflow approve <id>` (stage `spec` by default) | Implemented |
758
+ | `devflow reopen <id>` | Implemented: withdraw a spec approval to change it |
706
759
  | `devflow status <id>` | Implemented |
707
760
  | `devflow doctor <id>` | Implemented: read-only diagnostics |
708
761
  | `devflow recover <id>` | Implemented: register existing artifacts |
@@ -928,7 +981,7 @@ devflow approve 001
928
981
  ```
929
982
 
930
983
  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,
984
+ digests. For a `0.3.23` change it binds `spec.md`, `discovery.yaml` and,
932
985
  when a manifest applies, the architecture manifest digest. Repeating the
933
986
  same approval is a no-op. If an artifact changes after validation,
934
987
  DevFlow marks it stale and refuses approval until it is regenerated and
@@ -939,7 +992,7 @@ and names the pending questions and assumptions. Approval also rejects a
939
992
  specification whose section 7 still lists open questions. Legacy `0.2.0`
940
993
  changes without `discovery.yaml` remain approvable with a warning.
941
994
 
942
- Only the `spec` stage is available in `0.3.21`, so `--stage` is optional
995
+ Only the `spec` stage is available in `0.3.23`, so `--stage` is optional
943
996
  and defaults to `spec`. `--stage plan` and `--stage review` are
944
997
  rejected. There are no `plan`, `implement` or
945
998
  `review` commands in this release.
@@ -967,6 +1020,41 @@ The generated `AGENTS.md` (or `CLAUDE.md`) tells the agent to:
967
1020
  this step. Discovery and specification prompts skip it to save tokens;
968
1021
  the specification still lists it in section 9.
969
1022
 
1023
+ ### Reopen an approved specification
1024
+
1025
+ An approved specification is a contract. To change it, reopen it first;
1026
+ editing `spec.md` directly only marks it `stale`.
1027
+
1028
+ ```bash
1029
+ devflow reopen 001 # fix or extend the spec text yourself
1030
+ devflow reopen 001 --discovery # add or change decisions with the agent
1031
+ ```
1032
+
1033
+ `reopen` asks for confirmation (skip it with `--yes`), copies the
1034
+ current `spec.md` into `history/`, records a `spec_reopened` event and
1035
+ withdraws the approval. The previous approval stays in `events.jsonl`;
1036
+ nothing is deleted.
1037
+
1038
+ Without `--discovery`, the change returns to `draft`:
1039
+
1040
+ ```bash
1041
+ # edit spec.md
1042
+ devflow spec --continue 001 # validates and registers your edited spec
1043
+ devflow approve 001
1044
+ ```
1045
+
1046
+ With `--discovery`, the change returns to `awaiting_clarification` and
1047
+ Discovery is marked pending:
1048
+
1049
+ ```bash
1050
+ devflow spec --continue 001 # Discovery session: tell the agent what changes
1051
+ devflow spec --continue 001 # writes the new spec
1052
+ devflow approve 001
1053
+ ```
1054
+
1055
+ Only an approved spec can be reopened, and only while the change is in
1056
+ `spec_approved`.
1057
+
970
1058
  ## Generated files
971
1059
 
972
1060
  ```text
@@ -1006,12 +1094,13 @@ DevFlow rebuilds or rejects it rather than trusting it.
1006
1094
 
1007
1095
  ```text
1008
1096
  generated -> validated -> approved
1009
- | |
1010
- +-> rejected +-> stale
1097
+ | | |
1098
+ +-> rejected +-> stale +-> reopen -> validated
1011
1099
  ```
1012
1100
 
1013
1101
  - An approval stores the artifact kind and its SHA-256 digest.
1014
- - Editing an approved artifact makes it stale.
1102
+ - Editing an approved artifact makes it stale. Use `devflow reopen` to
1103
+ withdraw the approval and change it on purpose.
1015
1104
  - A stale, unvalidated or orphan artifact cannot be approved.
1016
1105
  - Semantic validation rejects malformed or inconsistent histories.
1017
1106
  - 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,158 @@
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.23` · 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
+ Discovery works **level by level**. This spec covers the essentials
67
+ with the tools your project already has, plus basic security, which is
68
+ always asked, never assumed. Each question also offers a "next level"
69
+ option with a short explanation. Whatever you don't choose now becomes a
70
+ suggested next spec.
71
+
72
+ ### 3. Continue until the spec is written
73
+
74
+ ```bash
75
+ devflow spec --continue 001
76
+ ```
77
+
78
+ Each command opens at most one chat. Run it again if there are pending
79
+ questions, and once more to write `spec.md`. Exit the chat only after
80
+ the agent says `spec.md` is written.
81
+
82
+ Prefer one command for both phases? Add `--auto` to the first command:
83
+ `devflow spec "Add a contact form" --auto`.
84
+
85
+ ### 4. Review and approve
86
+
87
+ Read `.devflow/specs/001-…/spec.md`. Section 10.1 lists the suggested
88
+ next specs, each with its `devflow spec "..."` command. Then:
89
+
90
+ ```bash
91
+ devflow approve 001
92
+ ```
93
+
94
+ ### 5. Implement
95
+
96
+ Open your agent normally (not through DevFlow) and ask:
97
+
98
+ ```text
99
+ Implement .devflow/specs/001-add-a-contact-form/spec.md
100
+ ```
101
+
102
+ The `AGENTS.md` file created by `devflow init` tells the agent to check
103
+ the approval, follow your code standards, build only the listed
104
+ requirements and report every acceptance criterion.
105
+
106
+ ### 6. Change an approved spec (if needed)
107
+
108
+ ```bash
109
+ devflow reopen 001 # you edit spec.md yourself
110
+ devflow reopen 001 --discovery # the agent asks about the new decisions
111
+ ```
112
+
113
+ Then run `devflow spec --continue 001` and approve again. The previous
114
+ version is kept in `history/`.
115
+
116
+ ## Everyday commands
117
+
118
+ | Command | What it does |
119
+ | --- | --- |
120
+ | `devflow init` | Prepare the project and the agent integration |
121
+ | `devflow spec "…"` | Start a change with Discovery |
122
+ | `devflow spec --continue 001` | Resume Discovery or write the spec |
123
+ | `devflow approve 001` | Approve the spec |
124
+ | `devflow reopen 001` | Withdraw the approval to change the spec |
125
+ | `devflow status 001` | Show where the change is and the next command |
126
+
127
+ ## When something looks wrong
128
+
129
+ `devflow status 001` always ends with a `Next:` line. If it suggests
130
+ `devflow doctor 001`, run it: `doctor` explains the problem and, when
131
+ possible, suggests `devflow recover 001` to register files that were
132
+ written outside the normal flow.
133
+
134
+ ## Good to know
135
+
136
+ - **Validation is free.** DevFlow checks Discovery and the spec with
137
+ local Python code; it does not call the model to do it.
138
+ - **Fewer wasted tokens.** Questions are cheap; rewriting code after a
139
+ misunderstanding is expensive. An approved spec avoids most of those
140
+ rewrites.
141
+ - **Grow step by step.** After approval, `devflow status 001` suggests
142
+ the next level as a new spec.
143
+ - **Small changes don't need DevFlow.** Use it when a change involves
144
+ decisions: new features, integrations, refactors.
145
+ - **Without a chat.** `--mode non-interactive` runs the agent in the
146
+ background. It cannot ask questions, so use it once decisions are
147
+ made.
148
+
149
+ ## Learn more
150
+
151
+ - [Full reference](docs/REFERENCE.md): every command, option, file and
152
+ rule.
153
+ - [Changelog](CHANGELOG.md)
154
+ - [How to publish a release](PUBLISHING.md)
155
+
156
+ ## License
157
+
158
+ MIT