autoworkflow 3.1.5 → 3.6.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.
Files changed (124) hide show
  1. package/.claude/commands/analyze.md +19 -0
  2. package/.claude/commands/audit.md +26 -0
  3. package/.claude/commands/build.md +39 -0
  4. package/.claude/commands/commit.md +25 -0
  5. package/.claude/commands/fix.md +23 -0
  6. package/.claude/commands/plan.md +18 -0
  7. package/.claude/commands/suggest.md +23 -0
  8. package/.claude/commands/verify.md +18 -0
  9. package/.claude/hooks/post-bash-router.sh +20 -0
  10. package/.claude/hooks/post-commit.sh +140 -0
  11. package/.claude/hooks/post-edit.sh +190 -17
  12. package/.claude/hooks/pre-edit.sh +221 -0
  13. package/.claude/hooks/session-check.sh +90 -0
  14. package/.claude/settings.json +56 -6
  15. package/.claude/settings.local.json +5 -1
  16. package/.claude/skills/actix.md +337 -0
  17. package/.claude/skills/alembic.md +504 -0
  18. package/.claude/skills/angular.md +237 -0
  19. package/.claude/skills/api-design.md +187 -0
  20. package/.claude/skills/aspnet-core.md +377 -0
  21. package/.claude/skills/astro.md +245 -0
  22. package/.claude/skills/auth-clerk.md +327 -0
  23. package/.claude/skills/auth-firebase.md +367 -0
  24. package/.claude/skills/auth-nextauth.md +359 -0
  25. package/.claude/skills/auth-supabase.md +368 -0
  26. package/.claude/skills/axum.md +386 -0
  27. package/.claude/skills/blazor.md +456 -0
  28. package/.claude/skills/chi.md +348 -0
  29. package/.claude/skills/code-review.md +133 -0
  30. package/.claude/skills/csharp.md +296 -0
  31. package/.claude/skills/css-modules.md +325 -0
  32. package/.claude/skills/cypress.md +343 -0
  33. package/.claude/skills/debugging.md +133 -0
  34. package/.claude/skills/diesel.md +392 -0
  35. package/.claude/skills/django.md +301 -0
  36. package/.claude/skills/docker.md +319 -0
  37. package/.claude/skills/doctrine.md +473 -0
  38. package/.claude/skills/documentation.md +182 -0
  39. package/.claude/skills/dotnet.md +409 -0
  40. package/.claude/skills/drizzle.md +293 -0
  41. package/.claude/skills/echo.md +321 -0
  42. package/.claude/skills/eloquent.md +256 -0
  43. package/.claude/skills/emotion.md +426 -0
  44. package/.claude/skills/entity-framework.md +370 -0
  45. package/.claude/skills/express.md +316 -0
  46. package/.claude/skills/fastapi.md +329 -0
  47. package/.claude/skills/fastify.md +299 -0
  48. package/.claude/skills/fiber.md +315 -0
  49. package/.claude/skills/flask.md +322 -0
  50. package/.claude/skills/gin.md +342 -0
  51. package/.claude/skills/git.md +116 -0
  52. package/.claude/skills/github-actions.md +353 -0
  53. package/.claude/skills/go.md +377 -0
  54. package/.claude/skills/gorm.md +409 -0
  55. package/.claude/skills/graphql.md +478 -0
  56. package/.claude/skills/hibernate.md +379 -0
  57. package/.claude/skills/hono.md +306 -0
  58. package/.claude/skills/java.md +400 -0
  59. package/.claude/skills/jest.md +313 -0
  60. package/.claude/skills/jpa.md +282 -0
  61. package/.claude/skills/kotlin.md +347 -0
  62. package/.claude/skills/kubernetes.md +363 -0
  63. package/.claude/skills/laravel.md +414 -0
  64. package/.claude/skills/mcp-browser.md +320 -0
  65. package/.claude/skills/mcp-database.md +219 -0
  66. package/.claude/skills/mcp-fetch.md +241 -0
  67. package/.claude/skills/mcp-filesystem.md +204 -0
  68. package/.claude/skills/mcp-github.md +217 -0
  69. package/.claude/skills/mcp-memory.md +240 -0
  70. package/.claude/skills/mcp-search.md +218 -0
  71. package/.claude/skills/mcp-slack.md +262 -0
  72. package/.claude/skills/micronaut.md +388 -0
  73. package/.claude/skills/mongodb.md +319 -0
  74. package/.claude/skills/mongoose.md +355 -0
  75. package/.claude/skills/mysql.md +281 -0
  76. package/.claude/skills/nestjs.md +335 -0
  77. package/.claude/skills/nextjs-app-router.md +260 -0
  78. package/.claude/skills/nextjs-pages.md +172 -0
  79. package/.claude/skills/nuxt.md +202 -0
  80. package/.claude/skills/openapi.md +489 -0
  81. package/.claude/skills/performance.md +199 -0
  82. package/.claude/skills/php.md +398 -0
  83. package/.claude/skills/playwright.md +371 -0
  84. package/.claude/skills/postgresql.md +257 -0
  85. package/.claude/skills/prisma.md +293 -0
  86. package/.claude/skills/pydantic.md +304 -0
  87. package/.claude/skills/pytest.md +313 -0
  88. package/.claude/skills/python.md +272 -0
  89. package/.claude/skills/quarkus.md +377 -0
  90. package/.claude/skills/react.md +230 -0
  91. package/.claude/skills/redis.md +391 -0
  92. package/.claude/skills/refactoring.md +143 -0
  93. package/.claude/skills/remix.md +246 -0
  94. package/.claude/skills/rest-api.md +490 -0
  95. package/.claude/skills/rocket.md +366 -0
  96. package/.claude/skills/rust.md +341 -0
  97. package/.claude/skills/sass.md +380 -0
  98. package/.claude/skills/sea-orm.md +382 -0
  99. package/.claude/skills/security.md +167 -0
  100. package/.claude/skills/sequelize.md +395 -0
  101. package/.claude/skills/spring-boot.md +416 -0
  102. package/.claude/skills/sqlalchemy.md +269 -0
  103. package/.claude/skills/sqlx-rust.md +408 -0
  104. package/.claude/skills/state-jotai.md +346 -0
  105. package/.claude/skills/state-mobx.md +353 -0
  106. package/.claude/skills/state-pinia.md +431 -0
  107. package/.claude/skills/state-redux.md +337 -0
  108. package/.claude/skills/state-tanstack-query.md +434 -0
  109. package/.claude/skills/state-zustand.md +340 -0
  110. package/.claude/skills/styled-components.md +403 -0
  111. package/.claude/skills/svelte.md +238 -0
  112. package/.claude/skills/sveltekit.md +207 -0
  113. package/.claude/skills/symfony.md +437 -0
  114. package/.claude/skills/tailwind.md +279 -0
  115. package/.claude/skills/terraform.md +394 -0
  116. package/.claude/skills/testing-library.md +371 -0
  117. package/.claude/skills/trpc.md +426 -0
  118. package/.claude/skills/typeorm.md +368 -0
  119. package/.claude/skills/vitest.md +330 -0
  120. package/.claude/skills/vue.md +202 -0
  121. package/.claude/skills/warp.md +365 -0
  122. package/README.md +163 -52
  123. package/package.json +1 -1
  124. package/system/triggers.md +256 -17
