/SKILL.md
# Shiny アプリでの日本語フォント設定 (macOS対策) macOS 上で R のプロット(特に Base R の `plot()` や `hist()`)を行う際、日本語が「トーフ(□)」のように文字化けすることがあります。これを防ぐために、OS が macOS であるかを判定し、適切な日本語フォント(ヒラギノ角ゴシックなど)を指定します。 ## 実装パターン ### Base R プロットの場合 `renderPlot` 内で描画を行う**直前**に、`par()` 関数を使ってフォントファミリーを指定します。 ```r # 共通関数として定義しておくと便利です set_font <- function() { if (Sys.info()["sysname"] == "Darwin") { par(family = "HiraKakuProN-W3") # ヒラギノ角ゴシック ProN W3 } } server <- function(input, output) { output$myPlot <- renderPlot({
npx skillsauth add kenjimyzk/my-r-shiny my-r-shinyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
macOS 上で R のプロット(特に Base R の plot() や hist())を行う際、日本語が「トーフ(□)」のように文字化けすることがあります。これを防ぐために、OS が macOS であるかを判定し、適切な日本語フォント(ヒラギノ角ゴシックなど)を指定します。
renderPlot 内で描画を行う直前に、par() 関数を使ってフォントファミリーを指定します。
# 共通関数として定義しておくと便利です
set_font <- function() {
if (Sys.info()["sysname"] == "Darwin") {
par(family = "HiraKakuProN-W3") # ヒラギノ角ゴシック ProN W3
}
}
server <- function(input, output) {
output$myPlot <- renderPlot({
# プロット作成前に実行
set_font()
# プロット描画
plot(
x, y,
main = "日本語のタイトル",
xlab = "日本語のX軸",
ylab = "日本語のY軸"
)
})
}
ggplot2 を使用する場合は、theme() 関数内でフォントを指定します。
library(ggplot2)
# Mac用フォント設定
font_family <- if (Sys.info()["sysname"] == "Darwin") "HiraKakuProN-W3" else ""
ggplot(data, aes(x, y)) +
geom_point() +
labs(title = "日本語タイトル") +
theme_gray(base_family = font_family) # テーマにフォントを適用
Darwin) に特化しています。Windows や Linux ではデフォルトで表示されることが多いですが、表示されない場合は Meiryo (Win) や Noto Sans CJK JP (Linux) などを指定する必要があります。showtext パッケージを使用する方法もありますが、パッケージのインストールが必要です。tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.