@exaudeus/workrail 0.0.2 → 0.0.3

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,20 @@
1
+ {
2
+ "id": "INVALID_ID_WITH_CAPS",
3
+ "name": "",
4
+ "description": "This workflow has multiple validation errors",
5
+ "version": "0.0.1",
6
+ "preconditions": [
7
+ "Valid precondition",
8
+ ""
9
+ ],
10
+ "clarificationPrompts": [
11
+ "Valid question?",
12
+ "Valid question?"
13
+ ],
14
+ "steps": [],
15
+ "metaGuidance": [
16
+ "This is a valid guidance",
17
+ "This is a valid guidance"
18
+ ],
19
+ "extraField": "This field is not allowed"
20
+ }
@@ -0,0 +1,118 @@
1
+ {
2
+ "id": "simple-auth-implementation",
3
+ "name": "Simple Authentication Implementation",
4
+ "description": "Implement basic JWT authentication for a REST API with user login and token validation",
5
+ "version": "0.0.1",
6
+ "preconditions": [
7
+ "User model exists in the database",
8
+ "JWT library is installed in the project",
9
+ "Environment variables for JWT_SECRET are configured"
10
+ ],
11
+ "clarificationPrompts": [
12
+ "What is the token expiration time you want to use?",
13
+ "Should the authentication support refresh tokens?",
14
+ "Do you need role-based access control?"
15
+ ],
16
+ "steps": [
17
+ {
18
+ "id": "analyze-current-auth",
19
+ "title": "Analyze current authentication setup",
20
+ "prompt": "Examine the existing authentication implementation if any. Look for: user model structure, existing auth middleware, login endpoints. Document what you find.",
21
+ "requireConfirmation": true
22
+ },
23
+ {
24
+ "id": "create-auth-middleware",
25
+ "title": "Create authentication middleware",
26
+ "prompt": "Create a middleware function that extracts and validates JWT tokens from the Authorization header. Return 401 for invalid tokens.",
27
+ "askForFiles": true,
28
+ "validationCriteria": [
29
+ {
30
+ "type": "contains",
31
+ "value": "jwt",
32
+ "message": "Implementation should include JWT token handling"
33
+ },
34
+ {
35
+ "type": "contains",
36
+ "value": "Authorization",
37
+ "message": "Should extract token from Authorization header"
38
+ },
39
+ {
40
+ "type": "regex",
41
+ "pattern": "\\b(401|unauthorized)\\b",
42
+ "flags": "i",
43
+ "message": "Should return 401 status for invalid tokens"
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "id": "implement-login",
49
+ "title": "Implement login endpoint",
50
+ "prompt": "Create a POST /auth/login endpoint that accepts email and password, validates credentials against the database, and returns a JWT token on success.",
51
+ "validationCriteria": [
52
+ {
53
+ "type": "contains",
54
+ "value": "POST",
55
+ "message": "Should implement POST endpoint"
56
+ },
57
+ {
58
+ "type": "regex",
59
+ "pattern": "/(auth/)?login",
60
+ "message": "Should implement login endpoint"
61
+ },
62
+ {
63
+ "type": "contains",
64
+ "value": "email",
65
+ "message": "Should handle email authentication"
66
+ },
67
+ {
68
+ "type": "contains",
69
+ "value": "password",
70
+ "message": "Should handle password authentication"
71
+ },
72
+ {
73
+ "type": "contains",
74
+ "value": "jwt",
75
+ "message": "Should return JWT token"
76
+ }
77
+ ]
78
+ },
79
+ {
80
+ "id": "test-authentication",
81
+ "title": "Test the authentication flow",
82
+ "prompt": "Test the complete flow: 1) Login with valid credentials, 2) Use the token to access a protected route, 3) Verify invalid tokens are rejected",
83
+ "requireConfirmation": true,
84
+ "validationCriteria": [
85
+ {
86
+ "type": "contains",
87
+ "value": "valid credentials",
88
+ "condition": {
89
+ "var": "testType",
90
+ "equals": "comprehensive"
91
+ },
92
+ "message": "Should test login with valid credentials"
93
+ },
94
+ {
95
+ "type": "contains",
96
+ "value": "protected route",
97
+ "message": "Should test access to protected routes"
98
+ },
99
+ {
100
+ "type": "contains",
101
+ "value": "invalid tokens",
102
+ "message": "Should verify invalid token rejection"
103
+ },
104
+ {
105
+ "type": "regex",
106
+ "pattern": "\\b(test|spec|describe|it)\\b",
107
+ "message": "Should include proper test structure"
108
+ }
109
+ ]
110
+ }
111
+ ],
112
+ "metaGuidance": [
113
+ "Always hash passwords using bcrypt or similar",
114
+ "Include proper error messages for debugging",
115
+ "Follow RESTful conventions for endpoints",
116
+ "Add rate limiting to prevent brute force attacks"
117
+ ]
118
+ }