본문으로 건너뛰기
cccskills
무료GitHub에 공개

cm-google-form

Google App Script form-to-sheet integration with auto-retry, toast notifications, and Zalo/contact fallback. Reusable across any static website.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구Google Sheets
설치 방법 보기

포함된 파일(5)

  • SKILL.md7.9 KB
  • templates/apps-script.js2.2 KB
  • templates/form-markup.html4.6 KB
  • templates/form-submit.js7.8 KB
  • templates/toast.css3.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Google Forms → Sheet Integration Skill

Connect HTML forms → Google Sheets via Google Apps Script. Auto-retry, toast UI, contact fallback on errors. Zero dependencies, works on any static site.


🎯 When to Use

TriggerAction
User says "create form", "connect Google Sheet"Activate this skill
User says "form broken", "submit not working"Debug using Phase 4-5
User says "add new form to page"Start from Phase 2
User says "form for another website"Start from Phase 1

📋 5-Phase Workflow

Phase 1: DISCOVER → Scan forms, identify fields, determine sheet structure
Phase 2: PLAN → Design sheet columns, map form fields, create deployment plan
Phase 3: BUILD → Generate Apps Script + Frontend JS + Toast CSS
Phase 4: INTEGRATE → Wire forms to JS, add CSS, deploy Apps Script
Phase 5: VERIFY → Test submit, test retry, test error fallback

🔴 Rule: NEVER skip Phase 1. Always read existing forms first.


Phase 1: DISCOVER (Scan & Analyze)

Goal: Understand what forms exist and what fields they have.

Actions:

  1. Search for forms in the project:

    grep -r "data-form-type\|onsubmit\|<form" --include="*.html" .
    
  2. For each form found, extract:

