Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计提醒

setup-putior-ci设置 putior ci

Agent Skill

setup-putior-ci 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

376

周安装

16

GitHub Stars

12

下载量

132
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/pjt222/development-guides --skill setup-putior-ci

简介

提供 CI/CD 流水线配置与质量门禁设置支持。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中需要自动化构建验证的场景。
  • 通过 npx skills add 命令从 development-guides 仓库安装。
  • 可能修改构建缓存或临时目录,应定期清理避免累积开销。
  • 注意门禁规则的严格性与误报率平衡,防止阻塞正常发布流程。

SKILL.md

Set Up putior CI/CD

Configure GitHub Actions to automatically regenerate workflow diagrams when source code changes, keeping documentation in sync with code.

When to Use

  • Workflow diagrams should always reflect the current state of the code
  • The project has CI/CD and wants automated documentation updates
  • Multiple contributors may change workflow-affecting code
  • Replacing manual diagram regeneration with automated pipeline

Inputs

  • Required: GitHub repository with putior annotations in source files
  • Required: Target file for diagram output (e.g., README.md, docs/workflow.md)
  • Optional: putior theme (default: "github")
  • Optional: Source directories to scan (default: "./R/" or "./src/")
  • Optional: Branch to trigger on (default: main)

Procedure

Step 1: Create GitHub Actions Workflow

Create the workflow YAML file for automated diagram generation.

# .github/workflows/update-workflow-diagram.yml
name: Update Workflow Diagram

on:
  push:
    branches: [main]
    paths:
      - 'R/**'
      - 'src/**'
      - 'scripts/**'

permissions:
  contents: write

jobs:
  update-diagram:
    if: github.actor != 'github-actions[bot]'
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - uses: r-lib/actions/setup-r@v2
        with:
          use-public-rspm: true

      - name: Install putior
        run: |
          install.packages("putior")
        shell: Rscript {0}

      - name: Generate workflow diagram
        run: |
          Rscript scripts/generate-workflow-diagram.R

      - name: Commit updated diagram
        run: |
          git config --local user.name "github-actions[bot]"
          git config --local user.email "github-actions[bot]@users.noreply.github.com"
          git add README.md docs/workflow.md  # Adjust to match your target files
          git diff --staged --quiet || git commit -m "docs: update workflow diagram [skip ci]"
          git push

Expected: File created at .github/workflows/update-workflow-diagram.yml.

On failure: Ensure the .github/workflows/ directory exists. Adjust the paths filter to match where annotated source files live in the repository.

Step 2: Write Generation Script

Create the R script that generates the diagram and updates target files using sentinel markers.

# scripts/generate-workflow-diagram.R
library(putior)

# Scan source files for annotations (exclude build scripts to avoid circular refs)
workflow <- put_merge("./R/", merge_strategy = "supplement",
  exclude = c("generate-workflow-diagram\\.R$"),
  log_level = NULL)  # Set to "DEBUG" to troubleshoot CI diagram generation

# Generate Mermaid code
mermaid_code <- put_diagram(workflow, output = "raw", theme = "github")

# Read target file (e.g., README.md)
readme <- readLines("README.md")

# Find sentinel markers
start_marker <- "<!-- PUTIOR-WORKFLOW-START -->"
end_marker <- "<!-- PUTIOR-WORKFLOW-END -->"

start_idx <- which(readme == start_marker)
end_idx <- which(readme == end_marker)

if (length(start_idx) == 1 && length(end_idx) == 1 && end_idx > start_idx) {
  # Replace content between sentinels
  new_content <- c(
    readme[1:start_idx],
    "",
    "```mermaid",
    mermaid_code,
    "```",
    "",
    readme[end_idx:length(readme)]
  )
  writeLines(new_content, "README.md")
  cat("Updated README.md workflow diagram\n")
} else {
  warning("Sentinel markers not found in README.md. Add them manually:\n",
          start_marker, "\n", end_marker)
}

# Also write standalone diagram file
writeLines(
  c("# Workflow Diagram", "",
    "```mermaid", mermaid_code, "```"),
  "docs/workflow.md"
)
cat("Updated docs/workflow.md\n")

Expected: Script at scripts/generate-workflow-diagram.R that reads annotations, generates Mermaid code, and replaces content between sentinel markers.

