Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Automating Your Automations

CSecurity

Mine atuin history and shell logs to find repetitive workflows, build Rust CLI or bash automations. Use when analyzing command patterns or finding automation opportunities.

22 stars
0 votes
0 copies
0 views
Added 9/20/2026
toolsrustgoshellbashsqltestinggit

Works with

cli

Security Analysis

C73/100
highCreates or modifies cron jobs for persistent execution
criticalModifies startup scripts or system services for persistence

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add lev-os/agents --skill automating-your-automations --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Automating Your Automations?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Automating Your Automations
[![Security: C — Skills Directory](https://www.skillsdirectory.com/api/skills/lev-os-automating-your-automations/badge)](https://www.skillsdirectory.com/skills/lev-os-automating-your-automations)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: automating-your-automations
description: >-
  Mine atuin history and shell logs to find repetitive workflows, build
  Rust CLI or bash automations. Use when analyzing command patterns or
  finding automation opportunities.
---

<!-- TOC: Core Insight | The Loop | Mine | Score | Propose | Build | Anti-Patterns | References -->

# Automating Your Automations

> **Core Insight:** Your command history is a fossil record of automation opportunities. Every repeated multi-step workflow is a Rust CLI waiting to be born.

| Principle | Implication |
|-----------|-------------|
| **Frequency x Pain = Priority** | 3-command sequence 50x/week > 10-command sequence 1x/month |
| **Complex → Rust; simple → bash** | State, error handling, SQLite → Rust CLI. Glue → bash |

---

## The Loop (Mandatory)

```
1. MINE      → atuin DB, zsh_history, systemd timers, journalctl
2. CLUSTER   → semantic similarity + temporal adjacency
3. SCORE     → frequency × time_saved × error_rate
4. PROPOSE   → Rust CLI vs bash script vs alias vs systemd timer
5. BUILD     → /rust-cli-with-sqlite or bash in ~/.local/bin/
6. VALIDATE  → 5x run, --dry-run, --robot JSON, ≥3x faster
7. INSTALL   → systemd timer, shell alias, or PATH binary
```

**Never skip 1-3.** Intuition about what's repetitive is unreliable; data wins.

---

## Step 1: Mine

### Data Sources

| Source | Location | Unique Value |
|--------|----------|--------------|
| **Atuin DB** | `~/.atuin/history.db` | Duration, exit codes, cwd, session grouping |
| **zsh_history** | `~/.zsh_history` | Timestamps in extended format |
| **Systemd** | `~/.config/systemd/user/*.timer` | Existing automation to audit |
| **Journalctl** | `journalctl --user` | Failure patterns |
| **bash/git/cron** | `~/.bash_history`, `git log`, `crontab -l` | Fallback sources |

If `~/.atuin/history.db` is missing, check XDG-style paths such as `~/.local/share/atuin/history.db` before concluding Atuin is unavailable. If Atuin truly is unavailable, fall back to `~/.zsh_history` / `~/.bash_history` and downgrade confidence on timing/failure-rate scoring.

### Essential Atuin Queries

Open read-only: `sqlite3 -readonly ~/.atuin/history.db`

If that path does not exist, discover the DB first:

```bash
find ~ ~/.local/share -maxdepth 3 \( -name 'history.db' -o -name '*atuin*' \) 2>/dev/null
```

Atuin stores `timestamp` and `duration` in **nanoseconds**. Exit 0 = success.

```sql
-- Top repeated commands
SELECT command, COUNT(*) as cnt, AVG(duration)/1e9 as avg_sec,
       SUM(CASE WHEN exit != 0 THEN 1 ELSE 0 END) as fails
FROM history GROUP BY command HAVING cnt > 5 ORDER BY cnt DESC LIMIT 30;

-- Multi-step workflows (commands within 10s in same session/cwd)
SELECT h1.command as step1, h2.command as step2, COUNT(*) as pair_cnt
FROM history h1 JOIN history h2
  ON h2.timestamp BETWEEN h1.timestamp AND h1.timestamp + 10000000000
  AND h1.cwd = h2.cwd AND h1.session = h2.session AND h1.id != h2.id
GROUP BY step1, step2 HAVING pair_cnt > 3
ORDER BY pair_cnt DESC LIMIT 20;

-- High-failure commands (retry/guard candidates)
SELECT command, COUNT(*) as total,
       ROUND(100.0 * SUM(CASE WHEN exit != 0 THEN 1 ELSE 0 END) / COUNT(*), 1) as fail_pct
FROM history GROUP BY command HAVING total > 5 AND fail_pct > 20
ORDER BY total DESC LIMIT 20;
```

**Full cookbook (10 queries + export + analysis):** [ATUIN-QUERIES.md](references/ATUIN-QUERIES.md)

### THE EXACT PROMPT

```
Analyze my command history to find automation opportunities.

1. Query atuin DB: repeated commands, multi-step workflows,
   high-failure commands, time-of-day patterns, retry patterns
2. Inspect systemd user timers for gaps and silent failures
3. Score each pattern: frequency × time_saved × error_rate
4. Output top 10 candidates with: pattern, frequency, time estimate,
   recommended implementation (Rust/bash/alias/timer), complexity (S/M/L)
```

---

## Step 2: Score

| Factor | Weight | Source |
|--------|--------|--------|
| **Frequency** | 40% | `COUNT(*)` from atuin |
| **Time saved** | 30% | `AVG(duration) × frequency` |
| **Error rate** | 20% | `fail_pct` from atuin |
| **Simplicity** | 10% | Inverse of implementation complexity |

```
Score = freq_norm×0.4 + time_norm×0.3 + fail_norm×0.2 + simplicity_norm×0.1
```

Only automate if Score >= 0.3. **Expanded 5-factor formula with normalization:** [PATTERN-DETECTION.md](references/PATTERN-DETECTION.md)

---

## Step 3: Propose

```
Stateful? (remembers across runs)
├─ YES → Rust CLI + SQLite (/rust-cli-with-sqlite)
│  ├─ Scheduled? → systemd timer
│  └─ Interactive? → clap subcommands + --robot JSON
└─ NO
   ├─ >3 steps? → bash script → ~/.local/bin/
   ├─ Retry/guard? → bash wrapper + set -euo pipefail
   └─ Single command? → shell alias → ~/.zshrc.local
```

---

## Step 4: Build

**Rust CLIs** — every automation CLI must have:
- `--robot` / `--json` for machine output
- `--dry-run` for safe testing
- Non-zero exit codes on failure

Scaffold template: [RUST-SCAFFOLD.md](references/RUST-SCAFFOLD.md)

**Bash scripts** — always `set -euo pipefail`, install to `~/.local/bin/`

**Systemd timers** — creation, activation, monitoring: [SYSTEMD.md](references/SYSTEMD.md)

---

## Step 5: Validate

- [ ] Run 5x, compare output to manual execution
- [ ] `--dry-run` produces no side effects
- [ ] `--robot` output parses as valid JSON
- [ ] Automated ≥ 3x faster than manual
- [ ] Force failure → verify graceful behavior

---

## Anti-Patterns

| Don't | Instead |
|-------|---------|
| Automate before measuring | Run atuin queries first |
| Rust CLI for 2-line glue | Bash script or alias |
| Skip `--dry-run` | Always add dry-run mode |
| Ignore exit codes | Non-zero exit + logging |
| Automate rare commands (Score < 0.3) | Skip — maintenance > benefit |
| One giant script | Unix philosophy: small composable tools |

---

## Integration

| Need | Skill |
|------|-------|
| Rust CLI + SQLite patterns | `/rust-cli-with-sqlite` |
| Search prior agent sessions | `/cass` |
| Turn automation into a skill | `/sc` + `/sw` |
| Track automation tasks | `/br` |
| Optimize slow commands | `/extreme-software-optimization` |

---

## Reference Index

| Need | Read |
|------|------|
| Full atuin query cookbook (10 queries) | [ATUIN-QUERIES.md](references/ATUIN-QUERIES.md) |
| Shell history parsing (zsh/bash/fish) | [SHELL-HISTORY.md](references/SHELL-HISTORY.md) |
| Systemd timers: create, audit, monitor | [SYSTEMD.md](references/SYSTEMD.md) |
| Rust CLI scaffold + Cargo.toml | [RUST-SCAFFOLD.md](references/RUST-SCAFFOLD.md) |
| Real-world examples with scores | [EXAMPLES.md](references/EXAMPLES.md) |
| Clustering + scoring algorithms | [PATTERN-DETECTION.md](references/PATTERN-DETECTION.md) |

---

## Done When

- [ ] Atuin DB queried for all pattern types
- [ ] Top candidates scored and ranked
- [ ] At least one automation built and validated
- [ ] Automation installed (PATH, alias, or systemd timer)
- [ ] Time savings measured

Attribution

lev-oslev-os
View sourceMore from lev-os →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

ucoz-landing-skill

Playbook for creating and editing uCoz landing pages via MCP tools (`templates_tool`, `ftp_tool`, `modules_tool`). Use for tasks such as: "build a landing page", "update the homepage as a landing page", "create a promo page on the homepage", "add a lead form / menu / SEO to the homepage". Homepage: `page_list`, `page_get`; first publish — `page_update` with full `page_tmpl`; HTML edits after generation — `patch_template` (module_id=2, template_id=1), not `update_template`. Activate the mail f...

107 votes

Paperclip

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

805541 votes

Instantly Rdsthomas Mission Control

Instantly.ai cold email outreach API - manage campaigns, leads, accounts, and analytics. Use for cold email automation, lead management, campaign creation/monitoring, and email account warmup.

761 votes

Daw Music

Digital Audio Workstation usage, music composition, interactive music systems, and game audio implementation for immersive soundscapes.

761 votes

Caveman Compress

Compress natural language memory files (CLAUDE.md, todos, preferences) into caveman format to save input tokens. Preserves all technical substance, code, URLs, and structure. Compressed version overwrites the original file. Human-readable backup saved as FILE.original.md. Trigger: /caveman-compress FILEPATH or "compress memory file"

1023330 votes
View all in tools →