Imported from nisrulz/app-privacy-policy-generator (
AGENTS.md). Install upstream withnpx skills add nisrulz/app-privacy-policy-generator. Copyright stays with the author.
AGENTS.md
Project Overview
Static Vue.js web app that generates privacy policies and Terms & Conditions for Android, iOS, and web apps. The build creates one index.html file. It uses no bundler or hot reload. The build toolchain is pure Go (cmd/build/): it renders Go text/template files, converts YAML to JavaScript, compiles Less, minifies JavaScript, and adds cache-busting values. Node is not required for the build.
Source Layout
src/tpl/— Gotext/templatefiles used to build the page;page.htmlis the entry point. The directory contains shared blocks (head,footer,mixins,meta,license-header, andcss) plus the page content. Templates use{{ }}(Go template delimiters); Vue uses[[ ]]delimiters. Put all labels and text throughtranslate('key').src/locales/— locale JSON files (one per language);en.jsonis the source of truth;de.jsonalso exists;_flagkey for each localesrc/tpl/mixins.html— shared template blocks:modal(),outputButtons(),attribution(),flycricketDeploy(),wizardProgress(),wizardMobileLogo(),wizardSidebar(); templates are invoked via{{template "name" .}}(carry the page-data dot) or{{template "name" (dict ...)}}(map args)src/tpl/meta.html— meta partials (metaBase,metaAppDescription,metaAuthor,metaWebappSupport,metaFavicon,metaDataTag,metaLinkPreview)src/tpl/css.html— CSS includes (inline normalize/bulma, preload sidebar image, stylesheet link)src/tpl/license-header.html— GPL license comment blocksrc/tpl/content.html— includes all content (wizard, privacy policies, T&C, disclaimer, FAQ, affiliate)src/tpl/modals.html— modal wrappers (privacy simple/no-tracking/gdpr, terms, disclaimer, faq)src/tpl/privacy-simple.html,privacy-no-tracking.html,privacy-gdpr.html— privacy policy bodies; all text viatranslate('key')src/tpl/tn-simple.html— T&C template; all text viatranslate('key')src/tpl/wizard-step-1..8.html— wizard steps; all labels viatranslate('key')src/tpl/info-modals.html— Disclaimer/FAQ modals with Vue-controlled visibility; text viatranslate('key')src/tpl/affiliate-flycricket.html— Flycricket affiliate integrationsrc/js/main.js— Vue app entry point: creates app with 3 composables (useAppState,useWizard,useContent), registerstranslate(),_updateMeta(),switchLocale()globallysrc/js/utils.js— utility helpers (convertHtmlToMd,getRawHTML,getContent,getTitle,loadInTextView)src/js/flycricket.js— Flycricket form submission helperwindow.fc_deploy(bodyContentId)(single function reused by all modal deploy buttons)src/includes/yaml/thirdpartyservices.yml— 3rd-party service definitions (source of truth); supports locale-awarename_{code}fields; JS is auto-generated during buildsrc/includes/vendor/— vendored third-party assets:vue.global.prod.js,to-markdown.min.jssrc/less/style.less— Less entry point (@imports 6 partials); compiled to CSS by Go buildsrc/less/_variables.less— Less variables (@color-primary,@font-sans,@border-radius, etc.)src/less/_base.less— Base layout, typography, hero, cards, footersrc/less/_scrollbar.less— Custom scrollbar stylessrc/less/_overrides.less— Label, button, input, modal, checkbox overridessrc/less/_bg-pattern.less—.bg-patternSVG data URI backgroundsrc/less/_dark.less— Dark theme overridespublic/site.webmanifest— PWA manifest (tracked, edit directly)public/sw.js— service worker with offline caching (tracked, edit directly)public/404.html— custom 404 page (tracked, edit directly)public/robots.txt— robots exclusion (tracked, edit directly)public/humans.txt— author/tech credits (tracked, edit directly)public/logo.svg— SVG logo (tracked, edit directly)public/images/third_party_logos/— third-party service logo images (tracked, add viaadd-thirdparty-serviceskill)public/images/app_graphics/— app graphics (side_image.png, 404.svg, etc.)public/images/app_icons/— UI icons (disclaimer.svg, etc.)public/favicon*,public/apple-touch-icon.png,public/android-chrome-*— favicons and PWA iconspublic/reviews.html— generated reviews page (committed for convenience)public/reviews-data.json— generated reviews data (committed for convenience)public/profile_pictures/— reviewer profile pictures (gitignored, generated by reviews tool)cmd/build/*.go— Go build toolchain source files (edit to modify build pipeline); includesserve.go(HTTP server for local dev)tests/golden-parity.spec.ts— served HTML parity tests for English and Germantests/golden/— golden HTML fixtures used by the Playwright parity teststests/— Playwright E2E tests (Node.js is used only on demand for testing)tools/reviews-page-generator/— standalone Go tool that generates the reviews page and its cached dataMakefile— project commands for formatting, building, serving, testing, and deployment
Build
make format # format Go source files
make check # run Go tests, vet, and build checks
make build # equivalent: go run ./cmd/build/
Compiles src/ → public/index.html, public/css/style.min.css, public/js/*.min.js. Build outputs are tracked. The build is pure Go — no Node/npm dependency.
Build pipeline:
- Go compiles
src/less/style.less→public/css/style.min.cssviatoakleaf/less.go - Go parses
src/includes/yaml/thirdpartyservices.yml→public/tmp/thirdpartyservices.js - Go builds locales registry from
src/locales/→public/js/locales.min.js - Go renders
src/tpl/(text/template, entrypage.html) →public/index.html - Go minifies
main.js→public/js/main.min.js; separately minifiesutils.min.js,thirdpartyservices.min.js,flycricket.min.js - Go copies vendor assets (Vue, to-markdown, Ko-fi image) to
public/ - Per-locale: Go renders HTML with
langoverride; Go generateslocale.min.js - Cache-busting:
?v=<md5>appended to all CSS/JS references in HTML files
Dev: make serve (builds then serves public/ on port 8000 via Go HTTP server).
Code Conventions
- No comments in source code unless documenting a complex legal rationale
- Commit style:
type(scope): Description - Vue.js 3 is self-hosted (served from
public/js/vendor/vue.global.prod.js); uses[[ ]]delimiters (configured increateApp) - Go
text/templatefiles use default{{ }}delimiters; Vue[[ variable ]]mustache interpolation passes through untouched (Vue.js syntax, not Go template syntax) - Translation: use
translate('key')in templates (global method set inmain.js), not$t('key') - Computed properties in Vue composable
computed()calls — prefer over inline string matching - Derived text (e.g.
deviceType,platformDesc) computed insidegenerate()following existing pattern, not watchers - Compile-time flags are passed as context fields on
pageDataincmd/build/render.go:Lang,Flycricket,NoTracking,Gdpr,ThemeToggle(alwaystruein the current site) data-themeattribute on<html>element; dark mode support via_dark.lessandtoggleTheme()inmain.js- Go 1.25 — toolchain uses
github.com/tdewolff/minify/v2for JS andgopkg.in/yaml.v3for YAML parsing
Testing
Run these checks:
- Run
make formatafter Go source changes. - Run
make checkfor Go vet and build checks. - The Playwright parity test compares served
en/deHTML againsttests/golden/. - Run
make checkfor all Go, golden, and Playwright checks. - Node.js is only required for
make check,make test-ui, andmake test-debug. make checkruns tests, vet, build, and Playwright checks.
Deployment
make deploy VERSION="<version>"
CI via GitHub Actions (.github/workflows/): production deploy on push to master, preview deploy on PRs from same repo. Only maintainers can deploy.
Skills
.agents/skills/add-thirdparty-service/— Load this skill when adding a new 3rd-party service entry..agents/skills/add-localization/— Load this skill when adding a new language translation.
Quick Workflow for Edits
- Edit templates under
src/tpl/ - Run
make formatafter Go source changes - Run
make buildto producepublic/ - Verify
public/renders correctly (openpublic/index.html) - Commit source and build output changes
Contribution Rules
- Bug fixes only for PRs (features discussed via issue first)
- New 3rd-party service: load the
add-thirdparty-serviceskill or manually add entry tosrc/includes/yaml/thirdpartyservices.yml+ logo (160×160) topublic/images/third_party_logos/ cmd/build/is pure Go; the build has no Node dependency (templates live insrc/tpl/, rendering viatext/template)- Build outputs expected (do not remove unless intentional):
public/index.html,public/css/style.min.css,public/js/*.min.js,public/js/vendor/,public/images/vendor/ public/sw.js,public/site.webmanifest,public/404.html,public/robots.txt,public/humans.txt,public/logo.svgare tracked source files (not generated)public/reviews.htmlandpublic/reviews-data.jsonare generated bytools/reviews-page-generator/but tracked for convenience