codex-genesis-harness 0.1.6 → 0.1.8

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 (136) hide show
  1. package/.codebase/COMPRESSED_CONTEXT.md +80 -0
  2. package/.codebase/CURRENT_STATE.md +35 -8
  3. package/.codebase/DEPENDENCY_GRAPH.md +14 -1
  4. package/.codebase/IMPLEMENTATION_HANDOFF.md +34 -336
  5. package/.codebase/KNOWN_PROBLEMS.md +54 -3
  6. package/.codebase/MODULE_INDEX.md +8 -0
  7. package/.codebase/PIPELINE_FLOW.md +7 -5
  8. package/.codebase/RECOVERY_POINTS.md +15 -431
  9. package/.codebase/TECH_DEBT.md +6 -0
  10. package/.codebase/TEST_MATRIX.md +4 -3
  11. package/.codebase/VISUAL_GRAPH.md +127 -0
  12. package/.codebase/beads.json +16 -0
  13. package/.codebase/context-policy.json +68 -0
  14. package/.codebase/memories/lessons_learned.md +21 -0
  15. package/.codebase/memories/preferences.md +17 -0
  16. package/.codebase/state.json +45 -24
  17. package/.codex/skills/genesis-ai-provider/SKILL.md +1 -1
  18. package/.codex/skills/genesis-api-contract/SKILL.md +1 -1
  19. package/.codex/skills/genesis-api-sync/SKILL.md +1 -1
  20. package/.codex/skills/genesis-architecture/SKILL.md +6 -1
  21. package/.codex/skills/genesis-codebase-map/SKILL.md +1 -1
  22. package/.codex/skills/genesis-debug-guide/SKILL.md +11 -5
  23. package/.codex/skills/genesis-design-spec/SKILL.md +3 -3
  24. package/.codex/skills/genesis-docs-automation/SKILL.md +52 -973
  25. package/.codex/skills/genesis-executing-plans/SKILL.md +54 -0
  26. package/.codex/skills/genesis-executing-plans/agents/openai.yaml +6 -0
  27. package/.codex/skills/genesis-executing-plans/checklists/.gitkeep +0 -0
  28. package/.codex/skills/genesis-executing-plans/examples/.gitkeep +0 -0
  29. package/.codex/skills/genesis-executing-plans/templates/.gitkeep +0 -0
  30. package/.codex/skills/genesis-harness/SKILL.md +64 -1384
  31. package/.codex/skills/genesis-harness/scripts/check-docs-sync.sh +3 -3
  32. package/.codex/skills/genesis-harness/scripts/init-planning.sh +1 -1
  33. package/.codex/skills/genesis-harness-engineering/SKILL.md +1 -1
  34. package/.codex/skills/genesis-new-design/SKILL.md +6 -2
  35. package/.codex/skills/genesis-new-design/agents/openai.yaml +2 -0
  36. package/.codex/skills/genesis-observability-automation/SKILL.md +69 -303
  37. package/.codex/skills/genesis-observability-automation/references/common-mistakes-and-recovery.md +84 -0
  38. package/.codex/skills/genesis-observability-automation/references/workflow-phases.md +78 -0
  39. package/.codex/skills/genesis-performance-profiling/SKILL.md +1 -22
  40. package/.codex/skills/genesis-performance-profiling/agents/openai.yaml +1 -1
  41. package/.codex/skills/genesis-pipeline-orchestration/SKILL.md +1 -1
  42. package/.codex/skills/genesis-planning/SKILL.md +31 -1
  43. package/.codex/skills/genesis-release/SKILL.md +29 -1
  44. package/.codex/skills/genesis-research-first/SKILL.md +6 -0
  45. package/.codex/skills/genesis-spec-propagation/SKILL.md +52 -504
  46. package/.codex/skills/genesis-test-driven-development/SKILL.md +55 -0
  47. package/.codex/skills/genesis-test-driven-development/agents/openai.yaml +6 -0
  48. package/.codex/skills/genesis-test-driven-development/checklists/.gitkeep +0 -0
  49. package/.codex/skills/genesis-test-driven-development/examples/.gitkeep +0 -0
  50. package/.codex/skills/genesis-test-driven-development/templates/.gitkeep +0 -0
  51. package/.codex/skills/{ui-ux-test-skill → genesis-ui-ux-test}/SKILL.md +1 -1
  52. package/.codex/skills/genesis-upgrade-design/SKILL.md +4 -2
  53. package/.codex/skills/genesis-upgrade-design/agents/openai.yaml +2 -0
  54. package/.codex/skills/genesis-using-git-worktrees/SKILL.md +54 -0
  55. package/.codex/skills/genesis-using-git-worktrees/agents/openai.yaml +6 -0
  56. package/.codex/skills/genesis-using-git-worktrees/checklists/.gitkeep +0 -0
  57. package/.codex/skills/genesis-using-git-worktrees/examples/.gitkeep +0 -0
  58. package/.codex/skills/genesis-using-git-worktrees/templates/.gitkeep +0 -0
  59. package/.codex/skills/genesis-verification-before-completion/SKILL.md +53 -0
  60. package/.codex/skills/genesis-verification-before-completion/agents/openai.yaml +6 -0
  61. package/.codex/skills/genesis-verification-before-completion/checklists/.gitkeep +0 -0
  62. package/.codex/skills/genesis-verification-before-completion/examples/.gitkeep +0 -0
  63. package/.codex/skills/genesis-verification-before-completion/templates/.gitkeep +0 -0
  64. package/.codex/skills/spec-impact-engine/SKILL.md +77 -500
  65. package/.codex/skills/spec-impact-engine/checklists/checklist.md +10 -0
  66. package/.codex-plugin/plugin.json +3 -4
  67. package/CHANGELOG.md +17 -0
  68. package/README.EN.md +33 -22
  69. package/README.VI.md +36 -24
  70. package/README.md +46 -8
  71. package/VERSION +1 -1
  72. package/bin/genesis-harness.js +1337 -7
  73. package/contracts/features/registry-schema.json +15 -0
  74. package/contracts/observability/agent-run-schema.json +34 -0
  75. package/contracts/observability/failure-schema.json +35 -0
  76. package/contracts/ui/auth/login-screen-contract.json +43 -0
  77. package/features/REGISTRY.md +63 -0
  78. package/features/SCOPE-template.md +65 -0
  79. package/fixtures/planning/MOCKUP_PROMPT_TEMPLATE.md +16 -0
  80. package/observability/agent-runs/sample-run.json +13 -0
  81. package/observability/decision-logs/sample-decision.md +43 -0
  82. package/observability/failures/sample-failure.json +12 -0
  83. package/package.json +9 -3
  84. package/playwright/e2e/app-template.spec.js +37 -0
  85. package/playwright/e2e/auth/login-screen.spec.js +65 -0
  86. package/playwright/e2e/web-template.spec.js +28 -0
  87. package/scripts/check-scope.sh +100 -0
  88. package/scripts/cold-start-check.js +133 -0
  89. package/scripts/install.sh +6 -6
  90. package/scripts/prompt_sentinel.js +35 -4
  91. package/scripts/run-evals.sh +137 -26
  92. package/scripts/scratch_parser.js +49 -0
  93. package/scripts/spec_visual_sync.js +1 -1
  94. package/scripts/test_generator.js +2 -2
  95. package/scripts/uninstall.sh +6 -6
  96. package/scripts/verify.sh +21 -66
  97. package/tests/integration/cli-smoke.test.js +103 -0
  98. package/tests/unit/feature_registry.test.js +152 -0
  99. package/tests/unit/prompt_sentinel.test.js +1 -1
  100. package/tests/unit/spec_visual_sync.test.js +1 -1
  101. package/tests/unit/test_generator.test.js +1 -1
  102. package/.codex/skills/genesis-docs/SKILL.md +0 -46
  103. package/.codex/skills/genesis-docs/agents/openai.yaml +0 -7
  104. package/.codex/skills/genesis-mvp-planning/SKILL.md +0 -114
  105. package/.codex/skills/genesis-mvp-planning/agents/openai.yaml +0 -6
  106. package/.codex/skills/genesis-release-orchestration/SKILL.md +0 -653
  107. package/.codex/skills/genesis-release-orchestration/agents/openai.yaml +0 -7
  108. package/.codex/skills/genesis-research/SKILL.md +0 -46
  109. package/.codex/skills/genesis-research/agents/openai.yaml +0 -7
  110. package/playwright/e2e/e2e-template.md +0 -4
  111. /package/.codex/skills/{genesis-docs/checklists/checklist.md → genesis-docs-automation/checklists/manual-docs-checklist.md} +0 -0
  112. /package/.codex/skills/{genesis-docs/examples/example.md → genesis-docs-automation/examples/manual-docs-example.md} +0 -0
  113. /package/.codex/skills/{genesis-docs → genesis-docs-automation}/templates/docs-update-template.md +0 -0
  114. /package/.codex/skills/{genesis-state-machine/SKILL.md → genesis-harness/references/state-machine.md} +0 -0
  115. /package/.codex/skills/{genesis-mvp-planning → genesis-planning}/checklists/mvp-readiness.md +0 -0
  116. /package/.codex/skills/{genesis-mvp-planning → genesis-planning}/examples/5-phase-roadmap-example.md +0 -0
  117. /package/.codex/skills/{genesis-mvp-planning → genesis-planning}/templates/phase-1-core.md +0 -0
  118. /package/.codex/skills/{genesis-mvp-planning → genesis-planning}/templates/phase-2-auth.md +0 -0
  119. /package/.codex/skills/{genesis-mvp-planning → genesis-planning}/templates/phase-3-features.md +0 -0
  120. /package/.codex/skills/{genesis-mvp-planning → genesis-planning}/templates/phase-4-integrations.md +0 -0
  121. /package/.codex/skills/{genesis-mvp-planning → genesis-planning}/templates/phase-5-readiness.md +0 -0
  122. /package/.codex/skills/{genesis-release-orchestration → genesis-release}/checklists/post-deployment-verification.md +0 -0
  123. /package/.codex/skills/{genesis-release-orchestration → genesis-release}/checklists/pre-release-validation.md +0 -0
  124. /package/.codex/skills/{genesis-release-orchestration/examples/example.md → genesis-release/examples/orchestration-example.md} +0 -0
  125. /package/.codex/skills/{genesis-release-orchestration → genesis-release}/observability/release-tracking.md +0 -0
  126. /package/.codex/skills/{genesis-release-orchestration → genesis-release}/playbooks/canary-deployment-orchestration.md +0 -0
  127. /package/.codex/skills/{genesis-release-orchestration → genesis-release}/playbooks/semantic-versioning-automation.md +0 -0
  128. /package/.codex/skills/{genesis-release-orchestration → genesis-release}/templates/deployment-strategy-template.md +0 -0
  129. /package/.codex/skills/{genesis-release-orchestration → genesis-release}/templates/release-runbook-template.md +0 -0
  130. /package/.codex/skills/{genesis-research → genesis-research-first}/checklists/checklist.md +0 -0
  131. /package/.codex/skills/{genesis-research/examples/example.md → genesis-research-first/examples/manual-research-example.md} +0 -0
  132. /package/.codex/skills/{genesis-research → genesis-research-first}/templates/research-note-template.md +0 -0
  133. /package/.codex/skills/{ui-ux-test-skill → genesis-ui-ux-test}/agents/openai.yaml +0 -0
  134. /package/.codex/skills/{ui-ux-test-skill → genesis-ui-ux-test}/checklists/checklist.md +0 -0
  135. /package/.codex/skills/{ui-ux-test-skill → genesis-ui-ux-test}/examples/example.md +0 -0
  136. /package/.codex/skills/{ui-ux-test-skill → genesis-ui-ux-test}/templates/playwright-test-template.md +0 -0
