Skip to content

Commit 7f3b41a

Browse files
committed
Refactor testing commands in Taskfile.yml for improved clarity and organization. Consolidate smoke tests and add new linting, type checking, and unit test tasks in qa/Taskfile.yml. Update founder_rules.mdc to include critical guidelines for Git operations.
1 parent 2be15f9 commit 7f3b41a

File tree

4 files changed

+134
-50
lines changed

4 files changed

+134
-50
lines changed

.cursor/commands/founder/Taskfile.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,25 +67,3 @@ tasks:
6767
- cd ../../backend && encore db reset
6868
- echo "✅ Database reset complete"
6969
silent: false
70-
71-
# Testing
72-
testing:smoke:
73-
desc: "Run all smoke tests"
74-
cmds:
75-
- task: qa:smoke:backend
76-
- task: qa:smoke:frontend
77-
silent: false
78-
79-
testing:backend:
80-
desc: "Run backend tests"
81-
cmds:
82-
- echo "🧪 Running backend tests..."
83-
- cd ../../backend && encore test
84-
silent: false
85-
86-
testing:frontend:
87-
desc: "Run frontend tests"
88-
cmds:
89-
- echo "🧪 Running frontend tests..."
90-
- cd ../../frontend && bun test
91-
silent: false

.cursor/commands/qa/Taskfile.yml

Lines changed: 107 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,128 @@
11
version: '3'
22

33
# QA commands
4-
# Testing and quality assurance tasks
4+
# Consolidated testing and quality assurance tasks
55

66
tasks:
7+
# Smoke tests (parallel health checks)
8+
smoke:
9+
desc: "Health checks for all services"
10+
cmds:
11+
- echo "🧪 Running smoke tests..."
12+
- |
13+
BACKEND_FAIL=0
14+
FRONTEND_FAIL=0
15+
16+
curl -sf http://localhost:${BACKEND_PORT:-4000}/health > /dev/null && echo "✅ Backend healthy" || { echo "❌ Backend smoke test failed"; BACKEND_FAIL=1; } &
17+
PID_BACKEND=$!
18+
19+
curl -sf http://localhost:${FRONTEND_PORT:-5173} > /dev/null && echo "✅ Frontend healthy" || { echo "❌ Frontend smoke test failed"; FRONTEND_FAIL=1; } &
20+
PID_FRONTEND=$!
21+
22+
wait $PID_BACKEND || BACKEND_FAIL=1
23+
wait $PID_FRONTEND || FRONTEND_FAIL=1
24+
25+
if [ $BACKEND_FAIL -eq 0 ] && [ $FRONTEND_FAIL -eq 0 ]; then
26+
echo "✅ All smoke tests passed"
27+
exit 0
28+
else
29+
echo "❌ Some smoke tests failed"
30+
exit 1
31+
fi
32+
silent: false
33+
734
smoke:backend:
8-
desc: "Run backend smoke tests"
35+
desc: "Backend health check only"
936
cmds:
10-
- echo "🧪 Running backend smoke tests..."
11-
- echo " Testing backend health endpoint..."
37+
- echo "🧪 Testing backend health..."
1238
- curl -f http://localhost:${BACKEND_PORT:-4000}/health || (echo "❌ Backend smoke test failed" && exit 1)
13-
- echo "✅ Backend smoke tests passed"
39+
- echo "✅ Backend smoke test passed"
1440
silent: false
1541

1642
smoke:frontend:
17-
desc: "Run frontend smoke tests"
43+
desc: "Frontend availability check only"
1844
cmds:
19-
- echo "🧪 Running frontend smoke tests..."
20-
- echo " Testing frontend accessibility..."
45+
- echo "🧪 Testing frontend availability..."
2146
- curl -f http://localhost:${FRONTEND_PORT:-5173} > /dev/null || (echo "❌ Frontend smoke test failed" && exit 1)
22-
- echo "✅ Frontend smoke tests passed"
47+
- echo "✅ Frontend smoke test passed"
48+
silent: false
49+
50+
# Static analysis
51+
lint:
52+
desc: "Lint both services"
53+
cmds:
54+
- echo "🔍 Linting backend..."
55+
- cd ../../../backend && bunx biome lint .
56+
- echo "🔍 Linting frontend..."
57+
- cd ../../../frontend && bunx biome lint .
58+
- echo "✅ Linting complete"
59+
silent: false
60+
61+
typecheck:
62+
desc: "TypeScript checking for both services"
63+
cmds:
64+
- echo "🔍 Type checking frontend..."
65+
- cd ../../../frontend && bun run check
66+
- echo "✅ Frontend types valid"
67+
silent: false
68+
69+
# Unit tests
70+
unit:backend:
71+
desc: "Backend unit tests"
72+
cmds:
73+
- echo "🧪 Running backend unit tests..."
74+
- cd ../../../backend && encore test
75+
silent: false
76+
77+
unit:frontend:
78+
desc: "Frontend unit tests"
79+
cmds:
80+
- echo "⚠️ No frontend unit tests configured yet"
81+
- echo " Frontend uses Playwright for E2E tests (use qa:e2e)"
82+
silent: false
83+
84+
unit:
85+
desc: "All unit tests (backend only, frontend has no unit tests)"
86+
cmds:
87+
- task: unit:backend
88+
- echo "Note - Frontend has no unit tests (uses E2E tests instead)"
89+
silent: false
90+
91+
# E2E tests
92+
e2e:
93+
desc: "Frontend E2E tests (headless)"
94+
cmds:
95+
- echo "🧪 Running E2E tests..."
96+
- cd ../../../frontend && bun run test:e2e
97+
silent: false
98+
99+
e2e:headed:
100+
desc: "Frontend E2E tests (headed mode)"
101+
cmds:
102+
- echo "🧪 Running E2E tests (headed)..."
103+
- cd ../../../frontend && bun run test:e2e:headed
23104
silent: false
24105

