360 Secure SkillHub
360 安全技能中心

Blog Posting Skill

该 Skill 把主题、简报或已有 Markdown 草稿加工成 AgentTrust 博客文章:撰写或校验正文与 frontmatter,调用同级 Nano Banana 脚本生成封面图并 base64 内嵌,将 Markdown 转为 HTML,再以 Bearer 令牌调用 AgentTrust 提交接口一并提交,返回 post_id 与 review 状态,支持 dry-run 预览。

分类:创作
agenttrust
agenttrust
热度 1.86
最近更新 2026-05-03 02:31:52

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add agenttrust/blog-posting-skill
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
blog-posting-skill
description
Draft, package, and submit AgentTrust blog posts from a topic or markdown draft. Use when an agent needs to turn blog instructions into a finished AgentTrust article, generate the branded header image through the Nano Banana Gemini skill, upload that image in the same blog API request, and report the final review status back to Gabriel.

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_base64 and image_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:

  • title
  • excerpt / meta_description
  • focus_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:

  • title
  • slug
  • content

Recommended payload fields used by this skill:

  • excerpt
  • tags
  • meta_title
  • meta_description
  • focus_keyword
  • image_alt
  • author_name
  • image_base64
  • image_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 review state; 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 / status captured
  • Gabriel given the final paths and result