Communitygithub.com

CSV Report Writer

작업 실행 결과 목록을 단일 컬럼 명세로 CSV와 마크다운 테이블로 동시에 출력합니다. 판다스 없이 표준 라이브러리만 사용하며, 안전한 이스케이프와 안정적인 컬럼 순서를 보장합니다.

CSV Report Writer란 무엇인가요?

이 스킬은 AI 에이전트(Claude Code, Cursor, Codex 등)가 작업 실행 결과를 CSV 파일과 마크다운 테이블 형식으로 동시에 출력해야 할 때 사용됩니다. 사용자가 '결과를 CSV로 저장해', '보고서로 내보내줘', '마크다운 테이블로 만들어줘' 등의 요청을 할 때 자동으로 호출됩니다. 단 하나의 컬럼 정의(키, 헤더, 선택적 포맷터)로 두 출력을 동기화하여 불일치를 방지하며, CSV는 `csv.writer`로 인용 부호를 올바르게 처리하고 마크다운 테이블은 파이프(`|`)와 줄바꿈 문자를 이스케이프하여 레이아웃이 깨지지 않도록 합니다. pandas나 polars 같은 외부 라이브러리가 필요 없고, stdlib만으로 동작합니다. 데이터 조인, 그룹화, 피벗 같은 고급 데이터프레임 작업이 필요한 경우에는 사용하지 말아야 합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/baronguyen001/ai-automation-skills/tree/HEAD/skills/csv-report-writer

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

CSV Report Writer은(는) 무엇을 하나요?

이 스킬은 작업이 결과 행 목록을 생성할 때, 스프레드시트용 CSV와 PR 코멘트(또는 Telegram 요약)용 마크다운 테이블을 함께 만들고 싶을 때 사용합니다. 하나의 컬럼 정의를 사용하므로 두 출력이 어긋나지 않습니다. 컬럼(키, 헤더, 선택적 포맷터)을 한 번 선언하면, 헬퍼 함수가 안정적인 컬럼 순서로 CSV 인용과 마크다운 파이프 이스케이프를 처리하여 두 출력을 모두 생성합니다. pandas가 필요 없습니다.

호출 시점

  • 사용자가 "결과를 CSV로 저장해", "보고서로 내보내줘", "이걸 마크다운 테이블로 만들어줘", "실행 결과를 스프레드시트로 저장해"라고 말할 때.
  • 대화 중인 코드에 list[dict](또는 객체 리스트)가 있고 현재 임시로 출력 중인 경우.

호출하지 말아야 할 때

  • 데이터에 실제 데이터프레임 작업(조인, 그룹화, 피벗)이 필요한 경우 → pandas/polars를 사용하세요.
  • 단일 스칼라 결과인 경우 → CSV/테이블이 과합니다.

구체적인 예시

사용자 입력:

스캔한 토큰 목록에 점수와 가격이 있어요. CSV로 저장하고 Telegram 요약용 마크다운 테이블도 만들어 주세요.

출력:

# assets/report.py를 프로젝트에 복사한 후:
from report import Column, write_csv, to_markdown

columns = [
    Column("symbol", "Symbol"),
    Column("score", "Score", fmt=lambda v: f"{v:.1f}"),
    Column("price_usd", "Price", fmt=lambda v: f"${v:,.4f}"),
]
rows = [
    {"symbol": "ABC", "score": 8.4, "price_usd": 0.0123},
    {"symbol": "XYZ", "score": 6.1, "price_usd": 1.5},
]

write_csv("scan.csv", columns, rows)        # 스키마가 적용된 CSV, 안정적인 컬럼 순서
print(to_markdown(columns, rows))           # 동일한 컬럼, 마크다운 테이블

두 출력 모두 정확히 동일한 컬럼과 순서를 사용하므로 CSV와 요약 테이블이 항상 일치합니다.

