codexspec 0.7.13__tar.gz → 0.7.14__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 (77) hide show
  1. {codexspec-0.7.13 → codexspec-0.7.14}/PKG-INFO +4 -1
  2. {codexspec-0.7.13 → codexspec-0.7.14}/README.md +3 -0
  3. {codexspec-0.7.13 → codexspec-0.7.14}/pyproject.toml +1 -1
  4. {codexspec-0.7.13 → codexspec-0.7.14}/src/codexspec/__init__.py +180 -1
  5. codexspec-0.7.14/src/codexspec/automation.py +946 -0
  6. codexspec-0.7.14/src/codexspec/blueprint.py +431 -0
  7. {codexspec-0.7.13 → codexspec-0.7.14}/src/codexspec/commands/installer.py +25 -4
  8. {codexspec-0.7.13 → codexspec-0.7.14}/src/codexspec/integrations/codex.py +2 -0
  9. {codexspec-0.7.13 → codexspec-0.7.14}/src/codexspec/translator.py +10 -0
  10. codexspec-0.7.14/templates/commands/auto-dev.md +148 -0
  11. codexspec-0.7.14/templates/commands/blueprint.md +128 -0
  12. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/generate-spec.md +7 -0
  13. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/implement-tasks.md +8 -1
  14. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/plan-to-tasks.md +7 -0
  15. codexspec-0.7.14/templates/commands/reverse-spec.md +589 -0
  16. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/review-code.md +55 -1
  17. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/spec-to-design.md +7 -0
  18. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/spec-to-plan.md +7 -0
  19. {codexspec-0.7.13 → codexspec-0.7.14}/templates/translations/de.json +54 -1
  20. {codexspec-0.7.13 → codexspec-0.7.14}/templates/translations/en.json +54 -1
  21. {codexspec-0.7.13 → codexspec-0.7.14}/templates/translations/es.json +54 -1
  22. {codexspec-0.7.13 → codexspec-0.7.14}/templates/translations/fr.json +54 -1
  23. {codexspec-0.7.13 → codexspec-0.7.14}/templates/translations/ja.json +54 -1
  24. {codexspec-0.7.13 → codexspec-0.7.14}/templates/translations/ko.json +54 -1
  25. {codexspec-0.7.13 → codexspec-0.7.14}/templates/translations/pt-BR.json +54 -1
  26. {codexspec-0.7.13 → codexspec-0.7.14}/templates/translations/zh-CN.json +54 -1
  27. {codexspec-0.7.13 → codexspec-0.7.14}/.gitignore +0 -0
  28. {codexspec-0.7.13 → codexspec-0.7.14}/LICENSE +0 -0
  29. {codexspec-0.7.13 → codexspec-0.7.14}/codexspec-icon.svg +0 -0
  30. {codexspec-0.7.13 → codexspec-0.7.14}/codexspec-logo-dark.svg +0 -0
  31. {codexspec-0.7.13 → codexspec-0.7.14}/codexspec-logo-light.svg +0 -0
  32. {codexspec-0.7.13 → codexspec-0.7.14}/scripts/bash/check-i18n-completeness.sh +0 -0
  33. {codexspec-0.7.13 → codexspec-0.7.14}/scripts/bash/check-i18n-structure.sh +0 -0
  34. {codexspec-0.7.13 → codexspec-0.7.14}/scripts/bash/check-prerequisites.sh +0 -0
  35. {codexspec-0.7.13 → codexspec-0.7.14}/scripts/bash/common.sh +0 -0
  36. {codexspec-0.7.13 → codexspec-0.7.14}/scripts/bash/create-new-feature.sh +0 -0
  37. {codexspec-0.7.13 → codexspec-0.7.14}/scripts/bash/review-context.sh +0 -0
  38. {codexspec-0.7.13 → codexspec-0.7.14}/scripts/powershell/check-prerequisites.ps1 +0 -0
  39. {codexspec-0.7.13 → codexspec-0.7.14}/scripts/powershell/common.ps1 +0 -0
  40. {codexspec-0.7.13 → codexspec-0.7.14}/scripts/powershell/create-new-feature.ps1 +0 -0
  41. {codexspec-0.7.13 → codexspec-0.7.14}/scripts/powershell/review-context.ps1 +0 -0
  42. {codexspec-0.7.13 → codexspec-0.7.14}/src/codexspec/commands/__init__.py +0 -0
  43. {codexspec-0.7.13 → codexspec-0.7.14}/src/codexspec/i18n.py +0 -0
  44. {codexspec-0.7.13 → codexspec-0.7.14}/src/codexspec/idea.md +0 -0
  45. {codexspec-0.7.13 → codexspec-0.7.14}/src/codexspec/integrations/__init__.py +0 -0
  46. {codexspec-0.7.13 → codexspec-0.7.14}/src/codexspec/integrations/base.py +0 -0
  47. {codexspec-0.7.13 → codexspec-0.7.14}/src/codexspec/integrations/claude.py +0 -0
  48. {codexspec-0.7.13 → codexspec-0.7.14}/src/codexspec/profile.py +0 -0
  49. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/analyze.md +0 -0
  50. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/checklist.md +0 -0
  51. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/clarify.md +0 -0
  52. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/commit-staged.md +0 -0
  53. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/config.md +0 -0
  54. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/constitution.md +0 -0
  55. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/debug.md +0 -0
  56. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/distill.md +0 -0
  57. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/evolve.md +0 -0
  58. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/onboard.md +0 -0
  59. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/pr.md +0 -0
  60. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/quick.md +0 -0
  61. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/release-notes.md +0 -0
  62. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/review-design.md +0 -0
  63. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/review-plan.md +0 -0
  64. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/review-spec.md +0 -0
  65. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/review-tasks.md +0 -0
  66. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/specify.md +0 -0
  67. {codexspec-0.7.13 → codexspec-0.7.14}/templates/commands/tasks-to-issues.md +0 -0
  68. {codexspec-0.7.13 → codexspec-0.7.14}/templates/docs/checklist-template.md +0 -0
  69. {codexspec-0.7.13 → codexspec-0.7.14}/templates/docs/constitution-template.md +0 -0
  70. {codexspec-0.7.13 → codexspec-0.7.14}/templates/docs/design-template.md +0 -0
  71. {codexspec-0.7.13 → codexspec-0.7.14}/templates/docs/plan-template-detailed.md +0 -0
  72. {codexspec-0.7.13 → codexspec-0.7.14}/templates/docs/plan-template-simple.md +0 -0
  73. {codexspec-0.7.13 → codexspec-0.7.14}/templates/docs/requirements-template.md +0 -0
  74. {codexspec-0.7.13 → codexspec-0.7.14}/templates/docs/spec-template-detailed.md +0 -0
  75. {codexspec-0.7.13 → codexspec-0.7.14}/templates/docs/spec-template-simple.md +0 -0
  76. {codexspec-0.7.13 → codexspec-0.7.14}/templates/docs/tasks-template-detailed.md +0 -0
  77. {codexspec-0.7.13 → codexspec-0.7.14}/templates/docs/tasks-template-simple.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: codexspec
