---
name: microsoft-forms-builder
description: "Create and configure Microsoft Forms surveys through an owned browser session (Playwright over CDP): title, description, text/choice questions, free-text 'Other', required flags, external-respondent sharing, short URL and an anonymous-access check; also read existing response data read-only for aggregation (references/reading-responses.md). Use for Microsoft Forms, forms.cloud.microsoft, アンケート作成, 事前アンケート, 事前ヒアリングフォーム, Forms の共有範囲, 短縮URL, building a survey from a question table, or アンケート結果の集計・回答の確認. Not for quizzes, Power Automate flows or Forms Pro."
argument-hint: "アンケートのタイトル・設問表（または spec.json）、回答者（社内/社外）、使うサインインアカウント"
user-invocable: true
license: CC BY-NC-SA 4.0
metadata:
  author: yamapan (https://github.com/aktsmm)
title: microsoft-forms-builder
canonical_url: https://skilld.dev/gh/aktsmm/agent-skills/microsoft-forms-builder
last_updated: 2026-11-18T07:02:40.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [assets/spec.example.json](https://skilld.dev/api/skills-raw/aktsmm/agent-skills/microsoft-forms-builder/assets/spec.example.json), [LICENSE.txt](https://skilld.dev/api/skills-raw/aktsmm/agent-skills/microsoft-forms-builder/LICENSE.txt), [references/reading-responses.md](https://skilld.dev/api/skills-raw/aktsmm/agent-skills/microsoft-forms-builder/references/reading-responses.md), [references/ui-notes.md](https://skilld.dev/api/skills-raw/aktsmm/agent-skills/microsoft-forms-builder/references/ui-notes.md), [scripts/browser_session.ps1](https://skilld.dev/api/skills-raw/aktsmm/agent-skills/microsoft-forms-builder/scripts/browser_session.ps1), [scripts/build_form.py](https://skilld.dev/api/skills-raw/aktsmm/agent-skills/microsoft-forms-builder/scripts/build_form.py), [scripts/forms_lib.py](https://skilld.dev/api/skills-raw/aktsmm/agent-skills/microsoft-forms-builder/scripts/forms_lib.py), [skill-license.json](https://skilld.dev/api/skills-raw/aktsmm/agent-skills/microsoft-forms-builder/skill-license.json).
>
> If the user asked to install this Skill, run `npx skilld install aktsmm/agent-skills/microsoft-forms-builder`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/microsoft-forms-builder`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/aktsmm/agent-skills/microsoft-forms-builder) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/microsoft-forms-builder`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/microsoft-forms-builder --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/microsoft-forms-builder --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Microsoft Forms Builder

Build a survey in Microsoft Forms from a question spec. Forms has no public API to create a form, so this drives the editor UI. The bundled scripts hold the working recipe; read [UI notes](https://skilld.dev/api/skills-raw/aktsmm/agent-skills/microsoft-forms-builder/references/ui-notes.md) before changing them.

## When to Use

- 「Forms でアンケートを作って」「事前アンケートを Forms にして」「共有範囲を外部にして」「短縮 URL がほしい」
- 「アンケート結果を見て」「回答を集計して」: read-only の手順は [Reading Responses](https://skilld.dev/api/skills-raw/aktsmm/agent-skills/microsoft-forms-builder/references/reading-responses.md)。
- A question table (Markdown, Excel, chat) must become a live Microsoft Form.
- An existing form must become answerable by external users, with a verified anonymous link.

## Not the Best Fit

- Statistical analysis or exports of responses beyond the read-only aggregate in [Reading Responses](https://skilld.dev/api/skills-raw/aktsmm/agent-skills/microsoft-forms-builder/references/reading-responses.md), quizzes, branching/sections, rating/date/ranking/file-upload questions (the scripts only build text and choice questions), Power Automate. Do those by hand or with another route.
- Credentials, MFA and tokens stay with the user. Never type them, and never read a sign-in page's secrets.

## Safety Gates

- **External respondents are a decision, not a default.** The tenant default is "organisation only". Run `--share anyone` only after the user states that respondents are external and anonymous. Bind the approval to the form and the audience.
- Sign in only by choosing the Windows-connected account on the account picker. If sign-in does not complete, stop and ask the user to finish it in that window.
- Use your own Edge window (own port, throwaway profile). Never attach to another tool's CDP browser. The profile holds tokens: stop the window and delete the profile when done.
- A test form may be deleted only if this run created it and its title matches exactly with one tile (My forms tab). Deletion goes to the Forms trash.
- Do not click "new form" repeatedly: each click opens a new tab and leaves an empty untitled form.

## Workflow

1. **Spec first.** Turn the question table into `spec.json` (see below). Always include an optional long free-text question such as "anything else you would like to tell us?"; the validator rejects specs without one. For choice questions use `other: true` instead of listing "その他" as a plain option.
2. `python scripts/build_form.py spec.json --dry-run` (spec check, no browser).
3. Start the session: `scripts/browser_session.ps1 -Action Start`.
4. `python scripts/build_form.py spec.json --account <work account on the picker>`. It creates the form, fills it, waits for "saved", reopens it and compares titles and required flags. Exit code 3 means the read-back failed.
5. External respondents approved: `python scripts/build_form.py spec.json --only-share <form id>` (sets "anyone can respond", turns on a short URL, opens it in a cookie-less context). Report `anonymousOk`.
6. Report the response URL (short URL when it exists), the sharing scope, and what was not checked (no test submission is made). Then `browser_session.ps1 -Action Stop`. If more edits are likely (user is still iterating on wording or questions), keep the session running and stop it only at the end: every `Start` uses a fresh profile, so each restart costs the user another sign-in.

Run Python Playwright from an interpreter that has it installed; set `PYTHONUTF8=1` and write Japanese output to a UTF-8 file, because the PowerShell pipe garbles it.

## spec.json

```json
{ "title": "...", "description": ["line 1", "line 2"],
  "questions": [
    {"type": "text", "title": "お名前", "required": true},
    {"type": "choice", "title": "...", "multiple": true, "required": false, "options": ["A", "B"], "other": true},
    {"type": "text", "title": "自由記述", "long": true, "required": false} ] }
```

`assets/spec.example.json` is a runnable sample. Put examples inside the question title, for example "(例: ...)": the subtitle control is not scripted.

## Gotchas That Cost a Rerun

- Every typing step must select-all first, or a resumed run appends a second copy of the text.
- Match type tiles with exact names: collapsed question cards also contain "テキスト".
- Added options come pre-filled ("オプション 3"); a plain option named "その他" is not the free-text "Other".
- New questions inherit the previous required switch; the script sets it explicitly.
- Leaving the page right after the last edit can lose it. The header can already read "保存済み" before a new edit registers, so after changing text wait with `wait_saved(page, expect=<snippet of the new text>)`, then reopen and verify (an existing form's description edit was lost this way).
- The built-in "Other" must be added after the other options; it always renders last.

More selectors, failure signatures and the delete recipe: [UI notes](https://skilld.dev/api/skills-raw/aktsmm/agent-skills/microsoft-forms-builder/references/ui-notes.md).

## Done Criteria

- [ ] Question titles, types, options and required flags match the spec after the editor was closed and reopened.
- [ ] Sharing scope reported; external scope only with the user's approval, with `anonymousOk: true`.
- [ ] The response link was opened in a cookie-less context and showed the title and question count.
- [ ] The owned browser and its profile are removed; any test form created by this run is deleted.
- [ ] Unverified items are stated: English UI, question types beyond text/choice, a real test submission.