$ show dongbeixiaohuo/writing-agent
This repo is a structured AI-assisted long-form article writing system, primarily delivered as a Claude Code plugin and a Tauri desktop app. It orchestrates a 14+ stage workflow (topic clarification, research, drafting, humanization, fact-checking, export) using specialized subagents and a central workflow contract (`collab_v2.json`). The system is model-agnostic, supporting Anthropic-compatible APIs including Chinese providers. It includes extensive tooling for evidence management, style modeling, blind evaluation, and publication metrics. While the core functionality is robust and well-tested, the codebase suffers from triple directory mirroring (`.claude/`, `claude-runtime/`, `plugins/writing-agent/`) requiring manual sync, hardcoded Windows paths in the desktop app, and a partially unverified style library. The architecture cleanly separates agent prompts (Markdown), runtime scripts (Python/Node), and a Tauri frontend, making the workflow itself reusable as a pattern for multi-stage AI agent orchestration.
The LLM identified 3 files worth highlighting for reuse:
Implements a comprehensive remote URL security policy for article extraction: blocks private IPs, loopback, and multicast addresses; performs DNS rebinding checks with `safeLookupCallback`; enforces redirect chain limits; validates MIME types for image downloads. The pattern of layered URL validation (IP filtering, DNS pinning, content-type verification) is reusable in any web-scraping or download utility that must prevent SSRF and resource abuse.
Generates quantitative writing style fingerprints from text samples: computes sentence length distribution (mean, std dev, percentiles), question/exclamation ratios, paragraph length distribution, and top n-grams. Outputs structured JSON with descriptive statistics and raw distributions. This component is standalone and could be extracted to analyze any text corpus for stylistic profiling, with clear separation between feature extraction and the writing-agent-specific usage.
Implements a snapshot-based fact-checking gate: freezes the current article body and title via SHA-256, validates structured fact claims against evidence, and produces a pass/fail report. Uses hash binding to prevent stale exports (any change invalidates old pass). The pattern of snapshot → validate → report with integrity anchors is reusable for any content pipeline that needs verifiable quality gates before publishing.