-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
457 lines (394 loc) · 14.2 KB
/
Taskfile.yml
File metadata and controls
457 lines (394 loc) · 14.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
# https://taskfile.dev
---
version: "3"
dotenv: [".env", ".env.local"]
includes:
backend:
taskfile: ./tasks/backend.yml
dir: backend
frontend:
taskfile: ./tasks/frontend.yml
dir: frontend
tasks:
default:
desc: "Show available tasks"
cmds: [task --list]
silent: true
dev:
desc: "Start backend + frontend in development mode"
deps:
- backend:dev
- frontend:dev
dev:backend:
desc: "Start backend only"
cmds:
- task: backend:dev
dev:frontend:
desc: "Start frontend only"
cmds:
- task: frontend:dev
# ── Testing ──────────────────────────────────────────────────
test:
desc: "Run default tests (backend unit + frontend unit)"
cmds:
- task: backend:test
- task: frontend:test:unit
test:unit:
desc: "Run unit tests only"
cmds:
- task: backend:test:unit
test:integration:
desc: "Run integration tests"
cmds:
- task: backend:test:integration
test:coverage:
desc: "Run tests with coverage reports"
cmds:
- task: backend:test:coverage
test:property:
desc: "Run property-based tests"
cmds:
- task: backend:test:property
test:performance:
desc: "Run performance benchmarks"
cmds:
- task: backend:test:performance
test:e2e:
desc: "Run end-to-end tests"
cmds:
- task: backend:test:e2e
test:frontend:
desc: "Run frontend tests (Vitest)"
cmds:
- task: frontend:test:unit
# ── Linting ──────────────────────────────────────────────────
lint:
desc: "Run all linters"
cmds:
- task: backend:lint
- task: frontend:lint
- task: lint:shell
- task: lint:yaml
- task: lint:spelling
- task: lint:duplicates
lint:python:
desc: "Lint Python code (ruff check + format check)"
cmds:
- task: backend:lint
- task: backend:format:check
lint:types:
desc: "Type check Python code"
cmds:
- task: backend:typecheck
lint:frontend:
desc: "Lint and type check frontend"
cmds:
- task: frontend:lint
- task: frontend:typecheck
lint:shell:
desc: "Lint shell scripts with ShellCheck"
cmds:
- cmd: shellcheck scripts/*.sh 2>/dev/null || true
lint:yaml:
desc: "Lint YAML files"
cmds:
- uvx yamllint -c .yamllint.yaml .
lint:spelling:
desc: "Check spelling with typos"
cmds:
- typos . 2>/dev/null || true
lint:duplicates:
desc: "Detect copy-paste code with jscpd"
cmds:
- bunx jscpd --config .jscpd.json . 2>/dev/null || true
lint:secrets:
desc: "Scan for leaked secrets"
cmds:
- cd backend && uv run detect-secrets scan --baseline ../.secrets.baseline
lint:markdown:
desc: "Lint Markdown files"
cmds:
- bunx markdownlint-cli2 '**/*.md' '#node_modules'
lint:links:
desc: "Check for broken links with lychee"
cmds:
- lychee --config .lychee.toml .
# ── Formatting ───────────────────────────────────────────────
format:
desc: "Format all code"
cmds:
- task: backend:format
- task: frontend:format
# ── Type checking ────────────────────────────────────────────
typecheck:
desc: "Run type checkers"
cmds:
- task: backend:typecheck
- task: frontend:typecheck
# ── Code quality ─────────────────────────────────────────────
xenon:
desc: "Cyclomatic complexity gate"
cmds:
- task: backend:xenon
check:
desc: "Full local quality gate (lint + test:unit + typecheck + xenon)"
cmds:
- task: lint
- task: test:unit
- task: typecheck
- task: xenon
ci:local:
desc: "Pre-push CI validation (mirrors GitHub Actions pipeline)"
cmds:
- task: lint
- task: typecheck
- task: test
- task: xenon
- task: security:scan
- task: pre-commit
# ── Architecture ─────────────────────────────────────────────
architecture:
desc: "Validate Clean Architecture import boundaries"
cmds:
- uv run python scripts/check_architecture_boundaries.py
# ── Pre-commit ───────────────────────────────────────────────
pre-commit:
desc: "Run pre-commit on all files"
cmds:
- uvx pre-commit run --all-files
# ── Database ─────────────────────────────────────────────────
db:migrate:
desc: "Run Alembic migrations"
cmds:
- task: backend:db:migrate
db:revision:
desc: "Create new Alembic migration"
cmds:
- task: backend:db:revision
db:downgrade:
desc: "Rollback last migration"
cmds:
- task: backend:db:downgrade
db:reset:
desc: "Delete SQLite DB and re-migrate"
cmds:
- cmd: rm -f backend/ekko.db
- task: backend:db:migrate
# ── Registry ─────────────────────────────────────────────────
registry:generate:
desc: "Generate registry constants from naming_registry.json"
dir: registry
cmds:
- uv run python generate_registry.py
# ── Installation ─────────────────────────────────────────────
install:
desc: "Install all project dependencies"
cmds:
- task: backend:install
- task: frontend:install
# ── Build ────────────────────────────────────────────────────
build:
desc: "Build frontend and backend for production"
cmds:
- task: frontend:build
- task: backend:build
build:exe:
desc: "Build standalone Windows EXE (frontend + PyInstaller)"
cmds:
- task: frontend:build
- cmd: cd backend && uv run pyinstaller --noconfirm ../ekko.spec
build:exe:debug:
desc: "Build standalone Windows EXE with debug logging"
cmds:
- task: frontend:build
- cmd: cd backend && uv run pyinstaller --noconfirm --log-level=DEBUG ../ekko.spec
# ── Containers ───────────────────────────────────────────────
docker:up:
desc: "Run local backend container stack"
cmds:
- docker compose -f docker/compose.yaml -f docker/compose.override.yaml up --build
docker:up:caddy:
desc: "Run local backend + Caddy HTTPS stack"
cmds:
- docker compose -f docker/compose.yaml -f docker/compose.override.yaml --profile caddy up --build
docker:down:
desc: "Stop local container stack"
cmds:
- docker compose -f docker/compose.yaml -f docker/compose.override.yaml down
# ── Security ─────────────────────────────────────────────────
security:audit:
desc: "Run security audits on all dependencies"
cmds:
- task: backend:security:audit
security:scan:
desc: "Run all security scans (Bandit + pip-audit + secrets)"
cmds:
- task: backend:security:bandit
- task: backend:security:audit
- task: lint:secrets
# ── Cleanup ──────────────────────────────────────────────────
clean:
desc: "Clean build artifacts and caches"
cmds:
- task: backend:clean
- task: frontend:clean
- cmd: rm -rf dist/ build/
# ── Versioning (Commitizen) ──────────────────────────────────
version-cz:
desc: "Show current version (commitizen)"
cmds:
- uv run cz version -p
changelog-cz:
desc: "Generate changelog (commitizen)"
cmds:
- uv run cz changelog
bump-cz:
desc: "Bump version with commitizen"
cmds:
- uv run cz bump --yes
# ══════════════════════════════════════════════════════════════════════════
# Tool Management (CodeRabbit, OpenSpec, Warp, GitNexus)
# ══════════════════════════════════════════════════════════════════════════
tools:openapi:generate:
desc: "Generate OpenAPI specification (JSON, YAML, HTML)"
cmds:
- uv run --project backend python tools/generate_openapi.py
tools:openapi:view:
desc: "Open generated OpenAPI documentation in browser"
cmds:
- cmd: open docs/api/index.html
platforms: [darwin]
- cmd: xdg-open docs/api/index.html
platforms: [linux]
- cmd: start docs/api/index.html
platforms: [windows]
tools:coderabbit:validate:
desc: "Validate CodeRabbit configuration"
cmds:
- |
if [ -f .coderabbit.yaml ]; then
echo "✓ CodeRabbit configuration found"
else
echo "✗ CodeRabbit configuration missing"
exit 1
fi
tools:gitnexus:validate:
desc: "Validate GitNexus configuration"
cmds:
- |
if [ -f .gitnexus/config.json ]; then
echo "✓ GitNexus configuration found (.gitnexus/config.json)"
else
echo "✗ GitNexus configuration missing"
exit 1
fi
tools:openspec:validate:
desc: "Validate OpenSpec configuration"
cmds:
- |
if [ -f .spectral.yaml ]; then
echo "✓ OpenSpec/Spectral configuration found (.spectral.yaml)"
else
echo "✗ OpenSpec/Spectral configuration missing"
exit 1
fi
tools:actionlint:validate:
desc: "Validate GitHub Actions workflows"
cmds:
- cmd: actionlint -color
ignore_error: true
- |
if command -v actionlint >/dev/null 2>&1; then
actionlint -color
else
echo "⚠ actionlint not installed locally (CI workflow will still validate workflows)"
fi
tools:warp:install:
desc: "Install Warp terminal configurations"
cmds:
- cmd: |
mkdir -p ~/.warp/launch_configurations
mkdir -p ~/.warp/workflows
cp .warp/launch_configurations/ekko.yaml ~/.warp/launch_configurations/
cp .warp/workflows/ekko-workflows.yaml ~/.warp/workflows/
echo "✓ Warp configurations installed (unix)"
platforms: [darwin, linux]
- cmd: |
echo "For Windows/WSL, use scripts/install/install-warp.zsh for best results."
echo "This ensures Warp + zsh/OMZ paths are configured consistently."
platforms: [windows]
tools:setup:
desc: "Setup all development tools (CodeRabbit, OpenSpec, Warp, GitNexus)"
cmds:
- task: tools:coderabbit:validate
- task: tools:gitnexus:validate
- task: tools:openspec:validate
- task: tools:actionlint:validate
- task: tools:openapi:generate
- task: tools:warp:install
- echo "✓ All tools configured successfully"
tools:status:
desc: "Check status of all configured tools"
cmds:
- |
echo "=== Tool Configuration Status ==="
echo ""
echo "CodeRabbit:"
if [ -f .coderabbit.yaml ]; then
echo " ✓ Configured (.coderabbit.yaml)"
else
echo " ✗ Not configured"
fi
echo ""
echo "GitNexus:"
if [ -f .gitnexus/config.json ]; then
echo " ✓ Configured (.gitnexus/config.json)"
else
echo " ✗ Not configured"
fi
echo ""
echo "OpenSpec:"
if [ -f .spectral.yaml ]; then
echo " ✓ Configured (.spectral.yaml)"
else
echo " ✗ Not configured"
fi
echo ""
echo "OpenAPI:"
if [ -f docs/api/openapi.json ]; then
echo " ✓ Generated (docs/api/)"
else
echo " ⚠ Not yet generated (run: task tools:openapi:generate)"
fi
echo ""
echo "Warp:"
if [ -f .warp/launch_configurations/ekko.yaml ]; then
echo " ✓ Project configs present"
else
echo " ✗ Not configured"
fi
echo ""
echo "VS Code:"
if [ -f .vscode/settings.json ]; then
echo " ✓ Configured (.vscode/settings.json)"
echo " ✓ Copilot settings present (verify model in Copilot Chat picker)"
else
echo " ✗ Not configured"
fi
# ══════════════════════════════════════════════════════════════════════════
# Pipeline Verification
# ══════════════════════════════════════════════════════════════════════════
verify:
desc: "Verify that CI/CD pipeline will pass before pushing"
cmds:
- cmd: bash scripts/verify-pipeline.sh
platforms: [darwin, linux]
- cmd: pwsh -NoProfile -File scripts/verify-pipeline.ps1
platforms: [windows]
verify:full:
desc: "Verify with full checks (longer-running tests)"
cmds:
- cmd: bash scripts/verify-pipeline.sh --full
platforms: [darwin, linux]
- cmd: pwsh -NoProfile -File scripts/verify-pipeline.ps1 -Full
platforms: [windows]