3
- Version: 0.7.13
3
+ Version: 0.7.14
4
4
  Summary: CodexSpec - A Requirements-First SDD toolkit for Claude Code
5
5
  Project-URL: Homepage, https://github.com/Zts0hg/codexspec
6
6
  Project-URL: Repository, https://github.com/Zts0hg/codexspec
@@ -576,11 +576,13 @@ Implementation follows **conditional TDD workflow**:
576
576
  | ---------------------------- | ----------------------------------------------------------------- |
577
577
  | `/codexspec:constitution` | Create/update project constitution with cross-artifact validation |
578
578
  | `/codexspec:specify` | Clarify, confirm, and persist requirements in `requirements.md` |
579
+ | `/codexspec:blueprint` | Discuss and maintain confirmed requirements in the shared blueprint |
579
580
  | `/codexspec:generate-spec` | Generate `spec.md` document ★ Auto-review |
580
581
  | `/codexspec:spec-to-design` | Produce `design.md` (architecture/components/decisions) ★ Auto-review |
581
582
  | `/codexspec:spec-to-plan` | Convert design to implementation plan ★ Auto-review |
582
583
  | `/codexspec:plan-to-tasks` | Break down plan into traceable, verifiable tasks ★ Auto-review |
583
584
  | `/codexspec:implement-tasks` | Execute tasks (conditional TDD) |
585
+ | `/codexspec:auto-dev` | Autonomously develop all pending blueprint requirements in order |
584
586
 
585
587
  #### Review Commands (Quality Gates)
586
588
 
@@ -601,6 +603,7 @@ Implementation follows **conditional TDD workflow**:
601
603
  | `/codexspec:checklist` | Generate requirements quality checklist |
602
604
  | `/codexspec:tasks-to-issues` | Convert tasks to GitHub Issues |
603
605
  | `/codexspec:debug` | Systematic root-cause debugging (4 phases; standalone or escalated from implement-tasks) |
