This skill should be used when the user asks to "fetch GitHub repos", "GitHub取得", "GitHub直接取得", "GitHubをDB投入", "リポジトリ取得", or mentions fetching GitHub repository data directly into table_database.db without Google Drive.
GitHub REST API からリポジトリ情報・Issue・PR を直接取得し、table_database.db + JSON に保存する (Drive不要)。
.env に GITHUB_TOKEN + GH_OWNER 設定済みcd /Users/sennin/Documents/GitHub/8888_AGI5
# 全リポジトリの情報取得 → JSON 保存
set -a && source .env && set +a
PYTHONPATH=claude/src python3 -c "
import os, json, requests
token = os.environ['GITHUB_TOKEN']
owner = os.environ['GH_OWNER']
headers = {'Authorization': f'token {token}', 'Accept': 'application/vnd.github.v3+json'}
# リポジトリ一覧
repos = requests.get(f'https://api.github.com/users/{owner}/repos?per_page=100', headers=headers).json()
os.makedirs('data/github_export', exist_ok=True)
with open('data/github_export/repos.json', 'w') as f:
json.dump(repos, f, ensure_ascii=False, indent=2)
print(f'{len(repos)} repos saved to data/github_export/repos.json')
# 各リポの Issues/PRs
for repo in repos:
name = repo['name']
issues = requests.get(f'https://api.github.com/repos/{owner}/{name}/issues?state=all&per_page=100', headers=headers).json()
if issues and isinstance(issues, list):
with open(f'data/github_export/{name}_issues.json', 'w') as f:
json.dump(issues, f, ensure_ascii=False, indent=2)
print(f' {name}: {len(issues)} issues/PRs')
"
GITHUB_TOKEN, GH_OWNER)data/github_export/*.json (リポ情報, Issues, PRs)/Users/sennin/Documents/GitHub/8888_AGI5/claude/80_tools/run_github_db_ingest.sh (table_database.db 投入版)/Users/sennin/Documents/GitHub/8888_AGI5/claude/src/connector/github_backfill_sync.py (Drive連携版)このスキルはデータ取得後、自動的に外部リンク抽出を実行する。コンテキスト内に含まれるURLを独立した external_links.db に格納し、IDで table_database.db および context_kv.db と連携する。
# データ取得後に自動実行される (fetch_and_bridge.sh の links ステップ)
bash claude/80_tools/fetch_links.sh --source github --skip-fetch
# URL + ページコンテンツも取得する場合
bash claude/80_tools/fetch_links.sh --source github
格納先:
external_links.db → external_links (URLメタデータ) + page_content (ページ全文) + source_refs (逆参照)table_database.db → records.external_links_json = [{"ext_link_id": N, "url": "..."}]context_kv.db → context_kv.ext_link_id カラム詳細は fetch-links スキルを参照。