@vincent119/go-copilot-rules 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,135 @@
1
+ ---
2
+ description: 'Bash / Shell Script 撰寫與自動產生規範'
3
+ trigger:
4
+ patterns:
5
+ - "**/*.sh"
6
+ - "**/*.bash"
7
+ ---
8
+
9
+ # Bash / Shell Script 指南(for Copilot & VS Code Agent)
10
+
11
+ 本檔延伸自 .github/copilot-common.md 與 .github/copilot-vocabulary.yaml,統一格式、安全與用詞規範。
12
+
13
+ ---
14
+
15
+ ## 1. 通用原則
16
+
17
+ - **以 Bash 為主(#!/usr/bin/env bash)**,僅在明確需要時使用 POSIX sh。
18
+ - 生成內容必須:
19
+ - 可直接執行 (`chmod +x`)
20
+ - 通過 `shellcheck` 無嚴重警告
21
+ - 無未定義變數引用 (`set -u`)
22
+ - 正確處理錯誤與退出碼 (`set -e`, `set -o pipefail`)
23
+ - 絕不假設執行環境,若需相依套件應先檢查 (`command -v ... || exit 1`)。
24
+
25
+ ---
26
+
27
+ ## 2. Header 與格式
28
+
29
+ - 開頭必須含:
30
+ ```bash
31
+ #!/usr/bin/env bash
32
+ set -euo pipefail
33
+ IFS=$'\n\t'
34
+ ```
35
+ - 每個函式前加上註解(用途與參數簡述)。
36
+ - 變數名稱採 **UPPER_SNAKE_CASE**。
37
+ - 函式名稱採 **snake_case**。
38
+ - 內文縮排:**2 空白**。
39
+ - 僅使用 ANSI 可攜語法,避免 bash 4+ 專屬語法於通用腳本中。
40
+
41
+ ---
42
+
43
+ ## 3. 錯誤處理與安全性
44
+
45
+ - 永遠明確檢查外部命令結果:
46
+ ```bash
47
+ if ! curl -fsSL "$url" -o "$file"; then
48
+ echo "Download failed" >&2
49
+ exit 1
50
+ fi
51
+ ```
52
+ - 禁止使用 `eval`、`source` 未信任來源。
53
+ - 所有 `rm`, `mv`, `cp` 操作需加 `--` 防止意外解析參數。
54
+ - 所有 `$VAR` 展開必加雙引號 `"${VAR}"`。
55
+
56
+ ---
57
+
58
+ ## 4. 函式與結構
59
+
60
+ - 函式開頭與結尾間保持一行空白:
61
+ ```bash
62
+ do_task() {
63
+ echo "running"
64
+ }
65
+ ```
66
+ - 禁止使用全域暫存變數,應以 `local` 管理。
67
+ - 使用 `return` 控制函式內部流程,不直接 `exit`。
68
+ - 使用 `trap` 處理中斷與清理:
69
+ ```bash
70
+ trap cleanup EXIT INT TERM
71
+ ```
72
+
73
+ ---
74
+
75
+ ## 5. CLI / 腳本行為
76
+
77
+ - 若腳本有參數,必須支援 `-h|--help`。
78
+ - 使用 `getopts` 或明確 `case "$1" in ...)` 處理參數。
79
+ - 所有輸出均應可重導向 (`stdout` / `stderr` 區分明確)。
80
+ - 避免互動式輸入;若必要,允許透過環境變數設定。
81
+
82
+ ---
83
+
84
+ ## 6. Logging 規範
85
+
86
+ ```bash
87
+ log_info() { echo "[INFO] $*" >&2; }
88
+ log_warn() { echo "[WARN] $*" >&2; }
89
+ log_error() { echo "[ERROR] $*" >&2; }
90
+ ```
91
+
92
+ - 錯誤訊息輸出到 `stderr`。
93
+ - 禁止混用 `echo` 與 `printf` 不同風格輸出。
94
+ - 重要訊息應加上時間戳(選用 `date +"%F %T"`)。
95
+
96
+ ---
97
+
98
+ ## 7. Copilot / Agent 智能產生行為
99
+
100
+ - 優先保持原始腳本結構與縮排。
101
+ - 生成函式或段落時:
102
+ - 若已存在同名函式 → 更新內容,不重複定義。
103
+ - 若需新增 → 插入於主邏輯前。
104
+ - 自動產生變數時:
105
+ - 須以 `readonly` 或 `local` 宣告。
106
+ - 不可覆寫現有環境變數。
107
+ - 若檔案包含:
108
+ - `#!/usr/bin/env bash` → 視為 Bash 語法基準。
109
+ - `#!/bin/sh` → 僅使用 POSIX 語法(避免 `[[ ]]`、`declare -A`)。
110
+
111
+ ---
112
+
113
+ ## 詞彙與術語(外部參照)
114
+
115
+ - 本檔不內嵌詞彙表,統一參照 `.github/copilot-vocabulary.yaml`。
116
+ - 若詞彙衝突,以 vocabulary 檔為準。
117
+ - forbidden / preferred / mapping / normalization 詳見該檔。
118
+
119
+ ---
120
+
121
+ ## 8. Review Checklist
122
+
123
+ - [ ] 通過 `shellcheck` 驗證
124
+ - [ ] 無未加引號的變數展開
125
+ - [ ] 有 `set -euo pipefail`
126
+ - [ ] 所有外部命令有錯誤檢查
127
+ - [ ] 無多餘 `sudo` 或 `eval`
128
+ - [ ] 幫助訊息與參數解析正常
129
+
130
+ ---
131
+
132
+ 放置路徑:
133
+ ```
134
+ .github/standards/bash.instructions.md
135
+ ```
@@ -1,8 +1,12 @@
1
1
  ---
2
- trigger: always_on
2
+ trigger:
3
+ patterns:
4
+ - "**/*.go"
5
+ - "**/go.mod"
6
+ - "**/go.sum"
3
7
  ---
4
8
 
5
- # Go 核心開發規範(Always-On 精簡版)
9
+ # Go 核心開發規範(精簡版)
6
10
 
7
11
  本檔僅包含**所有 Go 程式碼都需要的基礎規則**。進階主題(DDD、gRPC、Migration 等)已拆分為獨立 Skills,按需載入。
8
12
 
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: aws-eks-ami
3
+ description: 查詢 Amazon EKS 專用 AMI (AL2023 x86_64)。支援多版本、多地區、中英文地名查詢。
4
+ ---
5
+
6
+ # Amazon EKS AMI 查詢工具
7
+
8
+ 查詢 Amazon EKS 專用 AMI(Amazon Linux 2023、x86_64 架構),這些 AMI 包含所有必要的執行環境與工具,確保 Worker Node 能順利加入 EKS 叢集。
9
+
10
+ ## 使用時機
11
+
12
+ 當使用者詢問以下需求時,使用此技能:
13
+ - 查詢特定 Kubernetes 版本的 EKS AMI
14
+ - 獲取特定 AWS 地區的 AMI ID
15
+ - 比較不同地區的 AMI 版本
16
+ - 查詢最新可用的 EKS Node AMI
17
+
18
+ ## 查詢方式
19
+
20
+ ### 1. 預設查詢
21
+ 查詢 K8s 1.33 版本,東京地區 (ap-northeast-1):
22
+ ```bash
23
+ ./scripts/get-aws-eks-ami.sh
24
+ ```
25
+
26
+ ### 2. 指定 Kubernetes 版本
27
+ ```bash
28
+ K8S_VERSION='1.32' ./scripts/get-aws-eks-ami.sh
29
+ ```
30
+
31
+ ### 3. 指定地區(支援中英文)
32
+ ```bash
33
+ # 使用英文地名
34
+ REGION='Tokyo' K8S_VERSION='1.32' ./scripts/get-aws-eks-ami.sh
35
+
36
+ # 使用中文地名
37
+ REGION='東京' K8S_VERSION='1.31' ./scripts/get-aws-eks-ami.sh
38
+
39
+ # 使用 AWS Region Code
40
+ REGION='us-west-2' K8S_VERSION='1.32' ./scripts/get-aws-eks-ami.sh
41
+ ```
42
+
43
+ ## 支援的地區
44
+
45
+ ### 亞太地區 (APAC)
46
+ | 地名 | 中文名 | Region Code |
47
+ |------|--------|-------------|
48
+ | Tokyo | 東京 | ap-northeast-1 |
49
+ | Seoul | 首爾 | ap-northeast-2 |
50
+ | Osaka | 大阪 | ap-northeast-3 |
51
+ | Singapore | 新加坡 | ap-southeast-1 |
52
+ | Sydney | 雪梨 | ap-southeast-2 |
53
+ | Jakarta | 雅加達 | ap-southeast-3 |
54
+ | Melbourne | 墨爾本 | ap-southeast-4 |
55
+ | HongKong | 香港 | ap-east-1 |
56
+ | Bangkok | 曼谷 | ap-southeast-1 |
57
+ | Mumbai | 孟買 | ap-south-1 |
58
+ | Taipei | 台北 | ap-northeast-1 * |
59
+
60
+ *台北目前使用東京地區
61
+
62
+ ### 美洲地區
63
+ | 地名 | Region Code |
64
+ |------|-------------|
65
+ | Virginia | us-east-1 |
66
+ | Ohio | us-east-2 |
67
+ | California | us-west-1 |
68
+ | Oregon | us-west-2 |
69
+ | Canada | ca-central-1 |
70
+ | SaoPaulo | sa-east-1 |
71
+
72
+ ### 歐洲與中東
73
+ | 地名 | Region Code |
74
+ |------|-------------|
75
+ | Ireland | eu-west-1 |
76
+ | London | eu-west-2 |
77
+ | Paris | eu-west-3 |
78
+ | Frankfurt | eu-central-1 |
79
+ | Stockholm | eu-north-1 |
80
+ | Bahrain | me-south-1 |
81
+
82
+ ## 輸出格式
83
+
84
+ 腳本會以表格形式輸出,按建立時間從新到舊排序:
85
+ - **Name**: AMI 完整名稱
86
+ - **ImageId**: AMI ID (ami-xxxxx)
87
+ - **Architecture**: 架構 (x86_64)
88
+ - **CreationDate**: 建立日期
89
+
90
+ ## 注意事項
91
+
92
+ 1. **回覆使用者時,請提供最新(表格最上方)的 AMI ID**
93
+ 2. 確認使用者的 Kubernetes 版本與 EKS 叢集版本一致
94
+ 3. 不同地區的 AMI ID 不同,需針對目標地區查詢
95
+ 4. 建議使用最新版本的 AMI 以獲得安全更新
96
+ 5. 執行腳本需要安裝 AWS CLI 並配置好認證
97
+
98
+ ## 常見使用案例
99
+
100
+ ### 案例 1: 新建 EKS Node Group
101
+ ```bash
102
+ # 查詢生產環境使用的最新 AMI
103
+ REGION='Tokyo' K8S_VERSION='1.32' ./scripts/get-aws-eks-ami.sh
104
+ ```
105
+
106
+ ### 案例 2: 多地區部署
107
+ ```bash
108
+ # 東京地區
109
+ REGION='Tokyo' K8S_VERSION='1.32' ./scripts/get-aws-eks-ami.sh
110
+
111
+ # 新加坡地區
112
+ REGION='Singapore' K8S_VERSION='1.32' ./scripts/get-aws-eks-ami.sh
113
+ ```
114
+
115
+ ### 案例 3: 版本升級
116
+ ```bash
117
+ # 比較不同版本的 AMI
118
+ K8S_VERSION='1.31' ./scripts/get-aws-eks-ami.sh
119
+ K8S_VERSION='1.32' ./scripts/get-aws-eks-ami.sh
120
+ ```
@@ -0,0 +1,130 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+
4
+ # 預設值
5
+ K8S_VERSION="${K8S_VERSION:-1.33}"
6
+ REGION="${REGION:-${AWS_REGION:-ap-northeast-1}}"
7
+
8
+ # 將人類可讀的地名轉換為 AWS Region Code
9
+ case "$(echo "$REGION" | tr '[:upper:]' '[:lower:]')" in
10
+ # 亞太地區 - 東北亞
11
+ "tokyo" | "東京" )
12
+ TARGET_REGION="ap-northeast-1"
13
+ ;;
14
+ "seoul" | "首爾" )
15
+ TARGET_REGION="ap-northeast-2"
16
+ ;;
17
+ "osaka" | "大阪" )
18
+ TARGET_REGION="ap-northeast-3"
19
+ ;;
20
+ "taipei" | "台北" | "臺北" )
21
+ TARGET_REGION="ap-northeast-1" # 台北目前使用東京地區
22
+ ;;
23
+
24
+ # 亞太地區 - 東南亞
25
+ "singapore" | "新加坡" )
26
+ TARGET_REGION="ap-southeast-1"
27
+ ;;
28
+ "bangkok" | "曼谷" )
29
+ TARGET_REGION="ap-southeast-1" # 曼谷使用新加坡地區
30
+ ;;
31
+ "sydney" | "雪梨" )
32
+ TARGET_REGION="ap-southeast-2"
33
+ ;;
34
+ "jakarta" | "雅加達" )
35
+ TARGET_REGION="ap-southeast-3"
36
+ ;;
37
+ "melbourne" | "墨爾本" )
38
+ TARGET_REGION="ap-southeast-4"
39
+ ;;
40
+
41
+ # 亞太地區 - 其他
42
+ "hongkong" | "hong kong" | "香港" )
43
+ TARGET_REGION="ap-east-1"
44
+ ;;
45
+ "mumbai" | "孟買" )
46
+ TARGET_REGION="ap-south-1"
47
+ ;;
48
+
49
+ # 美洲地區
50
+ "virginia" | "維吉尼亞" | "us-east" )
51
+ TARGET_REGION="us-east-1"
52
+ ;;
53
+ "ohio" | "俄亥俄" )
54
+ TARGET_REGION="us-east-2"
55
+ ;;
56
+ "california" | "加州" | "北加州" )
57
+ TARGET_REGION="us-west-1"
58
+ ;;
59
+ "oregon" | "奧勒岡" )
60
+ TARGET_REGION="us-west-2"
61
+ ;;
62
+ "canada" | "加拿大" )
63
+ TARGET_REGION="ca-central-1"
64
+ ;;
65
+ "saopaulo" | "聖保羅" )
66
+ TARGET_REGION="sa-east-1"
67
+ ;;
68
+
69
+ # 歐洲與中東
70
+ "ireland" | "愛爾蘭" )
71
+ TARGET_REGION="eu-west-1"
72
+ ;;
73
+ "london" | "倫敦" )
74
+ TARGET_REGION="eu-west-2"
75
+ ;;
76
+ "paris" | "巴黎" )
77
+ TARGET_REGION="eu-west-3"
78
+ ;;
79
+ "frankfurt" | "法蘭克福" )
80
+ TARGET_REGION="eu-central-1"
81
+ ;;
82
+ "stockholm" | "斯德哥爾摩" )
83
+ TARGET_REGION="eu-north-1"
84
+ ;;
85
+ "bahrain" | "巴林" )
86
+ TARGET_REGION="me-south-1"
87
+ ;;
88
+
89
+ *)
90
+ # 預設直接使用傳入的字串(假設它是正確的 Region Code)
91
+ TARGET_REGION="$REGION"
92
+ ;;
93
+ esac
94
+
95
+ echo "================================================="
96
+ echo "🔍 查詢 Amazon EKS AMI"
97
+ echo "================================================="
98
+ echo "Kubernetes 版本: ${K8S_VERSION}"
99
+ echo "AWS 區域: ${TARGET_REGION}"
100
+ echo "AMI 類型: Amazon Linux 2023 (x86_64)"
101
+ echo "================================================="
102
+ echo ""
103
+
104
+ # 檢查 AWS CLI 是否安裝
105
+ if ! command -v aws &> /dev/null; then
106
+ echo "❌ 錯誤: 找不到 AWS CLI"
107
+ echo "請先安裝 AWS CLI: https://aws.amazon.com/cli/"
108
+ exit 1
109
+ fi
110
+
111
+ # 查詢 AMI
112
+ aws ec2 describe-images \
113
+ --region "${TARGET_REGION}" \
114
+ --owners amazon \
115
+ --filters "Name=name,Values=amazon-eks-node-al2023-x86_64-standard-${K8S_VERSION}-*" \
116
+ "Name=state,Values=available" \
117
+ "Name=architecture,Values=x86_64" \
118
+ "Name=is-public,Values=true" \
119
+ --query 'reverse(sort_by(Images, &CreationDate))[].{
120
+ Name: Name,
121
+ ImageId: ImageId,
122
+ Architecture: Architecture,
123
+ CreationDate: CreationDate,
124
+ PlatformDetails: PlatformDetails
125
+ }' \
126
+ --output table
127
+
128
+ echo ""
129
+ echo "✅ 查詢完成"
130
+ echo "💡 提示: 表格最上方的 AMI 為最新版本"
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: changelog-generator
3
+ description: Transform Git commits into user-facing changelogs. Auto-categorize, filter noise, generate professional Release Notes.
4
+ ---
5
+
6
+ # Changelog Generator
7
+
8
+ Convert technical commits into user-friendly release notes. Supports GitHub Release, App Store updates, email notifications, and more.
9
+
10
+ ## When to Use
11
+
12
+ Version releases, product update summaries, App Store submissions, public CHANGELOG maintenance.
13
+
14
+ ## Core Features
15
+
16
+ 1. **Auto-categorize**: feat→Added, fix→Fixed, perf→Improved
17
+ 2. **Filter noise**: Exclude CI/CD, tests, refactors, docs
18
+ 3. **Language transform**: Technical terms → User value descriptions
19
+ 4. **Follow standards**: Semantic Versioning + Keep a Changelog
20
+
21
+ ## Usage
22
+
23
+ ```bash
24
+ # Basic usage
25
+ Generate changelog for commits from the last 7 days
26
+ Create release notes for v2.5.0
27
+
28
+ # Specify range
29
+ Create changelog for commits between 3/1 and 3/15
30
+ Generate changelog for commits after v2.4.0
31
+ ```
32
+
33
+ ## Output Format
34
+
35
+ ```markdown
36
+ ## [X.Y.Z] - YYYY-MM-DD
37
+
38
+ ### ✨ Added
39
+ - Feature description (emphasize user value)
40
+
41
+ ### 🔧 Changed
42
+ - Improvement description (explain benefits)
43
+
44
+ ### 🐛 Fixed
45
+ - Fix description (problem solved)
46
+
47
+ ### ⚠️ Breaking Changes
48
+ - Change description (impact & migration guide)
49
+ ```
50
+
51
+ ## Filter Rules
52
+
53
+ **Exclude**: CI/CD, version bumps, refactors, tests, comments, logs, non-impactful dependency updates
54
+ **Include**: All changes affecting end users
55
+
56
+ ## Writing Principles
57
+
58
+ 1. One item per logical change
59
+ 2. No commit hashes, PR numbers, internal module names
60
+ 3. Avoid vague terms (improve/update), be specific about impact
61
+ 4. Use past tense, affirmative tone
62
+ 5. Emphasize "what was solved" or "what was gained"
63
+
64
+ ## Example
65
+
66
+ **Input**: Last 7 days commits
67
+ **Output**:
68
+ ```markdown
69
+ ## [2.5.0] - 2024-03-10
70
+
71
+ ### ✨ Added
72
+ - **Team Workspaces**: Create separate workspaces and invite team members
73
+ - **Keyboard Shortcuts**: Press ? to view all shortcuts
74
+
75
+ ### 🔧 Changed
76
+ - 2x faster file sync across devices
77
+ - Search now includes file content
78
+
79
+ ### 🐛 Fixed
80
+ - Fixed large image upload failures
81
+ - Resolved notification count errors
82
+ ```
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: k8s-debug
3
+ description: Kubernetes troubleshooting workflow - Pod status, logs, events, exec, and resource monitoring.
4
+ ---
5
+
6
+ # K8s Debugging Workflow
7
+
8
+ Systematic approach to diagnose and fix Kubernetes application issues.
9
+
10
+ ## 1. Check Pod Status
11
+
12
+ Identify pods in error states (CrashLoopBackOff, ImagePullBackOff, etc.):
13
+
14
+ ```bash
15
+ kubectl get pods -o wide
16
+ kubectl describe pod <POD_NAME>
17
+ ```
18
+
19
+ ## 2. View Logs
20
+
21
+ Check container logs for errors and stack traces:
22
+
23
+ ```bash
24
+ # Current logs
25
+ kubectl logs <POD_NAME> [-c <CONTAINER>]
26
+
27
+ # Previous crash logs
28
+ kubectl logs <POD_NAME> --previous
29
+ ```
30
+
31
+ ## 3. Check Events
32
+
33
+ Review cluster events for scheduling/mounting/health check failures:
34
+
35
+ ```bash
36
+ kubectl get events --sort-by=.lastTimestamp
37
+ ```
38
+
39
+ ## 4. Exec into Container
40
+
41
+ Debug filesystem, environment, or network issues:
42
+
43
+ ```bash
44
+ kubectl exec -it <POD_NAME> -- sh
45
+
46
+ # Inside container:
47
+ env # Check environment variables
48
+ curl localhost:8080 # Test HTTP endpoints
49
+ nc -zv <HOST> <PORT> # Test network connectivity
50
+ ```
51
+
52
+ ## 5. Port Forward
53
+
54
+ Forward pod port to local for testing:
55
+
56
+ ```bash
57
+ kubectl port-forward <POD_NAME> 8080:8080
58
+ ```
59
+
60
+ ## 6. Monitor Resources
61
+
62
+ Check for OOM or CPU throttling:
63
+
64
+ ```bash
65
+ kubectl top pod <POD_NAME>
66
+ ```
67
+
68
+ ## Common Issues
69
+
70
+ | Issue | Command | Solution |
71
+ |-------|---------|----------|
72
+ | CrashLoopBackOff | `logs --previous` | Check startup errors |
73
+ | ImagePullBackOff | `describe pod` | Verify image name/credentials |
74
+ | Pending | `get events` | Check resource limits/node capacity |
75
+ | OOMKilled | `top pod` | Increase memory limits |
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: release-workflow
3
+ description: Standard release workflow - Test, tag, push. Supports Go, Python, Node.js, Bash, YAML projects.
4
+ ---
5
+
6
+ # Release Workflow
7
+
8
+ Standard process for releasing new versions across different project types.
9
+
10
+ ## Workflow Steps
11
+
12
+ ### 1. Check Git Status
13
+
14
+ Ensure clean working directory:
15
+
16
+ ```bash
17
+ git status --porcelain
18
+ ```
19
+
20
+ ### 2. Run Tests
21
+
22
+ Execute tests based on project type:
23
+
24
+ ```bash
25
+ # Go
26
+ go test -v ./...
27
+
28
+ # Python
29
+ pytest
30
+
31
+ # Node.js
32
+ npm test
33
+
34
+ # Bash
35
+ bash -n script.sh
36
+
37
+ # YAML
38
+ yamllint .
39
+ ```
40
+
41
+ ### 3. Determine Version
42
+
43
+ Review existing tags and decide next version:
44
+
45
+ ```bash
46
+ git tag --sort=-v:refname | head -n 5
47
+ ```
48
+
49
+ **Ask user**: "What should the next version tag be? (e.g., v1.0.1)"
50
+
51
+ ### 4. Create Tag
52
+
53
+ ```bash
54
+ git tag <VERSION>
55
+ ```
56
+
57
+ ### 5. Push Tag
58
+
59
+ ```bash
60
+ git push origin <VERSION>
61
+ ```
62
+
63
+ ### 6. Verify (Optional)
64
+
65
+ ```bash
66
+ git ls-remote --tags origin | grep <VERSION>
67
+ ```
68
+
69
+ ## Version Guidelines
70
+
71
+ | Change Type | Version Bump | Example |
72
+ |------------|--------------|---------|
73
+ | Breaking changes | Major | v1.0.0 → v2.0.0 |
74
+ | New features | Minor | v1.0.0 → v1.1.0 |
75
+ | Bug fixes | Patch | v1.0.0 → v1.0.1 |
76
+
77
+ ## Common Patterns
78
+
79
+ ```bash
80
+ # Full workflow one-liner
81
+ git status --porcelain && \
82
+ go test -v ./... && \
83
+ git tag v1.0.1 && \
84
+ git push origin v1.0.1
85
+ ```
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: skill-creator
3
+ description: Guide for creating effective skills. Use when creating/updating skills to extend Claude's capabilities with workflows, tools, or domain knowledge.
4
+ ---
5
+
6
+ # Skill Creator
7
+
8
+ Skills extend Claude with specialized workflows, tools, and domain knowledge through modular packages.
9
+
10
+ ## What Skills Provide
11
+
12
+ - Specialized multi-step workflows
13
+ - Tool integrations and file format handling
14
+ - Domain expertise and business logic
15
+ - Bundled resources (scripts, references, assets)
16
+
17
+ ## Core Principles
18
+
19
+ **Be Concise**: Context window is shared. Assume Claude is smart—only add what's truly needed.
20
+
21
+ **Set Appropriate Freedom**:
22
+ - **High** (text instructions): Multiple valid approaches
23
+ - **Medium** (pseudocode/scripts): Preferred patterns with flexibility
24
+ - **Low** (specific scripts): Fragile operations requiring consistency
25
+
26
+ ## Skill Structure
27
+
28
+ ```bash
29
+ skill-name/
30
+ ├── SKILL.md (required)
31
+ │ ├── YAML: name + description
32
+ │ └── Markdown: instructions
33
+ └── Optional resources:
34
+ ├── scripts/ - Executable code
35
+ ├── references/ - Docs loaded as needed
36
+ └── assets/ - Output templates/files
37
+ ```
38
+
39
+ **Resources**:
40
+ - `scripts/`: Reusable code (Python/Bash)
41
+ - `references/`: Domain docs, schemas, APIs
42
+ - `assets/`: Templates, images, boilerplates
43
+
44
+ **Exclude**: README, CHANGELOG, docs not needed by Claude
45
+
46
+ ## Progressive Disclosure
47
+
48
+ 3-tier loading:
49
+ 1. **Metadata** (~100 words) - Always loaded
50
+ 2. **SKILL.md body** (<500 lines) - When triggered
51
+ 3. **Resources** - On demand
52
+
53
+ **Patterns**:
54
+ ```markdown
55
+ # Core workflow in SKILL.md
56
+ * Advanced: See [ADVANCED.md]
57
+ * API: See [API.md]
58
+ ```
59
+
60
+ Organize by domain/framework:
61
+ ```
62
+ cloud-deploy/
63
+ ├── SKILL.md
64
+ └── references/
65
+ ├── aws.md
66
+ └── gcp.md
67
+ ```
68
+
69
+ ## Creation Process
70
+
71
+ 1. **Understand**: Clarify use cases with examples
72
+ 2. **Plan**: Identify reusable scripts/references/assets
73
+ 3. **Initialize**: `scripts/init_skill.py <name> --path <dir>`
74
+ 4. **Edit**:
75
+ - Add resources (scripts/references/assets)
76
+ - Write SKILL.md with:
77
+ - **Frontmatter**: `name` + `description` (trigger conditions)
78
+ - **Body**: Instructions and workflows
79
+ 5. **Package**: `scripts/package_skill.py <path>`
80
+ 6. **Iterate**: Test and refine
81
+
82
+ ## Writing Guidelines
83
+
84
+ - Use imperative/infinitive tense
85
+ - `description`: Include what + when to use
86
+ - Keep SKILL.md <500 lines
87
+ - Test scripts before packaging
88
+ - Remove unused example files
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: test-coverage
3
+ description: Run tests with coverage reports for Go, Python, and Node.js projects.
4
+ ---
5
+
6
+ # Test Coverage
7
+
8
+ Generate test coverage reports across multiple languages.
9
+
10
+ ## Go
11
+
12
+ ```bash
13
+ # Run tests with coverage
14
+ go test -v -coverprofile=coverage.out ./...
15
+
16
+ # Terminal summary
17
+ go tool cover -func=coverage.out
18
+
19
+ # HTML report
20
+ go tool cover -html=coverage.out -o coverage.html
21
+ ```
22
+
23
+ ## Python
24
+
25
+ Requires `pytest` and `pytest-cov`:
26
+
27
+ ```bash
28
+ pytest --cov=. --cov-report=term --cov-report=html
29
+ ```
30
+
31
+ HTML report: `htmlcov/index.html`
32
+
33
+ ## Node.js
34
+
35
+ Using Jest:
36
+
37
+ ```bash
38
+ npm test -- --coverage
39
+ ```
40
+
41
+ HTML report: `coverage/lcov-report/index.html`
42
+
43
+ ## Coverage Goals
44
+
45
+ | Metric | Target |
46
+ |--------|--------|
47
+ | Overall | >80% |
48
+ | Critical paths | >90% |
49
+ | New code | 100% |
50
+
51
+ **Cleanup**: Remove `coverage.out`, `htmlcov/`, `coverage/` after review.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincent119/go-copilot-rules",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Professional Go development rules and skills for GitHub Copilot, Cursor, and other AI coding assistants",
5
5
  "keywords": [
6
6
  "copilot",