package/README.EN.md CHANGED
@@ -27,6 +27,17 @@
27
27
 
28
28
  ---
29
29
 
30
+ ## 💖 Support the Project (Donate)
31
+
32
+ This project is open-source and developed with passion. If you find **Genesis Codex Harness** helpful and it saves you time, consider buying me a coffee to keep the momentum going:
33
+
34
+ - **Momo (Vietnam)**: `0865814259`
35
+ - **PayPal**: *(Will be updated later)*
36
+
37
+ Thank you so much for supporting the development of this project! ❤️
38
+
39
+ ---
40
+
30
41
  ## 🎯 Why Genesis? (ROI in 3 minutes)
31
42
 
32
43
  ### Before Genesis ❌
@@ -133,16 +144,27 @@ Genesis Codex Harness introduces five groundbreaking architectural subsystems to
133
144
 
134
145
  ---
135
146
 
136
- ## 🚀 Next-Gen Harness Engineering Upgrades (v0.1.6)
147
+ ## 🚀 Next-Gen Harness Engineering Upgrades (v0.1.8)
137
148
 
138
- Genesis v0.1.6 introduces five advanced, state-of-the-art tools under `scripts/` to enforce type-safety, automate tests, establish visual-code integrity, protect token consumption, and enable self-healing loop memory recall:
149
+ Genesis v0.1.8 introduces five advanced, state-of-the-art tools under `scripts/` to enforce type-safety, automate tests, establish visual-code integrity, protect token consumption, and enable self-healing loop memory recall:
139
150
 
