@brunosps00/dev-workflow 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.
Files changed (54) hide show
  1. package/README.md +156 -0
  2. package/bin/dev-workflow.js +64 -0
  3. package/lib/constants.js +97 -0
  4. package/lib/init.js +101 -0
  5. package/lib/mcp.js +40 -0
  6. package/lib/prompts.js +36 -0
  7. package/lib/utils.js +69 -0
  8. package/lib/wrappers.js +22 -0
  9. package/package.json +41 -0
  10. package/scaffold/en/commands/analyze-project.md +695 -0
  11. package/scaffold/en/commands/brainstorm.md +79 -0
  12. package/scaffold/en/commands/bugfix.md +345 -0
  13. package/scaffold/en/commands/code-review.md +280 -0
  14. package/scaffold/en/commands/commit.md +179 -0
  15. package/scaffold/en/commands/create-prd.md +99 -0
  16. package/scaffold/en/commands/create-tasks.md +134 -0
  17. package/scaffold/en/commands/create-techspec.md +138 -0
  18. package/scaffold/en/commands/deep-research.md +411 -0
  19. package/scaffold/en/commands/fix-qa.md +109 -0
  20. package/scaffold/en/commands/generate-pr.md +206 -0
  21. package/scaffold/en/commands/help.md +289 -0
  22. package/scaffold/en/commands/refactoring-analysis.md +298 -0
  23. package/scaffold/en/commands/review-implementation.md +239 -0
  24. package/scaffold/en/commands/run-plan.md +236 -0
  25. package/scaffold/en/commands/run-qa.md +296 -0
  26. package/scaffold/en/commands/run-task.md +174 -0
  27. package/scaffold/en/templates/bugfix-template.md +91 -0
  28. package/scaffold/en/templates/prd-template.md +70 -0
  29. package/scaffold/en/templates/task-template.md +62 -0
  30. package/scaffold/en/templates/tasks-template.md +34 -0
  31. package/scaffold/en/templates/techspec-template.md +123 -0
  32. package/scaffold/pt-br/commands/analyze-project.md +628 -0
  33. package/scaffold/pt-br/commands/brainstorm.md +79 -0
  34. package/scaffold/pt-br/commands/bugfix.md +251 -0
  35. package/scaffold/pt-br/commands/code-review.md +220 -0
  36. package/scaffold/pt-br/commands/commit.md +127 -0
  37. package/scaffold/pt-br/commands/create-prd.md +98 -0
  38. package/scaffold/pt-br/commands/create-tasks.md +134 -0
  39. package/scaffold/pt-br/commands/create-techspec.md +136 -0
  40. package/scaffold/pt-br/commands/deep-research.md +158 -0
  41. package/scaffold/pt-br/commands/fix-qa.md +97 -0
  42. package/scaffold/pt-br/commands/generate-pr.md +162 -0
  43. package/scaffold/pt-br/commands/help.md +226 -0
  44. package/scaffold/pt-br/commands/refactoring-analysis.md +298 -0
  45. package/scaffold/pt-br/commands/review-implementation.md +201 -0
  46. package/scaffold/pt-br/commands/run-plan.md +159 -0
  47. package/scaffold/pt-br/commands/run-qa.md +238 -0
  48. package/scaffold/pt-br/commands/run-task.md +158 -0
  49. package/scaffold/pt-br/templates/bugfix-template.md +91 -0
  50. package/scaffold/pt-br/templates/prd-template.md +70 -0
  51. package/scaffold/pt-br/templates/task-template.md +62 -0
  52. package/scaffold/pt-br/templates/tasks-template.md +34 -0
  53. package/scaffold/pt-br/templates/techspec-template.md +123 -0
  54. package/scaffold/rules-readme.md +25 -0