@@ -1,3 +1,22 @@
1
+ ---
2
+ role: Technical Analyst
3
+ skills_required: []
4
+ output_schema:
5
+ task_description: string
6
+ classification: {type: enum[feature,fix,refactor,style,docs,test,query], workflow: array, gates: array}
7
+ relevant_files: [{path: string, reason: string}]
8
+ existing_patterns: array
9
+ blueprint_requirements: array
10
+ dependencies: array
11
+ notes: array
12
+ guardrails:
13
+ - Always read BLUEPRINT.md if it exists
14
+ - Always classify task type using system/router.md
15
+ - Never skip to implementation without analysis
16
+ - Identify all relevant files before planning
17
+ - Note existing patterns to maintain consistency
18
+ ---
19
+
1
20
  # /analyze - Analyze Command
2
21
 
3
22
  Analyze the codebase for a given task or question.
@@ -1,7 +1,33 @@
1
+ ---
2
+ role: Senior Code Reviewer
3
+ skills_required:
4
+ - security.md
5
+ - code-review.md
6
+ output_schema:
7
+ feature_name: string
8
+ issues: [{severity: enum[critical,high,medium,low], category: enum[security,performance,maintainability,correctness], file: string, line: number, message: string, suggestion: string}]
9
+ summary: string
10
+ score: number (0-100)
11
+ approval: boolean
12
+ blocking_issues: number
13
+ guardrails:
14
+ - Prioritize security issues above all else
15
+ - Fail immediately on critical issues
16
+ - Always provide actionable fix suggestions
17
+ - ONE FEATURE AT A TIME - never audit multiple features simultaneously
18
+ - Complete full cycle before moving to next feature
19
+ - Require user confirmation before proceeding to next feature
20
+ ---
21
+
1
22
  # /audit - Audit Command
