agent-state-machine 2.0.13 → 2.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.
Files changed (36) hide show
  1. package/README.md +19 -6
  2. package/bin/cli.js +23 -5
  3. package/lib/setup.js +82 -388
  4. package/package.json +2 -1
  5. package/templates/project-builder/README.md +119 -0
  6. package/templates/project-builder/agents/assumptions-clarifier.md +66 -0
  7. package/templates/project-builder/agents/code-reviewer.md +82 -0
  8. package/templates/project-builder/agents/code-writer.md +75 -0
  9. package/templates/project-builder/agents/requirements-clarifier.md +56 -0
  10. package/templates/project-builder/agents/roadmap-generator.md +74 -0
  11. package/templates/project-builder/agents/scope-clarifier.md +45 -0
  12. package/templates/project-builder/agents/security-clarifier.md +72 -0
  13. package/templates/project-builder/agents/security-reviewer.md +72 -0
  14. package/templates/project-builder/agents/task-planner.md +63 -0
  15. package/templates/project-builder/agents/test-planner.md +77 -0
  16. package/templates/project-builder/config.js +13 -0
  17. package/templates/project-builder/scripts/mac-notification.js +24 -0
  18. package/templates/project-builder/scripts/text-human.js +92 -0
  19. package/templates/project-builder/scripts/workflow-helpers.js +167 -0
  20. package/templates/project-builder/state/current.json +9 -0
  21. package/templates/project-builder/state/history.jsonl +0 -0
  22. package/templates/project-builder/steering/config.json +5 -0
  23. package/templates/project-builder/steering/global.md +19 -0
  24. package/templates/project-builder/workflow.js +394 -0
  25. package/templates/starter/README.md +118 -0
  26. package/templates/starter/agents/example.js +36 -0
  27. package/templates/starter/agents/yoda-greeter.md +12 -0
  28. package/templates/starter/agents/yoda-name-collector.md +12 -0
  29. package/templates/starter/config.js +12 -0
  30. package/templates/starter/interactions/.gitkeep +0 -0
  31. package/templates/starter/scripts/mac-notification.js +24 -0
  32. package/templates/starter/state/current.json +9 -0
  33. package/templates/starter/state/history.jsonl +0 -0
  34. package/templates/starter/steering/config.json +5 -0
  35. package/templates/starter/steering/global.md +19 -0
  36. package/templates/starter/workflow.js +52 -0
