AgentTrust Blog Posting Skill
Run the whole workflow inside this skill: topic → markdown draft → cover image → HTML payload → API submission.
Core rules
- Always generate the cover image before submitting the post.
- Always use the Nano Banana Gemini image generator through the sibling skill script.
- Always attach the generated image in the same blog API request via
image_base64andimage_filename. - Never silently downgrade to “text-only blog post” unless the user explicitly asks.
Acceptable starting points
A. Topic / instructions only
If the user gives only a topic, article brief, or raw notes:
- draft the article first
- save it under
blog-drafts/YYYY-MM-DD-slug.md - include complete frontmatter
- then run the publish helper script
B. Existing markdown draft
If the user already gives a markdown file, validate it and publish from that.
Expected frontmatter shape:
---
title: "Article Title"
description: "150-160 char SEO description"
date: "YYYY-MM-DD"
author: "Gabriel Guidarelli"
tags: ["ai-security", "agenttrust"]
status: "draft"
target_keyword: "primary keyword"
---
Use frontmatter as the source of truth for:
titleexcerpt/meta_descriptionfocus_keyword- tags
- slug
- author
Default workflow
1. Write the article if needed
When starting from a topic:
- write the blog post in Gabriel’s voice
- keep it clear, direct, and useful
- save the markdown draft locally before submitting
- make sure the frontmatter is complete before moving on
2. Generate the header image with Nano Banana
Use the bundled sibling script indirectly through:
python3 skills/blog-posting-skill/scripts/publish_agenttrust_blog.py <draft-path>
That helper script already calls:
skills/nano-banana-image-generator/scripts/generate_gemini_image.py
Do not invent another image workflow unless the Nano Banana path is broken.
The image prompt is locked to the AgentTrust trust-flow composition. Read references/cover-branding.md for the exact prompt and visual rules.
3. Convert markdown to clean HTML
The helper script converts the article body into simple clean HTML.
Supported structure:
- paragraphs →
<p> ##→<h2>###→<h3>- bullet lists →
<ul><li> - inline links → anchors
- basic bold / italic / inline code
4. Submit the post and image together
Use the production API:
POST https://agenttrust.ai/api/submitBlogPost
Auth:
Authorization: Bearer $AGENTTRUST_API_KEY
Content-Type: application/json
Required payload core:
titleslugcontent
Recommended payload fields used by this skill:
excerpttagsmeta_titlemeta_descriptionfocus_keywordimage_altauthor_nameimage_base64image_filename
When image_base64 is present, AgentTrust uploads the image and sets the blog image fields automatically. Prefer this over trying to host og_image manually.
Use the helper script
Standard end-to-end publish
python3 skills/blog-posting-skill/scripts/publish_agenttrust_blog.py \
blog-drafts/2026-04-14-my-post.md
Publish with explicit topic context for the image
python3 skills/blog-posting-skill/scripts/publish_agenttrust_blog.py \
blog-drafts/2026-04-14-my-post.md \
--topic "prompt injection protection for AI email"
Dry run
python3 skills/blog-posting-skill/scripts/publish_agenttrust_blog.py \
blog-drafts/2026-04-14-my-post.md \
--dry-run --json-out /tmp/blog-post-preview.json
What the helper script does
publish_agenttrust_blog.py:
- parses frontmatter
- validates required metadata
- derives slug if missing
- builds the Nano Banana prompt
- generates the cover image
- base64-encodes the generated image
- converts markdown to HTML
- submits the article and image together
- returns the API response with paths and payload summary
Reporting rules
After completion, report:
- article title
- markdown draft path
- generated image path
- whether the post was actually submitted or only dry-run built
post_id- returned status, normally
review - any failure reason if the image step or API step broke
Practical rules
- Use the production endpoint unless the user explicitly asks for test.
- Use Bearer auth, not
x-api-key. - Posts submit in
reviewstate; do not claim they are live unless confirmed. - Keep drafting, image generation, and submission as one workflow when the user asks for end-to-end publishing.
- If the Nano Banana image step fails, fix or retry that step before publishing.
- Prefer the helper script over manual curl because it keeps the workflow deterministic.
Output checklist
Before finishing, verify:
- draft exists locally
- frontmatter is complete
- cover image generated with Nano Banana
- image saved locally
- image attached through
image_base64 - HTML payload built cleanly
- article submitted to API or explicitly dry-run only
-
post_id/statuscaptured - Gabriel given the final paths and result
