Skip to main content
T2 chain · SEO / content marketing: two nika:fetch extractions chained (sitemap mode, then article mode), a jq slice binding, CEL indexing, and a schema-typed brief at the end.

The job

« Write something that ranks for X » usually starts with an hour of tab-hopping through the competitor’s site. This workflow maps their sitemap, reads their best page on the topic, finds the gaps, and hands your writer a typed brief: title, angle, outline, keywords.

The shape

The file

seo-content-brief.nika

How it works

1

Sitemap mode + a jq slice

mode: sitemap returns the URL list; the extract: binding top: ".[:5] | map(.loc)" keeps just the head of it, as bare loc URLs. Bindings are jq: slices, filters, everything.
2

CEL indexes into the binding

The second fetch binds map_top: ${{ tasks.map.top[0] }} in with:: index access is part of the CEL subset, and the binding IS the edge — every reference is a visible edge, declared where the data crosses.
3

The brief is a contract

title · angle · outline · keywords: your writer (or your next workflow) consumes fields, not a wall of prose.

Constructs you just used

Run it

What it needs: A local model (Ollama serving qwen3.5:4b). Nothing else: the placeholder competitor host resolves nowhere and the recovered samples take over.
1

Rehearse it

A mock model answers and nothing is written in your folder. Before it runs, nika try names the hosts a step may reach: may reach: competitor.example.com — the mock replaces the model, not the network.
2

Get your own copy

Save the file above as seo-content-brief.nika in a new folder. It reads no sample file.
3

Check it, then run it

The run writes out/briefs/<topic>.json.Any other model works: pass --model <provider>/<name> with its key, and cap a cloud model with --max-cost-usd.For a real brief, point const.competitor_sitemap at a real sitemap and add its host to permits.net.http. --var topic=your-keyword picks the target.

Make it yours

  • Brief the top THREE pages instead of one: bind top: ${{ tasks.map.top }} in with: and fan out with for_each: { items: ${{ with.top }} }. The fan-out tier shows how (Competitor radar).
  • Feed your own sitemap too and ask the model for internal-linking opportunities.
  • Pipe the brief straight into a draft: a second infer consuming ${{ tasks.brief.output.outline }}.

Next · Invoice chaser

CSV → JSON with nika:convert, a jq filter, and the three-line human-approval gate.