ck:git

GitHub

用于执行Git常规操作,包括暂存、提交、推送、创建PR及合并分支。支持按类型/范围自动拆分提交,并在提交前进行密钥安全扫描,确保代码规范与安全。

.opencode/skills/git/SKILL.md phuc-nt/my-translator

Trigger Scenarios

用户需要提交代码或推送更改 用户请求创建或合并Pull Request 用户询问Git操作流程或状态

Install

npx skills add phuc-nt/my-translator --skill ck:git -g -y
More Options

Non-standard path

npx skills add https://github.com/phuc-nt/my-translator/tree/main/.opencode/skills/git -g -y

Use without installing

npx skills use phuc-nt/my-translator@ck:git

指定 Agent (Claude Code)

npx skills add phuc-nt/my-translator --skill ck:git -a claude-code -g -y

安装 repo 全部 skill

npx skills add phuc-nt/my-translator --all -g -y

预览 repo 内 skill

npx skills add phuc-nt/my-translator --list

SKILL.md

Frontmatter
{
    "name": "ck:git",
    "metadata": {
        "author": "claudekit",
        "version": "1.0.0"
    },
    "description": "Git operations with conventional commits. Use for staging, committing, pushing, PRs, merges. Auto-splits commits by type\/scope. Security scans for secrets.",
    "argument-hint": "cm|cp|pr|merge [args]"
}

Git Operations

Default (No Arguments)

If invoked without arguments, use AskUserQuestion to present available git operations:

Operation Description
cm Stage files & create commits
cp Stage files, create commits and push
pr Create Pull Request
merge Merge branches

Present as options via AskUserQuestion with header "Git Operation", question "What would you like to do?".

Execute git workflows via git-manager subagent to isolate verbose output. Activate ck:context-engineering skill.

IMPORTANT:

  • Sacrifice grammar for the sake of concision.
  • Ensure token efficiency while maintaining high quality.
  • Pass these rules to subagents.

Arguments

  • cm: Stage files & create commits
  • cp: Stage files, create commits and push
  • pr: Create Pull Request [to-branch] [from-branch]
    • to-branch: Target branch (default: main)
    • from-branch: Source branch (default: current branch)
  • merge: Merge [to-branch] [from-branch]
    • to-branch: Target branch (default: main)
    • from-branch: Source branch (default: current branch)

Quick Reference

Task Reference
Commit references/workflow-commit.md
Push references/workflow-push.md
Pull Request references/workflow-pr.md
Merge references/workflow-merge.md
Standards references/commit-standards.md
Safety references/safety-protocols.md
Branches references/branch-management.md
GitHub CLI references/gh-cli-guide.md

Core Workflow

Step 1: Stage + Analyze

git add -A && git diff --cached --stat && git diff --cached --name-only

Step 2: Security Check

Scan for secrets before commit:

git diff --cached | grep -iE "(api[_-]?key|token|password|secret|credential)"

If secrets found: STOP, warn user, suggest .gitignore.

Step 3: Split Decision

NOTE:

  • Search for related issues on GitHub and add to body.
  • Only use feat, fix, or perf prefixes for files in .claude directory (do not use docs).

Split commits if:

  • Different types mixed (feat + fix, code + docs)
  • Multiple scopes (auth + payments)
  • Config/deps + code mixed
  • FILES > 10 unrelated

Single commit if:

  • Same type/scope, FILES ≤ 3, LINES ≤ 50

Step 4: Commit

git commit -m "type(scope): description"

Output Format

✓ staged: N files (+X/-Y lines)
✓ security: passed
✓ commit: HASH type(scope): description
✓ pushed: yes/no

Error Handling

Error Action
Secrets detected Block commit, show files
No changes Exit cleanly
Push rejected Suggest git pull --rebase
Merge conflicts Suggest manual resolution

References

  • references/workflow-commit.md - Commit workflow with split logic
  • references/workflow-push.md - Push workflow with error handling
  • references/workflow-pr.md - PR creation with remote diff analysis
  • references/workflow-merge.md - Branch merge workflow
  • references/commit-standards.md - Conventional commit format rules
  • references/safety-protocols.md - Secret detection, branch protection
  • references/branch-management.md - Naming, lifecycle, strategies
  • references/gh-cli-guide.md - GitHub CLI commands reference

Version History

  • 3495f99 Current 2026-07-25 07:19

Same Skill Collection

.opencode/skills/agent-browser/SKILL.md
.opencode/skills/ai-artist/SKILL.md
.opencode/skills/ai-multimodal/SKILL.md
.opencode/skills/ask/SKILL.md
.opencode/skills/backend-development/SKILL.md
.opencode/skills/better-auth/SKILL.md
.opencode/skills/bootstrap/SKILL.md
.opencode/skills/brainstorm/SKILL.md
.opencode/skills/chrome-devtools/SKILL.md
.opencode/skills/ck-autoresearch/SKILL.md
.opencode/skills/ck-debug/SKILL.md
.opencode/skills/ck-loop/SKILL.md
.opencode/skills/ck-plan/SKILL.md
.opencode/skills/ck-predict/SKILL.md
.opencode/skills/ck-scenario/SKILL.md
.opencode/skills/ck-security/SKILL.md
.opencode/skills/code-review/SKILL.md
.opencode/skills/coding-level/SKILL.md
.opencode/skills/context-engineering/SKILL.md
.opencode/skills/cook/SKILL.md
.opencode/skills/copywriting/SKILL.md
.opencode/skills/databases/SKILL.md
.opencode/skills/deploy/SKILL.md
.opencode/skills/devops/SKILL.md
.opencode/skills/docs-seeker/SKILL.md
.opencode/skills/docs/SKILL.md
.opencode/skills/fix/SKILL.md
.opencode/skills/frontend-design/SKILL.md
.opencode/skills/frontend-development/SKILL.md
.opencode/skills/gkg/SKILL.md
.opencode/skills/google-adk-python/SKILL.md
.opencode/skills/journal/SKILL.md
.opencode/skills/kanban/SKILL.md
.opencode/skills/llms/SKILL.md
.opencode/skills/markdown-novel-viewer/SKILL.md
.opencode/skills/mcp-builder/SKILL.md
.opencode/skills/mcp-management/SKILL.md
.opencode/skills/media-processing/SKILL.md
.opencode/skills/mermaidjs-v11/SKILL.md
.opencode/skills/mobile-development/SKILL.md
.opencode/skills/payment-integration/SKILL.md
.opencode/skills/plans-kanban/SKILL.md
.opencode/skills/preview/SKILL.md
.opencode/skills/problem-solving/SKILL.md
.opencode/skills/project-management/SKILL.md
.opencode/skills/project-organization/SKILL.md
.opencode/skills/react-best-practices/SKILL.md
.opencode/skills/remotion/SKILL.md
.opencode/skills/repomix/SKILL.md

Metadata

Files
0
Version
3495f99
Hash
9c9bb8b3
Indexed
2026-07-25 07:19

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 13:22
浙ICP备14020137号-1 $Гость$