codymaster 7.0.2 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/README.md +38 -1
- package/dist/agent/codex.js +73 -21
- package/dist/agent-dispatch.js +63 -48
- package/dist/cli/commands/brain.js +18 -0
- package/dist/cli/commands/design-studio.js +1 -1
- package/dist/cm-suggest.js +3 -3
- package/dist/dashboard-project-summary.js +9 -0
- package/dist/dashboard.js +11 -5
- package/dist/execution-analyzer.js +9 -1
- package/dist/judge.js +16 -15
- package/dist/mcp-context-server.js +45 -23
- package/dist/mcp-skills-tools.js +2 -2
- package/dist/skill-chain.js +26 -3
- package/dist/skill-token-report.js +105 -0
- package/dist/sprint-pipeline.js +3 -3
- package/dist/ui/onboarding.js +3 -4
- package/dist/utils/design-taste.js +1 -1
- package/dist/utils/output-compress.js +8 -0
- package/package.json +2 -1
- package/public/dashboard/app.js +40 -13
- package/public/dashboard/index.html +190 -5
- package/public/dashboard/style.css +1 -1
- package/scripts/build-skills.mjs +36 -2
- package/scripts/mcp-bridge.js +41 -24
- package/scripts/pack-plugin.mjs +206 -0
- package/skills/cm-ads-tracker/SKILL.md +401 -0
- package/skills/cm-ads-tracker/evals/evals.json +55 -0
- package/skills/cm-ads-tracker/references/gtm-architecture.md +321 -0
- package/skills/cm-ads-tracker/references/industry-events.md +294 -0
- package/skills/cm-ads-tracker/references/platforms-api.md +238 -0
- package/skills/cm-ads-tracker/templates/capi-payload.md +79 -0
- package/skills/cm-ads-tracker/templates/datalayer-push.js +104 -0
- package/skills/cm-ads-tracker/templates/gtm-variables.js +56 -0
- package/skills/cm-auto-publisher/SKILL.md +81 -0
- package/skills/cm-booking-calendar/SKILL.md +521 -0
- package/skills/cm-booking-calendar/references/industry-patterns.md +527 -0
- package/skills/cm-booking-calendar/templates/booking-form.css +626 -0
- package/skills/cm-booking-calendar/templates/booking-form.html +477 -0
- package/skills/cm-booking-calendar/templates/calendar-engine.js +419 -0
- package/skills/cm-booking-calendar/templates/calendar-export.js +395 -0
- package/skills/cm-booking-calendar/templates/reminder-config.js +629 -0
- package/skills/cm-brainstorm-idea/SKILL.md +5 -5
- package/skills/cm-code-review/SKILL.md +2 -2
- package/skills/cm-codeintell/SKILL.md +47 -580
- package/skills/cm-codeintell/references/integration-workflows.md +23 -0
- package/skills/cm-codeintell/references/layer-0-skeleton.md +54 -0
- package/skills/cm-codeintell/references/layer-1-codegraph.md +58 -0
- package/skills/cm-codeintell/references/layer-2-architecture.md +31 -0
- package/skills/cm-codeintell/references/layer-3-context-builder.md +32 -0
- package/skills/cm-content-factory/.content-factory-state.json +132 -0
- package/skills/cm-content-factory/.git 2/logs/refs/heads/main +1 -0
- package/skills/cm-content-factory/.git 2/logs/refs/remotes/origin/main +1 -0
- package/skills/cm-content-factory/.git 2/objects/02/fb0956734b5f8ba3f918b7defd04a89cfe0076 +0 -0
- package/skills/cm-content-factory/.git 2/objects/08/1e129d75dc6feac6c02037272e6bd1a04e3324 +0 -0
- package/skills/cm-content-factory/.git 2/objects/0c/5393416f3c5e01c9a655a802bff0dd52f76f0a +0 -0
- package/skills/cm-content-factory/.git 2/objects/10/0b9be46978a946a77188f68be725098a122001 +0 -0
- package/skills/cm-content-factory/.git 2/objects/10/cf041167fc9843610eb3d90259ef3396315fdc +0 -0
- package/skills/cm-content-factory/.git 2/objects/12/5e19538dd6e1338ffe74f6c4c165b00435bf48 +0 -0
- package/skills/cm-content-factory/.git 2/objects/16/a9b9d0088d5c1347628b45a2620b479d8ad57c +0 -0
- package/skills/cm-content-factory/.git 2/objects/17/8c2a9ef93c33ae4eec9d58e82321f9229843a1 +0 -0
- package/skills/cm-content-factory/.git 2/objects/25/397ae41d09104d763bdcac2695209d85cdea89 +0 -0
- package/skills/cm-content-factory/.git 2/objects/2f/a836b7947f2d458e1f639788bf4bb0983a3305 +0 -0
- package/skills/cm-content-factory/.git 2/objects/3a/baaaf0a1c0909c0828335791557125fba911e0 +0 -0
- package/skills/cm-content-factory/.git 2/objects/42/2924221b81f5ce3c4e4daac9a64a24f9b01f9a +0 -0
- package/skills/cm-content-factory/.git 2/objects/42/ec0ce707447dc11446a34c9995fb8533801731 +0 -0
- package/skills/cm-content-factory/.git 2/objects/46/e43ce92866d56ce74b1d750db307cfe6154a15 +0 -0
- package/skills/cm-content-factory/.git 2/objects/48/5e41b633c63f55b8277bcc59f44f67681f671a +0 -0
- package/skills/cm-content-factory/.git 2/objects/49/49c596a3a89fa240642acd95dd3258e261eb09 +0 -0
- package/skills/cm-content-factory/.git 2/objects/50/9d42d8412ef8eaf7f7e138476bac2e4d10ce60 +0 -0
- package/skills/cm-content-factory/.git 2/objects/55/0c8c389d981b463ef849aeb792d8be3ccb6ec8 +0 -0
- package/skills/cm-content-factory/.git 2/objects/5d/82d3b18410cdda3ace3677436f0cb599dbe2d2 +0 -0
- package/skills/cm-content-factory/.git 2/objects/60/0617c58e871a38b33bf29e282d132bb3c381ad +0 -0
- package/skills/cm-content-factory/.git 2/objects/6a/8369a99c687b7245c92ffaf0e0f0dab9014504 +0 -0
- package/skills/cm-content-factory/.git 2/objects/79/bea435d40ab531c1aaf6be0432c6a5b7aaed21 +0 -0
- package/skills/cm-content-factory/.git 2/objects/7e/5ebd79251c2f14e4aceb86c74b6b6daae6b500 +0 -0
- package/skills/cm-content-factory/.git 2/objects/81/98a822a60178d6d5023ddb3e222cddf048742e +0 -0
- package/skills/cm-content-factory/.git 2/objects/86/0a0e1943dfe53411d2e499a1f16f46a96ef758 +0 -0
- package/skills/cm-content-factory/.git 2/objects/86/971fb55fdc081fdbae52376f0f13e57a4e9b04 +0 -0
- package/skills/cm-content-factory/.git 2/objects/88/b89dd609a0a03f8d4fe8bfde20d5b8fc1d326d +0 -0
- package/skills/cm-content-factory/.git 2/objects/90/8737edb6b7809e32cc01590b4e08ba42a9d40d +0 -0
- package/skills/cm-content-factory/.git 2/objects/93/d5a8a9a7d4fb7f11491cb596a6880528725118 +0 -0
- package/skills/cm-content-factory/.git 2/objects/98/46a2ab81d0c3b3eb00ef88fc56989aa7e9f316 +0 -0
- package/skills/cm-content-factory/.git 2/objects/9b/d8dd1e49cf274eaf9c555f3ab39dce7af5715e +0 -0
- package/skills/cm-content-factory/.git 2/objects/a1/13329fb0cec96ae78b222d33a24c3b5bc7fa1f +0 -0
- package/skills/cm-content-factory/.git 2/objects/a9/e6effe626e8a3aea3a8fc3364b492191c6e7d0 +0 -0
- package/skills/cm-content-factory/.git 2/objects/ad/6de7e48d9782cca9353d1ff0aa1aab7fe1df85 +0 -0
- package/skills/cm-content-factory/.git 2/objects/af/54ae316f771ff692e299ffcd8bf2f06b413b59 +0 -0
- package/skills/cm-content-factory/.git 2/objects/b0/4cb8b0b00dad633e731c1472161419e738d674 +0 -0
- package/skills/cm-content-factory/.git 2/objects/b3/094abb0b9ed46419b269e4a4e36a459690e3b0 +0 -0
- package/skills/cm-content-factory/.git 2/objects/b9/435c5d4baac2cfc5c83009ddd27b46b60db5f1 +0 -0
- package/skills/cm-content-factory/.git 2/objects/ba/5da17dbaec5ec2dcfdfd126aead518d1171d5c +0 -0
- package/skills/cm-content-factory/.git 2/objects/c0/bf58703aa258ba5dd63083bebaec8f223d844c +0 -0
- package/skills/cm-content-factory/.git 2/objects/c4/701a34edf1fc1bad58ccc57bd03f9426acb59a +0 -0
- package/skills/cm-content-factory/.git 2/objects/c7/5ccce9a4e5cc74d9b3174550cf6d993ca43638 +0 -0
- package/skills/cm-content-factory/.git 2/objects/c7/710d59b5a35b0f1f0a0399386643a0bd94c929 +0 -0
- package/skills/cm-content-factory/.git 2/objects/d1/fe58237112e953e5fec52da22cf38e08be3df9 +5 -0
- package/skills/cm-content-factory/.git 2/objects/d2/2bbe9fd2f74c95bc5583e803f5e435f1e2cd86 +0 -0
- package/skills/cm-content-factory/.git 2/objects/d7/e72852ea2bff74581dbf247d400120086229f4 +0 -0
- package/skills/cm-content-factory/.git 2/objects/d8/d4c3b5553e4fd72807e1d4b49ef07d9ef3ac35 +0 -0
- package/skills/cm-content-factory/.git 2/objects/dc/75050c2876f6a02ae2a53a3c886f395b622977 +0 -0
- package/skills/cm-content-factory/.git 2/objects/ee/e8546f95acec500187c08a28a8b9ee02db0dec +0 -0
- package/skills/cm-content-factory/.git 2/objects/ef/263c059208b416c2146434f10cb2b9fabcba16 +0 -0
- package/skills/cm-content-factory/.git 2/objects/f3/ae597e84d9a59b88acd21c99bde2eaf686d785 +0 -0
- package/skills/cm-content-factory/.git 2/objects/f3/f6f5673c821d3d8e76fa267a9e882e7a5387ea +0 -0
- package/skills/cm-content-factory/.git 2/objects/f9/6e6d0ad02624dd11d5848594d056caef7a5e8b +0 -0
- package/skills/cm-content-factory/.git 2/objects/ff/278988fc1edf0db3abcf18de795f4cc0b4f3e1 +0 -0
- package/skills/cm-content-factory/.git 2/refs/heads/main +1 -0
- package/skills/cm-content-factory/.git 2/refs/remotes/origin/main +1 -0
- package/skills/cm-content-factory/.pytest_cache 2/v/cache/nodeids +76 -0
- package/skills/cm-content-factory/.pytest_cache 2/v/cache/stepwise +1 -0
- package/skills/cm-content-factory/AGENTS.md +61 -0
- package/skills/cm-content-factory/CLAUDE.md +63 -0
- package/skills/cm-content-factory/CURSOR.md +43 -0
- package/skills/cm-content-factory/Content Factory.zip +0 -0
- package/skills/cm-content-factory/SKILL.md +416 -0
- package/skills/cm-content-factory/cf +313 -0
- package/skills/cm-content-factory/config.schema.json +397 -0
- package/skills/cm-content-factory/dashboard/app.js +556 -0
- package/skills/cm-content-factory/dashboard/index.html +397 -0
- package/skills/cm-content-factory/dashboard/style.css +1211 -0
- package/skills/cm-content-factory/examples/01-real-estate.config.json +146 -0
- package/skills/cm-content-factory/examples/02-personal-finance.config.json +146 -0
- package/skills/cm-content-factory/examples/03-health-wellness.config.json +147 -0
- package/skills/cm-content-factory/examples/04-saas-software.config.json +147 -0
- package/skills/cm-content-factory/examples/05-legal-services.config.json +147 -0
- package/skills/cm-content-factory/examples/06-insurance.config.json +146 -0
- package/skills/cm-content-factory/examples/07-ecommerce-dropship.config.json +146 -0
- package/skills/cm-content-factory/examples/08-online-education.config.json +147 -0
- package/skills/cm-content-factory/examples/09-crypto-defi.config.json +147 -0
- package/skills/cm-content-factory/examples/10-beauty-skincare.config.json +147 -0
- package/skills/cm-content-factory/examples/11-home-services.config.json +146 -0
- package/skills/cm-content-factory/examples/12-dental-clinic.config.json +147 -0
- package/skills/cm-content-factory/examples/13-pet-care.config.json +147 -0
- package/skills/cm-content-factory/examples/14-travel-hospitality.config.json +147 -0
- package/skills/cm-content-factory/examples/15-ai-automation.config.json +147 -0
- package/skills/cm-content-factory/examples/16-wedding-events.config.json +147 -0
- package/skills/cm-content-factory/examples/17-fitness-coaching.config.json +148 -0
- package/skills/cm-content-factory/examples/18-cybersecurity.config.json +147 -0
- package/skills/cm-content-factory/examples/19-food-restaurant.config.json +148 -0
- package/skills/cm-content-factory/examples/20-solar-energy.config.json +147 -0
- package/skills/cm-content-factory/examples/fitness-blog.config.json +116 -0
- package/skills/cm-content-factory/examples/tech-blog.config.json +107 -0
- package/skills/cm-content-factory/extensions/EXTENSION_GUIDE.md +72 -0
- package/skills/cm-content-factory/extensions/hooks.py +126 -0
- package/skills/cm-content-factory/extensions/openclaw_adapter.py +132 -0
- package/skills/cm-content-factory/landing/docs/content/changelog.md +36 -0
- package/skills/cm-content-factory/landing/docs/content/deployment.md +46 -0
- package/skills/cm-content-factory/landing/docs/content/execution-flow.md +67 -0
- package/skills/cm-content-factory/landing/docs/content/openspace.md +27 -0
- package/skills/cm-content-factory/landing/docs/content/openviking.md +33 -0
- package/skills/cm-content-factory/landing/docs/content/use-cases.md +26 -0
- package/skills/cm-content-factory/landing/docs/content/v5-intro.md +28 -0
- package/skills/cm-content-factory/landing/docs/index.html +240 -0
- package/skills/cm-content-factory/landing/index.html +680 -0
- package/skills/cm-content-factory/landing/script.js +143 -0
- package/skills/cm-content-factory/landing/style.css +1216 -0
- package/skills/cm-content-factory/landing/translations.js +508 -0
- package/skills/cm-content-factory/logs/events.jsonl +11 -0
- package/skills/cm-content-factory/profiles/_template.profile.json +231 -0
- package/skills/cm-content-factory/profiles/finance.profile.json +278 -0
- package/skills/cm-content-factory/profiles/legal.profile.json +263 -0
- package/skills/cm-content-factory/profiles/medical-research.profile.json +321 -0
- package/skills/cm-content-factory/profiles/technology.profile.json +275 -0
- package/skills/cm-content-factory/scripts/agent_dispatcher.py +266 -0
- package/skills/cm-content-factory/scripts/audit.py +106 -0
- package/skills/cm-content-factory/scripts/dashboard_server.py +225 -0
- package/skills/cm-content-factory/scripts/deploy.py +146 -0
- package/skills/cm-content-factory/scripts/extract.py +132 -0
- package/skills/cm-content-factory/scripts/landing_generator.py +459 -0
- package/skills/cm-content-factory/scripts/memory.py +521 -0
- package/skills/cm-content-factory/scripts/monetize.py +239 -0
- package/skills/cm-content-factory/scripts/pipeline.py +357 -0
- package/skills/cm-content-factory/scripts/plan.py +163 -0
- package/skills/cm-content-factory/scripts/publish.py +145 -0
- package/skills/cm-content-factory/scripts/research.py +337 -0
- package/skills/cm-content-factory/scripts/scaffold.py +464 -0
- package/skills/cm-content-factory/scripts/scoreboard.py +336 -0
- package/skills/cm-content-factory/scripts/seo.py +90 -0
- package/skills/cm-content-factory/scripts/state_manager.py +320 -0
- package/skills/cm-content-factory/scripts/token_manager.py +268 -0
- package/skills/cm-content-factory/scripts/validate.py +221 -0
- package/skills/cm-content-factory/scripts/wizard.py +329 -0
- package/skills/cm-content-factory/scripts/write.py +93 -0
- package/skills/cm-content-factory/sites/docs-site/src/assets/houston.webp +0 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/architecture.md +90 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/data-flow.md +54 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/deployment.md +38 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/flows/index.md +65 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/flows/lc-content-lifecycle.md +48 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/flows/seq-write-mode.md +39 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/flows/uj-first-batch.md +42 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/flows/wf-content-pipeline.md +51 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/flows/wf-learning-cycle.md +52 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/getting-started/configuration.md +86 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/getting-started/installation.md +80 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/getting-started/intro.md +58 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/index.md +102 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/jtbd/index.md +45 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/jtbd/optimize-seo.md +29 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/jtbd/scale-content-production.md +55 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/jtbd/standardize-quality.md +29 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/personas/buyer-cmo-huong.md +41 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/personas/buyer-content-lead-khoa.md +40 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/personas/index.md +56 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/personas/user-content-manager-lan.md +46 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/personas/user-seo-minh.md +45 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/personas/user-writer-tu.md +45 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/sop/content-pipeline.md +108 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/sop/index.md +22 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/sop/memory-system.md +52 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/sop/seo-optimization.md +58 -0
- package/skills/cm-content-factory/sites/docs-site/src/content/docs/sop/troubleshooting-guide.md +92 -0
- package/skills/cm-content-factory/sites/docs-site/src/styles/custom.css +575 -0
- package/skills/cm-content-factory/tests/conftest.py +66 -0
- package/skills/cm-content-factory/tests/test_agent_dispatcher.py +125 -0
- package/skills/cm-content-factory/tests/test_memory.py +128 -0
- package/skills/cm-content-factory/tests/test_pipeline.py +107 -0
- package/skills/cm-content-factory/tests/test_research.py +56 -0
- package/skills/cm-content-factory/tests/test_state_manager.py +131 -0
- package/skills/cm-content-factory/tests/test_token_manager.py +110 -0
- package/skills/cm-content-factory/tests/test_wizard.py +121 -0
- package/skills/cm-continuity/SKILL.md +49 -480
- package/skills/cm-continuity/references/cm-uri-scheme.md +23 -0
- package/skills/cm-continuity/references/continuity-template.md +48 -0
- package/skills/cm-continuity/references/mcp-context-server.md +27 -0
- package/skills/cm-continuity/references/memory-architecture.md +26 -0
- package/skills/cm-continuity/references/memory-audit.md +18 -0
- package/skills/cm-continuity/references/session-protocol.md +31 -0
- package/skills/cm-continuity/references/storage-formats.md +20 -0
- package/skills/cm-cro-methodology/SKILL.md +290 -0
- package/skills/cm-cro-methodology/references/COPYWRITING.md +178 -0
- package/skills/cm-cro-methodology/references/OBJECTIONS.md +135 -0
- package/skills/cm-cro-methodology/references/PERSUASION.md +158 -0
- package/skills/cm-cro-methodology/references/RESEARCH.md +220 -0
- package/skills/cm-cro-methodology/references/funnel-analysis.md +365 -0
- package/skills/cm-cro-methodology/references/testing-methodology.md +330 -0
- package/skills/cm-design-system/SKILL.md +5 -6
- package/skills/cm-execution/SKILL.md +61 -379
- package/skills/cm-execution/references/mode-a-batch.md +28 -0
- package/skills/cm-execution/references/mode-b-subagent.md +46 -0
- package/skills/cm-execution/references/mode-c-parallel.md +39 -0
- package/skills/cm-execution/references/mode-d-rarv.md +62 -0
- package/skills/cm-execution/references/mode-e-triz-parallel.md +53 -0
- package/skills/cm-execution/references/mode-f-party.md +61 -0
- package/skills/cm-execution/references/persona-dispatch.md +22 -0
- package/skills/cm-execution/references/security-rules.md +47 -0
- package/skills/cm-google-form/SKILL.md +266 -0
- package/skills/cm-google-form/templates/apps-script.js +55 -0
- package/skills/cm-google-form/templates/form-markup.html +110 -0
- package/skills/cm-google-form/templates/form-submit.js +201 -0
- package/skills/cm-google-form/templates/toast.css +152 -0
- package/skills/cm-growth-hacking/SKILL.md +282 -0
- package/skills/cm-growth-hacking/bottom-sheet-engine.md +261 -0
- package/skills/cm-growth-hacking/calendar-integration.md +264 -0
- package/skills/cm-growth-hacking/references/engagement-patterns.md +346 -0
- package/skills/cm-growth-hacking/templates/bottom-sheet.css +528 -0
- package/skills/cm-growth-hacking/templates/bottom-sheet.js +269 -0
- package/skills/cm-growth-hacking/templates/calendar-cta.js +213 -0
- package/skills/cm-growth-hacking/templates/tracking-events.js +211 -0
- package/skills/cm-growth-hacking/templates/trigger-manager.js +254 -0
- package/skills/cm-growth-hacking/tracking-events.md +246 -0
- package/skills/cm-growth-hacking/trigger-system.md +342 -0
- package/skills/cm-how-it-work/SKILL.md +8 -9
- package/skills/cm-identity-guard/SKILL.md +4 -4
- package/skills/cm-jtbd/SKILL.md +98 -0
- package/skills/cm-notebooklm/SKILL.md +156 -0
- package/skills/cm-notebooklm/references/command_reference.md +94 -0
- package/skills/cm-notebooklm/references/workflows.md +60 -0
- package/skills/cm-notebooklm/resources/knowledge_sources.md +106 -0
- package/skills/cm-notebooklm/scripts/brain-sync.sh +453 -0
- package/skills/cm-notebooklm/scripts/graduate_wisdom.py +101 -0
- package/skills/cm-planning/SKILL.md +3 -3
- package/skills/cm-project-bootstrap/SKILL.md +2 -2
- package/skills/cm-quality-gate/SKILL.md +1 -1
- package/skills/cm-readit/SKILL.md +289 -0
- package/skills/cm-readit/audio-player.md +206 -0
- package/skills/cm-readit/examples/blog-reader.js +352 -0
- package/skills/cm-readit/examples/voice-cro.js +390 -0
- package/skills/cm-readit/tts-engine.md +262 -0
- package/skills/cm-readit/ui-patterns.md +362 -0
- package/skills/cm-readit/voice-cro.md +223 -0
- package/skills/cm-safe-deploy/SKILL.md +80 -510
- package/skills/cm-safe-deploy/references/gate-0-5-security-scan.md +31 -0
- package/skills/cm-safe-deploy/references/gate-0-secret-hygiene.md +68 -0
- package/skills/cm-safe-deploy/references/gate-1-syntax.md +23 -0
- package/skills/cm-safe-deploy/references/gate-2-test-suite.md +28 -0
- package/skills/cm-safe-deploy/references/gate-3-i18n.md +19 -0
- package/skills/cm-safe-deploy/references/gate-4-5-build-dist.md +16 -0
- package/skills/cm-safe-deploy/references/gate-6-deploy-smoke.md +18 -0
- package/skills/cm-safe-deploy/references/rollback.md +17 -0
- package/skills/cm-safe-deploy/references/setup-new-project.md +20 -0
- package/skills/cm-skill-index/SKILL.md +15 -15
- package/skills/cm-start/SKILL.md +1 -1
- package/skills/cm-tdd/SKILL.md +51 -356
- package/skills/cm-tdd/references/bugfix-example.md +15 -0
- package/skills/cm-tdd/references/rationalizations.md +20 -0
- package/skills/cm-tdd/references/red-green-refactor.md +33 -0
- package/skills/cm-tdd/references/stuck-debugging.md +18 -0
- package/skills/cm-tdd/references/test-quality.md +19 -0
- package/skills/cm-ux-master/SKILL.md +368 -115
- package/skills/profiles/core.txt +1 -4
- package/skills/profiles/design.txt +1 -2
- package/skills/profiles/full.txt +10 -16
- package/skills/profiles/growth.txt +9 -9
- package/skills/profiles/top35.json +13 -13
- package/skills/cm-conductor-worktrees/SKILL.archive.md +0 -28
- package/skills/cm-conductor-worktrees/SKILL.md +0 -26
- package/skills/cm-dashboard/SKILL.archive.md +0 -15
- package/skills/cm-dashboard/SKILL.md +0 -26
- package/skills/cm-dashboard/ui/app.js +0 -1278
- package/skills/cm-dashboard/ui/index.html +0 -206
- package/skills/cm-dashboard/ui/style.css +0 -440
- package/skills/cm-design-studio/SKILL.archive.md +0 -34
- package/skills/cm-design-studio/SKILL.md +0 -26
- package/skills/cm-engineering-meta/SKILL.archive.md +0 -73
- package/skills/cm-engineering-meta/SKILL.md +0 -26
- package/skills/cm-git-worktrees/SKILL.archive.md +0 -157
- package/skills/cm-git-worktrees/SKILL.md +0 -26
- package/skills/cm-post-deploy-canary/SKILL.archive.md +0 -22
- package/skills/cm-post-deploy-canary/SKILL.md +0 -26
- package/skills/cm-qa-visual-cli/SKILL.archive.md +0 -22
- package/skills/cm-qa-visual-cli/SKILL.md +0 -26
- package/skills/cm-second-opinion-cli/SKILL.archive.md +0 -23
- package/skills/cm-second-opinion-cli/SKILL.md +0 -26
- package/skills/cm-secret-shield/SKILL.archive.md +0 -580
- package/skills/cm-secret-shield/SKILL.md +0 -26
- package/skills/cm-security-gate/SKILL.archive.md +0 -239
- package/skills/cm-security-gate/SKILL.md +0 -26
- package/skills/cm-skill-health/SKILL.archive.md +0 -83
- package/skills/cm-skill-health/SKILL.md +0 -26
- package/skills/cm-skill-mastery/SKILL.archive.md +0 -156
- package/skills/cm-skill-mastery/SKILL.md +0 -26
- package/skills/cm-skill-search/SKILL.archive.md +0 -49
- package/skills/cm-skill-search/SKILL.md +0 -26
- package/skills/cm-skill-share/SKILL.archive.md +0 -58
- package/skills/cm-skill-share/SKILL.md +0 -26
- package/skills/cm-test-gate/SKILL.archive.md +0 -245
- package/skills/cm-test-gate/SKILL.md +0 -26
- package/skills/cm-ui-preview/SKILL.archive.md +0 -153
- package/skills/cm-ui-preview/SKILL.md +0 -26
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Mode D — Autonomous RARV
|
|
2
|
+
|
|
3
|
+
> Use when: `/cm-start` creates a goal plus a `cm-tasks.json` backlog and you want continuous autonomous execution.
|
|
4
|
+
|
|
5
|
+
## RARV Cycle
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
LOOP until backlog empty or user interrupts:
|
|
9
|
+
|
|
10
|
+
1. REASON Read cm-tasks.json → pick highest-priority backlog task
|
|
11
|
+
Update status → "in_progress"
|
|
12
|
+
Log: { phase: "REASON", message: "Selected: <title>" }
|
|
13
|
+
|
|
14
|
+
2. ACT Execute using the task's assigned CM skill
|
|
15
|
+
(cm-tdd, cm-debugging, cm-safe-deploy, etc.)
|
|
16
|
+
Log: { phase: "ACT", message: "<what was done>" }
|
|
17
|
+
|
|
18
|
+
3. REFLECT Update cm-tasks.json with results
|
|
19
|
+
Log: { phase: "REFLECT", message: "<outcome>" }
|
|
20
|
+
|
|
21
|
+
4. VERIFY Run cm-quality-gate
|
|
22
|
+
PASS → status = "done", completed_at = now()
|
|
23
|
+
FAIL → rarv_cycles++ → retry from REASON
|
|
24
|
+
rarv_cycles >= 2 → Skill Discovery Fallback:
|
|
25
|
+
npx skills find "{task keywords}"
|
|
26
|
+
Found + user approves → install, reset cycles = 0, retry
|
|
27
|
+
Not found OR cycles >= 3 → status = "blocked"
|
|
28
|
+
Log: { phase: "VERIFY", message: "✓ passed" | "✗ <error>" }
|
|
29
|
+
|
|
30
|
+
5. NEXT Recalculate stats → pick next task
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## `cm-tasks.json` Update Protocol
|
|
34
|
+
After EVERY phase:
|
|
35
|
+
1. Read current `cm-tasks.json`.
|
|
36
|
+
2. Sync state from `openspec/changes/[initiative-name]/tasks.md`.
|
|
37
|
+
3. Find the active task by `id`.
|
|
38
|
+
4. Update `status`, append to `logs[]`, and set timestamps.
|
|
39
|
+
5. Recalculate `stats`:
|
|
40
|
+
```js
|
|
41
|
+
stats.total = tasks.length
|
|
42
|
+
stats.done = tasks.filter(t => t.status === 'done').length
|
|
43
|
+
stats.in_progress = tasks.filter(t => t.status === 'in_progress').length
|
|
44
|
+
stats.blocked = tasks.filter(t => t.status === 'blocked').length
|
|
45
|
+
stats.backlog = tasks.filter(t => t.status === 'backlog').length
|
|
46
|
+
stats.rarv_cycles_total = tasks.reduce((sum, t) => sum + (t.rarv_cycles || 0), 0)
|
|
47
|
+
```
|
|
48
|
+
6. Set `updated` to the current ISO timestamp.
|
|
49
|
+
7. Write back to `cm-tasks.json`.
|
|
50
|
+
|
|
51
|
+
## Rules
|
|
52
|
+
- Max 3 retries per task before marking `blocked`.
|
|
53
|
+
- Always log — the dashboard reads logs in real time.
|
|
54
|
+
- Do not batch-skip — execute one task at a time through full RARV.
|
|
55
|
+
- Respect interrupts — if the user sends a message, pause and respond.
|
|
56
|
+
|
|
57
|
+
## Common Mistakes
|
|
58
|
+
| Mistake | Fix |
|
|
59
|
+
|---|---|
|
|
60
|
+
| Skipping VERIFY when it obviously works | VERIFY is non-negotiable |
|
|
61
|
+
| Marking blocked after 1 fail | Try skill discovery first |
|
|
62
|
+
| Not updating stats after each phase | Dashboard will lie |
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Mode E — TRIZ-Parallel ★
|
|
2
|
+
|
|
3
|
+
> Use when: 3+ tasks can run in parallel, speed matters, and quality cannot be sacrificed.
|
|
4
|
+
|
|
5
|
+
## TRIZ Principles Applied
|
|
6
|
+
|
|
7
|
+
| # | Principle | How |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| 1 | Segmentation | Split by file dependency graph — only truly independent tasks run together |
|
|
10
|
+
| 3 | Local Quality | Each agent runs its own mini quality gate before reporting |
|
|
11
|
+
| 10 | Prior Action | Pre-flight checks file overlaps before dispatch |
|
|
12
|
+
| 15 | Dynamicity | Batch size adapts based on clean runs vs conflicts |
|
|
13
|
+
| 18 | Feedback | Conflict detection uses a shared ledger of modified files |
|
|
14
|
+
| 40 | Composite | Each agent acts as implementer + tester + reviewer |
|
|
15
|
+
|
|
16
|
+
## Process
|
|
17
|
+
```
|
|
18
|
+
1. ANALYZE Extract file dependencies from task descriptions
|
|
19
|
+
2. GRAPH Build dependency graph → group into independent batches
|
|
20
|
+
3. ADAPT Read parallel history → compute optimal batch size
|
|
21
|
+
4. PRE-FLIGHT Check conflict ledger for overlaps with running agents
|
|
22
|
+
5. DISPATCH Send batch with quality contracts
|
|
23
|
+
6. MONITOR Each agent reports modified files → detect conflicts
|
|
24
|
+
7. VERIFY Each agent runs mini quality gate before reporting done
|
|
25
|
+
8. RECORD Update parallel history for future batch sizing
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quality Contract (per agent)
|
|
29
|
+
```markdown
|
|
30
|
+
You will:
|
|
31
|
+
- Modify ONLY these files: [list]
|
|
32
|
+
- Run tests for your scope before reporting done
|
|
33
|
+
- Report: { files_modified: [...], tests_passed: bool, summary: "..." }
|
|
34
|
+
- HALT and report if you need to touch a file outside your scope
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Persona
|
|
38
|
+
Read `references/persona-dispatch.md`. Typical default is engineer plus self-review responsibility.
|
|
39
|
+
|
|
40
|
+
## Rules
|
|
41
|
+
- Never dispatch conflicting tasks — pre-flight must pass.
|
|
42
|
+
- Each agent must self-validate.
|
|
43
|
+
- Adaptive sizing is mandatory.
|
|
44
|
+
- File scope is enforced.
|
|
45
|
+
- Conflict means halt until resolved.
|
|
46
|
+
|
|
47
|
+
## Common Mistakes
|
|
48
|
+
| Mistake | Fix |
|
|
49
|
+
|---|---|
|
|
50
|
+
| Assuming all tasks are independent | Always run dependency analysis |
|
|
51
|
+
| Skipping pre-flight to save time | Pre-flight prevents wasted work |
|
|
52
|
+
| Hardcoding batch size 5 | Start at 2 and let the system adapt |
|
|
53
|
+
| Continuing after first failure | Fix before the next batch |
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Mode F — Party (Persona Rotation, single agent)
|
|
2
|
+
|
|
3
|
+
> One agent, three voices. Cheaper than Mode B, deeper than Mode A.
|
|
4
|
+
|
|
5
|
+
## When
|
|
6
|
+
- Task is non-trivial but small enough for one session.
|
|
7
|
+
- You want multi-perspective scrutiny without paying for multiple subagents.
|
|
8
|
+
- Quality matters more than raw speed.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
```
|
|
12
|
+
1. ARCHITECT Load agents/architect.md as voice → propose design / approach
|
|
13
|
+
Append round to .cm/handoff/party.json
|
|
14
|
+
2. ENGINEER Load agents/engineer.md as voice → implement against the design
|
|
15
|
+
Append round
|
|
16
|
+
3. REVIEWER Load agents/reviewer.md as voice → critique implementation
|
|
17
|
+
verdict: "pass" | "revise" | "block"
|
|
18
|
+
Append round
|
|
19
|
+
4. (optional) SECURITY → load when task touches auth/files/subprocess
|
|
20
|
+
Also load references/security-rules.md
|
|
21
|
+
Append round
|
|
22
|
+
5. SYNTHESIZE Write final summary and set handoff.emitted_at
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Stop Conditions
|
|
26
|
+
- Reviewer verdict `pass` → done.
|
|
27
|
+
- Reviewer verdict `revise` → loop back to ENGINEER, max 2 revisions.
|
|
28
|
+
- Reviewer verdict `block` or 3rd revision → escalate to user, do not ship.
|
|
29
|
+
|
|
30
|
+
## Output Contract — `.cm/handoff/party.json`
|
|
31
|
+
Must match `PartyHandoff` from `src/handoff/contracts.ts`.
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"schema": "party@1",
|
|
36
|
+
"emitted_at": "<ISO>",
|
|
37
|
+
"emitted_by": "cm-execution",
|
|
38
|
+
"data": {
|
|
39
|
+
"topic": "<task title>",
|
|
40
|
+
"rounds": [
|
|
41
|
+
{ "persona": "architect", "output": "...", "ts": "<ISO>" },
|
|
42
|
+
{ "persona": "engineer", "output": "...", "ts": "<ISO>" },
|
|
43
|
+
{ "persona": "reviewer", "output": "...", "verdict": "pass", "ts": "<ISO>" }
|
|
44
|
+
],
|
|
45
|
+
"final": "<one-paragraph synthesis>"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Rules
|
|
51
|
+
- Never skip the reviewer round.
|
|
52
|
+
- Never edit a previous round — append only.
|
|
53
|
+
- One agent the whole way — do not dispatch subagents inside party mode.
|
|
54
|
+
- Persona files are the source of truth — load them, do not paraphrase them.
|
|
55
|
+
|
|
56
|
+
## Common Mistakes
|
|
57
|
+
| Mistake | Fix |
|
|
58
|
+
|---|---|
|
|
59
|
+
| Architect and engineer in the same voice | Reload persona between rounds |
|
|
60
|
+
| Skipping security on auth/file-touching tasks | Security round is mandatory |
|
|
61
|
+
| Reviewer revising more than 2 times | Escalate — that is a planning problem |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Persona Dispatch
|
|
2
|
+
|
|
3
|
+
> Used by Mode B, Mode E, and Mode F.
|
|
4
|
+
|
|
5
|
+
Pick persona by task signal:
|
|
6
|
+
|
|
7
|
+
| Task signal | Persona | File |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| design, architecture, trade-off | architect | `agents/architect.md` |
|
|
10
|
+
| implement, fix, refactor | engineer | `agents/engineer.md` |
|
|
11
|
+
| review, audit, verify | reviewer | `agents/reviewer.md` |
|
|
12
|
+
| secret, auth, input validation, deploy | security | `agents/security.md` |
|
|
13
|
+
| scope, intent, user story | pm | `agents/pm.md` |
|
|
14
|
+
|
|
15
|
+
## How to pass persona
|
|
16
|
+
- For subagents: use the platform's persona/subagent type when available.
|
|
17
|
+
- Otherwise: load the persona file as the system prompt for the inner call.
|
|
18
|
+
|
|
19
|
+
## Multi-persona tasks
|
|
20
|
+
Some tasks need two voices:
|
|
21
|
+
- In Mode F: run them as sequential rounds.
|
|
22
|
+
- In Mode B/E: chain them, usually architect first and security reviewer second.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Security Rules (Learned: March 2026)
|
|
2
|
+
|
|
3
|
+
> Code that touches files, subprocesses, or the DOM MUST follow these rules. No exceptions.
|
|
4
|
+
|
|
5
|
+
Load this reference when the task involves auth, files, subprocesses, user input, DOM rendering, config paths, or deploy.
|
|
6
|
+
|
|
7
|
+
## Frontend — DOM Safety
|
|
8
|
+
|
|
9
|
+
| Pattern | Risk | Fix |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| `innerHTML = \`...${data}...\`` | DOM XSS | `innerHTML = \`...${esc(data)}...\`` |
|
|
12
|
+
| `innerHTML = variable` | DOM XSS | `textContent = variable` |
|
|
13
|
+
| `eval(input)` / `new Function(input)` | Code injection | Avoid entirely |
|
|
14
|
+
| `document.write(data)` | DOM XSS | Use DOM API |
|
|
15
|
+
| `el.setAttribute('on*', data)` | Event injection | `el.addEventListener()` |
|
|
16
|
+
|
|
17
|
+
Always escape before `innerHTML`, prefer `textContent`, and validate URLs via allowlist.
|
|
18
|
+
|
|
19
|
+
## Backend — Python
|
|
20
|
+
|
|
21
|
+
| Pattern | Risk | Fix |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `Path(user_input) / "file"` | Path Traversal | `safe_resolve(base, user_input)` |
|
|
24
|
+
| `subprocess.run(f"cmd {arg}", shell=True)` | Command Injection | `subprocess.run(["cmd", arg])` |
|
|
25
|
+
| `open(config["path"])` | Path Traversal | `safe_open(base, config["path"])` |
|
|
26
|
+
| `json.load()` paths unvalidated | Path Traversal | Validate all paths from config via `safe_resolve()` |
|
|
27
|
+
|
|
28
|
+
Always validate every path from CLI, config, or API against a base directory.
|
|
29
|
+
|
|
30
|
+
## Backend — Express / Node
|
|
31
|
+
|
|
32
|
+
| Pattern | Risk | Fix |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| Missing `app.disable('x-powered-by')` | Info leak | Add after `express()` |
|
|
35
|
+
| No body size limit | DoS | `express.json({ limit: '1mb' })` |
|
|
36
|
+
| `path.resolve(userInput)` without validation | Path Traversal | Check null bytes + ensure path stays under base dir |
|
|
37
|
+
| `Object.assign(config, userInput)` | Prototype Pollution | Filter `__proto__` and `constructor` keys |
|
|
38
|
+
|
|
39
|
+
## Mandatory Checklist
|
|
40
|
+
- [ ] All user input flowing into FS / subprocess / DOM has been listed
|
|
41
|
+
- [ ] Each entry has explicit validation or escaping
|
|
42
|
+
- [ ] No `shell=True`, `eval`, or unsafe `innerHTML` interpolation remains
|
|
43
|
+
- [ ] Path inputs are validated against a base directory
|
|
44
|
+
- [ ] Test added that proves validation works on a malicious payload
|
|
45
|
+
|
|
46
|
+
## Escalation
|
|
47
|
+
If you cannot make the code safe within task scope, do not ship. Mark the task `blocked` with reason `security-gap` and dispatch the repo's security review flow.
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cm-google-form
|
|
3
|
+
description: Google App Script form-to-sheet integration with auto-retry, toast notifications, and Zalo/contact fallback. Reusable across any static website.
|
|
4
|
+
allowed-tools: Read, Write, Edit, Glob, Grep, Browser
|
|
5
|
+
version: 1.0
|
|
6
|
+
priority: HIGH
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Google Forms → Sheet Integration Skill
|
|
10
|
+
|
|
11
|
+
> **Connect HTML forms → Google Sheets via Google Apps Script.**
|
|
12
|
+
> Auto-retry, toast UI, contact fallback on errors. Zero dependencies, works on any static site.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 🎯 When to Use
|
|
17
|
+
|
|
18
|
+
| Trigger | Action |
|
|
19
|
+
|---------|--------|
|
|
20
|
+
| User says "create form", "connect Google Sheet" | Activate this skill |
|
|
21
|
+
| User says "form broken", "submit not working" | Debug using Phase 4-5 |
|
|
22
|
+
| User says "add new form to page" | Start from Phase 2 |
|
|
23
|
+
| User says "form for another website" | Start from Phase 1 |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 📋 5-Phase Workflow
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
Phase 1: DISCOVER → Scan forms, identify fields, determine sheet structure
|
|
31
|
+
Phase 2: PLAN → Design sheet columns, map form fields, create deployment plan
|
|
32
|
+
Phase 3: BUILD → Generate Apps Script + Frontend JS + Toast CSS
|
|
33
|
+
Phase 4: INTEGRATE → Wire forms to JS, add CSS, deploy Apps Script
|
|
34
|
+
Phase 5: VERIFY → Test submit, test retry, test error fallback
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
> 🔴 **Rule:** NEVER skip Phase 1. Always read existing forms first.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Phase 1: DISCOVER (Scan & Analyze)
|
|
42
|
+
|
|
43
|
+
**Goal:** Understand what forms exist and what fields they have.
|
|
44
|
+
|
|
45
|
+
### Actions:
|
|
46
|
+
|
|
47
|
+
1. **Search for forms** in the project:
|
|
48
|
+
```
|
|
49
|
+
grep -r "data-form-type\|onsubmit\|<form" --include="*.html" .
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
2. **For each form found, extract:**
|
|
53
|
+
|
|
54
|
+
| Info | How to Find |
|
|
55
|
+
|------|-------------|
|
|
56
|
+
| Form type | `data-form-type` attribute |
|
|
57
|
+
| Fields | `<input name="...">`, `<select name="...">` |
|
|
58
|
+
| Submit handler | `onsubmit` attribute |
|
|
59
|
+
| Page URL | File path |
|
|
60
|
+
|
|
61
|
+
3. **Ask user** (Socratic Gate):
|
|
62
|
+
- How many separate Google Sheets? (1 shared sheet or separate?)
|
|
63
|
+
- What columns does each sheet need?
|
|
64
|
+
- Is there a fallback contact channel? (WhatsApp, Messenger, Hotline?)
|
|
65
|
+
- Fallback contact URL (e.g., `https://wa.me/15551234567`)
|
|
66
|
+
|
|
67
|
+
### Output: Form Inventory Table
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
| # | Form Type | Pages | Fields | Target Sheet |
|
|
71
|
+
|---|-----------|-------|--------|-------------|
|
|
72
|
+
| 1 | massage | 7 | name, phone, branch, problem, time, package | Sheet Massage |
|
|
73
|
+
| 2 | course | 1 | name, phone, goal | Course Sheet |
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Phase 2: PLAN (Design & Map)
|
|
79
|
+
|
|
80
|
+
**Goal:** Map form fields → Sheet columns → Apps Script params.
|
|
81
|
+
|
|
82
|
+
### Sheet Column Design
|
|
83
|
+
|
|
84
|
+
For each sheet, define columns in order:
|
|
85
|
+
|
|
86
|
+
| Column | Source | Always Include |
|
|
87
|
+
|--------|--------|---------------|
|
|
88
|
+
| Timestamp | `new Date()` — auto | ✅ Yes |
|
|
89
|
+
| (form fields) | `e.parameter.xxx` | From inventory |
|
|
90
|
+
| Page Source | `e.parameter.url` | ✅ Yes |
|
|
91
|
+
|
|
92
|
+
### Naming Convention
|
|
93
|
+
|
|
94
|
+
| Element | Convention |
|
|
95
|
+
|---------|-----------|
|
|
96
|
+
| Sheet tab name | `Data` |
|
|
97
|
+
| Form attribute | `data-form-type="<type>"` |
|
|
98
|
+
| Hidden URL field | `<input type="hidden" name="url" value="">` |
|
|
99
|
+
| JS global function | `window.submitToGoogleSheet` |
|
|
100
|
+
|
|
101
|
+
### Deliverables Checklist
|
|
102
|
+
|
|
103
|
+
- [ ] Apps Script code per sheet
|
|
104
|
+
- [ ] Frontend JS with retry + toast
|
|
105
|
+
- [ ] Toast CSS component
|
|
106
|
+
- [ ] HTML form markup template
|
|
107
|
+
- [ ] Deploy instructions
|
|
108
|
+
- [ ] Verification test plan
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Phase 3: BUILD (Generate Code)
|
|
113
|
+
|
|
114
|
+
### 3A. Google Apps Script Template
|
|
115
|
+
|
|
116
|
+
> See `templates/apps-script.js` for the full template.
|
|
117
|
+
|
|
118
|
+
**Key rules:**
|
|
119
|
+
- Always use `doPost(e)` — NOT `doGet`
|
|
120
|
+
- Always wrap in `try/catch`
|
|
121
|
+
- Always return JSON with `{status: "success"}` or `{status: "error", message: "..."}`
|
|
122
|
+
- Column order MUST match `sheet.appendRow([...])` order
|
|
123
|
+
- Tab name MUST match `SHEET_NAME` constant
|
|
124
|
+
|
|
125
|
+
### 3B. Frontend JavaScript
|
|
126
|
+
|
|
127
|
+
> See `templates/form-submit.js` for the full template.
|
|
128
|
+
|
|
129
|
+
**Key features:**
|
|
130
|
+
|
|
131
|
+
| Feature | Detail |
|
|
132
|
+
|---------|--------|
|
|
133
|
+
| Auto-retry | 3 attempts, exponential backoff (1s → 2s → 4s) |
|
|
134
|
+
| Toast UI | Success (green), Error (red), Retrying (amber) |
|
|
135
|
+
| Phone validation | Vietnamese format: `/^0\d{8,10}$/` |
|
|
136
|
+
| Button states | "Submitting..." → "Retrying (X/3)..." → reset |
|
|
137
|
+
| CORS handling | Handles opaque responses from Apps Script |
|
|
138
|
+
| Fallback | Zalo button in error toast |
|
|
139
|
+
| Auto-dismiss | Success: 6s, Error: 15s, Retrying: 10s |
|
|
140
|
+
|
|
141
|
+
### 3C. Toast CSS
|
|
142
|
+
|
|
143
|
+
> See `templates/toast.css` for the full template.
|
|
144
|
+
|
|
145
|
+
**3 variants:** `--success`, `--error`, `--retrying`
|
|
146
|
+
|
|
147
|
+
### 3D. HTML Form Markup
|
|
148
|
+
|
|
149
|
+
> See `templates/form-markup.html` for examples.
|
|
150
|
+
|
|
151
|
+
**Required attributes:**
|
|
152
|
+
```html
|
|
153
|
+
<form data-form-type="TYPE" onsubmit="window.submitToGoogleSheet(event)">
|
|
154
|
+
<input type="hidden" name="url" value="">
|
|
155
|
+
<!-- form fields with name="..." -->
|
|
156
|
+
<button type="submit">Submit Text</button>
|
|
157
|
+
</form>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Phase 4: INTEGRATE (Wire Everything)
|
|
163
|
+
|
|
164
|
+
### Step-by-step:
|
|
165
|
+
|
|
166
|
+
1. **Add Toast CSS** → Append to main CSS file (e.g., `design-system.css`)
|
|
167
|
+
2. **Add Form JS** → Add to shared JS file or create `js/form-handler.js`
|
|
168
|
+
3. **Update HTML forms:**
|
|
169
|
+
- Add `data-form-type="..."` attribute
|
|
170
|
+
- Add `onsubmit="window.submitToGoogleSheet(event)"`
|
|
171
|
+
- Add `<input type="hidden" name="url" value="">`
|
|
172
|
+
- Ensure all inputs have `name="..."` matching Apps Script params
|
|
173
|
+
4. **Configure URLs:**
|
|
174
|
+
- Replace placeholder URLs in JS with deployed Apps Script URLs
|
|
175
|
+
5. **Configure fallback contact:**
|
|
176
|
+
- Replace Zalo URL in JS toast with project's contact URL
|
|
177
|
+
|
|
178
|
+
### Customization Points
|
|
179
|
+
|
|
180
|
+
| Setting | Location | Default |
|
|
181
|
+
|---------|----------|---------|
|
|
182
|
+
| Apps Script URLs | JS `URLS` object | placeholder |
|
|
183
|
+
| Fallback contact | Toast Zalo link | `https://zalo.me/...` |
|
|
184
|
+
| Max retries | `fetchWithRetry` arg | 3 |
|
|
185
|
+
| Phone regex | Validation block | `/^0\d{8,10}$/` |
|
|
186
|
+
| Toast auto-dismiss | `showFormToast` timeouts | 6s/15s/10s |
|
|
187
|
+
| Success message | `.then()` block | Customizable |
|
|
188
|
+
| Error message | `.catch()` block | Customizable |
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Phase 5: VERIFY (Test & Report)
|
|
193
|
+
|
|
194
|
+
### Test Checklist
|
|
195
|
+
|
|
196
|
+
| # | Test Case | Expected | Status |
|
|
197
|
+
|---|-----------|----------|--------|
|
|
198
|
+
| 1 | Submit valid form | Toast success (green) + Zalo opens | |
|
|
199
|
+
| 2 | Submit invalid phone | Toast error "Invalid phone number" | |
|
|
200
|
+
| 3 | Network offline | 3 retries → Toast error with Zalo button | |
|
|
201
|
+
| 4 | Check Google Sheet | New row appears with correct data | |
|
|
202
|
+
| 5 | Button states | Disabled during submit, resets after | |
|
|
203
|
+
| 6 | Toast close button | Toast disappears on click | |
|
|
204
|
+
| 7 | Mobile responsive | Toast visible above sticky CTA | |
|
|
205
|
+
| 8 | Multiple forms same page | Each form submits independently | |
|
|
206
|
+
|
|
207
|
+
### How to Test Retry
|
|
208
|
+
|
|
209
|
+
1. Open DevTools → Network tab
|
|
210
|
+
2. Block domain `script.google.com`
|
|
211
|
+
3. Submit form → Should see 3 retry attempts
|
|
212
|
+
4. Unblock → Submit again → Should succeed
|
|
213
|
+
|
|
214
|
+
### Report Template
|
|
215
|
+
|
|
216
|
+
```markdown
|
|
217
|
+
## Form Integration Test Report
|
|
218
|
+
|
|
219
|
+
**Date:** YYYY-MM-DD
|
|
220
|
+
**Pages tested:** X/Y
|
|
221
|
+
|
|
222
|
+
| Page | Form Type | Submit | Retry | Fallback | Sheet |
|
|
223
|
+
|------|-----------|--------|-------|----------|-------|
|
|
224
|
+
| index.html | massage | ✅ | ✅ | ✅ | ✅ |
|
|
225
|
+
| khoa-hoc.html | course | ✅ | ✅ | ✅ | ✅ |
|
|
226
|
+
|
|
227
|
+
**Issues found:** None / [list issues]
|
|
228
|
+
**Resolution:** [fixes applied]
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## ❌ Anti-Patterns
|
|
234
|
+
|
|
235
|
+
| ❌ Don't | ✅ Do |
|
|
236
|
+
|----------|------|
|
|
237
|
+
| Use `alert()` for feedback | Use toast notifications |
|
|
238
|
+
| No retry on failure | Auto-retry 3x with backoff |
|
|
239
|
+
| Silently fail | Show error + contact fallback |
|
|
240
|
+
| Hardcode form URLs | Use config object (`URLS`) |
|
|
241
|
+
| Skip phone validation | Validate before submit |
|
|
242
|
+
| Forget `name` attribute | Every input MUST have `name` |
|
|
243
|
+
| Use `doGet` for form submit | Use `doPost` only |
|
|
244
|
+
| Multiple submit handlers | One shared `submitToGoogleSheet` |
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## 📑 Templates
|
|
249
|
+
|
|
250
|
+
| File | Purpose |
|
|
251
|
+
|------|---------|
|
|
252
|
+
| `templates/apps-script.js` | Google Apps Script doPost handler |
|
|
253
|
+
| `templates/form-submit.js` | Frontend JS with retry + toast |
|
|
254
|
+
| `templates/toast.css` | Toast notification CSS component |
|
|
255
|
+
| `templates/form-markup.html` | HTML form examples |
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 🔗 Related Skills
|
|
260
|
+
|
|
261
|
+
| Need | Skill |
|
|
262
|
+
|------|-------|
|
|
263
|
+
| Form UI/UX design | `@[skills/cm-ux-master]` |
|
|
264
|
+
| SEO for forms | `@[skills/cm-dockit]` |
|
|
265
|
+
| Form security | `@[skills/vulnerability-scanner]` |
|
|
266
|
+
| Deployment | `@[skills/deployment-procedures]` |
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Apps Script — Form to Sheet Handler
|
|
3
|
+
*
|
|
4
|
+
* SETUP:
|
|
5
|
+
* 1. Create Google Sheet with headers matching appendRow columns
|
|
6
|
+
* 2. Extensions > Apps Script > paste this code
|
|
7
|
+
* 3. Deploy > New deployment > Web app
|
|
8
|
+
* - Execute as: Me
|
|
9
|
+
* - Who has access: Anyone
|
|
10
|
+
* 4. Copy the deployment URL → use in frontend URLS config
|
|
11
|
+
*
|
|
12
|
+
* CUSTOMIZATION:
|
|
13
|
+
* - Change SHEET_NAME if tab is not "Data"
|
|
14
|
+
* - Modify appendRow columns to match your form fields
|
|
15
|
+
* - Add more e.parameter.xxx for additional fields
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const SHEET_NAME = 'Data';
|
|
19
|
+
|
|
20
|
+
function doPost(e) {
|
|
21
|
+
try {
|
|
22
|
+
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(SHEET_NAME);
|
|
23
|
+
if (!e || !e.parameter) {
|
|
24
|
+
return ContentService.createTextOutput(JSON.stringify({ status: 'error', message: 'No data received' }))
|
|
25
|
+
.setMimeType(ContentService.MimeType.JSON);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const p = e.parameter;
|
|
29
|
+
|
|
30
|
+
// ═══════════════════════════════════════
|
|
31
|
+
// CUSTOMIZE: Change columns below to match your form
|
|
32
|
+
// Column order MUST match Sheet header row
|
|
33
|
+
// ═══════════════════════════════════════
|
|
34
|
+
sheet.appendRow([
|
|
35
|
+
new Date(), // A: Thời gian (auto)
|
|
36
|
+
p.name || '', // B: Họ tên
|
|
37
|
+
p.phone || '', // C: SĐT
|
|
38
|
+
// --- Add your custom fields below ---
|
|
39
|
+
// p.email || '', // D: Email
|
|
40
|
+
// p.branch || '', // E: Chi nhánh
|
|
41
|
+
// p.problem || '', // F: Vấn đề
|
|
42
|
+
// p.time || '', // G: Khung giờ
|
|
43
|
+
// p.package || '', // H: Gói dịch vụ
|
|
44
|
+
// p.goal || '', // I: Mục tiêu
|
|
45
|
+
// --- End custom fields ---
|
|
46
|
+
p.url || '' // Last: Nguồn trang (auto)
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
return ContentService.createTextOutput(JSON.stringify({ status: 'success' }))
|
|
50
|
+
.setMimeType(ContentService.MimeType.JSON);
|
|
51
|
+
} catch (err) {
|
|
52
|
+
return ContentService.createTextOutput(JSON.stringify({ status: 'error', message: err.toString() }))
|
|
53
|
+
.setMimeType(ContentService.MimeType.JSON);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Form Markup Templates — Google Apps Script Integration
|
|
3
|
+
|
|
4
|
+
RULES:
|
|
5
|
+
1. Every form MUST have data-form-type="TYPE"
|
|
6
|
+
2. Every form MUST have onsubmit="window.submitToGoogleSheet(event)"
|
|
7
|
+
3. Every form MUST include <input type="hidden" name="url" value="">
|
|
8
|
+
4. Every input/select MUST have name="..." matching Apps Script params
|
|
9
|
+
5. One submit button with type="submit"
|
|
10
|
+
-->
|
|
11
|
+
|
|
12
|
+
<!-- ═══════════════════════════════════════ -->
|
|
13
|
+
<!-- EXAMPLE 1: Service Booking (Massage) -->
|
|
14
|
+
<!-- ═══════════════════════════════════════ -->
|
|
15
|
+
<form data-form-type="massage" onsubmit="window.submitToGoogleSheet(event)">
|
|
16
|
+
<input type="hidden" name="url" value="">
|
|
17
|
+
|
|
18
|
+
<div class="form-group">
|
|
19
|
+
<label class="form-label">Họ và tên</label>
|
|
20
|
+
<input type="text" class="form-input" name="name" placeholder="Nhập họ tên" required>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="form-group">
|
|
24
|
+
<label class="form-label">Số điện thoại</label>
|
|
25
|
+
<input type="tel" class="form-input" name="phone" placeholder="0xxx xxx xxx" required>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="form-group">
|
|
29
|
+
<label class="form-label">Chi nhánh</label>
|
|
30
|
+
<select class="form-input" name="branch">
|
|
31
|
+
<option>Chi nhánh 1</option>
|
|
32
|
+
<option>Chi nhánh 2</option>
|
|
33
|
+
</select>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div class="form-group">
|
|
37
|
+
<label class="form-label">Vấn đề quan tâm</label>
|
|
38
|
+
<select class="form-input" name="problem">
|
|
39
|
+
<option>Đau cổ vai gáy</option>
|
|
40
|
+
<option>Mất ngủ</option>
|
|
41
|
+
<option>Đau lưng</option>
|
|
42
|
+
<option>Khác</option>
|
|
43
|
+
</select>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<button type="submit" class="btn btn-primary btn-lg" style="width:100%;">Đặt Lịch Ngay</button>
|
|
47
|
+
|
|
48
|
+
<p style="text-align:center;margin-top:12px;font-size:14px;color:#666;">
|
|
49
|
+
Hoặc gọi: <a href="tel:0559669663" style="color:#C9A84C;font-weight:600;">0559.669.663</a>
|
|
50
|
+
</p>
|
|
51
|
+
</form>
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
<!-- ═══════════════════════════════════════ -->
|
|
55
|
+
<!-- EXAMPLE 2: Course Registration -->
|
|
56
|
+
<!-- ═══════════════════════════════════════ -->
|
|
57
|
+
<form data-form-type="course" onsubmit="window.submitToGoogleSheet(event)">
|
|
58
|
+
<input type="hidden" name="url" value="">
|
|
59
|
+
|
|
60
|
+
<div class="form-group">
|
|
61
|
+
<label class="form-label">Họ và tên</label>
|
|
62
|
+
<input type="text" class="form-input" name="name" placeholder="Nhập họ tên" required>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div class="form-group">
|
|
66
|
+
<label class="form-label">Số điện thoại</label>
|
|
67
|
+
<input type="tel" class="form-input" name="phone" placeholder="0xxx xxx xxx" required>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<div class="form-group">
|
|
71
|
+
<label class="form-label">Mục tiêu học</label>
|
|
72
|
+
<select class="form-input" name="goal">
|
|
73
|
+
<option>Chuyển nghề</option>
|
|
74
|
+
<option>Nâng cấp kỹ năng</option>
|
|
75
|
+
<option>Chăm sóc gia đình</option>
|
|
76
|
+
</select>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<button type="submit" class="btn btn-primary btn-lg" style="width:100%;">Đăng Ký Tư Vấn</button>
|
|
80
|
+
</form>
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
<!-- ═══════════════════════════════════════ -->
|
|
84
|
+
<!-- EXAMPLE 3: Simple Contact/Lead Form -->
|
|
85
|
+
<!-- ═══════════════════════════════════════ -->
|
|
86
|
+
<form data-form-type="contact" onsubmit="window.submitToGoogleSheet(event)">
|
|
87
|
+
<input type="hidden" name="url" value="">
|
|
88
|
+
|
|
89
|
+
<div class="form-group">
|
|
90
|
+
<label class="form-label">Họ và tên</label>
|
|
91
|
+
<input type="text" class="form-input" name="name" placeholder="Nhập họ tên" required>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div class="form-group">
|
|
95
|
+
<label class="form-label">Số điện thoại</label>
|
|
96
|
+
<input type="tel" class="form-input" name="phone" placeholder="0xxx xxx xxx" required>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div class="form-group">
|
|
100
|
+
<label class="form-label">Email (tùy chọn)</label>
|
|
101
|
+
<input type="email" class="form-input" name="email" placeholder="email@example.com">
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<div class="form-group">
|
|
105
|
+
<label class="form-label">Nội dung</label>
|
|
106
|
+
<textarea class="form-input" name="message" rows="3" placeholder="Bạn cần hỗ trợ gì?"></textarea>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
<button type="submit" class="btn btn-primary btn-lg" style="width:100%;">Gửi Yêu Cầu</button>
|
|
110
|
+
</form>
|