@allenpan2026/harshjudge 0.4.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.
@@ -0,0 +1,129 @@
1
+ # Setup Workflow
2
+
3
+ ## Trigger
4
+
5
+ Use this workflow when user wants to:
6
+ - Initialize HarshJudge in a project
7
+ - Set up E2E testing infrastructure
8
+ - Start the HarshJudge dashboard
9
+
10
+ ## CLI Commands Used
11
+
12
+ - `harshjudge init <projectName>` — initializes project and spawns dashboard automatically
13
+
14
+ ## Assets Created
15
+
16
+ This workflow creates:
17
+ - `.harshJudge/config.yaml` - Project configuration
18
+ - `.harshJudge/prd.md` - Product requirements document
19
+ - `.harshJudge/scenarios/` - Empty scenarios directory
20
+
21
+ ## Workflow
22
+
23
+ ### Step 1: Gather Project Information
24
+
25
+ Determine the following (ask user if not clear):
26
+ - **projectName**: From `package.json` name field, or ask user
27
+ - **baseUrl**: Target application URL (default: `http://localhost:3000`)
28
+
29
+ Optionally explore the codebase to understand:
30
+ - Tech stack (frontend/backend frameworks)
31
+ - Key user flows
32
+ - Environment requirements
33
+
34
+ ### Step 2: Run init
35
+
36
+ ```bash
37
+ harshjudge init <project-name> --base-url <base-url>
38
+ ```
39
+
40
+ ### Step 3: Verify Response
41
+
42
+ The command outputs:
43
+
44
+ ```
45
+ HarshJudge initialized successfully!
46
+
47
+ Project: <project-name>
48
+ Dashboard: http://localhost:3001
49
+
50
+ Created:
51
+ .harshJudge/config.yaml
52
+ .harshJudge/prd.md
53
+ .harshJudge/scenarios/
54
+ .harshJudge/.gitignore
55
+ ```
56
+
57
+ **On Success:** Continue to Step 4
58
+ **On Error:** STOP and report (see Error Scenarios below)
59
+
60
+ ### Step 4: Update PRD with Project Details
61
+
62
+ The `prd.md` file is created from a template. Update it with:
63
+ - Product overview
64
+ - Tech stack details
65
+ - Test credentials
66
+ - Environment setup instructions
67
+
68
+ ### Step 5: Report Success
69
+
70
+ ```
71
+ HarshJudge initialized successfully!
72
+
73
+ Project: {projectName}
74
+ Dashboard: {dashboardUrl}
75
+
76
+ Created structure:
77
+ .harshJudge/
78
+ config.yaml # Project configuration
79
+ prd.md # Product requirements (update with project details)
80
+ scenarios/ # Test scenarios (empty)
81
+ .gitignore # Ignores large evidence files
82
+
83
+ Next steps:
84
+ 1. Update .harshJudge/prd.md with product details and test credentials
85
+ 2. Create your first test scenario
86
+ 3. Open {dashboardUrl} to view the dashboard
87
+ ```
88
+
89
+ ## Expected Output
90
+
91
+ After successful setup:
92
+
93
+ ```
94
+ .harshJudge/
95
+ config.yaml # Project configuration
96
+ prd.md # Product requirements document
97
+ scenarios/ # Empty, ready for test scenarios
98
+ {slug}/ # Created by harshjudge create
99
+ meta.yaml # Scenario definition + stats
100
+ steps/ # Individual step files
101
+ 01-step.md
102
+ 02-step.md
103
+ runs/ # Run history with evidence
104
+ snapshots/ # Inspection tool outputs
105
+ .gitignore # Ignores large evidence files
106
+ ```
107
+
108
+ Dashboard available at: `http://localhost:3001`
109
+
110
+ ## Error Scenarios
111
+
112
+ | Error | Cause | Resolution |
113
+ |-------|-------|------------|
114
+ | `EACCES` | Permission denied | Check directory write permissions |
115
+ | `EADDRINUSE` | Port 3001 in use | Kill existing process or use different port |
116
+ | `ENOENT` | Directory not found | Ensure running in valid project directory |
117
+ | `Dashboard spawn failed` | Node.js issue | Check Node.js installation |
118
+
119
+ **On ANY error:**
120
+ 1. **STOP immediately**
121
+ 2. Report error with full context
122
+ 3. Do NOT proceed or retry
123
+
124
+ ## Post-Setup Guidance
125
+
126
+ After successful initialization, suggest:
127
+ 1. **Update PRD:** "Review `.harshJudge/prd.md` and add product details, credentials"
128
+ 2. **Create scenario:** "Would you like to create a test scenario?"
129
+ 3. **View dashboard:** "Open {dashboardUrl} to view the testing dashboard"
@@ -0,0 +1,134 @@
1
+ # Status Workflow
2
+
3
+ ## Trigger
4
+
5
+ Use this workflow when user wants to:
6
+ - Check HarshJudge project status
7
+ - View all test scenarios
8
+ - See run history for a scenario
9
+ - Get summary of test results
10
+ - Filter starred scenarios
11
+ - Browse the .harshJudge/ directory structure
12
+
13
+ ## CLI Commands Used
14
+
15
+ - `harshjudge status` — project-wide or per-scenario status
16
+ - `harshjudge discover tree [path]` — browse directory structure
17
+ - `harshjudge discover search <pattern>` — search file content
18
+ - `harshjudge star <slug>` — mark/unmark as favorite
19
+
20
+ ## Prerequisites
21
+
22
+ - HarshJudge initialized (`.harshJudge/` exists)
23
+
24
+ ## Workflow
25
+
26
+ ### Option A: Project-Wide Status
27
+
28
+ ```bash
29
+ harshjudge status
30
+ ```
31
+
32
+ **Output:**
33
+ ```
34
+ HarshJudge Project Status
35
+
36
+ Project: my-app
37
+ Base URL: http://localhost:3000
38
+ Dashboard: http://localhost:3001
39
+
40
+ Scenarios (2 total):
41
+
42
+ | Scenario | Starred | Last Run | Status | Pass Rate |
43
+ |----------|---------|----------|--------|-----------|
44
+ | User Login Flow | ⭐ | 2h ago | Pass | 80% (8/10) |
45
+ | Checkout Process | | Never | N/A | - |
46
+
47
+ Tags: auth (1), critical (1), cart (1), payment (1)
48
+ ```
49
+
50
+ ### Option B: Specific Scenario Status
51
+
52
+ ```bash
53
+ harshjudge status login-flow
54
+ ```
55
+
56
+ **Output includes:**
57
+ - Scenario metadata (slug, title, tags, starred)
58
+ - Step list with filenames
59
+ - Run statistics (totalRuns, passed, failed, passRate, avgDuration)
60
+ - Recent run history with status and duration
61
+ - Last failure details (step, error, evidence path)
62
+
63
+ ### Option C: Browse Directory Structure
64
+
65
+ ```bash
66
+ harshjudge discover tree
67
+ harshjudge discover tree .harshJudge/scenarios/login-flow
68
+ ```
69
+
70
+ Useful for finding evidence files, exploring run history, or confirming file layout.
71
+
72
+ ### Option D: Search File Content
73
+
74
+ ```bash
75
+ harshjudge discover search "error"
76
+ harshjudge discover search "data-testid"
77
+ ```
78
+
79
+ Searches within `.harshJudge/` — useful for finding known patterns in step files or prd.md.
80
+
81
+ ---
82
+
83
+ ## Toggle Star
84
+
85
+ Mark a scenario as starred (favorite) for quick filtering:
86
+
87
+ ```bash
88
+ harshjudge star login-flow # toggle current state
89
+ harshjudge star login-flow --on # explicitly star
90
+ harshjudge star login-flow --off # explicitly unstar
91
+ ```
92
+
93
+ ---
94
+
95
+ ## Error Handling
96
+
97
+ | Error | Cause | Response |
98
+ |-------|-------|----------|
99
+ | `Project not initialized` | No `.harshJudge/` directory | Suggest running setup workflow |
100
+ | `Scenario not found` | Invalid slug | List available scenarios |
101
+ | `No scenarios` | Empty project | Suggest creating first scenario |
102
+
103
+ **On Error:**
104
+ 1. **STOP immediately**
105
+ 2. Report error with context
106
+ 3. Suggest resolution based on error type
107
+
108
+ ---
109
+
110
+ ## Status Indicators
111
+
112
+ | Icon | Meaning |
113
+ |------|---------|
114
+ | Pass | All steps completed successfully |
115
+ | Fail | One or more steps failed |
116
+ | N/A | Never run |
117
+ | ⭐ | Starred scenario (favorite) |
118
+
119
+ ## Post-Status Guidance
120
+
121
+ Based on status, suggest next actions:
122
+
123
+ **If scenarios exist but never run:**
124
+ > "Would you like to run one of these scenarios?"
125
+
126
+ **If recent failures:**
127
+ > "The login-flow scenario failed at step 03. Would you like to investigate or re-run it?"
128
+ > Reference: Use [[iterate]] workflow to analyze failures
129
+
130
+ **If no scenarios:**
131
+ > "No test scenarios found. Would you like to create one?"
132
+
133
+ **If high pass rate:**
134
+ > "Tests are looking healthy! Last run passed 2 hours ago."