606
+ | `/codexspec:reverse-spec` | Reverse-derive spec/design from existing code, then reconcile code against the confirmed baseline |
604
607
 
605
608
  #### Self-Evolution Commands
606
609
 
@@ -531,11 +531,13 @@ Implementation follows **conditional TDD workflow**:
531
531
  | ---------------------------- | ----------------------------------------------------------------- |
532
532
  | `/codexspec:constitution` | Create/update project constitution with cross-artifact validation |
533
533
  | `/codexspec:specify` | Clarify, confirm, and persist requirements in `requirements.md` |
534
+ | `/codexspec:blueprint` | Discuss and maintain confirmed requirements in the shared blueprint |
534
535
  | `/codexspec:generate-spec` | Generate `spec.md` document ★ Auto-review |
535
536
  | `/codexspec:spec-to-design` | Produce `design.md` (architecture/components/decisions) ★ Auto-review |
536
537
  | `/codexspec:spec-to-plan` | Convert design to implementation plan ★ Auto-review |
537
538
  | `/codexspec:plan-to-tasks` | Break down plan into traceable, verifiable tasks ★ Auto-review |
538
539
  | `/codexspec:implement-tasks` | Execute tasks (conditional TDD) |
540
+ | `/codexspec:auto-dev` | Autonomously develop all pending blueprint requirements in order |
539
541
 
540
542
  #### Review Commands (Quality Gates)
541
543
 
@@ -556,6 +558,7 @@ Implementation follows **conditional TDD workflow**:
556
558
  | `/codexspec:checklist` | Generate requirements quality checklist |
557
559
  | `/codexspec:tasks-to-issues` | Convert tasks to GitHub Issues |
558
560
  | `/codexspec:debug` | Systematic root-cause debugging (4 phases; standalone or escalated from implement-tasks) |
561
+ | `/codexspec:reverse-spec` | Reverse-derive spec/design from existing code, then reconcile code against the confirmed baseline |
559
562
 
560
563
  #### Self-Evolution Commands
561
564
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "codexspec"
3
- version = "0.7.13"
3
+ version = "0.7.14"
4
4
  description = "CodexSpec - A Requirements-First SDD toolkit for Claude Code"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -6,6 +6,7 @@ This toolkit provides a structured approach to software development using
6
6
  executable specifications that guide AI-assisted implementation.
