MCP HubMCP Hub
스킬 목록으로 돌아가기

annotate-source-files

pjt222
업데이트됨 2 days ago
8 조회
17
2
17
GitHub에서 보기
메타wordautomationdata

정보

이 스킬은 30개 이상의 프로그래밍 언어에 대해 언어별 올바른 주석 구문을 사용하여 소스 파일에 PUT 워크플로 주석을 자동으로 추가합니다. 주석 생성, 다중 줄 형식 지정 및 유효성 검사를 처리하여 코드베이스, 데이터 파이프라인 또는 다단계 계산을 문서화하는 데 이상적입니다. 기존 또는 새 파일에 구조화된 워크플로 문서를 추가해야 할 때 코드베이스 분석 후에 사용하세요.

빠른 설치

Claude Code

추천
기본
npx skills add pjt222/agent-almanac -a claude-code
플러그인 명령대체
/plugin add https://github.com/pjt222/agent-almanac
Git 클론대체
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/annotate-source-files

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Annotate Source Files

Add PUT workflow annotations to source files so putior can extract structured workflow data and generate Mermaid diagrams.

Cuándo Usar

  • After analyzing a codebase with analyze-codebase-workflow and having an annotation plan
  • Adding workflow documentation to new or existing source files
  • Enriching auto-detected workflows with manual labels and connections
  • Documenting data pipelines, ETL processes, or multi-step computations

Entradas

  • Requerido: Source files to annotate
  • Requerido: Annotation plan or knowledge of the workflow steps
  • Opcional: Style preference: single-line or multiline (default: single-line)
  • Opcional: Whether to use put_generate() for skeleton generation (default: yes)

Procedimiento

Paso 1: Determine Comment Prefix

Each language has a specific comment prefix for PUT annotations. Use get_comment_prefix() to find the correct one.

library(putior)

# Common prefixes
get_comment_prefix("R")    # "#"
get_comment_prefix("py")   # "#"
get_comment_prefix("sql")  # "--"
get_comment_prefix("js")   # "//"
get_comment_prefix("ts")   # "//"
get_comment_prefix("go")   # "//"
get_comment_prefix("rs")   # "//"
get_comment_prefix("m")    # "%"
get_comment_prefix("lua")  # "--"

Esperado: A string like "#", "--", "//", or "%".

