| name | Deliver Brief |
| description | Render brief from template and deliver to configured targets (email, GitHub issue, terminal). |
Templates
Located in this skill's templates/ directory:
HTML templates (for email):
pm.hbs — Evening Wrap-up
am.hbs — Morning Brief
weekly.hbs — Weekly Report
monthly.hbs — Monthly Report
Markdown templates (for GitHub issues and other markdown-native targets):
pm.md.hbs — Evening Wrap-up
am.md.hbs — Morning Brief
weekly.md.hbs — Weekly Report
monthly.md.hbs — Monthly Report
Delivery Targets
Read ~/Documents/dayarc/config.json → delivery to determine where to send the brief. If the delivery field is absent or empty, fall back to the default: email-only for all brief types.
{
"delivery": [
{ "target": "email", "briefs": ["pm", "am", "weekly", "monthly"] },
{ "target": "github-issue", "briefs": ["weekly"],
"config": { "repo": "owner/repo", "labels": ["weekly-brief"] } }
]
}
Allowed brief IDs: am, pm, weekly, monthly
For each target entry where the current briefType is in the briefs array, execute that target's delivery handler. Targets are independent — if one fails, log the error and continue with others. End with a delivery summary showing which targets succeeded and which failed.
Delivery Modes
Scheduled (multi-target)
Step 1: Render — Render the appropriate template with brief data. Use .hbs (HTML) for email targets and .md.hbs (Markdown) for GitHub and other markdown-native targets. If locale is not en, translate the rendered content into the target language (preserving all markup, emoji, and links).
Step 2: Deliver to each target — For each matching target in config:
Target: email
- Verify Outlook is running (check process).
- Idempotency check: Query Outlook Sent Items for a message with this brief's subject:
$ol = New-Object -ComObject Outlook.Application
$sent = $ol.Session.GetDefaultFolder(5) # 5 = olFolderSentMail
$subject = "{subject}"
$alreadySent = $sent.Items | Where-Object { $_.Subject -eq $subject } | Select-Object -First 1
if ($alreadySent) {
Write-Host "already delivered — skipping send (ItemID: $($alreadySent.EntryID))"
# skip this target, continue to next
}
- Send via Outlook COM:
$ol = New-Object -ComObject Outlook.Application
$mail = $ol.CreateItem(0)
$mail.To = $ol.Session.CurrentUser.Address
$mail.Subject = "{subject}"
$mail.HTMLBody = Get-Content "{html-path}" -Raw
$mail.Send()
Email subjects (translate if locale is not en):
- PM:
🌙 Evening Wrap-up — {date}
- AM:
☀️ Morning Brief — {date}
- Weekly:
📊 Weekly — Week of {date}
- Monthly:
📅 Monthly — {month} {year}
Target: github-issue
Creates a GitHub issue with the rendered Markdown brief.
Config fields:
| Field | Required | Description |
|---|
repo | ✅ | Target repository in owner/repo format |
labels | optional | Array of label names to apply |
assignees | optional | Array of GitHub usernames to assign |
Idempotency: Before creating, search for an existing issue with the same idempotency marker:
$marker = "<!-- dayarc:brief={briefType} period={period} -->"
$existing = gh issue list --repo "{repo}" --search "$marker" --state all --json number --jq ".[0].number" 2>$null
if ($existing) {
Write-Host "already delivered — issue #$existing exists, skipping"
# skip this target, continue to next
}
Create the issue:
- Render the
.md.hbs template.
- Prepend the idempotency marker as a hidden HTML comment at the top of the body.
- Write rendered content to a temp file.
- Create the issue:
$title = "{subject}"
$labelArgs = ($labels | ForEach-Object { "--label `"$_`"" }) -join " "
gh issue create --repo "{repo}" --title "$title" --body-file "{temp-file}" $labelArgs
- Clean up temp file.
Period format:
- PM/AM:
{YYYY-MM-DD} (e.g., 2026-05-28)
- Weekly:
{YYYY}-W{week-number} (e.g., 2026-W22)
- Monthly:
{YYYY-MM} (e.g., 2026-05)
Subjects (used as issue title):
- PM:
🌙 Evening Wrap-up — {date}
- AM:
☀️ Morning Brief — {date}
- Weekly:
📊 Weekly — Week of {date}
- Monthly:
📅 Monthly — {month} {year}
⚠️ Privacy note: GitHub issues may be visible to others depending on repository access settings. Ensure the target repository is private if the brief contains sensitive work data (meeting attendees, email subjects, internal project names).
Target: custom (future)
Additional delivery targets can be added by extending this skill with a new handler section. Community-contributed targets should follow the same pattern: config field, idempotency check, delivery action, cleanup.
Conversational (terminal)
Render the brief as formatted markdown text in the terminal. If locale is not en, translate the output before displaying. Do NOT deliver to any scheduled targets unless the user explicitly says "send it" / "deliver it".
Instructions
- Read
config.json → delivery (fall back to [{ "target": "email", "briefs": ["pm", "am", "weekly", "monthly"] }] if absent).
- Filter to targets where current
briefType is in the target's briefs array.
- Render templates (HTML for email, Markdown for github-issue).
- Execute each target's handler with idempotency check.
- Report delivery summary:
✅ email: sent | ✅ github-issue: created #42 or ❌ email: Outlook not running | ✅ github-issue: created #42.
- Clean up all temp files.