codemini-cli 0.4.4 → 0.4.6
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/deployment.md +5 -5
- package/package.json +1 -1
- package/skills/project-requirements/SKILL.md +98 -52
- package/src/commands/chat.js +59 -6
- package/src/core/chat-runtime.js +437 -2
- package/src/core/command-loader.js +9 -0
- package/src/core/fff-adapter.js +1 -1
- package/src/tui/chat-app.js +47 -14
- package/templates/project-requirements/report-shell.html +580 -0
package/deployment.md
CHANGED
|
@@ -13,13 +13,13 @@ npm pack
|
|
|
13
13
|
Expected output:
|
|
14
14
|
|
|
15
15
|
```text
|
|
16
|
-
codemini-cli-0.4.
|
|
16
|
+
codemini-cli-0.4.6.tgz
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
If you want to verify the package contents:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
tar -tf codemini-cli-0.4.
|
|
22
|
+
tar -tf codemini-cli-0.4.6.tgz
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## 2. Copy To The Target Machine
|
|
@@ -34,7 +34,7 @@ Copy the generated `.tgz` file to the Win10 machine by one of these methods:
|
|
|
34
34
|
Recommended target path:
|
|
35
35
|
|
|
36
36
|
```powershell
|
|
37
|
-
C:\temp\codemini-cli-0.4.
|
|
37
|
+
C:\temp\codemini-cli-0.4.6.tgz
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
## 3. Environment Requirements
|
|
@@ -58,7 +58,7 @@ npm -v
|
|
|
58
58
|
Global install:
|
|
59
59
|
|
|
60
60
|
```powershell
|
|
61
|
-
npm install -g C:\temp\codemini-cli-0.4.
|
|
61
|
+
npm install -g C:\temp\codemini-cli-0.4.6.tgz
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
If global install is blocked by company policy, install in a working directory instead:
|
|
@@ -66,7 +66,7 @@ If global install is blocked by company policy, install in a working directory i
|
|
|
66
66
|
```powershell
|
|
67
67
|
mkdir C:\temp\coder-test
|
|
68
68
|
cd C:\temp\coder-test
|
|
69
|
-
npm install C:\temp\codemini-cli-0.4.
|
|
69
|
+
npm install C:\temp\codemini-cli-0.4.6.tgz
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
## 5. Confirm Installation
|
package/package.json
CHANGED
|
@@ -21,25 +21,51 @@ Honor any concrete user request above, such as output format, report path, focus
|
|
|
21
21
|
Create the primary report at:
|
|
22
22
|
|
|
23
23
|
```text
|
|
24
|
-
docs/requirements/
|
|
24
|
+
docs/requirements/{{date}}-project-requirements.html
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
If a companion Markdown file is useful, create:
|
|
28
28
|
|
|
29
29
|
```text
|
|
30
|
-
docs/requirements/
|
|
30
|
+
docs/requirements/{{date}}-project-requirements.md
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
The HTML should be self-contained: inline CSS, inline JavaScript, no build step, no required external assets.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Use a clean, modern documentation style inspired by Notion and Linear unless the user asks otherwise:
|
|
36
36
|
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
- Use
|
|
42
|
-
-
|
|
37
|
+
- White background, warm neutral palette (#37352f text, #e9e9e7 borders), blue accents (#2383e2).
|
|
38
|
+
- Favor generous whitespace, clean typography, and subtle hover transitions over dense layouts.
|
|
39
|
+
- Cards should have rounded corners, minimal borders, and subtle shadow on hover.
|
|
40
|
+
- Tables should have uppercase header labels, no row background by default (only on hover).
|
|
41
|
+
- Use pill-shaped badges for evidence and risk labels — colored background + matching text, no emoji.
|
|
42
|
+
- Diagrams should look like polished internal architecture or business process documentation.
|
|
43
|
+
- Avoid playful palettes, strong gradients, decorative blobs, and visually loud illustrations.
|
|
44
|
+
|
|
45
|
+
Evidence badge class names — use `.tag` or `.badge` with these variants:
|
|
46
|
+
|
|
47
|
+
| Variant | Use for | Visual |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| `.tag.extracted` / `.badge.extracted` | Behavior directly supported by source code | Green text on green background |
|
|
50
|
+
| `.tag.inferred` / `.badge.inferred` | Reasonable inference from code relationships | Orange text on orange background |
|
|
51
|
+
| `.tag.unknown` / `.badge.unknown` | Needs user confirmation | Gray text on gray background |
|
|
52
|
+
| `.tag.warn` / `.badge.warn` | Medium risk or warning | Orange text on orange background |
|
|
53
|
+
| `.tag.danger` / `.badge.danger` | Critical/high risk | Red text on red background |
|
|
54
|
+
| `.tag.ok` / `.badge.ok` | Low risk or passed check | Green text on green background |
|
|
55
|
+
|
|
56
|
+
Risk level indicators in tables must use the badge variants above, never emoji. For example: `<span class="badge danger">CRITICAL</span>` not `🔴 CRITICAL`.
|
|
57
|
+
|
|
58
|
+
Wrap each requirement card in `<details class="card">` with a `<summary>` containing the API name and a one-line description. This makes all cards collapsible by default.
|
|
59
|
+
|
|
60
|
+
When the target HTML file already exists and contains `REQUIREMENTS_*` marker sections, treat it as the canonical report shell. Edit those marker sections in place instead of replacing the whole file. Preserve the existing CSS, JavaScript, navigation, metadata, and surrounding structure unless the user explicitly asks to redesign the shell.
|
|
61
|
+
|
|
62
|
+
Diagrams must be visible and polished when the HTML is opened directly from disk:
|
|
63
|
+
|
|
64
|
+
- Prefer custom inline SVG, CSS grid/flex diagrams, timeline layouts, swimlanes, and styled cards for architecture maps, dependency graphs, flow summaries, and state/lifecycle diagrams.
|
|
65
|
+
- Use semantic SVG groups, `<title>`/`<desc>`, readable labels, arrow markers, stable element ids, and source evidence links where useful.
|
|
66
|
+
- Keep diagrams evidence-based and readable. Prefer fewer correct nodes over a dense speculative map.
|
|
67
|
+
- Do not use Mermaid as the rendered diagram format unless the user explicitly asks for Mermaid source.
|
|
68
|
+
- Avoid showing raw diagram source blocks in the final HTML unless the user explicitly asks for source-only diagrams.
|
|
43
69
|
|
|
44
70
|
For medium or large projects, do not generate the entire HTML document in one model response or one huge `write` call. Create the report incrementally:
|
|
45
71
|
|
|
@@ -67,10 +93,12 @@ This chunked approach is required for HTML reports because inline CSS, JavaScrip
|
|
|
67
93
|
- Tool calls, MCP handlers, RPC methods, queue jobs, scheduled tasks, or exported SDK functions.
|
|
68
94
|
- UI flows only after the backend/interface layer is mapped, unless the project is frontend-only.
|
|
69
95
|
4. Connect each API/interface to requirements:
|
|
96
|
+
- Business capability supported by the interface.
|
|
70
97
|
- User goal and actor.
|
|
71
98
|
- Trigger and entry point.
|
|
72
99
|
- Request/input shape.
|
|
73
100
|
- Response/output shape.
|
|
101
|
+
- Business rules and decision points.
|
|
74
102
|
- Validation and permission rules.
|
|
75
103
|
- Data read/write behavior.
|
|
76
104
|
- Internal modules called.
|
|
@@ -78,12 +106,13 @@ This chunked approach is required for HTML reports because inline CSS, JavaScrip
|
|
|
78
106
|
- Error cases and retry/rollback behavior.
|
|
79
107
|
- Observability, audit, and security notes.
|
|
80
108
|
- Acceptance criteria.
|
|
109
|
+
- Open questions that block final confirmation.
|
|
81
110
|
5. Generate diagrams:
|
|
82
111
|
- Product flowchart for the main user journey.
|
|
83
112
|
- API dependency graph linking endpoints/commands to modules, data stores, and external services.
|
|
84
113
|
- Sequence diagram for at least one high-value flow.
|
|
85
114
|
- State or lifecycle diagram when the domain has clear states.
|
|
86
|
-
- Render each diagram as
|
|
115
|
+
- Render each diagram as polished inline HTML/CSS or SVG that is visible offline without external JavaScript.
|
|
87
116
|
6. Write the report and preserve traceability:
|
|
88
117
|
- Link sections with stable anchors.
|
|
89
118
|
- Include code file paths for evidence.
|
|
@@ -156,30 +185,30 @@ Open questions:
|
|
|
156
185
|
|
|
157
186
|
## Diagram Patterns
|
|
158
187
|
|
|
159
|
-
Use
|
|
188
|
+
Use custom HTML/CSS/SVG diagrams when diagrams help compress complexity. The visual output should look intentional, readable, and report-quality, not like raw generated graph syntax.
|
|
160
189
|
|
|
161
190
|
Inline SVG architecture map:
|
|
162
191
|
|
|
163
192
|
```html
|
|
164
|
-
<figure class="diagram" id="system-architecture">
|
|
193
|
+
<figure class="diagram-card" id="system-architecture">
|
|
165
194
|
<figcaption>System architecture</figcaption>
|
|
166
|
-
<svg viewBox="0 0 960
|
|
195
|
+
<svg viewBox="0 0 960 380" role="img" aria-labelledby="arch-title arch-desc">
|
|
167
196
|
<title id="arch-title">System architecture</title>
|
|
168
|
-
<desc id="arch-desc">CLI
|
|
197
|
+
<desc id="arch-desc">CLI entry points call the runtime, which coordinates tools and persisted session state.</desc>
|
|
169
198
|
<defs>
|
|
170
199
|
<marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto">
|
|
171
200
|
<path d="M0,0 L0,6 L9,3 z"></path>
|
|
172
201
|
</marker>
|
|
173
202
|
</defs>
|
|
174
|
-
<g
|
|
175
|
-
<rect x="
|
|
176
|
-
<text x="
|
|
203
|
+
<g class="node">
|
|
204
|
+
<rect x="48" y="72" width="190" height="86" rx="10"></rect>
|
|
205
|
+
<text x="72" y="122">CLI Entry</text>
|
|
177
206
|
</g>
|
|
178
|
-
<g
|
|
179
|
-
<rect x="
|
|
180
|
-
<text x="
|
|
207
|
+
<g class="node">
|
|
208
|
+
<rect x="386" y="72" width="210" height="86" rx="10"></rect>
|
|
209
|
+
<text x="410" y="122">Runtime</text>
|
|
181
210
|
</g>
|
|
182
|
-
<line x1="
|
|
211
|
+
<line x1="238" y1="115" x2="386" y2="115" marker-end="url(#arrow)"></line>
|
|
183
212
|
</svg>
|
|
184
213
|
</figure>
|
|
185
214
|
```
|
|
@@ -187,50 +216,52 @@ Inline SVG architecture map:
|
|
|
187
216
|
CSS box architecture map:
|
|
188
217
|
|
|
189
218
|
```html
|
|
190
|
-
<section class="
|
|
191
|
-
<a class="
|
|
192
|
-
<span class="
|
|
193
|
-
<a class="
|
|
194
|
-
<span class="
|
|
195
|
-
<a class="
|
|
219
|
+
<section class="dependency-map" aria-label="System architecture">
|
|
220
|
+
<a class="dep-node" href="#api-chat">Chat command</a>
|
|
221
|
+
<span class="dep-edge">→</span>
|
|
222
|
+
<a class="dep-node" href="#runtime-agent-loop">Agent loop</a>
|
|
223
|
+
<span class="dep-edge">→</span>
|
|
224
|
+
<a class="dep-node" href="#tools-write">Tools</a>
|
|
196
225
|
</section>
|
|
197
226
|
```
|
|
198
227
|
|
|
199
|
-
Optional Mermaid companion:
|
|
200
|
-
|
|
201
228
|
Product flow:
|
|
202
229
|
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
230
|
+
```html
|
|
231
|
+
<ol class="flow-steps" aria-label="Product flow">
|
|
232
|
+
<li><strong>User starts task</strong><span>Input is collected from CLI or UI.</span></li>
|
|
233
|
+
<li><strong>System validates input</strong><span>Policy, mode, and project context are checked.</span></li>
|
|
234
|
+
<li><strong>System performs core action</strong><span>Runtime coordinates model calls and tools.</span></li>
|
|
235
|
+
<li><strong>User receives result</strong><span>Final answer, artifacts, and evidence are returned.</span></li>
|
|
236
|
+
</ol>
|
|
208
237
|
```
|
|
209
238
|
|
|
210
239
|
API dependency map:
|
|
211
240
|
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
API
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
241
|
+
```html
|
|
242
|
+
<section class="dependency-map" aria-label="API dependency map">
|
|
243
|
+
<a class="dep-node" href="#api-command">API or command</a>
|
|
244
|
+
<span class="dep-edge">→</span>
|
|
245
|
+
<a class="dep-node" href="#handler">Handler</a>
|
|
246
|
+
<span class="dep-edge">→</span>
|
|
247
|
+
<a class="dep-node" href="#service">Service</a>
|
|
248
|
+
<span class="dep-edge">→</span>
|
|
249
|
+
<a class="dep-node" href="#store">Data store</a>
|
|
250
|
+
</section>
|
|
218
251
|
```
|
|
219
252
|
|
|
220
253
|
Sequence flow:
|
|
221
254
|
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
Service-->>API: Domain result
|
|
233
|
-
API-->>User: Response
|
|
255
|
+
```html
|
|
256
|
+
<table class="sequence-table">
|
|
257
|
+
<thead><tr><th>Step</th><th>Sender</th><th>Receiver</th><th>Message</th></tr></thead>
|
|
258
|
+
<tbody>
|
|
259
|
+
<tr><td>1</td><td>User</td><td>API</td><td>Request</td></tr>
|
|
260
|
+
<tr><td>2</td><td>API</td><td>Service</td><td>Validate and execute</td></tr>
|
|
261
|
+
<tr><td>3</td><td>Service</td><td>Store</td><td>Read/write data</td></tr>
|
|
262
|
+
<tr><td>4</td><td>API</td><td>User</td><td>Response</td></tr>
|
|
263
|
+
</tbody>
|
|
264
|
+
</table>
|
|
234
265
|
```
|
|
235
266
|
|
|
236
267
|
## Quality Bar
|
|
@@ -243,3 +274,18 @@ The report is complete when:
|
|
|
243
274
|
- Inferred requirements are labeled instead of stated as facts.
|
|
244
275
|
- Open questions are grouped so the user can resolve them later.
|
|
245
276
|
- The HTML can be opened directly from disk in a browser.
|
|
277
|
+
|
|
278
|
+
## Content Guidelines
|
|
279
|
+
|
|
280
|
+
Avoid duplication between sections:
|
|
281
|
+
|
|
282
|
+
- The Executive Summary risk list should contain only the **top 2-3 most critical risks** with one-sentence descriptions. The full risk matrix belongs in the Security section only.
|
|
283
|
+
- Key capabilities in the summary should be a concise table (name + one-liner + evidence). Detailed descriptions belong in the per-API requirement cards.
|
|
284
|
+
- Non-functional findings should appear only in the Non-functional section, not duplicated in the summary.
|
|
285
|
+
|
|
286
|
+
Open questions should be **actionable and specific**:
|
|
287
|
+
|
|
288
|
+
- Do NOT list questions that can be answered by reading the source code (e.g. "What is the test coverage?", "Is there CI/CD?"). Instead, investigate and report the answer directly.
|
|
289
|
+
- Do NOT list questions about whether a feature exists — check the code first and report what you find.
|
|
290
|
+
- Only list questions that require **human decision-making**, **business context**, or **stakeholder input** that cannot be derived from the codebase.
|
|
291
|
+
- Each open question should clearly state what decision or confirmation is needed and why it matters.
|
package/src/commands/chat.js
CHANGED
|
@@ -42,19 +42,72 @@ function parseChatArgs(args) {
|
|
|
42
42
|
return parsed;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export async function submitAndPrint(runtime, line, { output: out = process.stdout } = {}) {
|
|
45
|
+
export async function submitAndPrint(runtime, line, { output: out = process.stdout, showSystemTools = false } = {}) {
|
|
46
46
|
let streamed = false;
|
|
47
|
+
let atLineStart = true;
|
|
48
|
+
const write = (text) => {
|
|
49
|
+
const value = String(text || '');
|
|
50
|
+
if (!value) return;
|
|
51
|
+
out.write(value);
|
|
52
|
+
atLineStart = value.endsWith('\n');
|
|
53
|
+
};
|
|
54
|
+
const writeActivity = (event, label) => {
|
|
55
|
+
const name = String(event?.name || '').trim();
|
|
56
|
+
if (!name) return;
|
|
57
|
+
const summary = String(event?.summary || '').trim();
|
|
58
|
+
if (!atLineStart) write('\n');
|
|
59
|
+
write(`[${label}] ${name}${summary ? ` - ${summary}` : ''}\n`);
|
|
60
|
+
};
|
|
47
61
|
const result = await runtime.submit(line, (event) => {
|
|
48
|
-
if (event?.type
|
|
49
|
-
|
|
50
|
-
|
|
62
|
+
if (event?.type === 'assistant:delta' && event.text) {
|
|
63
|
+
streamed = true;
|
|
64
|
+
write(event.text);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (event?.type === 'tool:start') {
|
|
68
|
+
streamed = true;
|
|
69
|
+
writeActivity(event, 'tool:start');
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (event?.type === 'tool:end') {
|
|
73
|
+
streamed = true;
|
|
74
|
+
writeActivity(event, 'tool:end');
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (event?.type === 'tool:blocked') {
|
|
78
|
+
streamed = true;
|
|
79
|
+
writeActivity(event, 'tool:blocked');
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (event?.type === 'tool:error') {
|
|
83
|
+
streamed = true;
|
|
84
|
+
writeActivity(event, 'tool:error');
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (!showSystemTools && String(event?.type || '').startsWith('system_tool:')) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (event?.type === 'system_tool:start') {
|
|
91
|
+
streamed = true;
|
|
92
|
+
writeActivity(event, 'system:start');
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (event?.type === 'system_tool:end') {
|
|
96
|
+
streamed = true;
|
|
97
|
+
writeActivity(event, 'system:end');
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (event?.type === 'system_tool:error') {
|
|
101
|
+
streamed = true;
|
|
102
|
+
writeActivity(event, 'system:error');
|
|
103
|
+
}
|
|
51
104
|
});
|
|
52
105
|
if (result.type === 'exit' || result.type === 'noop') return result;
|
|
53
106
|
if (streamed) {
|
|
54
|
-
|
|
107
|
+
if (!atLineStart) write('\n');
|
|
55
108
|
return result;
|
|
56
109
|
}
|
|
57
|
-
if (result.text)
|
|
110
|
+
if (result.text) write(`${result.text}\n`);
|
|
58
111
|
return result;
|
|
59
112
|
}
|
|
60
113
|
|