적용 패턴

  1. 각 Column(key, header, fmt=...)을 한 번 선언합니다. 두 작성자가 동일한 리스트를 사용하므로 헤더와 순서가 동기화됩니다.
  2. 컬럼 순서를 안정적이고 명시적으로 유지합니다. 임의 행의 딕셔너리 삽입 순서에 의존하지 마세요.
  3. fmt 콜러블이 표현(통화, 반올림)을 담당하게 하고, 행 딕셔너리에는 원시값을 저장합니다.
  4. csv.writer를 사용하여 올바른 인용 처리를 합니다. 마크다운 테이블에서는 |와 줄바꿈 문자를 이스케이프하여 레이아웃이 깨지지 않도록 합니다.
  5. 누락된 키는 오류를 발생시키지 않고 빈 셀로 처리하여 부분적인 행도 보고할 수 있게 합니다.

참조: assets/report.py.

출처

저자의 자동화 프로젝트에서 실제 사용을 통해 정제되었습니다. v1.0.0. 참고: [[pr-body-formatter]], [[sqlite-state]], [[telegram-alerter]].

→ Trawlkit으로 완전한 실행 가능한 봇을 구축하세요.

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

baronguyen001/ai-automation-skills

Schedule any script to run on a recurring schedule on Windows (Task Scheduler) or Linux (cron) - register, list, and remove jobs from one command, with logging to a file and a guard against overlapping runs. Use for schedule a script, run nightly, set up a cron job, windows task scheduler, or run on a timer.

baronguyen001/ai-automation-skills

Strip HTML to clean plain text with the standard library only (no BeautifulSoup/lxml): drops script/style, turns block tags into line breaks, and collapses whitespace. Use when the user wants readable text from an HTML page/email, to clean scraped HTML before sending it to an LLM, or to build a text index from web content.

baronguyen001/ai-automation-skills

Persist records between scheduled runs as append-only JSON Lines (one object per line) with streaming reads and optional key-based dedup, stdlib only. Use when the user wants to log run results to JSONL, append events to a file, dedup records by id across runs, or keep a simple durable history without a database.

baronguyen001/ai-automation-skills

Extract text and simple table-like rows from a PDF for downstream AI without OCR binaries. Use when the user asks to read a PDF, turn a PDF into text, pull simple tables from statements/reports, or feed PDF content into an LLM pipeline.

baronguyen001/ai-automation-skills

Rotate a pool of HTTP/SOCKS proxies with round-robin selection, failure tracking, and a cooldown that benches dead proxies before retrying. BYO proxy list via env - none are shipped. Use for rotate proxies, spread requests across proxies, avoid IP bans, retry through a different proxy, or proxy health check.

baronguyen001/ai-automation-skills

Parse an RSS 2.0 or Atom feed into normalized item dicts (title, link, id, published, summary) with the standard library only - no feedparser. Use when the user asks to read an RSS/Atom feed, poll a blog/news feed, extract feed entries, or watch a site that publishes a feed.

baronguyen001/ai-automation-skills

Upload and download run artifacts from S3-compatible storage with BYO bucket and credentials from env. Use when the user asks to store scraper output, archive reports, publish artifacts to object storage, fetch a prior run file, or use MinIO/R2/Spaces/S3 without hardcoding credentials.

baronguyen001/ai-automation-skills

Draft a short-form TikTok/Reels/Shorts or long-form video script from a topic and creator persona file - hook variants, beat-structured body, CTA, b-roll cues, caption overlays, and [STORY]/[NUMBER] slots so the model never fabricates personal facts. Use for write a video script, tiktok script, youtube script, or /shortform-script.

baronguyen001/ai-automation-skills

Give scheduled scripts memory between runs with one SQLite file - a seen-set for dedup, a key/value cursor to resume where you left off, and order-preserving new-item filtering. Use for dedup across runs, don't re-alert the same item, remember the last id, resume a scraper, or persist state between cron runs.

관련 스킬