一键导入
create-study
Design complete surveys from free text requirements - generates a Python script with Survey, ScenarioList, and AgentList definitions
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Design complete surveys from free text requirements - generates a Python script with Survey, ScenarioList, and AgentList definitions
用 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 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
EDSL survey reference - question types, templating, rules, memory, helpers, and visualization
| name | create-study |
| description | Design complete surveys from free text requirements - generates a Python script with Survey, ScenarioList, and AgentList definitions |
| allowed-tools | Read, Glob, Skill, AskUserQuestion, Write |
| arguments | research_question |
This skill generates a Python script with EDSL objects (Survey, ScenarioList, AgentList) based on a free text description of what the user wants the study to accomplish.
Example:
/create-study Do LLMs exibit anchoring bias?
Extract from the free text:
If the description is ambiguous or missing key details, use AskUserQuestion to clarify before generating code.
Use AskUserQuestion to ask where the user wants the code:
Question: "Where would you like the survey code?"
Header: "Output"
Options:
1. "Write to file (Recommended)" - "Save to a Python file with an appropriate name based on the survey topic"
2. "Display only" - "Show the code in the conversation without saving"
If the user chooses to write to a file:
mafia_exit_survey.py, food_preferences_survey.py)Read the consolidated reference skill for detailed implementation guidance:
| Skill | When to Read |
|---|---|
| edsl-survey-reference | Question types, templating, rules, memory, helpers, visualization |
Use the Skill tool to invoke edsl-survey-reference, or Read the SKILL.md file from .claude/skills/edsl-survey-reference/SKILL.md.
Based on requirements, determine:
Produce a Python script that defines:
Survey with all questions and rulesScenarioList if variables are neededAgentList if personas are neededDo NOT include code to run or analyze the survey.
"I want to survey people about their food preferences. I want to ask about 5 different cuisines, get their favorite dish from each, and then ask follow-up questions based on their top choice."
from edsl import (
Survey,
QuestionMultipleChoice,
QuestionFreeText,
QuestionLinearScale,
Scenario,
ScenarioList,
Agent,
AgentList
)
# === QUESTIONS ===
# Initial preference question
q_cuisine = QuestionMultipleChoice(
question_name="favorite_cuisine",
question_text="Which cuisine do you enjoy most?",
question_options=["Italian", "Japanese", "Mexican", "Indian", "Thai"]
)
# Follow-up about favorite dish (uses piping)
q_dish = QuestionFreeText(
question_name="favorite_dish",
question_text="What is your favorite {{ favorite_cuisine.answer }} dish?"
)
# Rating question
q_frequency = QuestionLinearScale(
question_name="frequency",
question_text="How often do you eat {{ favorite_cuisine.answer }} food?",
question_options=[1, 2, 3, 4, 5],
option_labels={1: "Rarely", 5: "Very Often"}
)
# Why they like it
q_why = QuestionFreeText(
question_name="why_favorite",
question_text="Why do you particularly enjoy {{ favorite_cuisine.answer }} cuisine?"
)
# === SURVEY ===
survey = (Survey([q_cuisine, q_dish, q_frequency, q_why])
.set_full_memory_mode()) # Each question sees prior answers
# === SCENARIOS (if parameterizing) ===
# Not needed here since we use piping, but example:
# scenarios = ScenarioList([
# Scenario({"cuisine": "Italian"}),
# Scenario({"cuisine": "Japanese"}),
# ])
# === AGENTS (respondent personas) ===
agents = AgentList([
Agent(traits={"persona": "health-conscious millennial", "age": 28}),
Agent(traits={"persona": "traditional home cook", "age": 55}),
Agent(traits={"persona": "adventurous foodie", "age": 35}),
Agent(traits={"persona": "busy professional", "age": 42}),
])
# === READY TO RUN ===
# To execute: results = survey.by(agents).run()
from edsl import Survey, QuestionFreeText, QuestionMultipleChoice
questions = [
QuestionFreeText(question_name="q1", question_text="Question 1?"),
QuestionMultipleChoice(question_name="q2", question_text="Question 2?",
question_options=["A", "B", "C"]),
QuestionFreeText(question_name="q3", question_text="Question 3?"),
]
survey = Survey(questions)
from edsl import Survey, QuestionMultipleChoice, QuestionFreeText
q_branch = QuestionMultipleChoice(
question_name="path",
question_text="Which topic interests you?",
question_options=["Technology", "Nature", "Arts"]
)
q_tech = QuestionFreeText(question_name="tech_q", question_text="Tech follow-up?")
q_nature = QuestionFreeText(question_name="nature_q", question_text="Nature follow-up?")
q_arts = QuestionFreeText(question_name="arts_q", question_text="Arts follow-up?")
q_final = QuestionFreeText(question_name="final", question_text="Final thoughts?")
survey = (Survey([q_branch, q_tech, q_nature, q_arts, q_final])
.add_rule("path", "{{ path.answer }} == 'Technology'", "tech_q")
.add_rule("path", "{{ path.answer }} == 'Nature'", "nature_q")
.add_rule("path", "{{ path.answer }} == 'Arts'", "arts_q")
.add_skip_rule("tech_q", "{{ path.answer }} != 'Technology'")
.add_skip_rule("nature_q", "{{ path.answer }} != 'Nature'")
.add_skip_rule("arts_q", "{{ path.answer }} != 'Arts'"))
from edsl import Survey, QuestionFreeText, Scenario, ScenarioList
q = QuestionFreeText(
question_name="opinion",
question_text="What do you think about {{ scenario.topic }}?"
)
survey = Survey([q])
scenarios = ScenarioList([
Scenario({"topic": "artificial intelligence"}),
Scenario({"topic": "climate change"}),
Scenario({"topic": "remote work"}),
])
# To run: results = survey.by(scenarios).run()
from edsl import Survey, QuestionFreeText, Agent, AgentList
q = QuestionFreeText(
question_name="perspective",
question_text="As a {{ agent.role }}, what's your view on automation?"
)
survey = Survey([q])
agents = AgentList([
Agent(traits={"role": "factory worker", "experience": "20 years"}),
Agent(traits={"role": "tech executive", "experience": "15 years"}),
Agent(traits={"role": "policy maker", "experience": "10 years"}),
])
# To run: results = survey.by(agents).run()
from edsl import Survey, QuestionLinearScale, Scenario, ScenarioList, Agent, AgentList
q = QuestionLinearScale(
question_name="trust",
question_text="How much do you trust {{ scenario.source }} for {{ scenario.topic }} news?",
question_options=[1, 2, 3, 4, 5],
option_labels={1: "Not at all", 5: "Completely"}
)
survey = Survey([q])
scenarios = ScenarioList([
Scenario({"source": "social media", "topic": "political"}),
Scenario({"source": "traditional news", "topic": "political"}),
Scenario({"source": "social media", "topic": "scientific"}),
Scenario({"source": "traditional news", "topic": "scientific"}),
])
agents = AgentList([
Agent(traits={"age_group": "18-30", "education": "college"}),
Agent(traits={"age_group": "31-50", "education": "college"}),
Agent(traits={"age_group": "51+", "education": "college"}),
])
# To run (4 scenarios × 3 agents = 12 responses):
# results = survey.by(scenarios).by(agents).run()
Generate a complete Python script that:
Do NOT include:
.run() calls)The script should define the objects and be ready for the user to run separately.