بنقرة واحدة
service-creator
Guide for creating background monitoring services that can proactively notify users
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Guide for creating background monitoring services that can proactively notify users
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | Service Creator |
| description | Guide for creating background monitoring services that can proactively notify users |
This skill guides you on how to create background services that monitor data and proactively notify users.
Reference documents directory: {{SKILL_DIR}}/reference/
When you need detailed information on a specific topic below, use read_file to load the corresponding reference document. Do NOT read all references upfront — only load what you need for the current step.
| Reference File | When to Read |
|---|---|
reference/architecture.md | Before designing a new service's filtering logic |
reference/dry-run.md | When implementing dry run mode or verifying dry run output |
reference/modification.md | When modifying an existing service |
reference/guidelines.md | For best practices and example conversations |
reference/templates-minimal.md | When writing service code (recommended starting point) |
reference/templates-stock-monitor.md | When building a data-monitoring service with local filtering |
reference/templates-python-monitor.md | When building a Python monitoring service |
reference/templates-reminder.md | When building a reminder/time-based service |
Create a service when the user asks you to:
Examples of user requests:
Services use a two-layer filtering pattern: Local Rules Filter → Invoke API (LLM Evaluation).
Read reference/architecture.md for full details when designing filter logic.
When you call service_create, the system automatically checks if the required runtime (Node.js or Python) is available. If not available, the tool returns an error.
When runtime is missing:
brew install node / brew install python3) - no sudo neededservice_createNote: You cannot use sudo or su commands as they require password interaction. Only use installation methods that work without elevated privileges.
Use the service_create tool with:
name: Human-readable namedescription: What the service doestype: Choose based on whether the task has a definite end:
"longRunning": Never exits, runs indefinitely (e.g., "monitor stock price every 30s", "wake me up every day at 8am", "send weekly report every Monday")"scheduled": Completes and exits after task is done (e.g., "remind me at 4:30pm today", "remind me to drink water 3 times", "notify me tomorrow morning")runtime: "node" or "python"entryFile: Entry file name (e.g., "index.js" or "main.py")schedule: For scheduled services, interval like "*/5" (every 5 minutes)userRequest: The user's original request (verbatim)expectation: What should trigger a notificationAfter creating the service, write the code to the returned servicePath.
Before writing code: Read reference/templates-minimal.md for the recommended pattern. For more complex scenarios, read the appropriate full template.
Pre-built invoke helper: The service_create tool automatically generates an invoke helper file in the service directory:
invoke.js — use const { invoke, dryRunResult, DRY_RUN, SERVICE_ID } = require('./invoke');invoke.py — use from invoke import invoke, dry_run_result, DRY_RUN, SERVICE_IDInvoke API uses named parameters (NOT positional args):
await invoke({ context: CONTEXT, summary: '...', details: '...', metadata: {} })invoke(context=CONTEXT, summary='...', details='...', metadata={})This eliminates the need to copy-paste the invoke boilerplate. Just import and use it.
CRITICAL: Service Code Requirements
longRunning: Never exit - keep running indefinitely with setIntervalscheduled: Exit with process.exit(0) after task completion (e.g., reminder sent, N executions done)./invoke instead of writing your own HTTP clientreference/dry-run.md for the specification and patterns.IMPORTANT: Use setInterval() (Node.js) or loops (Python) to keep the service running. For scheduled type, call process.exit(0) when the task is complete.
After writing the service code, you MUST run service_dry_run to verify it works. Read reference/dry-run.md for full verification criteria, iteration rules, and failure handling.
Only after a successful dry run, use service_start with the serviceId to start the service.
When modifying a service, read reference/modification.md first — it describes the critical synchronization rules between code, CONTEXT, and service.json.
service_create - Create a new serviceservice_dry_run - Run a service in dry-run mode to verify it works (MANDATORY before starting)service_list - List all services and their statusservice_start - Start a service (only after successful dry run)service_stop - Stop a serviceservice_delete - Delete a serviceservice_get_info - Get detailed service information