2
23
 
3
24
  Run code quality, security, and architecture audits.
4
25
 
26
+ ## Prerequisites (LOAD FIRST)
27
+ **Before executing this command, READ these skill files:**
28
+ 1. `.claude/skills/security.md` - Security patterns and vulnerabilities
29
+ 2. `.claude/skills/code-review.md` - Code review checklist and feedback
30
+
5
31
  ## Trigger
6
32
  - User invokes `/audit`
7
33
  - User invokes `/audit project` (full project scan)
@@ -1,7 +1,46 @@
1
+ ---
2
+ role: Senior Full-Stack Engineer
3
+ skills_required: []
4
+ dynamic_skills:
5
+ - Detect project tech stack and load relevant skills
6
+ - React projects: react.md, nextjs-app-router.md or nextjs-pages.md
7
+ - Vue projects: vue.md, nuxt.md
8
+ - Backend: express.md, fastapi.md, etc.
9
+ - Database: prisma.md, postgresql.md, mongodb.md
10
+ output_schema:
11
+ feature_name: string
12
+ workflow_phases: [analyze, plan, confirm, implement, verify, audit, commit]
13
+ current_phase: string
14
+ phase_outputs: object
15
+ final_status: enum[completed,blocked,pending_approval]
16
+ guardrails:
17
+ - Execute FULL workflow: ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT
18
+ - NEVER skip the CONFIRM phase - always wait for user approval
19
+ - Handle loading, error, and empty states for all UI components
20
+ - Use TypeScript with proper type definitions
21
+ - Ensure accessibility (WCAG 2.1 AA minimum)
22
+ - Follow existing code patterns in the project
23
+ ---
24
+
1
25
  # /build - Build Feature Command
2
26
 
3
27
  Execute the full workflow to build a feature from start to finish.
4
28
 
29
+ ## Prerequisites (LOAD FIRST - Dynamic)
30
+ **Before executing, detect project tech stack and load relevant skills:**
31
+
32
+ 1. **Check package.json** for dependencies
33
+ 2. **Load matching skills from `.claude/skills/`:**
34
+ - React → `react.md`
35
+ - Next.js (app router) → `nextjs-app-router.md`
36
+ - Next.js (pages) → `nextjs-pages.md`
37
+ - Vue → `vue.md`
38
+ - Prisma → `prisma.md`
39
+ - Express → `express.md`
40
+ - TypeScript → Check `tsconfig.json` patterns
41
+
42
+ 3. **Always load:** `security.md` for security awareness
43
+
5
44
  ## Trigger
6
45
  - User invokes `/build [feature description]`
7
46
 
@@ -1,7 +1,32 @@
1
+ ---
2
+ role: Git Operations Specialist
3
+ skills_required:
4
+ - git.md
5
+ output_schema:
6
+ files_changed: array
7
+ commit_type: enum[feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert]
8
+ commit_scope: string
9
+ commit_message: string
10
+ gate_status: {typescript: boolean, eslint: boolean, todo_check: boolean, console_check: boolean, format_valid: boolean}
11
+ commit_hash: string
12
+ guardrails:
13
+ - ALWAYS use conventional commit format: type(scope): description
14
+ - NEVER commit with failing TypeScript or ESLint checks
15
+ - NEVER commit files containing TODO/FIXME comments
16
+ - NEVER commit files containing console.log statements
17
+ - NEVER force push to main/master branch
18
+ - ALWAYS run verification before committing
19
+ - ALWAYS ask for confirmation before executing commit
20
+ ---
21
+
1
22
  # /commit - Commit Command
