Communitygithub.com

sandypoli-boop/sansheng-write

中文长文写作引擎 · Claude Code skill:选题→大纲→正文→改稿→微信排版→配图。喂它你的语料,它长出你的声音。

sansheng-write 是什么?

sansheng-write is a Claude Code agent skill that 中文长文写作引擎 · Claude Code skill:选题→大纲→正文→改稿→微信排版→配图。喂它你的语料,它长出你的声音。.

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add sandypoli-boop/sansheng-write

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Long-form Chinese Writing System

Main Entry: Only carries "routing + trigger boundaries + global meta-instructions + high-frequency iron rules." All stage-specific details must be lazy-loaded from the corresponding references. In the text below, bare xxx.md always refers to references/xxx.md (files under profile/corpus/authors/ and profile/ already have full paths).

🔴 Default = fully automatic all the way to the drafts folder, no mid-way questions: As long as this skill is asked to write an article (including ordinary "write an article / help me write…", without the "full process" command), the default is to follow autopilot.md to complete outline→content enhancement→body→title→layout→images→BGM→publish draft, never stop at layout stage, never pop up a "1/2/3" menu after outline/layout. On failure, self-correct according to suggestions, do not skip or bypass. Only three types of stops allowed: ① Hard block (cover image repeatedly fails / credentials invalid / self-check Error cannot be fixed); ② Beginning candidate blind selection (the only legally mandated creation pause point; if user not present, take defaults and continue); ③ User explicitly says "wait for my confirmation at each step / step by step."

🟢 Must Read Before Starting (Meta-Instructions, Before Any Stage)

Before entering any stage, first read the two shared contexts in order. After reading, do not ask for known information (theme color / account name / creator background). Only ask for parameters that change for this task (style / audience / word count):

  1. Brand Context profile/context.md (brand identity / persona / style routing / conversation conventions); if profile is not configured, fall back to profile.example/context.md in the repo (neutral defaults, not an error on the normal path); if neither exists, fall back to the "Brand Identity Fallback" section of this file.
  2. Brand Web (Optional) profile/brand-net.md (territory map / foreshadowing pool / commitment ledger). If it exists, the three weaving questions in outline Step 7.5 must be answered (link to existing posts / push owned territories / foreshadow), with answers written to article-meta.yaml under weave: (see outline.md Step 7.5 for details); archive the wishes made in this article into brand-net.md §4. If the file does not exist, skip the weaving phase without error (weaving is an optional feature).

The profile directory is specified by the environment variable SANSHENG_WRITE_PROFILE_DIR (if not configured, falls back to profile.example/ in the repo). The entry point is scripts/profile_config.py. Multi-stage tasks: complete one stage before reading the next; do not read everything at once.

🔁 Recovery Protocol (Meta-Instruction)

Upon entering any {data directory}/{N}-{topic name}/ directory, first thing run python "$SKILL/scripts/pipeline.py" status to get stage status and next steps. After each stage is complete, update with verify <stage>/done <stage>. Recover with status after interruption. $SKILL = root of this skill repo (absolute path resolved automatically at runtime); data directory is specified by environment variable SANSHENG_WRITE_DATA_DIR (if not configured, <repo root>/data/).

Quick Route (🔴 = Must Read Before Entering This Stage)

