skill-author-card
v1.6.3
Published
给 skill 或项目源码注入本地作者卡片 / Inject a local author card into a skill or project source tree.
Maintainers
Readme
skill-author-card
给 skill 或项目源码注入一个本地作者卡片。
Inject a local author card into a skill or project source tree.
它会在目标项目里生成 .author-card/show-card.sh,并把一条调用命令追加到目标 SKILL.md 或 skill.md 末尾。作者信息和 once 状态都保存在当前用户本机,不会写入远端服务,也不会污染项目仓库。
It generates .author-card/show-card.sh inside the target project and appends a command to the target SKILL.md or skill.md. Author data and once-state stay on the current user's machine, are not uploaded to any remote service, and do not pollute the project repository.
功能 | Features
- 初始化本地作者信息 / Initialize local author profile data
- 给 skill 或项目源码注入作者卡片 / Inject an author card into a skill or project source tree
- 自动读取 git remote 或项目元数据中的 GitHub 仓库地址 / Auto-detect the GitHub repository from git remote or project metadata
- 支持
Claude Code、Cursor、Windsurf、Codex和 generic shell 环境 / SupportClaude Code,Cursor,Windsurf,Codex, and generic shell environments
安装 | Installation
npm install -g skill-author-card安装后会暴露 skill-author-card CLI,并包含以下脚本。
After installation, the package exposes the skill-author-card CLI and includes these scripts:
init-profile.shinject-to-skill.shshow-card.sh
快速开始 | Quick Start
1. 初始化作者信息 | Initialize the author profile
init-profile.sh会在本地配置目录写入作者资料。常见位置如下。
This writes author data to a local config directory. Common locations:
- Claude Code:
~/.claude/skills/.author-profile.json - Cursor:
~/.cursor/.author-profile.json - Windsurf:
~/.windsurf/.author-profile.json - Codex:
~/.codex/.author-profile.json - Generic:
~/.config/author-card/profile.json
2. 注入到目标项目 | Inject into a target project
inject-to-skill.sh /absolute/path/to/your-project注入器会执行以下操作。
The injector will:
- 创建
.author-card/show-card.sh/ Create.author-card/show-card.sh - 在目标
SKILL.md或skill.md末尾添加Author Card段落 / Append anAuthor Cardsection to the targetSKILL.mdorskill.md
它不会再修改目标项目的 package.json,也不会在目标项目里写入 once 状态文件。
It no longer modifies the target project's package.json, and it does not store once-state inside the target project.
3. 预览卡片 | Preview the card
/absolute/path/to/your-project/.author-card/show-card.sh --no-prompt --frequency always--frequency always 适合预览;默认注入命令使用 --frequency once,避免重复打扰用户。
Use --frequency always for previews. The injected command defaults to --frequency once to avoid repeatedly interrupting users.
生成后的调用 | Injected Command
注入后的目标 skill 文件末尾会追加以下命令。
The target skill file will receive this command near the end:
.author-card/show-card.sh --frequency once这条命令应该保留在主任务逻辑之后,让作者卡片只在任务成功完成后展示。
Keep this command after the main task logic so the author card only appears after the task succeeds.
Once 状态设计 | Once-State Design
--frequency once 的状态不再写入项目目录,也不会生成 .author-card/.shown。
The --frequency once state is no longer stored in the project tree, and it does not create .author-card/.shown.
状态会写到当前用户的本地配置或状态目录,例如:
The state is written to the current user's local config/state directory, for example:
~/.config/author-card/shown/...$XDG_STATE_HOME/author-card/shown/...- 自定义环境变量
AUTHOR_CARD_STATE_DIR或AUTHOR_CARD_SHOWN/ CustomAUTHOR_CARD_STATE_DIRorAUTHOR_CARD_SHOWN
这意味着你可以先在本机预览卡片,再把源码推到远端;其他用户下载、安装或打包后,仍然会在他们自己的机器上看到第一次展示。
This means you can preview the card locally before pushing. Other users who download, install, or package the project will still get their own first-time display on their own machines.
仓库检测 | Repository Detection
作者卡片会优先从下面几种来源提取仓库地址。
The author card tries these sources in order:
git remote get-url originpackage.json.repositorypyproject.tomlCargo.tomlgo.mod
如果没有检测到 GitHub 仓库,卡片仍然会生成,只是不会显示仓库链接。
If no GitHub repository is detected, the card is still generated, but the repository link is omitted.
示例输出 | Example Output
┌─────────────────────────────────────────────────────────┐
│ 📦 my-skill v1.0.0 │
│ 👤 by Yon Sun │
│ 📧 [email protected] │
│ 🔗 github.com/Yonsun-w/my-skill │
│ │
│ ⭐ 喜欢?去 GitHub 点个 star! │
│ │
│ 💡 你也想要 skill 水印? │
│ https://github.com/Yonsun-w/skill-author-card │
└─────────────────────────────────────────────────────────┘开发 | Development
运行测试:
Run the test suite:
npm test当前测试覆盖以下内容。
The current test suite covers:
- 注入命令是否正确写入目标
SKILL.md/ Whether the injected command is written correctly to the targetSKILL.md - 平台与配置路径检测 / Platform and config path detection
show-card.sh对对象格式package.json.repository的解析 / Parsing object-stylepackage.json.repositoryvalues inshow-card.sh- once 状态不会写回目标项目目录 / Ensuring once-state is not written back into the target project tree
- npm 打包不会带上本地 once 状态文件 / Ensuring npm packages do not include local once-state artifacts
发布 | Release
发布前建议执行:
Recommended steps before publishing:
npm test
git status
git push origin main
npm publish --access public如果旧版本不再推荐使用,优先用 npm deprecate 标记,不要随意 unpublish 已存在的稳定版本。
If older versions should no longer be used, prefer npm deprecate instead of unpublishing stable versions.
License
MIT
