Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ subcommands, flags, and examples.
| `cards` | `list`, `show` (with Tasks), `create --template`, `update`, `stage`, `link`, `park` / `resume`, `template-update` |
| `templates` | `list`, `show`, `create`, `update`, `reset`, `delete`, `sync` (see Template editing below) |
| `kb` | knowledge base: `search`, `related <task|card>`, `show`, `tree`, `ls`, `resolve`, `backlinks`, `history`, `write`, `publish` |
| `newsletter` | issues and their sponsor slots: `list`, `show`, `create`, `update`, `delete`, `dismiss-alert` |
| `newsletter` | Relay issue planning, sponsor slots and render evidence: `list`, `show`, `create`, `update`, `final-render` |
| `podcast` | episodes: `list`, `show`, `create`, `update`, `create-card`, `delete` |
| `speakers` | website speaker/author profiles: `list`, `show`, `create`, `update` |
| `books` | Book of the Week entries: `list`, `show`, `create`, `update` |
Expand Down
31 changes: 15 additions & 16 deletions cli/skill/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ dataops whoami # confirm identity and role before writ
## Required resources: only take Tasks you can do

Many Tasks need an account or access you may not have: YouTube, Luma, Meetup,
Mailchimp, the DataTalks.Club mailbox, Slack, LinkedIn, the website repo, the
Relay, the DataTalks.Club mailbox, Slack, LinkedIn, the website repo, the
bank. A Task lists them in `requires` (`dataops tasks show` prints it, `--json`
has `requires`); `dataops resources list` gives every id.

Expand All @@ -89,7 +89,7 @@ export DATAOPS_CAPABILITIES=youtube,google-docs,website # what you can log in
dataops tasks list --mine # filtered by DATAOPS_CAPABILITIES
dataops tasks list --can-do youtube,luma # or say it per command
dataops tasks list --can-do all # ignore DATAOPS_CAPABILITIES
dataops tasks list --status todo --requires mailchimp # who needs Mailchimp access
dataops tasks list --status todo --requires youtube # Tasks that need YouTube access
```

A Task can depend on other Tasks of its Card (`dependsOn`; `dataops tasks show`
Expand Down Expand Up @@ -278,20 +278,19 @@ only after the recording date is confirmed
(`dataops podcast update <episode-id> --recording-date YYYY-MM-DD`); the episode
brief is available before confirm.

For a newsletter issue's Markdown package (`issue.md`, `sources.md`, `brief.md`):
store it in DataOps on the newsletter issue — never commit it to Git:
`dataops newsletter markdown set <issue-id> --issue-file issue.md --sources-file sources.md --brief-file brief.md`
(or one file at a time with `dataops newsletter markdown set <issue-id> [issue|sources|brief] --file <path>`).
It automatically populates the `"Newsletter Markdown"` link on the issue and its Card
and prints the shareable HTML preview link (`/newsletter-issues/<id>/preview?code=XXXX-XXXX-XXXX-XXXX`).
Use `dataops newsletter markdown show <issue-id> [issue|sources|brief]` to read it,
`dataops newsletter markdown preview <issue-id>` to print the shareable link, and
`dataops newsletter markdown rotate-code <issue-id>` to rotate the preview access code.
To put the sponsor copy into the Relay email, run `dataops newsletter relay-sync <issue-id|issue-number> --slot primary|secondary` (add `--dry-run` first). It maps the slot's sponsor document (title, kicker, body, bullets, closing, image, CTA) into the Relay issue's sponsor block with one per-block write (under the ~8 KB CloudFront WAF body limit), updating the existing block rather than adding another. The Relay issue key comes from `final-render --relay-key`, or pass `--relay-key`.

Issue content blocks (intro, spotlight, courses, events, recording, article, sponsor) are edited in DataOps: `dataops newsletter block list|show|add|edit|move|delete <issue> ...`, `block-types <issue>`, `blocks-sync <issue> [--dry-run]` (two-way, per block; conflicts refuse the whole sync), `revisions <issue> [--block <id>] [--diff]` (who changed what). Adds, moves and deletes reach Relay on the next `blocks-sync`. Sponsor blocks are special: the main one is pinned first (no move/delete, nothing above it), secondary ones can move but not be deleted, and both are read-only here: edit the sponsor doc, and every doc save syncs the block (`sponsor-sync <issue> --slot primary|secondary [--dry-run] [--force]` re-runs it). Refusals print the server message and exit non-zero.

Use `dataops newsletter image upload <issue-id> <path>` to upload a newsletter image (PNG, JPEG, GIF, or WebP) to durable public hosting and print its public `https://` URL for `issue.md` and the HTML preview.
For current newsletter production, read the issue's Task and its live SOP.
For weekly assembly, open
`dataops kb show sop.newsletter.assemble-the-weekly-newsletter-in-dataops`.
Build and review the issue in Relay, then attach its rendered email with
`dataops newsletter final-render <issue-id> --relay-key <key> --web-view-url <url>`.
Record the source links and delivery evidence on the DataOps issue and Task.

For sponsored slots, edit the slot's sponsor document and follow the live
SOP for sponsor block synchronization. Preview the mapping of that document
to the existing Relay block with
`dataops newsletter relay-sync <issue-id|issue-number> --slot primary|secondary --dry-run`.
`dataops newsletter image upload <issue-id> <path>` returns a durable public
image URL for the sponsor document or Relay issue.

