Index of every page on this site: llms.txt
All skills
Run it yourself

撰写R脚本必须遵循本规范,开发包除外。

  • 1 file
  • 1.5 KB
  • Updated 2 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/victory-hugo/s2-agent-skill/r-style

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈16 tokens for metadata: the name and description. ≈365 when used: this file.

How this Skill uses context

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈29 characters, or 0.4%.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

R 代码风格

1. 线性执行

代码从上到下顺序执行,不封装函数。图形逐层保存为 p、p2、p3 等。

2. 注释格式

功能区块:

#* =====区块名称=====

步骤说明使用中文普通注释,并以动词开头:

# 读取数据
# 绘制基础图形

参数含义使用行末 #* 注释:

fill = Group, #* 填充颜色对应 Group 列
size = 3      #* 点大小

3. 数据处理

读取数据后使用 knitr::kable(head(df1)) 预览,再直接进行后续处理,不封装数据读取逻辑。

4. 变量命名

  • 图形:p、p2、p3 等
  • 数据框:df1、df2、df3 等
  • 多词变量:使用下划线连接

5. 包加载

所有 library() 放在脚本顶部,每行一个,不添加注释。

6. PDF 出图

任何情况下,都需要导出可在 Illustrator 中逐标签独立编辑的 PDF:

  • 使用 grDevices::pdf(..., family = "Arial", useDingbats = FALSE)
  • 使用项目内注册的 Arial AFM 字体度量
  • 不使用 cairo_pdf(),避免连续文字被合并到同一 BT...ET 文本对象
  • 验收要求:BaseFont 为 /Arial,且每个 BT...ET 中最多包含一个 Tj 或 TJ

7. 输出要求

  • 直接输出代码
  • 代码按顺序可执行
  • 不使用 main()、tryCatch()、invisible() 或自定义函数,除非用户明确要求
  • 说明内容优先写入代码注释,不在代码块外长篇解释

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 0b19307. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 2 months ago

README badge

README badge for victory-hugo/s2-agent-skill/r-style