hatena-blog-publisher
Skill2 starsChanged 9 months agoMITView on GitHub
Use this skill when the user wants to publish a local file as a Hatena Blog entry, create a Hatena Blog draft from Markdown or text, or automate Hatena Blog posting with the AtomPub API. Trigger when the user mentions はてなブログ, Hatena Blog, posting a file as an article, creating a blog draft, or asks to run the bundled publisher script. The script reads the first line as the article title and sends the complete file content as Markdown.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- azure-paas-supportSkill
- azure-resource-abbreviationsSkill
- backlog-apiSkill
- csharp-file-based-appsSkill
- dependabot-auto-mergeSkill
- devblog-updatesSkill
- github-changelogSkill
- github-entra-federated-credentialsSkill
- git-worktreeSkill
- marp-cssSkill
- marp-deckSkill
- summarized-postSkill
The file
Files
Hatena Blog Publisher
指定されたローカルファイルの内容を、はてなブログの記事として投稿するスキル。 現在のスクリプトは公開せず、常に下書きとして投稿する。
前提条件
- .NET 10 SDK 以降(C# file-based app の実行に使用)
- はてなブログのブログID
- はてなブログAtomPub APIで利用するユーザー名とAPIキー
- 投稿対象ファイルへの読み取りアクセス
認証情報はソースコードに埋め込まず、スクリプトの入力パラメーターとして渡す。
| パラメーター | 内容 | 例 |
username | はてなユーザー名 | example |
api-key | はてなブログAPIキー | ... |
blog-id | ブログID(通常はドメイン) | example.hatenablog.com |
file-path | 投稿対象ファイルのパス | articles\2026-09-05.md |
実行方法
スキルディレクトリを基準に、次のコマンドで実行する。
dotnet run --file scripts\hatena-client.cs -- <username> <api-key> <blog-id> <file-path>例:
dotnet run --file scripts\hatena-client.cs -- example your-api-key example.hatenablog.com articles\2026-09-05.md入力ファイルの扱い
- ファイルが存在しない場合はエラーを標準エラー出力に表示して終了する。
- 先頭行を記事タイトルとして使用する。
- 先頭行の
#は取り除き、前後の空白を除去する。したがって、Markdownの# タイトルを先頭行に置ける。 - ファイル全体を記事本文として送信する。本文のMarkdown記法は保持される。
- 空行や本文中の見出しは変更しない。
推奨する入力例:
# はてなブログの記事タイトル
ここから記事本文です。
## セクション
本文をMarkdownで記述します。投稿仕様
https://blog.hatena.ne.jp/{username}/{blogId}/atom/entryにAtomPub APIでPOSTする。- Basic認証に
usernameとapi-keyを使用する。 - Atomエントリの本文タイプは
text/markdownにする。 app:draft=yesを付けるため、投稿結果は下書きになる。- カテゴリは現在指定しない。
実行時には送信するXMLとHTTPステータス、APIレスポンス本文が標準出力に表示される。 APIキー自体はXML本文に含まれないが、記事本文が表示されるため、共有端末やCIログで 実行する場合はログの取り扱いに注意する。
ワークフロー
- 投稿するファイルのパスと、先頭行が意図したタイトルになっていることを確認する。
username、api-key、blog-idを準備する。APIキーはシェル履歴やCIログに 残る可能性があるため、必要に応じて安全な実行環境から渡す。- 上記のコマンドでスクリプトを実行する。
- HTTPステータスとレスポンス本文を確認し、はてなブログ管理画面で下書きを確認する。
- 内容・タイトル・公開設定を確認してから、管理画面で公開する。
関連ファイル
- 実行スクリプト:
scripts\hatena-client.cs - C# file-based app の実行方法: csharp-file-based-apps
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