25-
smoke:all:
26-
desc: "Run all smoke tests"
106+
e2e:ui:
107+
desc: "Playwright UI mode"
27108
cmds:
28-
- task: smoke:backend
29-
- task: smoke:frontend
109+
- echo "🎭 Opening Playwright UI..."
110+
- cd ../../../frontend && bun run test:e2e:ui
30111
silent: false
31112

113+
# Complete test suite
114+
all:
115+
desc: "Complete test suite (smoke + lint + typecheck + unit + e2e)"
116+
cmds:
117+
- task: smoke
118+
- task: lint
119+
- task: typecheck
120+
- task: unit
121+
- task: e2e
122+
- echo "🎉 All tests passed!"
123+
silent: false
124+
125+
# Appium (mobile testing)
32126
appium:start:
33127
desc: "Start Appium server"
34128
cmds:
@@ -44,10 +138,3 @@ tasks:
44138
- lsof -ti:${APPIUM_PORT:-4723} 2>/dev/null | xargs kill -9 2>/dev/null || true
45139
- echo "✅ Appium server stopped"
46140
silent: false
47-
48-
e2e:
49-
desc: "Run end-to-end tests"
50-
cmds:
51-
- echo "🧪 Running E2E tests..."
52-
- cd ../../backend && bun run test:e2e
53-
silent: false

.cursor/rules/founder_rules.mdc

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ description: "Non-negotiable development standards for ScreenGraph. Enforces arc
3131
15. [Single Environment Execution](#single-environment-execution)
3232
16. [Worktree Usage](#worktree-usage)
3333
17. [Standard Ports](#standard-ports)
34-
18. [Cursor Modes](#cursor-dropdown-modes)
35-
19. [Enforcement Rules](#enforcement-what-agents-cannot-do)
34+
18. [Git Operations](#git-operations)
35+
19. [Cursor Modes](#cursor-dropdown-modes)
36+
20. [Enforcement Rules](#enforcement-what-agents-cannot-do)
3637

3738
---
3839

@@ -341,6 +342,23 @@ cd frontend && bun run dev # Service-specific when needed
341342
- Scripts `./automation/scripts/dev-backend.sh` and `./automation/scripts/dev-frontend.sh` respect `.env` values.
342343
- Husky/CI always start services on the standard ports defined above.
343344

345+
### Git Operations
346+
347+
**CRITICAL: Git commits and pushes require explicit founder approval**
348+
349+
- ❌ **NEVER commit changes** unless the founder explicitly says "commit" or "commit this" in the prompt
350+
- ❌ **NEVER push changes** unless the founder explicitly says "push" or "push this" in the prompt
351+
- ❌ **NEVER run `git commit`** proactively, even if you think the work is complete
352+
- ❌ **NEVER stage files** (`git add`) unless explicitly requested
353+
354+
**Rationale:**
355+
- The founder controls when code is committed to history
356+
- Commits are permanent and must be intentional
357+
- AI agents should implement changes, not decide when they're "done"
358+
- Pre-commit hooks may have side effects that need manual oversight
359+
360+
**Violation:** If you commit or push without explicit founder approval, you are being too proactive and overstepping boundaries.
361+
344362
---
345363

346-
**Last Updated**: 2025-11-07
364+
**Last Updated**: 2025-11-09

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
"dev:backend": "BACKEND_PORT=${BACKEND_PORT:-4000} turbo run dev --filter=screengraph-backend",
1313
"dev:frontend": "FRONTEND_PORT=${FRONTEND_PORT:-5173} turbo run dev --filter=screengraph-frontend",
1414
"task": "cd .cursor && task",
15-
"qa:smoke": "cd .cursor && task qa:smoke:all",
16-
"qa:smoke:frontend": "cd .cursor && task qa:smoke:frontend",
17-
"qa:smoke:backend": "cd .cursor && task qa:smoke:backend",
18-
"lint": "cd .cursor && task frontend:lint",
19-
"typecheck": "cd .cursor && task frontend:typecheck",
15+
"qa": "cd .cursor && task qa:all",
16+
"qa:smoke": "cd .cursor && task qa:smoke",
17+
"qa:lint": "cd .cursor && task qa:lint",
18+
"qa:typecheck": "cd .cursor && task qa:typecheck",
19+
"qa:unit": "cd .cursor && task qa:unit",
20+
"qa:e2e": "cd .cursor && task qa:e2e",
2021
"test:e2e": "turbo run test:e2e --filter=screengraph-frontend",
2122
"test:e2e:headed": "turbo run test:e2e:headed --filter=screengraph-frontend",
2223
"test:e2e:ci": "turbo run test:e2e:ci --filter=screengraph-frontend",

0 commit comments

Comments
 (0)