140
151
  1. **Visual Architecture AST Sync (`scripts/spec_visual_sync.js`)**: Bidirectional compiler that syncs Mermaid ERD database diagrams (`database-erd.mmd`) to API contracts JSON schemas (`contracts/api/`) and vice-versa, establishing absolute visual-to-code design integrity.
141
152
  2. **Contract-Driven Test Auto-Generator (`scripts/test_generator.js`)**: Automatically compiles fully executable Mocha/Jest integration test suites in `tests/integration/` directly from your API contracts JSON response schemas, providing instant TDD "RED" skeletons.
142
153
  3. **AST Contract-Code Integrity Gate (`scripts/contract_integrity_gate.js`)**: Static analysis checker that programmatically validates implementation code properties against API contract JSON schemas at FSM transition boundaries, locking state transitions if data type mismatches or missing properties are detected.
143
- 4. **Pre-emptive Prompt Sentinel (`scripts/prompt_sentinel.js`)**: Real-time token budget monitor. Calculates token weights before calling LLM, pre-emptively halting runaway commands, and executing auto-compaction and log pruning when capacity thresholds (e.g. 20k tokens) are crossed.
154
+ 4. **Pre-emptive Prompt Sentinel (`scripts/prompt_sentinel.js`)**: Real-time token budget monitor. Calculates token weights before calling LLM, pre-emptively halting runaway commands, and executing auto-compaction and log pruning when the LeanCTX threshold in `.codebase/context-policy.json` is crossed.
144
155
  5. **Self-Healing Lessons-Learned Recall (`scripts/healing_telemetry.js`)**: Telemetry system that records compiler/test failure signatures and applied corrective code edits in `.codebase/failures/lessons_learned.md`. The self-healing loop recalls these recorded fixes on identical error signatures, bypassing iterations to achieve immediate **1-turn recovery**.
145
156
 
157
+ ### LeanCTX + Optional Local Wrappers
158
+
159
+ Genesis ships a portable LeanCTX policy at `.codebase/context-policy.json` and exposes it through:
160
+
161
+ ```bash
162
+ genesis-harness leanctx
163
+ genesis-harness prime
164
+ ```
165
+
166
+ `npm install` / `genesis-harness install` seeds the policy into the current project when a project root is detected, and never overwrites an existing custom policy. The `leanctx` command is only for inspection. Npm users keep using portable commands such as `genesis-harness sync`, `genesis-harness docs-gate`, and `npm run verify`. When `rtk` exists on a developer machine, Genesis reports it as an optional local wrapper only; it is not a public dependency.
167
+
146
168
  ---
147
169
 
148
170
  ## 🔬 Research-First Guarantee (NEW)
@@ -611,17 +633,13 @@ Each skill follows the standard naming convention in `.codex/skills/`:
611
633
  | **genesis-api-sync** | Automate bi-directional contract & codebase synchronization | When endpoints are updated |
612
634
  | **genesis-spec-propagation** | Automatically cascade design specification updates downstream | When specs change |
613
635
  | **genesis-docs-automation** | Automatically synchronize system technical docs | Triggers after tests pass |
614
- | **ui-ux-test-skill** | Design and validate UI user journeys and visual test specs | Before frontend implementation |
636
+ | **genesis-ui-ux-test** | Design and validate UI user journeys and visual test specs | Before frontend implementation |
615
637
  | **genesis-debug-guide** | Systematic, evidence-based debugging and troubleshooting | On compile errors or test failures |