For a podcast episode: `dataops podcast list --status booked` (or `--season N`),
`dataops podcast create --guests "Name[:slug]" --title "..." --recording-date YYYY-MM-DD`,
Expand Down
22 changes: 9 additions & 13 deletions cli/src/commands/newsletter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ export const summary = "Plan newsletter issues, their sponsor slots, and their C

export const help = `dataops newsletter - newsletter issues (the web Planning > Newsletter view)

Build and review current issues in Relay. Read the owning Task and its live
SOP for the workflow. For weekly assembly, open
dataops kb show sop.newsletter.assemble-the-weekly-newsletter-in-dataops
DataOps tracks the issue, sponsor slots, source links and delivery evidence.

An issue is one email. A weekly issue has an issue number and two sponsor
slots, primary and secondary; a stand-alone issue has one. A slot is booked
when it names a sponsor and open otherwise. Booking a slot for a sponsor from
Expand Down Expand Up @@ -63,14 +68,6 @@ Usage
dataops newsletter doc diff <doc-id> [--rev N]
dataops newsletter doc export <doc-id>
dataops newsletter doc delete <doc-id> --yes
dataops newsletter markdown set <issue-id> [issue|sources|brief] --file <path>
dataops newsletter markdown set <issue-id> [--issue-file <path>] [--sources-file <path>] [--brief-file <path>]
Store the Newsletter Markdown package (issue.md, sources.md,
brief.md) on the issue in DataOps, link the HTML preview on
the Card, and print the shareable preview link (?code=)
dataops newsletter markdown show <issue-id> [issue|sources|brief]
dataops newsletter markdown preview <issue-id>
dataops newsletter markdown rotate-code <issue-id>
dataops newsletter final-render <issue-id> [--html-file <path>] [--web-view-url <url>]
[--relay-key <key>] [--subject <text>] [--preview <text>] [--clear]
Attach Relay's rendered email HTML or web-view URL to
Expand Down Expand Up @@ -99,9 +96,8 @@ Usage
[--open-rate PCT] [--click-rate PCT]
[--linkedin-impressions N] [--linkedin-clicks N] [--linkedin-reactions N] [--linkedin-ctr PCT] [--linkedin-post URL|none]
[--x-impressions N] [--x-clicks N] [--x-reactions N] [--x-ctr PCT] [--x-post URL|none]
[--pull-mailchimp [--campaign ID] [--primary-url URL] [--secondary-url URL] [--dry-run]]
[--clear]
Show, set, or pull from Mailchimp the issue metrics and
Show or set the issue metrics and
per-slot (primary / secondary) link + LinkedIn + X metrics.
With no metric flags it shows the current values.
dataops newsletter report <issue-id> [primary|secondary] [--contact NAME] [--send]
Expand All @@ -121,7 +117,7 @@ Usage
start. The header row is found below the tab's banner
row. Creates missing issues (past ones get no Card); past
issues take the sheet's date, number, document links, and
Mailchimp/LinkedIn/X stats; upcoming ones only get what
recorded delivery and social metrics. Upcoming issues get what
they lack, differences are listed. Sponsor names and
company links already in DataOps are never overwritten or
cleared: sync fills what is missing and reports the rest.
Expand Down Expand Up @@ -884,7 +880,7 @@ export const doc = domainDocCommand("newsletter");

const MARKDOWN_KINDS = ["issue", "sources", "brief"];

export const newsletterMarkdownHelp = `dataops newsletter markdown - store and preview Newsletter Markdown packages in DataOps
export const newsletterMarkdownHelp = `dataops newsletter markdown - maintain historical newsletter packages

Newsletter Markdown packages (issue.md, sources.md, brief.md) live directly on the
newsletter issue in DataOps and are never committed to Git.
Expand Down Expand Up @@ -1070,7 +1066,7 @@ export async function markdown(args, io) {
return fn({ ...args, _: rest }, io);
}

export const newsletterImageHelp = `dataops newsletter image - upload durable public images for Newsletter Markdown
export const newsletterImageHelp = `dataops newsletter image - upload durable public images for a newsletter issue

Usage
dataops newsletter image upload <issue-id> <path>
Expand Down
12 changes: 12 additions & 0 deletions cli/test/work.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,18 @@ describe("agent guide", () => {
assert.match(io.text(), /leave it for another agent/);
});

test("guides active newsletter production through Relay", async () => {
for (const argv of [["agent-guide"], ["newsletter", "--help"]]) {
const io = captureIo();
assert.equal(await run(argv, io), 0);
const output = io.text();
assert.match(output, /Build and review.*in Relay/);
assert.match(output, /dataops kb show sop\.newsletter\.assemble-the-weekly-newsletter-in-dataops/);
assert.match(output, /dataops newsletter final-render/);
assert.doesNotMatch(output, /mailchimp|newsletter markdown|(?:issue|sources|brief)\.md/i);
}
});

test("the shipped guide puts the attached SOP first and uses creation-driven guest intake", async () => {
const io = captureIo();
assert.equal(await run(["agent-guide"], io), 0);
Expand Down