7
7
  """
8
8
 
9
+ import json
9
10
  import re
10
11
  import subprocess
11
12
  import sys
@@ -19,6 +20,19 @@ from rich.panel import Panel
19
20
  from rich.prompt import Confirm, Prompt
20
21
  from rich.table import Table
21
22
 
23
+ from .automation import (
24
+ AUTO_DEV_HEARTBEAT_INTERVAL_SECONDS,
25
+ AutoDevGit,
26
+ AutoDevOwnership,
27
+ AutomationError,
28
+ BlueprintStore,
29
+ OwnershipError,
30
+ WorkspaceContext,
31
+ ensure_dedicated_workspace,
32
+ locate_dedicated_workspace,
33
+ locate_repository,
34
+ )
35
+ from .blueprint import PROTOCOL_VERSION
22
36
  from .commands.installer import (
23
37
  COMMANDS_SUBDIR,
24
38
  detect_old_structure,
@@ -44,7 +58,7 @@ from .profile import ensure_profile_scaffold, inject_profile_block
44
58
  from .translator import SUPPORTED_LANGUAGES, translate
45
59
 
46
60
  # Version info
47
- __version__ = "0.7.13"
61
+ __version__ = "0.7.14"
48
62
  __author__ = "CodexSpec Team"
49
63
 
50
64
  # Constitution file path constants
@@ -174,6 +188,166 @@ def check() -> None:
174
188
  console.print(table)
175
189
 
176
190
 
191
+ def _machine_json(value: object) -> None:
192
+ sys.stdout.write(json.dumps(value, sort_keys=True, separators=(",", ":")) + "\n")
193
+
194
+
195
+ def _stdin_json() -> dict:
196
+ try:
197
+ value = json.loads(sys.stdin.read() or "{}")
198
+ except json.JSONDecodeError as exc:
199
+ raise AutomationError("invalid_json", str(exc)) from exc
200
+ if not isinstance(value, dict):
201
+ raise AutomationError("invalid_json_object")
202
+ return value
203
+
204
+
205
+ def _automation_failure(exc: Exception) -> None:
206
+ typer.echo(str(exc), err=True)
207
+ raise typer.Exit(1)
208
+
209
+
210
+ @app.command("_blueprint-helper", hidden=True)
211
+ def blueprint_helper(
212
+ action: str = typer.Argument(..., help="Internal helper action"),
213
+ ensure: bool = typer.Option(False, "--ensure", help="Create the dedicated workspace when missing"),
214
+ auto_dev_token: str | None = typer.Option(None, "--auto-dev-token", help="Fence an auto-dev status update"),
215
+ ) -> None:
216
+ """Internal machine interface for blueprint inspection and mutation."""
217
+ try:
218
+ context = locate_repository(Path.cwd())
219
+ workspace = ensure_dedicated_workspace(context) if ensure else locate_dedicated_workspace(context)
220
+ store = BlueprintStore(workspace)
221
+ if action == "inspect":
222
+ if auto_dev_token is not None:
223
+ raise AutomationError("unexpected_auto_dev_token")
224
+ content, current_hash = store.inspect()
225
+ _machine_json(
226
+ {
227
+ "protocol_version": PROTOCOL_VERSION,
228
+ "repository_root": str(context.repository_root),
229
+ "worktree_path": str(workspace.path),
230
+ "blueprint_exists": workspace.blueprint_path.exists(),
231
+ "blueprint_hash": current_hash,
232
+ "content": content.decode("utf-8"),
233
+ }
234
+ )
235
+ return
236
+ if action == "apply":
237
+ response = store.apply_and_commit(sys.stdin.buffer.read(), owner_token=auto_dev_token)
238
+ _machine_json(response)
239
+ return
240
+ raise AutomationError("unsupported_blueprint_helper_action", action)
241
+ except (AutomationError, OwnershipError, OSError, UnicodeError, ValueError) as exc:
242
+ _automation_failure(exc)
243
+
244
+
245
+ @app.command("_auto-dev-helper", hidden=True)
246
+ def auto_dev_helper(action: str = typer.Argument(..., help="Internal helper action")) -> None:
247
+ """Internal machine interface for auto-dev ownership and Git writes."""
248
+ try:
249
+ body = _stdin_json()
250
+ context = locate_repository(Path.cwd())
251
+ ownership = AutoDevOwnership(context)
252
+ workspace: WorkspaceContext | None = None
253
+ service: AutoDevGit | None = None
254
+ if action != "acquire":
255
+ # Every non-acquire action legitimately waits behind the active run.
256
+ workspace = ensure_dedicated_workspace(context)
257
+ service = AutoDevGit(workspace, ownership)
258
+ if action == "acquire":
259
+ if body:
260
+ raise AutomationError("unexpected_fields")
261
+ token = ownership.acquire()
262
+ workspace = ensure_dedicated_workspace(context)
263
+ service = AutoDevGit(workspace, ownership)
264
+ try:
265
+ merge_recovery = service.recover_merge_ownership(token)
266
+ if merge_recovery["state"] == "none":
267
+ BlueprintStore(workspace).recover_pending_transaction(owner_token=token)
268
+ elif BlueprintStore(workspace).recovery_path.exists():
269
+ raise AutomationError("concurrent_recovery_records")
270
+ except Exception:
271
+ ownership.release(token)
272
+ raise
273
+ _machine_json(
274
+ {
275
+ "state": "acquired",
276
+ "token": token,
277
+ "worktree_path": str(workspace.path),
278
+ "heartbeat_interval_seconds": AUTO_DEV_HEARTBEAT_INTERVAL_SECONDS,
279
+ "merge_recovery": merge_recovery,
280
+ }
281
+ )
282
+ return
283
+ if set(body) < {"token"} or not isinstance(body.get("token"), str):
284
+ raise AutomationError("missing_token")
285
+ token = body["token"]
286
+ if action in {"renew", "assert-owner", "release", "sync-default", "abort-sync"} and set(body) != {"token"}:
287
+ raise AutomationError("unexpected_fields")
288
+ if action == "renew":
289
+ ownership.renew(token)
290
+ result = {"state": "renewed"}
291
+ elif action == "assert-owner":
292
+ ownership.assert_owner(token)
293
+ result = {"state": "owner"}
294
+ elif action == "release":
295
+ ownership.release(token)
296
+ result = {"state": "released"}
297
+ elif action == "sync-default":
298
+ result = service.sync_default(token)
299
+ elif action == "prepare-sync-verification":
300
+ if set(body) != {"token", "resolved_paths"} or not isinstance(body["resolved_paths"], list):
301
+ raise AutomationError("invalid_prepare_sync_request")
302
+ if not body["resolved_paths"] or not all(isinstance(path, str) for path in body["resolved_paths"]):
303
+ raise AutomationError("invalid_prepare_sync_request")
304
+ result = service.prepare_sync_verification(token, body["resolved_paths"])
305
+ elif action == "abort-sync":
306
+ result = service.abort_sync(token)
307
+ elif action == "continue-sync":
308
+ if set(body) != {"token", "checks_passed"} or not isinstance(body["checks_passed"], bool):
309
+ raise AutomationError("invalid_continue_sync_request")
310
+ result = service.continue_sync(token, checks_passed=body["checks_passed"])
311
+ elif action == "commit-feature":
312
+ if set(body) != {"token", "feature_id", "commit_type", "description", "paths"}:
313
+ raise AutomationError("invalid_commit_feature_request")
314
+ if not all(isinstance(body[key], str) for key in ("feature_id", "commit_type", "description")):
315
+ raise AutomationError("invalid_commit_feature_request")
316
+ if not isinstance(body["paths"], list) or not all(isinstance(item, str) for item in body["paths"]):
317
+ raise AutomationError("invalid_commit_feature_request")
318
+ result = service.commit_feature(
319
+ token, body["feature_id"], body["commit_type"], body["description"], body["paths"]
320
+ )
321
+ else:
322
+ raise AutomationError("unsupported_auto_dev_helper_action", action)
323
+ _machine_json(result)
324
+ except (AutomationError, OwnershipError, OSError, ValueError) as exc:
325
+ _automation_failure(exc)
326
+
327
+
328
+ @app.command("show-blueprint")
329
+ def show_blueprint() -> None:
330
+ """Print the dedicated worktree's current blueprint without changing it."""
331
+ context = None
332
+ try:
333
+ context = locate_repository(Path.cwd())
334
+ workspace = locate_dedicated_workspace(context)
335
+ if not workspace.blueprint_path.is_file():
336
+ raise AutomationError("missing_blueprint")
337
+ content = workspace.blueprint_path.read_bytes()
338
+ sys.stdout.buffer.write(content)
339
+ sys.stdout.buffer.flush()
340
+ except (AutomationError, OSError) as exc:
341
+ code = exc.code if isinstance(exc, AutomationError) else "blueprint_read_failed"
342
+ config_file = context.repository_root / ".codexspec/config.yml" if context else None
343
+ language = get_interaction_language(config_file) if config_file else "en"
344
+ message = translate(f"cli.show_blueprint.{code}", language)
345
+ if message.startswith("cli.show_blueprint."):
346
+ message = translate("cli.show_blueprint.unknown", language, error=str(exc))
347
+ typer.echo(message, err=True)
348
+ raise typer.Exit(1)
349
+
350
+
177
351
  # workflow.auto_next toggle (used by the ``config --auto-next`` option).
