Token导航 LogoToken导航

Agent Skill · AI 工具

gpt2-codegolf(GPT2 代码高尔夫)

gpt2-codegolf 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

gpt2-codegolf 是AI 工具类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证为 MIT,第三方扫描已通过,按安装量在AI 工具类的 2,536 个 Skill 里排第 1,380。

总安装 783周安装 32GitHub Stars 93下载 251核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gpt2-codegolf(GPT2 代码高尔夫)
来源仓库:https://github.com/letta-ai/skills
仓库路径:skills/gpt2-codegolf
安装命令:
npx skills add https://github.com/letta-ai/skills --skill gpt2-codegolf
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/letta-ai/skills --skill gpt2-codegolf

这个 Skill 是做什么的

AI 工具类 Skill 用来扩展助手本身的能力,例如接模型、接检索、接外部服务。

gpt2-codegolf 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。通过 npx skills add 命令从指定仓库安装并使用。

安装前建议确认权限范围和维护状态,注意是否会触发联网或文件读写操作。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/gpt2-codegolf

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/letta-ai/skills --skill gpt2-codegolf;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

gpt2-codegolf 怎么安装?

在终端执行 npx skills add https://github.com/letta-ai/skills --skill gpt2-codegolf。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

gpt2-codegolf 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

gpt2-codegolf 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

gpt2-codegolf 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

gpt2-codegolf 用的人多吗?

公开数据是累计安装 783 次,近一周安装 32 次,下载 251 次,GitHub 93 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

gpt2-codegolf 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理AI 工具类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

AI 工具类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
executing-plans

执行计划 · Codex、Claude

1,515,336173,110只读MIT通过
verification-before-completion

完成前的验证 · Codex、Claude

1,319,472173,121权限未标注MIT通过
subagent-driven-development

子 Agent 驱动开发 · Codex、Claude

1,312,416173,138只读MIT通过
copy-editing

复制编辑 · Codex、Claude

1,209,57625,632只读MIT通过
paywall-upgrade-cro

付费专区升级 cro · Codex、Claude

1,030,17625,617只读MIT通过
gpt2-codegolf

GPT2 代码高尔夫 · 本页

78393只读MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

GPT-2 Code Golf

Overview

This skill provides guidance for implementing GPT-2 or similar transformer model inference in minimal code, typically for code golf challenges. These tasks require parsing binary checkpoint formats, implementing BPE tokenization, and performing forward passes through transformer architectures—all within strict size constraints.

Critical Principles

1. Verify Before Optimizing

Never optimize for size before functionality is verified. A working 10KB solution is better than a broken 4KB solution. Size optimization should be the final step, not a constraint during development.

2. Incremental Development and Testing

Build and test components independently before integration:

  1. Checkpoint parsing - Verify weights load correctly
  2. Tokenization - Verify BPE encoding/decoding works
  3. Forward pass - Verify matrix operations produce reasonable outputs
  4. Integration - Combine components only after individual verification

3. Format Analysis Before Implementation

Before writing any parsing code, analyze the actual file formats:

# Examine checkpoint structure
hexdump -C model.ckpt.data-00000-of-00001 | head -100

# Check index file format
cat model.ckpt.index | xxd | head -50

# Examine vocabulary/BPE file structure
head -50 vocab.bpe

Approach: Checkpoint Parsing

Understanding TensorFlow Checkpoint Format

TensorFlow checkpoints consist of multiple files:

  • .index file: Contains tensor metadata (names, shapes, offsets)
  • .data-* files: Contains actual weight values

The index file uses protocol buffers. Parsing it correctly requires understanding:

  • Varint encoding for integers
  • String length prefixes
  • Tensor shape encodings

Verification Strategy for Weight Loading

After implementing checkpoint parsing, verify weights loaded correctly:

// Print statistics for loaded weights
printf("wte sum: %f\n", sum_tensor(wte, vocab_size * n_embd));
printf("wpe[0]: %f %f %f\n", wpe[0], wpe[1], wpe[2]);
printf("First layer attn weight samples: %f %f\n",
       attn_w[0][0], attn_w[0][100]);

Red flags indicating parsing failure:

  • All values are zero
  • All values are identical
  • Values are extremely large (e.g., 1e30+)
  • NaN or Inf values

Common Mistakes in Checkpoint Parsing

  1. Using arbitrary magic offsets - Offsets depend on tensor order and checkpoint version
  2. Ignoring endianness - TensorFlow uses little-endian floats
  3. Skipping index file - The data file alone lacks tensor boundaries
  4. Pattern matching on binary data - Binary patterns like 0x08 are not reliable markers

Approach: BPE Tokenization

Understanding BPE Structure

GPT-2 uses byte-pair encoding with:

  • A vocabulary file mapping tokens to IDs
  • Merge rules defining how to combine byte sequences

Verification Strategy for Tokenization

Test with known input/output pairs:

// Known tokenization for GPT-2
// "Hello" -> [15496]
// " world" -> [995]
// "Hello world" -> [15496, 995]

int tokens[MAX_TOKENS];
int n = tokenize("Hello world", tokens);
assert(n == 2);
assert(tokens[0] == 15496);
assert(tokens[1] == 995);

Common Mistakes in BPE Implementation

  1. Word-level splitting - GPT-2 BPE operates on bytes, not words
  2. Ignoring merge order - Merges must be applied in priority order
  3. Missing special handling - Spaces are encoded as part of tokens (e.g., " world" is one token)
  4. Reading wrong file sections - Vocabulary IDs vs merge rules are in different sections

Approach: Forward Pass

Verification Strategy for Forward Pass

  1. Test with simple inputs first:
// Single token input, check output shape and range
float logits[VOCAB_SIZE];
forward_pass(single_token, 1, logits);
// Logits should be roughly in range [-10, 10]
// Softmax should sum to 1.0
  1. Compare against reference implementation:
# Generate reference outputs with Hugging Face
from transformers import GPT2LMHeadModel, GPT2Tokenizer
model = GPT2LMHeadModel.from_pretrained('gpt2')
# Save intermediate activations for comparison
  1. Check numerical stability:
// After attention, values should be bounded
// After layer norm, mean should be ~0, std ~1

Common Numerical Issues

  1. Overflow in softmax - Subtract max before exponentiating
  2. Accumulation errors - Use double precision for reductions
  3. Missing layer normalization - Each transformer block requires layer norm

Verification Checklist

Before declaring completion, verify each component:

  • Checkpoint parsing: Print sample weights, verify non-zero and reasonable values
  • Vocabulary loading: Print sample token mappings, verify expected tokens exist
  • BPE encoding: Test with known strings, verify token IDs match reference
  • BPE decoding: Round-trip test: encode then decode should return original string
  • Forward pass: Single token produces logits in expected range
  • Sampling: Top token for common prefixes matches expected continuations
  • End-to-end: Generated text is coherent (not garbage or repeated patterns)

When to Simplify vs. Ask for Alternatives

If proper implementation of a component would exceed constraints:

  1. Checkpoint format too complex: Ask if weights can be provided in a simpler format (raw binary floats, NumPy arrays)
  2. Full BPE too large: Ask if a pre-tokenized input is acceptable
  3. Full transformer too large: Ask about acceptable accuracy tradeoffs (fewer layers, smaller dimensions)

Never implement a non-functional simplification silently. If corners must be cut, communicate clearly which functionality is affected.

Anti-Patterns to Avoid

  1. Claiming success without testing - Always run the program with actual inputs before completion
  2. Ignoring self-identified risks - If a limitation is noted, address it or communicate it
  3. Premature size optimization - Get it working first, then optimize
  4. Testing only happy path - Verify error handling and edge cases
  5. Assuming file format knowledge - Always examine actual files before parsing

平台分布

Claude Code

27.95%
按下载量换算70

Gemini CLI

23.45%
按下载量换算59

Antigravity

16.79%
按下载量换算42

windsurf

10.41%
按下载量换算26

OpenCode

7.56%
按下载量换算19

Codex

2.77%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills