validate-project
Run full CI validation for the current project directory
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Validate Project
Run complete pre-commit validation for the current project.
When to Use
- Before committing changes
- After major refactoring
- When CI is failing and you need to reproduce locally
- Before creating a pull request
Available Operations
- Go Validation: generate, tidy, fmt, lint, vet, test
- Frontend Validation: lint, format, type-check, test
- Clean Check: Verify no uncommitted changes from generation
Instructions
Step 1: Detect Project Type
Check for these indicators:
-
go.mod→ Go project -
package.jsoninui/→ Has frontend - Directory name → Project identification
Step 2: Go Validation (if applicable)
# 1. Generate code (if applicable)
if grep -q "go:generate" **/*.go 2>/dev/null; then
go generate ./...
fi
# 2. Tidy dependencies
go mod tidy
# 3. Format code
go fmt ./...
# 4. Lint (if config exists)
if [ -f .golangci.yml ] || [ -f .golangci.yaml ]; then
golangci-lint run
fi
# 5. Vet
go vet ./...
# 6. Test
go test -short ./...
Step 3: Frontend Validation (if applicable)
cd ui/user
pnpm run ci
Step 4: Clean Check
if [ -n "$(git status --porcelain)" ]; then
echo "ERROR: Uncommitted changes after generate/tidy"
git status --short
exit 1
fi
Resources
Load these Level 3 resources as needed:
-
scripts/validate.sh- Complete validation script (run directly) -
references/ci-pipeline.md- CI pipeline documentation
Examples
Example 1: Go Project
User asks: "Validate my changes before committing"
Response:
- Detect go.mod → Go project
- Run go generate, tidy, fmt, lint, vet, test
- Check for uncommitted changes
- Report status with ✓ or ✗ for each step
Example 2: Full-Stack Project (obot-entraid)
User asks: "Run full validation"
Response:
- Run Go validation in root
- Run frontend validation in ui/user
- Check for uncommitted changes
- Report combined status
Notes
- Stop on first failure for faster feedback
- Always run clean check last to catch generated file changes
- Use
--shortflag for tests to skip long-running integration tests
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!