@damphuquy/agent-init 1.4.1 → 1.4.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@damphuquy/agent-init",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "Scaffolding CLI to bootstrap RIPER-5 Coding Agents & Operational Workspace",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -147,4 +147,27 @@ handoff.md ← (Complete) Short final projection
147
147
  </phase>
148
148
  </operational_phases>
149
149
 
150
+ ---
151
+
152
+ ## 4. Template Architecture Philosophy: Understanding Why & How
153
+
154
+ To prevent mechanical, cargo-cult usage of the framework, the template architecture is engineered around the following core technical principles:
155
+
156
+ ### 1. The Architectural "WHY" — Core Rationale
157
+ * **Why the `.seed` extension in `_seeds/`?**
158
+ * Blueprint Immutability: The `.seed` suffix isolates master templates from standard AI discovery tools (`grep`, `find`), preventing agents from mistaking blueprints for active tasks and overwriting master templates.
159
+ * **Why separate phase-specific artifacts instead of one large Markdown file?**
160
+ * Enforces Single Responsibility. Prevents oversized context windows (Anti-Context Saturation) that trigger hallucinations or rule neglect (Lost in the Middle). Ensures every Quality Gate (G1, G2, G3) maps to an auditable, physical file on disk.
161
+ * **Why split `features/` vs `general-plans/`?**
162
+ * Blast Radius Separation: `features/` handles large, multi-phase epics (≥5 files or domain subsystems), whereas `general-plans/` houses rapid bugfixes and optimizations (<5 files). This keeps your workspace organized and prevents minor fixes from burying major architecture.
163
+ * **Why use the 3-state pipeline (`active/`, `backlog/`, `completed/`)?**
164
+ * Filesystem State Machine: `active/` contains strictly one in-flight task at any time, maintaining zero context bleeding. `completed/` serves as a permanent historical archive for future tasks to reference via `<context_references>`.
165
+ * **Why pseudo-XML tags (`<goal>`, `<allowed_files>`,...)?**
166
+ * Machine-Readable Contract: Enforces unambiguous semantic boundaries that LLMs parse reliably, strictly constraining AI write access.
167
+
168
+ ### 2. The Operational "HOW" — Execution Principles
169
+ * **Copy-On-Demand:** Never bulk-copy all seeds into a task folder upfront. Start with `task.md`, then instantiate `research.md` $\rightarrow$ `decision.md` $\rightarrow$ `plan.md` $\rightarrow$ `state.md` $\rightarrow$ `review.md` $\rightarrow$ `handoff.md` sequentially as phases advance.
170
+ * **Stateless Chat, Stateful Workspace:** Sessions can reset and chats can close. All operational progress and error memory (`<failure_memory>`) are recorded on disk (`state.md`), allowing any new session to resume with 100% fidelity.
171
+ * **Selective Knowledge Crystallization:** Upon completion, summarize the task in `handoff.md`. Only promote reusable architectural standards or schema contracts into `process/context/` and `all-context.md`.
172
+
150
173
  </process_orchestration>
@@ -8,6 +8,13 @@
8
8
  Never edit seeds in-place — always copy first.
9
9
  </scope>
10
10
 
11
+ <architectural_rationale>
12
+ ### Seeds Architectural Rationale: Understanding "Why" & "How"
13
+ * **Why the `.seed` extension? (Why):** The `.seed` suffix acts as an immutable boundary. It prevents automated AI discovery tools (`find`, `grep`) from confusing archetype templates with active `*.md` task files. This guarantees agents will never accidentally overwrite master blueprints during execution.
14
+ * **Why separate seeds per phase? (Why):** Each phase of RIPER-5 requires a distinct cognitive posture and permission boundary (Research vs Innovate vs Plan vs Execute vs Review). Splitting archetypes prevents context window bloat (Anti-Context Saturation), avoids hallucinations, and anchors each Quality Gate (G1–G3) to an auditable physical artifact.
15
+ * **Copy-On-Demand Protocol (How):** Never bulk-copy all seeds into a task directory. Start exclusively with `task.md`. Sequentially instantiate subsequent artifacts (`research.md` $\rightarrow$ `decision.md` $\rightarrow$ `plan.md` $\rightarrow$ `state.md` $\rightarrow$ `review.md` $\rightarrow$ `handoff.md`) only as the task progresses into each phase.
16
+ </architectural_rationale>
17
+
11
18
  ---
12
19
 
13
20
  ## 1. Blueprint Catalog
@@ -147,4 +147,27 @@ handoff.md ← (Complete) Tóm tắt bàn giao ngắn gọn
147
147
  </phase>
148
148
  </operational_phases>
149
149
 
