@assertrx/dino 1.0.7 → 1.0.9

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": "@assertrx/dino",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "A friendly purple dinosaur pi package with a custom TUI header, theme, and Playwright skills.",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -25,7 +25,7 @@
25
25
  "postinstall": "npx playwright install chromium"
26
26
  },
27
27
  "dependencies": {
28
- "@earendil-works/pi-coding-agent": "*",
28
+ "@earendil-works/pi-coding-agent": "0.84.4",
29
29
  "@fastify/cors": "^11.3.0",
30
30
  "@mablhq/mabl-cli": "^2.127.20",
31
31
  "@modelcontextprotocol/sdk": "^1.30.0",
@@ -0,0 +1,48 @@
1
+ ---
2
+ description: Convert a Word or Excel requirements document into Gherkin BDD feature files using the bdd-gherkin skill
3
+ argument-hint: "<requirements-file> [output-dir]"
4
+ ---
5
+
6
+ Convert the requirements document at **$1** into Gherkin BDD feature files using the `bdd-gherkin` skill, and save them to `${2:-tests/features/}` — the same location and format used by "BDD From URL".
7
+
8
+ ## Workflow
9
+
10
+ 1. **Verify the document exists**.
11
+ - Check that $1 exists and is readable. If not, stop and report the exact problem (missing file, unsupported extension, unreadable content).
12
+
13
+ 2. **Load the BDD skill**.
14
+ - Read `skills/bdd-gherkin/SKILL.md` first and follow its rules for the rest of this task.
15
+
16
+ 3. **Extract the requirements text**.
17
+ - $1 may be a Word document (.docx), an Excel workbook (.xlsx/.xlsm), or a plain-text file (.txt/.md/.csv). Extract its full content to work from:
18
+ - **Plain text (.txt/.md/.csv)** — read the file directly.
19
+ - **Word (.docx)** — a .docx is a ZIP archive. Try, in order:
20
+ 1. `pandoc "$1" -t gfm` (keeps tables as markdown) if pandoc is installed
21
+ 2. Python with `python-docx` if available
22
+ 3. Raw fallback: extract `word/document.xml` from the archive (`unzip -p "$1" word/document.xml`, or PowerShell's `System.IO.Compression.ZipFile` on Windows) and strip the XML tags. Convert `<w:p>` elements to line breaks and `<w:tbl>` table rows to pipe-delimited rows so tabular requirements survive.
23
+ - **Excel (.xlsx/.xlsm)** — also a ZIP archive. Try, in order:
24
+ 1. Python with `openpyxl` or `pandas` if available
25
+ 2. Raw fallback: extract `xl/workbook.xml`, `xl/sharedStrings.xml`, and `xl/worksheets/sheet*.xml` from the archive and reconstruct the rows — shared strings give the text values, the sheet XML gives the cell positions. Emit each sheet as a separate section, headed by the sheet name.
26
+ - If the extracted text is too long to keep in the conversation, write it to a temporary file **outside** the workspace (e.g. in the OS temp dir) and delete it when done. Never modify or move the original document.
27
+ - If extraction yields garbled or clearly incomplete content, say so and stop instead of inventing requirements.
28
+
29
+ 4. **Analyze the requirements**.
30
+ - Identify the business capability or capabilities, the primary actor(s), the business value, business rules, constraints, and any acceptance criteria.
31
+ - Requirements documents follow recognizable structures — user stories ("As a… I want… So that…"), Jira-style fields (Summary / Observed Behavior / Expected Behavior / Conditions / Replication Steps / Acceptance Criteria), requirement tables with IDs (REQ-001, AC-02, …), or spreadsheets with one requirement per row. Map these to scenarios using the skill's Jira-ticket rules where applicable.
32
+ - For spreadsheets with multiple sheets, treat each sheet as a section of the requirements.
33
+
34
+ 5. **Generate the Gherkin scenarios**.
35
+ - Ground every scenario in what the document actually states — do **not** invent requirements that are not in the document.
36
+ - Cover, as far as the document supports them: happy paths, validation / invalid input, business-rule and state-based cases, boundary / edge cases, and error cases.
37
+ - Where the document is ambiguous, choose the most reasonable interpretation, proceed, and record the assumption in the final summary. This action usually runs unattended from Dino Desktop, so do not block on clarifying questions.
38
+
39
+ 6. **Save the feature files**.
40
+ - Write each capability to `${2:-tests/features/}/<capability-name>.feature` using a clear kebab-case file name (e.g. `loan-approval.feature`, `customer-onboarding.feature`).
41
+ - If the document covers multiple distinct capabilities, split it into multiple feature files in the output directory.
42
+ - When the document numbers its requirements (REQ-014, AC-2, …), add a brief `# REQ-014` comment above each scenario it produced, so coverage stays traceable back to the document.
43
+
44
+ ## Output
45
+
46
+ - The saved `.feature` file path(s).
47
+ - A coverage summary: how many requirements / acceptance criteria were found, how many scenarios were generated per category (happy path, validation, edge cases, errors), and any requirement IDs that could not be covered — with the reason.
48
+ - Any assumptions made about ambiguous requirements.
@@ -61,6 +61,14 @@ const PROMPT_REGISTRY = {
61
61
  ],
62
62
  description: "Generate Gherkin BDD scenarios for a page by inspecting it with playwright-cli",
63
63
  },
64
+ "bdd-from-requirements": {
65
+ file: "bdd-from-requirements.md",
66
+ params: [
67
+ { name: "requirementsFile", required: true, description: "Path to the requirements document (.docx, .xlsx, .txt, .md, .csv)" },
68
+ { name: "outputDir", required: false, description: "Output directory (default: tests/features/)" },
69
+ ],
70
+ description: "Convert a Word or Excel requirements document into Gherkin BDD feature files",
71
+ },
64
72
  "generate-spec-from-feature": {
65
73
  file: "generate-spec-from-feature.md",
66
74
  params: [
@@ -31,7 +31,7 @@ if !ERRORLEVEL! EQU 0 (
31
31
  for /f "tokens=*" %%v in ('pi --version 2^>^&1') do echo Found pi %%v
32
32
  ) else (
33
33
  echo Installing pi...
34
- call npm install -g @earendil-works/pi-coding-agent --silent --no-fund --no-audit
34
+ call npm install -g @earendil-works/pi-coding-agent@0.84.4 --silent --no-fund --no-audit
35
35
  if !ERRORLEVEL! NEQ 0 (
36
36
  echo ERROR: Failed to install pi.
37
37
  pause
@@ -56,6 +56,43 @@ if not exist "%DINO_DIR%" (
56
56
  echo Dino already installed at %DINO_DIR%
57
57
  )
58
58
 
59
+ :: ── 3b. Pin pi-coding-agent to last known-good version ───────────────
60
+ :: pi-coding-agent@0.85.0 imports @earendil-works/pi-server at runtime
61
+ :: without declaring it as a dependency (upstream packaging bug), which
62
+ :: breaks the API server with ERR_MODULE_NOT_FOUND. 0.84.4 is the last
63
+ :: version that works out of the box, so force it in pi's package dir
64
+ :: regardless of what dino's "*" dependency resolved to.
65
+ set "PI_NPM_DIR=%USERPROFILE%\.pi\agent\npm"
66
+ set "PINNED_PI=0.84.4"
67
+ node -e "const fs=require('fs');let v='';try{v=JSON.parse(fs.readFileSync(process.env.PI_NPM_DIR+'/node_modules/@earendil-works/pi-coding-agent/package.json','utf8')).version}catch(e){}process.exit(v===process.env.PINNED_PI?0:1)"
68
+ if errorlevel 1 (
69
+ echo Pinning @earendil-works/pi-coding-agent to %PINNED_PI% ...
70
+ pushd "%PI_NPM_DIR%"
71
+ call npm install "@earendil-works/pi-coding-agent@%PINNED_PI%" --save-exact --no-fund --no-audit --loglevel=error
72
+ if errorlevel 1 (
73
+ popd
74
+ echo ERROR: Failed to install @earendil-works/pi-coding-agent@%PINNED_PI%.
75
+ pause
76
+ exit /b 1
77
+ )
78
+ popd
79
+ echo Pinned to %PINNED_PI%.
80
+ ) else (
81
+ echo pi-coding-agent %PINNED_PI% ^(known-good^) installed.
82
+ )
83
+
84
+ :: Verify the package imports cleanly before starting the server.
85
+ pushd "%PI_NPM_DIR%"
86
+ node --input-type=module -e "await import('@earendil-works/pi-coding-agent')"
87
+ if errorlevel 1 (
88
+ popd
89
+ echo ERROR: pi-coding-agent failed to import - see message above.
90
+ pause
91
+ exit /b 1
92
+ )
93
+ popd
94
+ echo pi-coding-agent import check OK.
95
+
59
96
  :: ── 4. Start server ───────────────────────────────────────────────────
60
97
  echo [4/4] Starting Dino API server...
61
98
  echo.
@@ -21,7 +21,7 @@ if command -v pi &>/dev/null; then
21
21
  echo " Found pi $(pi --version 2>&1 || echo '(unknown version)')"
22
22
  else
23
23
  echo " Installing pi..."
24
- npm install -g @earendil-works/pi-coding-agent
24
+ npm install -g @earendil-works/pi-coding-agent@0.84.4
25
25
  echo " pi installed successfully."
26
26
  fi
27
27
 
@@ -36,6 +36,28 @@ else
36
36
  echo " Dino already installed at ${DINO_DIR}"
37
37
  fi
38
38
 
39
+ # pi-coding-agent@0.85.0 imports @earendil-works/pi-server at runtime
40
+ # without declaring it as a dependency (upstream packaging bug), which
41
+ # breaks the API server with ERR_MODULE_NOT_FOUND. 0.84.4 is the last
42
+ # version that works out of the box, so force it in pi's package dir
43
+ # regardless of what dino's "*" dependency resolved to.
44
+ PI_NPM_DIR="${HOME}/.pi/agent/npm"
45
+ PINNED_PI="0.84.4"
46
+ export PI_NPM_DIR PINNED_PI
47
+ if ! node -e "const fs=require('fs');let v='';try{v=JSON.parse(fs.readFileSync(process.env.PI_NPM_DIR+'/node_modules/@earendil-works/pi-coding-agent/package.json','utf8')).version}catch(e){}process.exit(v===process.env.PINNED_PI?0:1)"; then
48
+ echo " Pinning @earendil-works/pi-coding-agent to ${PINNED_PI}..."
49
+ (cd "${PI_NPM_DIR}" && npm install "@earendil-works/pi-coding-agent@${PINNED_PI}" --save-exact --no-fund --no-audit --loglevel=error)
50
+ echo " Pinned to ${PINNED_PI}."
51
+ else
52
+ echo " pi-coding-agent ${PINNED_PI} (known-good) installed."
53
+ fi
54
+
55
+ if ! (cd "${PI_NPM_DIR}" && node --input-type=module -e "await import('@earendil-works/pi-coding-agent')"); then
56
+ echo "ERROR: pi-coding-agent failed to import."
57
+ exit 1
58
+ fi
59
+ echo " pi-coding-agent import check OK."
60
+
39
61
  # ── 4. Start server ───────────────────────────────────────────────────
40
62
  echo "[4/4] Starting Dino API server..."
41
63
  echo ""
@@ -10,6 +10,18 @@ if not exist "%DINO_DIR%" (
10
10
  exit /b 1
11
11
  )
12
12
 
13
+ :: Self-heal: force known-good pi-coding-agent (0.85.0 has a missing
14
+ :: dependency that breaks the API server - see setup-dino-api.bat).
15
+ set "PI_NPM_DIR=%USERPROFILE%\.pi\agent\npm"
16
+ set "PINNED_PI=0.84.4"
17
+ node -e "const fs=require('fs');let v='';try{v=JSON.parse(fs.readFileSync(process.env.PI_NPM_DIR+'/node_modules/@earendil-works/pi-coding-agent/package.json','utf8')).version}catch(e){}process.exit(v===process.env.PINNED_PI?0:1)"
18
+ if errorlevel 1 (
19
+ echo Installing @earendil-works/pi-coding-agent@%PINNED_PI% ...
20
+ pushd "%PI_NPM_DIR%"
21
+ call npm install "@earendil-works/pi-coding-agent@%PINNED_PI%" --save-exact --no-fund --no-audit --loglevel=error
22
+ popd
23
+ )
24
+
13
25
  echo Starting Dino API server on port %PORT% (default: 4003)...
14
26
 
15
27
  :: The published npm package may not include api-server.mjs, so fall back
@@ -12,5 +12,15 @@ if [ ! -d "${DINO_DIR}" ]; then
12
12
  exit 1
13
13
  fi
14
14
 
15
+ # Self-heal: force known-good pi-coding-agent (0.85.0 has a missing
16
+ # dependency that breaks the API server - see setup-dino-api.sh).
17
+ PI_NPM_DIR="${HOME}/.pi/agent/npm"
18
+ PINNED_PI="0.84.4"
19
+ export PI_NPM_DIR PINNED_PI
20
+ if ! node -e "const fs=require('fs');let v='';try{v=JSON.parse(fs.readFileSync(process.env.PI_NPM_DIR+'/node_modules/@earendil-works/pi-coding-agent/package.json','utf8')).version}catch(e){}process.exit(v===process.env.PINNED_PI?0:1)"; then
21
+ echo "Installing @earendil-works/pi-coding-agent@${PINNED_PI}..."
22
+ (cd "${PI_NPM_DIR}" && npm install "@earendil-works/pi-coding-agent@${PINNED_PI}" --save-exact --no-fund --no-audit --loglevel=error)
23
+ fi
24
+
15
25
  echo "Starting Dino API server on port ${PORT:-4003}..."
16
26
  exec node "${DINO_DIR}/scripts/api-server.mjs"