# Diet Pattern Detection

> One-time diet pattern analysis. Runs via daily cron after onboarding, checks if user's actual eating pattern matches a different diet mode. Self-destructs after successful execution. NOT user-triggered — cron-only.

- **Type:** Skill
- **Install:** `agentstack add skill-nanorhino-weight-loss-skill-diet-pattern-detection`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [NanoRhino](https://agentstack.voostack.com/s/nanorhino)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [NanoRhino](https://github.com/NanoRhino)
- **Source:** https://github.com/NanoRhino/weight-loss-skill/tree/main/diet-pattern-detection
- **Website:** https://nanorhino.com/

## Install

```sh
agentstack add skill-nanorhino-weight-loss-skill-diet-pattern-detection
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Diet Pattern Detection

> ⚠️ **Cron-only skill.** Never triggered by user messages. Activated by a daily cron job created by `notification-manager` at onboarding completion.

## ⚠️ Output Format (HARD RULE — Never violate)

When this skill sends a message to the user (diet pattern detection result, mode switch suggestion, or any output), the **first line MUST** be the section banner based on user locale:

| USER.md locale | First line |
|---|---|
| `zh` / `zh-CN` / `zh-TW` / unset | `🔄——饮食模式调整——🔄` |
| `en` / `en-*` | `🔄——Diet Mode Adjustment——🔄` |

Then **one blank line**, then the message body.

✅ Correct (Chinese user):
```
🔄——饮食模式调整——🔄

📋 我注意到一个有趣的现象...
```

❌ Wrong — missing banner, or banner not on first line, or no blank line after banner.

## Trigger

Daily cron job. Start date: `Onboarding Completed` + 3 days (from `health-profile.md > Automation`). Cron time: dinner_time + 3h.

## Workflow

1. **Check precondition** — read `health-profile.md > Automation > Pattern Detection Completed`. If already has a date → skip (should not happen, but defensive).

2. **Run detection** (handles data sufficiency check internally):
   ```bash
   python3 {baseDir}/scripts/detect-pattern.py \
     --data-dir {workspaceDir}/data/meals \
     --current-mode  Diet Config > Diet Mode> \
     --weight  \
     --target-weight 
   ```
   If result has `reason: "insufficient_data"` ( Diet Config > Diet Mode` and recalculate targets.
   - `has_pattern: false` → no message (pattern matches current mode, all good).

4. **Self-destruct** (when result is `has_pattern` true or false, NOT insufficient_data):
   1. List current agent's cron jobs (`cron list`)
   2. Find job with name containing "diet-pattern" or "Diet pattern"
   3. Delete it (`cron remove`)
   4. Write completion date to `health-profile.md > Automation > Pattern Detection Completed: `

## Reference Files

- `references/diet-pattern-response.md` — user notification template (when pattern detected)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [NanoRhino](https://github.com/NanoRhino)
- **Source:** [NanoRhino/weight-loss-skill](https://github.com/NanoRhino/weight-loss-skill)
- **License:** MIT
- **Homepage:** https://nanorhino.com/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-nanorhino-weight-loss-skill-diet-pattern-detection
- Seller: https://agentstack.voostack.com/s/nanorhino
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
