This skill provides the automated setup for a lightweight, build-less web dashboard. It relies entirely on Alpine.js for state management and Vanilla CSS for styling. It eschews complex frameworks (like SvelteKit) and utility-class libraries in favor of a "Single-Scroll Artifact" or a "Static Triad".
This dashboard is designed fundamentally as a local, private interface. By default, it runs on localhost using a Python server, granting it safe access to the user's private data, local agent memory (memory.gz), and enabling interactive features like a Chat Envoy that triggers local agent shell commands, as well as a local-only File Browser for exploring the Fulcra file store.
Crucially: The local application and its sensitive capabilities must NEVER be published to the public internet directly. If the user wishes to share a dashboard, you must generate a separate, sanitized export that strips out the Python backend, interactive agent features, and unapproved private data.
When constructing this dashboard, you MUST follow these strict architectural rules to prevent the file from becoming a tangled, unmaintainable monolith:
```html
```
x-data="{ huge object }"). You must use Alpine.data() within the "Alpine.js State & Logic" province to extract the logic into a clean script block. The HTML should only contain the bindings (x-data="dashboard()", x-text, x-show, etc.).index.html is preferred, if the dashboard grows too vast, you may split it into three files:index.html (Structure & Semantic HTML)app.js (Alpine Alpine.data() and D3 functions)styles.css (Custom overriding aesthetics)No build step is allowed.
When a user requests to "set up the web app" or "create a dashboard for the Fulcra skills" (or if they are transitioning from the fulcra-onboarding skill), you should execute the setup script provided by this skill.
# Run the setup script to scaffold the Alpine dashboard
./scripts/setup-dashboard.sh <target-directory>
If no is provided, it defaults to creating a fulcra-dashboard folder in the current working directory.
Contextual Awareness (Standalone vs. Post-Onboarding):
Do not assume this skill is always run immediately after fulcra-onboarding.
uv tool run fulcra-api catalog to check for user annotations and discuss options before proceeding).fulcra-api CLI. uv tool run fulcra-api catalog to discover available data. CRITICAL: Prioritize user-configured data over passive metrics (like step count). Explicitly filter for items where categories includes "user_configured", or where the id follows the format *Annotation/ (e.g., ScaleAnnotation/1234-abcd...).uv tool run fulcra-api get-records "ScaleAnnotation/" "30 days" > timeline_name.jsonl ).data.json timelines array so your background work is visualized alongside their personal data.RecordsProcessed metric for the timeline (e.g., uv tool run fulcra-api get-records "RecordsProcessed" "30 days" > records_processed.jsonl) to populate the Data Velocity chart. Do not skip this step or set it to null.data.json config file acts as a manifest. It should map your layout to the .jsonl files you downloaded, and you must include the annotation description in the timeline block, like this: {"summary": "A concise overview of the current data and recent activity...", "timelines": [{"id": "...", "title": "...", "description": "The description from the catalog...", "icon": "...", "color": "...", "data": "timeline_name.jsonl"}], "recordsProcessed": "records_processed.jsonl"}. Crucial: For the "summary" field, you MUST read the downloaded .jsonl data and write a short, personalized text summary of the actual real-world activity shown in the data (e.g., "You've been consistently tracking your mood, with a slight dip this week"). Do not write meta-descriptions like "This is a retro dashboard.".jsonl files and aggregate records for the charts natively on init().index.html directly to rewrite the main title, subtitle, and all component headers to fit the theme (e.g., change "Fulcra Dashboard" to "The Cybernetic Core", "Records Processed" to "Baguettes Baked", and "Relay" to something thematically appropriate for the chat interface like "The Oracle's Ear" or "Comms Link"). Replace all default emojis (like 📊 or 🛰️) with theme-appropriate icons..dashboard-bento-grid layout that features a sticky left column and a flexible right column. Do not rewrite or remove the core structural HTML (e.g. .layout-container, .dashboard-bento-grid, .bento-col-left, .bento-col-right). When you edit the CSS, you must leave the structural grid properties (grid-template-columns, sticky positioning, flex directions) intact to prevent breaking the layout. Limit your CSS edits to colors (by updating the root variables), fonts, borders, box-shadows, and backgrounds.image_generate tool. Save it to the folder and reference it via an ![]()
tag in the dashboard header. Style Directive: The image must be extremely high-quality and perfectly cohesive with the user's chosen theme. Whether the vibe calls for retro 2D pixel art, a minimalist vector illustration, or a sleek 3D render, ensure the specific art style, color palette, and lighting strictly match the CSS variables and overall aesthetic you are building.backdrop-filter: blur() block for tech/modern themes, an ambient radial-gradient vignette for dark/moody themes). Additionally, the hero must not dominate the viewport. Keep it compact (e.g., min-height: 250px) so the core telemetry data is visible "above the fold."@keyframes in theme.css) that fits the theme (e.g., a floating asteroid, a blinking cursor, a buzzing fly) and attach it to the .animation-layer or other suitable elements.git is installed. Suggest 1 or 2 fun repository names based on their theme.git init && git add . && git commit -m "Initial commit"). Do not push to GitHub yet.```bash
cd
python3 server.py 8081 > dev.log 2>&1 &
```
public-export directory.public-export by copying the necessary components from the template-dashboard directory. CRITICAL: Do NOT include the Chat Envoy or the File Browser in the public HTML structure. The public dashboard must be strictly read-only..jsonl files) into public-export, and create a new, sanitized data.json referencing only those files. Copy over the app.js, theme.css, and required images, ensuring they do not contain sensitive local state.public-export directory.npm install -g surgesurge inside the public-export directory.gh (GitHub CLI) is installed and authenticated (gh auth status).public-export directory, initialize git, create the repository, and push (git init && git add . && git commit -m "Initial public export" && gh repo create --public --source=. --remote=origin --push ).gh api repos/{owner}/{repo}/pages -X POST -f "source[branch]=main" -f "source[path]=/".https://.github.io// .npm i -g vercelvercel deploy --prod inside the public-export directory.server.py) to analyze their data before sending it to the frontend.Connecting the Chat Envoy:
If the user asks you to "connect the chat envoy" (as prompted by the default placeholder error message in the dashboard), you must edit server.py to route messages and set up a polling mechanism.
🚨 SECURITY CONSIDERATION: We avoid having the web server execute shell commands directly (like triggering OpenClaw via subprocess) to prevent security audit flags and reduce RCE risks. Instead, the backend acts as a passive queue, and the agent polls it.
server.py to use a persistent chat.json file rather than an in-memory chat_history list.do_POST handler for /api/chat to simply record the new user message into chat.json and mark it as "unread".server.py (e.g., GET /api/chat/unread) that returns any unread messages from chat.json and simultaneously marks them as read./api/chat/unread endpoint periodically.cron tool, the model is invoked every time the cron triggers. To avoid burning tokens every 5 seconds, either use a longer interval (e.g., checking via HEARTBEAT.md every 30 minutes) or write an external bash script that loops every 5 seconds, checks the endpoint via curl, and ONLY invokes the agent via openclaw agent --to main --message ... when unread messages are found. Discuss these tradeoffs with the user before setting up the schedule.chat.json file for context, respond to the user's latest message, and append the response to chat.json as role 'assistant' with a timestamp.共 4 个版本