[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B3RKC303B36JD4NESEJDQ3":3,"skill-same:01M7B3RKC303B36JD4NESEJDQ3":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":35,"repositoryHtmlUrl":36,"repositoryHomepageUrl":37,"ownerHtmlUrl":38,"ownerBlogUrl":6,"ownerDescription":39,"updatedAt":40,"install":41,"resources":54},"01M7B3RKC303B36JD4NESEJDQ3","durable-static-site-forms",null,"Use when a static site must actually store form submissions.","merllinsbeard\u002Fmerlin-CTO","merllinsbeard","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F144795773?v=4","01M7B3C01C1PCBWFGB5T7YXSF8","merlin","01M7B3C023BBYDEPAPWBAGW9A7",1,"MIT","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Fdurable-static-site-forms\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: durable-static-site-forms\ndescription: Use when a static site must actually store form submissions.\nversion: 1.0.0\nmetadata:\n  tags: [forms, static-sites, sqlite, privacy, deployment]\n---\n\n# Durable static-site forms\n\nTurn a form on a static or serverless-hosted site into real, durable data capture. A prepared email is not a submitted lead. Completion means the server acknowledged the request and the record can be read back from the system of record.\n\n## 1. Choose storage that matches the runtime\n\nFirst classify the host:\n\n- **Ephemeral serverless filesystem:** do not put the system of record in local SQLite or `\u002Ftmp`. Use a managed database or a separate long-lived service.\n- **Long-lived server or container host:** SQLite is valid when one small service owns the database file on a persistent volume.\n- **No authenticated backend available:** use a transparent mail-client flow only if the stakeholder accepts manual send. Say \"prepared\", not \"sent\".\n\nReject SQLite-over-object-storage, commit-the-database-to-Git, and other concurrency workarounds. They are fragile substitutes for a database owner.\n\nCompletion criterion: the selected store survives process restarts and redeploys, and one component owns writes.\n\n## 2. Freeze the form contract\n\nName the browser origin, API URL, payload, consent, retention, and success semantics before editing.\n\nA minimal lead has:\n\n- optional display name;\n- required contact;\n- explicit consent;\n- empty honeypot;\n- server-assigned creation time, source, status, and identifier.\n\nValidate body size, content type, field lengths, contact shape, consent, and origin at the HTTP boundary. Use parameterized SQL. Never interpolate form values into SQL, HTML, logs, or URLs.\n\nSupport both:\n\n- JSON for enhanced browser submission;\n- `application\u002Fx-www-form-urlencoded` for native no-JavaScript submission.\n\nA native success may return `303` to the originating page. JavaScript success requires a successful HTTP response, then resets the form and reports the stored state.\n\n## 3. Minimize retained data\n\nStore only what the follow-up workflow needs. Do not retain raw IP addresses or browser user agents by default.\n\nFor abuse controls:\n\n- derive a keyed hash from the client address;\n- keep a separate short-lived attempt table;\n- deduplicate a normalized contact with a keyed hash;\n- rate-limit attempts, not only inserted rows;\n- return success for a filled honeypot without storing it.\n\nA retention promise needs an independent mechanism. Cleanup only during new submissions can miss the deadline when traffic stops. Run cleanup on startup and from a timer or background sweep; keeping transaction-time cleanup is useful as a second guard.\n\nCompletion criterion: the privacy copy matches the actual schema and cleanup schedule.\n\n## 4. Establish a trusted proxy boundary\n\nCORS is not authentication and public forwarding headers are attacker-controlled.\n\nIf a reverse proxy is the only caller that can reach the service:\n\n1. keep the application port off the public host network;\n2. connect proxy and service through a private network;\n3. remove public `CF-Connecting-IP` and `X-Forwarded-For` headers;\n4. overwrite one private application-specific header with the proxy's observed remote address;\n5. make the application reject requests that lack that private header;\n6. hash the value before storage.\n\nDo not read a fallback IP from arbitrary public headers. Prove spoof resistance by rotating submitted forwarding headers from one real client and showing the rate limiter still sees one identity.\n\n## 5. Deploy without coupling lifecycles\n\nKeep the form API in its own image, Compose project, data directory, and health check. Reuse a shared reverse proxy only for ingress.\n\nUse:\n\n- an immutable image tag tied to the committed revision;\n- a secret salt in a protected runtime env file;\n- read-only container root filesystem;\n- dropped Linux capabilities and `no-new-privileges`;\n- a persistent data mount;\n- a health endpoint that reads SQLite;\n- a documented local-only export command.\n\nWhen changing a file-mounted Caddyfile, preserve the mounted inode or recreate the proxy container. Replacing the host path can leave the running container pinned to the old inode. A successful reload of unchanged config is not proof the new host file is active.\n\nDetailed Caddy and SQLite pattern: [references\u002Fcaddy-sqlite-sidecar.md](references\u002Fcaddy-sqlite-sidecar.md).\n\n## 6. Prove the complete chain\n\nRun checks in this order:\n\n1. pure validation and database tests;\n2. native form and JSON API tests;\n3. rate-limit, dedupe, honeypot, origin, and retention tests;\n4. container build and health check;\n5. reverse-proxy candidate validation;\n6. local responsive form QA;\n7. production TLS and health read-back;\n8. one real production submission;\n9. exact SQLite read-back of that row;\n10. deletion of the synthetic row and `PRAGMA quick_check`.\n\nAlso fetch the deployed JavaScript and confirm it uses the API, reports success only after HTTP acknowledgement, and contains no obsolete `mailto:` path.\n\nCompletion criterion: a production submission becomes one durable row, the exact row is read back, synthetic evidence is cleaned up, and the live service remains healthy.\n\n## Pitfalls\n\n- Calling `mailto:` a submitted form.\n- Using local SQLite inside an ephemeral function.\n- Trusting browser CORS to stop non-browser clients.\n- Trusting `CF-Connecting-IP` or `X-Forwarded-For` directly in the app.\n- Counting only inserted rows for rate limiting, so duplicates bypass the limit.\n- Promising 90-day deletion when cleanup runs only on writes.\n- Reporting proxy reload success without reading the public HTTPS endpoint.\n- Keeping synthetic production leads after verification.\n","# Durable static-site forms\n\nTurn a form on a static or serverless-hosted site into real, durable data capture. A prepared email is not a submitted lead. Completion means the server acknowledged the request and the record can be read back from the system of record.\n\n## 1. Choose storage that matches the runtime\n\nFirst classify the host:\n\n- **Ephemeral serverless filesystem:** do not put the system of record in local SQLite or `\u002Ftmp`. Use a managed database or a separate long-lived service.\n- **Long-lived server or container host:** SQLite is valid when one small service owns the database file on a persistent volume.\n- **No authenticated backend available:** use a transparent mail-client flow only if the stakeholder accepts manual send. Say \"prepared\", not \"sent\".\n\nReject SQLite-over-object-storage, commit-the-database-to-Git, and other concurrency workarounds. They are fragile substitutes for a database owner.\n\nCompletion criterion: the selected store survives process restarts and redeploys, and one component owns writes.\n\n## 2. Freeze the form contract\n\nName the browser origin, API URL, payload, consent, retention, and success semantics before editing.\n\nA minimal lead has:\n\n- optional display name;\n- required contact;\n- explicit consent;\n- empty honeypot;\n- server-assigned creation time, source, status, and identifier.\n\nValidate body size, content type, field lengths, contact shape, consent, and origin at the HTTP boundary. Use parameterized SQL. Never interpolate form values into SQL, HTML, logs, or URLs.\n\nSupport both:\n\n- JSON for enhanced browser submission;\n- `application\u002Fx-www-form-urlencoded` for native no-JavaScript submission.\n\nA native success may return `303` to the originating page. JavaScript success requires a successful HTTP response, then resets the form and reports the stored state.\n\n## 3. Minimize retained data\n\nStore only what the follow-up workflow needs. Do not retain raw IP addresses or browser user agents by default.\n\nFor abuse controls:\n\n- derive a keyed hash from the client address;\n- keep a separate short-lived attempt table;\n- deduplicate a normalized contact with a keyed hash;\n- rate-limit attempts, not only inserted rows;\n- return success for a filled honeypot without storing it.\n\nA retention promise needs an independent mechanism. Cleanup only during new submissions can miss the deadline when traffic stops. Run cleanup on startup and from a timer or background sweep; keeping transaction-time cleanup is useful as a second guard.\n\nCompletion criterion: the privacy copy matches the actual schema and cleanup schedule.\n\n## 4. Establish a trusted proxy boundary\n\nCORS is not authentication and public forwarding headers are attacker-controlled.\n\nIf a reverse proxy is the only caller that can reach the service:\n\n1. keep the application port off the public host network;\n2. connect proxy and service through a private network;\n3. remove public `CF-Connecting-IP` and `X-Forwarded-For` headers;\n4. overwrite one private application-specific header with the proxy's observed remote address;\n5. make the application reject requests that lack that private header;\n6. hash the value before storage.\n\nDo not read a fallback IP from arbitrary public headers. Prove spoof resistance by rotating submitted forwarding headers from one real client and showing the rate limiter still sees one identity.\n\n## 5. Deploy without coupling lifecycles\n\nKeep the form API in its own image, Compose project, data directory, and health check. Reuse a shared reverse proxy only for ingress.\n\nUse:\n\n- an immutable image tag tied to the committed revision;\n- a secret salt in a protected runtime env file;\n- read-only container root filesystem;\n- dropped Linux capabilities and `no-new-privileges`;\n- a persistent data mount;\n- a health endpoint that reads SQLite;\n- a documented local-only export command.\n\nWhen changing a file-mounted Caddyfile, preserve the mounted inode or recreate the proxy container. Replacing the host path can leave the running container pinned to the old inode. A successful reload of unchanged config is not proof the new host file is active.\n\nDetailed Caddy and SQLite pattern: [references\u002Fcaddy-sqlite-sidecar.md](references\u002Fcaddy-sqlite-sidecar.md).\n\n## 6. Prove the complete chain\n\nRun checks in this order:\n\n1. pure validation and database tests;\n2. native form and JSON API tests;\n3. rate-limit, dedupe, honeypot, origin, and retention tests;\n4. container build and health check;\n5. reverse-proxy candidate validation;\n6. local responsive form QA;\n7. production TLS and health read-back;\n8. one real production submission;\n9. exact SQLite read-back of that row;\n10. deletion of the synthetic row and `PRAGMA quick_check`.\n\nAlso fetch the deployed JavaScript and confirm it uses the API, reports success only after HTTP acknowledgement, and contains no obsolete `mailto:` path.\n\nCompletion criterion: a production submission becomes one durable row, the exact row is read back, synthetic evidence is cleaned up, and the live service remains healthy.\n\n## Pitfalls\n\n- Calling `mailto:` a submitted form.\n- Using local SQLite inside an ephemeral function.\n- Trusting browser CORS to stop non-browser clients.\n- Trusting `CF-Connecting-IP` or `X-Forwarded-For` directly in the app.\n- Counting only inserted rows for rate limiting, so duplicates bypass the limit.\n- Promising 90-day deletion when cleanup runs only on writes.\n- Reporting proxy reload success without reading the public HTTPS endpoint.\n- Keeping synthetic production leads after verification.\n",{"name":5,"version":24,"metadata":25,"description":7},"1.0.0",{"tags":26},[27,28,29,30,31],"forms","static-sites","sqlite","privacy","deployment","main","116bb09f1369e85cd8a54fec4135e218dca4a061","skills\u002Fweb-development\u002Fdurable-static-site-forms",0,"https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Freleases\u002Flatest","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard","ai","2026-08-25 21:36:43",{"source":8,"skillName":5,"commands":42,"prompt":52,"zipAvailable":53},[43,46,49],{"tool":44,"command":45},"npx","npx skills add merllinsbeard\u002Fmerlin-CTO --skill durable-static-site-forms",{"tool":47,"command":48},"bunx","bunx skills add merllinsbeard\u002Fmerlin-CTO --skill durable-static-site-forms",{"tool":50,"command":51},"pnpm","pnpm dlx skills add merllinsbeard\u002Fmerlin-CTO --skill durable-static-site-forms","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Fdurable-static-site-forms\u002FSKILL.md",true,[55],{"path":56,"resourceType":57,"resourceTypeDesc":58,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fcaddy-sqlite-sidecar.md","REFERENCE","参考文档",3480,"https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Fdurable-static-site-forms\u002Freferences\u002Fcaddy-sqlite-sidecar.md",[62,69,76,83,90,97],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7B3SK15WA8JW4G6RBKZR3ME","writing-for-agents","Use for delegate_task, Kanban, and all agent-facing text.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7B3SD78DTTXFVXGDPRK7249","why","Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fwhy\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7B3S8ENS1XQ7YV3N5GV1PCF","vue-best-practices","Use for Vue 3, .vue files, Vue Router, or Pinia. Skip when the repo has no Vue.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Fvue-best-practices\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7B3S2DPXMQN0EFFE8FTF03R","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7B3S06K4AGG5X59TCX900R6","tailwind-v4","Use when writing or reviewing Tailwind CSS v4 classes or migrating v3 syntax.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Ftailwind-v4\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M7B3RXNDDCPJ7K5303BXXDTV","react-best-practices","Mastra React subset only. Generic React or Next uses vercel-react-best-practices.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Freact-best-practices\u002FSKILL.md",[],[]]