Dineway Content Pipeline
Use this Skill as the master Agent protocol. Specialist Skills perform research, writing, and
optimization judgment. Native Pipeline state owns Runs, Jobs, Assignments, Attempts, Results,
Handoffs, timing, and next actions. Dineway CMS owns Draft and Live Revisions. Local
.dineway/content/ files are reconstructable working evidence only.
Required references
Read references/artifact-contract.md, references/workflow-policy.md,
references/local-scheduling.md, and references/listen-contract.md before changing state.
Read references/performance-benchmark.md when measuring or reporting Pipeline speed.
Invariants
- Read
dineway-cli before running the capability preflight below.
- Run exactly one
content_pipeline_capabilities_get preflight before the first mutation (CLI:
dineway pipeline capabilities). Proceed only when compact Context, batch Observations, Run Start,
Stage Begin/Complete, Draft assembly, atomic quality completion, connection readiness, and actor
write readiness are present. If ready=false, perform only the returned action. Do not retry
diagnosis and do not fall back to granular lifecycle writes.
- Start or explicitly resume the native Run before Research creates its first artifact.
- Follow
content_pipeline_status_get.currentStage and .nextAction; do not rebuild normal routing
from local files.
- Use
content_pipeline_stage_begin and content_pipeline_stage_complete for production work.
Granular Job, Assignment, Attempt, Result-record, and Result-accept writes are internal invariants,
not an Agent workflow.
- Treat every retry as at-least-once. Reuse stable idempotency keys, refresh native state after an
ambiguous response, and never infer whether a write committed.
- Never copy article bodies into Pipeline Result authority. Writer and Fix Results bind the native
content identity and exact Draft Revision.
- Never weaken exact-Draft Review, Quality Attestation, schema, media, calendar, role, CSRF, or
release-authorization gates to save time.
- Deep GEO is optional unless
run.metadata.deepGeoEnabled is exactly true.
- AI reasoning stays in specialist Skills. Deterministic surfaces persist, validate, coordinate,
authorize, and report; they do not hide model execution.
Entry and recovery
Run the single capability and authentication preflight above.
Call content_pipeline_run_start immediately. Pass runId only to resume an explicitly known
compatible Run; never coalesce work by title or objective.
Call content_pipeline_context_get once. Use its bounded content identity, schema fingerprint and
fields, Site Briefing entries, valid Observation summaries, accepted Result receipts, and wake
action. Do not rediscover these through separate status, schema, policy, and identity reads.
Call content_pipeline_status_get only for explicit resume or recovery, using the default summary
response. Request full only for diagnosis. If it reports Handoff,
failed/blocked work, Draft drift, or overdue capacity, resolve that state before normal production.
Only for explicit recovery or Handoff, cache the native status plus current CMS content and
release-readiness response in .dineway/content/runs/<run-id>/native-state.json, then run:
python3 scripts/scan_content_work.py --workspace <site-root> --run <run-id> --write --pretty
On a healthy path, trust every Start/Begin/Complete response and do not insert status/scanner
refreshes between Stages. Local scanner recovery actions may only
require refreshing corrupt/missing cache artifacts or reconciling an authoritative Handoff,
Assignment, Attempt, Draft, or calendar state.
Standard four-stage protocol
The standard production lifecycle uses no more than nine state-changing lifecycle calls:
- one
content_pipeline_run_start;
- Research Begin + Complete;
- Brief Begin + Complete;
- Writer Begin + Complete; and
- Optimization Begin + Complete.
Each Begin atomically creates or reuses the compatible Job, active Assignment, and running Attempt.
Do specialist work outside the transaction. Each Complete atomically validates the typed payload,
derives SHA-256/UTF-8 byte receipts from canonical artifacts, records immutable provenance and
observations, finishes the Attempt and Assignment, applies acceptance policy, and returns the next
action. Each Complete validates the stage's compact decisions, source, assessment, or optional typed
artifact input. Never hand-build a Result envelope, byte count, hash, or acceptance write.
Research
Call content_pipeline_stage_begin with stage research before collecting evidence. Run
dineway-content-research. For every Research type, use Dineway Tools to start organic SERP
analysis as the first evidence operation; only after it starts may keyword metrics, competitors,
questions, official sources, Site Context, and first-party inventory run concurrently. Record
explicit availability, numeric metrics or null, and bounded lineage in one idempotent Observation
batch. Complete with compact editorial decisions and the selected Observation IDs. The server
hydrates authoritative evidence, validates SERP-first ordering, compiles the canonical Research
Result, renders research/evidence.json and
research/findings.md, derives both receipts, and accepts Research. Do not perform free-form
browser research or send caller-built Result/artifact wrappers.
Brief
Begin brief; native state resolves and binds the latest accepted Research Result. Run
dineway-content-brief using that Result as the only evidence authority. Return only editorial
selections: target keyword, audience/voice choices, required topics/guardrails, internal-link and
media choices, approved questions, and the ordered outline. The server copies metrics, evidence,
identity, locale, schema, and upstream bindings from authoritative state, compiles the Writer-ready
Brief, renders brief/brief.md, and derives its receipt. Brief
acceptance is the single human governance decision in this lifecycle: an authenticated human must
complete or replay the stage with briefApproval.confirmed=true. API-token and system actors cannot
approve it. Do not start Writer until native status returns begin_writer.
Writer
Begin writer with the target identity; native state resolves and binds the accepted Brief. Run
dineway-content-writer and write one schema-aware source object with ordered sections/cards, final
copy, media IDs, and required accessibility metadata such as imageAlt. With CLI, pass it through
dineway pipeline stages complete --source-file <path>; the CLI reads the file locally and submits
its object. The Dineway backend validates the database-owned schema and media, assembles canonical
CMS JSON deterministically, writes one Draft Revision, derives the content fingerprint, creates the
Writer Result, and returns only a compact receipt. Do not call CMS create/update separately.
Optimization and content QA
Begin optimization against the exact Writer Draft. Run dineway-content-optimize as an audit by
default. Perform one complete content QA on that exact Draft:
- schema and identity;
- Brief coverage, heading structure, and required media/accessibility metadata;
- SEO metadata, canonical/robots, internal links, and structured data through native interfaces;
- source provenance and unresolved rules; and
- final SEO/GEO/brand/evidence/structure/readability scores.
This is content and governance QA through CLI, MCP, or native interfaces. Do not open a browser,
take screenshots, inspect lazy loading, test responsive layout, or perform interaction/rendering QA.
Complete with the compact assessment. When every mandatory check passes, do not submit content and
do not create another Draft. If blocking findings require content changes, include one consolidated
remediationSource; the backend permits one newer Draft and records the Writer source Draft → final
Draft lineage without a Writer rebind. If deepGeoEnabled is true, run a separate
geo_optimization Begin/Complete against the final Draft.
Atomic final-quality boundary
The final Optimization Complete—or optional deep-GEO Complete—preflights current Draft identity,
schema, accepted upstream Results, explicit source/final lineage, media, evidence, scores, gates, and
server-derived fingerprint. It commits Result acceptance and Quality Attestation in one transaction
or commits neither, then returns inspect_release_readiness. There is no separate Agent Attestation
mutation. A later Draft, Schema, policy, accepted Result, media, or evidence change still invalidates
the Attestation fail-closed.
Release readiness, Review, and publish
Before requesting approval or publishing, call the read-only content_release_readiness tool. It
returns current blockers and warnings separately, including actor/operation, exact Draft, Review,
release authorization, Quality Attestation, Schema/media evidence, calendar policy/capacity, and
schedule-time problems. It creates no grant, reservation, or approval state.
Quality Policy applicability comes only from accepted Pipeline Writer provenance. Never infer it
from whether the caller is a token, an API client, or a human-facing UI. Content with no accepted
Writer Result is manual and receives no Pipeline quality warning. Content with accepted Writer
provenance remains Pipeline-authored after later human edits; missing or stale exact-Draft quality
evidence is reported as a warning.
Resolve all blockers, submit one exact-Draft editorial Review Request, and wait for human approval.
For token actors, create and obtain approval for the exact release request. Re-run readiness with
the Review and release IDs. Token actors must never submit a policy override: resolve every warning,
then publish only when ready=true and the response says publish. A signed-in human Admin user may
separately confirm an exact overridable warning; Core binds that confirmation to the current Draft,
Review, warning fingerprint, policy, and authorizing user.
Use content_publish or dineway content publish. The successful response includes the durable
publication receipt derived from the consumed release grant: exact Draft/Live Revision IDs, Review,
release authorization, action hash, policy contributions, actor, and timestamps. Save that returned
receipt directly; do not assemble a local substitute or wait for a second receipt step.
Post-publish verification
The full content QA already ran before release. After publish, verify only native publication
state:
- expected title;
- expected Live Revision ID;
- expected card/item count where relevant;
- required media references remain valid; and
- no native publish or content error state.
Do not open a browser for this article workflow. Do not repeat the full crawl, schema audit, or
package check unless native state detects drift.
Optional Jobs, Monitor, and Fix
- Competition, AI Visibility, Atomization, Site Analysis, and Monitor use their typed specialist
Jobs when native status or the wake plan calls for them.
- Monitor records observations and deterministic evaluation only; it never edits content.
- A qualifying regression creates one deduplicated Fix opportunity for the existing content ID.
Fix starts/resumes a Run, creates a new Draft Revision, and repeats the same stage, Attestation,
Review, readiness, and release rules.
- Unsupported NLWeb/Chat Listen sources remain explicitly
not_configured or not_observed until
their native owner provides the contract.
Exit
Read native status and CMS identity once for final reporting, save the returned native
Result/publication receipts, and use scripts/benchmark_pipeline_trace.py for equivalent-scenario
complete-session performance evidence. Run the local scanner only when recovery or Handoff state
requires it. Report:
- current Run and stage;
- accepted Results and exact Draft/Live Revision;
- Content-ready, Review-ready, benchmark-complete, optional publication, human wait, tool execution,
Agent reasoning, orchestration, and QA timing;
- lifecycle writes, Agent-to-tool round trips, total tool-output bytes, retries, context compactions,
rebinding Jobs, late Attestation failures, and browser-QA calls;
- all remaining readiness blockers and human decisions;
- source unavailability; and
- native next action.
If responsibility moves, create a native Handoff. Do not leave ownership only in a local note.
1---2name: dineway-content-pipeline3description: Orchestrate Dineway's run-first Research, Brief, Draft, Optimize, release, publish, Monitor, and Fix workflow through native stage-level transactions and exact-Draft governance.4---56# Dineway Content Pipeline78Use this Skill as the master Agent protocol. Specialist Skills perform research, writing, and9optimization judgment. Native Pipeline state owns Runs, Jobs, Assignments, Attempts, Results,10Handoffs, timing, and next actions. Dineway CMS owns Draft and Live Revisions. Local11`.dineway/content/` files are reconstructable working evidence only.1213## Required references1415Read `references/artifact-contract.md`, `references/workflow-policy.md`,16`references/local-scheduling.md`, and `references/listen-contract.md` before changing state.17Read `references/performance-benchmark.md` when measuring or reporting Pipeline speed.1819## Invariants2021- Read [`dineway-cli`](../dineway-cli/SKILL.md) before running the capability preflight below.22- Run exactly one `content_pipeline_capabilities_get` preflight before the first mutation (CLI:23 `dineway pipeline capabilities`). Proceed only when compact Context, batch Observations, Run Start,24 Stage Begin/Complete, Draft assembly, atomic quality completion, connection readiness, and actor25 write readiness are present. If `ready=false`, perform only the returned action. Do not retry26 diagnosis and do not fall back to granular lifecycle writes.27- Start or explicitly resume the native Run before Research creates its first artifact.28- Follow `content_pipeline_status_get.currentStage` and `.nextAction`; do not rebuild normal routing29 from local files.30- Use `content_pipeline_stage_begin` and `content_pipeline_stage_complete` for production work.31 Granular Job, Assignment, Attempt, Result-record, and Result-accept writes are internal invariants,32 not an Agent workflow.33- Treat every retry as at-least-once. Reuse stable idempotency keys, refresh native state after an34 ambiguous response, and never infer whether a write committed.35- Never copy article bodies into Pipeline Result authority. Writer and Fix Results bind the native36 content identity and exact Draft Revision.37- Never weaken exact-Draft Review, Quality Attestation, schema, media, calendar, role, CSRF, or38 release-authorization gates to save time.39- Deep GEO is optional unless `run.metadata.deepGeoEnabled` is exactly `true`.40- AI reasoning stays in specialist Skills. Deterministic surfaces persist, validate, coordinate,41 authorize, and report; they do not hide model execution.4243## Entry and recovery44451. Run the single capability and authentication preflight above.462. Call `content_pipeline_run_start` immediately. Pass `runId` only to resume an explicitly known47 compatible Run; never coalesce work by title or objective.483. Call `content_pipeline_context_get` once. Use its bounded content identity, schema fingerprint and49 fields, Site Briefing entries, valid Observation summaries, accepted Result receipts, and wake50 action. Do not rediscover these through separate status, schema, policy, and identity reads.514. Call `content_pipeline_status_get` only for explicit resume or recovery, using the default summary52 response. Request `full` only for diagnosis. If it reports Handoff,53 failed/blocked work, Draft drift, or overdue capacity, resolve that state before normal production.545. Only for explicit recovery or Handoff, cache the native status plus current CMS content and55 release-readiness response in `.dineway/content/runs/<run-id>/native-state.json`, then run:5657 ```bash58 python3 scripts/scan_content_work.py --workspace <site-root> --run <run-id> --write --pretty59 ```60616. On a healthy path, trust every Start/Begin/Complete response and do not insert status/scanner62 refreshes between Stages. Local scanner recovery actions may only63 require refreshing corrupt/missing cache artifacts or reconciling an authoritative Handoff,64 Assignment, Attempt, Draft, or calendar state.6566## Standard four-stage protocol6768The standard production lifecycle uses no more than nine state-changing lifecycle calls:69701. one `content_pipeline_run_start`;712. Research Begin + Complete;723. Brief Begin + Complete;734. Writer Begin + Complete; and745. Optimization Begin + Complete.7576Each Begin atomically creates or reuses the compatible Job, active Assignment, and running Attempt.77Do specialist work outside the transaction. Each Complete atomically validates the typed payload,78derives SHA-256/UTF-8 byte receipts from canonical artifacts, records immutable provenance and79observations, finishes the Attempt and Assignment, applies acceptance policy, and returns the next80action. Each Complete validates the stage's compact decisions, source, assessment, or optional typed81artifact input. Never hand-build a Result envelope, byte count, hash, or acceptance write.8283### Research8485Call `content_pipeline_stage_begin` with stage `research` before collecting evidence. Run86`dineway-content-research`. For every Research type, use Dineway Tools to start organic SERP87analysis as the first evidence operation; only after it starts may keyword metrics, competitors,88questions, official sources, Site Context, and first-party inventory run concurrently. Record89explicit availability, numeric metrics or `null`, and bounded lineage in one idempotent Observation90batch. Complete with compact editorial decisions and the selected Observation IDs. The server91hydrates authoritative evidence, validates SERP-first ordering, compiles the canonical Research92Result, renders `research/evidence.json` and93`research/findings.md`, derives both receipts, and accepts Research. Do not perform free-form94browser research or send caller-built Result/artifact wrappers.9596### Brief9798Begin `brief`; native state resolves and binds the latest accepted Research Result. Run99`dineway-content-brief` using that Result as the only evidence authority. Return only editorial100selections: target keyword, audience/voice choices, required topics/guardrails, internal-link and101media choices, approved questions, and the ordered outline. The server copies metrics, evidence,102identity, locale, schema, and upstream bindings from authoritative state, compiles the Writer-ready103Brief, renders `brief/brief.md`, and derives its receipt. Brief104acceptance is the single human governance decision in this lifecycle: an authenticated human must105complete or replay the stage with `briefApproval.confirmed=true`. API-token and system actors cannot106approve it. Do not start Writer until native status returns `begin_writer`.107108### Writer109110Begin `writer` with the target identity; native state resolves and binds the accepted Brief. Run111`dineway-content-writer` and write one schema-aware source object with ordered sections/cards, final112copy, media IDs, and required accessibility metadata such as `imageAlt`. With CLI, pass it through113`dineway pipeline stages complete --source-file <path>`; the CLI reads the file locally and submits114its object. The Dineway backend validates the database-owned schema and media, assembles canonical115CMS JSON deterministically, writes one Draft Revision, derives the content fingerprint, creates the116Writer Result, and returns only a compact receipt. Do not call CMS create/update separately.117118### Optimization and content QA119120Begin `optimization` against the exact Writer Draft. Run `dineway-content-optimize` as an audit by121default. Perform one complete content QA on that exact Draft:122123- schema and identity;124- Brief coverage, heading structure, and required media/accessibility metadata;125- SEO metadata, canonical/robots, internal links, and structured data through native interfaces;126- source provenance and unresolved rules; and127- final SEO/GEO/brand/evidence/structure/readability scores.128129This is content and governance QA through CLI, MCP, or native interfaces. Do not open a browser,130take screenshots, inspect lazy loading, test responsive layout, or perform interaction/rendering QA.131132Complete with the compact assessment. When every mandatory check passes, do not submit content and133do not create another Draft. If blocking findings require content changes, include one consolidated134`remediationSource`; the backend permits one newer Draft and records the Writer source Draft → final135Draft lineage without a Writer rebind. If `deepGeoEnabled` is true, run a separate136`geo_optimization` Begin/Complete against the final Draft.137138## Atomic final-quality boundary139140The final Optimization Complete—or optional deep-GEO Complete—preflights current Draft identity,141schema, accepted upstream Results, explicit source/final lineage, media, evidence, scores, gates, and142server-derived fingerprint. It commits Result acceptance and Quality Attestation in one transaction143or commits neither, then returns `inspect_release_readiness`. There is no separate Agent Attestation144mutation. A later Draft, Schema, policy, accepted Result, media, or evidence change still invalidates145the Attestation fail-closed.146147## Release readiness, Review, and publish148149Before requesting approval or publishing, call the read-only `content_release_readiness` tool. It150returns current blockers and warnings separately, including actor/operation, exact Draft, Review,151release authorization, Quality Attestation, Schema/media evidence, calendar policy/capacity, and152schedule-time problems. It creates no grant, reservation, or approval state.153154Quality Policy applicability comes only from accepted Pipeline Writer provenance. Never infer it155from whether the caller is a token, an API client, or a human-facing UI. Content with no accepted156Writer Result is manual and receives no Pipeline quality warning. Content with accepted Writer157provenance remains Pipeline-authored after later human edits; missing or stale exact-Draft quality158evidence is reported as a warning.159160Resolve all blockers, submit one exact-Draft editorial Review Request, and wait for human approval.161For token actors, create and obtain approval for the exact release request. Re-run readiness with162the Review and release IDs. Token actors must never submit a policy override: resolve every warning,163then publish only when `ready=true` and the response says `publish`. A signed-in human Admin user may164separately confirm an exact overridable warning; Core binds that confirmation to the current Draft,165Review, warning fingerprint, policy, and authorizing user.166167Use `content_publish` or `dineway content publish`. The successful response includes the durable168publication receipt derived from the consumed release grant: exact Draft/Live Revision IDs, Review,169release authorization, action hash, policy contributions, actor, and timestamps. Save that returned170receipt directly; do not assemble a local substitute or wait for a second receipt step.171172## Post-publish verification173174The full content QA already ran before release. After publish, verify only native publication175state:1761771. expected title;1782. expected Live Revision ID;1793. expected card/item count where relevant;1804. required media references remain valid; and1815. no native publish or content error state.182183Do not open a browser for this article workflow. Do not repeat the full crawl, schema audit, or184package check unless native state detects drift.185186## Optional Jobs, Monitor, and Fix187188- Competition, AI Visibility, Atomization, Site Analysis, and Monitor use their typed specialist189 Jobs when native status or the wake plan calls for them.190- Monitor records observations and deterministic evaluation only; it never edits content.191- A qualifying regression creates one deduplicated Fix opportunity for the existing content ID.192 Fix starts/resumes a Run, creates a new Draft Revision, and repeats the same stage, Attestation,193 Review, readiness, and release rules.194- Unsupported NLWeb/Chat Listen sources remain explicitly `not_configured` or `not_observed` until195 their native owner provides the contract.196197## Exit198199Read native status and CMS identity once for final reporting, save the returned native200Result/publication receipts, and use `scripts/benchmark_pipeline_trace.py` for equivalent-scenario201complete-session performance evidence. Run the local scanner only when recovery or Handoff state202requires it. Report:203204- current Run and stage;205- accepted Results and exact Draft/Live Revision;206- Content-ready, Review-ready, benchmark-complete, optional publication, human wait, tool execution,207 Agent reasoning, orchestration, and QA timing;208- lifecycle writes, Agent-to-tool round trips, total tool-output bytes, retries, context compactions,209 rebinding Jobs, late Attestation failures, and browser-QA calls;210- all remaining readiness blockers and human decisions;211- source unavailability; and212- native next action.213214If responsibility moves, create a native Handoff. Do not leave ownership only in a local note.