Install
$ agentstack add skill-piter902-survey-creator-skill-survey-creator ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Survey Creator
Generate HTML survey pages only.
Treat skills/survey-creator/ as the canonical generator root for this skill. All generator-private references, templates, validators, tests, examples, and docs live under this directory.
The workflow is:
- understand the user's intent
- analyze the prompt and infer the survey structure
- generate a schema draft from
references/ - validate that schema against the reference formats and field rules
- render a submittable HTML page from the validated schema
- verify the HTML does not blank-screen in desktop and mobile browser runtimes
- verify basic accessibility and form semantics
- make the generated submit payload conform to the submission contract
- validate the submit payload against the concrete schema so every questionId / optionId / childId / score belongs to that exact survey
Do not return raw JSON schema by default. Use the schema as an internal generation artifact unless the user explicitly asks to inspect it.
Load these references first
Before generating output, read only the files you need from:
references/schema-notes.mdreferences/field-guide-overview.mdreferences/id-rules.mdreferences/survey-welcom.jsonreferences/survey-fields.mdreferences/question-radio.jsonreferences/radio-fields.mdreferences/question-checkbox.jsonreferences/checkbox-fields.mdreferences/question-input.jsonreferences/input-fields.mdreferences/question-score.jsonreferences/score-fields.mdreferences/question-nps.jsonreferences/nps-fields.mdreferences/question-finish.jsonreferences/finish-fields.mdreferences/rich-text-rules.mdreferences/pagination-rules.mdreferences/submission-contract.mdreferences/child-input-rules.mdreferences/local-cache-rules.mdreferences/logic-rules.mdreferences/logic-specification.mdreferences/logic-example-library.mdreferences/toc-survey-ui-rules.mdreferences/toc-style-system.mdvalidators/README.mdvalidators/validate_reference_consistency.pyvalidators/validate_survey_schema.pyvalidators/validate_survey_payload.pyvalidators/validate_payload_against_schema.pyvalidators/validate_survey_html_runtime.pyvalidators/validate_survey_html_interaction_e2e.pyvalidators/validate_survey_html_accessibility.pyvalidators/render_survey_html.pyvalidators/build_validated_survey.pyvalidators/generate_sample_payload.pydocs/LEGALITY_GUARANTEE.mddocs/LEGALITY_MATRIX.mdtests/contract/README.mdrun_all_legality_checks.sh
Always read references/schema-notes.md first, then references/field-guide-overview.md, then references/id-rules.md, references/rich-text-rules.md, references/pagination-rules.md, references/submission-contract.md, references/child-input-rules.md, references/local-cache-rules.md, references/logic-rules.md, references/logic-specification.md, and references/logic-example-library.md, then the specific *-fields.md files for every node type you plan to generate or validate. If the user requests a stronger toC visual direction, also read references/toc-style-system.md and references/toc-survey-ui-rules.md. When schema safety matters, also use validators/validate_survey_schema.py as the executable guardrail before rendering HTML.
Legality engine boundary
Treat this skill as a schema legality engine plus fixed HTML renderer. The user and AI may iterate on business semantics, but the skill must enforce protocol legality before delivery.
Read docs/LEGALITY_GUARANTEE.md when changing the skill, adding fields, adding question types, or assessing whether generated artifacts are safe to deliver.
When modifying references, validators, payload format, or templates, run:
python3 /tests/contract/run_contract_tests.py
/validators/run-validator-smoke-tests.sh
Only consider the skill healthy when both pass.
Primary job
Turn a user's high-level request into a self-contained HTML survey page that:
- matches the user's scenario and UI style
- uses only schema-supported question structures
- is built from a validated internal schema draft
- supports form submission at the HTML level
- serializes submission data using the default submission contract unless the user overrides it
Core principle
- Prompt determines intent and presentation
- References determine structure and allowed fields
- Validation is mandatory before HTML generation
This skill should think in two layers:
- an internal schema layer
- a rendered HTML layer
The schema layer is not optional. Build it first, validate it, then render.
Required execution sequence
Step 1: Understand the user's intent
Read the prompt carefully and identify:
- the survey scenario
- who the respondent is
- likely question count
- whether the page is feedback / registration / research / satisfaction / other
- any explicit UI style directions
- whether the user implies optional conditional inputs such as “其他,请说明”
- whether one-page-one-question flow is implied or should be enabled
- whether previous-page navigation should be available
- whether the UI style implies a known
stylePack
If the prompt is underspecified, make sensible product decisions instead of stopping.
Step 1.5: Infer stylePack
When the user gives visual direction, infer a renderer stylePack before generating HTML.
Use only the generic toC packs:
consumer-minimalconsumer-polishedconsumer-trustconsumer-editorialconsumer-utilityconsumer-campaign
Explicit mapping
- mentions WeChat / 微信 / 小程序 / 表单感 / 轻量填写
→ consumer-minimal
- mentions 更产品化 / 更高级 / 更精致 / 更有设计感
→ consumer-polished
- mentions 满意度 / 购买后反馈 / 产品可信赖 / 售后体验
→ consumer-trust
- mentions 年轻 / 内容感 / 社区感 / lifestyle / 更有氛围
→ consumer-editorial
- mentions 克制 / 干净 / 工具型 / 平台感 / 高效率
→ consumer-utility
- mentions 运营活动 / 活动页 / 更强视觉冲击 / 黑白紫活动风
→ consumer-campaign
Implicit mapping
- generic toC without a strong aesthetic signal
→ default to consumer-minimal
- product or purchase feedback
→ default to consumer-trust
- more branded but still general consumer UI
→ default to consumer-polished
- content or lifestyle tone
→ default to consumer-editorial
- platform/tool-like tone
→ default to consumer-utility
Always record this decision mentally and pass it into the renderer or pipeline command via --style-pack.
Step 2: Infer an internal schema draft
Create an internal questionnaire object using both the reference JSON examples and the field-guide markdown files.
Do not rely on JSON shape alone. Use the field guides to understand what each field means, when it is optional, and how it should be rendered.
For a full survey, the internal shape should be:
{ "survey": { ... }, "questions": [ ... ], "finish": [ { ... } ] }
This internal schema is the planning source for the HTML. Do not expose it unless the user asks.
Step 3: Validate the internal schema
Before rendering HTML, verify all of the following:
Structure validation
- top level contains
survey,questions,finish questionsis an arrayfinishis an array of one or more finish objectssurvey.type === "survey"- every
finish[i].type === "finish" - every question uses only supported types
- supported types include
radio,checkbox,input,score,nps - score questions may carry media at both
attribute.mediaandoption[].attribute.media - nps questions may carry media at both
attribute.mediaandoption[].attribute.media, and use range-basedscoreDesckeys such as0-6
Field validation
survey,radio,checkbox, andinputuseattributetitleanddescriptionare treated as rich-text-capable string fieldsradio,checkbox, andinputincludeid,title,descriptionwhen appropriateradioandcheckboxuseoptionarrays- if a selection question is randomized, check for option-level
option[].attribute.random === falseoverrides before shuffling inputuses anoptionarray with input metadata inoption[].attributeinputmay contain one or multiple option-defined input fields, so submission must preserve answers peroption[].idrather than collapsing everything into one string- conditional free-text is only represented through
childitems oftype: "input" - an option may contain one or multiple child items; do not assume only one child field exists
- child items may include their own
attributeconfiguration and should be fully respected when present, using the same input-style semantics you already received for child field behavior - child and input rendering should follow
dataTypewhen present - Allowed input/child dataType values are
email,tel,number,text,date,time,dateTime,dateRange,timeRange,dateTimeRange; unknown values must fall back totext - do not invent unsupported field names
Reference conformance validation
- field names must match the reference patterns
- field meanings must remain consistent with the field-guide explanations
- rich-text fields must be treated as normal HTML-capable content
- rich-text fields must be sanitized through a whitelist of display-oriented safe tags before rendering
- pagination-related fields must be interpreted according to the pagination rules
- when
attribute.random === true, randomized option order should visibly change across reloads or renders, while preserving option ids and submitted values - option-level random overrides must be respected: if an option has
option.attribute.random === false, that option must stay fixed even when the question is randomized - unsupported node types are forbidden unless the user explicitly asks to extend the schema
- checkbox
exclusiveandmutual-exclusionhave different semantics:exclusiveclears all other options, whilemutual-exclusiononly clears other mutual-exclusion options - media is optional unless the prompt requires it
If the inferred schema fails validation, fix it before rendering. Never render HTML from an invalid schema.
Step 3.5: Run the executable schema validator
After the manual semantic review above, run the executable validator whenever you have local file access or can materialize the schema temporarily:
python3 /validators/validate_survey_schema.py /absolute/path/to/schema.json
Rules:
- if the validator returns non-zero, the schema must be fixed before HTML generation
- treat unsupported fields as hallucination risk, not as harmless extras
- treat duplicate ids as blocking errors
- treat unsupported
dataTypevalues as blocking errors - inspect semantic lint warnings by severity;
highwarnings should normally be resolved before rendering final HTML - prefer using warning
code,suggestion, andfixHintto repair the schema automatically before proceeding - use
--jsonwhen you need a machine-readable validation report
If you cannot execute the validator in the current environment, you should still follow the same rule set manually and explicitly say that executable validation was not run.
Step 4: Render HTML from the validated schema
When local scripting is available, prefer using the automated renderer:
python3 /validators/render_survey_html.py --schema /absolute/path/to/schema.json --out /absolute/path/to/output.html
If --out points to a directory, the renderer writes:
.html
Or use the full automatic pipeline in one command:
python3 /validators/build_validated_survey.py --schema /absolute/path/to/schema.json --out-html /absolute/path/to/output.html --out-payload /absolute/path/to/output-payload.json
If --out-html, --out-payload, or --out-schema point to directories, the builder writes:
.html.payload.json.repaired.schema.json
When semantic warnings are expected, prefer the repair-enabled pipeline:
python3 /validators/build_validated_survey.py --schema /absolute/path/to/schema.json --out-schema /absolute/path/to/repaired-schema.json --out-html /absolute/path/to/output.html --out-payload /absolute/path/to/output-payload.json --auto-repair --fail-on-high-warning
For skill execution, prefer the single unified entry:
python3 /validators/run_survey_creator_pipeline.py --schema /absolute/path/to/schema.json --output-dir /absolute/path/to/output-dir --style-pack consumer-trust --auto-repair --fail-on-high-warning
Default output naming for the unified pipeline:
- if
--prefixis provided, it is used as the output filename stem - otherwise the pipeline uses the final rendered
survey.idas the filename stem - for example, if
survey.id === "survey-310991633843965952", the generated HTML file must besurvey-310991633843965952.html
Supported --style-pack values currently include:
consumer-minimalconsumer-polishedconsumer-trustconsumer-editorialconsumer-utilityconsumer-campaign
Only return the final HTML to the user after this automated chain succeeds, desktop/mobile E2E viewports pass, htmlAccessibility.valid === true, payloadAgainstSchema.valid === true, and the pipeline report says releaseDecision.shipReady === true. If the generated HTML fails runtime or E2E checks, run the HTML auto-repair pass before giving up.
Step 4: Render HTML from the validated schema
Map the validated schema to page structure:
survey→ welcome / intro / hero section- render
titleanddescriptionusing rich-text-capable output - support only whitelisted display-oriented elements inside rich-text fields
radio→ radio groupcheckbox→ checkbox groupinput→ text input, textarea, or structured range input blockscore→ score / rating gridnps→ recommendation score scalefinish→ one or more submit / thank-you / final action sections
When multiple finish nodes exist:
- treat
finish[0]as the default finish - allow
logic.action.type === "end_survey"to route to a specificfinish[].idviaaction.targetQuestionId - use multiple finish nodes only when the final tone or next-step guidance truly differs between user branches
- when a finish needs a follow-up destination, place it under
finish[].postSubmit finish[].postSubmit.redirectmust run only after successful submit, never when the finish screen first appears
Step 5: Build submission payload behavior
Use references/submission-contract.md as the default submit serialization protocol.
At minimum, the generated HTML should make it possible to assemble:
surveyIdsubmittedAtas a millisecond timestampanswers[]withquestionId,questionType, and type-specificvalue
For radio / checkbox / input / score / nps questions, preserve schema ids in DOM structure so submission assembly is reliable. Unanswered questions must be omitted from answers. If a child input carries its own attribute configuration, use that configuration in child rendering and validation. Treat child attribute semantics as the same input-style configuration family already defined by the provided materials. If one option has multiple child fields, submission assembly must preserve them as a list of child answer objects rather than collapsing them into one value. For input questions, use option[].attribute.dataType to choose control type and validation behavior. Apply the same rule to child inputs. If the dataType is missing or unsupported, fall back to text. For dateRange, timeRange, and dateTimeRange, serialize the submitted value as { start, end }. For input questions, serialize value as an array of answered option-field objects, each preserving optionId, dataType, and value.
Step 5.5: Run the executable payload validator
After assembling the default payload shape, validate it with:
python3 /validators/validate_survey_paylo
…
## Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- **Author:** [piter902](https://github.com/piter902)
- **Source:** [piter902/survey-creator-skill](https://github.com/piter902/survey-creator-skill)
- **License:** MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.