616
638
  | **genesis-pipeline-orchestration** | Orchestrate multi-phase software development lifecycle | Complex multi-phase projects |
617
639
  | **genesis-architecture** | High-level system design and architecture decisions (ADRs) | Major design changes |
618
640
  | **genesis-planning** | Breakdown complex business requirements into micro-plans | Preparing large features |
619
- | **genesis-mvp-planning** | Automate the setup of a 5-Phase MVP Roadmap post-initialization | Runs right after initialization |
620
641
  | **genesis-codebase-map** | Build comprehensive dependency graphs and architecture maps | Navigating large codebases |
621
- | **genesis-docs** | Generate exhaustive technical engineering summaries | End of phase / release |
622
- | **genesis-research** | Search official docs, packages, and code patterns | Finding best practices |
623
- | **genesis-release** | Manage semantic versioning and Git release tags | Preparing releases |
624
- | **genesis-release-orchestration** | Generate release checklists, rollback plans, and runbooks | Before production deployment |
642
+ | **genesis-release** | Manage semantic versioning, Git tags, runbooks, and rollback plans | Preparing releases & deployments |
625
643
  | **genesis-performance-profiling** | Measure system latency and execute runtime optimization | Before performance tuning |
626
644
  | **genesis-observability-automation** | Log autonomous decisions, ADR history, and tool outputs | Maintaining execution trace |
627
645
  | **genesis-ai-provider** | Monitor, budget, and optimize LLM token consumption | Safeguarding API token limits |
@@ -630,6 +648,10 @@ Each skill follows the standard naming convention in `.codex/skills/`:
630
648
  | **genesis-design-spec** | Define and manage design tokens and theme consistency | Standardizing design systems |
631
649
  | **genesis-harness-engineering** | Build test frameworks, harness structures, and test fixtures | Setting up test suites |
632
650
  | **spec-impact-engine** | Evaluate the blast radius of proposed specification changes | Assessing spec adjustments |
651
+ | **genesis-executing-plans** | Strictly follow the approved execution plan and task.md | Implementing features via plan |
652
+ | **genesis-test-driven-development** | Enforce TDD (Red -> Green -> Refactor) and test verification | Writing logic or bug fixes |
653
+ | **genesis-verification-before-completion** | Require evidence and script execution before task completion | Finalizing any autonomous task |
654
+ | **genesis-using-git-worktrees** | Isolate destructive or large architectural changes | High-risk refactoring |
633
655
 
634
656
  ---
635
657
 
@@ -738,17 +760,6 @@ npm run pack:check # Check npm package
738
760
 
739
761
  ---
740
762
 
741
- ## 💖 Support the Project (Donate)
742
-
743
- This project is open-source and developed with passion. If you find **Genesis Codex Harness** helpful and it saves you time, consider buying me a coffee to keep the momentum going:
744
-
745
- - **Momo (Vietnam)**: `0865814259`
746
- - **PayPal**: *(Will be updated later)*
747
-
748
- Thank you so much for supporting the development of this project! ❤️
749
-
750
- ---
751
-
752
763
  ## 🔗 Resources
753
764
 
