Content Creation Workbench for Agent Plugins: Design and Practice
This article describes a plugin-based content creation workbench for agent clients. It explains why long chat sessions are a poor fit for content production, then covers manifest-based extension points, a structured data model with a constrained article state machine, scheduling and capacity checks, retrospective and style-extraction modules, data boundaries, and practical implementation recommendations.
1. Background: Long Conversations Struggle to Support Content Production
When using an agent to assist with writing or video script production, a common pattern is to iterate in the same conversation. An article often goes through topic selection, a first draft, multiple rounds of revision, storyboard design, and publishing arrangements. These outputs stack up as messages in chronological order, mixing first drafts, revision notes, and storyboards. To find a specific version, users must scroll through messages one by one.
Conversation records are essentially timelines, while content production needs entities and states. An article has a title, body text, current stage, and planned publish time. A topic idea has a source and notes. If this information is stored only in a timeline, retrieval, statistics, and workflow transitions become laborious. A common engineering approach is therefore to add a structured workspace outside the conversation: the conversation produces content, and the workspace manages it.
2. Basic Approach to a Plugin-Based Architecture
To add a workspace to an existing agent client, a plugin-based approach is relatively safe. The host application only needs to provide a small number of extension points, and the plugin implements the concrete functionality. Typical extension points include:
- Navigation entry: register a standalone page in the sidebar or menu.
- Local storage: provide key-value or document storage for the plugin to save its own data.
- Command registration: register common operations as commands so they can be triggered in conversations.
- View rendering: allow the plugin to declare custom UI components.
A plugin lifecycle generally includes four phases: install, enable, disable, and uninstall. During installation, the host reads the manifest file and validates the version and dependencies. After enabling, the plugin registers entries and commands. When disabled, entries are hidden but data is retained. During uninstallation, the user must be clearly told whether data will be deleted as well, and this step should be reversible or exportable.
The following is a generic manifest example. Field names and permission names are illustrative and do not follow any specific product specification:
{"name": "content-workbench","version": "0.1.0","entry": "sidebar","permissions": ["storage.local"],"commands": ["workbench.open", "workbench.export"]}
Permission declarations should be as minimal as possible. If the workbench only needs to read and write local storage, it should not request network access or clipboard reading.
3. Data Model Design
A workbench usually revolves around four types of entities: ideas, articles, schedule items, and retrospective records. An idea is the lightest entity: it only needs a sentence, a link, or an image reference, plus a source and tags. An article is linked to one or more ideas and records versions. A schedule item binds an article to a date. A retrospective record stores performance data for published content and the lessons drawn from it.
The article state is the part that most needs strict constraints. One feasible division uses four stages—Idea, Draft, Scheduled, and Published—and defines the allowed transition directions. The example below uses a state table to restrict illegal transitions:
from dataclasses import dataclass, fieldfrom enum import Enumclass Stage(Enum):IDEA = "灵感"DRAFT = "成稿"SCHEDULED = "待发布"PUBLISHED = "已发布"ALLOWED = {Stage.IDEA: {Stage.DRAFT},Stage.DRAFT: {Stage.SCHEDULED, Stage.IDEA},Stage.SCHEDULED: {Stage.PUBLISHED, Stage.DRAFT},Stage.PUBLISHED: set(),}@dataclassclass Article:title: strstage: Stage = Stage.IDEAhistory: list = field(default_factory=list)def move(self, target: Stage) -> None:if target not in ALLOWED[self.stage]:raise ValueError(f"不允许从{self.stage.value}转到{target.value}")self.history.append((self.stage, target))self.stage = target
Published articles are not allowed to move backward because published content has already produced external data; arbitrary rollback would make retrospective data inconsistent. Keeping the history field makes it possible to trace how long each article stayed in each stage during retrospectives.
4. Scheduling and Publishing Plans
The core of the scheduling module is a calendar view. When a user drags an article to a day, the system creates a schedule item. Implementation must address two questions: whether to limit the number of publications on the same day, and how to notify related entries after a schedule change.
Conflict detection can serve as a pre-check for scheduling. The function below returns a warning when the number of items for a day exceeds a configured limit instead of rejecting the change outright, leaving the decision to the user:
from datetime import datedef check_capacity(schedule: dict, day: date, limit: int = 2) -> list[str]:"""Check the number of scheduled items for a day and return a warning if the limit is exceeded."""items = schedule.get(day, [])if len(items) >= limit:return [f"{day} 已有 {len(items)} 篇排期,已达到上限 {limit}"]return []
Schedule data should be stored separately from article data. When an article title changes, the schedule view should read the latest title instead of keeping a copy in the schedule item. This avoids inconsistency between two places.
5. Retrospectives and Knowledge Capture
The goal of the retrospective module is to turn result data into constraints for the next round of content creation. Recorded data usually includes metrics such as views, engagement, and completion rate; the exact metrics vary by platform and should be defined by the user.
The key to retrospectives is not recording numbers but attribution. Good performance for an article may come from the title, the cover, the publishing time, or the topic itself. The workbench can offer a simple approach: label one to three possible causes in each retrospective record, then consolidate recurring causes into writing rules. For example, a rule such as “articles with specific numbers in the title have a higher-than-average completion rate” can be written to a rules file for reference in later creation.
Rules files should be stored as plain text or Markdown for manual review and version control. The number of rules should not be too large; otherwise, it will limit creative diversity.
6. Style Extraction
The style module usually has two parts: preset styles and personal styles. Preset styles can be organized by category, such as technology, practical tutorials, and life essays, with references for tone, paragraph length, and opening style. Personal style needs to be extracted from old drafts provided by the user.
Feature extraction can start with quantifiable metrics, such as average sentence length, paragraph length, frequency of common connectives, and title patterns. The example below calculates average sentence length as one style feature:
import redef avg_sentence_length(text: str) -> float:"""Split sentences by Chinese periods, question marks, and exclamation marks, and return the average character count."""sentences = [s.strip() for s in re.split(r"[。!?]", text) if s.strip()]if not sentences:return 0.0return sum(len(s) for s in sentences) / len(sentences)
A single metric is not enough to describe style. In practice, multiple metrics should be combined into a style card, and users should be allowed to edit it manually. The style card constrains the generation step; it does not replace the user’s judgment.
7. Data Boundaries and Security
The workbench stores topics, articles, and retrospective data, which often contain unpublished information. The storage location should therefore be explicit. Prefer local storage, and when synchronization is involved, require users to opt in. Export functions should also remind users to check for sensitive content.
Input validation is equally important. Articles may contain external links and image URLs; before rendering them, check the protocol and allow only common safe protocols. Imported old draft files need size and format limits to avoid UI freezes caused by parsing abnormal files.
8. Practical Recommendations
First, design the data model and state transitions before the UI. State confusion is the most common source of failures in content workbenches.
Second, make scheduling and retrospectives optional modules. Not every creator needs full publishing management; a simple to-do list can meet most needs.
Third, write unit tests for the state machine and schedule validation. Test cases should cover edge cases such as illegal transitions, duplicate scheduling, and empty data.
Fourth, record the time and source of each modification. These logs help determine during retrospectives whether a change actually affected results.
Overall, structuring the outputs of conversations is the core value of a content workbench. Pluginization decouples the workbench from the host application, the data model and state machine keep the process controllable, and the retrospective and style modules let experience be captured and reused. When implementing it, define permissions and data boundaries first, then expand features gradually, avoiding piling up UI without constraints.