178
352
  # Defined here because ``config()``'s ``flag_value`` default is evaluated at
179
353
  # function-definition time.
@@ -1479,6 +1653,7 @@ The following slash commands are available in this project:
1479
1653
  |---------|-------------|
1480
1654
  | `/codexspec:constitution` | Create or update project governing principles |
1481
1655
  | `/codexspec:specify` | Define what you want to build (requirements and user stories) |
1656
+ | `/codexspec:blueprint` | Discuss and maintain confirmed requirements in the shared blueprint |
1482
1657
  | `/codexspec:generate-spec` | Generate detailed specification from high-level requirements |
1483
1658
  | `/codexspec:spec-to-plan` | Convert specification to technical implementation plan |
1484
1659
  | `/codexspec:plan-to-tasks` | Break down plan into actionable tasks |
@@ -1486,6 +1661,7 @@ The following slash commands are available in this project:
1486
1661
  | `/codexspec:review-plan` | Review technical plan for feasibility |
1487
1662
  | `/codexspec:review-tasks` | Review task breakdown for completeness |
1488
1663
  | `/codexspec:implement-tasks` | Execute tasks according to the breakdown |
1664
+ | `/codexspec:auto-dev` | Autonomously develop pending blueprint requirements in document order |
1489
1665
 
1490
1666
  ### Enhanced Commands
1491
1667
 
@@ -1531,6 +1707,9 @@ The following slash commands are available in this project:
1531
1707
 
1532
1708
  > **Shortcut**: For small, self-contained requirements, run `/codexspec:quick` to
1533
1709
  > auto-run spec → plan → tasks → implementation in one shot.
1710
+ >
1711
+ > **Continuous development**: Use `/codexspec:blueprint` to prepare confirmed requirements and
1712
+ > `/codexspec:auto-dev` to develop them in document order.
1534
1713
 
1535
1714
  ## Directory Structure
1536
1715