Line and block comments: putior detects annotations in both line comments (//, #, --) and C-style block comments (/* */, /** */). For JS/TS, both // and /* */ blocks are scanned. Python triple-quote strings (''' ''') are not detected — use # for Python annotations.

En caso de fallo: If the extension is not recognized, the file language may not be supported. Check get_supported_extensions() for the full list. For unsupported languages, use # as a conventional default.

Paso 2: Generate Annotation Skeletons

Use put_generate() to create annotation templates based on auto-detected I/O.

# Print suggestions to console
put_generate("./src/etl/")

# Single-line style (default)
put_generate("./src/etl/", style = "single")

# Multiline style for complex annotations
put_generate("./src/etl/", style = "multiline")

# Copy to clipboard for pasting
put_generate("./src/etl/", output = "clipboard")

Example output for an R file:

# put id:'extract_data', label:'Extract Customer Data', input:'customers.csv', output:'raw_data.internal'

Example output for SQL:

-- put id:'load_data', label:'Load Customer Table', output:'customers'

Esperado: One or more annotation comment lines per source file, pre-filled with detected function names and I/O.

En caso de fallo: If no suggestions are generated, the file may not contain recognizable I/O patterns. Write annotations manually based on your understanding of the code.

Paso 3: Refine Annotations

Edit the generated skeletons to add accurate labels, connections, and metadata.

Annotation syntax reference:

<prefix> put id:'unique_id', label:'Human Readable Label', input:'file1.csv, file2.rds', output:'result.parquet, summary.internal'

Fields:

  • id (required): Unique identifier, used for node connections
  • label (required): Human-readable description shown in diagram
  • input: Comma-separated list of input files or variables
  • output: Comma-separated list of output files or variables
  • .internal extension: Marks in-memory variables (not persisted between scripts)
  • node_type: Controls Mermaid node shape and class styling. Values:
    • "input" — stadium shape ([...]) for data sources and configuration
    • "output" — subroutine shape [[...]] for generated artifacts
    • "process" — rectangle [...] for processing steps (default)
    • "decision" — diamond {...} for conditional logic
    • "start" / "end" — stadium shape ([...]) for entry/terminal nodes

Example with node_type:

# put id:'config', label:'Load Config', node_type:'input', output:'config.internal'
# put id:'transform', label:'Apply Rules', node_type:'process', input:'config.internal', output:'result.rds'
# put id:'report', label:'Generate Report', node_type:'output', input:'result.rds'

Multiline syntax (for complex annotations):

# put id:'complex_step', \
#   label:'Multi-line Label', \
#   input:'data.csv, config.yaml', \
#   output:'result.parquet'

Cross-file data flow (connecting scripts via file-based I/O):

# Script 1: extract.R
# put id:'extract', label:'Extract Data', output:'raw_data.internal, raw_data.rds'
data <- read.csv("source.csv")
saveRDS(data, "raw_data.rds")

# Script 2: transform.R
# put id:'transform', label:'Transform Data', input:'raw_data.rds', output:'clean_data.parquet'
data <- readRDS("raw_data.rds")
arrow::write_parquet(clean, "clean_data.parquet")

Esperado: Annotations refined with accurate IDs, labels, and I/O fields that reflect actual data flow.

En caso de fallo: If unsure about I/O, use .internal extension for in-memory intermediates and explicit file names for persisted data.

Paso 4: Insert Annotations into Files

Place annotations at the top of each file or immediately above the relevant code block.

Placement conventions:

  1. File-level annotation: Place at the top of the file, after any shebang line or file header comment
  2. Block-level annotation: Place immediately above the code block it describes
  3. Multiple annotations per file: Use for files with distinct workflow phases

Example placement in an R file:

#!/usr/bin/env Rscript
# ETL Extract Script
#
# put id:'read_source', label:'Read Source Data', input:'raw_data.csv', output:'df.internal'

df <- read.csv("raw_data.csv")

# put id:'clean_data', label:'Clean and Validate', input:'df.internal', output:'clean.rds'

df_clean <- df[complete.cases(df), ]
saveRDS(df_clean, "clean.rds")

Use the Edit tool to insert annotations into existing files without disturbing surrounding code.

Esperado: Annotations inserted at appropriate locations in each source file.

En caso de fallo: If annotations break syntax highlighting in the editor, ensure the comment prefix is correct for the language. PUT annotations are standard comments and should not affect code execution.

Paso 5: Validate Annotations

Run putior's validation to check annotation syntax and connectivity.

# Scan annotated files
workflow <- put("./src/", validate = TRUE)

# Check for validation issues
print(workflow)
cat(sprintf("Total nodes: %d\n", nrow(workflow)))

# Verify connections by checking input/output overlap
inputs <- unlist(strsplit(workflow$input, ",\\s*"))
outputs <- unlist(strsplit(workflow$output, ",\\s*"))
connected <- intersect(inputs, outputs)
cat(sprintf("Connected data flows: %d\n", length(connected)))

# Generate diagram to visually inspect
cat(put_diagram(workflow, theme = "github", show_source_info = TRUE))

# Merge with auto-detected for maximum coverage
merged <- put_merge("./src/", merge_strategy = "supplement")
cat(put_diagram(merged, theme = "github"))

Esperado: All annotations parse without errors. The diagram shows a connected workflow. put_merge() fills in any gaps from auto-detection.

En caso de fallo: Common validation issues:

  • Missing closing quote: id:'nameid:'name'
  • Using double quotes inside: id:"name"id:'name'
  • Duplicate IDs across files: each id must be unique across the entire scanned directory
  • Backslash continuation on the wrong line: the \ must be the last character before newline

Validación

  • Every annotated file has syntactically valid PUT annotations
  • put("./src/") returns a data frame with the expected number of nodes
  • No duplicate id values across the scanned directory
  • put_diagram() produces a connected flowchart (not all isolated nodes)
  • Multiline annotations (if used) parse correctly with backslash continuation
  • .internal variables appear only as outputs, never as cross-file inputs

Errores Comunes

  • Quote nesting errors: PUT annotations use single quotes: id:'name'. Double quotes cause parsing issues when the annotation is inside a string context.
  • Duplicate IDs: Every id must be globally unique within the scanned scope. Use a naming convention like <script>_<step> (e.g., extract_read, transform_clean).
  • .internal as cross-file input: .internal variables exist only during script execution. To pass data between scripts, use a persisted file format (.rds, .csv, .parquet) as the output of one script and input of the next.
  • Missing connections: If the diagram shows disconnected nodes, check that output filenames in one annotation exactly match input filenames in another (including extensions).
  • Wrong comment prefix: Using # in a SQL file or // in Python will cause the annotation to be treated as code, not a comment. Always verify with get_comment_prefix().
  • Forgetting multiline continuation: When using multiline annotations, every continued line must end with \ and the next line must start with the comment prefix.
  • Python triple-quote strings: putior does not scan Python triple-quote strings (''' ''', """ """). Always use # for Python PUT annotations.
  • Meta-pipeline annotations: If you annotate a build script that also scans for annotations (e.g., a script that calls put() and put_diagram()), the script's own annotations will appear in the generated diagram. Either exclude the file from scanning (see generate-workflow-diagram Common Pitfalls) or avoid placing PUT annotations in the build script itself.

Habilidades Relacionadas

  • analyze-codebase-workflow — prerequisite: produces the annotation plan this skill follows
  • generate-workflow-diagram — next step: generate the final diagram from annotations
  • install-putior — putior must be installed before annotating
  • configure-putior-mcp — MCP tools provide interactive annotation assistance

GitHub 저장소

pjt222/agent-almanac
경로: i18n/es/skills/annotate-source-files
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

연관 스킬

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을 선택하십시오.

스킬 보기