Skip to content

Conversation

@azu
Copy link
Owner

@azu azu commented Jan 14, 2026

  • Claude Codeと連携して、入力内容を取得
image

azu and others added 3 commits January 14, 2026 21:18
URLを入力するとClaude Code CLIを使ってJSer.info風の説明文を自動生成する機能を追加。
- ClaudeCodeButton: URL横のボタンでClaude Code実行
- ClaudeCodePreview: 生成結果のプレビュー表示
- Cmd+Shift+Jで結果をEditorに挿入
- MCP設定によるjser-infoツールの利用

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
コメント欄への挿入時に既存テキストに追記するのではなく、
生成結果で全体を置き換えるように修正。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 14, 2026 13:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR integrates Claude Code functionality to automatically generate descriptive text from URLs. When a user enters a URL, the application can invoke Claude Code via CLI to fetch and generate content based on that URL.

Changes:

  • Added Claude Code integration with automatic URL processing triggered by URL input changes
  • Implemented UI components (button and preview) to control and display AI-generated results
  • Added keyboard shortcut (Cmd+Shift+J) to insert generated content into the editor

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/browser/service-instance.js Added getClaudeCodeConfig() function to retrieve Claude Code configuration with test environment detection
src/browser/component/Editor.js Added onInsertClaudeCode prop and keyboard shortcut handler for Cmd+Shift+J
src/browser/component/ClaudeCodePreview.js New component to display AI generation results with error/success states
src/browser/component/ClaudeCodeButton.js New component providing UI button for Claude Code with auto-trigger on URL changes
src/browser/Store/ServiceStore.js Added Claude Code state management including status tracking and action handlers
src/browser/App.js Integrated Claude Code components and wired up action handlers
src/browser/Action/ServiceActionConst.js Added Claude Code action constants
src/browser/Action/ServiceAction.js Implemented Claude Code execution logic using child process spawn
css/index.css Added styles for Claude Code button and preview components

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


const { spawn } = require("child_process");
const fs = require("fs");
const path = require("path");
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The path module is imported but never used in this file. Consider removing the unused import.

Suggested change
const path = require("path");

Copilot uses AI. Check for mistakes.
this.dispatch(keys.claudeCodeStart, { url });

// 設定からプロンプトを使用
const prompt = `${config.prompt}\n\nURL: ${url}`;
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The url parameter is directly interpolated into the prompt without validation or sanitization. While the URL is checked to start with 'http' in the calling code, this creates a potential command injection risk if the URL contains special characters. Consider validating or escaping the URL before using it in the prompt that will be passed to the spawned process.

Copilot uses AI. Check for mistakes.
- requireをimportに統一
- デバッグログを削除
- _extractDescriptionをインライン化
- 未使用のpath importを削除

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@azu azu added the Type: Feature New Feature label Jan 14, 2026
getContentがundefinedを返す場合にdestructureエラーが
発生していた問題を修正。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@azu azu enabled auto-merge (squash) January 14, 2026 14:53
@azu azu merged commit 6a6bd84 into master Jan 14, 2026
5 checks passed
@azu azu deleted the claude branch January 14, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature New Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants