gitignore-sync

TotalClaw 作者 totalclaw

上下文感知的 .gitignore 生成由 gitignore.io 支持,而不是 vibes。让它再次变得无聊:准确、幂等、上下文感知。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~nikita-holban-gitignore-sync
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~nikita-holban-gitignore-sync/file -o nikita-holban-gitignore-sync.md
# Gitignore Sync

Generate high-confidence `.gitignore` rules from real repo signals and gitignore.io, then update safely via a managed block so manual rules stay untouched.

## Execution Rule

Use `scripts/update_gitignore.py` as the only execution path.
Do not fetch from the API directly in ad-hoc commands.
Do not manually compose or rewrite `.gitignore` when this skill is selected.

## Workflow

1. Infer requested templates from the user prompt.
2. Detect likely templates from repository files and folders.
3. Run `scripts/update_gitignore.py` with `--prompt-text` and/or `--services`.
4. Let the script fetch combined template rules from `https://www.toptal.com/developers/gitignore/api/<templates>`.
5. Let the script write or update a managed block in `.gitignore`.
6. Preserve non-managed user sections in `.gitignore`.

## Run

From the target repository root, run:

```bash
python3 <skill-path>/scripts/update_gitignore.py \
  --prompt-text "create .gitignore for flutter firebase vscode" \
  --repo .
```

Use explicit templates when the user names exact services:

```bash
python3 <skill-path>/scripts/update_gitignore.py \
  --services flutter,firebase,visualstudiocode \
  --repo .
```

## Notes

- Prefer passing both `--prompt-text` and `--services` when available.
- Keep manual custom rules outside the managed block markers.
- Re-run safely; the script replaces only the managed block.
- Use `--rules-file` for offline/local testing when network access is blocked.

---

## 中文说明

# Gitignore Sync

从真实的仓库信号和 gitignore.io 生成高置信度的 `.gitignore` 规则,然后通过一个受管块安全地更新,使手动规则保持不受影响。

## 执行规则

将 `scripts/update_gitignore.py` 作为唯一的执行路径。
不要在临时命令中直接从 API 拉取。
当选中本技能时,不要手动编写或重写 `.gitignore`。

## 工作流

1. 从用户提示中推断所请求的模板。
2. 从仓库的文件和文件夹中检测可能的模板。
3. 使用 `--prompt-text` 和/或 `--services` 运行 `scripts/update_gitignore.py`。
4. 让脚本从 `https://www.toptal.com/developers/gitignore/api/<templates>` 获取组合后的模板规则。
5. 让脚本在 `.gitignore` 中写入或更新一个受管块。
6. 保留 `.gitignore` 中非受管的用户部分。

## 运行

从目标仓库根目录运行:

```bash
python3 <skill-path>/scripts/update_gitignore.py \
  --prompt-text "create .gitignore for flutter firebase vscode" \
  --repo .
```

当用户指明确切的服务时,使用显式模板:

```bash
python3 <skill-path>/scripts/update_gitignore.py \
  --services flutter,firebase,visualstudiocode \
  --repo .
```

## 注意事项

- 在可用时,优先同时传入 `--prompt-text` 和 `--services`。
- 将手动自定义规则保留在受管块标记之外。
- 可安全地重新运行;脚本只替换受管块。
- 当网络访问被阻断时,使用 `--rules-file` 进行离线/本地测试。