Skip to content
Back to skills

License Header Adder

ASecurity

為新建立的原始碼檔案加上標準的開源授權條款標頭。適用於需要版權聲明的程式碼檔案建立情境。

  • 57 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added May 31, 2026
developmentpythongojavac++shell

Security analysis

A100/100

Scanned May 31, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill license-header-adder --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of License Header Adder?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for License Header Adder
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-license-header-adder/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-license-header-adder)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: license-header-adder
description: 為新建立的原始碼檔案加上標準的開源授權條款標頭。適用於需要版權聲明的程式碼檔案建立情境。
---

# 授權條款標頭 Skill

這個 Skill 確保所有新建立的原始碼檔案都有正確的版權標頭。

## 指示說明

1. **讀取範本**:首先,讀取位於 `resources/HEADER_TEMPLATE.txt` 的標頭範本檔案內容。
2. **加入檔案開頭**:當建立新檔案時(例如 `.py`、`.java`、`.js`、`.ts`、`.go`),將範本內容加到目標檔案的最開頭。
3. **調整註解語法**:
   - 對於 C 風格語言(Java、JS、TS、C++),保持 `/* ... */` 區塊格式。
   - 對於 Python、Shell 或 YAML,將區塊轉換為使用 `#` 註解。
   - 對於 HTML/XML,使用 `<!-- ... -->` 格式。

## 使用時機

- 當建立新的程式碼檔案時
- 當需要為現有檔案補上授權條款標頭時
- 當專案需要統一的版權聲明格式時

## 範例

### 範例 1:為 Java 檔案加上授權條款

**使用者指令**:為 MyService.java 加上授權條款標頭

**AI 執行步驟**:

1. 讀取 `resources/HEADER_TEMPLATE.txt` 內容
2. 將內容以 `/* ... */` 格式加到 Java 檔案開頭

---

### 範例 2:為 Python 檔案加上授權條款

**使用者指令**:為 utils.py 加上授權條款標頭

**AI 執行步驟**:

1. 讀取 `resources/HEADER_TEMPLATE.txt` 內容
2. 將每行轉換為 `#` 開頭的註解
3. 加到 Python 檔案開頭

---

## 注意事項

- 範本內容必須**完全照抄**,不可修改任何文字
- 法律文字不可有任何錯字或遺漏
- 根據目標檔案的程式語言調整註解格式

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.