pactkit-codex 0.1.0__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 (299) hide show
  1. pactkit_codex-0.1.0/.claude/CLAUDE.local.md +70 -0
  2. pactkit_codex-0.1.0/.claude/CLAUDE.md +14 -0
  3. pactkit_codex-0.1.0/.claude/pactkit.yaml +140 -0
  4. pactkit_codex-0.1.0/.gitignore +13 -0
  5. pactkit_codex-0.1.0/AGENTS.md +4 -0
  6. pactkit_codex-0.1.0/LICENSE +21 -0
  7. pactkit_codex-0.1.0/PKG-INFO +227 -0
  8. pactkit_codex-0.1.0/README.md +196 -0
  9. pactkit_codex-0.1.0/docs/architecture/governance/lessons.md +7 -0
  10. pactkit_codex-0.1.0/docs/architecture/governance/rules.md +12 -0
  11. pactkit_codex-0.1.0/docs/architecture/graphs/call_graph.mmd +83 -0
  12. pactkit_codex-0.1.0/docs/architecture/graphs/class_graph.mmd +78 -0
  13. pactkit_codex-0.1.0/docs/architecture/graphs/code_graph.mmd +132 -0
  14. pactkit_codex-0.1.0/docs/architecture/graphs/system_design.mmd +46 -0
  15. pactkit_codex-0.1.0/docs/product/context.md +26 -0
  16. pactkit_codex-0.1.0/docs/product/prd.md +265 -0
  17. pactkit_codex-0.1.0/docs/product/sprint_board.md +111 -0
  18. pactkit_codex-0.1.0/docs/reference/codex-integration-preresearch.md +196 -0
  19. pactkit_codex-0.1.0/docs/reference/pactkit-architecture.md +96 -0
  20. pactkit_codex-0.1.0/docs/reference/pactkit-profiles.py +201 -0
  21. pactkit_codex-0.1.0/docs/reference/pactkit-prompts-inventory.md +97 -0
  22. pactkit_codex-0.1.0/docs/reference/startup-prompt.md +41 -0
  23. pactkit_codex-0.1.0/docs/reference/tool-integration-checklist.md +272 -0
  24. pactkit_codex-0.1.0/docs/specs/BUG-001.md +59 -0
  25. pactkit_codex-0.1.0/docs/specs/BUG-002.md +71 -0
  26. pactkit_codex-0.1.0/docs/specs/BUG-003.md +78 -0
  27. pactkit_codex-0.1.0/docs/specs/BUG-004.md +88 -0
  28. pactkit_codex-0.1.0/docs/specs/BUG-005.md +157 -0
  29. pactkit_codex-0.1.0/docs/specs/STORY-001.md +128 -0
  30. pactkit_codex-0.1.0/docs/specs/STORY-002.md +144 -0
  31. pactkit_codex-0.1.0/docs/specs/STORY-003.md +111 -0
  32. pactkit_codex-0.1.0/docs/specs/STORY-004.md +132 -0
  33. pactkit_codex-0.1.0/docs/specs/STORY-005.md +131 -0
  34. pactkit_codex-0.1.0/docs/specs/STORY-006.md +144 -0
  35. pactkit_codex-0.1.0/docs/specs/STORY-007.md +117 -0
  36. pactkit_codex-0.1.0/docs/specs/STORY-008.md +150 -0
  37. pactkit_codex-0.1.0/docs/specs/STORY-009.md +116 -0
  38. pactkit_codex-0.1.0/docs/specs/STORY-010.md +165 -0
  39. pactkit_codex-0.1.0/docs/specs/STORY-011.md +180 -0
  40. pactkit_codex-0.1.0/docs/specs/STORY-012.md +193 -0
  41. pactkit_codex-0.1.0/pyproject.toml +93 -0
  42. pactkit_codex-0.1.0/src/pactkit_codex/__init__.py +3 -0
  43. pactkit_codex-0.1.0/src/pactkit_codex/backfill.py +72 -0
  44. pactkit_codex-0.1.0/src/pactkit_codex/cleaners.py +84 -0
  45. pactkit_codex-0.1.0/src/pactkit_codex/cli.py +643 -0
  46. pactkit_codex-0.1.0/src/pactkit_codex/config.py +1002 -0
  47. pactkit_codex-0.1.0/src/pactkit_codex/context_gen.py +235 -0
  48. pactkit_codex-0.1.0/src/pactkit_codex/coverage_gate.py +115 -0
  49. pactkit_codex-0.1.0/src/pactkit_codex/doctor.py +183 -0
  50. pactkit_codex-0.1.0/src/pactkit_codex/generators/__init__.py +0 -0
  51. pactkit_codex-0.1.0/src/pactkit_codex/generators/adapter.py +62 -0
  52. pactkit_codex-0.1.0/src/pactkit_codex/generators/deployer.py +707 -0
  53. pactkit_codex-0.1.0/src/pactkit_codex/guards.py +85 -0
  54. pactkit_codex-0.1.0/src/pactkit_codex/id_generator.py +37 -0
  55. pactkit_codex-0.1.0/src/pactkit_codex/invariants.py +36 -0
  56. pactkit_codex-0.1.0/src/pactkit_codex/issue_sync.py +156 -0
  57. pactkit_codex-0.1.0/src/pactkit_codex/lazy_visualize.py +120 -0
  58. pactkit_codex-0.1.0/src/pactkit_codex/lessons.py +80 -0
  59. pactkit_codex-0.1.0/src/pactkit_codex/lint_runner.py +91 -0
  60. pactkit_codex-0.1.0/src/pactkit_codex/profiles.py +158 -0
  61. pactkit_codex-0.1.0/src/pactkit_codex/prompts/__init__.py +57 -0
  62. pactkit_codex-0.1.0/src/pactkit_codex/prompts/agents.py +312 -0
  63. pactkit_codex-0.1.0/src/pactkit_codex/prompts/commands.py +698 -0
  64. pactkit_codex-0.1.0/src/pactkit_codex/prompts/references.py +419 -0
  65. pactkit_codex-0.1.0/src/pactkit_codex/prompts/rules.py +459 -0
  66. pactkit_codex-0.1.0/src/pactkit_codex/prompts/skills.py +555 -0
  67. pactkit_codex-0.1.0/src/pactkit_codex/prompts/workflows.py +774 -0
  68. pactkit_codex-0.1.0/src/pactkit_codex/regression.py +74 -0
  69. pactkit_codex-0.1.0/src/pactkit_codex/schemas.py +210 -0
  70. pactkit_codex-0.1.0/src/pactkit_codex/scripts.py +122 -0
  71. pactkit_codex-0.1.0/src/pactkit_codex/sec_scope.py +225 -0
  72. pactkit_codex-0.1.0/src/pactkit_codex/skills/__init__.py +30 -0
  73. pactkit_codex-0.1.0/src/pactkit_codex/skills/board.py +309 -0
  74. pactkit_codex-0.1.0/src/pactkit_codex/skills/scaffold.py +452 -0
  75. pactkit_codex-0.1.0/src/pactkit_codex/skills/spec_linter.py +416 -0
  76. pactkit_codex-0.1.0/src/pactkit_codex/skills/visualize.py +2108 -0
  77. pactkit_codex-0.1.0/src/pactkit_codex/spec_status.py +50 -0
  78. pactkit_codex-0.1.0/src/pactkit_codex/test_mapper.py +60 -0
  79. pactkit_codex-0.1.0/src/pactkit_codex/utils.py +9 -0
  80. pactkit_codex-0.1.0/src/pactkit_codex/validators.py +132 -0
  81. pactkit_codex-0.1.0/tests/e2e/test_story008_codex_e2e.py +170 -0
  82. pactkit_codex-0.1.0/tests/pactkit/conftest.py +145 -0
  83. pactkit_codex-0.1.0/tests/pactkit/e2e/__init__.py +0 -0
  84. pactkit_codex-0.1.0/tests/pactkit/e2e/cli/__init__.py +0 -0
  85. pactkit_codex-0.1.0/tests/pactkit/e2e/cli/test_cli_e2e.py +447 -0
  86. pactkit_codex-0.1.0/tests/pactkit/integration/__init__.py +0 -0
  87. pactkit_codex-0.1.0/tests/pactkit/integration/test_deploy_classic.py +63 -0
  88. pactkit_codex-0.1.0/tests/pactkit/unit/test_agent_features.py +138 -0
  89. pactkit_codex-0.1.0/tests/pactkit/unit/test_agent_frontmatter.py +106 -0
  90. pactkit_codex-0.1.0/tests/pactkit/unit/test_agents_enrichment.py +180 -0
  91. pactkit_codex-0.1.0/tests/pactkit/unit/test_board_bug027.py +174 -0
  92. pactkit_codex-0.1.0/tests/pactkit/unit/test_board_sections.py +296 -0
  93. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug001_skill_path.py +92 -0
  94. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug002_plugin_paths.py +219 -0
  95. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug003_multi_import.py +80 -0
  96. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug004_dead_set.py +53 -0
  97. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug005_archive_taskless.py +71 -0
  98. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug006_scan_excludes.py +149 -0
  99. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug007_stale_trace_refs.py +111 -0
  100. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug008_stale_command_refs.py +180 -0
  101. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug009_project_config_backfill.py +344 -0
  102. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug010_rewrite_yaml.py +195 -0
  103. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug011_stale_refs.py +113 -0
  104. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug012_call_graph_filter.py +271 -0
  105. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug013_config_single_source.py +294 -0
  106. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug014_version_hygiene.py +164 -0
  107. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug017_project_init_playbook.py +43 -0
  108. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug018_issue_tracker_verification.py +85 -0
  109. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug019_venv_deployment.py +173 -0
  110. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug020_claude_md_backup.py +197 -0
  111. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug025_release_delegation.py +147 -0
  112. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug026_version_sync.py +153 -0
  113. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug028_ghost_refs.py +86 -0
  114. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug029_stack_detection_fallback.py +70 -0
  115. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug030_spec_lint_cli.py +183 -0
  116. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug031_docstring_accuracy.py +82 -0
  117. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug034_plan_metadata_template.py +45 -0
  118. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug035_opencode_dual_layer.py +110 -0
  119. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug_021.py +341 -0
  120. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug_022.py +193 -0
  121. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug_023.py +286 -0
  122. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug_024.py +204 -0
  123. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug_slim001_env_detection.py +70 -0
  124. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug_slim002_instruction_collision.py +169 -0
  125. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug_slim003.py +238 -0
  126. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug_slim004.py +152 -0
  127. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug_slim005.py +111 -0
  128. pactkit_codex-0.1.0/tests/pactkit/unit/test_bug_slim006.py +214 -0
  129. pactkit_codex-0.1.0/tests/pactkit/unit/test_check_command.py +123 -0
  130. pactkit_codex-0.1.0/tests/pactkit/unit/test_command_frontmatter.py +120 -0
  131. pactkit_codex-0.1.0/tests/pactkit/unit/test_command_visualize_modes.py +83 -0
  132. pactkit_codex-0.1.0/tests/pactkit/unit/test_config.py +308 -0
  133. pactkit_codex-0.1.0/tests/pactkit/unit/test_config_auto_merge.py +423 -0
  134. pactkit_codex-0.1.0/tests/pactkit/unit/test_constitution_sharpening.py +194 -0
  135. pactkit_codex-0.1.0/tests/pactkit/unit/test_create_skill.py +150 -0
  136. pactkit_codex-0.1.0/tests/pactkit/unit/test_cross_flow_matrix.py +104 -0
  137. pactkit_codex-0.1.0/tests/pactkit/unit/test_deploy_opencode_parity.py +333 -0
  138. pactkit_codex-0.1.0/tests/pactkit/unit/test_deployer_cleanup.py +205 -0
  139. pactkit_codex-0.1.0/tests/pactkit/unit/test_deployer_plugin.py +269 -0
  140. pactkit_codex-0.1.0/tests/pactkit/unit/test_design_command.py +396 -0
  141. pactkit_codex-0.1.0/tests/pactkit/unit/test_done_gates.py +144 -0
  142. pactkit_codex-0.1.0/tests/pactkit/unit/test_draw_prompt.py +165 -0
  143. pactkit_codex-0.1.0/tests/pactkit/unit/test_draw_references.py +93 -0
  144. pactkit_codex-0.1.0/tests/pactkit/unit/test_drawio_mcp.py +82 -0
  145. pactkit_codex-0.1.0/tests/pactkit/unit/test_home_path_fix.py +138 -0
  146. pactkit_codex-0.1.0/tests/pactkit/unit/test_hotfix_command.py +151 -0
  147. pactkit_codex-0.1.0/tests/pactkit/unit/test_init_guard.py +107 -0
  148. pactkit_codex-0.1.0/tests/pactkit/unit/test_lang_profiles.py +215 -0
  149. pactkit_codex-0.1.0/tests/pactkit/unit/test_list_stories.py +192 -0
  150. pactkit_codex-0.1.0/tests/pactkit/unit/test_mcp_integration.py +347 -0
  151. pactkit_codex-0.1.0/tests/pactkit/unit/test_model_config.py +67 -0
  152. pactkit_codex-0.1.0/tests/pactkit/unit/test_modular_constitution.py +151 -0
  153. pactkit_codex-0.1.0/tests/pactkit/unit/test_multi_prefix.py +163 -0
  154. pactkit_codex-0.1.0/tests/pactkit/unit/test_pdca_slim.py +325 -0
  155. pactkit_codex-0.1.0/tests/pactkit/unit/test_profiles.py +324 -0
  156. pactkit_codex-0.1.0/tests/pactkit/unit/test_project_visibility.py +76 -0
  157. pactkit_codex-0.1.0/tests/pactkit/unit/test_prompt_cli_refs.py +82 -0
  158. pactkit_codex-0.1.0/tests/pactkit/unit/test_prompt_structural_invariants.py +132 -0
  159. pactkit_codex-0.1.0/tests/pactkit/unit/test_prompts_package.py +246 -0
  160. pactkit_codex-0.1.0/tests/pactkit/unit/test_release.py +161 -0
  161. pactkit_codex-0.1.0/tests/pactkit/unit/test_release_field.py +150 -0
  162. pactkit_codex-0.1.0/tests/pactkit/unit/test_release_v110.py +128 -0
  163. pactkit_codex-0.1.0/tests/pactkit/unit/test_render_prompt.py +317 -0
  164. pactkit_codex-0.1.0/tests/pactkit/unit/test_review_command.py +241 -0
  165. pactkit_codex-0.1.0/tests/pactkit/unit/test_rules_enrichment.py +197 -0
  166. pactkit_codex-0.1.0/tests/pactkit/unit/test_scaffold.py +99 -0
  167. pactkit_codex-0.1.0/tests/pactkit/unit/test_scaffold_developer_prefix.py +114 -0
  168. pactkit_codex-0.1.0/tests/pactkit/unit/test_schemas.py +258 -0
  169. pactkit_codex-0.1.0/tests/pactkit/unit/test_script_extraction.py +103 -0
  170. pactkit_codex-0.1.0/tests/pactkit/unit/test_selective_deploy.py +309 -0
  171. pactkit_codex-0.1.0/tests/pactkit/unit/test_session_context.py +226 -0
  172. pactkit_codex-0.1.0/tests/pactkit/unit/test_skill_structure.py +218 -0
  173. pactkit_codex-0.1.0/tests/pactkit/unit/test_skills_enrichment.py +136 -0
  174. pactkit_codex-0.1.0/tests/pactkit/unit/test_smart_regression.py +242 -0
  175. pactkit_codex-0.1.0/tests/pactkit/unit/test_sprint_command.py +195 -0
  176. pactkit_codex-0.1.0/tests/pactkit/unit/test_stack_references.py +274 -0
  177. pactkit_codex-0.1.0/tests/pactkit/unit/test_status_command.py +163 -0
  178. pactkit_codex-0.1.0/tests/pactkit/unit/test_statusline.py +216 -0
  179. pactkit_codex-0.1.0/tests/pactkit/unit/test_story001_codex_profile.py +145 -0
  180. pactkit_codex-0.1.0/tests/pactkit/unit/test_story014_release.py +83 -0
  181. pactkit_codex-0.1.0/tests/pactkit/unit/test_story015_ci_lint_gate.py +108 -0
  182. pactkit_codex-0.1.0/tests/pactkit/unit/test_story016_claude_md.py +84 -0
  183. pactkit_codex-0.1.0/tests/pactkit/unit/test_story017_init_claude_md.py +44 -0
  184. pactkit_codex-0.1.0/tests/pactkit/unit/test_story018_arch_staleness.py +80 -0
  185. pactkit_codex-0.1.0/tests/pactkit/unit/test_story019_bailout.py +59 -0
  186. pactkit_codex-0.1.0/tests/pactkit/unit/test_story020_horizon.py +94 -0
  187. pactkit_codex-0.1.0/tests/pactkit/unit/test_story021_rfc.py +59 -0
  188. pactkit_codex-0.1.0/tests/pactkit/unit/test_story022_decision_tree.py +53 -0
  189. pactkit_codex-0.1.0/tests/pactkit/unit/test_story023_test_quality.py +72 -0
  190. pactkit_codex-0.1.0/tests/pactkit/unit/test_story024_native_agent.py +315 -0
  191. pactkit_codex-0.1.0/tests/pactkit/unit/test_story025_ci_pipeline.py +329 -0
  192. pactkit_codex-0.1.0/tests/pactkit/unit/test_story026_issue_tracker.py +126 -0
  193. pactkit_codex-0.1.0/tests/pactkit/unit/test_story027_hooks.py +112 -0
  194. pactkit_codex-0.1.0/tests/pactkit/unit/test_story028_rule_scoping.py +115 -0
  195. pactkit_codex-0.1.0/tests/pactkit/unit/test_story029_doctor.py +47 -0
  196. pactkit_codex-0.1.0/tests/pactkit/unit/test_story030_lint.py +91 -0
  197. pactkit_codex-0.1.0/tests/pactkit/unit/test_story031_git_init_guard.py +96 -0
  198. pactkit_codex-0.1.0/tests/pactkit/unit/test_story032_greenfield_redirect.py +104 -0
  199. pactkit_codex-0.1.0/tests/pactkit/unit/test_story033_config_backfill.py +280 -0
  200. pactkit_codex-0.1.0/tests/pactkit/unit/test_story034_plan_config_refresh.py +103 -0
  201. pactkit_codex-0.1.0/tests/pactkit/unit/test_story035_readme_docs.py +153 -0
  202. pactkit_codex-0.1.0/tests/pactkit/unit/test_story037_regression_fix.py +179 -0
  203. pactkit_codex-0.1.0/tests/pactkit/unit/test_story038_call_graph_update.py +145 -0
  204. pactkit_codex-0.1.0/tests/pactkit/unit/test_story039_venv_config.py +163 -0
  205. pactkit_codex-0.1.0/tests/pactkit/unit/test_story040_layered_claude_md.py +393 -0
  206. pactkit_codex-0.1.0/tests/pactkit/unit/test_story042_spec_linter.py +407 -0
  207. pactkit_codex-0.1.0/tests/pactkit/unit/test_story043_active_clarify.py +120 -0
  208. pactkit_codex-0.1.0/tests/pactkit/unit/test_story044_consistency_check.py +112 -0
  209. pactkit_codex-0.1.0/tests/pactkit/unit/test_story045_auto_pr.py +91 -0
  210. pactkit_codex-0.1.0/tests/pactkit/unit/test_story046_agent_adapter.py +295 -0
  211. pactkit_codex-0.1.0/tests/pactkit/unit/test_story047_enterprise_flags.py +272 -0
  212. pactkit_codex-0.1.0/tests/pactkit/unit/test_story048_worktree_isolation.py +169 -0
  213. pactkit_codex-0.1.0/tests/pactkit/unit/test_story049_community_standards.py +121 -0
  214. pactkit_codex-0.1.0/tests/pactkit/unit/test_story050_doc_only_shortcut.py +203 -0
  215. pactkit_codex-0.1.0/tests/pactkit/unit/test_story051_workflow_streamlining.py +255 -0
  216. pactkit_codex-0.1.0/tests/pactkit/unit/test_story052_conditional_github_release.py +189 -0
  217. pactkit_codex-0.1.0/tests/pactkit/unit/test_story053_impact_regression.py +289 -0
  218. pactkit_codex-0.1.0/tests/pactkit/unit/test_story055_commands.py +150 -0
  219. pactkit_codex-0.1.0/tests/pactkit/unit/test_story055_config.py +309 -0
  220. pactkit_codex-0.1.0/tests/pactkit/unit/test_story055_spec_linter.py +136 -0
  221. pactkit_codex-0.1.0/tests/pactkit/unit/test_story056_commands.py +162 -0
  222. pactkit_codex-0.1.0/tests/pactkit/unit/test_story056_config.py +197 -0
  223. pactkit_codex-0.1.0/tests/pactkit/unit/test_story057_implicit_cleanup.py +179 -0
  224. pactkit_codex-0.1.0/tests/pactkit/unit/test_story058_routing_fix.py +105 -0
  225. pactkit_codex-0.1.0/tests/pactkit/unit/test_story060_init_hang.py +261 -0
  226. pactkit_codex-0.1.0/tests/pactkit/unit/test_story061_remove_thinking.py +110 -0
  227. pactkit_codex-0.1.0/tests/pactkit/unit/test_story062_mcp_recommendations.py +122 -0
  228. pactkit_codex-0.1.0/tests/pactkit/unit/test_story063_prompt_slimming.py +209 -0
  229. pactkit_codex-0.1.0/tests/pactkit/unit/test_story064_venv_local_md.py +228 -0
  230. pactkit_codex-0.1.0/tests/pactkit/unit/test_story065_sprint_model.py +193 -0
  231. pactkit_codex-0.1.0/tests/pactkit/unit/test_story069_opencode_format.py +246 -0
  232. pactkit_codex-0.1.0/tests/pactkit/unit/test_story070_opencode_compliance.py +255 -0
  233. pactkit_codex-0.1.0/tests/pactkit/unit/test_story071_opencode_config_parity.py +223 -0
  234. pactkit_codex-0.1.0/tests/pactkit/unit/test_story072_developer_prefix.py +279 -0
  235. pactkit_codex-0.1.0/tests/pactkit/unit/test_story073_command_model_routing.py +240 -0
  236. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim009_lazy_rules.py +254 -0
  237. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim010_dry_refactor.py +178 -0
  238. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim011_command_rules.py +319 -0
  239. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim012_ci.py +490 -0
  240. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim014_clean.py +89 -0
  241. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim014_context.py +227 -0
  242. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim014_guard.py +69 -0
  243. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim014_lazy_viz.py +228 -0
  244. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim014_next_id.py +82 -0
  245. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim014_regression.py +120 -0
  246. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim014_sec_scope.py +288 -0
  247. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim014_validators.py +265 -0
  248. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim015_doctor.py +404 -0
  249. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim016_testmap_lint.py +198 -0
  250. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim017.py +233 -0
  251. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim018.py +136 -0
  252. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim019_plan_subphases.py +101 -0
  253. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim020_explore_stall_fix.py +91 -0
  254. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim021.py +199 -0
  255. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim022.py +337 -0
  256. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim023.py +132 -0
  257. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim024.py +289 -0
  258. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim025.py +340 -0
  259. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim026.py +127 -0
  260. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim027.py +363 -0
  261. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim028.py +418 -0
  262. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim029.py +268 -0
  263. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim030.py +391 -0
  264. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim031.py +451 -0
  265. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim032.py +482 -0
  266. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim033.py +462 -0
  267. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim034.py +203 -0
  268. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim035.py +322 -0
  269. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim036.py +108 -0
  270. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim037.py +140 -0
  271. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim038.py +106 -0
  272. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim039.py +162 -0
  273. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim040.py +124 -0
  274. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim041.py +212 -0
  275. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim042.py +198 -0
  276. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim043.py +130 -0
  277. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim044.py +151 -0
  278. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim045.py +236 -0
  279. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim046.py +157 -0
  280. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim047.py +138 -0
  281. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim048.py +223 -0
  282. pactkit_codex-0.1.0/tests/pactkit/unit/test_story_slim049.py +200 -0
  283. pactkit_codex-0.1.0/tests/pactkit/unit/test_tools.py +162 -0
  284. pactkit_codex-0.1.0/tests/pactkit/unit/test_update_task.py +122 -0
  285. pactkit_codex-0.1.0/tests/pactkit/unit/test_visualize_modes.py +219 -0
  286. pactkit_codex-0.1.0/tests/unit/test_bug001_profile_commands.py +15 -0
  287. pactkit_codex-0.1.0/tests/unit/test_bug002_sprint_exclusion.py +40 -0
  288. pactkit_codex-0.1.0/tests/unit/test_bug003_brand_leaks.py +61 -0
  289. pactkit_codex-0.1.0/tests/unit/test_bug005_claude_paths.py +79 -0
  290. pactkit_codex-0.1.0/tests/unit/test_story002_agents_md.py +123 -0
  291. pactkit_codex-0.1.0/tests/unit/test_story003_project_files.py +103 -0
  292. pactkit_codex-0.1.0/tests/unit/test_story004_codex_prompts.py +114 -0
  293. pactkit_codex-0.1.0/tests/unit/test_story005_deploy_skills.py +108 -0
  294. pactkit_codex-0.1.0/tests/unit/test_story006_config_toml.py +101 -0
  295. pactkit_codex-0.1.0/tests/unit/test_story007_playbook_paths.py +133 -0
  296. pactkit_codex-0.1.0/tests/unit/test_story009_cleanup.py +71 -0
  297. pactkit_codex-0.1.0/tests/unit/test_story010_dual_file.py +160 -0
  298. pactkit_codex-0.1.0/tests/unit/test_story011_rule_loading.py +153 -0
  299. pactkit_codex-0.1.0/tests/unit/test_story012_update_command.py +187 -0
