MANDATORY post-development workflow orchestrating validation, synchronization, and testing phases. Automatically invoked by AI agents after code changes. BLOCKING - work is incomplete without this.
Instrucciones de origen · Vista previa de solo lectura
name
post-dev-workflow
description
MANDATORY post-development workflow orchestrating validation, synchronization, and testing phases. Automatically invoked by AI agents after code changes. BLOCKING - work is incomplete without this.
version
2.0.0
author
SublinkPro Team
user-invocable
false
mandatory
true
enforcement-level
blocking
Post-Development Workflow Skill
🛑 MANDATORY AUTOMATED WORKFLOW 🛑
This workflow is REQUIRED after completing ANY code change, before declaring work "complete".
CRITICAL: This workflow is a PREREQUISITE for committing. Do NOT proceed to commit without completing this workflow successfully.
When to Use This Skill
ALWAYS use this skill when:
Any code change is complete (backend, frontend, or both)
Before declaring work "finished" or "done"
Before preparing to commit changes
Before creating or updating a pull request
This is NOT optional for AI agents. If an AI agent completes development without running this workflow, the work is incomplete.
Workflow Phases
This skill orchestrates multiple validation phases in sequence:
Development Complete
↓
1. Code Validation (lint, format, build)
↓
2. Cross-Layer Sync Check (if multi-layer change)
↓
3. Documentation Sync Check (if behavior/API/config changed)
↓
4. Test Execution (if key logic changed)
↓
5. Change Summary (prepare commit message and PR description)
↓
Stage Changes (git add)
↓
Present Summary to User
↓
User Verifies/Tests
↓
User Commits When Ready
Phase 1: Code Validation
Run validation commands for all changed layers.
Backend Changes
gofmt -w <changed-files> # Format
golangci-lint run # Lint
go test ./... # Test
Required exit criteria:
gofmt produces no further changes
golangci-lint run exits with status 0
Relevant go test passes
Frontend Changes
cd webs
yarn run lint # Always required
yarn run build # If routing/assets/build affected
Optional auto-fix:
yarn run lint:fix
yarn run prettier
Required exit criteria:
yarn run lint exits with status 0
yarn run build succeeds (if applicable)
When Phase 1 Fails
DO NOT proceed to Phase 2 until all validation passes. Fix issues first.
Detailed validation commands and troubleshooting: See references/validation-commands.md
Both English (.md) and Chinese (.zh-CN.md) versions updated
Language switch links work
Content semantically equivalent
Required exit criteria:
All affected documentation identified
Both language versions updated
Links verified (no broken references)
Code examples accurate and tested
Documentation map updated (skill-sublinkpro/reference/docs.md) if new docs added
When to Skip Phase 3
Skip only if:
Pure internal refactoring (no user-visible changes)
Bug fix that restores documented behavior (not new behavior)
Test-only changes
Document the skip reason in your change summary.
Detailed documentation sync patterns and templates: See references/documentation-sync-rules.md
Phase 4: Test Execution
Trigger condition: Changes affect key business logic, APIs, permissions, configuration semantics, migrations, scheduled tasks, mihomo integrations, protocol parsing, or data transformations
What Needs Tests
Backend tests required when:
Added or changed business logic in services/
Added or changed API handler in api/
Added or changed permission checks in middlewares/
Added or changed database migration in models/db_migrate.go
Added or changed scheduled task in services/scheduler/
Added or changed protocol in node/protocol/
Fixed a bug (add regression test)
Frontend tests:
Added or changed utility functions in webs/src/utils/
Added or changed complex components with business logic
Added or changed API client functions in webs/src/api/
Fixed a bug (add regression test)
Test Requirements
# Backend: run relevant tests
go test ./services/scheduler/... # Example: if scheduler changed
go test ./... # Full suite if time permits# Frontend: run tests with Vitestcd webs
yarn test# Run all tests
yarn test --run # Run without watch mode
Test quality:
Tests cover happy path, boundaries, and error cases
Tests are isolated (no execution order dependency)
Test names describe scenario and expected outcome
Regression tests added for bug fixes
Required exit criteria:
Relevant tests exist
All tests pass
Coverage is reasonable for the changed area
When to Skip Phase 4
Skip only if:
Pure documentation changes
Pure UI styling changes (no logic)
Refactoring with existing test coverage
Document the skip reason in your change summary.
Phase 5: Change Summary
Prepare a comprehensive summary of what was done, why, and how it was validated.
Scope: Component area (e.g., airports, auth, theme, i18n, scheduler)
Subject: Concise description (≤72 chars, imperative mood, no period)
Examples
feat(airports): add batch subscription update
Added batch update dialog with progress tracking.
Users can now select multiple airports and update them in parallel.
Closes #123
Changes staged and ready for user verification (DO NOT auto-commit)
❌ Cannot declare work complete when:
Validation commands fail
Documentation out of sync with code
Cross-layer changes not synchronized
Tests missing or failing
Change summary incomplete
Pre-commit-check not invoked or failed
For AI Agents: Automation Notes
This workflow should be automatically triggered after completing code development, without waiting for user prompt.
Triggering Logic
IF code_change_complete:
INVOKE .agents/skills/post-dev-workflow/SKILL.md
RUN Phase 1 (validation)
IF multi_layer_change:
RUN Phase 2 (cross-layer sync)
IF behavior_or_api_or_config_changed:
RUN Phase 3 (documentation sync)
IF key_logic_changed:
RUN Phase 4 (test execution)
RUN Phase 5 (change summary)
🛑 RUN Phase 6 (pre-commit-check) - MANDATORY, NO EXCEPTIONS
REPORT results to user
IF all_phases_pass:
STAGE changes (git add)
PRESENT summary to user
WAIT for user verification/testing
DO NOT auto-commit
ELSE:
FIX failures and re-run
Critical Rule: Phase 6 is Non-Negotiable
Phase 6 (pre-commit-check) MUST be invoked before any git add/commit, even if:
Or if Phase 6 was skipped (THIS SHOULD NEVER HAPPEN):
## ❌ CRITICAL ERROR: Pre-Commit Validation Skipped
Phase 6 (pre-commit-check) was not invoked. This is a MANDATORY step.
Invoking pre-commit-check now...
Anti-Patterns to Avoid
❌ Skipping validation because "it's a small change"
Small changes still need lint/format/test
❌ Updating only English docs and forgetting Chinese versions
Both languages must be updated together
❌ Changing backend API without updating frontend
Cross-layer sync is mandatory
❌ Declaring work "done" without running this workflow
This workflow IS part of "done"
❌ Running validation but not fixing failures
All validation must pass before proceeding
❌ Updating code without updating documentation
Documentation is part of the deliverable
❌ Auto-committing without user verification
Stage changes and let user verify/test before committing
❌ Committing without a proper change summary
Reviewers and future maintainers need context
Related Skills
.agents/skills/pre-commit-check/SKILL.md - Detailed pre-commit checklist (subset of this workflow)