Model only based on samples provided by the user or explicitly permitted for retrieval. Use author identity for sample grouping and style library retrieval; do not write external credentials, prior impressions, or viewpoints outside the samples into the style profile.
0. Resolve the writable style root directory
Must be executed before starting:
python "${CLAUDE_SKILL_DIR}/scripts/manage_style_registry.py" resolve-root --workspace-root "."
Record the command's sole output as [风格根目录], and use this root directory for all subsequent profiles, evidence, and registries:
- In this repository's development environment, return
claude-runtime/styles, which is the sole source; after completion, run the sync script to update the consumer-side mirror. - When the plugin is installed in an ordinary workspace, return
.claude/styles, and do not write to the plugin cache. - It is forbidden to skip resolution and directly assume
.claude/styles, otherwise it will cause runtime mirror drift.
1. Collect samples and confirm author anchors
- Accept local documents or URLs. For URLs, first call
web-article-extractor, save the main text todocs/YYYY-MM-DD-文章标题.md。 - Process batch URLs serially in the order "navigate → wait → extract → save"; do not navigate concurrently within the same page context.
- Extract author anchors from each sample's author, official account, and source URL.
- Verify all anchors before merging text:
- Author anchors are consistent: continue modeling.
- Author anchors are inconsistent: group by author; if reliable grouping is impossible, stop and ask the user to confirm whether they really want to build a "mixed style."
- Author unknown: retain the source identifier and do not guess the author.
- Retrieve
[风格根目录]/: for a new author, create a new profile; for an existing author, read the old profile and old evidence ledger, and perform incremental verification.
2. First establish an evidence ledger
Before any style induction, save evidence to [风格根目录]/_evidence/[风格名]_evidence.md. Each record includes:
| Field | Requirement |
|---|---|
| Observed phenomenon | The specific writing pattern appearing in the sample |
| Original text evidence | The necessary short excerpt supporting the judgment |
| Occurrence location | Sample title, number, or URL |
| Functional judgment | The role of this writing pattern in context |
| Reusable rule | How to reproduce it in a new topic |
| Applicable boundary | When it applies or does not apply |
Hard rules:
- A stable feature must have at least 2 pieces of evidence, from at least 2 independent samples.
- A single sample can only produce a "candidate feature" and cannot be claimed as a stable style.
- Do not equate sample topics with author style.
- Every profile, judgment, and usage rule must be traceable back to the evidence ledger.
- Original text excerpts should retain only the shortest fragment needed to prove the conclusion; do not pile long passages of original text into the style file as templates.
For evidence grading, incremental updates, and prior isolation rules, see style-core-and-validation.md。
3. Run quantitative fingerprinting
Run the script first, then write conclusions about sentence length, paragraphs, questions, and punctuation:
python "${CLAUDE_SKILL_DIR}/scripts/style_fingerprint.py" docs/[样本1].md docs/[样本2].md
Write the results into the style profile's 00b. 量化指纹, and note the sample size. Rhythm descriptions must match the measured results; a sentence-initial word must appear at least 3 times before it can be listed in the lexical fingerprint.
4. Distill style, not a generic good-article formula
Analyze 15 dimensions according to 15-dimensions.md , and additionally answer:
- What does the author observe first when facing a new topic?
- Which angles, materials, and suggestions does the author automatically exclude?
- What is the argumentative engine from phenomenon to judgment?
- What are the material selection preferences and rejection items?
- What are the emotional curve and the reader relationship?
- When switching to a new theme, what is the minimal reproducible recipe?
- What substantive judgments and value rankings recur across multiple samples?
Run two checks on each core rule:
- Generic baseline check: rules that any excellent writer would already follow are moved to "generic baseline" and do not count as the author's fingerprint.
- In-library differentiation check: rules that duplicate two or more existing styles are downgraded, and the "differentiation switch" from the most similar style must be written out.
5. Perform falsifiable imitation validation
5.1 Unfamiliar-topic validation
- Choose a new topic not covered by the samples and write a 300–500 word short piece.
- Score it on five items: entry angle, material selection, argumentative progression, sentence rhythm, and emotion and reader relationship, each worth 0–2 points.
- Every 2-point score must cite the corresponding evidence ledger entry; if it cannot be traced, count it as 0 points.
- If the total score is below 8 points, return to revise the style core.
5.2 Multiple independent blind tests
- Prepare at least 3 sets of functionally similar "original short passage + imitation short passage", randomly shuffling A/B within each set.
- Give each set separately to independent reviewers who have no access to the style file or the author's identity, providing only the two plain-text passages.
- Reviewers are allowed to answer "cannot determine"; each time they must give a judgment, confidence level, and evidence-based flaws, and are not required to fill a fixed number.
- Aggregate rather than judge on a single instance:
- At least 2 sets judged incorrectly or cannot be determined, and no high-confidence "judgment method" flaws: pass.
- At least 2 sets correctly identified, or high-confidence judgment-method flaws appear: send back to revise the style core.
- Re-test the imitation passages with a quantitative script; if key rhythm indicators deviate from the sample baseline by more than 30%, it must not pass.
Blind tests receive only plain text; they do not use tools, do not read files, and do not inherit this modeling context. Write the raw results and aggregated conclusions into the validation appendix of the style profile.
6. Generate or update the style profile
Output to [风格根目录]/[风格名].md. The file must contain YAML Front Matter:
---
author: "作者或公众号名"
source_count: 3
last_updated: 2026-07-18
---
Use the complete structure style-output-template.md. Items 01–15 in the template must correspond one-to-one with the 15-dimension reference; "usage instructions" and validation results serve as unnumbered appendices.
When updating a single historical file, handle only the current target and do not batch-rewrite the entire style library. Preview first:
python "${CLAUDE_SKILL_DIR}/scripts/normalize_style_frontmatter.py" "[风格根目录]/[目标文件].md" --check --refresh-existing
After confirming the preview scope is correct, remove --check and execute. The script uses atomic replacement via temporary files; do not silently execute [风格根目录] on the entire --refresh-existing。
6.1 Registration status lifecycle
Each newly created profile must be registered first; re-running on an existing profile is idempotent and will not silently downgrade a validated status:
python "${CLAUDE_SKILL_DIR}/scripts/manage_style_registry.py" register --style-root "[风格根目录]" --profile "[风格名].md"
A new registration status can only be legacy_unverified. When there is a single sample, insufficient evidence, failure to verify on an unfamiliar topic, or failure to pass blind testing, stop here and do not upgrade.
Only after the evidence ledger has been persisted, the cross-sample threshold is met, unfamiliar topic verification has passed, and at least 3 independent blind test groups have been aggregated and passed according to the rules of this Skill, may an explicit upgrade be made:
python "${CLAUDE_SKILL_DIR}/scripts/manage_style_registry.py" verify --style-root "[风格根目录]" --profile "[风格名].md" --evidence "_evidence/[风格名]_evidence.md" --blind-test-passed
--blind-test-passed is a manual semantic gate declaration, and it is forbidden to add it in advance in order to make the command pass. The registration script only validates files, paths, and explicit declarations; it does not replace cross-sample and blind test judgment.
Regardless of whether the final state remains legacy_unverified or is upgraded to verified, if [风格根目录] is claude-runtime/styles, the following must be executed before returning or stopping:
python -B "scripts/sync_claude_runtime.py"
Completion conditions
- Author anchors have been checked, and samples from different authors have not been accidentally mixed.
- The evidence ledger has been persisted, and stable features meet the cross-sample threshold.
- Quantitative indicators come from actual script measurements.
- The 15 dimensions, style core, distinguishing switches, and applicable boundaries are complete.
- At least 3 independent blind test groups have been aggregated, and failed items have been corrected in reverse.
- The style profile Front Matter, evidence paths, and update time are correct.
- The style profile, evidence ledger, and
style_registry.jsonregistration status are consistent; if verification has not passed, remainlegacy_unverified。