Install
$ agentstack add skill-bm629-agent-skills-content-template-gateway ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Content Template Gateway
Overview
content-template-gateway is the canonical entry point for any agent-authored structured content in this project — regardless of destination. Whenever a user or agent is about to author content that will land in any of these targets, this skill is invoked first:
- Content-types (template-driving): RFC, ADR, post-mortem, runbook, spec, plan, PRD, one-pager, roadmap, README, tutorial, release notes, retrospective, status report, meeting notes, resume, cover letter, blog post, GitHub PR description / issue body / PR-or-issue comment, Jira or Linear ticket, multi-paragraph commit message, Slack or email announcement, or any other structurally-templated shape.
- Destinations (orthogonal — the same content-type can land in any of these): local markdown file, GitHub (PR / issue / comment body via
gh ...), Jira / Linear (API or web), Confluence, Notion, Google Drive, Slack, email, or any future system that accepts structured agent-authored prose. Content-type drives template choice; destination is incidental metadata carried into the Phase C directive.
The skill (a) identifies the content-type and variant from the user/agent's intent via research, (b) checks docs/templates/// for an existing template, (c) enforces template use via a hard-refusal directive if a template exists, (d) forges a new template (via a research-backed workflow) if none exists, and (e) advises on placing content that doesn't fit when the user asks.
The skill is self-contained: it prefers a research-capable skill when one is installed but falls back to built-in WebSearch + WebFetch so it works in any environment.
When to activate
- User asks to author any structured content — for any destination. Primary trigger.
- Agent is about to author structured content for any destination. Even when the user did NOT explicitly request a template — if YOU (the agent) are about to perform any of the following, this skill activates first. This is just as required as the user-initiated trigger. Examples (non-exhaustive):
- Write a new doc-shaped file:
temp-spec-*.md,temp-plan-*.md,docs//.md, README for a subdirectory, or any structurally-templated artifact. - Call
gh pr create,gh issue create,gh pr comment,gh issue commentwith a non-trivial body. - Create a Jira / Linear ticket or write its description body.
- Compose a multi-paragraph
git commitbody. - Post a long-form Slack / email message; publish a Confluence / Notion page.
- User asks to re-forge an existing template (mode
force-regenerate). - User asks to add a new variant of an existing content-type (mode
force-new-variant). - User says "advise: I have content that doesn't fit" — triggers Phase E.
- User invokes the skill explicitly (e.g.,
/content-template-gateway).
Do NOT activate when:
- User wants project structure scaffolding (e.g., "create a Python
uvworkspace"). Different skill. - User wants to translate an existing template to another language or format. Out of scope.
- User wants to fill in a template with real content (instantiate it). That's the consuming agent's job — this skill only returns the template + directive.
- User is editing already-authored content for typos / formatting / clarity. The skill is for new content authoring, not editing existing content.
- User explicitly says "I don't need a template — quick note." (Override case; not blocked but skill doesn't auto-fire.)
- Single-line / trivial content (one-line commit message, one-line Slack reply, terse code comment). The skill is for structured multi-section content.
Workflow
Phase A — Identify
Inputs:
- The user/agent's free-text intent (e.g., "I want to write a runbook for restarting the API", or "I'm about to
gh pr createfor the auth refactor"). - The destination hint (file path,
gh pr,gh issue,jira,linear,slack,commit-msg,confluence, etc.). Inferred from intent wording or the imminent tool call; ask if unclear. - Optional explicit mode hint (
use-or-createdefault,force-regenerate,force-new-variant). - Optional explicit content-type and/or variant override.
Action sequence:
- Detect mode from intent. Set mode based on the user's wording:
force-regeneratetriggers: "re-forge X", "regenerate the X template", "refresh X", "update the X template", "redo X".force-new-varianttriggers: "add a new variant", "create a variant called X", "new variant of Y called X".- Otherwise default to
use-or-create.
- Research content-type + variant. Use the fallback research chain: prefer
deep-researchskill (199-biotechnologies/claude-deep-research-skill — multi-source with credibility scoring + citation tracking) if active; else any other research-capable skill; else built-inWebSearch+WebFetch. (See## Research methodologyfor how to actually do the research.) - Handle ambiguity. If research returns 2–3 plausible content-type candidates, present them with one-line descriptions and let the user pick.
- Apply slug rules to produce canonical `
andslugs (lowercase-hyphens; strip content-type word from variant; truncate at 30 chars; reserved variant slugsREADME/template/research/./_`). - Confirm slugs. Show: "I'll look for
docs/templates///. Confirm or rename."
Failure handling: If Phase A cannot identify after research, ask for more context. Up to 2 rounds. Then abort with a force-new-variant mode hint.
Output to Phase B: content-type slug, variant slug, mode, destination.
Phase B — Check
Inputs from Phase A: content-type, variant, mode, destination.
Action sequence:
- Classify
docs/templates///:
- Complete — both
template.mdandresearch.mdexist. - Missing — folder does not exist.
- Orphan partial — folder exists but
template.mdorresearch.md(orforge:frontmatter) is missing.
- Branch on mode + state:
| Mode | State | Next | |---|---|---| | use-or-create | Complete | → Phase C | | use-or-create | Missing | → Phase D, then C | | use-or-create | Orphan | → Orphan sub-menu (see below), then re-classify | | force-regenerate | Complete or Orphan | → Phase D (overwriting), then C | | force-regenerate | Missing | → Phase D, then C | | force-new-variant | Complete | → Slug collision; ask for different slug, re-enter B | | force-new-variant | Missing | → Phase D, then C | | force-new-variant | Orphan | → Orphan sub-menu first, then re-classify |
Orphan sub-menu (referenced from the table above):
For each orphan variant folder detected, prompt the user:
> Partial variant folder detected: / (missing: template.md and/or research.md and/or forge: frontmatter). > What would you like to do? > 1. Regenerate it (re-run Phase D for this slug) > 2. Delete it > 3. Leave alone (skip; surface again next run)
Apply the choice, then re-classify the folder and continue per the branch table.
Output to Phase C or D: validated content-type, variant, destination, and a should_forge flag.
Phase C — Enforce
Inputs: validated content-type, variant, destination. The template files exist at docs/templates///.
Action sequence:
- Load
template.mdandresearch.md. - Assemble the return payload:
``` ═══════════════════════════════════════════════════════════════ TEMPLATE DIRECTIVE — MUST FOLLOW ═══════════════════════════════════════════════════════════════
You are about to author content of type: Variant: Destination: (file path, gh pr, jira, slack, ...) Template source: docs/templates///template.md
RULES:
- You MUST follow the template structure below — section headings,
order, and required fields are not negotiable.
- You MAY add placeholder text or fill in sections, but you MUST
NOT remove or rename sections.
- If your content does not fit any section in the template, STOP
and invoke content-template-gateway with intent "advise: I have content that doesn't fit" — do NOT improvise sections.
- You MUST author the content INTO the template before performing
any destination-side action (writing the file, calling gh pr create, posting the ticket, sending the message, etc.). Do NOT call the destination first and patch later.
- If you proceed without this template, you are violating
the project's "templates first" norm.
═══════════════════════════════════════════════════════════════ TEMPLATE CONTENT — copy and fill in below ═══════════════════════════════════════════════════════════════
═══════════════════════════════════════════════════════════════ RESEARCH NOTES — for your reference (not required reading) ═══════════════════════════════════════════════════════════════
```
- Return the assembled payload to the caller.
No user prompts. Pure output assembly.
Phase D — Forge (sub-procedure)
Invoked from: Phase B (Missing or Orphan-resolved), or directly when mode is force-regenerate / force-new-variant.
Action sequence:
- Initial content-type research via fallback chain. (See
## Research methodologyfor how.) - Propose variants. Skip this step entirely when mode is
force-regenerateorforce-new-variant— the variant is already named in Phase A's output. Otherwise (mode =use-or-create), present 2–4 candidates with one-line descriptions and auto-derived slugs. User accepts the list / edits it / asks for a fresh research pass. - Deep research per variant. Re-invoke fallback chain with variant's narrower scope. (See
## Research methodology.) On failure: retry once → sub-menu (retry / skip / cancel). - Emit artifacts (in this order):
- For each variant: write
template.mdthenresearch.mdintodocs/templates///. Both carryforge:frontmatter (status: unreviewed,forged:,reviewed: null). - After ALL variants are written, update
docs/templates//README.mdas the variant index. - Skipped variants leave no folder and are excluded from
README.md. - Print end-of-forge summary to the caller in this format:
`` Forge complete for `.
Emitted: • (docs/templates///) • (docs/templates///)
Skipped (research failed): • — retry by re-invoking with mode force-new-variant ```
The "Skipped" block is omitted entirely if all variants succeeded.
Output to Phase C: the content-type + variant of the template the caller asked for.
Phase E — Advise (sub-procedure)
Invoked from: Phase A when intent matches an "advise:" pattern.
Inputs: content-type and variant of the currently-enforced template, plus user's content that doesn't fit.
Action sequence:
- Load the current
template.mdandresearch.md. - Research placement via fallback chain — how is this kind of content typically placed for this content-type? (See
## Research methodology.) - Decide & branch:
- Fits within existing variant → return placement recommendations (paragraph N →
## SectionName). - Does not fit → propose a new variant with the missing section. Ask user: yes (invoke Phase D for the new variant) / no (return best-effort placement to the existing variant) / refine (user describes what to change about the proposal; up to 2 refinement rounds, then accept the best version or abort with a placement-recommendation fallback).
Output: either placement recommendations (plain text) or a new template + directive (via Phase D → Phase C).
Research methodology
All research calls (Phase A; Phase D Steps 1 and 3; Phase E) follow this methodology.
Goal per research call
- Phase A — Identify. "What content-type is this? What variants exist? Which variant best matches the user's intent?"
- Phase D Step 1 — Initial. "What is this content-type in general? Canonical examples?"
- Phase D Step 3 — Per-variant deep. "For THIS specific variant, what sections / structure does it conventionally have?"
- Phase E — Placement. "For this content in the context of this template, where does it conventionally go, or does it require a new variant?"
Source-quality tiers (prefer top of list)
- Official / canonical references — original specifications (e.g., Michael Nygard's ADR post for ADRs), official documentation, language/framework reference docs, destination-platform docs (GitHub's PR template guidance, Atlassian's Jira ticket guides).
- Multiple corroborating engineering blogs — well-established sources like Google SRE Book, Atlassian Handbook, GitLab docs, well-known company engineering blogs.
- Single reputable source — usable, but mark as single-source in
research.md. - Avoid — individual Stack Overflow answers (without corroboration), AI-generated content farms, individual tutorials with no provenance.
Query pattern (broad → narrow)
- Broad: "what is a ``" — confirm the high-level shape.
- Structure: "`` template / sections / structure"
- Variants: "`` variants / types"
- Examples: "`` example" — verify proposed sections appear in real instances.
Minimum sources before declaring a section "canonical"
- 2+ independent sources must include a section before treating it as canonical for the variant.
- 1 source only → include in template but mark the section in
research.mdas "single-source; verify before relying on it." - Contradictory sources → present both interpretations in
research.md; pick based on user's likely context, or ask the user.
Verification checks before emitting
- [ ] Every section in the proposed
template.mdappears in at least 2 real-world examples for that variant. - [ ] Variants are meaningfully distinct — if two proposed variants have 90%+ section overlap, they're not really different variants (merge or rename).
- [ ] Section names use common terminology (don't invent new names).
Stop criteria
- 2–3 sources agree on the structural shape → enough.
- New queries return content already seen → stop.
- Token / time budget reached → stop and commit to best-effort; flag in
research.md.
Rules
Hard rules (never violate):
- Never return a template without the hard-refusal directive.
- Never overwrite an existing template file outside Phase D and outside
force-regenerateorforce-new-variantmode. - Never declare a skill dependency. The skill is self-contained; the research fallback chain is a runtime preference.
- Never enumerate trigger commands in the SKILL.md body beyond example illustration. The
When to activatelist is illustrative, not closed — agents apply the underlying principle ("structured agent-authored content for any destination") to any new tool / API / system.
Preferences (override-able by user choice):
- Prefer
deep-researchskill (199-biotechnologies/claude-deep-research-skill) if available (fallback order). - Prefer skip-on-failure over abort-on-failure in Phase D.
- Prefer immediate cancellation without confirmation.
Output
The skill returns one of:
- Phase C payload — assembled directive + template + research, ASCII-bounded. Returned for any successful
use-or-create/force-regenerate/force-new-variant/ Phase-E-new-variant path. - Phase E placement recommendations — plain-text section-mapping. Returned when Phase E's research determines content fits within the existing variant.
- Abort signal — plain-text reason. Returned when user cancels or Phase A exhausts its 2 context-gathering rounds.
Side effects on disk:
- Phase D writes
template.md,research.md, andREADME.mdunderdocs/templates//. - No other phase writes to disk.
- The skill never writes to external destinations (files
…
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: bm629
- Source: bm629/agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.