@@ -0,0 +1,70 @@
1
+ # pactkit-codex (v0.1.0)
2
+
3
+ > PactKit PDCA workflow framework adapted for OpenAI Codex CLI.
4
+
5
+ ## Project Status
6
+
7
+ **v0.1.0 Feature Complete** — 16 stories/bugs done, 126 tests passing.
8
+
9
+ Core deployment chain works:
10
+ ```bash
11
+ pactkit-codex init --format codex # Deploy to ~/.codex/
12
+ ```
13
+
14
+ ## Architecture Decisions
15
+
16
+ ### Codex CLI Constraints (vs Claude Code)
17
+
18
+ | Capability | Claude Code | Codex CLI | Our Solution |
19
+ |------------|-------------|-----------|--------------|
20
+ | Multi-agent | Native | Single agent | Prompt-level role conventions |
21
+ | Custom commands | `/project-*` | `/prompts:*` | Deploy to `~/.codex/prompts/` |
22
+ | Rule loading | `@import` | None | Agentic routing (Prerequisites header) |
23
+ | Config | `settings.json` | `config.toml` | Generate with PactKit defaults |
24
+
25
+ ### Dual-File Architecture (STORY-010)
26
+
27
+ ```
28
+ ./AGENTS.md # PactKit-managed (always regenerated)
29
+ .codex/
30
+ ├── pactkit.yaml # Project config
31
+ └── AGENTS.local.md # User-owned (never overwritten)
32
+ ```
33
+
34
+ ### Per-Command Rule Loading (STORY-011)
35
+
36
+ Rules extracted to `~/.codex/rules/` (9 files). Each prompt declares its prerequisites:
37
+ ```markdown
38
+ ## Prerequisites — Read These Rules First
39
+ - `~/.codex/rules/01-core-protocol.md`
40
+ - `~/.codex/rules/09-credential-safety.md`
41
+ ```
42
+
43
+ `COMMAND_RULES_MAP` in `rules.py` is the single source of truth.
44
+
45
+ ## Key Files
46
+
47
+ | File | Purpose |
48
+ |------|---------|
49
+ | `src/pactkit_codex/generators/deployer.py` | Main deployment orchestrator |
50
+ | `src/pactkit_codex/prompts/rules.py` | Rule modules + COMMAND_RULES_MAP |
51
+ | `src/pactkit_codex/profiles.py` | FormatProfile (paths, config) |
52
+ | `tests/unit/` | 126 unit tests |
53
+ | `tests/e2e/` | E2E deployment verification |
54
+
55
+ ## Deploy Output Structure
56
+
57
+ ```
58
+ ~/.codex/
59
+ ├── AGENTS.md # Global constitution (~6KB, roles + routing + rule index)
60
+ ├── config.toml # Model, sandbox, MCP config
61
+ ├── rules/ # 9 rule files (on-demand loading)
62
+ ├── prompts/ # 10 command prompts (project-act, project-plan, etc.)
63
+ └── skills/ # 10 skills (visualize, board, scaffold, etc.)
64
+ ```
65
+
66
+ ## Future Work
67
+
68
+ - [ ] Migrate commands to Codex Skills (prompts deprecated upstream)
69
+ - [ ] Add `pactkit-codex update` for incremental upgrades
70
+ - [ ] Test with actual Codex CLI TUI session
@@ -0,0 +1,14 @@
1
+ # pactkit-codex — Project Context
2
+
3
+ ## Dev Commands
4
+
5
+ ```bash
6
+ # Run tests
7
+ pytest tests/ -v
8
+
9
+ # Lint
10
+ ruff check src/ tests/
11
+ ```
12
+
13
+ @./docs/product/context.md
14
+ @./.claude/CLAUDE.local.md
@@ -0,0 +1,140 @@
1
+ # PactKit Configuration
2
+ # Edit this file to customize which components are deployed.
3
+ # Remove items from a list to disable them. Default: all enabled.
4
+
5
+ version: "2.4.0"
6
+ stack: auto
7
+ root: .
8
+ developer: ""
9
+
10
+ # Agents — AI role definitions
11
+ agents:
12
+ - code-explorer
13
+ - product-designer
14
+ - qa-engineer
15
+ - repo-maintainer
16
+ - security-auditor
17
+ - senior-developer
18
+ - system-architect
19
+ - system-medic
20
+ - visual-architect
21
+
22
+ # Commands — PDCA playbooks
23
+ commands:
24
+ - project-act
25
+ - project-check
26
+ - project-clarify
27
+ - project-design
28
+ - project-done
29
+ - project-hotfix
30
+ - project-init
31
+ - project-plan
32
+ - project-pr
33
+ - project-release
34
+ - project-sprint
35
+
36
+ # Skills — tool scripts
37
+ skills:
38
+ - pactkit-analyze
39
+ - pactkit-board
40
+ - pactkit-doctor
41
+ - pactkit-draw
42
+ - pactkit-release
43
+ - pactkit-review
44
+ - pactkit-scaffold
45
+ - pactkit-status
46
+ - pactkit-trace
47
+ - pactkit-visualize
48
+
49
+ # Rules — constitution modules
50
+ rules:
51
+ - 01-core-protocol
52
+ - 02-hierarchy-of-truth
53
+ - 03-file-atlas
54
+ - 04-routing-table
55
+ - 05-workflow-conventions
56
+ - 06-mcp-integration
57
+ - 07-shared-protocols
58
+ - 08-architecture-principles
59
+ - 09-sectional-write
60
+
61
+ # CI/CD — set provider to github or gitlab to generate pipeline config
62
+ ci:
63
+ provider: none
64
+ # runner: ubuntu-latest
65
+ # language_version: "3.11"
66
+ # github_host: "" # GHE server (empty = github.com)
67
+ # actions_ref: "" # GHE actions prefix
68
+
69
+ # Issue Tracker — set provider to github to link stories to issues
70
+ issue_tracker:
71
+ provider: none
72
+
73
+ # Hooks — safe, report-only hook templates (command-type only)
74
+ hooks:
75
+ post_test_coverage: false
76
+ pre_commit_lint: false
77
+ pre_push_check: false
78
+
79
+ # Lint — configure lint behavior in /project-done
80
+ lint_blocking: false
81
+ auto_fix: false
82
+
83
+ # Virtual Environment — configure venv detection and paths
84
+ venv:
85
+ auto_detect: true
86
+
87
+ # Release — configure release automation behavior
88
+ release:
89
+ github_release: false
90
+
91
+ # Regression — configure impact-based test selection strategy
92
+ regression:
93
+ strategy: impact
94
+ max_impact_tests: 50
95
+
96
+ # Check — configure QA verification behavior
97
+ check:
98
+ security_checklist: true
99
+ security_scope_override: none
100
+
101
+ # Done — configure commit and lesson quality behavior
102
+ done:
103
+ lesson_quality_threshold: 15
104
+
105
+ # E2E Testing — configure end-to-end test strategy (none|cli|frontend|backend|fullstack)
106
+ e2e:
107
+ type: none
108
+ blocking: false
109
+ test_dir: tests/e2e
110
+ env_file: .env.test
111
+ api_spec: "" # OpenAPI spec path for frontend/backend
112
+ compose_file: docker-compose.test.yml # for fullstack
113
+
114
+ # Visualize — configure directory scan exclusions
115
+ visualize:
116
+ scan_excludes:
117
+ - venv
118
+ - _venv
119
+ - .venv
120
+ - .env
121
+ - env
122
+ - __pycache__
123
+ - .git
124
+ - .claude
125
+ - tests
126
+ - docs
127
+ - node_modules
128
+ - site-packages
129
+ - dist
130
+ - build
131
+
132
+ # Command Models — override model per command for OpenCode deployment
133
+ command_models:
134
+ project-act: sonnet
135
+ project-check: sonnet
136
+ project-done: sonnet
137
+ project-hotfix: sonnet
138
+ project-init: sonnet
139
+ project-pr: sonnet
140
+ project-release: sonnet
@@ -0,0 +1,13 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.pyo
4
+ .venv/
5
+ dist/
6
+ *.egg-info/
7
+ .pytest_cache/
8
+ .mypy_cache/
9
+ .ruff_cache/
10
+ .coverage
11
+ htmlcov/
12
+ .env
13
+ *.log
@@ -0,0 +1,4 @@
1
+ # pactkit-codex
2
+
3
+ @./docs/product/context.md
4
+ output MUST use Chinese
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Anthropic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,227 @@
1
+ Metadata-Version: 2.4
2
+ Name: pactkit-codex
3
+ Version: 0.1.0
4
+ Summary: PactKit PDCA workflow framework adapted for OpenAI Codex CLI
5
+ Project-URL: Homepage, https://github.com/anthropics/pactkit-codex
6
+ Project-URL: Repository, https://github.com/anthropics/pactkit-codex
7
+ Project-URL: Documentation, https://github.com/anthropics/pactkit-codex#readme
8
+ Project-URL: Issues, https://github.com/anthropics/pactkit-codex/issues
9
+ Author: Slim
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: agent,ai,code-assistant,code-quality,codex,codex-cli,developer-tools,devops,openai,pdca,scaffold,spec-driven,tdd
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Build Tools
22
+ Classifier: Topic :: Software Development :: Quality Assurance
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: pyyaml>=6.0
25
+ Provides-Extra: multilang
26
+ Requires-Dist: tree-sitter-go>=0.25; extra == 'multilang'
27
+ Requires-Dist: tree-sitter-java>=0.23; extra == 'multilang'
28
+ Requires-Dist: tree-sitter-typescript>=0.23; extra == 'multilang'
29
+ Requires-Dist: tree-sitter>=0.25; extra == 'multilang'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # pactkit-codex
33
+
34
+ > PactKit PDCA workflow framework adapted for [OpenAI Codex CLI](https://github.com/openai/codex).
35
+
36
+ [![PyPI version](https://badge.fury.io/py/pactkit-codex.svg)](https://pypi.org/project/pactkit-codex/)
37
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
38
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
39
+
40
+ ## What is this?
41
+
42
+ **pactkit-codex** brings the [PactKit](https://github.com/pactkit/pactkit) spec-driven development workflow to OpenAI's Codex CLI. It deploys:
43
+
44
+ - **AGENTS.md** — Global constitution with agent roles and PDCA routing
45
+ - **Command prompts** — 10 PDCA workflow commands (`/project-plan`, `/project-act`, etc.)
46
+ - **Skills** — Standalone Python scripts (visualize, board, scaffold)
47
+ - **Rules** — Modular governance rules loaded on-demand per command
48
+
49
+ ## Installation
50
+
51
+ ```bash
52
+ pip install pactkit-codex
53
+ ```
54
+
55
+ ## Quick Start
56
+
57
+ ```bash
58
+ # Deploy PactKit configuration to ~/.codex/
59
+ pactkit-codex init
60
+
61
+ # Update when pactkit-codex is upgraded
62
+ pactkit-codex update
63
+
64
+ # Check version
65
+ pactkit-codex version
66
+ ```
67
+
68
+ ## What Gets Deployed
69
+
70
+ After running `pactkit-codex init`:
71
+
72
+ ```
73
+ ~/.codex/
74
+ ├── AGENTS.md # Global constitution (~6KB)
75
+ ├── config.toml # Model, sandbox, MCP config
76
+ ├── .pactkit-version # Version marker for updates
77
+ ├── rules/ # 9 rule files (on-demand loading)
78
+ │ ├── 01-core-protocol.md
79
+ │ ├── 02-hierarchy-of-truth.md
80
+ │ └── ...
81
+ ├── prompts/ # 10 PDCA command prompts
82
+ │ ├── project-plan.md
83
+ │ ├── project-act.md
84
+ │ └── ...
85
+ └── skills/ # 10 skill directories
86
+ ├── pactkit-visualize/
87
+ ├── pactkit-board/
88
+ └── ...
89
+
90
+ ./ # Project root
91
+ ├── AGENTS.md # Project instructions (PactKit-managed)
92
+ └── .codex/
93
+ ├── pactkit.yaml # Project config
94
+ └── AGENTS.local.md # Your custom instructions (never overwritten)
95
+ ```
96
+
97
+ ## Commands
98
+
99
+ ### Initialization
100
+
101
+ ```bash
102
+ pactkit-codex init # Full deployment
103
+ pactkit-codex init -t /tmp/preview # Deploy to custom directory
104
+ ```
105
+
106
+ ### Update
107
+
108
+ ```bash
109
+ pactkit-codex update # Incremental update (if version changed)
110
+ pactkit-codex update --if-needed # Silent no-op if current (for hooks)
111
+ pactkit-codex update --force # Force redeploy even if current
112
+ pactkit-codex update --dry-run # Show what would change
113
+ ```
114
+
115
+ ### Utilities
116
+
117
+ ```bash
118
+ pactkit-codex version # Show version
119
+ pactkit-codex spec-lint <file> # Validate spec structure
120
+ pactkit-codex doctor # Check project health
121
+ pactkit-codex visualize --lazy # Generate code dependency graphs
122
+ ```
123
+
124
+ ## PDCA Workflow Commands
125
+
126
+ Once deployed, use these commands in Codex CLI:
127
+
128
+ | Command | Phase | Purpose |
129
+ |---------|-------|---------|
130
+ | `/prompts:project-init` | Bootstrap | Initialize project governance |
131
+ | `/prompts:project-design` | Plan | Greenfield product design |
132
+ | `/prompts:project-plan` | Plan | Break down requirements into specs |
133
+ | `/prompts:project-act` | Act | Implement code per spec (TDD) |
134
+ | `/prompts:project-check` | Check | QA verification |
135
+ | `/prompts:project-done` | Done | Finalize and document |
136
+ | `/prompts:project-release` | Done | Version release |
137
+ | `/prompts:project-pr` | Done | Create pull request |
138
+ | `/prompts:project-hotfix` | Act | Quick fix bypass |
139
+ | `/prompts:project-clarify` | Plan | Clarify requirements |
140
+
141
+ ## Project Structure
142
+
143
+ Your project should have:
144
+
145
+ ```
146
+ your-project/
147
+ ├── AGENTS.md # PactKit-managed (auto-generated)
148
+ ├── .codex/
149
+ │ ├── pactkit.yaml # Project config
150
+ │ └── AGENTS.local.md # Your custom instructions
151
+ ├── docs/
152
+ │ ├── specs/ # Requirement specifications
153
+ │ │ ├── STORY-001.md
154
+ │ │ └── ...
155
+ │ └── product/
156
+ │ ├── sprint_board.md # Current sprint tasks
157
+ │ └── context.md # Project context (auto-generated)
158
+ └── tests/
159
+ ├── unit/
160
+ └── e2e/
161
+ ```
162
+
163
+ ## Codex CLI vs Claude Code
164
+
165
+ This project adapts PactKit for Codex CLI, which has different capabilities:
166
+
167
+ | Feature | Claude Code | Codex CLI | pactkit-codex Solution |
168
+ |---------|-------------|-----------|------------------------|
169
+ | Multi-agent | Native | Single agent | Prompt-level role conventions |
170
+ | Custom commands | `/project-*` | `/prompts:*` | Deploy to `~/.codex/prompts/` |
171
+ | Rule loading | `@import` | None | Agentic routing (Prerequisites header) |
172
+ | Config | `settings.json` | `config.toml` | Generate with defaults |
173
+
174
+ ## Configuration
175
+
176
+ ### pactkit.yaml
177
+
178
+ ```yaml
179
+ stack: python # Detected automatically
180
+ version: 0.0.1 # Your project version
181
+ root: .
182
+ developer: "" # Optional: your name prefix for Story IDs
183
+ ```
184
+
185
+ ### Custom Instructions
186
+
187
+ Add your project-specific instructions to `.codex/AGENTS.local.md`:
188
+
189
+ ```markdown
190
+ # Project Local Instructions
191
+
192
+ ## Build Commands
193
+ - Run tests: `pytest tests/ -v`
194
+ - Lint: `ruff check src/`
195
+
196
+ ## Project Conventions
197
+ - Use snake_case for Python
198
+ - All APIs must have OpenAPI docs
199
+ ```
200
+
201
+ This file is **never overwritten** by pactkit-codex updates.
202
+
203
+ ## Development
204
+
205
+ ```bash
206
+ # Clone
207
+ git clone https://github.com/anthropics/pactkit-codex.git
208
+ cd pactkit-codex
209
+
210
+ # Install dev dependencies
211
+ pip install -e ".[multilang]"
212
+
213
+ # Run tests
214
+ pytest tests/ -v
215
+
216
+ # Lint
217
+ ruff check src/ tests/
218
+ ```
219
+
220
+ ## License
221
+
222
+ MIT License - see [LICENSE](LICENSE) for details.
223
+
224
+ ## Related Projects
225
+
226
+ - [PactKit](https://github.com/pactkit/pactkit) — Original framework for Claude Code
227
+ - [Codex CLI](https://github.com/openai/codex) — OpenAI's terminal-based AI coding assistant
@@ -0,0 +1,196 @@
1
+ # pactkit-codex
2
+
3
+ > PactKit PDCA workflow framework adapted for [OpenAI Codex CLI](https://github.com/openai/codex).
4
+
5
+ [![PyPI version](https://badge.fury.io/py/pactkit-codex.svg)](https://pypi.org/project/pactkit-codex/)
6
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+
9
+ ## What is this?
10
+
11
+ **pactkit-codex** brings the [PactKit](https://github.com/pactkit/pactkit) spec-driven development workflow to OpenAI's Codex CLI. It deploys:
12
+
13
+ - **AGENTS.md** — Global constitution with agent roles and PDCA routing
14
+ - **Command prompts** — 10 PDCA workflow commands (`/project-plan`, `/project-act`, etc.)
15
+ - **Skills** — Standalone Python scripts (visualize, board, scaffold)
16
+ - **Rules** — Modular governance rules loaded on-demand per command
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ pip install pactkit-codex
22
+ ```
23
+
24
+ ## Quick Start
25
+
26
+ ```bash
27
+ # Deploy PactKit configuration to ~/.codex/
28
+ pactkit-codex init
29
+
30
+ # Update when pactkit-codex is upgraded
31
+ pactkit-codex update
32
+
33
+ # Check version
34
+ pactkit-codex version
35
+ ```
36
+
37
+ ## What Gets Deployed
38
+
39
+ After running `pactkit-codex init`:
40
+
41
+ ```
42
+ ~/.codex/
43
+ ├── AGENTS.md # Global constitution (~6KB)
44
+ ├── config.toml # Model, sandbox, MCP config
45
+ ├── .pactkit-version # Version marker for updates
46
+ ├── rules/ # 9 rule files (on-demand loading)
47
+ │ ├── 01-core-protocol.md
48
+ │ ├── 02-hierarchy-of-truth.md
49
+ │ └── ...
50
+ ├── prompts/ # 10 PDCA command prompts
51
+ │ ├── project-plan.md
52
+ │ ├── project-act.md
53
+ │ └── ...
54
+ └── skills/ # 10 skill directories
55
+ ├── pactkit-visualize/
56
+ ├── pactkit-board/
57
+ └── ...
58
+
59
+ ./ # Project root
60
+ ├── AGENTS.md # Project instructions (PactKit-managed)
61
+ └── .codex/
62
+ ├── pactkit.yaml # Project config
63
+ └── AGENTS.local.md # Your custom instructions (never overwritten)
64
+ ```
65
+
66
+ ## Commands
67
+
68
+ ### Initialization
69
+
70
+ ```bash
71
+ pactkit-codex init # Full deployment
72
+ pactkit-codex init -t /tmp/preview # Deploy to custom directory
73
+ ```
74
+
75
+ ### Update
76
+
77
+ ```bash
78
+ pactkit-codex update # Incremental update (if version changed)
79
+ pactkit-codex update --if-needed # Silent no-op if current (for hooks)
80
+ pactkit-codex update --force # Force redeploy even if current
81
+ pactkit-codex update --dry-run # Show what would change
82
+ ```
83
+
84
+ ### Utilities
85
+
86
+ ```bash
87
+ pactkit-codex version # Show version
88
+ pactkit-codex spec-lint <file> # Validate spec structure
89
+ pactkit-codex doctor # Check project health
90
+ pactkit-codex visualize --lazy # Generate code dependency graphs
91
+ ```
92
+
93
+ ## PDCA Workflow Commands
94
+
95
+ Once deployed, use these commands in Codex CLI:
96
+
97
+ | Command | Phase | Purpose |
98
+ |---------|-------|---------|
99
+ | `/prompts:project-init` | Bootstrap | Initialize project governance |
100
+ | `/prompts:project-design` | Plan | Greenfield product design |
101
+ | `/prompts:project-plan` | Plan | Break down requirements into specs |
102
+ | `/prompts:project-act` | Act | Implement code per spec (TDD) |
103
+ | `/prompts:project-check` | Check | QA verification |
104
+ | `/prompts:project-done` | Done | Finalize and document |
105
+ | `/prompts:project-release` | Done | Version release |
106
+ | `/prompts:project-pr` | Done | Create pull request |
107
+ | `/prompts:project-hotfix` | Act | Quick fix bypass |
108
+ | `/prompts:project-clarify` | Plan | Clarify requirements |
109
+
110
+ ## Project Structure
111
+
112
+ Your project should have:
113
+
114
+ ```
115
+ your-project/
116
+ ├── AGENTS.md # PactKit-managed (auto-generated)
117
+ ├── .codex/
118
+ │ ├── pactkit.yaml # Project config
119
+ │ └── AGENTS.local.md # Your custom instructions
120
+ ├── docs/
121
+ │ ├── specs/ # Requirement specifications
122
+ │ │ ├── STORY-001.md
123
+ │ │ └── ...
124
+ │ └── product/
125
+ │ ├── sprint_board.md # Current sprint tasks
126
+ │ └── context.md # Project context (auto-generated)
127
+ └── tests/
128
+ ├── unit/
129
+ └── e2e/
130
+ ```
131
+
132
+ ## Codex CLI vs Claude Code
133
+
134
+ This project adapts PactKit for Codex CLI, which has different capabilities:
135
+
136
+ | Feature | Claude Code | Codex CLI | pactkit-codex Solution |
137
+ |---------|-------------|-----------|------------------------|
138
+ | Multi-agent | Native | Single agent | Prompt-level role conventions |
139
+ | Custom commands | `/project-*` | `/prompts:*` | Deploy to `~/.codex/prompts/` |
140
+ | Rule loading | `@import` | None | Agentic routing (Prerequisites header) |
141
+ | Config | `settings.json` | `config.toml` | Generate with defaults |
142
+
143
+ ## Configuration
144
+
145
+ ### pactkit.yaml
146
+
147
+ ```yaml
148
+ stack: python # Detected automatically
149
+ version: 0.0.1 # Your project version
150
+ root: .
151
+ developer: "" # Optional: your name prefix for Story IDs
152
+ ```
153
+
154
+ ### Custom Instructions
155
+
156
+ Add your project-specific instructions to `.codex/AGENTS.local.md`:
157
+
158
+ ```markdown
159
+ # Project Local Instructions
160
+
161
+ ## Build Commands
162
+ - Run tests: `pytest tests/ -v`
163
+ - Lint: `ruff check src/`
164
+
165
+ ## Project Conventions
166
+ - Use snake_case for Python
167
+ - All APIs must have OpenAPI docs
168
+ ```
169
+
170
+ This file is **never overwritten** by pactkit-codex updates.
171
+
172
+ ## Development
173
+
174
+ ```bash
175
+ # Clone
176
+ git clone https://github.com/anthropics/pactkit-codex.git
177
+ cd pactkit-codex
178
+
179
+ # Install dev dependencies
180
+ pip install -e ".[multilang]"
181
+
182
+ # Run tests
183
+ pytest tests/ -v
184
+
185
+ # Lint
186
+ ruff check src/ tests/
187
+ ```
188
+
189
+ ## License
190
+
191
+ MIT License - see [LICENSE](LICENSE) for details.
192
+
193
+ ## Related Projects
194
+
195
+ - [PactKit](https://github.com/pactkit/pactkit) — Original framework for Claude Code
196
+ - [Codex CLI](https://github.com/openai/codex) — OpenAI's terminal-based AI coding assistant
@@ -0,0 +1,7 @@
1
+ # Lessons Learned
2
+
3
+ > Decisions and insights recorded during development.
4
+
5
+ | Date | Lesson | Source |
6
+ |------|--------|--------|
7
+ | 2026-03-25 | Project initialized — greenfield, no source code yet | /project-init |