On failure: If put_merge() returns empty, check that source paths match the repository layout. Adjust "./R/" to the actual source directory.

Step 3: Configure Auto-Commit

The workflow must avoid infinite loops where an auto-commit re-triggers the same workflow. Pushes made with the default GITHUB_TOKEN typically do not trigger new workflow runs, but the workflow also includes an explicit if: guard on the job as a safety net.

Key configuration points:

  • permissions: contents: write grants push access
  • if: github.actor!= 'github-actions[bot]' skips the job when the push came from the bot itself
  • git diff --staged --quiet || git commit only commits if there are changes
  • [skip ci] in the commit message is a convention some CI systems honor (not built into GitHub Actions, but useful as a signal)
  • Bot identity used for commits: github-actions[bot]

Expected: The workflow only commits when diagrams actually change. No empty commits, no infinite loops.

On failure: If push fails with permission denied, check repository settings: Settings > Actions > General > Workflow permissions must be set to "Read and write permissions".

Step 4: Add Sentinel Markers to README

Insert sentinel markers in the target file where the diagram should appear.

## Workflow

<!-- PUTIOR-WORKFLOW-START -->
<!-- This section is auto-generated by putior CI. Do not edit manually. -->

flowchart TD A["Placeholder — will be replaced on next CI run"]

Expected: Sentinel markers in README.md (or other target file). The content between them will be replaced on each CI run.

On failure: Ensure markers are on their own lines with no leading/trailing whitespace. The script matches exact line content.

Step 5: Test the Pipeline

Trigger the workflow and verify the diagram updates.

# Make a small change to trigger the workflow
echo "# test" >> R/some-file.R
git add R/some-file.R
git commit -m "test: trigger workflow diagram update"
git push

# Monitor the GitHub Actions run
gh run watch

# Verify the diagram was updated
git pull
cat README.md | grep -A 5 "PUTIOR-WORKFLOW-START"

Expected: GitHub Actions run completes successfully. The diagram between sentinel markers in README.md is updated with current workflow data.

On failure: Check the Actions log for errors. Common issues:

  • putior package not available: add to DESCRIPTION Suggests or install explicitly in the workflow
  • Source path wrong: the R script's put_merge() path must be relative to the repo root
  • No sentinel markers: the script warns but doesn't crash; add markers to README.md

Validation

  • .github/workflows/update-workflow-diagram.yml exists and is valid YAML
  • scripts/generate-workflow-diagram.R runs without errors locally
  • README.md contains <!-- PUTIOR-WORKFLOW-START --> and <!-- PUTIOR-WORKFLOW-END --> sentinels
  • GitHub Actions workflow triggers on push to the correct branch and paths
  • Diagram content between sentinels is updated after a workflow run
  • Job-level if: guard prevents infinite commit loops from bot pushes
  • No changes = no commit (idempotent)

Common Pitfalls

  • Infinite CI loops: Pushes with the default GITHUB_TOKEN typically don't trigger new runs, but always add an explicit if: github.actor!= 'github-actions[bot]' guard on the job. The [skip ci] tag in the commit message is a useful convention but is not a built-in GitHub Actions mechanism.
  • Permission denied on push: GitHub Actions needs write permission. Set permissions: contents: write in the workflow file, or configure it in repository settings.
  • Sentinel marker mismatch: If markers have trailing spaces, leading tabs, or are on the same line as other content, the script won't find them. Keep markers on their own clean lines.
  • Source path mismatch: The R script runs from the repo root. Paths like "./R/" or "./src/" must match the actual directory structure.
  • Package installation in CI: If the project uses renv, the CI workflow needs renv::restore() before putior is available. Alternatively, install putior explicitly in the workflow.
  • Large repos slowing CI: For repos with many source files, limit the paths trigger filter to directories that contain PUT annotations, not the entire repo.

Related Skills

  • generate-workflow-diagram — the manual version of what this CI automates
  • setup-github-actions-ci — general GitHub Actions CI/CD setup for R packages
  • build-ci-cd-pipeline — broader CI/CD pipeline design
  • annotate-source-files — annotations must exist before CI can generate diagrams
  • commit-changes — understanding auto-commit patterns

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.75%
按下载量换算46

Claude

29.1%
按下载量换算38

Cursor

20.35%
按下载量换算27

Gemini CLI

10.8%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/pjt222/development-guides --skill setup-putior-ci 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills