tv-calendar
GitHub用于生成自包含的HTML周日历组件,指导如何嵌入CSS/JS资源、构建标记及处理事件属性。
Trigger Scenarios
Install
npx skills add telepath-computer/television --skill tv-calendar -g -y
SKILL.md
Frontmatter
{
"name": "tv-calendar",
"description": "Author self-contained HTML calendar artifacts using the bundled calendar-week elements and copied calendar assets."
}
Authoring a calendar week
Know the main television skill first. Re-read it only if it is not already in your context or you know it changed. It defines the general Television workflow, path artifact registration, and the canonical HTML house style. This skill only adds calendar-specific guidance.
A working-week calendar with a generated header strip, all-day band, time axis,
and timed event grid. The agent only authors a single <calendar-week> plus
flat sibling <calendar-event> children. The component renders the rest.
Required assets
Every calendar artifact must be self-contained. Read calendar.css and
calendar.js from this skill folder and carry them into the artifact output
instead of referencing /skills/tv-calendar/... URLs.
For a Television HTML directory artifact, copy both files into the registered directory next to index.html and reference them relatively:
<link rel="stylesheet" href="/canonical/v2/styles.css?authoredForAppVersion=<version>" />
<link rel="stylesheet" href="./calendar.css" />
<script type="module" src="./calendar.js"></script>
For a running server, read the exact release version from tv status; when working in a Television checkout, read the exact version from the checkout root package.json. Copy that exact release version unchanged into authoredForAppVersion. A missing version or the 0.0.0 development sentinel does not identify a release, so omit the metadata.
For a standalone single-file HTML artifact, inline the contents of
calendar.css and calendar.js directly into <style> and
<script type="module"> tags so the output stays self-contained.
calendar.js registers the custom elements. calendar.css provides the
calendar-specific chrome styling. Do not reimplement those elements yourself.
Markup contract
Author exactly this surface:
<calendar-week start-date="YYYY-MM-DD" days="N" start-hour="8">
<calendar-event title="..." start="..." end="..." color="blue"></calendar-event>
<calendar-event title="..." start="..." end="..." all-day color="purple"></calendar-event>
</calendar-week>
<calendar-week> attributes:
start-dateis required and must be a realYYYY-MM-DDdate.daysis required and should usually be5or7.start-houris optional. Omit it unless you need a fixed initial scroll position.
<calendar-event> attributes:
titleis required.startis required.endis required.all-dayis optional and presence-only. Use it only for all-day events.coloris optional. Allowed values:red,orange,yellow,green,blue,purple.
Timed vs. all-day events
Timed events:
- Omit
all-day. - Use
YYYY-MM-DDTHH:MMwall-clock datetimes for bothstartandend. - Keep each event within a single day.
All-day events:
- Include
all-day. - Use date-only
YYYY-MM-DDvalues for bothstartandend. endis non-inclusive, following RFC 5545.
What the component auto-renders
Do not author any of these directly:
<calendar-headers><calendar-day><calendar-allday><calendar-grid><calendar-time-axis><calendar-column><calendar-cell>
Behavior to rely on
- all-day events clip silently to the visible range
- all-day events stack into lanes automatically when their visible spans overlap
- timed events on the same day cascade to the right when their time ranges overlap
- malformed events are silently dropped
Content guidance
- make the schedule feel real
- vary event titles and durations
- use the color palette intentionally
- avoid placeholder text like "Event 1"
Version History
- a8e73fb Current 2026-10-18 15:28


