Skip to content

Add article direction skill - #143

Open
ara-ta3 wants to merge 1 commit into
mainfrom
codex/add-zenn-skills
Open

Add article direction skill#143
ara-ta3 wants to merge 1 commit into
mainfrom
codex/add-zenn-skills

Conversation

@ara-ta3

@ara-ta3 ara-ta3 commented Mar 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • 既存記事の分析から新しい記事の方向性を提案する derive-article-direction スキルを追加
  • フォーマット、エージェント、参考資料、記事信号収集用スクリプトを含めてスキルの構成を整備

Testing

  • Not run (not requested)

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

このプルリクエストは、既存のコンテンツリポジトリから新しい記事の執筆方向を効果的に特定するための新しい機能を追加します。これにより、コンテンツ作成者は、既に公開されている記事との重複を避けつつ、読者のニーズに合致し、かつ既存のコンテンツ群と関連性の高い記事のアイデアを効率的に生成できるようになります。

Highlights

  • 新しいスキル derive-article-direction の追加: 既存のMarkdown記事群を分析し、新しい記事の方向性を提案することを目的とした新しいスキルが追加されました。
  • スキルの構成整備: 記事のシグナルを収集するためのPythonスクリプト、OpenAIエージェントの設定、および提案の標準出力フォーマットを含む、スキルの構成が整備されました。
  • 記事方向性提案のヒューリスティック: 提案される記事の方向性は、既存記事の根拠に基づいており、読者レベル、問題設定、対象環境、比較軸、運用フェーズなどの観点から差別化ポイントを明確にするためのヒューリスティックが定義されています。

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • skills/derive-article-direction/SKILL.md
    • 新しい derive-article-direction スキルの目的、ワークフロー、ヒューリスティック、出力ガイドラインを詳述したドキュメントが追加されました。
  • skills/derive-article-direction/agents/openai.yaml
    • derive-article-direction スキルのOpenAIエージェント設定が追加され、表示名、簡単な説明、デフォルトプロンプトが定義されました。
  • skills/derive-article-direction/references/output-format.md
    • 記事の方向性提案のための標準出力フォーマットを定義するMarkdownファイルが追加されました。これには、結論、根拠となる既存記事、推奨方向性、タイトル案、構成案などが含まれます。
  • skills/derive-article-direction/scripts/collect_article_signals.py
    • Markdown記事からフロントマター、見出し、導入段落を抽出し、関連性スコアを計算するPythonスクリプトが追加されました。
Activity
  • このプルリクエストは、ara-ta3 によって作成されました。現時点では、追加のレビューコメントや活動は記録されていません。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

ぼくはずんだもんなのだ!このプルリクエスト、とっても良い感じなのだ。新しい derive-article-direction スキルを追加して、既存の記事から次の記事の方向性を見つけるなんて、すごく賢いのだ。ドキュメントやスクリプトがしっかり整備されていて、素晴らしい仕事なのだ。
特に、collect_article_signals.py スクリプトは、記事の情報を集める中心的な役割を担っていて、よくできているのだ。ただ、もっと良くするために、いくつか提案があるのだ。スクリプトがエラーで止まらないようにしたり、コードをもう少しスッキリさせたりできると思うのだ。詳しいことは、下のコメントを見てほしいのだ。

Comment on lines +161 to +175
for path in paths:
text = path.read_text(encoding="utf-8")
frontmatter, body = parse_frontmatter(text)
signal = ArticleSignal(
path=str(path),
title=str(frontmatter.get("title", path.stem)),
topics=[str(topic) for topic in frontmatter.get("topics", [])],
article_type=str(frontmatter.get("type", "")),
published=frontmatter.get("published") if isinstance(frontmatter.get("published"), bool) else None,
headings=extract_headings(body, heading_limit),
lead=extract_lead(body),
score=0,
)
signal.score = compute_score(signal, queries)
signals.append(signal)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

ぼくはずんだもんなのだ!collect_signals 関数の中で、ファイルを一つずつ処理しているけど、もしファイルの読み込みや解析でエラーが起きたら、スクリプト全体が止まっちゃうのだ。例えば、ファイルが壊れていたり、文字コードが違っていたりすると問題なのだ。
try...except ブロックを使って、エラーが起きてもそのファイルだけをスキップして、処理を続けられるようにするのがおすすめなのだ。こうすれば、もっと頑丈なスクリプトになるのだ!

Suggested change
for path in paths:
text = path.read_text(encoding="utf-8")
frontmatter, body = parse_frontmatter(text)
signal = ArticleSignal(
path=str(path),
title=str(frontmatter.get("title", path.stem)),
topics=[str(topic) for topic in frontmatter.get("topics", [])],
article_type=str(frontmatter.get("type", "")),
published=frontmatter.get("published") if isinstance(frontmatter.get("published"), bool) else None,
headings=extract_headings(body, heading_limit),
lead=extract_lead(body),
score=0,
)
signal.score = compute_score(signal, queries)
signals.append(signal)
for path in paths:
try:
text = path.read_text(encoding="utf-8")
frontmatter, body = parse_frontmatter(text)
signal = ArticleSignal(
path=str(path),
title=str(frontmatter.get("title", path.stem)),
topics=[str(topic) for topic in frontmatter.get("topics", [])],
article_type=str(frontmatter.get("type", "")),
published=frontmatter.get("published") if isinstance(frontmatter.get("published"), bool) else None,
headings=extract_headings(body, heading_limit),
lead=extract_lead(body),
score=0,
)
signal.score = compute_score(signal, queries)
signals.append(signal)
except (IOError, UnicodeDecodeError):
continue

Comment on lines +184 to +190
published = (
"true"
if signal.published is True
else "false"
if signal.published is False
else "unknown"
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

ぼくはずんだもんなのだ!format_markdown 関数の中で published の状態を文字列に変換する部分、ちょっとコードが長くて読みにくいかもしれないのだ。
ネストした三項演算子よりも、辞書の get メソッドを使うともっとスッキリ書けるのだ。コードが短くなって、何をしているか分かりやすくなるのだ!

        published = {True: "true", False: "false"}.get(signal.published, "unknown")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant