openclix-campaign-design
npx skills add https://github.com/openclix/openclix --skill openclix-campaign-design
Agent 安装分布
Skill 文档
OpenClix Campaign Design
Turn campaign goals into schema-valid OpenClix config JSON with minimal ambiguity. Keep outputs auditable and compatible with the OpenClix runtime contract. When the user asks for implementation, install the final config JSON into app resources and wire runtime initialization code.
Workflow
Follow these phases in order.
- Collect campaign context.
- Build or refresh an app profile artifact.
- Design campaign set.
- Generate or update OpenClix config.
- Validate and hand off.
- Install config resource and wire app initialization.
1) Collect Campaign Context
Gather only missing facts needed for design decisions:
- app name and platform(s)
- primary retention goals (onboarding, habit, re-engagement, milestone, feature discovery)
- event taxonomy: event names + available property keys
- current campaign config path (if existing)
- existing app resource/file management convention for JSON assets
- startup location where Clix is currently initialized (or should be initialized)
- global constraints: quiet hours, frequency cap expectations, locale/timezone assumptions
If the user already provided enough detail, do not re-ask resolved points.
2) Build Or Refresh App Profile Artifact
Before authoring campaigns:
- Read
references/json-schemas.md. - Read
references/schemas/app-profile.schema.json. - Create or update
.clix-campaigns/app-profile.json. - Capture goals, event taxonomy, personalization variables, existing campaigns, and constraints.
- Present the JSON and confirm accuracy before proceeding.
3) Design Campaign Set
Before drafting campaigns:
- Read
references/openclix-campaign-playbook.md.
Design 3-5 campaigns unless the user requests a different count. Spread campaigns across lifecycle stages or explicit user priorities.
OpenClix modeling rule:
- One campaign delivers one message.
- Model multi-step journeys as multiple related campaign IDs (for example
onboarding-step-1,onboarding-step-2,onboarding-step-3).
Trigger selection rule:
- Use
eventfor behavior-driven messaging. - Use
scheduledfor one-time date/time delivery. - Use
recurringfor repeated cadence.
Suppression and cancellation rule:
- Use
delay_seconds+cancel_eventfor pending enrollment cancellation when behavior can invalidate intent. - Use global
settings.do_not_disturbandsettings.frequency_capwhen needed.
Content rule:
- Use only known personalization keys with
{{key}}syntax. - Keep schema-safe limits: title <= 120, body <= 500.
- Prefer concise UX copy (title <= 45, body <= 140) unless user needs longer copy.
4) Generate Or Update OpenClix Config
Before writing config:
- Read
references/schemas/openclix.schema.json.
Write updates in this order:
- Update the user-specified config path if provided.
- Otherwise write
.clix-campaigns/openclix-config.json.
Guarantee these invariants:
schema_versionis exactlyopenclix/config/v1.config_versionis explicit and traceable.- Campaign IDs are kebab-case.
- Campaign
typeiscampaign. - Campaign
statusisrunningorpaused. - Trigger-specific required fields are present.
- No unknown fields are introduced.
When editing existing config, keep diffs minimal and preserve unrelated campaigns.
5) Validate And Hand Off
Run structural checks on each output JSON file:
jq . <file>
When a JSON Schema validator is available, validate against:
references/schemas/app-profile.schema.jsonfor app profilesreferences/schemas/openclix.schema.jsonfor config files
Report at handoff:
- output file paths
- campaign IDs and intent
- key assumptions
- unresolved gaps requiring user input
6) Install Config Resource And Wire App Initialization
When the user requests code integration, do not stop at JSON generation. Install the produced config into the app project and wire runtime loading.
Before editing app code:
- Inspect how the target project already stores JSON resources/assets.
- Follow existing conventions for directory, naming, and startup wiring.
- If Clix client is not integrated yet, run
openclix-initfirst.
Integration requirements:
- Copy final config JSON into a resource location consistent with the app:
- React Native / Expo: existing
assets/or project resource pattern. - Flutter: asset path already used by the app and declared in
pubspec.yaml. - iOS: bundle resource location already used by the app target.
- Android: existing
assets/orres/rawpattern used by the app.
- React Native / Expo: existing
- Keep filename stable unless project convention requires a different name.
- Update app startup code so Clix is initialized and then receives the local config.
- Load JSON from the resource file, parse into OpenClix
Config, then callClixCampaignManager.replaceConfig(...). - Run platform build/analysis checks after wiring.
Critical runtime note:
Clix.initialize(...)auto-fetches config only for HTTP(S) endpoints.- For in-app resource JSON, always load and apply config explicitly via
ClixCampaignManager.replaceConfig(...)after initialization.
Completion requirements for implementation tasks:
- resource file path reported
- modified startup/init file paths reported
- confirmation that local resource config is applied at runtime
Design Guardrails
- Do not invent event names that conflict with provided taxonomy.
- Prefer explicit condition rules (
field: "name"andfield: "property") over vague matching. - Default to
connector: "and"; useoronly with explicit rationale. - Include
weekly_rule.days_of_weekwhenever recurrence type isweekly. - Use global quiet-hour controls before introducing ad-hoc per-campaign windows.
- Do not rely on non-HTTP endpoints being auto-loaded by
Clix.initialize(...). - For local JSON delivery, always wire explicit resource load +
ClixCampaignManager.replaceConfig(...). - Keep integration edits minimal and aligned with existing project structure.
Resources
references/json-schemas.md: planning + config structures and examples.references/openclix-campaign-playbook.md: trigger strategy and campaign decomposition.references/schemas/app-profile.schema.json: app profile schema.references/schemas/openclix.schema.json: canonical OpenClix schema used by this skill.