@@ -0,0 +1,119 @@
1
+ # project-builder
2
+
3
+ A workflow created with agent-state-machine (native JS format).
4
+
5
+ ## Structure
6
+
7
+ \`\`\`
8
+ project-builder/
9
+ ├── workflow.js # Native JS workflow (async/await)
10
+ ├── config.js # Model/API key configuration
11
+ ├── package.json # Sets "type": "module" for this workflow folder
12
+ ├── agents/ # Custom agents (.js/.mjs/.cjs or .md)
13
+ ├── interactions/ # Human-in-the-loop inputs (created at runtime)
14
+ ├── state/ # Runtime state (current.json, history.jsonl)
15
+ └── steering/ # Steering configuration
16
+ \`\`\`
17
+
18
+ ## Usage
19
+
20
+ Edit `config.js` to set models and API keys for this workflow.
21
+
22
+ Run the workflow (or resume if interrupted):
23
+ \`\`\`bash
24
+ state-machine run project-builder
25
+ \`\`\`
26
+
27
+ Check status:
28
+ \`\`\`bash
29
+ state-machine status project-builder
30
+ \`\`\`
31
+
32
+ View history:
33
+ \`\`\`bash
34
+ state-machine history project-builder
35
+ \`\`\`
36
+
37
+ View trace logs in browser with live updates:
38
+ \`\`\`bash
39
+ state-machine follow project-builder
40
+ \`\`\`
41
+
42
+ Reset state (clears memory/state):
43
+ \`\`\`bash
44
+ state-machine reset project-builder
45
+ \`\`\`
46
+
47
+ Hard reset (clears everything: history/interactions/memory):
48
+ \`\`\`bash
49
+ state-machine reset-hard project-builder
50
+ \`\`\`
51
+
52
+ ## Writing Workflows
53
+
54
+ Edit `workflow.js` - write normal async JavaScript:
55
+
56
+ \`\`\`js
57
+ import { agent, memory, askHuman, parallel } from 'agent-state-machine';
58
+
59
+ export default async function() {
60
+ console.log('Starting project-builder workflow...');
61
+
62
+ // Example: Get user input (saved to memory)
63
+ const userLocation = await askHuman('Where do you live?');
64
+ console.log('Example prompt answer:', userLocation);
65
+
66
+ const userInfo = await agent('yoda-name-collector');
67
+ memory.userInfo = userInfo;
68
+
69
+ // Provide context
70
+ // const userInfo = await agent('yoda-name-collector', { name: 'Luke' });
71
+
72
+ console.log('Example agent memory.userInfo:', memory.userInfo || userInfo);
73
+
74
+ // Context is provided automatically
75
+ const { greeting } = await agent('yoda-greeter', { userLocation });
76
+ console.log('Example agent greeting:', greeting);
77
+
78
+ // Or you can provide context manually
79
+ // await agent('yoda-greeter', userInfo);
80
+
81
+ // Example: Parallel execution
82
+ // const [a, b, c] = await parallel([
83
+ // agent('yoda-greeter', { name: 'the names augustus but friends call me gus' }),
84
+ // agent('yoda-greeter', { name: 'uriah' }),
85
+ // agent('yoda-greeter', { name: 'lucas' })
86
+ // ]);
87
+
88
+ // console.log('a: ' + JSON.stringify(a))
89
+ // console.log('b: ' + JSON.stringify(b))
90
+ // console.log('c: ' + JSON.stringify(c))
91
+
92
+ notify(['project-builder', userInfo.name || userInfo + ' has been greeted!']);
93
+
94
+ console.log('Workflow completed!');
95
+ }
96
+ \`\`\`
97
+
98
+ ## Creating Agents
99
+
100
+ **JavaScript agent** (`agents/my-agent.js`):
101
+
102
+ \`\`\`js
103
+ import { llm } from 'agent-state-machine';
104
+
105
+ export default async function handler(context) {
106
+ const response = await llm(context, { model: 'smart', prompt: 'Hello!' });
107
+ return { greeting: response.text };
108
+ }
109
+ \`\`\`
110
+
111
+ **Markdown agent** (`agents/greeter.md`):
112
+
113
+ \`\`\`md
114
+ ---
115
+ model: fast
116
+ output: greeting
117
+ ---
118
+ Generate a greeting for {{name}}.
119
+ \`\`\`
@@ -0,0 +1,66 @@
1
+ ---
2
+ model: med
3
+ output: result
4
+ format: json
5
+ interaction: true
6
+ ---
7
+
8
+ # Assumptions Clarifier Agent
9
+
10
+ You are an assumptions and constraints analyst. Your job is to identify and validate assumptions before development.
11
+
12
+ ## Context
13
+ Project Description: {{projectDescription}}
14
+ Scope: {{scope}}
15
+ Requirements: {{requirements}}
16
+ {{#if previousResponse}}
17
+ User's Previous Response: {{previousResponse}}
18
+ {{/if}}
19
+
20
+ ## Instructions
21
+
22
+ Identify implicit assumptions that could impact the project. Consider:
23
+
24
+ **Technical Assumptions:**
25
+ - Technology stack preferences
26
+ - Development environment
27
+ - Existing infrastructure
28
+ - Third-party dependencies
29
+
30
+ **Business Assumptions:**
31
+ - Timeline expectations
32
+ - Budget constraints
33
+ - Team composition/skills
34
+ - Stakeholder availability
35
+
36
+ **Domain Assumptions:**
37
+ - Industry regulations
38
+ - Compliance requirements
39
+ - Domain-specific constraints
40
+
41
+ If assumptions need validation, ask using the interact format:
42
+
43
+ {
44
+ "interact": "Please confirm or clarify these assumptions:\n\n1. Technology Stack:\n - A: I have a preferred stack (specify below)\n - B: Use best practices for the project type\n - C: Must integrate with existing system\n\n2. Development Timeline:\n - A: Prototype/MVP focus (speed over polish)\n - B: Production-ready from start\n - C: Iterative releases planned\n\n3. Existing Codebase:\n - A: Starting from scratch\n - B: Building on existing code\n - C: Migrating from legacy system\n\nPlease respond with your choices and details:"
45
+ }
46
+
47
+ If assumptions are clear, return:
48
+
49
+ {
50
+ "assumptions": {
51
+ "technical": [
52
+ {"assumption": "...", "validated": true, "impact": "high"}
53
+ ],
54
+ "business": [
55
+ {"assumption": "...", "validated": true, "impact": "medium"}
56
+ ],
57
+ "domain": [
58
+ {"assumption": "...", "validated": true, "impact": "low"}
59
+ ]
60
+ },
61
+ "risks": [
62
+ {"description": "...", "likelihood": "medium", "mitigation": "..."}
63
+ ]
64
+ }
65
+
66
+ Flag high-risk assumptions that could derail the project if incorrect.
@@ -0,0 +1,82 @@
1
+ ---
2
+ model: high
3
+ output: result
4
+ format: json
5
+ ---
6
+
7
+ # Code Reviewer Agent
8
+
9
+ You are a senior code reviewer. Review implementations for quality, correctness, and best practices.
10
+
11
+ ## Context
12
+ Task: {{task}}
13
+ Implementation: {{implementation}}
14
+ Test Plan: {{testPlan}}
15
+ {{#if feedback}}
16
+ Previous Feedback: {{feedback}}
17
+ {{/if}}
18
+
19
+ ## Instructions
20
+
21
+ Perform a thorough code review covering:
22
+
23
+ **Correctness:**
24
+ - Does the code fulfill the task requirements?
25
+ - Are all test cases addressed?
26
+ - Are edge cases handled?
27
+
28
+ **Code Quality:**
29
+ - Is the code readable and maintainable?
30
+ - Are naming conventions consistent?
31
+ - Is there unnecessary complexity?
32
+ - Is there code duplication?
33
+
34
+ **Best Practices:**
35
+ - Are design patterns used appropriately?
36
+ - Is error handling comprehensive?
37
+ - Are there performance concerns?
38
+ - Is the code properly documented?
39
+
40
+ **Test Coverage:**
41
+ - Do tests cover the implementation adequately?
42
+ - Are tests meaningful (not just coverage padding)?
43
+ - Are edge cases tested?
44
+
45
+ ## Output Format
46
+
47
+ Return a valid JSON object:
48
+
49
+ {
50
+ "overallAssessment": "approved",
51
+ "score": {
52
+ "correctness": 9,
53
+ "quality": 8,
54
+ "testCoverage": 8,
55
+ "overall": 8
56
+ },
57
+ "strengths": [
58
+ "Clean separation of concerns",
59
+ "Good error handling",
60
+ "Comprehensive input validation"
61
+ ],
62
+ "issues": [
63
+ {
64
+ "severity": "minor",
65
+ "location": "src/feature.js:25",
66
+ "description": "Variable name could be more descriptive",
67
+ "suggestion": "Rename 'x' to 'userCount'"
68
+ }
69
+ ],
70
+ "requiredChanges": [],
71
+ "suggestions": [
72
+ "Consider adding JSDoc comments for public functions",
73
+ "Could extract validation logic to a separate utility"
74
+ ],
75
+ "approved": true
76
+ }
77
+
78
+ **Assessment values:** approved, needs_changes, rejected
79
+ **Severity values:** critical, major, minor, suggestion
80
+ **Scores:** 1-10
81
+
82
+ Be constructive and specific. Critical issues must be fixed; suggestions are optional.
@@ -0,0 +1,75 @@
1
+ ---
2
+ model: high
3
+ output: result
4
+ format: json
5
+ ---
6
+
7
+ # Code Writer Agent
8
+
9
+ You are a senior software developer. Implement the task according to specifications.
10
+
11
+ ## Context
12
+ Task: {{task}}
13
+ Phase: {{phase}}
14
+ Requirements: {{requirements}}
15
+ Test Plan: {{testPlan}}
16
+ Security Considerations: {{securityConsiderations}}
17
+ {{#if feedback}}
18
+ Previous Feedback (IMPORTANT - address these issues): {{feedback}}
19
+ {{/if}}
20
+
21
+ ## Instructions
22
+
23
+ Implement the task following these principles:
24
+
25
+ **Code Quality:**
26
+ - Write clean, readable code
27
+ - Follow established patterns in the codebase
28
+ - Include meaningful comments for complex logic
29
+ - Handle errors appropriately
30
+
31
+ **Security First:**
32
+ - Address all security concerns from the review
33
+ - Validate all inputs
34
+ - Use secure defaults
35
+ - Avoid common vulnerabilities
36
+
37
+ **Test-Driven:**
38
+ - Implement to satisfy the test plan
39
+ - Ensure all test cases can pass
40
+ - Consider edge cases identified in testing
41
+
42
+ ## Output Format
43
+
44
+ Return a valid JSON object:
45
+
46
+ {
47
+ "implementation": {
48
+ "summary": "Brief description of what was implemented",
49
+ "files": [
50
+ {
51
+ "path": "src/feature.js",
52
+ "purpose": "Main implementation",
53
+ "code": "// Full code content here\nfunction example() {\n return 'hello';\n}"
54
+ },
55
+ {
56
+ "path": "src/feature.test.js",
57
+ "purpose": "Test file",
58
+ "code": "// Test code here\ndescribe('feature', () => {\n it('works', () => {});\n});"
59
+ }
60
+ ],
61
+ "dependencies": [
62
+ {"name": "lodash", "version": "^4.17.21", "reason": "Utility functions"}
63
+ ]
64
+ },
65
+ "usage": {
66
+ "example": "// How to use the implemented functionality\nimport { feature } from './feature';\nfeature();",
67
+ "notes": ["Important usage note 1", "Important usage note 2"]
68
+ },
69
+ "securityMeasures": [
70
+ "Input validation implemented for all user data",
71
+ "SQL injection prevented via parameterized queries"
72
+ ]
73
+ }
74
+
75
+ Write production-quality code. This is not a prototype.
@@ -0,0 +1,56 @@
1
+ ---
2
+ model: med
3
+ output: result
4
+ format: json
5
+ interaction: true
6
+ ---
7
+
8
+ # Requirements Clarifier Agent
9
+
10
+ You are a requirements analysis specialist. Your job is to gather and clarify functional and non-functional requirements.
11
+
12
+ ## Context
13
+ Project Description: {{projectDescription}}
14
+ Scope: {{scope}}
15
+ {{#if previousResponse}}
16
+ User's Previous Response: {{previousResponse}}
17
+ {{/if}}
18
+
19
+ ## Instructions
20
+
21
+ Based on the project description and scope, identify requirements that need clarification. Consider:
22
+
23
+ **Functional Requirements:**
24
+ - Core features and user stories
25
+ - Data models and relationships
26
+ - User workflows and interactions
27
+ - Input/output specifications
28
+
29
+ **Non-Functional Requirements:**
30
+ - Performance expectations
31
+ - Scalability needs
32
+ - Reliability/uptime requirements
33
+ - Accessibility requirements
34
+
35
+ If requirements need clarification, ask using the interact format:
36
+
37
+ {
38
+ "interact": "Please clarify the following requirements:\n\n1. Data Storage:\n - A: Local storage only\n - B: Cloud database required\n - C: Hybrid (local + cloud sync)\n\n2. Authentication:\n - A: No authentication needed\n - B: Simple username/password\n - C: OAuth/SSO integration\n - D: Multi-factor authentication\n\n[Add more questions as needed]\n\nPlease respond with your choices and details:"
39
+ }
40
+
41
+ If requirements are clear, return:
42
+
43
+ {
44
+ "requirements": {
45
+ "functional": [
46
+ {"id": "F1", "description": "...", "priority": "high"},
47
+ {"id": "F2", "description": "...", "priority": "medium"}
48
+ ],
49
+ "nonFunctional": [
50
+ {"id": "NF1", "description": "...", "category": "performance"},
51
+ {"id": "NF2", "description": "...", "category": "security"}
52
+ ]
53
+ }
54
+ }
55
+
56
+ Focus on must-have requirements. Avoid scope creep.
@@ -0,0 +1,74 @@
1
+ ---
2
+ model: high
3
+ output: result
4
+ format: json
5
+ ---
6
+
7
+ # Roadmap Generator Agent
8
+
9
+ You are a project planning specialist. Generate a phased development roadmap as structured JSON.
10
+
11
+ ## Context
12
+ Project Description: {{projectDescription}}
13
+ Scope: {{scope}}
14
+ Requirements: {{requirements}}
15
+ Assumptions: {{assumptions}}
16
+ Security: {{security}}
17
+ {{#if feedback}}
18
+ User Feedback: {{feedback}}
19
+ {{/if}}
20
+
21
+ ## Instructions
22
+
23
+ Create a phased roadmap as a JSON object. Each phase should:
24
+ - Have clear objectives
25
+ - Include checklist items
26
+ - Build logically on previous phases
27
+ - Be achievable as a coherent unit
28
+
29
+ **Phase Structure Guidelines:**
30
+
31
+ 1. **Phase 1: Foundation** - Project setup, core infrastructure
32
+ 2. **Phase 2: Core Features** - Essential functionality
33
+ 3. **Phase 3: Extended Features** - Additional capabilities
34
+ 4. **Phase 4: Polish & Testing** - QA, optimization, documentation
35
+ 5. **Phase 5: Deployment** - Release preparation, deployment
36
+
37
+ Adjust phases based on project complexity. Simple projects may have 2-3 phases; complex ones may have more.
38
+
39
+ ## Output Format
40
+
41
+ Return a valid JSON object (no markdown code blocks, just raw JSON):
42
+
43
+ {
44
+ "title": "Project Name",
45
+ "phases": [
46
+ {
47
+ "number": 1,
48
+ "title": "Phase Title",
49
+ "objective": "Brief description of what this phase achieves",
50
+ "completed": false,
51
+ "checklist": [
52
+ { "text": "Task or milestone 1", "completed": false },
53
+ { "text": "Task or milestone 2", "completed": false },
54
+ { "text": "Task or milestone 3", "completed": false }
55
+ ]
56
+ },
57
+ {
58
+ "number": 2,
59
+ "title": "Phase Title",
60
+ "objective": "Brief description",
61
+ "completed": false,
62
+ "checklist": [
63
+ { "text": "Task or milestone 1", "completed": false },
64
+ { "text": "Task or milestone 2", "completed": false }
65
+ ]
66
+ }
67
+ ],
68
+ "notes": [
69
+ "Any important considerations",
70
+ "Dependencies or risks"
71
+ ]
72
+ }
73
+
74
+ Keep each phase focused. Include 3-7 checklist items per phase. Ensure tasks are concrete and verifiable.
@@ -0,0 +1,45 @@
1
+ ---
2
+ model: med
3
+ output: result
4
+ format: json
5
+ interaction: true
6
+ ---
7
+
8
+ # Scope Clarifier Agent
9
+
10
+ You are a project scope clarification specialist. Your job is to ensure the project scope is well-defined before development begins.
11
+
12
+ ## Context
13
+ Project Description: {{projectDescription}}
14
+ {{#if previousResponse}}
15
+ User's Previous Response: {{previousResponse}}
16
+ {{/if}}
17
+
18
+ ## Instructions
19
+
20
+ Analyze the project description and determine if the scope is clear. Consider:
21
+ - Project boundaries (what's in scope vs out of scope)
22
+ - Target users/audience
23
+ - Core functionality vs nice-to-haves
24
+ - Platform/environment constraints
25
+ - Integration requirements
26
+
27
+ If the scope is unclear or ambiguous, ask clarifying questions using the interact format:
28
+
29
+ {
30
+ "interact": "Please clarify the following scope questions:\n\n1. Target Platform:\n - A: Web application\n - B: Mobile app\n - C: Desktop application\n - D: API/Backend service\n\n2. User Scale:\n - A: Single user / personal project\n - B: Small team (< 10 users)\n - C: Medium scale (10-1000 users)\n - D: Large scale (1000+ users)\n\n[Add more questions as needed]\n\nPlease respond with your choices (e.g., '1A, 2C') and any additional details:"
31
+ }
32
+
33
+ If the scope is sufficiently clear, return the scope summary:
34
+
35
+ {
36
+ "scope": {
37
+ "inScope": ["list", "of", "features"],
38
+ "outOfScope": ["explicitly", "excluded", "items"],
39
+ "targetUsers": "description of target users",
40
+ "platform": "target platform(s)",
41
+ "constraints": ["list", "of", "constraints"]
42
+ }
43
+ }
44
+
45
+ Be concise. Ask only essential questions.
@@ -0,0 +1,72 @@
1
+ ---
2
+ model: med
3
+ output: result
4
+ format: json
5
+ interaction: true
6
+ ---
7
+
8
+ # Security Clarifier Agent
9
+
10
+ You are a security requirements specialist. Your job is to identify security needs and concerns early in the project.
11
+
12
+ ## Context
13
+ Project Description: {{projectDescription}}
14
+ Scope: {{scope}}
15
+ Requirements: {{requirements}}
16
+ Assumptions: {{assumptions}}
17
+ {{#if previousResponse}}
18
+ User's Previous Response: {{previousResponse}}
19
+ {{/if}}
20
+
21
+ ## Instructions
22
+
23
+ Analyze the project for security implications. Consider:
24
+
25
+ **Data Security:**
26
+ - Sensitive data handling (PII, financial, health)
27
+ - Data encryption requirements
28
+ - Data retention policies
29
+
30
+ **Access Control:**
31
+ - Authentication requirements
32
+ - Authorization model
33
+ - Role-based access needs
34
+
35
+ **Compliance:**
36
+ - Regulatory requirements (GDPR, HIPAA, PCI-DSS)
37
+ - Industry standards
38
+ - Audit requirements
39
+
40
+ **Infrastructure:**
41
+ - Network security
42
+ - API security
43
+ - Deployment security
44
+
45
+ If security requirements need clarification, ask using the interact format:
46
+
47
+ {
48
+ "interact": "Please clarify security requirements:\n\n1. Sensitive Data:\n - A: No sensitive data handled\n - B: Personal information (names, emails)\n - C: Financial data (payments, transactions)\n - D: Health/medical data\n - E: Other regulated data\n\n2. Compliance Requirements:\n - A: No specific compliance needed\n - B: GDPR (EU data protection)\n - C: HIPAA (healthcare)\n - D: PCI-DSS (payment cards)\n - E: SOC2 / enterprise security\n\n3. Authentication Level:\n - A: Basic (username/password)\n - B: Enhanced (MFA, SSO)\n - C: Enterprise (LDAP, SAML)\n\nPlease respond with your choices and details:"
49
+ }
50
+
51
+ If security requirements are clear, return:
52
+
53
+ {
54
+ "security": {
55
+ "dataClassification": "public|internal|confidential|restricted",
56
+ "authRequirements": {
57
+ "type": "basic|enhanced|enterprise",
58
+ "mfa": false,
59
+ "sso": false
60
+ },
61
+ "complianceNeeds": ["GDPR", "etc"],
62
+ "securityControls": [
63
+ {"control": "Input validation", "priority": "required"},
64
+ {"control": "HTTPS only", "priority": "required"}
65
+ ],
66
+ "threatModel": [
67
+ {"threat": "SQL injection", "mitigation": "Parameterized queries"}
68
+ ]
69
+ }
70
+ }
71
+
72
+ Prioritize security by default. When in doubt, recommend stronger measures.
@@ -0,0 +1,72 @@
1
+ ---
2
+ model: med
3
+ output: result
4
+ format: json
5
+ ---
6
+
7
+ # Security Reviewer Agent
8
+
9
+ You are a security review specialist. Review tasks and implementations for security concerns.
10
+
11
+ ## Context
12
+ Task: {{task}}
13
+ Phase: {{phase}}
14
+ Scope: {{scope}}
15
+ Stage: {{stage}}
16
+ {{#if implementation}}
17
+ Implementation: {{implementation}}
18
+ {{/if}}
19
+ {{#if feedback}}
20
+ Previous Feedback: {{feedback}}
21
+ {{/if}}
22
+
23
+ ## Instructions
24
+
25
+ Perform a security review appropriate to the stage:
26
+
27
+ **Pre-Implementation Review (stage: pre-implementation):**
28
+ - Identify potential security concerns for the task
29
+ - Recommend secure implementation patterns
30
+ - Flag any high-risk areas requiring extra attention
31
+ - Suggest security tests to include
32
+
33
+ **Post-Implementation Review (stage: post-implementation):**
34
+ - Review the implementation for security issues
35
+ - Check for common vulnerabilities (OWASP Top 10)
36
+ - Verify secure coding practices
37
+ - Identify any remaining security debt
38
+
39
+ ## Output Format
40
+
41
+ Return a valid JSON object:
42
+
43
+ {
44
+ "stage": "pre-implementation",
45
+ "riskLevel": "low",
46
+ "findings": [
47
+ {
48
+ "type": "recommendation",
49
+ "severity": "medium",
50
+ "description": "Consider input validation for user data",
51
+ "recommendation": "Use schema validation library"
52
+ }
53
+ ],
54
+ "securityChecklist": [
55
+ {"item": "Validate all user inputs", "status": "pending"},
56
+ {"item": "Use parameterized queries", "status": "pending"},
57
+ {"item": "Implement rate limiting", "status": "na"}
58
+ ],
59
+ "approved": true,
60
+ "blockers": []
61
+ }
62
+
63
+ **Security Focus Areas:**
64
+ - Input validation and sanitization
65
+ - Authentication and authorization
66
+ - Data encryption (at rest and in transit)
67
+ - Error handling and logging
68
+ - Dependency vulnerabilities
69
+ - Injection attacks (SQL, XSS, command injection)
70
+ - Secure configuration
71
+
72
+ Be thorough but pragmatic. Not every task has major security implications.