setup-putior-ci
정보
이 스킬은 GitHub Actions CI/CD 파이프라인을 설정하여 모든 푸시 시마다 putior 워크플로우 다이어그램을 자동으로 재생성합니다. 필요한 워크플로우 YAML 파일, 센티넬 마커가 포함된 다이어그램 생성용 R 스크립트를 생성하며, 업데이트된 다이어그램의 자동 커밋을 처리합니다. 다이어그램이 항상 최신 코드 상태를 반영해야 하거나 수동 재생성을 자동화로 대체할 필요가 있을 때 사용하세요.
빠른 설치
Claude Code
추천npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/setup-putior-ciClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Putior-CI einrichten
Konfigurieren GitHub Actions to automatisch regenerate workflow diagrams when Quellcode changes, keeping documentation in sync with code.
Wann verwenden
- 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
Eingaben
- Erforderlich: GitHub repository with putior annotations in Quelldateis
- Erforderlich: 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)
Vorgehensweise
Schritt 1: Erstellen GitHub Actions Workflow
Erstellen der 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
Erwartet: File created at .github/workflows/update-workflow-diagram.yml.
Bei Fehler: Sicherstellen the .github/workflows/ directory exists. Anpassen the paths filter to match where annotated Quelldateis live in das Repository.
Schritt 2: Schreiben Generation Script
Erstellen 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")
Erwartet: Script at scripts/generate-workflow-diagram.R that reads annotations, generates Mermaid code, and replaces content zwischen sentinel markers.
Bei Fehler: If put_merge() returns empty, check that source paths match das Repository layout. Anpassen "./R/" to the actual source directory.
Schritt 3: Konfigurieren Auto-Commit
The workflow must avoid infinite loops where an auto-commit re-triggers the same workflow. Pushes made with the default GITHUB_TOKEN typischerweise nicht trigger new workflow runs, but der Workflow also includes an explicit if: guard on the job as a safety net.
Key configuration points:
Berechtigungs: contents: writegrants push accessif: github.actor != 'github-actions[bot]'skips the job when the push came from the bot itselfgit diff --staged --quiet || git commitonly 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]
Erwartet: The workflow only commits when diagrams actually change. No empty commits, no infinite loops.
Bei Fehler: If push fails with Berechtigung denied, check repository settings: Settings > Actions > General > Workflow Berechtigungs muss set to "Lesen and write Berechtigungs".
Schritt 4: Hinzufuegen Sentinel Markers to README
Insert sentinel markers in das Ziel file where the diagram should appear.
## Workflow
<!-- PUTIOR-WORKFLOW-START -->
<!-- This section is auto-generated by putior CI. Do not edit manually. -->
```mermaid
flowchart TD
A["Placeholder — wird replaced on next CI run"]
<!-- PUTIOR-WORKFLOW-END -->
**Erwartet:** Sentinel markers in README.md (or other target file). The content zwischen them wird replaced on each CI run.
**Bei Fehler:** Sicherstellen markers are on their own lines with no leading/trailing whitespace. The script matches exact line content.
### Schritt 5: Testen the Pipeline
Ausloesen der Workflow and verify the diagram updates.
```bash
# 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"
Erwartet: GitHub Actions run completes erfolgreich. The diagram zwischen sentinel markers in README.md is updated with current workflow data.
Bei Fehler: Check the Actions log for errors. Common issues:
putiorpackage not available: add toDESCRIPTIONSuggests or install explicitly in der Workflow- Source path wrong: the R script's
put_merge()path muss relative to the repo root - No sentinel markers: the script warns but doesn't crash; add markers to README.md
Validierung
-
.github/workflows/update-workflow-diagram.ymlexists and is valid YAML -
scripts/generate-workflow-diagram.Rruns ohne 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 zwischen sentinels is updated nach a workflow run
- Job-level
if:guard prevents infinite commit loops from bot pushes - No changes = no commit (idempotent)
Haeufige Stolperfallen
- Infinite CI loops: Pushes with the default
GITHUB_TOKENtypischerweise don't trigger new runs, but always add an explicitif: github.actor != 'github-actions[bot]'guard on the job. The[skip ci]tag in the commit message is a useful convention but ist nicht a built-in GitHub Actions mechanism. - Permission denied on push: GitHub Actions needs write Berechtigung. Set
Berechtigungs: contents: writein der 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 Verzeichnisstruktur. - Package installation in CI: If das Projekt uses renv, the CI workflow needs
renv::restore()vor putior ist verfuegbar. Alternatively, install putior explicitly in der Workflow. - Large repos slowing CI: For repos with many Quelldateis, limit the
pathstrigger filter to directories that contain PUT annotations, not the entire repo.
Verwandte Skills
generate-workflow-diagram— the manual version of what this CI automatessetup-github-actions-ci— general GitHub Actions CI/CD setup for R packagesbuild-ci-cd-pipeline— broader CI/CD pipeline designannotate-source-files— annotations must exist vor CI can generate diagramscommit-changes— understanding auto-commit patterns
GitHub 저장소
연관 스킬
content-collections
메타이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.
polymarket
메타이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.
creating-opencode-plugins
메타이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.
sglang
메타SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.
