🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Auto Sec Blogger Repo

by @rebugui

Collects security news from multiple sources, generates expert-level blog posts with GLM-4.7, publishes drafts to Notion, and auto-deploys approved posts to...

Versionv1.0.1
Downloads538
Installs1
TERMINAL
clawhub install auto-sec-blogger-repo

πŸ“– About This Skill


name: auto-sec-blogger description: AI-powered security blog automation system (identical to github.com/rebugui/intelligence-agent). Collects news from Google News, arXiv, HackerNews β†’ generates blog posts with GLM-4.7 β†’ publishes to Notion β†’ auto-deploys to GitHub Pages via Git. Features Human-in-the-Loop approval workflow. Use when you want to automate blog writing, news collection, or content generation with the exact functionality of the original intelligence-agent repository. Triggers: "λΈ”λ‘œκ·Έ κΈ€ μž‘μ„±", "λ³΄μ•ˆ λ‰΄μŠ€ λ°œν–‰", "κΉƒν—™ λΈ”λ‘œκ·Έ λ°œν–‰", "intelligence agent", "μ§€λŠ₯ν˜• μ—μ΄μ „νŠΈ", "μžλ™ κΈ€μ“°κΈ°".

Intelligence Agent

κ°œμš”

λ³΄μ•ˆ λ‰΄μŠ€λ₯Ό μžλ™μœΌλ‘œ μˆ˜μ§‘ν•˜κ³ , LLM(GLM-4.7)을 μ‚¬μš©ν•˜μ—¬ μ „λ¬Έκ°€ μˆ˜μ€€μ˜ λΈ”λ‘œκ·Έ 글을 μž‘μ„±ν•œ ν›„, Notionκ³Ό GitHub Pages에 μžλ™μœΌλ‘œ κ²Œμ‹œν•˜λŠ” μ‹œμŠ€ν…œμž…λ‹ˆλ‹€.

GitHub μ €μž₯μ†Œμ™€ 동일: https://github.com/rebugui/intelligence-agent

μ•„ν‚€ν…μ²˜

λ‰΄μŠ€ μˆ˜μ§‘ (Google News, arXiv, HackerNews)
    ↓
GLM-4.7 κΈ€ μž‘μ„± (μ „λ¬Έ λ³΄μ•ˆ λΈ”λ‘œκ·Έ)
    ↓
Notion Draft μ €μž₯ (μƒνƒœ: Draft)
    ↓
μ‚¬μš©μž κ²€ν†  및 승인 (Human-in-the-Loop)
    ↓
Git Push β†’ GitHub Actions β†’ GitHub Pages

μ£Όμš” κΈ°λŠ₯