2
23
 
3
24
  Run pre-commit gate and create a conventional commit.
4
25
 
26
+ ## Prerequisites (LOAD FIRST)
27
+ **Before executing this command, READ these skill files:**
28
+ 1. `.claude/skills/git.md` - Git conventions, commit formats, and best practices
29
+
5
30
  ## Trigger
6
31
  - User invokes `/commit [message]`
7
32
  - Or: After AUDIT phase passes
@@ -1,7 +1,30 @@
1
+ ---
2
+ role: Senior Debug Engineer
3
+ skills_required:
4
+ - debugging.md
5
+ output_schema:
6
+ diagnosis: {root_cause: string, error_type: string, affected_files: array}
7
+ fix: {approach: string, changes: [{file: string, description: string}], verification_steps: array}
8
+ prevention: {regression_test: string, recommendations: array}
9
+ iteration: number
10
+ status: enum[fixed,in_progress,stuck]
11
+ guardrails:
12
+ - Make minimal, targeted changes only
13
+ - Always verify fix with npm run verify
14
+ - Never make destructive changes without confirmation
15
+ - Add regression test recommendation for each fix
16
+ - Follow systematic debugging: REPRODUCE → ISOLATE → IDENTIFY → FIX → VERIFY
17
+ - Max 10 fix iterations before asking for help
18
+ ---
19
+
1
20
  # /fix - Fix Command
2
21
 
3
22
  Fix verification errors and re-verify.
4
23
 
24
+ ## Prerequisites (LOAD FIRST)
25
+ **Before executing this command, READ these skill files:**
26
+ 1. `.claude/skills/debugging.md` - Systematic debugging approach and techniques
27
+
5
28
  ## Trigger
6
29
  - User invokes `/fix`
7
30
  - Or: Automatically when `verify_loop` detects errors
@@ -1,3 +1,21 @@
1
+ ---
2
+ role: Senior Technical Project Manager
3
+ skills_required: []
4
+ output_schema:
5
+ feature_name: string
6
+ classification: {type: string, workflow: string}
7
+ phases: [{name: string, tasks: array}]
8
+ tasks: [{id: string, description: string, effort: enum[S,M,L,XL], depends_on: array}]
9
+ risks: [{risk: string, mitigation: string}]
10
+ definition_of_done: array
11
+ guardrails:
12
+ - Maximum 10 tasks per phase
13
+ - Always include effort estimates (S/M/L/XL)
14
+ - Always identify task dependencies
15
+ - Never implement without explicit user approval
16
+ - Break complex tasks into smaller steps
17
+ ---
18
+
1
19
  # /plan - Plan Command
2
20
 
3
21
  Create an implementation plan with suggestions.
@@ -1,7 +1,30 @@
1
+ ---
2
+ role: Technical Advisor
3
+ skills_required:
4
+ - code-review.md
5
+ output_schema:
6
+ task_name: string
7
+ suggestions:
8
+ required: [{description: string, reason: string}]
9
+ recommended: [{description: string, reason: string}]
10
+ optional: [{description: string, reason: string}]
11
+ user_selection: array
12
+ guardrails:
13
+ - Categorize all suggestions by priority (required/recommended/optional)
14
+ - Always explain the "why" for each suggestion
15
+ - Required items are non-negotiable for feature completeness
16
+ - Let user select which suggestions to implement
17
+ - Never implement suggestions without user approval
18
+ ---
19
+
1
20
  # /suggest - Suggest Command
2
21
 
3
22
  Generate feature completeness suggestions for a task.
4
23
 
24
+ ## Prerequisites (LOAD FIRST)
25
+ **Before executing this command, READ these skill files:**
26
+ 1. `.claude/skills/code-review.md` - Code review patterns and feedback templates
27
+
5
28
  ## Trigger
6
29
  - User invokes `/suggest [task]`
7
30
  - Or: Automatically during PLAN phase for features
