# town.chalky.task

> Published by [chalky.town](https://lexicon.garden/identity/did:plc:mthv22lb4hhaxupzjnqvijwk)

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mthv22lb4hhaxupzjnqvijwk/town.chalky.task)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mthv22lb4hhaxupzjnqvijwk/town.chalky.task/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mthv22lb4hhaxupzjnqvijwk/town.chalky.task/examples)

## Definitions

### `town.chalky.task`

**Type**: `record`

A single task in a chalky.town weekly planner. Stored in the author's repo. Field names mirror app.attodo.task where the concept is shared (title/description/completed/completedAt and the rec* recurrence fields); chalky-specific fields (day, order, color, subtasks, updatedAt) extend it. A recurring task is a template that projects occurrences onto later matching days; per-occurrence state (done/skipped) lives in separate town.chalky.occurrence records that reference this one.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `day` | `string` | No | Local calendar day the task sits on, as YYYY-MM-DD. Omit for the Someday bucket. |
| `color` | `string` | No |  |
| `order` | `integer` | Yes | Fractional-ish sort key within a day; lower sorts higher. |
| `title` | `string` | Yes | The task title. May contain inline Markdown (links and emphasis); clients that don't render Markdown can show it as plain text. |
| `recCount` | `integer` | No | Optional: end the series after this many occurrences, counted from the anchor (inclusive). |
| `recUntil` | `string` | No | Optional last occurrence day (YYYY-MM-DD), inclusive. Set directly or kept in sync as the concrete stop date when recCount is used. |
| `subtasks` | `array` | No |  |
| `completed` | `boolean` | Yes |  |
| `createdAt` | `string` (datetime) | Yes |  |
| `updatedAt` | `string` (datetime) | Yes | Last local edit; used as the last-write-wins clock during sync. |
| `recByMonth` | `integer` | No | Yearly only: the month (1=January … 12=December). Omitted means the anchor's month. |
| `recMonthly` | `string` | No | Monthly & yearly: land on the calendar date-of-month ("day") or the anchor's nth weekday ("weekday", e.g. the 2nd Friday). Omitted means "day". |
| `completedAt` | `string` (datetime) | No | When `completed` last flipped to true (non-recurring tasks only; recurring tasks track per-occurrence completion in completedDates). |
| `description` | `string` | No | Optional longer notes. May contain block-level Markdown (headings, lists, links, code, etc.); clients that don't render Markdown can show it as plain text. |
| `isRecurring` | `boolean` | No | Whether this task is a recurring template. |
| `recInterval` | `integer` | No | Recur every N frequency units (e.g. every 2 weeks). |
| `recByWeekday` | `array` | No | Weekly only: weekdays the series lands on (0=Sunday … 6=Saturday). Omitted means just the anchor day's weekday. |
| `recFrequency` | `string` | No | How often the task recurs. |
| `recByMonthDay` | `integer` | No | Monthly & yearly "day" mode: the date-of-month. Omitted means the anchor's date. Months without this day are skipped. |

### `town.chalky.task#subtask`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes |  |
| `done` | `boolean` | Yes |  |
| `text` | `string` | Yes |  |
| `completedAt` | `string` (datetime) | No | When `done` last flipped to true. Used to order completed subtasks by completion time. |

## Raw Schema

```json
{
  "id": "town.chalky.task",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "title",
          "completed",
          "order",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "day": {
            "type": "string",
            "description": "Local calendar day the task sits on, as YYYY-MM-DD. Omit for the Someday bucket."
          },
          "color": {
            "type": "string",
            "knownValues": [
              "salmon",
              "chardonnay",
              "witch-haze",
              "mint-green",
              "melrose"
            ]
          },
          "order": {
            "type": "integer",
            "description": "Fractional-ish sort key within a day; lower sorts higher."
          },
          "title": {
            "type": "string",
            "maxLength": 500,
            "description": "The task title. May contain inline Markdown (links and emphasis); clients that don't render Markdown can show it as plain text."
          },
          "recCount": {
            "type": "integer",
            "minimum": 1,
            "description": "Optional: end the series after this many occurrences, counted from the anchor (inclusive)."
          },
          "recUntil": {
            "type": "string",
            "description": "Optional last occurrence day (YYYY-MM-DD), inclusive. Set directly or kept in sync as the concrete stop date when recCount is used."
          },
          "subtasks": {
            "type": "array",
            "items": {
              "ref": "#subtask",
              "type": "ref"
            }
          },
          "completed": {
            "type": "boolean",
            "default": false
          },
          "createdAt": {
            "type": "string",
            "format": "datetime"
          },
          "updatedAt": {
            "type": "string",
            "format": "datetime",
            "description": "Last local edit; used as the last-write-wins clock during sync."
          },
          "recByMonth": {
            "type": "integer",
            "maximum": 12,
            "minimum": 1,
            "description": "Yearly only: the month (1=January … 12=December). Omitted means the anchor's month."
          },
          "recMonthly": {
            "enum": [
              "day",
              "weekday"
            ],
            "type": "string",
            "description": "Monthly & yearly: land on the calendar date-of-month (\"day\") or the anchor's nth weekday (\"weekday\", e.g. the 2nd Friday). Omitted means \"day\"."
          },
          "completedAt": {
            "type": "string",
            "format": "datetime",
            "description": "When `completed` last flipped to true (non-recurring tasks only; recurring tasks track per-occurrence completion in completedDates)."
          },
          "description": {
            "type": "string",
            "maxLength": 3000,
            "description": "Optional longer notes. May contain block-level Markdown (headings, lists, links, code, etc.); clients that don't render Markdown can show it as plain text."
          },
          "isRecurring": {
            "type": "boolean",
            "default": false,
            "description": "Whether this task is a recurring template."
          },
          "recInterval": {
            "type": "integer",
            "minimum": 1,
            "description": "Recur every N frequency units (e.g. every 2 weeks)."
          },
          "recByWeekday": {
            "type": "array",
            "items": {
              "type": "integer",
              "maximum": 6,
              "minimum": 0
            },
            "description": "Weekly only: weekdays the series lands on (0=Sunday … 6=Saturday). Omitted means just the anchor day's weekday."
          },
          "recFrequency": {
            "enum": [
              "daily",
              "weekly",
              "monthly",
              "yearly"
            ],
            "type": "string",
            "description": "How often the task recurs."
          },
          "recByMonthDay": {
            "type": "integer",
            "maximum": 31,
            "minimum": 1,
            "description": "Monthly & yearly \"day\" mode: the date-of-month. Omitted means the anchor's date. Months without this day are skipped."
          }
        }
      },
      "description": "A single task in a chalky.town weekly planner. Stored in the author's repo. Field names mirror app.attodo.task where the concept is shared (title/description/completed/completedAt and the rec* recurrence fields); chalky-specific fields (day, order, color, subtasks, updatedAt) extend it. A recurring task is a template that projects occurrences onto later matching days; per-occurrence state (done/skipped) lives in separate town.chalky.occurrence records that reference this one."
    },
    "subtask": {
      "type": "object",
      "required": [
        "id",
        "text",
        "done"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "done": {
          "type": "boolean",
          "default": false
        },
        "text": {
          "type": "string",
          "maxLength": 500
        },
        "completedAt": {
          "type": "string",
          "format": "datetime",
          "description": "When `done` last flipped to true. Used to order completed subtasks by completion time."
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