@@ -0,0 +1,174 @@
1
+ <system_instructions>
2
+ You are an AI assistant responsible for implementing software development tasks. Your job is to identify the next available task, perform the necessary setup, implement, and validate before committing.
3
+
4
+ <critical>You must not rush to finish the task. Always check the necessary files, verify the tests, and go through a reasoning process to ensure both understanding and correct execution.</critical>
5
+ <critical>THE TASK CANNOT BE CONSIDERED COMPLETE UNTIL ALL TESTS ARE PASSING</critical>
6
+
7
+ ## Complementary Skills
8
+
9
+ When available in the project at `./.agents/skills/`, use these skills as specialized support without replacing this command:
10
+
11
+ - `vercel-react-best-practices`: use when the task touches React/Next.js, especially for rendering, data fetching, hydration, bundle, cache, and performance
12
+ - `webapp-testing`: use when the task requires functional frontend validation in a real browser
13
+ - `agent-browser`: use when UI validation requires persistent session, operational navigation inspection, or complementary visual evidence
14
+
15
+ ## File Locations
16
+
17
+ - PRD: `./spec/prd-[feature-name]/prd.md`
18
+ - Tech Spec: `./spec/prd-[feature-name]/techspec.md`
19
+ - Tasks: `./spec/prd-[feature-name]/tasks.md`
20
+ - Project Rules: `ai/rules/`
21
+
22
+ ## Steps to Execute
23
+
24
+ ### 0. Verify Branch
25
+ - Confirm you are on the branch `feat/prd-[feature-name]`
26
+ - If not: `git checkout feat/prd-[feature-name]`
27
+
28
+ ### 1. Pre-Task Setup
29
+ - Read the task definition (`[num]_task.md`)
30
+ - Review the PRD context
31
+ - Verify tech spec requirements (including testing strategy)
32
+ - Understand dependencies from previous tasks
33
+
34
+ ### 2. Task Analysis
35
+ Analyze considering:
36
+ - Main objectives of the task
37
+ - How the task fits into the project context
38
+ - Alignment with project rules and patterns (`ai/rules/`)
39
+ - Possible solutions or approaches
40
+ - If React/Next.js is in scope, explicitly incorporate relevant heuristics from `vercel-react-best-practices`
41
+
42
+ ### 3. Task Summary
43
+
44
+ ```
45
+ Task ID: [ID or number]
46
+ Task Name: [Name or brief description]
47
+ PRD Context: [Key points from the PRD]
48
+ Tech Spec Requirements: [Key technical requirements]
49
+ Dependencies: [List of dependencies]
50
+ Main Objectives: [Primary objectives]
51
+ Risks/Challenges: [Identified risks or challenges]
52
+ ```
53
+
54
+ ### 4. Approach Plan
55
+
56
+ ```
57
+ 1. [First step]
58
+ 2. [Second step]
59
+ 3. [Additional steps as needed]
60
+ ```
61
+
62
+ ## Implementation
63
+
64
+ After providing the summary and approach, **begin implementation immediately**:
65
+ - Execute necessary commands
66
+ - Make code changes
67
+ - **Implement unit tests** (mandatory for backend)
68
+ - Follow established project patterns
69
+ - Ensure all requirements are met
70
+ - **Run tests**: use the project's test command
71
+ - If there is interactive frontend, also validate real behavior with `webapp-testing` or `agent-browser` when doing so reduces the risk of invisible regression in unit tests
72
+
73
+ **YOU MUST** start the implementation right after the process above.
74
+
75
+ <critical>Use the Context7 MCP to look up documentation for the language, frameworks, and libraries involved in the implementation</critical>
76
+
77
+ ## Important Notes
78
+
79
+ - Always verify against the PRD, tech spec, and task file
80
+ - Implement proper solutions **without using hacks or workarounds**
81
+ - Follow all established project patterns
82
+
83
+ ## Post-Implementation Validation - Level 1 (Required)
84
+
85
+ <critical>This validation is MANDATORY before the commit. If it fails, fix and re-validate.</critical>
86
+
87
+ After implementing, execute the lightweight validation (Level 1):
88
+
89
+ ### Acceptance Criteria Checklist
90
+ For each acceptance criterion defined in the task:
91
+ - Verify it was implemented with evidence in the code
92
+ - If any criterion was not met: **FIX before proceeding**
93
+
94
+ ### Test Execution
95
+ ```bash
96
+ # Run tests for the impacted project
97
+ pnpm test # or npm test
98
+ ```
99
+ - [ ] All tests pass (existing + new)
100
+ - [ ] New tests were created for new code
101
+ - If any test fails: **FIX before proceeding**
102
+
103
+ ### Basic Standards Verification
104
+ - [ ] Explicit types (no `any`)
105
+ - [ ] Code compiles without errors
106
+ - [ ] Lint passes
107
+ - [ ] Multi-tenancy respected (if applicable)
108
+ - [ ] Project patterns followed (`ai/rules/`)
109
+
110
+ ### Functional UI Verification (for tasks with frontend)
111
+ <critical>Placeholder/stub pages are NOT acceptable deliverables for user interaction FRs.</critical>
112
+ - [ ] Each page/route created renders functional content (NOT a generic placeholder)
113
+ - [ ] If the task covers a listing FR: the page shows a table/list with real API data
114
+ - [ ] If the task covers a creation FR: the page has a functional form/dialog
115
+ - [ ] If the task covers a configuration FR: the page displays and allows editing the parameters
116
+ - [ ] No page shows a generic message like "initial foundation", "protected base", or "placeholder"
117
+ - If any verification fails: **the task is NOT complete -- implement the real UI before committing**
118
+
119
+ ### Created Artifacts Documentation (MANDATORY)
120
+
121
+ <critical>
122
+ When finishing each task, RECORD in the project's tasks.md a "Created Artifacts" section with:
123
+
124
+ 1. **New API routes**: method + path (e.g., `GET /module/resource`)
125
+ 2. **New frontend pages**:
126
+ - URL (e.g., `/module/page`)
127
+ - How it is accessed: via menu (sidebar item) OR via link on another page (specify which)
128
+ 3. **Reusable components created**: name + location
129
+
130
+ A page that is NOT accessible via the menu NOR via another page is USELESS -- ensure
131
+ every new page has at least one access path for the user.
132
+ </critical>
133
+
134
+ Format in tasks.md (add after marking the task as completed):
135
+
136
+ ```markdown
137
+ ### Artifacts from Task X.0
138
+
139
+ | Artifact | Type | Access |
140
+ |----------|------|--------|
141
+ | `GET /module/resource` | API | -- |
142
+ | `/module/page` | Page | Menu: Module > Item |
143
+ | `/module/page/sub` | Page | Link "Action" on page `/module/page` |
144
+ | `ComponentScreen` | Component | Used by pages X, Y, Z |
145
+ ```
146
+
147
+ ### Validation Result
148
+ - **If ALL OK**: Proceed to the commit
149
+ - **If FAILURE**: Fix the issues and re-execute the validation
150
+ - **DO NOT generate a report file** - only output in the terminal
151
+
152
+ ## Automatic Commit (Required)
153
+
154
+ At the end of the task (after Level 1 validation passes), **always** commit (no push):
155
+
156
+ ```bash
157
+ git status
158
+ git add .
159
+ git commit -m "feat([module]): [concise description]
160
+
161
+ - [item 1 implemented]
162
+ - [item 2 implemented]
163
+ - Add unit tests"
164
+ ```
165
+
166
+ **Note**: The push will only be done at PR creation when all tasks are completed.
167
+
168
+ <critical>After completing the task, mark it as complete in tasks.md</critical>
169
+
170
+ ## Next Steps
171
+
172
+ - If there are more tasks: `run-task [next-task]`
173
+ - If last task: create PR (e.g., targeting `main`)
174
+ </system_instructions>
@@ -0,0 +1,91 @@
1
+ # Bugfix: [Bug Name]
2
+
3
+ ## Problem Summary
4
+
5
+ | Field | Value |
6
+ |-------|-------|
7
+ | **Affected Project(s)** | [project1, project2, etc.] |
8
+ | **Severity** | [critical / high / medium / low] |
9
+ | **Environment** | [production / staging / development] |
10
+ | **Reported on** | [date] |
11
+ | **Reported by** | [name/channel] |
12
+
13
+ ## Bug Description
14
+
15
+ [Describe the incorrect behavior observed. Be specific about what happens vs what should happen.]
16
+
17
+ ## Steps to Reproduce
18
+
19
+ 1. [Step 1]
20
+ 2. [Step 2]
21
+ 3. [Step 3]
22
+ 4. [Observed result]
23
+
24
+ **Test data:** [If applicable, include data needed to reproduce]
25
+
26
+ ## Expected Behavior
27
+
28
+ [Describe the correct behavior that should occur]
29
+
30
+ ## Evidence
31
+
32
+ ### Logs/Stack Trace
33
+ ```
34
+ [Paste relevant logs or stack traces]
35
+ ```
36
+
37
+ ### Screenshots/Videos
38
+ [If applicable]
39
+
40
+ ### Related Commits
41
+ - [hash] - [description]
42
+
43
+ ## Root Cause Analysis
44
+
45
+ ### Symptom
46
+ [What the user observes]
47
+
48
+ ### Identified Cause
49
+ [Technical explanation of the bug's cause]
50
+
51
+ ### Affected Files
52
+ | File | Change Type | Description |
53
+ |------|-------------|-------------|
54
+ | [path] | [fix/test/config] | [what to change] |
55
+
56
+ ## Impact
57
+
58
+ ### Affected Users
59
+ [How many users? Which personas?]
60
+
61
+ ### Impacted Features
62
+ [List of features that depend on the buggy code]
63
+
64
+ ### Regression Risk
65
+ [low / medium / high] - [justification]
66
+
67
+ ## Proposed Solution
68
+
69
+ [Describe the fix approach at a high level]
70
+
71
+ ### Alternatives Considered
72
+ | Alternative | Pros | Cons |
73
+ |-------------|------|------|
74
+ | [option 1] | | |
75
+ | [option 2] | | |
76
+
77
+ ## Acceptance Criteria
78
+
79
+ - [ ] Bug no longer reproduces following the described steps
80
+ - [ ] Automated tests cover the scenario
81
+ - [ ] No regression in related features
82
+ - [ ] [Other specific criteria]
83
+
84
+ ## Out of Scope
85
+
86
+ [What will NOT be fixed in this bugfix - future improvements, refactoring, etc.]
87
+
88
+ ## Open Questions
89
+
90
+ - [ ] [Question 1]
91
+ - [ ] [Question 2]
@@ -0,0 +1,70 @@
1
+ # Product Requirements Document (PRD) Template
2
+
3
+ ## Overview
4
+
5
+ [Provide a high-level overview of your product/feature. Explain what problem it solves, who it's for, and why it's valuable.]
6
+
7
+ ## Goals
8
+
9
+ [List specific, measurable goals for this feature:
10
+
11
+ - What success looks like
12
+ - Key metrics to track
13
+ - Business objectives to achieve]
14
+
15
+ ## User Stories
16
+
17
+ [Detail user narratives describing feature usage and benefits:
18
+
19
+ - As a [user type], I want to [perform an action] so that [benefit]
20
+ - Include primary and secondary user personas
21
+ - Cover main flows and edge cases]
22
+
23
+ ## Core Features
24
+
25
+ [List and describe your product's core features. For each feature, include:
26
+
27
+ - What it does
28
+ - Why it's important
29
+ - How it works at a high level
30
+ - Functional requirements (numbered for clarity)]
31
+
32
+ ## User Experience
33
+
34
+ [Describe the user journey and experience:
35
+
36
+ - User personas and their needs
37
+ - Main user flows and interactions
38
+ - UI/UX considerations and requirements
39
+ - Accessibility requirements]
40
+
41
+ ## High-Level Technical Constraints
42
+
43
+ [Capture only high-level constraints and considerations (avoid design solutions -- those belong in the Tech Spec):
44
+
45
+ - Required external integrations or existing systems to interface with
46
+ - Compliance, regulatory, or security mandates
47
+ - Performance/scalability targets (e.g., expected TPS, upper latency bounds)
48
+ - Data sensitivity/privacy considerations
49
+ - Non-negotiable technology or protocol requirements
50
+
51
+ Implementation details will be addressed in the Technical Specification.]
52
+
53
+ ## Out of Scope
54
+
55
+ [Clearly state what this feature will NOT include to manage scope:
56
+
57
+ - Explicitly excluded features
58
+ - Future considerations that are out of scope
59
+ - Boundaries and limitations
60
+
61
+ (Note: Technical implementation risks will be detailed in the Tech Spec.)]
62
+
63
+ ## Open Questions
64
+
65
+ [List any remaining questions or areas needing additional clarification:
66
+
67
+ - Unclear requirements or edge cases
68
+ - Questions about user needs or business goals
69
+ - Dependencies on external business factors
70
+ - Areas requiring design or user research]
@@ -0,0 +1,62 @@
1
+ # Task X.0: [Main Task Title]
2
+
3
+ <critical>Read the prd.md and techspec.md files in this folder. If you don't read these files your task will be invalidated.</critical>
4
+
5
+ ## Overview
6
+
7
+ [Brief task description]
8
+
9
+ **Functional Requirements covered**: FR[X.Y], FR[X.Z] (maximum 2 per task)
10
+
11
+ <requirements>
12
+ [List of mandatory requirements]
13
+ </requirements>
14
+
15
+ ## Subtasks
16
+
17
+ ### Implementation
18
+ - [ ] X.1 [Subtask description]
19
+ - [ ] X.2 [Subtask description]
20
+
21
+ ### Unit Tests (Mandatory for Backend)
22
+ - [ ] X.3 Create tests for [service/use-case]
23
+ - [ ] X.4 Create tests for [controller/adapter]
24
+
25
+ ## Unit Tests
26
+
27
+ ### Test Cases
28
+
29
+ | Method | Cases |
30
+ |--------|-------|
31
+ | `[method1]` | Happy path, edge case, error |
32
+ | `[method2]` | Happy path, not found |
33
+
34
+ ### Required Mocks
35
+ - `[repository/service]` - mocked via mock function
36
+
37
+ ## Implementation Details
38
+
39
+ [Relevant sections from the tech spec - reference techspec.md instead of duplicating content]
40
+
41
+ ## Success Criteria
42
+
43
+ - [Measurable outcomes]
44
+ - [Quality requirements]
45
+ - **Unit tests passing**
46
+ - **Minimum 80% coverage** on services/use-cases
47
+
48
+ ## Relevant Files
49
+ - [Files relevant to this task]
50
+ - [File].spec.ts - Unit tests
51
+
52
+ ## Commit on Completion
53
+
54
+ When completing this task, commit:
55
+ ```bash
56
+ git add .
57
+ git commit -m "feat([module]): [description]
58
+
59
+ - [item 1]
60
+ - [item 2]
61
+ - Add unit tests"
62
+ ```
@@ -0,0 +1,34 @@
1
+ # Implementation Tasks Summary for [Feature]
2
+
3
+ ## Branch
4
+
5
+ ```
6
+ feat/prd-[feature-name]
7
+ ```
8
+
9
+ ## Impacted Projects
10
+
11
+ - [ ] [Project 1]
12
+ - [ ] [Project 2]
13
+
14
+ ## Tasks
15
+
16
+ | Task | Description | FRs | Status |
17
+ |------|-------------|-----|--------|
18
+ | 1.0 | [Title] | FR1.1, FR1.2 | Pending |
19
+ | 2.0 | [Title] | FR2.1 | Pending |
20
+ | 3.0 | [Title] | FR3.1, FR3.2 | Pending |
21
+
22
+ ## Progress
23
+
24
+ - [ ] 1.0 Main Task Title
25
+ - [ ] 2.0 Main Task Title
26
+ - [ ] 3.0 Main Task Title
27
+
28
+ ## Workflow
29
+
30
+ Each task follows this flow:
31
+ 1. `/execute-task [N]_task.md` - Implements the task
32
+ 2. Unit tests included in the implementation
33
+ 3. Commit at the end of each task (no push)
34
+ 4. Next task or `/generate-pr [target-branch]` when all tasks are completed
@@ -0,0 +1,123 @@
1
+ # Technical Specification Template
2
+
3
+ ## Executive Summary
4
+
5
+ [Provide a brief technical overview of the solution approach. Summarize the key architectural decisions and implementation strategy in 1-2 paragraphs.]
6
+
7
+ ## System Architecture
8
+
9
+ ### Component Overview
10
+
11
+ [Brief description of main components and their responsibilities:
12
+
13
+ - Component names and primary functions
14
+ - Key relationships between components
15
+ - Data flow overview]
16
+
17
+ ## Implementation Design
18
+
19
+ ### Key Interfaces
20
+
21
+ [Define main service interfaces (<=20 lines per example):
22
+
23
+ ```
24
+ // Example interface definition
25
+ type ServiceName interface {
26
+ MethodName(ctx context.Context, input Type) (output Type, error)
27
+ }
28
+ ```
29
+
30
+ ]
31
+
32
+ ### Data Models
33
+
34
+ [Define essential data structures:
35
+
36
+ - Core domain entities (if applicable)
37
+ - Request/response types
38
+ - Database schemas (if applicable)]
39
+
40
+ ### API Endpoints
41
+
42
+ [List API endpoints if applicable:
43
+
44
+ - Method and path (e.g., `POST /api/v0/resource`)
45
+ - Brief description
46
+ - Request/response format references]
47
+
48
+ ## Integration Points
49
+
50
+ [Include only if the feature requires external integrations:
51
+
52
+ - External services or APIs
53
+ - Authentication requirements
54
+ - Error handling approach]
55
+
56
+ ## Testing Approach
57
+
58
+ ### Unit Tests
59
+
60
+ [Describe unit testing strategy:
61
+
62
+ - Key components to test
63
+ - Mock requirements (external services only)
64
+ - Critical test scenarios]
65
+
66
+ ### Integration Tests
67
+
68
+ [If needed, describe integration tests:
69
+
70
+ - Components to test together
71
+ - Test data requirements]
72
+
73
+ ## Development Sequencing
74
+
75
+ ### Build Order
76
+
77
+ [Define implementation sequence:
78
+
79
+ 1. First component/feature (why first)
80
+ 2. Second component/feature (dependencies)
81
+ 3. Subsequent components
82
+ 4. Integration and testing]
83
+
84
+ ### Technical Dependencies
85
+
86
+ [List any blocking dependencies:
87
+
88
+ - Required infrastructure
89
+ - External service availability]
90
+
91
+ ## Monitoring and Observability
92
+
93
+ [Define monitoring approach using existing infrastructure:
94
+
95
+ - Metrics to expose
96
+ - Key logs and log levels
97
+ - Integration with existing dashboards]
98
+
99
+ ## Technical Considerations
100
+
101
+ ### Key Decisions
102
+
103
+ [Document important technical decisions:
104
+
105
+ - Chosen approach and justification
106
+ - Trade-offs considered
107
+ - Rejected alternatives and why]
108
+
109
+ ### Known Risks
110
+
111
+ [Identify technical risks:
112
+
113
+ - Potential challenges
114
+ - Mitigation approaches
115
+ - Areas needing research]
116
+
117
+ ### Standards Compliance
118
+
119
+ [Review the rules in `ai/rules/` that apply to this techspec and list them below:]
120
+
121
+ ### Relevant Files
122
+
123
+ [List relevant project files here]