Building an Automated Essay Production Pipeline with an AI Coding Skill System
This article shares a practical engineering approach to automated essay writing using the skill extension mechanism of AI coding tools. Instead of one-off prompts, the author built a five-layer pipeline—corpus, seed, generation, evaluation, and distribution—decoupled by standardized data contracts. It covers how reusable skills act as single-responsibility microservices, how corpus retrieval and structured seeds keep output on-topic, how parallel scheduling produces nine differentiated drafts, and how multi-dimensional scoring turns subjective judgment into comparable vectors that feed back into the seed layer. The article also details channel-specific formatting, data feedback loops, and five engineering lessons, such as version-controlling scoring prompts and keeping a human spot-check step. Readers will learn a repeatable way to treat creative writing as an observable, retryable, and measurable software delivery process.
1. Why Essay Production Needs Engineering
Two months ago, I started using the skill extension mechanism of AI coding tools to build an automated essay production pipeline. The point here is not one-off question-and-answer sessions like “write me an essay about spring,” but an engineering system with observability, retryability, and evaluability.
Traditional content production has three typical pain points. First, quality variance is high: the same author produces noticeably different quality at different times. Second, the workflow is fragmented: topic selection, retrieval, writing, review, and publishing are scattered across separate stages and stitched together manually. Third, there is a lack of quantitative feedback: whether a draft is good can only be judged subjectively, and nothing accumulates into an iterable data asset.
Treating writing as software delivery is a viable way to address these three pain points. The pipeline has a clear goal: given a topic, produce nine scored drafts in about fifteen minutes and present them in an interactive interface. After two months of running, the system has accumulated 84 essays, generated 294 scoring records, published 73 essays to a knowledge community, and published 80 to a content subscription platform.
2. Overall Architecture: A Five-Layer Pipeline
The whole pipeline can be abstracted into five layers, with standardized data contracts decoupling each layer so that any layer can be replaced or rerun independently.
- Corpus layer: handles material collection, cleaning, chunking, and vectorization, producing retrievable knowledge fragments.
- Seed layer: breaks a topic into writing intent, structural skeleton, and style constraints, generating a structured seed.
- Generation layer: schedules multiple writing tasks in parallel based on the seed and outputs candidate drafts.
- Evaluation layer: scores drafts across multiple dimensions to form comparable quality vectors.
- Distribution layer: adapts formatting to channel specifications and writes back publishing status and feedback data.
The data contract should use a unified structured format, for example:
{"topic": "Rain in the Old Town","seed_id": "seed-20250601-001","outline": ["Scene opening", "Memory flashback", "Urban change", "Closing"],"style": {"tone": "restrained", "sentence_len": "mostly medium-to-long sentences"},"draft_id": "draft-0007","scores": {"structure": 8.1, "imagery": 7.6, "coherence": 8.4}}
The value of a contract is that the evaluation layer and the generation layer can be decoupled asynchronously. Scaling the generation layer does not change the scoring criteria, and adjusting the scoring criteria does not require rewriting the generation logic.
3. The Role of the Skill System: Turning Capabilities into Reusable Units
The skill mechanism of AI coding tools essentially packages a reusable operating specification into a capability unit that the model can load. It usually consists of four parts: trigger conditions, input conventions, execution steps, and output format. In the pipeline, I use it like a microservice: each skill does one thing, with structured data as both input and output.
Common skill divisions include a corpus retrieval skill, a seed generation skill, a writing skill, a scoring skill, and a format adaptation skill. The benefit is controllable context. If the entire workflow is stuffed into a single conversation, the model quickly loses earlier constraints; a single-responsibility skill loads only the necessary information each time, which significantly improves stability.
A writing skill declaration can be simplified as:
name: prose-draftinput: seed(json), corpus_refs(array)steps:1. Validate required fields of the seed2. Generate section by section following the outline, keeping referential consistency across sections3. Self-check before output: any vague lyricism, any drift from the topicoutput: draft(json) + self_check(report)
4. Corpus Retrieval and Seed Generation
The key to the corpus layer is not “more” but “retrievable and trustworthy.” In practice, I divide materials into three categories: citable public texts, my own historical drafts, and structured fact cards. Each category gets a different tag, and retrieval filters by tag to avoid style contamination.
The retrieval chain is usually: tokenize the topic, vector recall, keyword fallback, then rerank and take the top few results. The reranking step cannot be skipped, because pure vector recall tends to return fragments that are semantically close but stylistically off.
Seed generation turns a topic into executable writing instructions with four elements: core imagery, structural skeleton, style parameters, and prohibitions. Prohibitions are especially important, for example banning repeated use of the same sentence pattern and banning stacking more than two abstract nouns. Putting constraints upfront in the seed stage is far cheaper than reworking a finished draft.
5. Parallel Writing and Scheduling Control
Parallelism is the core means of compressing time. The nine drafts are not nine serial conversations but a single batch task: the same seed spawns nine sets of differentiated parameters, such as narrative perspective, timeline, and ending style, then executes concurrently.
Scheduling needs to handle three things: a concurrency limit, failure retries, and result convergence. A lightweight task table can manage state:
task_id | seed_id | variant | status | retry | draft_ref0001 | 001 | v1 | done | 0 | draft-00010002 | 001 | v2 | running | 1 | -
Differentiated parameters are the key to avoiding nine homogeneous outputs. If the nine parameter sets only change adjectives, the output will be highly similar; changing perspective and structure immediately widens the difference.
6. Automated Scoring: Turning Subjective Judgment into Vectors
The evaluation layer defines three to five dimensions: structural completeness, imagery density, language coherence, topic relevance, and originality risk. Each dimension uses the same scoring prompt and anchor examples to keep results comparable across batches.
To keep scoring stable, I introduce two mechanisms. First, blind scoring: the scoring skill does not see the prompts used during generation. Second, dual scoring with averaging: if the deviation between two scores exceeds a threshold, a third arbitration is triggered. Among the 294 scoring records, the proportion exceeding the threshold is not high, but it is exactly these samples that helped me correct the scoring anchors.
Scoring results are not only used for filtering but also flow back to the seed layer: whichever style parameters have the highest average score get a higher weight in the next batch. This forms a closed-loop iteration.
7. Distribution and Data Feedback
The distribution layer adapts formatting: a knowledge community favors long-form text with section subheadings, while a subscription platform favors short paragraphs with the summary upfront. After the adaptation skill processes the same draft, the title, summary, and body length are all rewritten rather than simply truncated.
After publishing, reading and engagement data are collected and correlated with the scoring vectors. In practice, high-scoring pieces do not necessarily spread well, which suggests the scoring dimensions need an additional metric such as readability.
8. Engineering Lessons and Common Pitfalls
First, do not let skills grow indefinitely; once the number of skills exceeds twenty, maintenance costs rise sharply, and similar ones should be merged. Second, persist all intermediate artifacts, because the pipeline must support resume-from-checkpoint. Third, version-control scoring prompts, otherwise historical scores lose comparability. Fourth, keep a human spot-check step: automation handles scale, humans handle the bottom line. Fifth, make cost observable by tracking call volume and latency per batch, so you can locate whether the bottleneck is in retrieval or generation.
The essence of this system is breaking creation into an orchestrable, measurable, and rollback-capable engineering workflow. The skill mechanism provides capability packaging, the data contract provides collaboration boundaries, and the scoring loop provides the iteration direction. Only by combining the three does “nine scored drafts in fifteen minutes” turn from a coincidence into a stable output.
