AGENT SKILL

gh-comment-attach-files

Attach local files to a GitHub issue or pull request comment via Playwright CLI and return the hosted attachment URLs without submitting the comment. Use when you need GitHub-hosted image or document URLs on github.com or GitHub Enterprise Server.

License 许可
Apache-2.0
最近更新
2026-07-21
Stars
★ 0
Forks
0

01 前言 Front Matter

name
gh-comment-attach-files
metadata
{ "owner": "mryfmo", "scope": "personal", "freshness": "90d", "provenance": "repo=mryfmo/dotfiles; license=MIT", "last-verified": 1784592000000 }
description
Attach local files to a GitHub issue or pull request comment via Playwright CLI and return the hosted attachment URLs without submitting the comment. Use when you need GitHub-hosted image or document URLs on github.com or GitHub Enterprise Server.

02 资源文件 3

03 SKILL.md 正文

GitHub Comment Attach Files

Read Acknowledgement

  • After reading this skill, say: 🐙 私は gh-comment-attach-files を読みました。

When To Use

Use this skill when you need GitHub to host local files and give back anonymized attachment URLs, but you do not want Codex to submit the issue or pull request comment itself.

Typical cases:

  • Upload PNG, JPG, PDF, Markdown, or other GitHub-supported attachments to a PR or issue comment box.
  • Replace broken local image URLs in a draft report with GitHub-hosted URLs.
  • Work against either github.com or GitHub Enterprise Server.

Do not use this skill when the task is to actually post, edit, or rewrite a comment. This skill stops after URL acquisition.

Prerequisites

  • npx @playwright/cli must be available.
  • If you use --repo ... --issue ... or --repo ... --pr ..., gh must be installed and authenticated.
  • If GitHub redirects to login or SSO, finish authentication in the opened browser window while the script is polling for the comment composer.

Workflow

  1. Resolve the target page from either a direct URL or gh metadata.
  2. Stage the requested files under ./.playwright-cli/gh-comment-attach-files/....
  3. Open the issue or pull request page with a persistent Playwright CLI browser profile.
  4. Find the main comment composer and attach files one by one.
  5. Read the inserted Markdown and return JSON with target_url, source_path, staged_name, and attachment_url.
  6. Close the browser unless --leave-open is used.

Command

Direct URL:

uv run python ~/.agents/skills/gh-comment-attach-files/scripts/attach_comment_files.py \
  --url https://github.com/OWNER/REPO/pull/123 \
  docs/report.md assets/chart.png

Resolve the page with gh:

uv run python ~/.agents/skills/gh-comment-attach-files/scripts/attach_comment_files.py \
  --repo ghe.corp.yahoo.co.jp/OWNER/REPO \
  --pr 123 \
  results/report.md results/chart.png

Output

The script prints JSON only:

{
  "target_url": "https://github.com/OWNER/REPO/pull/123",
  "attachments": [
    {
      "source_path": "/abs/path/results/chart.png",
      "staged_name": "chart--e5b6d4a1.png",
      "attachment_url": "https://github.com/user-attachments/assets/..."
    }
  ]
}

Notes

  • The script does not submit the comment.
  • staged_name may differ from the original basename so duplicate filenames stay distinct.
  • The default persistent profile lives under ./.playwright-cli/gh-comment-attach-files/profile.
  • Use --leave-open when you want to keep the browser and draft comment visible after the URLs are collected.

Resources

scripts/

  • scripts/attach_comment_files.py: resolves the target page, stages files, drives Playwright CLI, and returns hosted attachment URLs as JSON.

04 同仓库更多 Skills

mryfmo
mryfmo/herness-self-improvement

shdoc-shell-docs

Write and review shellscript documentation with shdoc annotations. Use when Codex creates, edits, or reviews `.sh` files or shell executables and should add, repair, or normalize `@file`, `@brief`, `@description`, `@arg`, `@option`, and `@example` comments to match shdoc conventions.

★ 0
mryfmo
mryfmo/herness-self-improvement

python-uv-workflow

Apply Python development policy using uv-first execution, test-first behavior validation, and pre-commit quality gates. Use when implementing or refactoring Python code.

★ 0
mryfmo
mryfmo/herness-self-improvement

humanizer-ja

AIくさい日本語を、人が書いたように自然でこなれた日本語へ書き換えるスキル。ブログ記事、メモ、メール、文書、SNS投稿、チャット返信などの日本語を書いたり推敲したりするときに使う。AIっぽい言い回しを消したいとき、日本語を自然にしたいとき、言い換えたいとき、硬さを抜きたいとき、トーンを整えたいとき、人間らしい声や温度を足したいときに使う。

★ 0
mryfmo
mryfmo/herness-self-improvement

gh-first-workflow

Enforce gh-first GitHub investigation, pull request maintenance, and Conventional Commit output rules. Use when investigating GitHub issues or pull requests, creating or updating pull requests, summarizing investigation results, or preparing commit messages.

★ 0
mryfmo
mryfmo/herness-self-improvement

convert-to-transformers

Use this skill when converting custom PyTorch models to Hugging Face Transformers format. Helps with: (1) Creating PretrainedConfig and PreTrainedModel classes, (2) Writing ImageProcessor/Tokenizer, (3) Compatibility testing, (4) Hub upload preparation. Use when the user wants to make their model compatible with transformers library.

★ 0
mryfmo
mryfmo/herness-self-improvement

agmsg

Cross-agent messaging via SQLite. Send messages between Claude Code, Codex, Gemini CLI, and other agents. No daemon, no network, no dependencies beyond bash and sqlite3.

★ 0