Intent (including necessary constraints for that line)Read
New topic / Write an article / Discuss directionoutline.md
Expand into body / Continue writing / Revise (before writing, run prep_writing.py to aggregate _prep-context.md then go through 7 preparation steps)writing.md + corresponding chapter in style-routes.md + profile/corpus/authors/{X}.compact.md
Generate a few versions of beginning for blind selection / Choose a beginning / Change beginning (2-3 hook A/B/C blind selection without reasons, the only legally mandated pause point for autopilot)writing.md §Beginning Candidate Blind Selection
Content enhancement / Material not sharp enough (4 strategies, after outline but before writing)content-enhance.md
Generate titles (output 5 candidates inline + ranking)title.md
Writing techniques / Opening and ending / Memorable quotescraft-techniques.md
Genre-specific (tutorial/methodology checklist/technical analysis, only these three genres load; selection of genre from three options is in outline Step 3)writing-genres.md
Remove AI flavor / Polish draftanti-ai-filter.md
Cold-read external review (after polishing but before layout, dispatch different model family subagents, produces _stutter-list.md, runs in parallel window with fact-check)semantic-review.md
Fact-check / Verify data version prices (after polishing but before layout, dispatch context-free subagent, produces _fact-check.md, preflight hard assertion exit 2)fact-check.md
Layout / Convert to HTML / Table of contents barlayout.md
Layout compatibility / Tables / Cards / Platform filteringwechat-compat.md
Layout troubleshooting / Style anomalies (on demand, not for daily SOP)layout-reference.md
🔴 Must read before changing any color/radius (visual SSOT, change once globally effective)design-tokens.md
🔴 Must read before any image generation; for real people and real events, actively search for real news photos, crop to 16:9, AI generation of person portraits prohibited (news figures/major events same rule)image-routing.md
🔴 Generate cover image / Select style (locked to montage-evidence, automatically selects / avoid last 3 articles if already used; remaining 4 styles only activated by cover_style in meta)cover-styles.md
Generate music / BGM / Theme song (MiniMax music-2.6-free)music.md
Publish / Send to drafts / After finalizationpublish.md
Convert to graphic/text / Split into graphic/textxhs-storyboard.md
Full-process autopilot (orchestrator default on = fan-out parallel / off = serial, pipeline.py orchestrator on/off to toggle)autopilot.md + orchestration.md + agent-contracts.md
🔴 Check iron rules / Confirm constraints (must read before entering publish/layout/image generation)iron-rules.md
Learn an article's layout (Agent fetches URL → analyzes → writes to layout reference library)—
I made edits / Learn from my edits (extract pattern from draft vs final diff, write playbook.md)learn-edits.md
Review skill / Skill introspection / Evolutionskill-review.md

Sub-command shortcuts: write topic/write outline→outline | write body/write expand→writing | write beginning candidates/blind select beginning/choose beginning→writing §Beginning Candidate Blind Selection | write title→title | write music/write BGM→music | write layout→layout | write publish→publish | write graphic/text/convert to graphic/text→xhs-storyboard | write status/write progress→pipeline.py status | full process/go through process→autopilot | review skill/skill introspection/skill retrospective/skill evolution→skill-review

✍️ Six Core Writing Principles (Semantic Layer Positive Rules — Table of Contents for Six Chapter Pointers, Single Source of Truth only)

