> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openclix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflow

> Recommended agent-based mobile app retention and engagement automation workflow.

## 1. Integrate with `openclix-init`

`openclix-init`:

* Detects platform (Expo/RN/Flutter/iOS/Android)
* Detects pre-existing local notification paths outside OpenClix
* Classifies detected notification paths as migration-capable or keep-as-is
* Asks whether to migrate supported notification flows or keep the existing implementation unchanged
* Defaults to keeping existing local notifications unless migration is explicitly requested
* Copies local-source templates into your repo
* Wires minimal initialization/event/lifecycle touchpoints
* Reuses existing dependencies where possible
* Runs platform-appropriate build/analyze verification

## 2. Generate config with `openclix-design-campaigns`

`openclix-design-campaigns`:

* Creates a structured campaign planning profile
* Designs lifecycle campaigns (onboarding/habit/re-engagement/milestone/feature discovery)
* Produces schema-valid config (`openclix/config/v1`)

Expected output:

* `.openclix/campaigns/app-profile.json`
* `.openclix/campaigns/openclix-config.json`

## 3. Measure impact with `openclix-analytics`

`openclix-analytics`:

* Detects provider: Firebase > PostHog > Mixpanel > Amplitude
* Wires OpenClix event forwarding with `openclix_*` properties
* Produces pre/post impact artifacts for retention + engagement

Expected output:

* `.openclix/analytics/impact-metrics.json`
* `.openclix/analytics/impact-report.md`

## 4. Sync source integration when template baseline changes

`openclix-update`:

* Detects template drift in your existing OpenClix integration
* Proposes per-file updates while preserving custom code areas when markers exist
* Offers conflict reporting for files requiring manual review
* Keeps `openclix-update-campaigns` focused on campaign recommendations only

```bash theme={null}
bash skills/openclix-update/scripts/detect_integration.sh --root <target-project-root>
bash skills/openclix-update/scripts/plan_sync.sh --root <target-project-root> --plan .openclix/openclix-update/openclix-update-plan.json
bash skills/openclix-update/scripts/apply_sync.sh --root <target-project-root> --plan .openclix/openclix-update/openclix-update-plan.json --apply
bash skills/openclix-update/scripts/report.sh --plan .openclix/openclix-update/openclix-update-plan.json
```

Expected output:

* `.openclix/openclix-update/openclix-update-plan.json`
* `.openclix/openclix-update/openclix-update-apply.json`
* `.openclix/openclix-update/openclix-update-report.md`

## 5. Draft campaign operations with `openclix-update-campaigns`

`openclix-update-campaigns`:

* Reads impact + campaign metrics and evaluates per-campaign actions.
* Produces `openclix-config.next.json` without mutating active config.
* Keeps apply behind explicit confirmation.

Expected output:

* `.openclix/campaigns/update-recommendations.json`
* `.openclix/campaigns/openclix-config.next.json`

## 6. Run agent retention operations with `retention_ops_automation.sh`

Use the helper script when you want OpenClaw, Claude Code, and/or Codex prompts generated from the latest OpenClix artifacts.

```bash theme={null}
bash scripts/retention_ops_automation.sh \
  --root <target-project-root> \
  --agent all \
  --delivery-mode auto \
  --dry-run
```

Run from the OpenClix repository root, or use an absolute script path if you are currently inside a different project directory.

Expected output:

* `.openclix/automation/run-summary.json`
* `.openclix/automation/prompts/openclaw.md`
* `.openclix/automation/prompts/claude-code.md`
* `.openclix/automation/prompts/codex.md`

## 7. Maintain Claude plugin registration

Keep Claude Code marketplace metadata current as OpenClix evolves:

```bash theme={null}
claude plugin marketplace update openclix
claude plugin update openclix@openclix
```

Validate plugin manifests before cutting a release:

```bash theme={null}
bash scripts/validate_claude_plugin.sh
```

Release rule:

* Keep `.claude-plugin/plugin.json` `version`,
  `.claude-plugin/marketplace.json` `metadata.version`,
  and `.claude-plugin/marketplace.json` `plugins[0].version` aligned.
* Keep `.claude-plugin/marketplace.json` `plugins[0].source` as `./` so plugin installs resolve from the same marketplace checkout.

Next: [Agent-based mobile app retention automation guide](/guides/agent-retention-automation)