1. λ‰΄μŠ€ μˆ˜μ§‘ (News Collection)

  • Google News: ν‚€μ›Œλ“œ 기반 λ³΄μ•ˆ λ‰΄μŠ€ μˆ˜μ§‘
  • arXiv: μ΅œμ‹  λ³΄μ•ˆ 연ꡬ λ…Όλ¬Έ μˆ˜μ§‘
  • HackerNews: νŠΈλ Œλ”© 기술 λ‰΄μŠ€ μˆ˜μ§‘
  • 쀑볡 제거: URL 기반 쀑볡 λ‰΄μŠ€ 필터링
  • 2. LLM κΈ€μ“°κΈ° (Content Generation)

  • λͺ¨λΈ: GLM-4.7 (Zhipu AI)
  • μŠ€νƒ€μΌ: μ „λ¬Έ λ³΄μ•ˆ λΈ”λ‘œκ·Έ
  • ꡬ쑰:
  • - 제λͺ© (ν—€λ“œλΌμΈ) - μš”μ•½ (3쀄 μš”μ•½) - λ³Έλ¬Έ (상세 뢄석) - κ²°λ‘  (μ‹œμ‚¬μ ) - νƒœκ·Έ (ν‚€μ›Œλ“œ)
  • Mermaid λ‹€μ΄μ–΄κ·Έλž¨: 곡격 흐름, μ•„ν‚€ν…μ²˜ μ‹œκ°ν™”
  • 3. Notion 톡합 (Notion Integration)

  • μƒνƒœ 관리: Draft β†’ Review β†’ Approved β†’ Published
  • μžλ™ μ €μž₯: μƒμ„±λœ κΈ€ μžλ™ μ €μž₯
  • μ‚¬μš©μž 승인: Notionμ—μ„œ μƒνƒœ λ³€κ²½μœΌλ‘œ 배포 승인
  • 4. Git 기반 λ°œν–‰ (Git Publishing)

  • μžλ™ 컀밋: λ§ˆν¬λ‹€μš΄ 파일 Git에 컀밋
  • GitHub Actions: μžλ™ Jekyll λΉŒλ“œ
  • GitHub Pages: 정적 λΈ”λ‘œκ·Έ 배포
  • μ„€μΉ˜

    1. μ˜μ‘΄μ„± μ„€μΉ˜

    cd ~/.openclaw/workspace/skills/intelligence-agent/scripts
    pip3 install -r requirements.txt
    

    2. ν™˜κ²½ λ³€μˆ˜ μ„€μ •

    # ~/.openclaw/workspace/.env

    GLM API

    GLM_API_KEY=your_glm_api_key GLM_BASE_URL=https://api.z.ai/api/coding/paas/v4

    Notion

    NOTION_API_KEY=ntn_xxx NOTION_DATABASE_ID=xxx

    GitHub Pages

    GITHUB_TOKEN=ghp_xxx GITHUB_BLOG_REPO=username/username.github.io BLOG_LOCAL_PATH=/path/to/blog/repo

    μ‚¬μš©λ²•

    1. 전체 νŒŒμ΄ν”„λΌμΈ μ‹€ν–‰ (ν…ŒμŠ€νŠΈμš©)

    cd ~/.openclaw/workspace/skills/intelligence-agent/scripts
    python3 intelligence_pipeline.py --max-articles 5
    

    2. λ‰΄μŠ€ μˆ˜μ§‘λ§Œ

    from collector import NewsCollector

    collector = NewsCollector() articles = collector.fetch_all(max_results_per_source=15)

    3. λΈ”λ‘œκ·Έ κΈ€ μž‘μ„±λ§Œ

    from writer import BlogWriter

    writer = BlogWriter() post = writer.generate_article(article_data)

    4. Notion λ°œν–‰λ§Œ

    from notion_publisher import NotionPublisher

    publisher = NotionPublisher() result = publisher.create_article(blog_post)

    5. Git λ°œν–‰λ§Œ

    from git_publisher_service import GitPublisherService

    git_publisher = GitPublisherService() git_publisher.publish(blog_posts)

    μ›Œν¬ν”Œλ‘œμš° 상세

    1단계: λ‰΄μŠ€ μˆ˜μ§‘

    # collector.py
    class NewsCollector:
        def fetch_google_news(self, query="security vulnerability"):
            # Google News RSS ν”Όλ“œμ—μ„œ μˆ˜μ§‘
            pass

    def fetch_arxiv(self, category="cs.CR"): # arXiv λ³΄μ•ˆ λ…Όλ¬Έ μˆ˜μ§‘ pass

    def fetch_hackernews(self): # HackerNews νŠΈλ Œλ”© 기사 μˆ˜μ§‘ pass

    2단계: AI 기사 선별

    # selector.py
    class ArticleSelector:
        async def evaluate_and_select(self, articles, max_articles=5):
            # GLM-4.7으둜 기사 ν’ˆμ§ˆ 평가
            # 점수 기반 μƒμœ„ 기사 선별
            pass
    

    3단계: λΈ”λ‘œκ·Έ κΈ€ μž‘μ„±

    # writer.py
    class BlogWriter:
        async def generate_article(self, article):
            # GLM-4.7으둜 λΈ”λ‘œκ·Έ κΈ€ μž‘μ„±
            # Mermaid λ‹€μ΄μ–΄κ·Έλž¨ 생성
            # λ§ˆν¬λ‹€μš΄ ν˜•μ‹ 좜λ ₯
            pass
    

    4단계: Notion λ°œν–‰

    # notion_publisher.py
    class NotionPublisher:
        def create_article(self, blog_post):
            # Notion DB에 Draft μƒνƒœλ‘œ μ €μž₯
            # μƒνƒœ: Draft β†’ Review β†’ Approved
            pass
    

    5단계: Git λ°œν–‰ (μ‚¬μš©μž 승인 ν›„)

    # git_publisher_service.py
    class GitPublisherService:
        def publish(self, blog_posts):
            # λ§ˆν¬λ‹€μš΄ 파일 생성
            # Git commit & push
            # GitHub Actions 트리거
            pass
    

    Cron μŠ€μΌ€μ€„λ§

    맀일 08:30 μžλ™ μ‹€ν–‰

    # intelligence_pipeline.py
    from apscheduler.schedulers.blocking import BlockingScheduler

    scheduler = BlockingScheduler() scheduler.add_job(run_pipeline, 'cron', hour=8, minute=30) scheduler.start()

    Notion λ°μ΄ν„°λ² μ΄μŠ€ ꡬ쑰

    ν•„μˆ˜ 속성

    | 속성λͺ… | νƒ€μž… | μ„€λͺ… | |--------|------|------| | 제λͺ© | title | λΈ”λ‘œκ·Έ κΈ€ 제λͺ© | | μƒνƒœ | select | Draft/Review/Approved/Published | | λ‚ μ§œ | date | λ°œν–‰μΌ | | νƒœκ·Έ | multi_select | ν‚€μ›Œλ“œ | | URL | url | 원문 URL | | μΉ΄ν…Œκ³ λ¦¬ | select | 취약점/연ꡬ/νŠΈλ Œλ“œ |

    Jekyll λΈ”λ‘œκ·Έ ꡬ쑰

    blog/
    β”œβ”€β”€ _posts/
    β”‚   β”œβ”€β”€ 2025-03-09-cve-2025-xxxx-analysis.md
    β”‚   β”œβ”€β”€ 2025-03-09-ai-security-trends.md
    β”‚   └── ...
    β”œβ”€β”€ _layouts/
    β”‚   β”œβ”€β”€ post.html
    β”‚   └── default.html
    β”œβ”€β”€ _config.yml
    └── .github/
        └── workflows/
            └── jekyll.yml
    

    νŠΈλŸ¬λΈ”μŠˆνŒ…

    GLM API Rate Limit

    ❌ Error: Rate limit reached (429)
    

    ν•΄κ²°:

  • μžλ™ μž¬μ‹œλ„ 3회
  • 60초 λŒ€κΈ° ν›„ μž¬μ‹œλ„
  • Notion API Error

    ❌ Error: Notion API error
    

    ν•΄κ²°:

  • API ν‚€ 확인
  • Database ID 확인
  • Integration κΆŒν•œ 확인
  • Git Push μ‹€νŒ¨

    ❌ Error: Git push failed
    

    ν•΄κ²°:

  • GitHub Token 확인
  • 원격 μ €μž₯μ†Œ κΆŒν•œ 확인
  • 브랜치 확인
  • 파일 ꡬ쑰

    intelligence-agent/
    β”œβ”€β”€ SKILL.md (이 파일)
    β”œβ”€β”€ scripts/
    β”‚   β”œβ”€β”€ intelligence_pipeline.py (메인 νŒŒμ΄ν”„λΌμΈ)
    β”‚   β”œβ”€β”€ collector.py (λ‰΄μŠ€ μˆ˜μ§‘)
    β”‚   β”œβ”€β”€ selector.py (AI 기사 선별)
    β”‚   β”œβ”€β”€ writer.py (λΈ”λ‘œκ·Έ κΈ€ μž‘μ„±)
    β”‚   β”œβ”€β”€ notion_publisher.py (Notion λ°œν–‰)
    β”‚   β”œβ”€β”€ git_publisher_service.py (Git λ°œν–‰)
    β”‚   β”œβ”€β”€ llm_client.py (GLM API ν΄λΌμ΄μ–ΈνŠΈ)
    β”‚   β”œβ”€β”€ llm_client_async.py (비동기 GLM ν΄λΌμ΄μ–ΈνŠΈ)
    β”‚   β”œβ”€β”€ prompt_manager.py (ν”„λ‘¬ν”„νŠΈ 관리)
    β”‚   β”œβ”€β”€ prompts.yaml (ν”„λ‘¬ν”„νŠΈ ν…œν”Œλ¦Ώ)
    β”‚   β”œβ”€β”€ models.py (데이터 λͺ¨λΈ)
    β”‚   β”œβ”€β”€ utils.py (μœ ν‹Έλ¦¬ν‹°)
    β”‚   β”œβ”€β”€ config.py (μ„€μ •)
    β”‚   └── requirements.txt (μ˜μ‘΄μ„±)
    └── references/
        β”œβ”€β”€ architecture.md (상세 μ•„ν‚€ν…μ²˜)
        β”œβ”€β”€ prompts_guide.md (ν”„λ‘¬ν”„νŠΈ κ°€μ΄λ“œ)
        └── api_reference.md (API 레퍼런슀)
    

    ν™˜κ²½ λ³€μˆ˜

    ν•„μˆ˜

    GLM_API_KEY          # GLM-4.7 API ν‚€
    NOTION_API_KEY       # Notion API ν‚€
    NOTION_DATABASE_ID   # Notion λ°μ΄ν„°λ² μ΄μŠ€ ID
    

    선택사항

    GITHUB_TOKEN         # GitHub 개인 μ•‘μ„ΈμŠ€ 토큰
    GITHUB_BLOG_REPO     # GitHub λΈ”λ‘œκ·Έ μ €μž₯μ†Œ (username/repo)
    BLOG_LOCAL_PATH      # 둜컬 λΈ”λ‘œκ·Έ 경둜
    

    ν…ŒμŠ€νŠΈ

    전체 νŒŒμ΄ν”„λΌμΈ ν…ŒμŠ€νŠΈ

    python3 test_full_pipeline.py
    

    Mermaid λ‹€μ΄μ–΄κ·Έλž¨ ν…ŒμŠ€νŠΈ

    python3 test_mermaid_fix.py
    

    참고자료

  • GitHub μ €μž₯μ†Œ
  • GLM API λ¬Έμ„œ
  • Notion API λ¬Έμ„œ
  • Jekyll λ¬Έμ„œ
  • λ¦¬μ†ŒμŠ€

    scripts/

    원본 μ €μž₯μ†Œμ˜ λͺ¨λ“  Python 슀크립트 포함:
  • intelligence_pipeline.py - 전체 νŒŒμ΄ν”„λΌμΈ μ‹€ν–‰
  • collector.py - λ‰΄μŠ€ μˆ˜μ§‘κΈ°
  • selector.py - AI 기사 선별
  • writer.py - λΈ”λ‘œκ·Έ κΈ€ μž‘μ„±
  • notion_publisher.py - Notion λ°œν–‰
  • git_publisher_service.py - Git λ°œν–‰
  • llm_client.py - GLM API ν΄λΌμ΄μ–ΈνŠΈ
  • prompts.yaml - ν”„λ‘¬ν”„νŠΈ ν…œν”Œλ¦Ώ
  • references/

  • architecture.md - 상세 μ•„ν‚€ν…μ²˜ μ„€λͺ…
  • prompts_guide.md - ν”„λ‘¬ν”„νŠΈ μž‘μ„± κ°€μ΄λ“œ
  • api_reference.md - API 레퍼런슀