@damphuquy/agent-init 1.0.0
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/README.md +146 -0
- package/bin/bootstrap.js +88 -0
- package/package.json +35 -0
- package/templates/.agents/name_rule.md +3 -0
- package/templates/AGENTS.md +102 -0
- package/templates/process/README.md +58 -0
- package/templates/process/_seeds/_GUIDE.md +30 -0
- package/templates/process/_seeds/context-group.md.seed +24 -0
- package/templates/process/_seeds/program-template.md.seed +56 -0
- package/templates/process/_seeds/task-template.md.seed +93 -0
- package/templates/process/context/all-context.md +30 -0
- package/templates/process/context/planning/all-planning.md +31 -0
- package/templates/process/development-protocols/all-development-protocols.md +27 -0
- package/templates/process/development-protocols/implementation-standards.md +28 -0
- package/templates/process/development-protocols/orchestration.md +24 -0
- package/templates/process/features/active/.gitkeep +0 -0
- package/templates/process/features/backlog/.gitkeep +0 -0
- package/templates/process/features/completed/.gitkeep +0 -0
- package/templates/process/general-plans/active/.gitkeep +0 -0
- package/templates/process/general-plans/backlog/.gitkeep +0 -0
- package/templates/process/general-plans/completed/.gitkeep +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# RIPER-5 Coding Agents & Operational Workspace Scaffolder
|
|
2
|
+
|
|
3
|
+
Bộ công cụ khởi tạo bộ khung System Prompt / Agent Manual (`AGENTS.md`) và Operational Workspace (`process/`) cho bất kỳ subsystem hoặc repository nào.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Khởi tạo từ xa (Remote Execution)
|
|
8
|
+
|
|
9
|
+
Không cần clone repository, chạy trực tiếp trên máy đích.
|
|
10
|
+
|
|
11
|
+
### Node.js (npx)
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Khởi tạo tại thư mục hiện tại
|
|
15
|
+
npx @damphuquy/agent-init .
|
|
16
|
+
|
|
17
|
+
# Khởi tạo vào thư mục chỉ định
|
|
18
|
+
npx @damphuquy/agent-init ./my-project
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Linux / macOS / WSL (Bash)
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Khởi tạo tại thư mục hiện tại
|
|
25
|
+
curl -fsSL https://raw.githubusercontent.com/<USER>/<REPO>/main/bootstrap.sh | bash
|
|
26
|
+
|
|
27
|
+
# Khởi tạo vào thư mục chỉ định
|
|
28
|
+
curl -fsSL https://raw.githubusercontent.com/<USER>/<REPO>/main/bootstrap.sh | bash -s -- ./my-project
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Windows (PowerShell)
|
|
32
|
+
|
|
33
|
+
```powershell
|
|
34
|
+
# Khởi tạo tại thư mục hiện tại
|
|
35
|
+
irm https://raw.githubusercontent.com/<USER>/<REPO>/main/bootstrap.ps1 | iex
|
|
36
|
+
|
|
37
|
+
# Khởi tạo vào thư mục chỉ định
|
|
38
|
+
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/<USER>/<REPO>/main/bootstrap.ps1))) -TargetDir ".\my-project"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 2. Khởi tạo cục bộ (Local Execution)
|
|
44
|
+
|
|
45
|
+
Khi đã tải hoặc clone repository về máy:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Sử dụng Node.js
|
|
49
|
+
node bin/bootstrap.js [target_directory]
|
|
50
|
+
|
|
51
|
+
# Sử dụng Bash
|
|
52
|
+
bash bootstrap.sh [target_directory]
|
|
53
|
+
|
|
54
|
+
# Sử dụng Python
|
|
55
|
+
python3 bootstrap.py [target_directory]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 3. Tùy chọn tham số (Options)
|
|
61
|
+
|
|
62
|
+
- `-f, --force`: Ghi đè file nếu đã tồn tại trước đó.
|
|
63
|
+
- `-h, --help`: Hiển thị hướng dẫn sử dụng.
|
|
64
|
+
|
|
65
|
+
Ví dụ:
|
|
66
|
+
```bash
|
|
67
|
+
npx @damphuquy/agent-init ./my-project --force
|
|
68
|
+
bash bootstrap.sh ./my-project --force
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 4. Cấu trúc thư mục mã nguồn và chỉnh sửa template
|
|
74
|
+
|
|
75
|
+
Tất cả template mẫu được tách riêng biệt thành các file thực tế trong thư mục `templates/`:
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
.
|
|
79
|
+
├── templates/ # Toàn bộ nội dung template (chỉnh sửa trực tiếp tại đây)
|
|
80
|
+
│ ├── AGENTS.md
|
|
81
|
+
│ ├── .agents/name_rule.md
|
|
82
|
+
│ └── process/
|
|
83
|
+
│ ├── README.md
|
|
84
|
+
│ ├── _seeds/ # Các seed templates (task, program, context)
|
|
85
|
+
│ ├── context/ # Context routers
|
|
86
|
+
│ └── development-protocols/ # Quy chuẩn lập trình & điều phối
|
|
87
|
+
├── bin/
|
|
88
|
+
│ └── bootstrap.js # CLI runner đọc trực tiếp từ templates/
|
|
89
|
+
├── scripts/
|
|
90
|
+
│ └── build-bundle.js # Trình biên dịch tự động templates/ vào bootstrap.sh/ps1/py
|
|
91
|
+
├── bootstrap.sh # Bản standalone cho curl | bash
|
|
92
|
+
├── bootstrap.ps1 # Bản standalone cho PowerShell irm | iex
|
|
93
|
+
├── bootstrap.py # Bản standalone cho Python
|
|
94
|
+
└── package.json
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Khi bạn chỉnh sửa bất kỳ nội dung nào trong thư mục `templates/`, chỉ cần chạy lệnh sau để tự động đồng bộ sang tất cả các file thực thi đơn lẻ:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npm run build
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 5. Cấu trúc thư mục được sinh ra trên dự án đích
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
<target_dir>/
|
|
109
|
+
├── AGENTS.md # Master Agent Guidelines (4 Pillars + RIPER-5 Framework)
|
|
110
|
+
├── .agents/
|
|
111
|
+
│ └── name_rule.md # Quy tắc đặt tên và interface
|
|
112
|
+
└── process/
|
|
113
|
+
├── README.md # Trung tâm điều hành task process
|
|
114
|
+
├── _seeds/ # Blueprints / Templates gốc (Read-only)
|
|
115
|
+
│ ├── _GUIDE.md # Hướng dẫn sử dụng seeds
|
|
116
|
+
│ ├── task-template.md.seed # Template cho task đơn lẻ (SPEC, PLAN, AC)
|
|
117
|
+
│ ├── program-template.md.seed # Blueprint cho chương trình đa pha
|
|
118
|
+
│ └── context-group.md.seed # Seed cho router ngữ cảnh domain
|
|
119
|
+
├── context/
|
|
120
|
+
│ ├── all-context.md # Root context router
|
|
121
|
+
│ └── planning/all-planning.md # Tiêu chuẩn INVEST, capacity planning
|
|
122
|
+
├── development-protocols/
|
|
123
|
+
│ ├── all-development-protocols.md # Protocols index
|
|
124
|
+
│ ├── orchestration.md # Quy tắc subagent delegation
|
|
125
|
+
│ └── implementation-standards.md # Chuẩn typing, domain purity, testing
|
|
126
|
+
├── features/ # Quản lý task theo feature/domain
|
|
127
|
+
│ ├── active/ # Task đang thực thi ({task_slug}_{date}/)
|
|
128
|
+
│ ├── backlog/ # Task chờ xử lý ({note_slug}_NOTE_{date}.md)
|
|
129
|
+
│ └── completed/ # Task đã hoàn thành
|
|
130
|
+
└── general-plans/ # Quản lý task cross-cutting / độc lập
|
|
131
|
+
├── active/
|
|
132
|
+
├── backlog/
|
|
133
|
+
└── completed/
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 6. Các bước sau khi khởi tạo
|
|
139
|
+
|
|
140
|
+
1. **Cập nhật lệnh kiểm thử trong `AGENTS.md`**:
|
|
141
|
+
Mở file `<target_dir>/AGENTS.md` và chỉnh sửa các lệnh kiểm thử tại phần `<validation_commands>` phù hợp với công nghệ của dự án (ví dụ: `npm test`, `pytest`, `go test ./...`).
|
|
142
|
+
|
|
143
|
+
2. **Tạo task đầu tiên từ template**:
|
|
144
|
+
```bash
|
|
145
|
+
cp process/_seeds/task-template.md.seed process/general-plans/active/01-init_PLAN.md
|
|
146
|
+
```
|
package/bin/bootstrap.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
function parseArgs() {
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
let targetDir = '.';
|
|
9
|
+
let force = false;
|
|
10
|
+
|
|
11
|
+
for (let i = 0; i < args.length; i++) {
|
|
12
|
+
const arg = args[i];
|
|
13
|
+
if (arg === '--force' || arg === '-f') {
|
|
14
|
+
force = true;
|
|
15
|
+
} else if (arg === '--help' || arg === '-h') {
|
|
16
|
+
console.log(`
|
|
17
|
+
Usage:
|
|
18
|
+
npx @damphuquy/agent-init [target_directory] [options]
|
|
19
|
+
node bin/bootstrap.js [target_directory] [options]
|
|
20
|
+
|
|
21
|
+
Options:
|
|
22
|
+
-f, --force Overwrite existing files if present
|
|
23
|
+
-h, --help Display this help message
|
|
24
|
+
|
|
25
|
+
Examples:
|
|
26
|
+
npx @damphuquy/agent-init .
|
|
27
|
+
npx @damphuquy/agent-init ./services/billing --force
|
|
28
|
+
`);
|
|
29
|
+
process.exit(0);
|
|
30
|
+
} else if (!arg.startsWith('-')) {
|
|
31
|
+
targetDir = arg;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return { targetDir, force };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function copyDirectoryRecursive(srcDir, destDir, targetBase, force, stats = { created: 0, skipped: 0 }) {
|
|
39
|
+
if (!fs.existsSync(destDir)) {
|
|
40
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const entries = fs.readdirSync(srcDir, { withFileTypes: true });
|
|
44
|
+
|
|
45
|
+
for (const entry of entries) {
|
|
46
|
+
const srcPath = path.join(srcDir, entry.name);
|
|
47
|
+
const destPath = path.join(destDir, entry.name);
|
|
48
|
+
|
|
49
|
+
if (entry.isDirectory()) {
|
|
50
|
+
copyDirectoryRecursive(srcPath, destPath, targetBase, force, stats);
|
|
51
|
+
} else {
|
|
52
|
+
const relPath = path.relative(targetBase, destPath);
|
|
53
|
+
if (fs.existsSync(destPath) && !force) {
|
|
54
|
+
console.log(` [SKIPPED] ${relPath} (already exists, use --force to overwrite)`);
|
|
55
|
+
stats.skipped++;
|
|
56
|
+
} else {
|
|
57
|
+
fs.copyFileSync(srcPath, destPath);
|
|
58
|
+
console.log(` [CREATED] ${relPath}`);
|
|
59
|
+
stats.created++;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return stats;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function scaffold(targetDir, force) {
|
|
68
|
+
const templatesDir = path.resolve(__dirname, '../templates');
|
|
69
|
+
|
|
70
|
+
if (!fs.existsSync(templatesDir)) {
|
|
71
|
+
console.error(`Error: Templates directory not found at ${templatesDir}`);
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const resolvedTarget = path.resolve(process.cwd(), targetDir);
|
|
76
|
+
console.log(`Scaffolding RIPER-5 Coding Agents Workspace into: ${resolvedTarget}`);
|
|
77
|
+
|
|
78
|
+
const stats = copyDirectoryRecursive(templatesDir, resolvedTarget, resolvedTarget, force);
|
|
79
|
+
|
|
80
|
+
console.log(`\nSetup complete: ${stats.created} created, ${stats.skipped} skipped.`);
|
|
81
|
+
console.log(`\nNext Steps:`);
|
|
82
|
+
console.log(` 1. Review and customize validation commands in: ${path.join(targetDir, 'AGENTS.md')}`);
|
|
83
|
+
console.log(` 2. Instantiate your first active task:`);
|
|
84
|
+
console.log(` cp ${path.join(targetDir, 'process/_seeds/task-template.md.seed')} ${path.join(targetDir, 'process/general-plans/active/01-init_PLAN.md')}\n`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const { targetDir, force } = parseArgs();
|
|
88
|
+
scaffold(targetDir, force);
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@damphuquy/agent-init",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Scaffolding CLI to bootstrap RIPER-5 Coding Agents & Operational Workspace",
|
|
5
|
+
"main": "bin/bootstrap.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agent-init": "./bin/bootstrap.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"templates"
|
|
12
|
+
],
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "node scripts/build-bundle.js",
|
|
18
|
+
"start": "node ./bin/bootstrap.js",
|
|
19
|
+
"scaffold": "node ./bin/bootstrap.js"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"ai-agent",
|
|
23
|
+
"riper-5",
|
|
24
|
+
"agent-manual",
|
|
25
|
+
"operational-workspace",
|
|
26
|
+
"scaffold",
|
|
27
|
+
"coding-agents",
|
|
28
|
+
"agent-init"
|
|
29
|
+
],
|
|
30
|
+
"author": "Phu Quy Dam",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=16.0.0"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Repository Agent Guidelines (RIPER-5 Framework)
|
|
2
|
+
|
|
3
|
+
<agent_guidelines version="2.0">
|
|
4
|
+
|
|
5
|
+
<overview>
|
|
6
|
+
Master operating instructions for AI agents in this subsystem/repository. Establishes the **4 Core Pillars** and the **RIPER-5 Operational Loop**, integrated with the [`process/`](process/README.md) task framework.
|
|
7
|
+
</overview>
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. Core Foundations
|
|
12
|
+
|
|
13
|
+
<foundations>
|
|
14
|
+
<!-- Pillar 1: Task & Specification -->
|
|
15
|
+
<pillar id="task_spec" title="Task & Specification">
|
|
16
|
+
<rule>Single Source of Truth: Active task file in [`process/features/{feature}/active/`](process/features/) or [`process/general-plans/active/`](process/general-plans/) (instantiated from [`process/_seeds/task-template.md.seed`](process/_seeds/task-template.md.seed)).</rule>
|
|
17
|
+
<rule>Define changes via Goal, Current Behavior, Expected Behavior, Invariants, and `<out_of_scope>`.</rule>
|
|
18
|
+
<rule>Acceptance Criteria (AC) must be unambiguous, verifiable markdown checkboxes (`- [ ]`).</rule>
|
|
19
|
+
</pillar>
|
|
20
|
+
|
|
21
|
+
<!-- Pillar 2: Context Navigation -->
|
|
22
|
+
<pillar id="context" title="Context Navigation">
|
|
23
|
+
<rule>Gather minimum sufficient context. No full-repo scanning or drive-by refactoring.</rule>
|
|
24
|
+
<information_priority>
|
|
25
|
+
1. Task Spec & AC ([`process/features/**/_SPEC*.md`](process/features/), [`process/general-plans/**/_PLAN*.md`](process/general-plans/), [`process/context/all-context.md`](process/context/all-context.md))
|
|
26
|
+
2. Relevant Test Suites (`tests/...`)
|
|
27
|
+
3. Domain Models & Ports (`src/.../domain/`, `src/.../application/port_*`)
|
|
28
|
+
4. Configuration & DI (`src/.../infrastructure/config/`, `pyproject.toml` / `package.json`)
|
|
29
|
+
5. Concrete Implementations (`src/.../infrastructure/`, `src/.../application/service/`, `src/.../api/`)
|
|
30
|
+
</information_priority>
|
|
31
|
+
</pillar>
|
|
32
|
+
|
|
33
|
+
<!-- Pillar 3: Engineering Harness & Guardrails -->
|
|
34
|
+
<pillar id="harness" title="Engineering Harness & Guardrails">
|
|
35
|
+
<validation_commands>
|
|
36
|
+
# Adapt these commands to your subsystem's toolchain:
|
|
37
|
+
# e.g., Python: uv run pytest && uv run mypy --strict . && uv run ruff check . && uv run ruff format --check .
|
|
38
|
+
# e.g., Node/TS: npm run test && npm run typecheck && npm run lint
|
|
39
|
+
</validation_commands>
|
|
40
|
+
<architecture_guardrail>
|
|
41
|
+
Clean Architecture & Dependency Injection provide structural guidance, NOT an instruction to blindly over-engineer simple utilities.
|
|
42
|
+
</architecture_guardrail>
|
|
43
|
+
</pillar>
|
|
44
|
+
</foundations>
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 2. Operational Loop (Pillar 4: RIPER-5 Protocol)
|
|
49
|
+
|
|
50
|
+
<operational_loop>
|
|
51
|
+
<phase order="1" name="Research (R)">
|
|
52
|
+
Ingest active task spec, follow `<information_priority>`, establish domain invariants and boundaries.
|
|
53
|
+
</phase>
|
|
54
|
+
|
|
55
|
+
<phase order="2" name="Innovate & Plan (I)">
|
|
56
|
+
Decompose into vertical slices (per [`process/context/planning/all-planning.md`](process/context/planning/all-planning.md)), define step-by-step plan and test cases.
|
|
57
|
+
</phase>
|
|
58
|
+
|
|
59
|
+
<phase order="3" name="Produce (P)">
|
|
60
|
+
Implement scoped atomic edits with strict typing. Preserve public APIs and backward compatibility.
|
|
61
|
+
</phase>
|
|
62
|
+
|
|
63
|
+
<phase order="4" name="Evaluate (E)">
|
|
64
|
+
Execute focused test $\rightarrow$ full suite $\rightarrow$ type check $\rightarrow$ lint & format check.
|
|
65
|
+
</phase>
|
|
66
|
+
|
|
67
|
+
<phase order="5" name="Reconcile & Review (R)">
|
|
68
|
+
Inspect `git diff` for zero noise. Safely toggle verified checkboxes (`- [x]`). Move completed task to `completed/`.
|
|
69
|
+
</phase>
|
|
70
|
+
|
|
71
|
+
<retry_budget max_attempts="3">
|
|
72
|
+
Maximum 3 consecutive attempts per distinct failure symptom. Never bypass errors with suppression flags (e.g. `# type: ignore`, `eslint-disable`). If exhausted, halt and log into `<open_decisions>`.
|
|
73
|
+
</retry_budget>
|
|
74
|
+
|
|
75
|
+
<escalation_and_stop_conditions>
|
|
76
|
+
Halt immediately and request human guidance if:
|
|
77
|
+
1. Retry budget is exhausted on a recurring failure.
|
|
78
|
+
2. Modification requires undeclared changes to public APIs, DB schemas, or security policies.
|
|
79
|
+
3. Modification requires touching files outside defined boundaries or in `<out_of_scope>`.
|
|
80
|
+
*Exception:* Do not stop if the change was explicitly authorized by the user in the prompt/spec, or is a mandatory accompanying test/import update.
|
|
81
|
+
</escalation_and_stop_conditions>
|
|
82
|
+
|
|
83
|
+
<completion_gate>
|
|
84
|
+
A task is COMPLETE only when:
|
|
85
|
+
1. All Acceptance Criteria in the active task spec are verified (`- [x]`).
|
|
86
|
+
2. All validation commands execute with zero errors/warnings.
|
|
87
|
+
3. The final `git diff` contains zero extraneous or unreviewed modifications.
|
|
88
|
+
</completion_gate>
|
|
89
|
+
</operational_loop>
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 3. Workspace Protocols
|
|
94
|
+
|
|
95
|
+
<workspace_rules>
|
|
96
|
+
<rule id="env">Execute all commands inside the designated runtime virtual environment / harness.</rule>
|
|
97
|
+
<rule id="sync">Only toggle `- [x]` after Phase 4 (Evaluate) and Phase 5 (Reconcile) pass. Never overwrite human-written specs.</rule>
|
|
98
|
+
<rule id="isolation">Keep edits within this subsystem unless explicit cross-system coordination is requested.</rule>
|
|
99
|
+
<rule id="subagents">Subagent delegation must adhere to [`process/development-protocols/orchestration.md`](process/development-protocols/orchestration.md).</rule>
|
|
100
|
+
</workspace_rules>
|
|
101
|
+
|
|
102
|
+
</agent_guidelines>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Process & Task Orchestration (RIPER-5)
|
|
2
|
+
|
|
3
|
+
<process_orchestration version="2.0" framework="RIPER-5">
|
|
4
|
+
|
|
5
|
+
<overview>
|
|
6
|
+
Standard template and operational control center for managing engineering tasks and coordinating AI agent execution in this subsystem.
|
|
7
|
+
</overview>
|
|
8
|
+
|
|
9
|
+
## 1. Directory Structure
|
|
10
|
+
```text
|
|
11
|
+
process/
|
|
12
|
+
├── README.md # Operational guide (this file)
|
|
13
|
+
├── _seeds/ # Read-only archetype blueprints and templates
|
|
14
|
+
│ ├── _GUIDE.md # Guide on using seeds
|
|
15
|
+
│ ├── task-template.md.seed # Archetype for single tasks (SPEC, PLAN, REPORT)
|
|
16
|
+
│ ├── program-template.md.seed # Archetype for multi-phase programs (Umbrella PLAN)
|
|
17
|
+
│ └── context-group.md.seed # Archetype for domain context routers
|
|
18
|
+
├── context/ # Durable knowledge base & context routers
|
|
19
|
+
│ ├── all-context.md # Root context router
|
|
20
|
+
│ └── planning/all-planning.md # Planning calibration & vertical slicing rules
|
|
21
|
+
├── development-protocols/ # System rules & execution harness
|
|
22
|
+
│ ├── all-development-protocols.md
|
|
23
|
+
│ ├── orchestration.md # Subagent delegation rules
|
|
24
|
+
│ └── implementation-standards.md # Typing, linting, and testing standards
|
|
25
|
+
├── features/ # Domain features (≥5 files / ≥3 phases)
|
|
26
|
+
│ ├── active/ # Active task folders: {task_slug}_{dd-mm-yy}/
|
|
27
|
+
│ ├── completed/ # Archived task folders
|
|
28
|
+
│ └── backlog/ # Backlog notes: {note_slug}_NOTE_{dd-mm-yy}.md
|
|
29
|
+
└── general-plans/ # Cross-cutting & standalone tasks
|
|
30
|
+
├── active/
|
|
31
|
+
├── completed/
|
|
32
|
+
└── backlog/
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 2. The RIPER-5 Operational Flow
|
|
36
|
+
<operational_phases>
|
|
37
|
+
<phase order="1" name="Research">
|
|
38
|
+
Ingest task spec and follow `<information_priority>` (Spec $\rightarrow$ Tests $\rightarrow$ Domain $\rightarrow$ Config $\rightarrow$ Target code).
|
|
39
|
+
</phase>
|
|
40
|
+
|
|
41
|
+
<phase order="2" name="Innovate & Plan">
|
|
42
|
+
Decompose into vertical slices; populate the execution plan.
|
|
43
|
+
</phase>
|
|
44
|
+
|
|
45
|
+
<phase order="3" name="Produce">
|
|
46
|
+
Apply minimal atomic edits with strict typing.
|
|
47
|
+
</phase>
|
|
48
|
+
|
|
49
|
+
<phase order="4" name="Evaluate">
|
|
50
|
+
Run test suites, static type checking, linter and code format checks.
|
|
51
|
+
</phase>
|
|
52
|
+
|
|
53
|
+
<phase order="5" name="Reconcile & Review">
|
|
54
|
+
Inspect `git diff`, update checkboxes (`- [x]`), verify all Acceptance Criteria.
|
|
55
|
+
</phase>
|
|
56
|
+
</operational_phases>
|
|
57
|
+
|
|
58
|
+
</process_orchestration>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Seeds & Archetypes Scaffolding Guide
|
|
2
|
+
|
|
3
|
+
<seeds_guide version="1.0">
|
|
4
|
+
|
|
5
|
+
<scope>
|
|
6
|
+
`_seeds/` is a read-only scaffolding directory containing blueprint templates.
|
|
7
|
+
Copy and instantiate these seeds when defining new tasks, programs, or context routers.
|
|
8
|
+
</scope>
|
|
9
|
+
|
|
10
|
+
## 1. Blueprint Catalog
|
|
11
|
+
<catalog>
|
|
12
|
+
<seed type="task" path="task-template.md.seed">
|
|
13
|
+
Standard single-task template covering `_SPEC`, `_PLAN`, `_REPORT`, and verifiable Acceptance Criteria.
|
|
14
|
+
</seed>
|
|
15
|
+
|
|
16
|
+
<seed type="program" path="program-template.md.seed">
|
|
17
|
+
Multi-phase program blueprint with umbrella planning, phase breakdown, and blast radius registries.
|
|
18
|
+
</seed>
|
|
19
|
+
|
|
20
|
+
<seed type="context" path="context-group.md.seed">
|
|
21
|
+
Template for creating domain-specific context routers (`all-{group}.md`).
|
|
22
|
+
</seed>
|
|
23
|
+
</catalog>
|
|
24
|
+
|
|
25
|
+
## 2. Instantiation Command
|
|
26
|
+
```bash
|
|
27
|
+
cp process/_seeds/task-template.md.seed process/features/your-feature/active/your-task_PLAN_$(date +%d-%m-%y).md
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
</seeds_guide>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Context Group: [Group Name]
|
|
2
|
+
|
|
3
|
+
<context_group name="[Group Name]" version="1.0">
|
|
4
|
+
|
|
5
|
+
<overview>
|
|
6
|
+
[Domain-specific knowledge base and architectural references for Group Name.]
|
|
7
|
+
</overview>
|
|
8
|
+
|
|
9
|
+
## 1. Domain Principles & Invariants
|
|
10
|
+
<domain_invariants>
|
|
11
|
+
- [Invariant 1 — Core business rule]
|
|
12
|
+
- [Invariant 2 — Data integrity or architectural constraint]
|
|
13
|
+
</domain_invariants>
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 2. Key References & System Contracts
|
|
18
|
+
<references>
|
|
19
|
+
<domain_models>`src/domain/...`</domain_models>
|
|
20
|
+
<port_interfaces>`src/application/port_...`</port_interfaces>
|
|
21
|
+
<adapters>`src/infrastructure/...`</adapters>
|
|
22
|
+
</references>
|
|
23
|
+
|
|
24
|
+
</context_group>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Multi-Phase Program: [PROG-ID] [Program Name]
|
|
2
|
+
|
|
3
|
+
<program_umbrella_plan version="2.0" framework="RIPER-5">
|
|
4
|
+
|
|
5
|
+
<metadata>
|
|
6
|
+
<program_id>[PROG-ID]</program_id>
|
|
7
|
+
<lead>@engineering_lead</lead>
|
|
8
|
+
<target_timeline>[e.g. Sprint 1-3]</target_timeline>
|
|
9
|
+
</metadata>
|
|
10
|
+
|
|
11
|
+
## 1. Executive Strategy & Outcome
|
|
12
|
+
<strategy>
|
|
13
|
+
<target_outcome>
|
|
14
|
+
[High-level measurable architectural or business goal.]
|
|
15
|
+
</target_outcome>
|
|
16
|
+
|
|
17
|
+
<system_impact>
|
|
18
|
+
[Affected subsystems, downstream services, or performance targets.]
|
|
19
|
+
</system_impact>
|
|
20
|
+
</strategy>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Phase Breakdown & Blast Radius
|
|
25
|
+
<phase_breakdown>
|
|
26
|
+
<phase number="1" id="phase-01">
|
|
27
|
+
<title>[Domain Models & Port Interfaces]</title>
|
|
28
|
+
<scope>`src/domain/`, `src/application/port_*`</scope>
|
|
29
|
+
<blast_radius level="LOW">Zero external dependency impacts</blast_radius>
|
|
30
|
+
<status>NOT_STARTED</status>
|
|
31
|
+
</phase>
|
|
32
|
+
|
|
33
|
+
<phase number="2" id="phase-02">
|
|
34
|
+
<title>[Infrastructure Adapters & Persistence]</title>
|
|
35
|
+
<scope>`src/infrastructure/`</scope>
|
|
36
|
+
<blast_radius level="MEDIUM">Depends on Phase 01 domain contracts</blast_radius>
|
|
37
|
+
<status>NOT_STARTED</status>
|
|
38
|
+
</phase>
|
|
39
|
+
|
|
40
|
+
<phase number="3" id="phase-03">
|
|
41
|
+
<title>[API Exposure & End-to-End Integration]</title>
|
|
42
|
+
<scope>`src/api/`</scope>
|
|
43
|
+
<blast_radius level="HIGH">Exposes public HTTP endpoints and DTO contracts</blast_radius>
|
|
44
|
+
<status>NOT_STARTED</status>
|
|
45
|
+
</phase>
|
|
46
|
+
</phase_breakdown>
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 3. Global Invariants & Phase Gate Rules
|
|
51
|
+
<phase_gates>
|
|
52
|
+
<rule>Every phase must pass 100% of validation commands before the next phase begins.</rule>
|
|
53
|
+
<rule>No phase may introduce breaking changes to existing public APIs without prior approval.</rule>
|
|
54
|
+
</phase_gates>
|
|
55
|
+
|
|
56
|
+
</program_umbrella_plan>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Task: [TASK-ID] [Task Title]
|
|
2
|
+
|
|
3
|
+
<task_spec version="2.0" framework="RIPER-5">
|
|
4
|
+
|
|
5
|
+
<status>
|
|
6
|
+
<phase>PLANNING</phase> <!-- RESEARCHING | PLANNING | PRODUCING | EVALUATING | RECONCILED | COMPLETED -->
|
|
7
|
+
<state>IN_PROGRESS</state>
|
|
8
|
+
<assignee>@agent_or_human</assignee>
|
|
9
|
+
</status>
|
|
10
|
+
|
|
11
|
+
## 1. Specification (Pillar 1: Task / Spec)
|
|
12
|
+
<specification>
|
|
13
|
+
<goal>
|
|
14
|
+
[Target outcome, business value, or functional capability.]
|
|
15
|
+
</goal>
|
|
16
|
+
|
|
17
|
+
<current_behavior>
|
|
18
|
+
[Current behavior prior to this change.]
|
|
19
|
+
</current_behavior>
|
|
20
|
+
|
|
21
|
+
<expected_behavior>
|
|
22
|
+
[Expected behavior once the change is complete.]
|
|
23
|
+
</expected_behavior>
|
|
24
|
+
|
|
25
|
+
<invariants>
|
|
26
|
+
- [Invariant 1 — Conditions that must remain true.]
|
|
27
|
+
</invariants>
|
|
28
|
+
|
|
29
|
+
<out_of_scope>
|
|
30
|
+
- [Explicitly excluded components, refactoring, or undeclared API/schema changes.]
|
|
31
|
+
</out_of_scope>
|
|
32
|
+
|
|
33
|
+
<acceptance_criteria>
|
|
34
|
+
- [ ] [AC-1: Verifiable functional behavior with explicit input and expected output]
|
|
35
|
+
- [ ] [AC-2: Edge cases, validation rules, or error handling]
|
|
36
|
+
- [ ] [AC-3: Automated tests added/updated and passing]
|
|
37
|
+
</acceptance_criteria>
|
|
38
|
+
</specification>
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 2. Context Boundaries (Pillar 2: Context)
|
|
43
|
+
<context_boundaries>
|
|
44
|
+
<target_files>
|
|
45
|
+
- `src/[path/to/file]` — [Planned modification]
|
|
46
|
+
- `tests/[path/to/test_file]` — [Target assertions and test fixtures]
|
|
47
|
+
</target_files>
|
|
48
|
+
</context_boundaries>
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 3. RIPER-5 Execution Plan (Pillar 4: Loop)
|
|
53
|
+
<execution_plan>
|
|
54
|
+
<phase name="Research">
|
|
55
|
+
- [ ] Ingest task spec, domain invariants, and out-of-scope boundaries.
|
|
56
|
+
- [ ] Read corresponding tests and port interfaces.
|
|
57
|
+
</phase>
|
|
58
|
+
|
|
59
|
+
<phase name="Innovate & Plan">
|
|
60
|
+
- [ ] Step 1: [Design domain models / port contracts]
|
|
61
|
+
- [ ] Step 2: [Formulate test strategy and edge cases]
|
|
62
|
+
</phase>
|
|
63
|
+
|
|
64
|
+
<phase name="Produce">
|
|
65
|
+
- [ ] Step 1: [Implement core logic with strict typing]
|
|
66
|
+
- [ ] Step 2: [Implement automated unit/integration tests]
|
|
67
|
+
</phase>
|
|
68
|
+
|
|
69
|
+
<phase name="Evaluate">
|
|
70
|
+
- [ ] Execute focused tests and full validation suite.
|
|
71
|
+
</phase>
|
|
72
|
+
|
|
73
|
+
<phase name="Reconcile & Review">
|
|
74
|
+
- [ ] Review `git diff` for zero unwanted changes or debug statements.
|
|
75
|
+
- [ ] Verify all Acceptance Criteria are satisfied (`- [x]`).
|
|
76
|
+
- [ ] Mark phase as COMPLETED.
|
|
77
|
+
</phase>
|
|
78
|
+
</execution_plan>
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 4. Guardrails & Escalation (Pillar 3 & 4: Harness)
|
|
83
|
+
<guardrails>
|
|
84
|
+
<open_decisions>
|
|
85
|
+
<!-- Log any technical trade-offs or items requiring human guidance here -->
|
|
86
|
+
</open_decisions>
|
|
87
|
+
|
|
88
|
+
<retry_budget max_attempts="3">
|
|
89
|
+
Maximum 3 consecutive attempts per distinct failure symptom before halting.
|
|
90
|
+
</retry_budget>
|
|
91
|
+
</guardrails>
|
|
92
|
+
|
|
93
|
+
</task_spec>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Root Context Router
|
|
2
|
+
|
|
3
|
+
<context_router version="1.0">
|
|
4
|
+
|
|
5
|
+
<description>
|
|
6
|
+
Central durable knowledge index routing to specialized domain context groups across the system.
|
|
7
|
+
</description>
|
|
8
|
+
|
|
9
|
+
## Context Directory Index
|
|
10
|
+
<context_groups>
|
|
11
|
+
<group id="planning">
|
|
12
|
+
<title>Planning Standards & Calibration</title>
|
|
13
|
+
<path>[`planning/all-planning.md`](planning/all-planning.md)</path>
|
|
14
|
+
<scope>INVEST criteria, vertical slicing rules, Story Point capacity calibration</scope>
|
|
15
|
+
</group>
|
|
16
|
+
|
|
17
|
+
<group id="seeds">
|
|
18
|
+
<title>Seeds & Archetypes Guide</title>
|
|
19
|
+
<path>[`../_seeds/_GUIDE.md`](../_seeds/_GUIDE.md)</path>
|
|
20
|
+
<scope>Scaffolding seeds for tasks, programs, and context groups</scope>
|
|
21
|
+
</group>
|
|
22
|
+
|
|
23
|
+
<group id="protocols">
|
|
24
|
+
<title>Development Protocols Index</title>
|
|
25
|
+
<path>[`../development-protocols/all-development-protocols.md`](../development-protocols/all-development-protocols.md)</path>
|
|
26
|
+
<scope>Engineering harness, subagent orchestration, and code standards</scope>
|
|
27
|
+
</group>
|
|
28
|
+
</context_groups>
|
|
29
|
+
|
|
30
|
+
</context_router>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Planning Standards & Calibration Context
|
|
2
|
+
|
|
3
|
+
<planning_context version="1.0">
|
|
4
|
+
|
|
5
|
+
<overview>
|
|
6
|
+
Guidelines for story point estimation, vertical slicing, and capacity calibration.
|
|
7
|
+
</overview>
|
|
8
|
+
|
|
9
|
+
## 1. Quality Standards
|
|
10
|
+
<quality_standards>
|
|
11
|
+
<standard name="INVEST">
|
|
12
|
+
- **Independent:** Deliverable without cross-story blockers.
|
|
13
|
+
- **Negotiable:** Implementation details are flexibly refined.
|
|
14
|
+
- **Valuable:** Delivers measurable user or business value.
|
|
15
|
+
- **Estimable:** Scoped clearly to estimate effort.
|
|
16
|
+
- **Small:** Fits within 1-3 engineering days.
|
|
17
|
+
- **Testable:** Concrete Acceptance Criteria defined.
|
|
18
|
+
</standard>
|
|
19
|
+
|
|
20
|
+
<standard name="Vertical Slicing">
|
|
21
|
+
Avoid horizontal silos. Deliver end-to-end vertical slices across API, logic, and persistence.
|
|
22
|
+
</standard>
|
|
23
|
+
</quality_standards>
|
|
24
|
+
|
|
25
|
+
## 2. Capacity Calibration
|
|
26
|
+
<capacity_calibration>
|
|
27
|
+
<unit>1 Story Point ≈ 2-4 focused engineering hours</unit>
|
|
28
|
+
<max_task_size>3-5 Story Points (larger tasks must be decomposed)</max_task_size>
|
|
29
|
+
</capacity_calibration>
|
|
30
|
+
|
|
31
|
+
</planning_context>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Development Protocols Index
|
|
2
|
+
|
|
3
|
+
<protocols_router version="1.0">
|
|
4
|
+
|
|
5
|
+
<description>
|
|
6
|
+
Central router for engineering protocols, subagent orchestration, and code quality standards.
|
|
7
|
+
</description>
|
|
8
|
+
|
|
9
|
+
## Protocol Catalog
|
|
10
|
+
<protocol_list>
|
|
11
|
+
<protocol name="Subagent Orchestration">
|
|
12
|
+
<path>[`orchestration.md`](orchestration.md)</path>
|
|
13
|
+
<description>Rules for subagent delegation, isolation, and reactive coordination</description>
|
|
14
|
+
</protocol>
|
|
15
|
+
|
|
16
|
+
<protocol name="Implementation & Testing Standards">
|
|
17
|
+
<path>[`implementation-standards.md`](implementation-standards.md)</path>
|
|
18
|
+
<description>Strict typing, code hygiene, and test harness standards</description>
|
|
19
|
+
</protocol>
|
|
20
|
+
|
|
21
|
+
<protocol name="System Agent Guidelines & RIPER-5">
|
|
22
|
+
<path>[`../../AGENTS.md`](../../AGENTS.md)</path>
|
|
23
|
+
<description>Core 4 pillars and RIPER-5 operational loop specification</description>
|
|
24
|
+
</protocol>
|
|
25
|
+
</protocol_list>
|
|
26
|
+
|
|
27
|
+
</protocols_router>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Implementation & Harness Standards
|
|
2
|
+
|
|
3
|
+
<implementation_standards version="1.0">
|
|
4
|
+
|
|
5
|
+
<description>
|
|
6
|
+
Engineering quality, type safety, and testing conventions for this codebase.
|
|
7
|
+
</description>
|
|
8
|
+
|
|
9
|
+
## 1. Type Safety & Code Hygiene
|
|
10
|
+
<conventions>
|
|
11
|
+
<rule id="strict_typing">
|
|
12
|
+
All functions, methods, and class attributes must have explicit type annotations. Use modern union types (`int | None` or `string | null`) and avoid untyped `Any`/`any` unless interfacing with raw external payloads.
|
|
13
|
+
</rule>
|
|
14
|
+
<rule id="domain_purity">
|
|
15
|
+
Code in domain layers must remain pure with zero external infrastructure dependencies.
|
|
16
|
+
</rule>
|
|
17
|
+
<rule id="immutability">
|
|
18
|
+
Prefer immutable models for domain events, value objects, and DTOs.
|
|
19
|
+
</rule>
|
|
20
|
+
</conventions>
|
|
21
|
+
|
|
22
|
+
## 2. Test Architecture
|
|
23
|
+
<test_structure>
|
|
24
|
+
- `tests/unit/`: Fast, isolated tests for domain models, core logic, and mock adapters.
|
|
25
|
+
- `tests/integration/`: End-to-end flow tests with test services or local databases.
|
|
26
|
+
</test_structure>
|
|
27
|
+
|
|
28
|
+
</implementation_standards>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Subagent Delegation & Orchestration Protocol
|
|
2
|
+
|
|
3
|
+
<orchestration_protocol version="1.0">
|
|
4
|
+
|
|
5
|
+
<description>
|
|
6
|
+
Guidelines for delegating, isolating, and coordinating subagents during complex tasks.
|
|
7
|
+
</description>
|
|
8
|
+
|
|
9
|
+
## 1. Delegation Principles
|
|
10
|
+
<delegation_rules>
|
|
11
|
+
<rule id="explicit_scope">
|
|
12
|
+
Always specify exact files, function signatures, and expected structured output formats.
|
|
13
|
+
</rule>
|
|
14
|
+
|
|
15
|
+
<rule id="context_containment">
|
|
16
|
+
Do not grant unbounded repo access; constrain subagent context to relevant test suites and port contracts.
|
|
17
|
+
</rule>
|
|
18
|
+
|
|
19
|
+
<rule id="no_polling">
|
|
20
|
+
Rely on the system's reactive message wakeup mechanism when subagents complete their execution.
|
|
21
|
+
</rule>
|
|
22
|
+
</delegation_rules>
|
|
23
|
+
|
|
24
|
+
</orchestration_protocol>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|