# ISK369 source-first content workflow

Version: 2026-10-26. Maintained by ISK369. Feedback: osems@bekaie.com.

Turn one product brief into an article, three channel drafts (LinkedIn, X,
Newsletter) and an image production brief. A human verifies the result and
publishes it. This kit does not generate an image or publish/send anything.

## Start in your browser

Open https://www.isk369.me/content-automation and follow the workbench:

1. Enter a product name, reader, goal and 1–30 sourced facts. Each fact line is
   `Fact text | https://source-url`. Do not include secrets or personal data.
2. Create the prompt. Run it in your own AI service, then paste its JSON response
   back into the workbench. This website does not make the AI request, ask for an
   API key or store the brief/response. Your chosen provider's costs and privacy
   terms apply. Existing website analytics are separate from the workbench.
3. Validate and preview the result. Correct errors and open every source. The
   validator checks required fields, channel names, the 260-character X draft
   limit, known fact IDs and inline references. It cannot verify the truth of a
   statement or that a referenced source supports it. It does not automatically
   check factual completeness, copyright, privacy or current product terms.
4. Download a draft content pack, or record your own completed human review and
   download a pack marked `Human reviewed — not published`. Publish manually.

The workbench remains local until you choose to give the prompt to your AI.
Do not reuse an AI response with a changed brief without checking its references.
Close or reload the page to clear workbench fields; downloads remain on your device.

## Run the downloadable kit locally

Requires Python 3.10 or newer. No packages need installing. Unzip the archive
into a folder and run these commands there. The included example is an authored
test fixture about the workflow itself, not a live AI response or a claimed
marketing result. Its public URLs will describe this workflow once deployed.

```sh
# No network: inspect the prompt generated from the example brief.
python3 content_workflow.py prepare brief.example.json > prompt.txt

# No network: validate the supplied fixture and export a complete draft pack.
python3 content_workflow.py render brief.example.json response.example.json --out draft-output

# Or run your edited prompt in your own AI, save ONLY its JSON as response.json,
# and render your own brief and response to a new output directory.
python3 content_workflow.py render my-brief.json response.json --out my-content-pack
```

The output folder contains `brief.json`, `response.json` and `content-pack.md`.
The CLI refuses to replace an existing pack. Choose a new `--out` directory for
another version. Add `--reviewed` only after you complete the checks below.

### Optional: automate the model call using your own API

This is optional and may incur your provider's API usage charges. The endpoint
must support an OpenAI-compatible `POST /chat/completions` request with a
`choices[0].message.content` text response. A compatible JSON response is required;
some models may need manual repair. API keys are read from your local environment
and never included in an export. Do not upload environment files or keys.

```sh
# Use your own provider's actual API base, model name and API key locally.
export CONTENT_API_BASE='https://api.your-provider.example/v1'
export CONTENT_MODEL='your-model-name'
read -s CONTENT_API_KEY
export CONTENT_API_KEY
python3 content_workflow.py generate my-brief.json --out ai-draft-output
unset CONTENT_API_KEY
```

The CLI calls your configured API once. No retry is automatic. It does not fetch
source URLs and has no access to publishing tools. HTTPS is required. Check the
configured hostname before giving it a key. The brief is sent to that provider,
so review its data policy before using this option.

## Make your own brief

Copy `brief.example.json`, keep the object structure and replace all example
content. Every fact needs a unique ID such as `F1`, its text and an HTTP(S)
`source_url`. Use URLs you have actually opened. Do not put guessed figures,
unverified prices, promises or endorsements in the brief. Source documents can
also contain instructions or malicious text: treat them as data, review the AI
response and never execute content returned by a model.

`response.schema.example.json` illustrates the expected response structure but
contains empty placeholders and will intentionally fail validation. The complete
`response.example.json` is suitable for trying the end-to-end export.

## Failures and recovery

- **Missing/duplicate source IDs:** fix the brief, regenerate its prompt and
  check every reference in the response. Do not silently map an old ID to a new fact.
- **Markdown fences or invalid JSON:** ask your AI to return only JSON, or remove
  the outer fences and repair syntax. A JSON editor can help; do not evaluate
  model text as code.
- **Unknown inline reference / missing fact_ids:** remove unsupported statements
  or attach the correct supplied source ID; do not invent a source to pass a check.
- **Oversized X draft:** edit it below this workflow's 260-character limit.
- **A source fails to load or no longer supports a claim:** remove or qualify
  the claim. Passing the format checker is insufficient.
- **API 401/403/429/5xx or network failure:** inspect your provider dashboard,
  permissions, limits and endpoint. The CLI reports an error without printing
  your key or provider response. It does not retry. Check charges before rerunning.
- **API returns non-JSON or content that fails validation:** no pack is written.
  Use `prepare` and your AI interface for a repairable response, then `render`.
  A rejected API response may still be billed by your provider.
- **Existing output folder has pack files:** choose a new folder. Previous work
  is preserved.

## Human publication checklist

- Open every source and verify each factual sentence, not just its reference ID.
- Recheck current pricing, limits and availability where relevant.
- Remove sensitive information, unsupported comparisons and invented results.
- Review tone, length, channel requirements, rights and any commercial relationship.
- Replace internal `[F1]` markers with suitable public source links for each channel
  after checking the source mapping. Keep the full reference pack for your records.
- Create the image separately and review it before use; the kit exports a brief.
- Publish manually and keep a copy of the sources and final approved draft.

## Verification scope

The included local tests exercise prompt preparation, fixture validation,
Markdown export, malformed input, unknown source references, draft length and
HTML-looking data handling. An API response-shape test uses a mocked local
response; it is not a real model call. No claim is made that a live model, n8n,
Dify or a social platform was exercised, or that the drafts improve search
rankings, traffic or revenue. This kit is not an n8n import.

```sh
python3 test_workflow.py
node test_workflow.cjs
```