150
+ ---
151
+
152
+ ## 4. Triết Lý Kiến Trúc Templates: Vì Sao Tổ Chức Như Vậy? (Why & How)
153
+
154
+ Để tránh tình trạng chỉ sử dụng máy móc mà không hiểu nguyên lý, kiến trúc của hệ thống templates được xây dựng dựa trên các trụ cột kỹ thuật sau:
155
+
156
+ ### 1. Bản chất "WHY" — Lý Do Thiết Kế
157
+ * **Tại sao có hậu tố `.seed` trong `_seeds/`?**
158
+ * Hậu tố `.seed` phân định ranh giới bất biến (Blueprint Immutability). Ngăn chặn các công cụ tìm kiếm của AI (như `grep`, `find`) nhận diện nhầm file mẫu thành file task đang chạy, bảo vệ phôi mẫu không bị AI vô tình ghi đè.
159
+ * **Tại sao chia nhỏ theo từng Phase thay vì 1 file Markdown lớn?**
160
+ * Áp dụng nguyên lý Single Responsibility. Tránh hiện tượng phình to context window (Anti-Context Saturation) khiến AI bị ảo giác hoặc "quên" quy tắc (Lost in the middle). Đảm bảo mỗi Quality Gate (G1, G2, G3) được gắn với một bằng chứng vật lý độc lập.
161
+ * **Tại sao phân chia `features/` vs `general-plans/`?**
162
+ * Phân tách theo bán kính ảnh hưởng (Blast Radius). `features/` dành cho task lớn (≥5 files hoặc theo domain), `general-plans/` dành cho tác vụ nhanh, sửa bug (<5 files). Ngăn chặn tình trạng hàng chục task vụn vặt làm loãng cấu trúc hệ thống.
163
+ * **Tại sao có 3 trạng thái `active/`, `backlog/`, `completed/`?**
164
+ * Mô hình State Machine trên filesystem: `active/` tại một thời điểm chỉ chứa DUY NHẤT một task đang làm, giữ không gian làm việc của AI sạch sẽ tuyệt đối. `completed/` lưu trữ tri thức lịch sử để các task sau kế thừa qua `<context_references>`.
165
+ * **Tại sao dùng thẻ XML (`<goal>`, `<allowed_files>`,...)?**
166
+ * Ranh giới cú pháp máy đọc được (Machine-Readable Contract), khóa chặt phạm vi sửa đổi của AI.
167
+
168
+ ### 2. Bản chất "HOW" — Nguyên Tắc Vận Hành
169
+ * **Copy-On-Demand:** Tuyệt đối không copy hàng loạt tất cả seed vào task cùng lúc. Bắt đầu với `task.md`, sau đó sinh ra `research.md` $\rightarrow$ `decision.md` $\rightarrow$ `plan.md` $\rightarrow$ `state.md` $\rightarrow$ `review.md` $\rightarrow$ `handoff.md` theo tiến độ phase.
170
+ * **Stateless Chat, Stateful Workspace:** Cửa sổ chat có thể tắt hoặc reset session. Toàn bộ tiến độ và bộ nhớ lỗi (`<failure_memory>`) được lưu bền vững trên ổ đĩa (`state.md`), session mới chỉ cần nạp lại file là tiếp tục công việc chính xác 100%.
171
+ * **Selective Knowledge Crystallization:** Sau khi task hoàn thành và tạo `handoff.md`, chỉ những thay đổi kiến trúc/contract dùng chung mới được cập nhật vào `process/context/` và đăng ký trong `all-context.md`.
172
+
150
173
  </process_orchestration>
@@ -8,6 +8,13 @@
8
8
  Không bao giờ chỉnh sửa trực tiếp bên trong `_seeds/` — luôn luôn sao chép trước khi dùng.
9
9
  </scope>
10
10
 
11
+ <architectural_rationale>
12
+ ### Triết Lý Thiết Kế Seeds: Bản Chất "Why" & "How"
13
+ * **Tại sao là đuôi `.seed`? (Why):** Đuôi `.seed` đóng vai trò ranh giới bất biến (Blueprint Immutability). Nó giúp phân biệt rõ ràng giữa "khuôn mẫu phôi" và "tài liệu markdown đang làm việc" (`*.md`). Khi AI quét repo bằng các công cụ tìm kiếm, hậu tố `.seed` bảo vệ các file này không bao giờ bị AI sửa đè vào làm hỏng template gốc của cả dự án.
14
+ * **Tại sao tách riêng từng seed theo phase? (Why):** Mỗi giai đoạn trong chu trình RIPER-5 đòi hỏi một kiểu tư duy và ranh giới quyền hạn khác biệt (Khảo sát vs Đề xuất vs Lập kế hoạch vs Thực thi vs Nghiệm thu). Việc tách rời giúp AI chỉ nạp đúng artifact cần thiết, chống phình to context window (Anti-Context Saturation) và gắn chặt với từng Cổng kiểm soát (Gates G1–G3).
15
+ * **Quy tắc Copy-On-Demand (How):** Tuyệt đối không copy hàng loạt tất cả seed vào thư mục task. Bắt đầu duy nhất với `task.md`. Khi task tiến vào phase nào, mới lần lượt khởi tạo artifact của phase đó (`research.md` $\rightarrow$ `decision.md` $\rightarrow$ `plan.md` $\rightarrow$ `state.md` $\rightarrow$ `review.md` $\rightarrow$ `handoff.md`).
16
+ </architectural_rationale>
17
+
11
18
  ---
12
19
 
13
20
  ## 1. Danh Mục Blueprints Mẫu