InfoHow to Find
Form typedata-form-type attribute
Fields<input name="...">, <select name="...">
Submit handleronsubmit attribute
Page URLFile path
  1. Ask user (Socratic Gate):
    • How many separate Google Sheets? (1 shared sheet or separate?)
    • What columns does each sheet need?
    • Is there a fallback contact channel? (WhatsApp, Messenger, Hotline?)
    • Fallback contact URL (e.g., https://wa.me/15551234567)

Output: Form Inventory Table

| # | Form Type | Pages | Fields | Target Sheet |
|---|-----------|-------|--------|-------------|
| 1 | massage   | 7     | name, phone, branch, problem, time, package | Sheet Massage |
| 2 | course    | 1     | name, phone, goal | Course Sheet |

Phase 2: PLAN (Design & Map)

Goal: Map form fields → Sheet columns → Apps Script params.

Sheet Column Design

For each sheet, define columns in order:

ColumnSourceAlways Include
Timestampnew Date() — auto✅ Yes
(form fields)e.parameter.xxxFrom inventory
Page Sourcee.parameter.url✅ Yes

Naming Convention

ElementConvention
Sheet tab nameData
Form attributedata-form-type="<type>"
Hidden URL field<input type="hidden" name="url" value="">
JS global functionwindow.submitToGoogleSheet

Deliverables Checklist

  • Apps Script code per sheet
  • Frontend JS with retry + toast
  • Toast CSS component
  • HTML form markup template
  • Deploy instructions
  • Verification test plan

Phase 3: BUILD (Generate Code)

3A. Google Apps Script Template

See templates/apps-script.js for the full template.

Key rules:

  • Always use doPost(e) — NOT doGet
  • Always wrap in try/catch
  • Always return JSON with {status: "success"} or {status: "error", message: "..."}
  • Column order MUST match sheet.appendRow([...]) order
  • Tab name MUST match SHEET_NAME constant

3B. Frontend JavaScript

See templates/form-submit.js for the full template.

Key features:

FeatureDetail
Auto-retry3 attempts, exponential backoff (1s → 2s → 4s)
Toast UISuccess (green), Error (red), Retrying (amber)
Phone validationVietnamese format: /^0\d{8,10}$/
Button states"Submitting..." → "Retrying (X/3)..." → reset
CORS handlingHandles opaque responses from Apps Script
FallbackZalo button in error toast
Auto-dismissSuccess: 6s, Error: 15s, Retrying: 10s

3C. Toast CSS

See templates/toast.css for the full template.

3 variants: --success, --error, --retrying

3D. HTML Form Markup

See templates/form-markup.html for examples.

Required attributes:

<form data-form-type="TYPE" onsubmit="window.submitToGoogleSheet(event)">
  <input type="hidden" name="url" value="">
  <!-- form fields with name="..." -->
  <button type="submit">Submit Text</button>
</form>

Phase 4: INTEGRATE (Wire Everything)

Step-by-step:

  1. Add Toast CSS → Append to main CSS file (e.g., design-system.css)
  2. Add Form JS → Add to shared JS file or create js/form-handler.js
  3. Update HTML forms:
    • Add data-form-type="..." attribute
    • Add onsubmit="window.submitToGoogleSheet(event)"
    • Add <input type="hidden" name="url" value="">
    • Ensure all inputs have name="..." matching Apps Script params
  4. Configure URLs:
    • Replace placeholder URLs in JS with deployed Apps Script URLs
  5. Configure fallback contact:
    • Replace Zalo URL in JS toast with project's contact URL

Customization Points

SettingLocationDefault
Apps Script URLsJS URLS objectplaceholder
Fallback contactToast Zalo linkhttps://zalo.me/...
Max retriesfetchWithRetry arg3
Phone regexValidation block/^0\d{8,10}$/
Toast auto-dismissshowFormToast timeouts6s/15s/10s
Success message.then() blockCustomizable
Error message.catch() blockCustomizable

Phase 5: VERIFY (Test & Report)

Test Checklist

#Test CaseExpectedStatus
1Submit valid formToast success (green) + Zalo opens
2Submit invalid phoneToast error "Invalid phone number"
3Network offline3 retries → Toast error with Zalo button
4Check Google SheetNew row appears with correct data
5Button statesDisabled during submit, resets after
6Toast close buttonToast disappears on click
7Mobile responsiveToast visible above sticky CTA
8Multiple forms same pageEach form submits independently

How to Test Retry

  1. Open DevTools → Network tab
  2. Block domain script.google.com
  3. Submit form → Should see 3 retry attempts
  4. Unblock → Submit again → Should succeed

Report Template

## Form Integration Test Report

**Date:** YYYY-MM-DD
**Pages tested:** X/Y

| Page | Form Type | Submit | Retry | Fallback | Sheet |
|------|-----------|--------|-------|----------|-------|
| index.html | massage | ✅ | ✅ | ✅ | ✅ |
| khoa-hoc.html | course | ✅ | ✅ | ✅ | ✅ |

**Issues found:** None / [list issues]
**Resolution:** [fixes applied]

❌ Anti-Patterns

❌ Don't✅ Do
Use alert() for feedbackUse toast notifications
No retry on failureAuto-retry 3x with backoff
Silently failShow error + contact fallback
Hardcode form URLsUse config object (URLS)
Skip phone validationValidate before submit
Forget name attributeEvery input MUST have name
Use doGet for form submitUse doPost only
Multiple submit handlersOne shared submitToGoogleSheet

📑 Templates

FilePurpose
templates/apps-script.jsGoogle Apps Script doPost handler
templates/form-submit.jsFrontend JS with retry + toast
templates/toast.cssToast notification CSS component
templates/form-markup.htmlHTML form examples

🔗 Related Skills

NeedSkill
Form UI/UX design@[skills/cm-ux-master]
SEO for forms@[skills/cm-dockit]
Form security@[skills/vulnerability-scanner]
Deployment@[skills/deployment-procedures]

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

End-to-end ad conversion tracking: Meta Pixel+CAPI, TikTok Events API, Google Ads Enhanced Conversions, GTM, attribution. Auto-detects industry, maps standard events, outputs a developer-ready implementation doc. Use for pixels, GTM, CAPI, ROAS, or 'set up tracking' requests.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tody-agent/codymaster532026년 8월 26일 업데이트

Comprehensive publishing automation skill bridging AI agents (OpenClaw, Manus, Claude) to the Content Factory Router. Uses the Router API to publish markdown articles with rich media to any connected Astro site natively.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tody-agent/codymaster532026년 8월 26일 업데이트

Easy-to-use conversational CLI (Codex style) for non-technical users to spawn parallel AI tasks supervised by a visual web dashboard.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tody-agent/codymaster532026년 8월 26일 업데이트

Easy-to-use conversational CLI (Claude Code style) for non-technical users to spawn parallel AI tasks supervised by a visual web dashboard.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tody-agent/codymaster532026년 8월 26일 업데이트

Booking & Calendar CRO Engine — Packages all booking, scheduling, .ics download, and Google Calendar integration into a revenue-boosting system. Auto-detect industry → select matching pattern → generate calendar engine + booking UI + export logic. Integrates with cm-google-form (form → sheet) and cm-ads-tracker (conversion events). ALWAYS trigger for: booking, appointment, calendar, reminder, download ics, google calendar, add to calendar, book appointment, schedule, "create booking", "add scheduling", "appointment reminder system", "calendar CRO", "reduce no-show"

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tody-agent/codymaster532026년 8월 26일 업데이트

Strategic analysis gate for existing products — multi-dimensional evaluation (tech, product, design, business) using Design Thinking + 9 Windows (TRIZ) + Double Diamond. Outputs 2-3 qualified options with recommendations. Use BEFORE cm-planning for complex initiatives and enhancements on existing codebases.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tody-agent/codymaster532026년 8월 26일 업데이트

tody-agent의 스킬 모두 보기

이 스킬의 문제 신고