@exaudeus/workrail 0.0.13 → 0.0.15

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.
@@ -1,124 +1,127 @@
1
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.1.0",
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
- "agentRole": "You are a security-focused systems analyst with expertise in authentication architecture. Your role is to thoroughly assess existing auth implementations, identify security vulnerabilities, and document current patterns to ensure new implementations align with security best practices.",
22
- "requireConfirmation": true
23
- },
24
- {
25
- "id": "create-auth-middleware",
26
- "title": "Create authentication middleware",
27
- "prompt": "Create a middleware function that extracts and validates JWT tokens from the Authorization header. Return 401 for invalid tokens.",
28
- "agentRole": "You are a senior backend engineer specializing in secure middleware development. Focus on implementing robust token validation, proper error handling, and following security best practices for JWT token processing. Ensure your implementation is production-ready and follows the principle of least privilege.",
29
- "askForFiles": true,
30
- "validationCriteria": [
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.1.0",
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": [
31
17
  {
32
- "type": "contains",
33
- "value": "jwt",
34
- "message": "Implementation should include JWT token handling"
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
+ "agentRole": "You are a security-focused systems analyst with expertise in authentication architecture. Your role is to thoroughly assess existing auth implementations, identify security vulnerabilities, and document current patterns to ensure new implementations align with security best practices.",
22
+ "requireConfirmation": true
35
23
  },
36
24
  {
37
- "type": "contains",
38
- "value": "Authorization",
39
- "message": "Should extract token from Authorization header"
25
+ "id": "create-auth-middleware",
26
+ "title": "Create authentication middleware",
27
+ "prompt": "Create a middleware function that extracts and validates JWT tokens from the Authorization header. Return 401 for invalid tokens.",
28
+ "agentRole": "You are a senior backend engineer specializing in secure middleware development. Focus on implementing robust token validation, proper error handling, and following security best practices for JWT token processing. Ensure your implementation is production-ready and follows the principle of least privilege.",
29
+ "askForFiles": true,
30
+ "validationCriteria": [
31
+ {
32
+ "type": "contains",
33
+ "value": "jwt",
34
+ "message": "Implementation should include JWT token handling"
35
+ },
36
+ {
37
+ "type": "contains",
38
+ "value": "Authorization",
39
+ "message": "Should extract token from Authorization header"
40
+ },
41
+ {
42
+ "type": "regex",
43
+ "pattern": "\\b(401|unauthorized)\\b",
44
+ "flags": "i",
45
+ "message": "Should return 401 status for invalid tokens"
46
+ }
47
+ ],
48
+ "hasValidation": true
40
49
  },
41
50
  {
42
- "type": "regex",
43
- "pattern": "\\b(401|unauthorized)\\b",
44
- "flags": "i",
45
- "message": "Should return 401 status for invalid tokens"
46
- }
47
- ]
48
- },
49
- {
50
- "id": "implement-login",
51
- "title": "Implement login endpoint",
52
- "prompt": "Create a POST /auth/login endpoint that accepts email and password, validates credentials against the database, and returns a JWT token on success.",
53
- "agentRole": "You are an API development specialist with deep expertise in authentication endpoints and security. Your implementation should include proper input validation, secure password handling, rate limiting considerations, and comprehensive error responses that don't leak sensitive information.",
54
- "validationCriteria": [
55
- {
56
- "type": "contains",
57
- "value": "POST",
58
- "message": "Should implement POST endpoint"
59
- },
60
- {
61
- "type": "regex",
62
- "pattern": "/(auth/)?login",
63
- "message": "Should implement login endpoint"
64
- },
65
- {
66
- "type": "contains",
67
- "value": "email",
68
- "message": "Should handle email authentication"
69
- },
70
- {
71
- "type": "contains",
72
- "value": "password",
73
- "message": "Should handle password authentication"
74
- },
75
- {
76
- "type": "contains",
77
- "value": "jwt",
78
- "message": "Should return JWT token"
79
- }
80
- ]
81
- },
82
- {
83
- "id": "test-authentication",
84
- "title": "Test the authentication flow",
85
- "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",
86
- "agentRole": "You are a quality assurance engineer specializing in security testing and authentication flows. Your testing approach should be comprehensive, covering positive and negative test cases, edge cases, and potential security vulnerabilities. Focus on creating maintainable, automated tests that verify both functionality and security.",
87
- "requireConfirmation": true,
88
- "validationCriteria": [
89
- {
90
- "type": "contains",
91
- "value": "valid credentials",
92
- "condition": {
93
- "var": "testType",
94
- "equals": "comprehensive"
95
- },
96
- "message": "Should test login with valid credentials"
97
- },
98
- {
99
- "type": "contains",
100
- "value": "protected route",
101
- "message": "Should test access to protected routes"
102
- },
103
- {
104
- "type": "contains",
105
- "value": "invalid tokens",
106
- "message": "Should verify invalid token rejection"
51
+ "id": "implement-login",
52
+ "title": "Implement login endpoint",
53
+ "prompt": "Create a POST /auth/login endpoint that accepts email and password, validates credentials against the database, and returns a JWT token on success.",
54
+ "agentRole": "You are an API development specialist with deep expertise in authentication endpoints and security. Your implementation should include proper input validation, secure password handling, rate limiting considerations, and comprehensive error responses that don't leak sensitive information.",
55
+ "validationCriteria": [
56
+ {
57
+ "type": "contains",
58
+ "value": "POST",
59
+ "message": "Should implement POST endpoint"
60
+ },
61
+ {
62
+ "type": "regex",
63
+ "pattern": "/(auth/)?login",
64
+ "message": "Should implement login endpoint"
65
+ },
66
+ {
67
+ "type": "contains",
68
+ "value": "email",
69
+ "message": "Should handle email authentication"
70
+ },
71
+ {
72
+ "type": "contains",
73
+ "value": "password",
74
+ "message": "Should handle password authentication"
75
+ },
76
+ {
77
+ "type": "contains",
78
+ "value": "jwt",
79
+ "message": "Should return JWT token"
80
+ }
81
+ ],
82
+ "hasValidation": true
107
83
  },
108
84
  {
109
- "type": "regex",
110
- "pattern": "\\b(test|spec|describe|it)\\b",
111
- "message": "Should include proper test structure"
85
+ "id": "test-authentication",
86
+ "title": "Test the authentication flow",
87
+ "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",
88
+ "agentRole": "You are a quality assurance engineer specializing in security testing and authentication flows. Your testing approach should be comprehensive, covering positive and negative test cases, edge cases, and potential security vulnerabilities. Focus on creating maintainable, automated tests that verify both functionality and security.",
89
+ "requireConfirmation": true,
90
+ "validationCriteria": [
91
+ {
92
+ "type": "contains",
93
+ "value": "valid credentials",
94
+ "condition": {
95
+ "var": "testType",
96
+ "equals": "comprehensive"
97
+ },
98
+ "message": "Should test login with valid credentials"
99
+ },
100
+ {
101
+ "type": "contains",
102
+ "value": "protected route",
103
+ "message": "Should test access to protected routes"
104
+ },
105
+ {
106
+ "type": "contains",
107
+ "value": "invalid tokens",
108
+ "message": "Should verify invalid token rejection"
109
+ },
110
+ {
111
+ "type": "regex",
112
+ "pattern": "\\b(test|spec|describe|it)\\b",
113
+ "message": "Should include proper test structure"
114
+ }
115
+ ],
116
+ "hasValidation": true
112
117
  }
113
- ]
114
- }
115
- ],
116
- "metaGuidance": [
117
- "Always hash passwords using bcrypt or similar",
118
- "Include proper error messages for debugging",
119
- "Follow RESTful conventions for endpoints",
120
- "Add rate limiting to prevent brute force attacks",
121
- "Each step leverages specialized agent expertise through agentRole field",
122
- "Agent roles provide behavioral guidance separate from user-facing prompts"
123
- ]
124
- }
118
+ ],
119
+ "metaGuidance": [
120
+ "Always hash passwords using bcrypt or similar",
121
+ "Include proper error messages for debugging",
122
+ "Follow RESTful conventions for endpoints",
123
+ "Add rate limiting to prevent brute force attacks",
124
+ "Each step leverages specialized agent expertise through agentRole field",
125
+ "Agent roles provide behavioral guidance separate from user-facing prompts"
126
+ ]
127
+ }
@@ -93,9 +93,69 @@
93
93
  "description": "Whether the agent should ask for relevant files before executing the step.",
