Skill站外收录 @skilllib/skill-2117939930272417340
skill-git-workflow
自动创建符合规范的 git 提交,针对任务状态变更与产物生成进行细粒度版本控制,确保每次提交范围精准且消息格式统一,支持任务生命周期的可追溯管理。
开发运维 AI 技能
Skills.MD
# Git Workflow Skill
Create properly scoped git commits for task operations.
## Trigger Conditions
This skill activates when:
- Task status changes (research, plan, implement complete)
- Artifacts are created
- Task lifecycle operations occur
## Commit Message Formats
### Task Operations
| Operation | Format |
|-----------|--------|
| Create task | `task {N}: create {title}` |
| Complete research | `task {N}: complete research` |
| Create plan | `task {N}: create implementation plan` |
| Complete phase | `task {N} phase {P}: {phase_name}` |
| Complete task | `task {N}: complete implementation` |
| Revise plan | `task {N}: revise plan (v{V})` |
### System Operations
| Operation | Format |
|-----------|--------|
| Archive tasks | `todo: archive {N} completed tasks` |
| Error fixes | `errors: create fix plan for {N} errors` |
| Code review | `review: {scope} code review` |
| State sync | `sync: reconcile TODO.md and state.json` |
## Execution Flow
```
1. Receive commit request:
- operation_type
- task_number (if applicable)
- scope (files to include)
- message_template
2. Stage appropriate files:
- git add {scope}
3. Create commit:
- Format message
- Add co-author
- Execute commit
4. Verify success:
- Check exit code
- Log result
5. Return result
```
## Commit Scope Rules
### Task-Specific Commits
Include only task-related files:
```
.claude/specs/TODO.md
.claude/specs/state.json
.claude/specs/{N}_{SLUG}/**
```
### Implementation Commits
Include source files modified:
```
Logos/**/*.lean (for Lean tasks)
src/**/* (for general tasks)
```
### Phase Commits
Scope to phase changes only:
```
Files modified in that phase
Updated plan with phase status
```
## Safety Checks
### Before Commit
```
1. git status - verify staged files
2. Check no sensitive files staged (.env, credentials)
3. Verify commit message format
```
### Never Run
- `git push --force`
- `git reset --hard` (without explicit request)
- `git rebase -i`
## Message Template
```
{scope}: {action} {description}
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
```
## Execution Commands
### Standard Commit
```bash
git add {files}
git commit -m "$(cat <<'EOF'
{message}
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
EOF
)"
```
### Task Commit
```bash
git add .claude/specs/
git commit -m "$(cat <<'EOF'
task {N}: {action}
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
EOF
)"
```
## Return Format
```json
{
"status": "completed|failed",
"summary": "Created commit: {short_message}",
"commit_hash": "abc123",
"files_committed": [
"path/to/file1",
"path/to/file2"
],
"message": "Full commit message"
}
```
## Error Handling
### Nothing to Commit
```json
{
"status": "completed",
"summary": "No changes to commit",
"commit_hash": null
}
```
### Pre-Commit Hook Failure
```json
{
"status": "failed",
"error": "Pre-commit hook failed",
"recovery": "Fix issues and retry (do not use --no-verify)"
}
```
### Git Error
```json
{
"status": "failed",
"error": "Git command failed: {error}",
"recovery": "Check git status and resolve manually"
}
```
## Non-Blocking Behavior
Git failures should NOT block task operations:
- Log the failure
- Continue with task
- Report to user that commit failed
- Task state is preserved regardless
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「skill-git-workflow」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次