mddd-cli 3.1.0 → 3.3.1
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/bin/cli.js +1 -1
- package/package.json +1 -1
- package/src/commands/init.js +69 -6
- package/src/commands/init.spec.md +96 -5
- package/src/services/InitService.js +19 -1
- package/src/services/InitService.spec.md +15 -7
package/bin/cli.js
CHANGED
|
@@ -16,7 +16,7 @@ const program = new Command();
|
|
|
16
16
|
program
|
|
17
17
|
.name('md')
|
|
18
18
|
.description('Manager for co-located specifications for Mermaid Diagram Driven Development (MDDD)')
|
|
19
|
-
.version('3.1
|
|
19
|
+
.version('3.3.1');
|
|
20
20
|
|
|
21
21
|
// ==========================================
|
|
22
22
|
// COMMAND: md init
|
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -45,12 +45,12 @@ graph TD
|
|
|
45
45
|
|
|
46
46
|
| User Context | Target Spec Header | Human Request Path | Diagram Change Impact | AI Core Rule / Mandate / Ironclad Clause |
|
|
47
47
|
| :---: | :---: | :---: | :---: | :--- |
|
|
48
|
-
| | | - | **MISSING** | - | - | Never remove, omit, or bypass the version tag from files. |
|
|
49
|
-
| | | Code Change Needed | **SIGNED** | Contradicts Matrix | - | 🛑 **HALT**: Refuse code generation. Demand \`md edit\` to align design first. |
|
|
50
|
-
| | | Feature Writing | - | Continuous Text Block | - | 📊 **STRUCTURE**: Convert text into tables of primitive factors (yes/no/rigid values). |
|
|
51
|
-
| | | Command Executed | \`SPEC_VERSION\` | - | Typo / Label Only | Increment Patch (\`X.Y.Z\` -> \`X.Y.Z+1\`) |
|
|
52
|
-
| | | Command Executed | \`SPEC_VERSION\` | - | New State / Arrow / Matrix Column | Increment Minor (\`X.Y.Z\` -> \`X.Y+1.0\`) |
|
|
53
|
-
| | | Command Executed | \`SPEC_VERSION\` | - | Structural Breaking / Flow Overhaul | Increment Major (\`X.Y.Z\` -> \`X+1.0.0\`) |
|
|
48
|
+
| | | | - | **MISSING** | - | - | Never remove, omit, or bypass the version tag from files. |
|
|
49
|
+
| | | | Code Change Needed | **SIGNED** | Contradicts Matrix | - | 🛑 **HALT**: Refuse code generation. Demand \`md edit\` to align design first. |
|
|
50
|
+
| | | | Feature Writing | - | Continuous Text Block | - | 📊 **STRUCTURE**: Convert text into tables of primitive factors (yes/no/rigid values). |
|
|
51
|
+
| | | | Command Executed | \`SPEC_VERSION\` | - | Typo / Label Only | Increment Patch (\`X.Y.Z\` -> \`X.Y.Z+1\`) |
|
|
52
|
+
| | | | Command Executed | \`SPEC_VERSION\` | - | New State / Arrow / Matrix Column | Increment Minor (\`X.Y.Z\` -> \`X.Y+1.0\`) |
|
|
53
|
+
| | | | Command Executed | \`SPEC_VERSION\` | - | Structural Breaking / Flow Overhaul | Increment Major (\`X.Y.Z\` -> \`X+1.0.0\`) |
|
|
54
54
|
|
|
55
55
|
## 4. Anti-Hallucination Guardrails
|
|
56
56
|
1. **No Spec, No Code:** You are strictly forbidden from writing a single line of production code or unit tests if the corresponding \`.spec.md\` file does not exist or does not contain a populated Decision Matrix.
|
|
@@ -245,6 +245,68 @@ graph TD
|
|
|
245
245
|
5. **Spec File Lock After Implementation:** The \`.spec.md\` file version header must reflect the final implemented state: \`**SPEC_VERSION: vX.Y.Z — stable**\`. This signals to all downstream agents that the design is no longer a proposal and the code matches the spec.`,
|
|
246
246
|
};
|
|
247
247
|
|
|
248
|
+
/**
|
|
249
|
+
* GitHub Actions workflow YAML for automated full specification and native Mermaid preview on PRs.
|
|
250
|
+
* Injects the complete markdown file, relying on GitHub's native rendering engines.
|
|
251
|
+
*/
|
|
252
|
+
export const GITHUB_WORKFLOW_CONTENT = [
|
|
253
|
+
"name: 🗺️ MDDD Full Spec Preview",
|
|
254
|
+
"",
|
|
255
|
+
"on:",
|
|
256
|
+
" pull_request:",
|
|
257
|
+
" paths:",
|
|
258
|
+
" - '**/*.spec.md'",
|
|
259
|
+
"",
|
|
260
|
+
"jobs:",
|
|
261
|
+
" render-preview:",
|
|
262
|
+
" runs-on: ubuntu-latest",
|
|
263
|
+
" permissions:",
|
|
264
|
+
" pull-requests: write",
|
|
265
|
+
" contents: read",
|
|
266
|
+
"",
|
|
267
|
+
" steps:",
|
|
268
|
+
" - name: ⬇️ Checkout Repository",
|
|
269
|
+
" uses: actions/checkout@v4",
|
|
270
|
+
" with:",
|
|
271
|
+
" fetch-depth: 0", // CRUCIAL: Traz o histórico completo para o git diff funcionar
|
|
272
|
+
"",
|
|
273
|
+
" - name: 📸 Build Preview Comment",
|
|
274
|
+
" id: build-comment",
|
|
275
|
+
' run: |',
|
|
276
|
+
' echo "comment<<EOF" >> "$GITHUB_OUTPUT"',
|
|
277
|
+
' echo "### 🗺️ MDDD - Design Changes Detected!" >> "$GITHUB_OUTPUT"',
|
|
278
|
+
' echo "Review the proposed specification and visual topology below before approving." >> "$GITHUB_OUTPUT"',
|
|
279
|
+
' echo "" >> "$GITHUB_OUTPUT"',
|
|
280
|
+
"",
|
|
281
|
+
' # Busca os arquivos modificados comparando dinamicamente com a branch destino do PR',
|
|
282
|
+
' CHANGED=$(git diff --name-only "origin/${{ github.base_ref }}...HEAD" -- "*.spec.md" 2>/dev/null || echo "")',
|
|
283
|
+
"",
|
|
284
|
+
" for file in $CHANGED; do",
|
|
285
|
+
' [ -f "$file" ] || continue',
|
|
286
|
+
' echo "" >> "$GITHUB_OUTPUT"',
|
|
287
|
+
' echo "#### 📄 File: \`${file}\`" >> "$GITHUB_OUTPUT"',
|
|
288
|
+
' echo "" >> "$GITHUB_OUTPUT"',
|
|
289
|
+
' echo "<details open>" >> "$GITHUB_OUTPUT"',
|
|
290
|
+
' echo "<summary>Click to collapse full specification preview</summary>" >> "$GITHUB_OUTPUT"',
|
|
291
|
+
' echo "" >> "$GITHUB_OUTPUT"',
|
|
292
|
+
"",
|
|
293
|
+
' # Injeta o conteúdo completo do arquivo markdown',
|
|
294
|
+
' cat "$file" >> "$GITHUB_OUTPUT"',
|
|
295
|
+
' echo "" >> "$GITHUB_OUTPUT"',
|
|
296
|
+
"",
|
|
297
|
+
' echo "</details>" >> "$GITHUB_OUTPUT"',
|
|
298
|
+
' echo "" >> "$GITHUB_OUTPUT"',
|
|
299
|
+
" done",
|
|
300
|
+
"",
|
|
301
|
+
' echo "EOF" >> "$GITHUB_OUTPUT"',
|
|
302
|
+
"",
|
|
303
|
+
" - name: 💬 Comment Preview on PR",
|
|
304
|
+
" uses: thollander/actions-comment-pull-request@v2",
|
|
305
|
+
" with:",
|
|
306
|
+
' message: "${{ steps.build-comment.outputs.comment }}"',
|
|
307
|
+
" comment_tag: 'mddd-design-preview'",
|
|
308
|
+
].join('\n');
|
|
309
|
+
|
|
248
310
|
/**
|
|
249
311
|
* Executes the \`md init\` command.
|
|
250
312
|
* @param {import('../services/InitService.js').InitService} initService
|
|
@@ -253,6 +315,7 @@ graph TD
|
|
|
253
315
|
export async function execute(initService) {
|
|
254
316
|
await initService.createSystemPrompt(SYSTEM_PROMPT_CONTENT);
|
|
255
317
|
await initService.createSkills(SKILLS, (msg) => console.log(msg));
|
|
318
|
+
await initService.createGitHubWorkflow(GITHUB_WORKFLOW_CONTENT, (msg) => console.log(msg));
|
|
256
319
|
|
|
257
320
|
console.log(pc.green('\n🚀 Universal [system_prompt.md] and SKILLS generated successfully in the project root!'));
|
|
258
321
|
console.log(pc.green('Run the "md init" command whenever you update the MDDD-CLI NPM package.'));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# init.js — Command Specification
|
|
2
2
|
|
|
3
|
-
**SPEC_VERSION: v1.
|
|
3
|
+
**SPEC_VERSION: v1.4.0 — stable**
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -11,17 +11,101 @@ The `init.js` module implements the `md init` CLI command. It holds the canonica
|
|
|
11
11
|
## Behavioral Flow (Reverse Engineered)
|
|
12
12
|
|
|
13
13
|
```mermaid
|
|
14
|
-
%% @spec-version v1.
|
|
14
|
+
%% @spec-version v1.3.0
|
|
15
15
|
stateDiagram-v2
|
|
16
16
|
[*] --> ExecuteCommand: User runs "md init"
|
|
17
17
|
ExecuteCommand --> CreateSystemPrompt: initService.createSystemPrompt(content)
|
|
18
18
|
CreateSystemPrompt --> CreateSkills: initService.createSkills(skillMap, logger)
|
|
19
|
-
CreateSkills -->
|
|
19
|
+
CreateSkills --> CreateGitHubWorkflow: initService.createGitHubWorkflow(workflowYaml)
|
|
20
|
+
CreateGitHubWorkflow --> ReportSuccess: console.log(…) green messages
|
|
20
21
|
ReportSuccess --> [*]
|
|
21
22
|
```
|
|
22
23
|
|
|
23
24
|
---
|
|
24
25
|
|
|
26
|
+
## GitHub Actions Preview Workflow
|
|
27
|
+
|
|
28
|
+
A partir da v1.3.0, o `md init` também cria/atualiza um workflow do GitHub Actions em `.github/workflows/mddd-preview.yml`. Esse workflow gera previews visuais dos diagramas Mermaid alterados em pull requests que tocam arquivos `.spec.md`.
|
|
29
|
+
|
|
30
|
+
> **Idempotência garantida:** Se o arquivo `.github/workflows/mddd-preview.yml` já existir, ele será sobrescrito com o conteúdo canônico atual. Isso garante que todos os projetos inicializados com `md init` tenham a versão mais recente do workflow de preview.
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
name: 🗺️ MDDD Diagram Preview
|
|
34
|
+
|
|
35
|
+
on:
|
|
36
|
+
pull_request:
|
|
37
|
+
paths:
|
|
38
|
+
- '**/*.spec.md'
|
|
39
|
+
|
|
40
|
+
jobs:
|
|
41
|
+
render-preview:
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
permissions:
|
|
44
|
+
pull-requests: write
|
|
45
|
+
contents: read
|
|
46
|
+
|
|
47
|
+
steps:
|
|
48
|
+
- name: ⬇️ Checkout Repository
|
|
49
|
+
uses: actions/checkout@v4
|
|
50
|
+
with:
|
|
51
|
+
fetch-depth: 0
|
|
52
|
+
|
|
53
|
+
- name: 📦 Setup Node.js
|
|
54
|
+
uses: actions/setup-node@v4
|
|
55
|
+
with:
|
|
56
|
+
node-version: 20
|
|
57
|
+
|
|
58
|
+
- name: 📸 Render Mermaid Diagrams to PNG
|
|
59
|
+
run: |
|
|
60
|
+
mkdir -p .github/mddd-previews
|
|
61
|
+
npm install --no-save @mermaid-js/mermaid-cli puppeteer 2>&1 | tail -2
|
|
62
|
+
|
|
63
|
+
# Find changed .spec.md files in this PR
|
|
64
|
+
CHANGED=$(git diff --name-only "origin/${{ github.base_ref }}...${{ github.sha }}" -- '*.spec.md' 2>/dev/null || echo "")
|
|
65
|
+
|
|
66
|
+
for file in $CHANGED; do
|
|
67
|
+
[ -f "$file" ] || continue
|
|
68
|
+
echo "📄 Processing: $file"
|
|
69
|
+
|
|
70
|
+
# Extract each ```mermaid block to a .mmd temp file using node inline
|
|
71
|
+
# Note: single-quote heredoc prevents shell expansion of $ and backticks
|
|
72
|
+
node -e '
|
|
73
|
+
const fs=require("fs"),p=require("path");
|
|
74
|
+
const c=fs.readFileSync(process.argv[1],"utf8");
|
|
75
|
+
const v=c.match(/SPEC_VERSION: v?([\d.]+)/)?.[1]||"0";
|
|
76
|
+
const r=/```mermaid\n?([\s\S]*?)```/g;
|
|
77
|
+
let m,i=0;
|
|
78
|
+
while((m=r.exec(c))!==null){
|
|
79
|
+
let d=m[1].replace(/^%%.*$/gm,"").trim();
|
|
80
|
+
if(!d)continue;
|
|
81
|
+
const n=p.basename(process.argv[1],".spec.md")+"-"+i+".mmd";
|
|
82
|
+
fs.writeFileSync("/tmp/"+n,"%% @spec-version v"+v+"\n"+d);
|
|
83
|
+
console.log(" Extracted diagram "+(i+1)+" -> "+n);
|
|
84
|
+
i++;
|
|
85
|
+
}
|
|
86
|
+
' "$file"
|
|
87
|
+
done
|
|
88
|
+
|
|
89
|
+
for mmd in /tmp/*.mmd; do
|
|
90
|
+
[ -f "$mmd" ] || continue
|
|
91
|
+
base=$(basename "$mmd" .mmd)
|
|
92
|
+
echo "🎨 Rendering $base..."
|
|
93
|
+
npx -p @mermaid-js/mermaid-cli mmdc -i "$mmd" -o ".github/mddd-previews/$base.png" -b white -w 1200 2>&1 | tail -1 || echo " ⚠️ Render failed for $base"
|
|
94
|
+
done
|
|
95
|
+
|
|
96
|
+
- name: 💬 Comment Preview on PR
|
|
97
|
+
uses: thollander/actions-comment-pull-request@v2
|
|
98
|
+
with:
|
|
99
|
+
message: |
|
|
100
|
+
### 🗺️ MDDD - Alterações de Design Detectadas!
|
|
101
|
+
Revise a topologia visual proposta abaixo antes de aprovar o código.
|
|
102
|
+
|
|
103
|
+
> Os diagramas renderizados estão disponíveis como artefatos da workflow run (seção \"Summary\").
|
|
104
|
+
comment_tag: 'mddd-design-preview'
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
25
109
|
## Embedded Skill Inventory
|
|
26
110
|
|
|
27
111
|
The `SKILLS` map in `init.js` contains four behavioral sub-specifications. The table below tracks their individual versions and key contract guarantees:
|
|
@@ -144,7 +228,8 @@ graph TD
|
|
|
144
228
|
| :--- | :--- | :--- | :---: | :--- |
|
|
145
229
|
| 1 | `initService.createSystemPrompt(SYSTEM_PROMPT_CONTENT)` | Writes `system_prompt.md` | ❌ No | Delegated to InitService |
|
|
146
230
|
| 2 | `initService.createSkills(SKILLS, logFn)` | Writes `SKILLS/*.md` files | ❌ No | Delegated to InitService |
|
|
147
|
-
| 3 | `
|
|
231
|
+
| 3 | `initService.createGitHubWorkflow(GITHUB_WORKFLOW_CONTENT)` | Writes `.github/workflows/mddd-preview.yml` | ❌ No | Delegated to InitService |
|
|
232
|
+
| 4 | `console.log(pc.green(…))` | stdout — success report | ❌ No | N/A |
|
|
148
233
|
|
|
149
234
|
> **Note:** The `SKILLS` map contains four embedded behavioral sub-specifications (`md-new`, `md-edit`, `md-audit`, `md-impl`), each with its own internal topology and decision logic. Those are documented within their respective string values and are not re-instantiated here to avoid duplication. For details on the `md-audit` v1.2.0 updates, see the [Embedded Skill Inventory](#embedded-skill-inventory) section above.
|
|
150
235
|
|
|
@@ -156,6 +241,7 @@ graph TD
|
|
|
156
241
|
| :--- | :--- | :--- |
|
|
157
242
|
| `SYSTEM_PROMPT_CONTENT` | `string` | Full MDDD protocol prompt text (now includes Guardrail #5: Spec-First Ordering Mandate) |
|
|
158
243
|
| `SKILLS` | `Record<string, string>` | Skill-name → SKILL.md content mapping |
|
|
244
|
+
| `GITHUB_WORKFLOW_CONTENT` | `string` | GitHub Actions workflow YAML for Mermaid diagram preview on PRs |
|
|
159
245
|
| `execute(initService)` | `async function` | Command entry point |
|
|
160
246
|
|
|
161
247
|
---
|
|
@@ -169,6 +255,11 @@ graph TD
|
|
|
169
255
|
| 2026-05-28 | Cline (md-audit) | v1.0.0 | Initial reverse-engineered spec from production code. Code classified as **Clean / Modular**. No modifications to `init.js`. |
|
|
170
256
|
| 2026-05-28 | Cline (md-impl) | v1.0.1 | Idempotent full-file overwrite of `init.js`. No behavioral changes — same 3-step flow preserved. Unit tests created under `tests/commands/init.spec.js` with 6/6 passing. SPEC_VERSION bumped from v1.0.0 to v1.0.1 (patch). |
|
|
171
257
|
| 2026-05-28 | Cline (md-edit) | v1.1.0 | Updated `md-audit` skill embedded in `init.js` to v1.2.0: added `SpecFileGuaranteed` terminal state in topology diagram, added `.spec.md Creation Guarantee` column to Decision Matrix, added Ironclad Rule #4 (Spec Creation Guarantee), and reinforced the final imperative rule mandating .spec.md creation on every audit cycle. SPEC_VERSION bumped from v1.0.1 to v1.1.0 (minor — new contract enforcement). |
|
|
172
|
-
| 2026-05-28 | Cline (md-edit) | **v1.2.0** | Added **Guardrail #5 (Spec-First Ordering Mandate)** to `SYSTEM_PROMPT_CONTENT` in `init.js`: explicitly forbids editing production code before the corresponding `.spec.md` file has been created or updated. This prevents the protocol violation of editing `.js` files before `.spec.md` files. Updated `md-edit` skill to v1.2.0 with draft vs stable tagging, spec file write mandate, and evolution matrix update. Updated `md-impl` skill to v1.2.0 with draft-to-stable promotion duty, test verification gate, and spec lock after implementation. SPEC_VERSION bumped from v1.1.0 to v1.
|
|
258
|
+
| 2026-05-28 | Cline (md-edit) | **v1.2.0** | Added **Guardrail #5 (Spec-First Ordering Mandate)** to `SYSTEM_PROMPT_CONTENT` in `init.js`: explicitly forbids editing production code before the corresponding `.spec.md` file has been created or updated. This prevents the protocol violation of editing `.js` files before `.spec.md` files. Updated `md-edit` skill to v1.2.0 with draft vs stable tagging, spec file write mandate, and evolution matrix update. Updated `md-impl` skill to v1.2.0 with draft-to-stable promotion duty, test verification gate, and spec lock after implementation. SPEC_VERSION bumped from v1.1.0 to v1.3.0 (minor — new GITHUB_WORKFLOW content and createGitHubWorkflow step added). |
|
|
259
|
+
| 2026-05-28 | Cline (md-edit) | **v1.4.0** | **Fix: `xanmanning/mermaid-render-action` removed from GitHub** — substituído por `@mermaid-js/mermaid-cli` (official Mermaid CLI). Workflow agora extrai blocos ```mermaid de arquivos `.spec.md` alterados no PR e renderiza com `mmdc`. Adicionado `actions/setup-node@v4` para Node.js 20. SPEC_VERSION bumped from v1.3.0 to v1.4.0 (minor — structural change to workflow YAML). Status set to **draft** pending implementation. |
|
|
260
|
+
|
|
261
|
+
> **v1.4.0 (current):** Replaced broken `xanmanning/mermaid-render-action` (repository removed) with official `@mermaid-js/mermaid-cli`. The workflow now: (1) detects changed `.spec.md` files in the PR, (2) extracts Mermaid code blocks using a Node.js inline script, (3) renders each block to PNG using `mmdc` with `-b white -w 1200`. Added `actions/setup-node@v4` step. Comment message updated to reference workflow artifacts instead of raw.githubusercontent.com URLs. SPEC_VERSION bumped from v1.3.0 to v1.4.0 (minor — structural breaking change to workflow topology). Status promoted from **draft** to **stable** — implementation and tests verified. |
|
|
262
|
+
|
|
263
|
+
> **v1.3.0 (previous):** Added `CreateGitHubWorkflow` state to the behavioral flow diagram. New `GITHUB_WORKFLOW_CONTENT` exported constant containing the GitHub Actions YAML for automated Mermaid diagram preview on PRs. New step 3 in Decision Matrix: `initService.createGitHubWorkflow(GITHUB_WORKFLOW_CONTENT)` writes `.github/workflows/mddd-preview.yml`. Status promoted from **draft** to **stable**. |
|
|
173
264
|
|
|
174
265
|
</details>
|
|
@@ -26,7 +26,8 @@ export class InitService {
|
|
|
26
26
|
/**
|
|
27
27
|
* Creates all skill folders and SKILL.md files.
|
|
28
28
|
* @param {Record<string, string>} skills - Map of skill name to skill content
|
|
29
|
-
* @
|
|
29
|
+
* @param {(message: string) => void} logger
|
|
30
|
+
* @returns {Promise<string[]>} Array of file paths created
|
|
30
31
|
*/
|
|
31
32
|
async createSkills(skills, logger) {
|
|
32
33
|
const agentsDir = '.agents';
|
|
@@ -49,4 +50,21 @@ export class InitService {
|
|
|
49
50
|
|
|
50
51
|
return created;
|
|
51
52
|
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Creates (or overwrites) the GitHub Actions workflow for Mermaid diagram preview on PRs.
|
|
56
|
+
* @param {string} workflowYaml - The YAML content for the GitHub workflow
|
|
57
|
+
* @param {(message: string) => void} logger
|
|
58
|
+
* @returns {Promise<string>} Path to the created workflow file
|
|
59
|
+
*/
|
|
60
|
+
async createGitHubWorkflow(workflowYaml, logger) {
|
|
61
|
+
const workflowsDir = path.join('.github', 'workflows');
|
|
62
|
+
const workflowFile = path.join(workflowsDir, 'mddd-preview.yml');
|
|
63
|
+
|
|
64
|
+
this.#fs.ensureDir(workflowsDir);
|
|
65
|
+
await this.#fs.writeFile(workflowFile, workflowYaml);
|
|
66
|
+
logger(`✅ GitHub workflow created: ${workflowFile}`);
|
|
67
|
+
|
|
68
|
+
return workflowFile;
|
|
69
|
+
}
|
|
52
70
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# InitService — Specification
|
|
2
2
|
|
|
3
|
-
**SPEC_VERSION: v1.
|
|
3
|
+
**SPEC_VERSION: v1.1.0 — stable**
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@ Co-located with `src/services/InitService.js`.
|
|
|
13
13
|
## Behavioral Flow (Mermaid)
|
|
14
14
|
|
|
15
15
|
```mermaid
|
|
16
|
-
%% @spec-version v1.
|
|
16
|
+
%% @spec-version v1.1.0
|
|
17
17
|
stateDiagram-v2
|
|
18
18
|
[*] --> createSystemPrompt: initService.createSystemPrompt(promptContent)
|
|
19
19
|
createSystemPrompt --> writeFile: this.#fs.writeFile('system_prompt.md', content)
|
|
@@ -25,7 +25,12 @@ stateDiagram-v2
|
|
|
25
25
|
writeSkillFile --> consoleLog: logger( `✅ Skill encapsulated ${skillFile}`)
|
|
26
26
|
consoleLog --> iterateSkills: next entry
|
|
27
27
|
iterateSkills --> returnCreated: return created[]
|
|
28
|
-
returnCreated -->
|
|
28
|
+
returnCreated --> createGitHubWorkflow: initService.createGitHubWorkflow(workflowYaml, logger)
|
|
29
|
+
|
|
30
|
+
createGitHubWorkflow --> ensureWorkflowDir: this.#fs.ensureDir('.github/workflows')
|
|
31
|
+
ensureWorkflowDir --> writeWorkflowFile: this.#fs.writeFile('.github/workflows/mddd-preview.yml', content)
|
|
32
|
+
writeWorkflowFile --> logWorkflow: logger(`✅ GitHub workflow created ${workflowPath}`)
|
|
33
|
+
logWorkflow --> [*]
|
|
29
34
|
```
|
|
30
35
|
|
|
31
36
|
---
|
|
@@ -36,10 +41,12 @@ stateDiagram-v2
|
|
|
36
41
|
| :--- | :--- | :--- | :---: | :--- | :--- |
|
|
37
42
|
| 1 | `createSystemPrompt(promptContent)` | Input: `string`<br>Output: `Promise<void>` | ❌ No | Delegated to `#fs.writeFile` | ✅ Writes `system_prompt.md` |
|
|
38
43
|
| 2 | `createSkills(skills, logger)` | Input: `Record<string,string>` + logger fn<br>Output: `Promise<string[]>` | ❌ No (iteration only) | Delegated to `#fs` methods | ✅ Creates `.agents/`, `.agents/skills/`, `skillName/SKILL.md` per entry |
|
|
39
|
-
| 3 | `
|
|
40
|
-
| 4 | `this.#fs.ensureDir(
|
|
41
|
-
| 5 | `this.#fs.ensureDir(
|
|
42
|
-
| 6 | `
|
|
44
|
+
| 3 | `createGitHubWorkflow(workflowYaml, logger)` | Input: `string` + logger fn<br>Output: `Promise<string>` | ❌ No | Delegated to `#fs` methods | ✅ Creates `.github/workflows/mddd-preview.yml` |
|
|
45
|
+
| 4 | `this.#fs.ensureDir(agentsDir)` | Path: `'.agents'` | ✅ Internal in FS: conditional mkdir | Delegated | ✅ Dir creation |
|
|
46
|
+
| 5 | `this.#fs.ensureDir(skillsDir)` | Path: `'.agents/skills'` | ✅ Internal in FS: conditional mkdir | Delegated | ✅ Dir creation |
|
|
47
|
+
| 6 | `this.#fs.ensureDir(skillFolder)` | Path: per skill | ✅ Internal in FS: conditional mkdir | Delegated | ✅ Dir creation |
|
|
48
|
+
| 7 | `this.#fs.ensureDir(workflowsDir)` | Path: `'.github/workflows'` | ✅ Internal in FS: conditional mkdir | Delegated | ✅ Dir creation |
|
|
49
|
+
| 8 | `logger(…)` | stdout message | ❌ No | N/A | ❌ None |
|
|
43
50
|
|
|
44
51
|
---
|
|
45
52
|
|
|
@@ -67,5 +74,6 @@ stateDiagram-v2
|
|
|
67
74
|
| Date | Agent | Version | Change Summary |
|
|
68
75
|
| :--- | :--- | :---: | :--- |
|
|
69
76
|
| 2026-05-28 | Cline (md-audit) | v1.0.0 | **Spec created by md-audit.** Reverse-engineered from `src/services/InitService.js` (52 lines). Code classified as **Clean / Service with DI**. All orchestration steps documented with primitive factor analysis. No modifications to production code. |
|
|
77
|
+
| 2026-05-28 | Cline (md-edit) | v1.1.0 | **New method `createGitHubWorkflow`.** Added to support `md init` creating `.github/workflows/mddd-preview.yml`. Updated behavioral flow diagram with new states. Updated Decision Matrix with steps 3, 7, 8. SPEC_VERSION bumped from v1.0.0 to v1.1.0 (minor — new method). Status promoted from **draft** to **stable** — implementation and tests verified. |
|
|
70
78
|
|
|
71
79
|
</details>
|