frevana-gen-report
Frevana Report Generator
Generate final HTML by calling Frevana's POST https://api.frevana.com/report/generate.
Purpose
This skill is for backend HTML generation.
Inputs:
contenttemplate_id
Output:
- final HTML extracted from the Frevana API response JSON's
contentfield
The API returns JSON in the shape {"content": "<html>..."}. This skill extracts the content value and treats that HTML as the final API result. Do not modify, optimize, rewrite, or post-process it unless the user explicitly asks for that.
What This Skill Needs
- user-provided
contentorcontent_file - user-provided
template_id FREVANA_TOKENin the environment, or an explicit--tokenoverride for the current runcurlbash
Execution Order
Use this flow so the request stays simple and reliable:
- Confirm the user has provided
template_idand eithercontentorcontent_file. - Prefer the script over ad hoc
curlcommands. - Let the script read
FREVANA_TOKENfirst. - In interactive shell usage, if
FREVANA_TOKENis missing, the script may prompt for it. - In non-interactive or agent workflows, fail fast if the token is missing and tell the user to set
FREVANA_TOKENor pass--tokenexplicitly. - Parse the response JSON and extract its
contentfield. - Return that extracted HTML exactly as provided in
content. - When useful, also save it to an
.htmlfile.
Commands
Inline content
bash <skill-path>/scripts/generate_report.sh \
--content "report content" \
--template-id "report template id"
Content from file
Use this for long or multi-line content.
bash <skill-path>/scripts/generate_report.sh \
--content-file ./report-content.md \
--template-id "report template id"
Save returned HTML to a file
bash <skill-path>/scripts/generate_report.sh \
--content-file ./report-content.md \
--template-id "report template id" \
--output ./out/frevana-report.html
Token override for the current run
Use a token override only when the user explicitly gives one for the current run.
bash <skill-path>/scripts/generate_report.sh \
--content "report content" \
--template-id "report template id" \
--token "your bearer token"
Fixed Request Shape
The script sends this payload shape:
{
"content": "report content",
"template_id": "report template id",
"target_platform": "generate_auto_formating_content"
}
target_platform is fixed and should not be changed unless the API contract changes.
Response Shape
The API response is expected to be JSON like:
{
"content": "<html>...</html>"
}
This skill extracts content and returns only that HTML.
Output
- Success: the script parses the response JSON, extracts
content, and prints that HTML string to stdout - With
--output: the extracted HTML is also written to the specified file path - Failure: the script prints the response body or parsing error and exits non-zero
- The extracted HTML is the final API result and should be passed through unchanged unless the user explicitly requests edits
Notes
- Require exactly one of
--contentor--content-file - If either content input or
template_idis missing, stop and ask for it - If
curlis missing, stop and tell the user to installcurl - If
bashis unavailable, stop and tell the user to run the script in a Bash environment - Do not echo the Bearer token back to the user
- Prefer
--content-filefor long content because it is more stable than shell-quoted multi-line strings
Example Prompts
中文
- "用 Frevana 的模板
tpl_123生成一个 HTML 报告,内容是这段市场分析" - "用
medium-article-template-v2把这篇文章内容生成最终 HTML,直接返回原始结果,不要改写" - "帮我调用
/report/generate,template_id是annual_summary_v2,把结果保存成 HTML 文件" - "给你 template_id 和正文内容,调用 Frevana 后端 API 生成最终 HTML"
English
- "Use Frevana template
tpl_123to generate an HTML report from this market analysis content" - "Use
medium-article-template-v2to turn this article into final HTML and return the raw result without rewriting it" - "Call
/report/generatewith template_idannual_summary_v2and save the result as an HTML file" - "Given a template ID and article content, call the Frevana backend API and return the final HTML"