annotate-source-files
정보
이 스킬은 30개 이상의 프로그래밍 언어에 대해 각 언어별 주석 구문을 사용하여 소스 파일에 PUT 워크플로 주석을 자동으로 추가합니다. 주석 생성, 다중 줄 형식 지정, .internal 변수 처리, 자동 주석 접두사 감지를 통한 검증 기능을 제공합니다. 주석 계획을 수립한 후 기존 코드베이스, 데이터 파이프라인 또는 다단계 계산 작업에서 워크플로를 문서화할 때 사용하세요.
빠른 설치
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/annotate-source-filesClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Annotate Source Files
Add PUT workflow annotations → putior extracts structured workflow data + generates Mermaid diagrams.
Use When
- After
analyze-codebase-workflow+ annotation plan - Add workflow docs new/existing src
- Enrich auto-detected w/ manual labels + connections
- Doc data pipelines, ETL, multi-step computations
In
- Required: Src files to annotate
- Required: Annotation plan or workflow steps knowledge
- Optional: Style — single-line or multiline (default: single-line)
- Optional: Use
put_generate()skeletons? (default: yes)
Do
Step 1: Determine Comment Prefix
Each lang has specific prefix. get_comment_prefix() → 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") # "--"
→ String like "#", "--", "//", or "%".
Line + block comments: putior detects annotations in both line comments (
//,#,--) + C-style block comments (/* */,/** */). JS/TS both//+/* */scanned. Python triple-quote strings (''' ''') not detected — use#for Python.
If err: Ext not recognized → lang may not be supported. Check get_supported_extensions(). Unsupported langs → use # conventional default.
Step 2: Generate Skeletons
put_generate() → 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 out for R file:
# put id:'extract_data', label:'Extract Customer Data', input:'customers.csv', output:'raw_data.internal'
Example out for SQL:
-- put id:'load_data', label:'Load Customer Table', output:'customers'
→ 1+ annotation comment lines per file, pre-filled w/ detected fn names + I/O.
If err: No suggestions → file may not have recognizable I/O patterns. Write annotations manually.
Step 3: Refine Annotations
Edit generated skeletons → accurate labels, connections, metadata.
Annotation syntax:
<prefix> put id:'unique_id', label:'Human Readable Label', input:'file1.csv, file2.rds', output:'result.parquet, summary.internal'
Fields:
id(required): Unique ID, for node connectionslabel(required): Human-readable desc shown diagraminput: Comma-separated insoutput: Comma-separated outs.internalext: Marks in-memory vars (not persisted between scripts)node_type: Mermaid shape + class styling. Values:"input"— stadium shape([...])data srcs + config"output"— subroutine shape[[...]]generated artifacts"process"— rectangle[...]processing steps (default)"decision"— diamond{...}conditional logic"start"/"end"— stadium shape([...])entry/terminal
Example w/ 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 (complex):
# put id:'complex_step', \
# label:'Multi-line Label', \
# input:'data.csv, config.yaml', \
# output:'result.parquet'
Block comment syntax (//-prefix langs only: JS, TS, Go, Rust, C, C++, Java, etc.):
Langs w/ // line comments also support PUT in /* */ + /** */ blocks. Use * put as line prefix inside block body:
/* put id:'init', label:'Initialize Config', output:'config.internal' */
/**
* put id:'process', \
* label:'Process Records', \
* input:'config.internal, records.json', \
* output:'results.json'
*/
function processRecords(config, records) {
// ...
}
JSDoc annotations useful documenting workflow + API docs:
/**
* Transform raw sensor data into normalized readings.
* put id:'normalize', label:'Normalize Sensor Data', input:'raw_readings.json', output:'normalized.parquet'
*/
export function normalizeSensorData(readings: SensorReading[]): NormalizedData {
// ...
}
Note: Block comment annotations not supported for
#-prefix (R, Python, Shell) or---prefix (SQL, Lua). Line comments only those. Block-originated no backslash continuation across lines.
Cross-file data flow (connect 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")
→ Annotations refined w/ accurate IDs, labels, I/O reflecting actual data flow.
If err: Unsure I/O → .internal ext for in-memory intermediates + explicit file names for persisted.
Step 4: Insert Annotations
Place at top of file or immediately above relevant code block.
Placement conventions:
- File-level: Top after shebang or header comment
- Block-level: Immediately above code block it describes
- Multi per file: Distinct workflow phases
Example in R:
#!/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")
Edit tool → insert into existing files no disturb surrounding.
→ Annotations inserted at appropriate locations per file.
If err: Break syntax highlighting → verify prefix correct for lang. PUT = std comments + should not affect exec.
Step 5: Validate
Run putior validation → syntax + 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"))
→ All annotations parse no err. Diagram shows connected workflow. put_merge() fills gaps from auto-detection.
If err: Common issues:
- Missing close quote:
id:'name→id:'name' - Double quotes inside:
id:"name"→id:'name' - Duplicate IDs across files: each
idmust be unique across entire scanned dir - Backslash continuation wrong line:
\must be last char before newline
Check
- Every annotated file has syntactically valid PUT annotations
-
put("./src/")returns df w/ expected node count - No duplicate
idvalues across scanned dir -
put_diagram()produces connected flowchart (not all isolated) - Multiline annotations (if used) parse correct w/ backslash continuation
-
.internalvars appear only outputs, never cross-file ins - Files excluded via
excludeno appear in workflow (e.g.,put("./src/", exclude = "test_")skips test helpers)
Traps
- Quote nesting: PUT uses single quotes:
id:'name'. Double quotes → parsing issues when annotation in string ctx. - Duplicate IDs: Every
idmust be globally unique within scanned scope. Naming:<script>_<step>(e.g.,extract_read,transform_clean). - .internal as cross-file in:
.internalexists only during script exec. Pass data between scripts → persisted file format (.rds,.csv,.parquet) as out of one + in of next. - Missing connections: Disconnected nodes → check out filenames in 1 annotation exactly match in filenames in another (including exts).
- Wrong prefix:
#in SQL or//in Python → annotation treated as code not comment. Always verifyget_comment_prefix(). - Forget multiline continuation: Every continued line must end
\+ next line must start w/ comment prefix. - Python triple-quote strings: putior no scan (
''' ''',""" """). Always#for Python PUT. - Meta-pipeline annotations: Annotate build script that also scans for annotations (e.g., script calling
put()+put_diagram()) → script's own annotations appear in generated diagram. Exclude file from scanning (seegenerate-workflow-diagramTraps) or no PUT in build script itself.
→
analyze-codebase-workflow— prereq: produces annotation plan this followsgenerate-workflow-diagram— next: generate final from annotationsinstall-putior— putior installed before annotatingconfigure-putior-mcp— MCP tools interactive annotation assistance
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을 선택하십시오.