@@ -1,3 +1,21 @@
1
+ ---
2
+ role: Quality Assurance Engineer
3
+ skills_required: []
4
+ output_schema:
5
+ typescript: {status: enum[pass,fail], error_count: number, errors: array}
6
+ eslint: {status: enum[pass,fail], warning_count: number, warnings: array}
7
+ gate_passed: boolean
8
+ iteration: number
9
+ max_iterations: 10
10
+ guardrails:
11
+ - Always run full verification (typecheck + lint)
12
+ - Report every error with file path and line number
13
+ - Auto-enter fix loop on any failure
14
+ - Maximum 10 fix iterations before escalating to user
15
+ - Never skip verification steps
16
+ - Clear reporting of gate status
17
+ ---
18
+
1
19
  # /verify - Verify Command
2
20
 
3
21
  Run TypeScript and ESLint verification with fix loop.
@@ -0,0 +1,20 @@
1
+ #!/bin/bash
2
+ # AutoWorkflow Post-Bash Router Hook
3
+ # Runs on: PostToolUse for Bash
4
+ # Purpose: Route bash commands to appropriate post-action hooks
5
+ #
6
+ # Routes:
7
+ # - git commit → post-commit.sh (BLUEPRINT update reminder)
8
+
9
+ # Get the command that was executed
10
+ TOOL_INPUT="$1"
11
+
12
+ # Check if this was a git commit command
13
+ if echo "$TOOL_INPUT" | grep -qE "git\s+commit"; then
14
+ # Route to post-commit hook
15
+ ./.claude/hooks/post-commit.sh
16
+ exit $?
17
+ fi
18
+
19
+ # No routing needed for other commands
20
+ exit 0
@@ -0,0 +1,140 @@
1
+ #!/bin/bash
2
+ # AutoWorkflow Post-Commit Hook
3
+ # Runs on: PostToolUse for Bash (when git commit detected)
4
+ # Purpose: Trigger BLUEPRINT.md update reminder after feature commits
5
+ #
6
+ # This hook implements the on:feature_complete trigger
7
+ # It reminds Claude to update BLUEPRINT.md after successful commits
8
+
9
+ # Colors
10
+ RED='\033[0;31m'
11
+ GREEN='\033[0;32m'
12
+ YELLOW='\033[1;33m'
13
+ CYAN='\033[0;36m'
14
+ BOLD='\033[1m'
15
+ DIM='\033[2m'
16
+ NC='\033[0m'
17
+
18
+ # State directory
19
+ STATE_DIR=".claude/.autoworkflow"
20
+
21
+ # State files
22
+ PHASE_FILE="$STATE_DIR/phase"
23
+ TASK_TYPE_FILE="$STATE_DIR/task-type"
24
+
25
+ # Get task type
26
+ get_task_type() {
27
+ if [ -f "$TASK_TYPE_FILE" ]; then
28
+ cat "$TASK_TYPE_FILE"
29
+ else
30
+ echo "unknown"
31
+ fi
32
+ }
33
+
34
+ # Check if task type requires BLUEPRINT update
35
+ requires_blueprint_update() {
36
+ local task_type="$1"
37
+ case "$task_type" in
38
+ feature|refactor)
39
+ return 0
40
+ ;;
41
+ *)
42
+ return 1
43
+ ;;
44
+ esac
45
+ }
46
+
47
+ # Reset workflow state after commit
48
+ reset_workflow() {
49
+ echo "IDLE" > "$PHASE_FILE"
50
+ rm -f "$STATE_DIR/verify-iteration" 2>/dev/null
51
+ rm -f "$STATE_DIR/verify-status" 2>/dev/null
52
+ rm -f "$STATE_DIR/plan-approved" 2>/dev/null
53
+ rm -f "$STATE_DIR/changed-files" 2>/dev/null
54
+ rm -f "$STATE_DIR/session-resumed" 2>/dev/null
55
+ }
56
+
57
+ # Get last commit info
58
+ get_commit_info() {
59
+ local commit_type=$(git log -1 --pretty=%s 2>/dev/null | cut -d'(' -f1 | cut -d':' -f1)
60
+ local commit_scope=$(git log -1 --pretty=%s 2>/dev/null | sed -n 's/.*(\([^)]*\)).*/\1/p')
61
+ local commit_msg=$(git log -1 --pretty=%s 2>/dev/null)
62
+ local commit_hash=$(git log -1 --pretty=%h 2>/dev/null)
63
+ local files_changed=$(git diff-tree --no-commit-id --name-only -r HEAD 2>/dev/null | wc -l | tr -d ' ')
64
+
65
+ echo "$commit_type|$commit_scope|$commit_msg|$commit_hash|$files_changed"
66
+ }
67
+
68
+ # Main execution
69
+ main() {
70
+ local task_type=$(get_task_type)
71
+ local commit_info=$(get_commit_info)
72
+ local commit_type=$(echo "$commit_info" | cut -d'|' -f1)
73
+ local commit_scope=$(echo "$commit_info" | cut -d'|' -f2)
74
+ local commit_msg=$(echo "$commit_info" | cut -d'|' -f3)
75
+ local commit_hash=$(echo "$commit_info" | cut -d'|' -f4)
76
+ local files_changed=$(echo "$commit_info" | cut -d'|' -f5)
77
+
78
+ echo ""
79
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
80
+ echo -e "${GREEN}${BOLD}✅ AUTOWORKFLOW: COMMIT COMPLETE${NC}"
81
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
82
+ echo ""
83
+ echo -e " ${CYAN}Hash:${NC} $commit_hash"
84
+ echo -e " ${CYAN}Message:${NC} $commit_msg"
85
+ echo -e " ${CYAN}Files:${NC} $files_changed changed"
86
+ echo ""
87
+
88
+ # Check if BLUEPRINT update is needed
89
+ if requires_blueprint_update "$task_type" || [ "$commit_type" = "feat" ] || [ "$commit_type" = "refactor" ]; then
90
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
91
+ echo -e "${YELLOW}${BOLD}📘 AUTOWORKFLOW: UPDATE PHASE${NC}"
92
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
93
+ echo ""
94
+ echo "This commit may have added new features/routes/APIs."
95
+ echo ""
96
+ echo -e "${BOLD}Check if BLUEPRINT.md needs updating:${NC}"
97
+ echo ""
98
+ echo " 1. New routes/pages added?"
99
+ echo " 2. New API endpoints added?"
100
+ echo " 3. New features/components added?"
101
+ echo " 4. Existing features modified?"
102
+ echo ""
103
+
104
+ # Check what might have changed
105
+ local new_routes=$(git diff-tree --no-commit-id --name-only -r HEAD 2>/dev/null | grep -E "(pages|app|routes)" | head -3)
106
+ local new_apis=$(git diff-tree --no-commit-id --name-only -r HEAD 2>/dev/null | grep -E "(api|endpoints|routes)" | head -3)
107
+ local new_components=$(git diff-tree --no-commit-id --name-only -r HEAD 2>/dev/null | grep -E "components" | head -3)
108
+
109
+ if [ -n "$new_routes" ]; then
110
+ echo -e "${DIM}Potential new routes:${NC}"
111
+ echo "$new_routes" | while read f; do echo -e " ${DIM}- $f${NC}"; done
112
+ echo ""
113
+ fi
114
+
115
+ if [ -n "$new_apis" ]; then
116
+ echo -e "${DIM}Potential new APIs:${NC}"
117
+ echo "$new_apis" | while read f; do echo -e " ${DIM}- $f${NC}"; done
118
+ echo ""
119
+ fi
120
+
121
+ if [ -n "$new_components" ]; then
122
+ echo -e "${DIM}Potential new components:${NC}"
123
+ echo "$new_components" | while read f; do echo -e " ${DIM}- $f${NC}"; done
124
+ echo ""
125
+ fi
126
+
127
+ echo -e "${BOLD}Action:${NC} Review and update instructions/BLUEPRINT.md if needed."
128
+ echo ""
129
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
130
+ fi
131
+
132
+ # Reset workflow state
133
+ reset_workflow
134
+
135
+ echo ""
136
+ echo -e "${GREEN}Workflow complete. Ready for next task.${NC}"
137
+ echo ""
138
+ }
139
+
140
+ main
@@ -86,27 +86,42 @@ print_header() {
86
86
  echo ""
87
87
  }