94
94
  "default": false
95
95
  },
96
- "requireConfirmation": {
96
+ "hasValidation": {
97
97
  "type": "boolean",
98
- "description": "Whether to require user confirmation before proceeding",
98
+ "description": "Whether this step has validation logic that should be called. Set to true for steps with validationCriteria to optimize execution performance.",
99
+ "default": false
100
+ },
101
+ "requireConfirmation": {
102
+ "oneOf": [
103
+ {
104
+ "type": "boolean",
105
+ "description": "Whether to require user confirmation before proceeding"
106
+ },
107
+ {
108
+ "type": "object",
109
+ "description": "Conditional logic that determines if confirmation is required based on context variables. Uses same expression format as runCondition.",
110
+ "properties": {
111
+ "var": {
112
+ "type": "string",
113
+ "description": "Variable name from execution context"
114
+ },
115
+ "equals": {
116
+ "description": "Check if variable equals this value"
117
+ },
118
+ "not_equals": {
119
+ "description": "Check if variable does not equal this value"
120
+ },
121
+ "gt": {
122
+ "type": "number",
123
+ "description": "Check if variable is greater than this number"
124
+ },
125
+ "gte": {
126
+ "type": "number",
127
+ "description": "Check if variable is greater than or equal to this number"
128
+ },
129
+ "lt": {
130
+ "type": "number",
131
+ "description": "Check if variable is less than this number"
132
+ },
133
+ "lte": {
134
+ "type": "number",
135
+ "description": "Check if variable is less than or equal to this number"
136
+ },
137
+ "and": {
138
+ "type": "array",
139
+ "description": "Logical AND of multiple conditions",
140
+ "items": {
141
+ "type": "object"
142
+ }
143
+ },
144
+ "or": {
145
+ "type": "array",
146
+ "description": "Logical OR of multiple conditions",
147
+ "items": {
148
+ "type": "object"
149
+ }
150
+ },
151
+ "not": {
152
+ "type": "object",
153
+ "description": "Logical NOT of a condition"
154
+ }
155
+ },
156
+ "additionalProperties": false
157
+ }
158
+ ],
99
159
  "default": false
100
160
  },
101
161
  "runCondition": {