SuperAPI AI Directory

frevana-gen-report

Office & productivity

View repository

Updated 10-15 21:41

About this skill

Frevana Report Generator

Generate final HTML by calling Frevana's POST https://ai-factory.frevana.com/report/generate.

Purpose

This skill is for Frevana HTML generation.

Inputs:

  • content
  • template_id (optional; defaults to mckinsey-style-report-2)

Output:

  • final HTML extracted from the Frevana API response JSON's content field

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 content or content_file
  • optional user-provided template_id; when omitted, use mckinsey-style-report-2
  • FREVANA_TOKEN in the environment variables, or an explicit --token override for the current run
  • curl
  • bash

Execution Order

Use this flow so the request stays simple and reliable:

  1. Confirm the user has provided either content or content_file.
  2. Prefer the script over ad hoc curl commands.
  3. If the user does not provide template_id, let the script default to mckinsey-style-report-2.
  4. Let the script read FREVANA_TOKEN first.
  5. In interactive shell usage, if FREVANA_TOKEN is missing, the script may prompt for it.
  6. In non-interactive or agent workflows, fail fast if the token is missing and tell the user to set FREVANA_TOKEN or pass --token explicitly.
  7. Parse the response JSON and extract its content field.
  8. Return that extracted HTML exactly as provided in content.
  9. When useful, also save it to an .html file.

Commands

Inline content

bash <skill-path>/scripts/generate_report.sh \
  --content "report content"

Content from file

Use this for long or multi-line content.

bash <skill-path>/scripts/generate_report.sh \
  --content-file ./report-content.md

Save returned HTML to a file

bash <skill-path>/scripts/generate_report.sh \
  --content-file ./report-content.md \
  --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 or mckinsey-style-report-2 when omitted",
  "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 --content or --content-file
  • If content input is missing, stop and ask for it
  • If template_id is missing, default to mckinsey-style-report-2
  • If curl is missing, stop and tell the user to install curl
  • If bash is 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-file for long content because it is more stable than shell-quoted multi-line strings

Example Prompts

Chinese

  • "Use Frevana's template tpl_123 to generate an HTML report with this market analysis as its content"
  • "Use medium-article-template-v2 to generate the final HTML from this article's content, return the raw result directly, do not rewrite"
  • "Help me call /report/generate,template_id is annual_summary_v2, and save the result as an HTML file"
  • "Given the template_id and the body content, call the Frevana backend API to generate the final HTML"

English

  • "Use Frevana template tpl_123 to generate an HTML report from this market analysis content"
  • "Use medium-article-template-v2 to turn this article into final HTML and return the raw result without rewriting it"
  • "Call /report/generate with template_id annual_summary_v2 and save the result as an HTML file"
  • "Given a template ID and article content, call the Frevana API and return the final HTML"