poll-builder

Self-hosted poll creation tool with real-time results. Use when you need to create a poll, check vote counts, close a poll, export results, or get the shareable link for a poll. Triggers include "create poll", "vote", "poll results", "survey", "collect votes", "share poll", or any task involving polling or voting.

7 stars

Best use case

poll-builder is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Self-hosted poll creation tool with real-time results. Use when you need to create a poll, check vote counts, close a poll, export results, or get the shareable link for a poll. Triggers include "create poll", "vote", "poll results", "survey", "collect votes", "share poll", or any task involving polling or voting.

Teams using poll-builder should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/poll-builder/SKILL.md --create-dirs "https://raw.githubusercontent.com/heldernoid/agentic-build-templates/main/projects/web-applications/poll-builder/skills/poll-builder/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/poll-builder/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How poll-builder Compares

Feature / Agentpoll-builderStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Self-hosted poll creation tool with real-time results. Use when you need to create a poll, check vote counts, close a poll, export results, or get the shareable link for a poll. Triggers include "create poll", "vote", "poll results", "survey", "collect votes", "share poll", or any task involving polling or voting.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# poll-builder

Create polls, share via link, see live results. Self-hosted.

## Base URL

```
http://localhost:3000
```

## Quick Reference

### Create a poll

```bash
curl -X POST http://localhost:3000/api/polls \
  -H "Content-Type: application/json" \
  -d '{
    "title": "What should we build next?",
    "description": "Vote for the next feature",
    "type": "single",
    "options": ["Mobile app", "API improvements", "Better docs", "Admin dashboard"],
    "endsAt": "2026-03-25T23:59:00Z"
  }'
# Response includes: id, slug, shareUrl
```

### Get all polls

```bash
curl http://localhost:3000/api/polls
```

### Get poll results

```bash
curl http://localhost:3000/api/polls/1/results
# Returns per-option vote counts and percentages
```

### Get public poll (for voting)

```bash
curl http://localhost:3000/api/p/k9xm2q4r
```

### Submit a vote

```bash
curl -X POST http://localhost:3000/api/p/k9xm2q4r/vote \
  -H "Content-Type: application/json" \
  -d '{"optionIds": [1]}'
# Multi-choice: "optionIds": [1, 3]
```

### Close a poll

```bash
curl -X PATCH http://localhost:3000/api/polls/1/close
```

### Export as CSV

```bash
curl http://localhost:3000/api/polls/1/export.csv > results.csv
```

## API Reference

### Admin

| Method | Path | Description |
|---|---|---|
| GET | /api/polls | List all polls with vote counts |
| GET | /api/polls/:id | Poll detail + options + results |
| POST | /api/polls | Create poll |
| PUT | /api/polls/:id | Update poll |
| DELETE | /api/polls/:id | Delete poll and all votes |
| PATCH | /api/polls/:id/close | Close poll |
| PATCH | /api/polls/:id/reopen | Reopen closed poll |
| GET | /api/polls/:id/results | Detailed results |
| GET | /api/polls/:id/export.csv | CSV download |

### Public

| Method | Path | Description |
|---|---|---|
| GET | /api/p/:slug | Public poll data |
| POST | /api/p/:slug/vote | Submit vote |
| GET | /api/p/:slug/results | Public results |

## Poll Object

```typescript
{
  id: number
  slug: string                  // 8-char shareable ID, e.g. "k9xm2q4r"
  title: string
  description: string | null
  type: "single" | "multiple"
  status: "open" | "closed"
  maxVoters: number | null       // null = unlimited
  endsAt: string | null          // ISO 8601
  requireName: boolean
  allowComments: boolean
  shareUrl: string               // full URL for sharing
  options: PollOption[]
  totalVotes: number
  createdAt: string
}
```

## Vote Errors

| Error | Meaning |
|---|---|
| `already_voted` | This voter already voted in this poll |
| `poll_closed` | Poll is closed, no more votes accepted |
| `max_voters_reached` | Voter limit has been hit |
| `invalid_option` | Provided option ID does not belong to this poll |
| `too_many_options` | Multi-choice max exceeded |

## WebSocket

Connect to `ws://localhost:3000/ws` to receive live updates:

```json
// Subscribe
{ "type": "subscribe", "slug": "k9xm2q4r" }

// Server broadcasts on each vote
{
  "type": "update",
  "slug": "k9xm2q4r",
  "results": [
    { "optionId": 1, "text": "Mobile app", "votes": 396, "pct": 48.1 }
  ],
  "totalVotes": 824
}
```

## Environment Variables

| Variable | Description | Default |
|---|---|---|
| PORT | Server port | 3000 |
| DATA_DIR | SQLite directory | ./data |
| BASE_URL | Public URL for share links | http://localhost:3000 |
| LOG_LEVEL | debug/info/warn/error | info |