@assertrx/dino 1.0.8 → 1.0.10
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
|
@@ -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.
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Generate exhaustive Gherkin BDD scenarios for a single page using the bdd-gherkin skill
|
|
3
|
-
argument-hint: "<URL> [output-dir] [auth-env-file]"
|
|
3
|
+
argument-hint: "<URL> [output-dir] [auth-env-file] [tester-roles]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
Selected tester roles (may be empty): ${4:-}
|
|
7
|
+
|
|
6
8
|
Use the `bdd-gherkin` skill and `playwright-cli` commands to inspect the page at $1 and generate exhaustive Gherkin BDD scenarios for **that page only**. Fall back to the Playwright MCP bridge (`browser_*` tools) only if `playwright-cli` is unavailable or fails.
|
|
7
9
|
|
|
8
10
|
## Preferred tooling
|
|
@@ -43,6 +45,8 @@ Use the `bdd-gherkin` skill and `playwright-cli` commands to inspect the page at
|
|
|
43
45
|
- **UI / interaction cases** — toggles, show/hide password, dropdown dependencies, disabled fields, cancel/reset actions.
|
|
44
46
|
- **Accessibility / usability cases** — keyboard focus, visible labels, error announcement (if inferable from the page).
|
|
45
47
|
|
|
48
|
+
Additionally, if the "Selected tester roles" value at the top of this prompt is **not empty**, adopt the perspective of each listed tester role (e.g. accessibility tester, security tester, performance tester, functional tester) and generate additional scenarios that role would write for this page. Examples: an accessibility tester produces scenarios for screen-reader labels, focus order, and color-contrast issues; a security tester produces scenarios for injection attempts, unauthorized access, and data exposure; a performance tester produces scenarios for large payloads and slow-network handling. Keep these role-specific scenarios business-readable and in the same Gherkin style as the rest — tag them with a role tag such as `@accessibility`, `@security`, or `@performance`. If no tester roles are listed, skip this and produce only the default coverage above.
|
|
49
|
+
|
|
46
50
|
5. **Follow Gherkin best practices**.
|
|
47
51
|
- Use a single-focused Scenario for each behavior.
|
|
48
52
|
- Use **exactly one `When` action per scenario**; move setup details into `Given` or `Background`.
|
package/scripts/api-server.mjs
CHANGED
|
@@ -58,9 +58,18 @@ const PROMPT_REGISTRY = {
|
|
|
58
58
|
{ name: "url", required: true, description: "Target website URL" },
|
|
59
59
|
{ name: "outputDir", required: false, description: "Output directory (default: tests/features/)" },
|
|
60
60
|
{ name: "authEnvFile", required: false, description: "Auth env file for login credentials" },
|
|
61
|
+
{ name: "testerRoles", required: false, description: "Comma-separated tester roles (e.g. accessibility, security) whose perspectives to include when generating scenarios" },
|
|
61
62
|
],
|
|
62
63
|
description: "Generate Gherkin BDD scenarios for a page by inspecting it with playwright-cli",
|
|
63
64
|
},
|
|
65
|
+
"bdd-from-requirements": {
|
|
66
|
+
file: "bdd-from-requirements.md",
|
|
67
|
+
params: [
|
|
68
|
+
{ name: "requirementsFile", required: true, description: "Path to the requirements document (.docx, .xlsx, .txt, .md, .csv)" },
|
|
69
|
+
{ name: "outputDir", required: false, description: "Output directory (default: tests/features/)" },
|
|
70
|
+
],
|
|
71
|
+
description: "Convert a Word or Excel requirements document into Gherkin BDD feature files",
|
|
72
|
+
},
|
|
64
73
|
"generate-spec-from-feature": {
|
|
65
74
|
file: "generate-spec-from-feature.md",
|
|
66
75
|
params: [
|
|
@@ -100,8 +109,14 @@ async function loadPrompt(name, params = {}) {
|
|
|
100
109
|
|
|
101
110
|
let content = await readFile(filePath, "utf-8");
|
|
102
111
|
|
|
103
|
-
// Build positional arg array from ordered entry.params
|
|
104
|
-
|
|
112
|
+
// Build positional arg array from ordered entry.params. Array values
|
|
113
|
+
// (e.g. testerRoles sent as a list from the desktop app) are joined into
|
|
114
|
+
// a comma-separated string so the prompt template can substitute them.
|
|
115
|
+
const positional = entry.params.map((p) => {
|
|
116
|
+
const v = params[p.name];
|
|
117
|
+
if (Array.isArray(v)) return v.filter(Boolean).join(", ");
|
|
118
|
+
return v ?? "";
|
|
119
|
+
});
|
|
105
120
|
// Substitute $1, $2, $3, $4, ${1:-default}, ${2:-default}, etc.
|
|
106
121
|
content = content.replace(
|
|
107
122
|
/\$\{?(\d+)(?:\s*:-\s*([^}]*))?\}?/g,
|