AgentStack
SKILL unreviewed MIT Self-run

Yaml

skill-leolin990405-r-analytics-skill-yaml · by LeoLin990405

R yaml package for YAML parsing. Use for reading/writing YAML configuration files.

No reviews yet
0 installs
11 views
0.0% view→install

Install

$ agentstack add skill-leolin990405-r-analytics-skill-yaml

Open-source listing — not yet scanned by AgentStack. Follow the source repository for install instructions.

Security review

⚠ Flagged

1 finding(s); flagged for manual review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures
  • high Dangerous shell/eval execution.

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution Used

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Yaml? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

yaml

YAML parsing and generation.

Reading YAML

library(yaml)

# Read from file
config <- read_yaml("config.yml")
config <- yaml.load_file("config.yml")

# Read from string
yaml_str <- "
name: project
version: 1.0
settings:
  debug: true
  threads: 4
"
config <- yaml.load(yaml_str)

Writing YAML

# Write to file
write_yaml(config, "output.yml")

# Convert to string
yaml_str <- as.yaml(config)
cat(yaml_str)

Data Structures

# Lists become YAML mappings
config <- list(
  name = "myproject",
  version = "1.0.0",
  authors = c("Alice", "Bob"),
  settings = list(
    debug = TRUE,
    port = 8080
  )
)
as.yaml(config)
# name: myproject
# version: 1.0.0
# authors:
# - Alice
# - Bob
# settings:
#   debug: yes
#   port: 8080

# Data frames
df <- data.frame(x = 1:3, y = c("a", "b", "c"))
as.yaml(df)

Handlers

# Custom type handlers
handlers <- list(
  "!date" = function(x) as.Date(x),
  "!expr" = function(x) eval(parse(text = x))
)

yaml_str <- "
date: !date 2024-01-15
result: !expr 1 + 2 + 3
"
config <- yaml.load(yaml_str, handlers = handlers)

Options

# Preserve order
config <- yaml.load_file("config.yml",
  eval.expr = FALSE,
  merge.precedence = "override"
)

# Unicode handling
write_yaml(config, "output.yml",
  unicode = TRUE,
  indent = 2
)

# Column width
as.yaml(config, column.major = FALSE, indent.mapping.sequence = TRUE)

Common Patterns

# Configuration file
config <- list(
  database = list(
    host = "localhost",
    port = 5432,
    name = "mydb"
  ),
  logging = list(
    level = "INFO",
    file = "app.log"
  ),
  features = list(
    enabled = c("auth", "cache"),
    disabled = c("beta")
  )
)
write_yaml(config, "config.yml")

# Read and use
config <- read_yaml("config.yml")
db_host <- config$database$host
log_level <- config$logging$level

Multi-Document YAML

# Read multiple documents
docs <- yaml.load_file("multi.yml",
  readLines.warn = FALSE,
  multi.document = TRUE
)

# Each document is a list element
doc1 <- docs[[1]]
doc2 <- docs[[2]]

Error Handling

# Safe loading
tryCatch({
  config <- read_yaml("config.yml")
}, error = function(e) {
  message("YAML parse error: ", e$message)
  config <- list()  # Default config
})

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.