754
765
  - **GitHub**: [codex-genesis-harness](https://github.com/tuanpham09/codex-genesis-harness)
@@ -765,7 +776,7 @@ Thank you so much for supporting the development of this project! ❤️
765
776
  - ✅ **Skills**: 25 fully implemented & verified (added 5-Phase MVP Roadmap planner, advanced self-healing and compaction engines)
766
777
  - ✅ **Test Coverage**: 80%+ required
767
778
  - ✅ **Token Savings**: 40-60%
768
- - ✅ **Production Ready**: Yes (v0.1.6)
779
+ - ✅ **Production Ready**: Yes (v0.1.8)
769
780
  - ✅ **Auto-Research Enforcement**: Active
770
781
  - ✅ **Auto-Debug Verification**: Active
771
782
  - ✅ **Auto-Spec-Propagation**: Active
@@ -777,7 +788,7 @@ Thank you so much for supporting the development of this project! ❤️
777
788
 
778
789
  MIT License - See [LICENSE](LICENSE)
779
790
 
780
- **Genesis Codex Harness** - Build production software with Codex | v0.1.6 | June 2026
791
+ **Genesis Codex Harness** - Build production software with Codex | v0.1.8 | June 2026
781
792
 
782
793
  ---
783
794
 
package/README.VI.md CHANGED
@@ -26,6 +26,17 @@
26
26
 
27
27
  ---
28
28
 
29
+ ## 💖 Ủng Hộ Dự Án (Donate)
30
+
31
+ Dự án này là mã nguồn mở và được phát triển hoàn toàn vì đam mê. Nếu bạn thấy **Genesis Codex Harness** hữu ích và giúp bạn tiết kiệm thời gian, bạn có thể mời tôi một ly cafe để tiếp thêm động lực phát triển nhé:
32
+
33
+ - **Momo**: `0865814259`
34
+ - **PayPal**: *(Sẽ cập nhật sau)*
35
+
36
+ Cảm ơn bạn rất nhiều vì đã đồng hành cùng sự phát triển của dự án! ❤️
37
+
38
+ ---
39
+
29
40
  ## 🎯 Tại Sao Dùng Genesis? (ROI trong 3 phút)
30
41
 
31
42
  ### Trước Genesis ❌
@@ -132,15 +143,27 @@ Genesis Codex Harness giới thiệu 5 phân hệ kỹ thuật mang tính đột
132
143
 
133
144
  ---
134
145
 
135
- ## 🚀 Nâng Cấp Kỹ Nghệ Harness Thế Hệ Mới (v0.1.6)
146
+ ## 🚀 Nâng Cấp Kỹ Nghệ Harness Thế Hệ Mới (v0.1.8)
136
147
 
137
- Phiên bản Genesis v0.1.6 giới thiệu năm công cụ cao cấp, đột phá trong thư mục `scripts/` nhằm áp đặt an toàn kiểu dữ liệu, tự động hóa test, thiết lập sự đồng nhất giữa sơ đồ trực quan và mã nguồn, chủ động kiểm soát token khôi phục nhanh bài học sửa lỗi của Ralph Loop:
148
+ Phiên bản Genesis v0.1.8 giới thiệu sáu công cụ cao cấp, đột phá trong thư mục `scripts/` nhằm áp đặt an toàn kiểu dữ liệu, tự động hóa test, thiết lập sự đồng nhất giữa sơ đồ trực quan và mã nguồn, chủ động kiểm soát token, khôi phục nhanh bài học sửa lỗi hỗ trợ lập trình UI thần tốc:
138
149
 
139
150
  1. **Đồng bộ Sơ đồ Trực quan 2 Chiều (`scripts/spec_visual_sync.js`)**: Trình biên dịch hai chiều tự động đồng bộ hóa sơ đồ cơ sở dữ liệu ERD Mermaid (`database-erd.mmd`) sang các tệp JSON API contracts (`contracts/api/`) và ngược lại, bảo vệ tính nhất quán thiết kế tuyệt đối.
140
151
  2. **Trình Tự Động Sinh Test từ Hợp Đồng (`scripts/test_generator.js`)**: Tự động biên dịch và tạo cấu trúc các bộ kiểm thử tích hợp (Node.js/Jest) hoàn chỉnh tại `tests/integration/` trực tiếp từ các file response contract JSON, hỗ trợ lập tức kịch bản TDD "RED" skeleton.
141
152
  3. **Cổng Kiểm Soát Đồng Nhất Kiểu Dữ Liệu Tĩnh (`scripts/contract_integrity_gate.js`)**: Trình phân tích tĩnh chủ động đối chiếu mã nguồn thực tế với JSON API contract khi FSM chuyển trạng thái, khóa cứng tiến trình build/commit nếu phát hiện trường dữ liệu bị thiếu hoặc sai lệch kiểu dữ liệu.
142
- 4. **Vệ Binh Tiền Trảm Token Chủ Động (`scripts/prompt_sentinel.js`)**: Bộ giám sát dung lượng token thời gian thực. Sentinel đo lường tải lượng token trước khi gọi LLM, chủ động tạm dừng các lệnh quá nặng và kích hoạt nén FSM/dọn logs khi dung lượng chạm ngưỡng an toàn (ví dụ: 20k tokens).
153
+ 4. **Vệ Binh Tiền Trảm Token Chủ Động (`scripts/prompt_sentinel.js`)**: Bộ giám sát dung lượng token thời gian thực. Sentinel đo lường tải lượng token trước khi gọi LLM, chủ động tạm dừng các lệnh quá nặng và kích hoạt nén FSM/dọn logs khi dung lượng chạm ngưỡng LeanCTX trong `.codebase/context-policy.json`.
143
154
  5. **Tự Động Thu Hồi Bài Học Sửa Lỗi (`scripts/healing_telemetry.js`)**: Hệ thống ghi chép lịch sử chữ ký lỗi và mã nguồn sửa lỗi thành công vào `.codebase/failures/lessons_learned.md`. Vòng lặp Ralph Loop sẽ đối sánh và tái sử dụng trực tiếp các phương án sửa lỗi này khi gặp lỗi tương ứng, đạt hiệu suất **tự khắc phục lỗi chỉ trong đúng 1 turn**.
155
+ 6. **Aesthetic Vibe Mode (`VIBE_MODE=1`)**: Một hệ thống Triage linh hoạt cho phép AI tự động bỏ qua các bài test nghiêm ngặt (TDD/Contract) khi người dùng chỉ muốn chỉnh sửa giao diện thẩm mỹ (CSS/UI). Mọi vi phạm lách luật đều được ghi chép ngầm vào `.codebase/TECH_DEBT.md` để xử lý sau.
156
+
157
+ ### LeanCTX + wrapper local tùy chọn
158
+
159
+ Genesis cài kèm policy LeanCTX portable tại `.codebase/context-policy.json` và cung cấp:
160
+
161
+ ```bash
162
+ genesis-harness leanctx
163
+ genesis-harness prime
164
+ ```
165
+
166
+ `npm install` / `genesis-harness install` sẽ tự seed policy vào project hiện tại khi phát hiện project root, và không ghi đè policy đã custom. Lệnh `leanctx` chỉ để xem/kiểm tra policy. Người dùng cài từ npm vẫn dùng lệnh chuẩn như `genesis-harness sync`, `genesis-harness docs-gate`, `npm run verify`. Nếu máy dev có `rtk`, Genesis chỉ tự nhận diện và hiển thị như wrapper local tùy chọn; `rtk` không phải dependency công khai.
144
167
 
145
168
  ---
146
169
 
@@ -611,17 +634,13 @@ Mỗi skill tuân theo naming quy chuẩn trong thư mục `.codex/skills/`:
611
634
  | **genesis-api-sync** | Đồng bộ hóa API contract và codebase tự động | Khi cập nhật endpoint |
612
635
  | **genesis-spec-propagation** | Tự động lan tỏa thay đổi đặc tả xuống hạ nguồn | Khi spec thay đổi |
613
636
  | **genesis-docs-automation** | Tự động hóa đồng bộ tài liệu hệ thống | Tự động chạy sau khi test pass |
614
- | **ui-ux-test-skill** | Thiết kế và xác thực UI flows, kịch bản test giao diện | Trước khi triển khai giao diện |
637
+ | **genesis-ui-ux-test** | Thiết kế và xác thực UI flows, kịch bản test giao diện | Trước khi triển khai giao diện |
615
638
  | **genesis-debug-guide** | Hướng dẫn chẩn đoán và khắc phục lỗi có hệ thống | Khi code lỗi hoặc test fail |
616
639
  | **genesis-pipeline-orchestration** | Điều phối pipeline phát triển nhiều giai đoạn | Quản lý đa giai đoạn |
617
640
  | **genesis-architecture** | Thiết kế hệ thống và ghi nhận quyết định kiến trúc (ADR) | Quyết định thiết kế lớn |
618
- | **genesis-planning** | Lập kế hoạch phân rã công việc khoa học | Chuẩn bị feature phức tạp |
619
- | **genesis-mvp-planning** | Tự động lập kế hoạch và phân rã Lộ trình 5-Phase MVP | Chạy ngay sau khi khởi tạo dự án |
641
+ | **genesis-planning** | Lập kế hoạch phân rã công việc Lộ trình 5-Phase MVP | Chuẩn bị feature phức tạp & thiết lập lộ trình |
620
642
  | **genesis-codebase-map** | Vẽ bản đồ kiến trúc codebase | Tìm hiểu codebase lớn |
621
- | **genesis-docs** | Tạo tài liệu kỹ thuật chi tiết | Kết thúc giai đoạn / release |
622
- | **genesis-research** | Nghiên cứu công nghệ, thư viện phù hợp | Tìm kiếm best practices |
623
- | **genesis-release** | Quản lý quy trình phát hành phiên bản | Version control + git tag |
624
- | **genesis-release-orchestration** | Tự động hóa lập kế hoạch và runbook phát hành | Chuẩn bị deploy hệ thống |
643
+ | **genesis-release** | Quản phiên bản, runbooks, kế hoạch khôi phục (rollback) | Chuẩn bị phát hành & triển khai |
625
644
  | **genesis-performance-profiling** | Đo lường hiệu suất và tối ưu hóa thời gian chạy | Trước khi tối ưu hiệu năng |
626
645
  | **genesis-observability-automation** | Tự động ghi chép quyết định (ADR) và log hành vi hệ thống | Ghi chép lịch sử vận hành |
627
646
  | **genesis-ai-provider** | Theo dõi và tối ưu hóa lượng token tiêu thụ | Giám sát chi phí API |
@@ -630,6 +649,10 @@ Mỗi skill tuân theo naming quy chuẩn trong thư mục `.codex/skills/`:
630
649
  | **genesis-design-spec** | Thiết lập Design System và Design Tokens | Đồng bộ thiết kế hệ thống |
631
650
  | **genesis-harness-engineering** | Xây dựng cơ sở hạ tầng test và dữ liệu mẫu | Setup test framework |
632
651
  | **spec-impact-engine** | Công cụ đánh giá mức độ ảnh hưởng của thay đổi spec | Kiểm tra độ tương thích |
652
+ | **genesis-executing-plans** | Tuân thủ chặt chẽ bản kế hoạch đã duyệt và task.md | Triển khai theo plan đã chốt |
653
+ | **genesis-test-driven-development** | Ép buộc tuân thủ TDD (Red -> Green -> Refactor) | Viết logic mới hoặc sửa lỗi |
654
+ | **genesis-verification-before-completion** | Bắt buộc chạy kịch bản kiểm định trước khi xong việc | Đóng gói/hoàn tất đầu mục |
655
+ | **genesis-using-git-worktrees** | Cô lập môi trường code bằng git worktree an toàn | Đổi cấu trúc/refactor diện rộng |
633
656
 
634
657
  ---
635
658
 
@@ -638,7 +661,7 @@ Mỗi skill tuân theo naming quy chuẩn trong thư mục `.codex/skills/`:
638
661
  | Tài Liệu | Mục Đích | Thời Gian |
639
662
  |----------|---------|----------|
640
663
  | [MODEL_ALLOCATION.md](.codex/MODEL_ALLOCATION.md) | Tại sao Codex là primary | 5 phút |
641
- | [SKILLS_INDEX.md](.codex/SKILLS_INDEX.md) | Chi tiết 19 skills | 20 phút |
664
+ | [SKILLS_INDEX.md](.codex/SKILLS_INDEX.md) | Chi tiết 25 skills | 20 phút |
642
665
  | [SKILLS_NAMING_GUIDE.md](.codex/SKILLS_NAMING_GUIDE.md) | Convention naming | 5 phút |
643
666
  | [FILE_NAMING_CLARIFICATION.md](.codebase/FILE_NAMING_CLARIFICATION.md) | Giải thích file naming | 5 phút |
644
667
  | [CONTRIBUTING.md](CONTRIBUTING.md) | Cách đóng góp | 10 phút |
@@ -730,17 +753,6 @@ npm run eval # Chạy evaluation
730
753
 
731
754
  ---
732
755
 
733
- ## 💖 Ủng Hộ Dự Án (Donate)
734
-
735
- Dự án này là mã nguồn mở và được phát triển hoàn toàn vì đam mê. Nếu bạn thấy **Genesis Codex Harness** hữu ích và giúp bạn tiết kiệm thời gian, bạn có thể mời tôi một ly cafe để tiếp thêm động lực phát triển nhé:
736
-
737
- - **Momo**: `0865814259`
738
- - **PayPal**: *(Sẽ cập nhật sau)*
739
-
740
- Cảm ơn bạn rất nhiều vì đã đồng hành cùng sự phát triển của dự án! ❤️
741
-
742
- ---
743
-
744
756
  ## 🔗 Tài Nguyên
745
757
 
746
758
  - **GitHub**: [codex-genesis-harness](https://github.com/tuanpham09/codex-genesis-harness)
@@ -757,7 +769,7 @@ Cảm ơn bạn rất nhiều vì đã đồng hành cùng sự phát triển c
757
769
  - ✅ **25 Skills**: Hoàn toàn kế thừa và triển khai đầy đủ (đã bổ sung lộ trình 5-Phase MVP, tự chữa lành & nén context)
758
770
  - ✅ **Test Coverage**: 80%+ required
759
771
  - ✅ **Token Savings**: 40-60%
760
- - ✅ **Production Ready**: Yes (v0.1.6)
772
+ - ✅ **Production Ready**: Yes (v0.1.8)
761
773
  - ✅ **Auto-Research Enforcement**: Active
762
774
  - ✅ **Auto-Debug Verification**: Active
763
775
  - ✅ **Auto-Spec-Propagation**: Active
@@ -769,7 +781,7 @@ Cảm ơn bạn rất nhiều vì đã đồng hành cùng sự phát triển c
769
781
 
770
782
  MIT License - Xem [LICENSE](LICENSE)
771
783
 
772
- **Genesis Codex Harness** - Xây dựng phần mềm production với Codex | v0.1.6 | Tháng 6, 2026
784
+ **Genesis Codex Harness** - Xây dựng phần mềm production với Codex | v0.1.8 | Tháng 6, 2026
773
785
 
774
786
  ---
775
787
 
package/README.md CHANGED
@@ -13,6 +13,17 @@
13
13
 
14
14
  ---
15
15
 
16
+ ## 💖 Support the Project (Donate)
17
+
18
+ This project is open-source and developed purely out of passion. If you find **Genesis Codex Harness** helpful and it saves you time, you can buy me a coffee to keep the development going:
19
+
20
+ - **Momo**: `0865814259`
21
+ - **PayPal**: *(Coming soon)*
22
+
23
+ Thank you so much for your support! ❤️
24
+
25
+ ---
26
+
16
27
  ## ⚡ Core Pillars at a Glance
17
28
 
18
29
  * 🗺️ **Structured 5-Phase MVP Roadmap (`genesis-mvp-planning`):** Guarantees a decision-complete path to production. Genesis structures project delivery across 5 standard MVP phases (Foundation/API Core, Auth/Security, Core Features, Integrations, and Production Readiness), ensuring core infrastructure is verified before writing feature code.
@@ -67,7 +78,7 @@ graph TD
67
78
  VL -- Test Passes / Green --> VG[4. Zero-Drift Validation Gate]
68
79
  VG -- Git Diff Spec Warning --> Synced[5. Auto-Docs & State Compaction]
69
80
  Synced --> Complete([COMPLETED State])
70
-
81
+
71
82
  subgraph Harness Runtime Shell (FSM-Driven)
72
83
  RF
73
84
  TDD
@@ -76,7 +87,7 @@ graph TD
76
87
  VG
77
88
  Synced
78
89
  end
79
-
90
+
80
91
  subgraph Memory & Context Safeguards
81
92
  Compaction[(Context Compaction)] <--> Synced
82
93
  Offload[(Tool Log Offloader)] <--> VL
@@ -89,20 +100,32 @@ Genesis is built on five core, state-of-the-art technological breakthroughs that
89
100
  1. **Context Compaction Engine (`compact-context.sh`)**: Automatically condenses architectural decisions, API states, and task history into `.codebase/context/` when prompt window boundaries are reached, freeing up massive context space while keeping 100% decision recall.
90
101
  2. **Tool Call Offloading (`offload-log.sh`)**: Intercepts massive terminal outputs (such as verbose test suites or compiler logs) and offloads them to disk log files (`.system_generated/tasks/`), returning a clean, structural status summary back to the model.
91
102
  3. **Verify-Fix Self-Healing Loop (`run-verify-loop.sh`)**: An autonomous, closed-loop debug engine that captures test failures, reads error output from disk logs, refactors implementation code, and re-runs tests autonomously up to 5 times until the build turns green.
92
- 4. **5-Phase MVP Planner (`genesis-mvp-planning`)**: Guarantees architectural rigor. Runs immediately post-initialization to break down requirements into 5 standard delivery phases, ensuring core contracts are validated before feature coding.
103
+ 4. **5-Phase MVP Planner (`genesis-planning`)**: Guarantees architectural rigor. Breaks down requirements into 5 standard delivery phases, ensuring core contracts are validated before feature coding.
93
104
  5. **Documentation Drift Check Validation Gates (`validation_gates.sh`)**: A hook-level scan that alerts the engineer on phase state changes if source code changes are detected without matching spec updates under `.codebase/`.
94
105
 
95
106
  ---
96
107
 
97
- ## 🚀 Next-Gen Harness Engineering Upgrades (v0.1.6)
108
+ ## 🚀 Next-Gen Harness Engineering Upgrades (v0.1.8)
98
109
 
99
- Genesis v0.1.6 introduces five advanced, state-of-the-art tools under `scripts/` to enforce type-safety, automate tests, establish visual-code integrity, protect token consumption, and enable self-healing loop memory recall:
110
+ Genesis v0.1.8 introduces six advanced, state-of-the-art tools under `scripts/` to enforce type-safety, automate tests, establish visual-code integrity, protect token consumption, enable self-healing loop memory recall, and provide agile UI iteration:
100
111
 
101
112
  1. **Visual Architecture AST Sync (`scripts/spec_visual_sync.js`)**: Bidirectional compiler that syncs Mermaid ERD database diagrams (`database-erd.mmd`) to API contracts JSON schemas (`contracts/api/`) and vice-versa, establishing absolute visual-to-code design integrity.
102
113
  2. **Contract-Driven Test Auto-Generator (`scripts/test_generator.js`)**: Automatically compiles fully executable Mocha/Jest integration test suites in `tests/integration/` directly from your API contracts JSON response schemas, providing instant TDD "RED" skeletons.
103
114
  3. **AST Contract-Code Integrity Gate (`scripts/contract_integrity_gate.js`)**: Static analysis checker that programmatically validates implementation code properties against API contract JSON schemas at FSM transition boundaries, locking state transitions if data type mismatches or missing properties are detected.
104
115
  4. **Pre-emptive Prompt Sentinel (`scripts/prompt_sentinel.js`)**: Real-time token budget monitor. Calculates token weights before calling LLM, pre-emptively halting runaway commands, and executing auto-compaction and log pruning when capacity thresholds (e.g. 20k tokens) are crossed.
105
116
  5. **Self-Healing Lessons-Learned Recall (`scripts/healing_telemetry.js`)**: Telemetry system that records compiler/test failure signatures and applied corrective code edits in `.codebase/failures/lessons_learned.md`. The self-healing loop recalls these recorded fixes on identical error signatures, bypassing iterations to achieve immediate **1-turn recovery**.
117
+ 6. **Aesthetic Vibe Mode (`VIBE_MODE=1`)**: A dynamic Triage engine that allows the AI to bypass strict PEV loops and TDD blockers exclusively for pure UI/CSS aesthetic changes. Bypassed failures are seamlessly routed to `.codebase/TECH_DEBT.md` for later reconciliation.
118
+
119
+ ### LeanCTX + Optional Local Wrappers
120
+
121
+ Genesis ships a portable LeanCTX policy at `.codebase/context-policy.json` and exposes it through:
122
+
123
+ ```bash
124
+ genesis-harness leanctx
125
+ genesis-harness prime
126
+ ```
127
+
128
+ `npm install` / `genesis-harness install` seeds the policy into the current project when a project root is detected, and never overwrites an existing custom policy. The `leanctx` command is only for inspection. Public npm usage and CI commands stay portable (`genesis-harness sync`, `genesis-harness docs-gate`, `npm run verify`). If `rtk` is installed locally, Genesis reports it as an optional wrapper for developer machines only; it is not required for npm users.
106
129
 
107
130
  ---
108
131
 
@@ -145,7 +168,7 @@ After installation, simply type standard commands in your Codex chat interface t
145
168
  ├── genesis-upgrade-design/ # Existing visual audit and upgrade engine
146
169
  ├── genesis-api-contract/ # Enterprise API contract designer
147
170
  ├── genesis-spec-propagation/ # Automated spec propagation engine
148
- ├── genesis-mvp-planning/ # 5-Phase MVP roadmap generator [NEW v0.1.6]
171
+ ├── genesis-planning/ # 5-Phase MVP roadmap planner
149
172
  └── ... (19 more skills, total 25 skills)
150
173
 
151
174
  .codebase/ # Persistent repository memory system
@@ -158,13 +181,28 @@ observability/ # Run records and architectural ADR lo
158
181
 
159
182
  ---
160
183
 
184
+ ## 🔌 MCP Server Configuration (Optional)
185
+
186
+ To supercharge the agent's research and debugging capabilities, you can optionally configure MCP (Model Context Protocol) servers.
187
+ We provide two ways to integrate them:
188
+
189
+ ### Option 1: Global Installation
190
+ Run the built-in setup script to install recommended MCPs globally:
191
+ ```bash
192
+ npm run mcp:setup
193
+ ```
194
+ This installs essential MCPs like Puppeteer (Browser/UI tests), GitHub, and SQLite (Vector Memory).
195
+
196
+ ### Option 2: Dynamic Execution (Agent Config)
197
+ If you prefer not to install them globally, you can configure your Agent Client (e.g., Claude Desktop, Hermes, Cursor) to run them dynamically. See the `mcp.example.json` file in the repository root for configuration snippets.
198
+
161
199
  ## 📊 Project Status & Versioning
162
200
 
163
201
  - ✅ **Architecture Rating**: `10/10` (Enforced research-first + self-healing + spec-propagation)
164
202
  - ✅ **Codex-Only Enforcement**: `100%`
165
203
  - ✅ **Skills Matrix**: 25 fully implemented, structured, and verified skills
166
204
  - ✅ **Token Caching Savings**: `40% to 60%` verified per enterprise project
167
- - ✅ **Stability & Readiness**: Production Ready (`v0.1.6` - June 2026)
205
+ - ✅ **Stability & Readiness**: Production Ready (`v0.1.8` - June 2026)
168
206
 
169
207
  ---
170
208
 
@@ -174,5 +212,5 @@ Licensed under the [MIT License](LICENSE). Contributions, bug reports, and featu
174
212
 
175
213
  ---
176
214
 
177
- **Genesis Codex Harness** v0.1.6 | June 2026
215
+ **Genesis Codex Harness** v0.1.8 | June 2026
178
216
  👉 **[Full English Guide](README.EN.md) | [Tiếng Việt Hướng Dẫn](README.VI.md)**
package/VERSION CHANGED
@@ -1,2 +1,2 @@
1
- 0.1.6
1
+ 0.1.8
2
2