一键导入
create-survey
Create Surveys from questions, QSF files, or programmatically with branching logic
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create Surveys from questions, QSF files, or programmatically with branching logic
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Analyze EDSL Results objects - load by UUID or file path, export survey documentation, and generate analysis reports
Answer questions about a generated analysis report - reads report artifacts, performs additional analysis if needed, and saves the answer with metadata
Design complete surveys from free text requirements - generates a Python script with Survey, ScenarioList, and AgentList definitions
Design a detailed experimental plan from a research question - includes literature review, randomization plan, survey design, power analysis, and sample size recommendation
EDSL agent reference - AgentList operations, trait manipulation, templates, codebooks, and instructions
Save/load Surveys, Agents, and AgentLists locally, push/pull to Expected Parrot cloud, git versioning
| name | create-survey |
| description | Create Surveys from questions, QSF files, or programmatically with branching logic |
| allowed-tools | Read, Glob, Bash(python:*), AskUserQuestion |
| user-invocable | true |
| arguments | survey_description |
You will create a survey in EDSL.
When this skill is invoked, you will receive a survey_description string that explains the purpose and context of the survey. Use this description to:
If no description is provided, ask the user: "What is the survey for? Please describe its purpose and any specific topics or questions you'd like to include."
from edsl import Survey, QuestionFreeText, QuestionMultipleChoice
# Create questions
q1 = QuestionFreeText(
question_name="name",
question_text="What is your name?"
)
q2 = QuestionMultipleChoice(
question_name="color",
question_text="What is your favorite color?",
question_options=["Red", "Blue", "Green", "Yellow"]
)
q3 = QuestionFreeText(
question_name="why_color",
question_text="Why do you like that color?"
)
# Create survey from list of questions
survey = Survey([q1, q2, q3])
Survey is immutable - each operation returns a new Survey instance:
from edsl import Survey, QuestionFreeText
survey = Survey()
# Each add_question returns a NEW survey
survey = survey.add_question(QuestionFreeText(
question_name="q1",
question_text="First question?"
))
survey = survey.add_question(QuestionFreeText(
question_name="q2",
question_text="Second question?"
))
# Add at specific index
survey = survey.add_question(new_question, index=1)
Instructions are displayed to respondents between questions:
from edsl import Survey, Instruction
instruction = Instruction(
text="Please answer the following questions honestly.",
name="intro" # Optional name
)
# Add instruction at the beginning
survey = survey.add_instruction(instruction, index=0)
# Add instruction between questions
survey = survey.add_instruction(
Instruction(text="Now for some demographic questions..."),
index=3
)
To see the question types available, use
from edsl import Question
Question.available()
You can import them like so:
from edsl import (
QuestionFreeText, # Open-ended text response
QuestionMultipleChoice, # Single selection from options
QuestionCheckBox, # Multiple selections allowed
QuestionLinearScale, # Numeric scale (1-5, 1-10, etc.)
QuestionNumerical, # Numeric answer
QuestionYesNo, # Yes/No question
QuestionList, # Return a list of items
QuestionRank, # Rank items in order
QuestionMatrix, # Grid/matrix question
)
Reference previous answers in question text:
q1 = QuestionFreeText(
question_name="name",
question_text="What is your name?"
)
q2 = QuestionFreeText(
question_name="greeting",
question_text="Hello {{ name.answer }}! How are you today?"
)
survey = Survey([q1, q2])
# q2 will display the answer from q1 in its text
Survey methods can be chained since each returns a new Survey:
survey = (Survey([q1, q2, q3])
.add_rule("q1", "{{ q1.answer }} == 'skip'", "q3")
.add_skip_rule("q2", "{{ q1.answer }} == 'skip'")
.add_question(q4))
You will create a Python file with a descriptive name e.g., 'exit_interview.py' Whatever the name of your survey, you will also save it as local JSON file:
import os
survey_name = os.path.splitext(os.path.basename(__file__))[0]
survey.save(survey_name)
| Task | Method |
|---|---|
| Create survey | Survey([q1, q2, q3]) |
| Add question | survey.add_question(q, index=None) |
| Add instruction | survey.add_instruction(inst, index=0) |
| Get question | survey.get("question_name") |
| List questions | survey.questions |
| Question names | survey.question_names |
| Number of questions | len(survey) |