🔴 This section is just a table of contents pointer, not an independently executable "sufficient version" — the abstract is present and the model will skip the body (known failure mode). During the writing phase, truly internalize _prep-context.md (rendered by prep_writing.py, §0 three principles at top). During the polishing phase, check each pointer by going into the corresponding chapter and ticking off one by one; don't just look at the table of contents. 🟡 Honest boundaries: The six principles are only "feed material before writing + self-aware inspection after writing"; no machine post-writing verification; exit 2 hard gate only catches regex/count-detectable surface fingerprints (cliché blacklist, half-width punctuation, whole-sentence bold count). Semantic human touch cannot be forced by regex, same-model self-review cannot detect it, only by cross-model semantic differential (semantic-review.md). Don't assume it has been machine-implemented.

  1. So What Deliver (argument asks reader "so what?" and answers) → anti-ai-filter.md §8.1
  2. Analogy Grounding (abstract judgment paired with everyday analogy) → anti-ai-filter.md
  3. Anomalous Detail Anchor (in key scenes, give concrete details that are so unusual they don't seem fabricated) → anti-ai-filter.md §2.3.5
  4. Write Yourself Dumb (don't establish authority, trade self-deprecation for trust) → anti-ai-filter.md §6.1
  5. Concrete Paragraph Lead (BLOT) (first sentence of each paragraph gives a specific person/thing/scene/number) → writing.md §Density Rule 9
  6. Inter-sentence Gravity (last sentence leaves a hook, first sentence of next catches it; anadiplosis + old info first, new info after) → Single source writing.md §Inter-sentence Gravity

Special Conventions (Used for Every Dialog Turn in Conversation)

  • 「」Annotations: Content inside 「」 is annotation, not body text—instruction-type is executed directly, reference-type is used as context. 「Material」 Mark: Assigned to material sorting table. 「Into Bag」 Mark: Automatically deposits into the corresponding category of profile's topic reserve files as topic reserve.
  • Automatic Material Reading: At the start of conversation, check the working directory for 素材/ (materials). If any content exists, read it all. Fact Verification: Search directly for facts/data that need verification; do not ask the creator.
  • 🔴 Em dashes uniformly --: All dashes in text intended for readers use two English hyphens --. Full-width em dashes are prohibited.
  • 🔴 Iron Rules Outline iron-rules.md: Concentrates all hard constraints (layout→publish sequence/memorable quote card decorative quotation marks prohibited/opening strategy branching/image generation backend/component small images/data image anti-hallucination/information source format/AUDIO-CARD position/knowledge graph position/timeline H3/article guide/sensitive topic wording to avoid takedown/non-skippable stages/publish integrity). Must read before entering publish/layout/image generation.

🔄 Skill Introspection Mechanism

At runtime, contracts.py/format_layout.py/pipeline.py append the results of each verify gate to $SKILL/_skill-observations.jsonl (zero cost). When the user says "review skill" (recommended every 8-10 articles), go through skill-review.md to dispatch an observer agent to produce a report; the observer only diagnoses, changes are decided by the user.

Layout Template / Configuration / Publish Script

  • HTML Component Templates (table of contents bar/H2-PART/H3 timeline/Case/Key Points/Memorable Quote Card/Link Card/Deep Read/Recommendation/Follow Card) in templates/; layout goes to layout.md to see the workflow and component list, read code from templates/. 🔴 Memorable quote card prohibits &ldquo; (may render as garbled on some platforms), source line = hairline + faded right-aligned.
  • article-meta.yaml: Persistent parameters per article directory (table of contents text/H2 style/cover keywords/weave/modifier_style, template templates/article-meta.template.yaml), automatically read by format_layout.py, CLI parameters take precedence.
  • Publish/Post-processing Scripts (pipeline.py+archive / format_layout.py contract gates / add_logo.js / compress_images.py / generate_article_bgm.py / generate_recommend_html.py) Usage goes to publish.md. Hard constraints: ① ⚠️ --check ≠ passing the publish contract gate; for verification use format_layout.py --all --check; ② archive must first done publish wechat_url=... or it will exit immediately due to missing link; ③ 🔴 Do not manually edit articles.md (it is an auto-generated rendering view from archive). The one-time migrate_to_works.py has an overwrite prevention bar and is only migrated once manually.

Runtime Data Files (Corpus Pool, Do Not Copy Full Segments into Context)

  • Unified SSOT {data directory}/works.yaml: One entry per article + video. Before writing/illustration, first read the last 3 articles for dimension/closing/style deduplication; after publishing, archive writes. articles.md and 作品库看板.html (works dashboard) are its rendering views (🔴 do not manually edit); old history.yaml has been replaced and is no longer written to.
  • prep_writing.py automatically aggregates into _prep-context.md before writing (no need to manually browse): Profile corpus pool's style example library / memorable quote library (by topic) / counterexample library / voice corpus (gate: >200 characters ≈ 2-3 paragraphs is injected) + profile/corpus/authors/{X}.compact.md (user-provided author style guide; when no user-provided guide exists, inject the in-repo original profile/corpus/voice-samples.md as a basic human-touch fallback).
  • Manual Reading by Topic (Not Automatic): If the profile has a curated sample library profile/corpus/samples/{author}/, before writing, based on the current style route, selectively read 2-3 articles (if no corresponding author, fall back to profile/corpus/voice-samples.md). Check the brand specifications / topic reserve files in profile as needed.

Finished Output Directory

{data directory}/{N}-{topic name}/
  ├── outline.md ← outline   ├── final draft.md ← writing   ├── final draft.html ← layout   └── materials/ ← all AI-generated images

Numbering increments sequentially from the largest existing number in {data directory}/.

Brand Identity (Fallback — Normally, Priority is to Read profile/context.md)

⚠️ Only when both profile/context.md and its fallback profile.example/context.md do not exist, the following section takes precedence.

  • Brand Name / Account Name: Provided by profile (see example in profile.example/context.md) | Theme Color (primary): #2F6F8F (neutral slate; to change style see design-tokens.md; six built-in themes: slate/ink/sage/jade/amber/plum, see profile/brand.yaml)
  • Style Route: The main route is the user-provided author style guide (profile/corpus/authors/*.compact.md) select exactly one; can be combined with 0-1 modifier guides (not used as main route); genre is one of three options (in-depth/article/tutorial/methodology checklist, details in outline Step 3). Full list and combination mechanism see style-routes.md (modifier is automatically combined into _prep-context by prep_writing.py). When no user-provided guide exists, fall back to profile/corpus/voice-samples.md.
  • Brand Specifications / Creator Persona: profile/context.md (neutral example in profile.example/).

When NOT to Use (Reverse Routing: Delegate to Other Tools / Do Not Trigger)

User IntentShould UseDo Not Use This Skill
First research/understand the topic, see what各方 say (then decide whether to write)Your usual research tool (multi-source + cross-verification + summary)Research goes to research tool; "whether the topic is worth writing" is done by this skill's "write topic" stage
Polish/forge a single title (no body)This skill's "write title" (title.md)Pure title polishing belongs to this skill's inline forging
Published article data review/follower growth/readership diagnosisYour data analysis toolThis skill does not process published data
Convert written article to short video voiceover/storyboardYour video skillThis skill outputs articles, not video scripts; after final draft, hand over video to video tool, do not overreach and write voiceover
General Chinese writing (no brand constraints needed)Native writing is sufficientBrand constraints will contaminate general writing
English content / Pure code / Git sync / Environment configurationDefault workflowThis skill is designed for long-form Chinese writing

Handover Rules · Topic/Material Research Diversion: Light material (verify one fact/supplement one number/check one name/confirm time price) → directly search using WebSearch, do not trigger a research tool; Deep material (controversial/multi-platform reputation/cross-verification to eliminate falsehoods/international + domestic coverage/systematic background timeline, or user says "find out clearly/各方 say/whether it's true/cross-verify") → delegate to your usual research tool, when writing, manually cite its factual foundation and sources—do not automatically inject material, do not pre-fill meta. When in doubt, default to light material search yourself.

references Three-Level Hierarchy (Stratified by Loading Timing)

  • L1 · Must Read on Startup (Cross-stage Invariants, 2 items): iron-rules (must expand before entering publish/layout/image generation), autopilot ("write article" main path cockpit). — The items that are truly unconditionally read every session are profile/context.md + optional profile/brand-net.md (not part of references, see above startup meta-instructions).
  • L2 · Stage On-Demand (Loaded on Route Trigger): Main flow references (i.e., those listed in the "Quick Route" table above) + profile/corpus/authors/*.compact.md (user-provided, variable count, automatically aggregated by prep_writing.py).
  • L3 · Troubleshooting On-Demand (Low Frequency/Advanced/Historical, Not Read Daily): layout-reference / orchestration / agent-contracts / learn-edits / skill-review / _archive/后备技法池.md (fallback technique pool, only read when the main craft-techniques pool is insufficient).

相关技能