88
88
 
89
- # Run verification
90
- run_verify() {
89
+ # Detect project type
90
+ detect_project_type() {
91
+ if [ -f "package.json" ]; then
92
+ echo "node"
93
+ elif [ -f "composer.json" ]; then
94
+ echo "php"
95
+ elif [ -f "pyproject.toml" ] || [ -f "requirements.txt" ] || [ -f "setup.py" ]; then
96
+ echo "python"
97
+ elif [ -f "Cargo.toml" ]; then
98
+ echo "rust"
99
+ elif [ -f "go.mod" ]; then
100
+ echo "go"
101
+ elif [ -f "Gemfile" ]; then
102
+ echo "ruby"
103
+ elif [ -f "build.gradle" ] || [ -f "pom.xml" ]; then
104
+ echo "java"
105
+ else
106
+ echo "unknown"
107
+ fi
108
+ }
109
+
110
+ # Run verification for Node.js projects
111
+ run_verify_node() {
91
112
  local has_verify=false
92
113
  local has_typecheck=false
93
114
  local has_lint=false
94
115
 
95
- # Check what scripts are available
96
- if [ -f "package.json" ]; then
97
- grep -q '"verify"' package.json 2>/dev/null && has_verify=true
98
- grep -q '"typecheck"' package.json 2>/dev/null && has_typecheck=true
99
- grep -q '"lint"' package.json 2>/dev/null && has_lint=true
100
- fi
116
+ grep -q '"verify"' package.json 2>/dev/null && has_verify=true
117
+ grep -q '"typecheck"' package.json 2>/dev/null && has_typecheck=true
118
+ grep -q '"lint"' package.json 2>/dev/null && has_lint=true
101
119
 
102
120
  if [ "$has_verify" = true ]; then
103
121
  echo -e "${CYAN}Running:${NC} npm run verify"
104
122
  echo ""
105
- if npm run verify 2>&1; then
106
- return 0
107
- else
108
- return 1
109
- fi
123
+ npm run verify 2>&1
124
+ return $?
110
125
  elif [ "$has_typecheck" = true ] || [ "$has_lint" = true ]; then
111
126
  local exit_code=0
112
127
 
@@ -126,11 +141,169 @@ run_verify() {
126
141
  fi
127
142
 
128
143
  return $exit_code
129
- else
130
- echo -e "${YELLOW}⚠${NC} No verify/typecheck/lint scripts found in package.json"
131
- echo " Skipping verification."
132
- return 0
133
144
  fi
145
+ return 0
146
+ }
147
+
148
+ # Run verification for PHP projects
149
+ run_verify_php() {
150
+ local exit_code=0
151
+
152
+ # Check for PHPStan
153
+ if [ -f "phpstan.neon" ] || [ -f "phpstan.neon.dist" ] || grep -q '"phpstan"' composer.json 2>/dev/null; then
154
+ echo -e "${CYAN}Running:${NC} ./vendor/bin/phpstan analyse"
155
+ if ! ./vendor/bin/phpstan analyse 2>&1; then
156
+ exit_code=1
157
+ fi
158
+ fi
159
+
160
+ # Check for PHP CS Fixer or PHP_CodeSniffer
161
+ if [ -f ".php-cs-fixer.php" ] || [ -f ".php-cs-fixer.dist.php" ]; then
162
+ echo ""
163
+ echo -e "${CYAN}Running:${NC} ./vendor/bin/php-cs-fixer fix --dry-run --diff"
164
+ if ! ./vendor/bin/php-cs-fixer fix --dry-run --diff 2>&1; then
165
+ exit_code=1
166
+ fi
167
+ elif [ -f "phpcs.xml" ] || [ -f "phpcs.xml.dist" ]; then
168
+ echo ""
169
+ echo -e "${CYAN}Running:${NC} ./vendor/bin/phpcs"
170
+ if ! ./vendor/bin/phpcs 2>&1; then
171
+ exit_code=1
172
+ fi
173
+ fi
174
+
175
+ # Check for composer scripts
176
+ if grep -q '"test"' composer.json 2>/dev/null; then
177
+ echo ""
178
+ echo -e "${CYAN}Running:${NC} composer test"
179
+ if ! composer test 2>&1; then
180
+ exit_code=1
181
+ fi
182
+ fi
183
+
184
+ if [ $exit_code -eq 0 ] && ! grep -q '"phpstan"' composer.json 2>/dev/null && ! [ -f ".php-cs-fixer.php" ] && ! [ -f "phpcs.xml" ]; then
185
+ echo -e "${YELLOW}⚠${NC} No PHP verification tools detected (PHPStan, PHP-CS-Fixer, PHPCS)"
186
+ echo " Consider adding: composer require --dev phpstan/phpstan"
187
+ fi
188
+
189
+ return $exit_code
190
+ }
191
+
192
+ # Run verification for Python projects
193
+ run_verify_python() {
194
+ local exit_code=0
195
+
196
+ # Check for mypy
197
+ if [ -f "mypy.ini" ] || [ -f "setup.cfg" ] || [ -f "pyproject.toml" ]; then
198
+ if command -v mypy &> /dev/null; then
199
+ echo -e "${CYAN}Running:${NC} mypy ."
200
+ if ! mypy . 2>&1; then
201
+ exit_code=1
202
+ fi
203
+ fi
204
+ fi
205
+
206
+ # Check for ruff or flake8
207
+ if command -v ruff &> /dev/null; then
208
+ echo ""
209
+ echo -e "${CYAN}Running:${NC} ruff check ."
210
+ if ! ruff check . 2>&1; then
211
+ exit_code=1
212
+ fi
213
+ elif command -v flake8 &> /dev/null; then
214
+ echo ""
215
+ echo -e "${CYAN}Running:${NC} flake8 ."
216
+ if ! flake8 . 2>&1; then
217
+ exit_code=1
218
+ fi
219
+ fi
220
+
221
+ if [ $exit_code -eq 0 ] && ! command -v mypy &> /dev/null && ! command -v ruff &> /dev/null; then
222
+ echo -e "${YELLOW}⚠${NC} No Python verification tools detected (mypy, ruff, flake8)"
223
+ echo " Consider adding: pip install mypy ruff"
224
+ fi
225
+
226
+ return $exit_code
227
+ }
228
+
229
+ # Run verification for Rust projects
230
+ run_verify_rust() {
231
+ local exit_code=0
232
+
233
+ echo -e "${CYAN}Running:${NC} cargo check"
234
+ if ! cargo check 2>&1; then
235
+ exit_code=1
236
+ fi
237
+
238
+ echo ""
239
+ echo -e "${CYAN}Running:${NC} cargo clippy"
240
+ if ! cargo clippy -- -D warnings 2>&1; then
241
+ exit_code=1
242
+ fi
243
+
244
+ return $exit_code
245
+ }
246
+
247
+ # Run verification for Go projects
248
+ run_verify_go() {
249
+ local exit_code=0
250
+
251
+ echo -e "${CYAN}Running:${NC} go build ./..."
252
+ if ! go build ./... 2>&1; then
253
+ exit_code=1
254
+ fi
255
+
256
+ echo ""
257
+ echo -e "${CYAN}Running:${NC} go vet ./..."
258
+ if ! go vet ./... 2>&1; then
259
+ exit_code=1
260
+ fi
261
+
262
+ if command -v golangci-lint &> /dev/null; then
263
+ echo ""
264
+ echo -e "${CYAN}Running:${NC} golangci-lint run"
265
+ if ! golangci-lint run 2>&1; then
266
+ exit_code=1
267
+ fi
268
+ fi
269
+
270
+ return $exit_code
271
+ }
272
+
273
+ # Run verification based on project type
274
+ run_verify() {
275
+ local project_type=$(detect_project_type)
276
+
277
+ echo -e "${DIM}Detected project type: ${project_type}${NC}"
278
+ echo ""
279
+
280
+ case "$project_type" in
281
+ node)
282
+ run_verify_node
283
+ return $?
284
+ ;;
285
+ php)
286
+ run_verify_php
287
+ return $?
288
+ ;;
289
+ python)
290
+ run_verify_python
291
+ return $?
292
+ ;;
293
+ rust)
294
+ run_verify_rust
295
+ return $?
296
+ ;;
297
+ go)
298
+ run_verify_go
299
+ return $?
300
+ ;;
301
+ *)
302
+ echo -e "${YELLOW}⚠${NC} Unknown project type - no verification available"
303
+ echo " Supported: Node.js, PHP, Python, Rust, Go"
304
+ return 0
305
+ ;;
306
+ esac
134
307
  }
135
308
 
136
309
  # Main execution