/verify-task $ARGUMENTS
You are running the quality gate before wrap-up. Check everything, report results, and fix issues.
Step 1 — Resolve $ARGUMENTS and identify scope
$ARGUMENTS may be either a Jira task ID or a path to a plan file. Normalize first and produce two values: <task_id> and <plan_file>.
If $ARGUMENTS contains / or ends with .md — treat it as a plan file path:
<plan_file>=$ARGUMENTS(verify the file exists; if not, STOP and report the bad path)<task_id>= the firstMLID-\d+token found in the filename. If none, STOP and ask for the task ID explicitly.
Otherwise — treat $ARGUMENTS as a Jira task ID:
<task_id>=$ARGUMENTS<plan_file>= the result of globbingdocs/agomez/plans/<task_id>*.md. If zero matches, STOP and tell the user to run/plan-task <task_id>first. If multiple matches, STOP and ask the user to pass the explicit plan file path.
Use <task_id> for commit messages and the report header. Use <plan_file> to determine the base branch.
Determine changed files:
git diff --name-only <base-branch>...HEAD
Where <base-branch> is:
developfor standalone tasksepic/MLID-XXXX-*for epic sub-tasks (read from<plan_file>)
Store the list of changed files — all subsequent checks target only these files.
Step 2 — Run checks
Run the following checks. For each, record pass or fail.
2a. Tests
cd apps/web && npx jest --no-coverage
Run the full test suite (not just changed files) to catch regressions.
2b. Type checking
cd apps/web && npx tsc --noEmit
2c. Prettier (changed files only)
cd apps/web && npx prettier --check <changed-files>
If files need formatting:
cd apps/web && npx prettier --write <changed-files>
2d. ESLint (changed files only)
cd apps/web && npx eslint <changed-files>
If auto-fixable issues found:
cd apps/web && npx eslint --fix <changed-files>
2e. Code quality scan
Search changed files for violations:
console.logorconsole.warnorconsole.error— should useloggerinstead: anyoras any— should use proper types- Leftover debug code,
TODOcomments from this task,debuggerstatements
2f. Test coverage (changed source files only)
For each changed .ts/.tsx file (excluding test files) that has a corresponding test file:
cd apps/web && npx jest --coverage --collectCoverageFrom='<file-path>' --testPathPattern='<test-file>'
Check that line coverage is ≥ 80%.
Step 3 — Report results
Present a checklist:
## Quality Gate — <task_id>
- [x] Tests: all passing (N tests)
- [x] Types: no errors
- [x] Prettier: formatted (N files)
- [ ] ESLint: 2 warnings in xxx.ts
- [x] No console.log
- [x] No `any` types
- [x] Coverage: 87% on xxx.ts (threshold: 80%)
### Issues Found
- ESLint warning: unused import in `apps/web/xxx.ts:14`
Step 4 — Fix issues
If any checks failed:
- Fix the issues (formatting, lint, type errors)
- Re-run the failing checks to confirm they pass
- Commit the fixes:
[<task_id>] - chore(quality): fix lint/format/type issues - Update the checklist to show all passing
Important Rules
- Never run
npm run formatornpm run lintglobally — always target only changed files - Always run from
apps/web/for lint and type checks (tsconfig.eslint.json issue at root) - Auto-fix what you can — don't just report issues, fix them
- Commit fixes separately — quality fixes get their own commit, not mixed with feature code