diazmelgarejo/perpetua-tools/perpetua-tools

Claude Code and agent skill by diazmelgarejo/perpetua-tools

Trust tier 2
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"},{"type":"plugin","description":"Custom plugin integration"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Install

npx vskill@latest install diazmelgarejo/perpetua-tools/perpetua-tools

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as diazmelgarejo/perpetua-tools/perpetua-tools.

SKILL.md — Perpetua-Tools Model Selection Skill

Version: v1.1.1.0 · Updated: 2026-04-08
Repo: https://github.com/diazMelgarejo/Perpetua-Tools · Branch: main

Layering (all interoperable and independently configurable):

LayerRepoRole
Orchestrator & instance managerPerpetua-Tools (this repo)Top-level agent lifecycle, ModelRegistry / config/*.yml, FastAPI /orchestrate, idempotency
Reasoning & routing methodologyorama-system`bin/orama-system/SKILL.md`, AFRP (pre-router gate) / CIDF / process; multi-agent registry is separately installable and not required to run this orchestrator
Subagent auto-selection (ECC-style)ECC ToolsDefault subagent routing unless the top-level orchestrator overrides roles
AutoResearch syncuditgoenka/autoresearchIdempotent sync of the Claude Code research-loop plugin; integrated via /autoresearch/* endpoints and orchestrator/autoresearch_bridge.py. /autoresearch slash-command availability is not a hard dependency: prefers the idempotent global skill install (scripts/install-vendor-guided.sh), falls back to the Claude Code plugin marketplace, then to a micro-implementation if neither is present. The underlying orchestration (git sync, GPU dispatch, dry-run planning) works regardless. Karpathy's repo is the original single-track train.py loop only. Qu and Lu, arXiv:2603.23420, are the bilevel mechanism paper. EdwardOptimization/Bilevel-Autoresearch branch experimental/tri-level-pr2 is optional Level 3 research; its report does not show a reliable gain over bi-level.

Selection order: Top-level model routing follows this `SKILL.md` → `orchestrator/model_registry.py` + `config/models.yml` / `routing.yml` first. Subagents use ECC-tools defaults unless overridden. orama-system remains the methodology layer for reasoning execution, not a hard dependency of the YAML registry.

Harness model defaults (provider-agnostic; the harness picks the path): cite Alexandria model-governance (PR #1, tip d6da6781) and the local pin docs/standards/model-governance.md. Cursor / Grok Bot default: grok-4.7 {effort: medium, fast: false}. Allowed alternatives: composer-2.5, or gpt-5.6-terra at medium, both with fast off. Anthropic default: claude-sonnet-5-5 medium. grok-4.5 is banned. auto is editor-only. Agents never self-escalate. The local-first runtime frugality ladder below is unchanged.

Optional (code review only): For graph-first review workflows (not dispatch), see orama-system `bin/orama-system/skills/code-review/SKILL.md` (CRG → gbrain → Read).


State Ownership & Redis Strategy

Canonical MVP wording: For MVP/v1.0, orama remains stateless and has no Redis requirement. PT is the sole orchestration layer and owns agent instantiation, tracking, queueing, budget enforcement, and file-based runtime state. Redis-backed coordination is a future PT-only enhancement planned for multi-instance distributed deployments in v1.1 and above.

Rules:

  • Single PT instance or LAN MVP per machine: file-based state only (.state/agents.json; spend in the private SQLite budget store .state/budget.sqlite3, see docs/coordination/spend-gate.md)
  • No Redis mentions in orama install/runtime requirements
  • Any future queue/cache/distributed lock support belongs to PT
  • Redis only activates when PT supports multi-instance distributed operation (v1.1+), not before

Multi-Computer Orchestration (Hardware-Aware)

This orchestrator is designed for full hardware profile awareness [web:40] across a distributed LAN environment. It adapts standard multi-agent orchestration strategies [web:23][web:25] (sequential, concurrent, routing) to physical hardware constraints.

LAN Resume & Distributed Discovery
  • Automatic Resume (LAN Detect): On startup, the system scans the LAN for existing instances (Redis: agent:registry:* or local .state/agents.json).
  • Session Continuity: Resume from the last known state by re-attaching to running agent processes or resuming from the Short Persistence Log (.state/session.log).
  • Discovery Strategy: Attempt to connect to REDIS_HOST. If unreachable, fallback to the local state file for standalone operations.
Spawn Reconciliation (Pre-Model Spawning)
  • Centralized Registry Check: Before spawning any agent, the orchestrator MUST check the AgentTracker (global registry) for an existing agent with the same role and task_hash.
  • Proper Session Planning: Reconcile spawns before model assignment to prevent dual-task GPU contention or redundant model loading.
  • Model Assignment: Once a spawn is reconciled, assign the model based on the hardware profile's VRAM/RAM ceiling (see hardware/SKILL.md).
Profile Deployment Logic
Profile IDArchitectureCore SpecializationPrimary Use Case
mac-studioApple SiliconLow-latency, Large RAMOrchestration, Synthesis, Multi-step reasoning
win-rtx3080x86-64 / CUDAParallel GPU computeHeavy coding, Critic passes, ML experiments

Hardware Affinity (Perpetua-Tools owns enforcement)

Skill: .claude/skills/hardware-policy/SKILL.md — operational playbook (CLI, layers, gap history).
Policy: config/model_hardware_policy.yml · API: src/utils/hardware_policy.py
Validation: scripts/hardware_policy_cli.py · Human gate: orama-system/start.sh --hardware-policy

orama's hardware-affinity-gate skill imports PT rules one-way — do not duplicate policy in orama or here.

Canonical enforcement stack
LayerComponent
Policyconfig/model_hardware_policy.yml
APIsrc/utils/hardware_policy.py (load_policy, check_affinity, filter_models_for_platform)
CLIscripts/hardware_policy_cli.py (delegates to API — never duplicate parsers)
Researchersscripts/launch_researchers.py (_platform_for_role, _pick_model_with_affinity)
Runtimeagent_launcher.py, orchestrator/supervisor.py, worker_registry.py
Discoverysrc/perpetua/discovery/selector.py (_MIRROR_BACKENDS)

Refer to hardware/SKILL.md for role matrix and VRAM constraints.

Hardware Profiles — Model Guidance
⚠️ Never hardcode model names in production code — query /api/tags (Ollama) or /v1/models (LM Studio) at runtime (see Skill 3 and src/utils/hardware_policy.py).
The examples below are known-good references from operational experience, not defaults to hardcode. They serve as smoke-test baselines only.
Profile A — mac-studio (16GB+ Unified Memory)
  • Primary: glm-5.3-flash:cloud via local Ollama when the live probe succeeds
  • Local Fallback: Qwen3.5-9B-MLX-4bit (LM Studio, Metal full offload, context 4096) or qwen3.5:9b-mlx via Ollama (localhost:11434)
  • Roles: Thin Orchestrator via GLM, local verifier/orchestrator fallback via Mac LM Studio/Ollama.
  • VRAM: N/A (Unified). LM Studio/Ollama handle Apple Silicon Metal natively.
Profile B — win-rtx3080 (10GB VRAM)
  • Primary (LM Studio): Qwen3.5-27B-Claude-4.6-Opus-Reasoning-Distilled-v2 (gpu_offload=40, context 16384)
  • Roles: Coder, Checker, Refiner, Executor, Verifier, AutoResearch Coder
  • NEVER Mac models: qwen3.5-9b-mlx, qwen3.5-9b-mlx-4bit, gemma-4-e4b-it
  • NEVER load MLX models on Windows — MLX requires Apple Silicon Metal.
  • Constraints: gpu_offload=40 layers max; probe /api/tags or /v1/models for available quant variants (gemma-4-26b-a4b-it, qwen3.5:35b-a3b-q4_K_M, or qwen3-coder family at http://<YOUR_WINDOWS_IP>:11434).
Canonical Model Routing Decision Tree
Task Received
│
├─ Mac host?
│ └─ ALWAYS primary: Qwen3.5-9B-MLX-4bit
│ └─ NEVER Windows models or CUDA-only layers
│
├─ Windows host?
│ └─ ALWAYS primary: Qwen3.5-27B-Claude-4.6-Opus-Reasoning-Distilled-v2
│ └─ NEVER Mac models, MLX, or Metal-only paths
│
└─ Cloud / Perplexity route only when budget + internet allow
---
## Cloud Routing Rules (< $5/month budget)
Paid cloud is last on the runtime ladder. Cost gate fails closed.
Approval rule: [Escalation approval regimes](docs/standards/model-governance.md#escalation-approval-regimes).
### Anthropic path — default Claude Sonnet 5.5 (medium)

CLOUD_ORCHESTRATION = { "provider": "anthropic", "model": "claude-sonnet-5-5", "effort": "medium", "trigger_conditions": [ "strategic_decision == True", "reasoning_steps > 200", "multi_repo_coordination == True" ], "max_calls_per_day": 3, "max_tokens_per_call": 500, # Keep prompts SHORT "estimated_cost_per_call": 0.05, "fallback": "qwen3-30b-critic" # Dell local }

Cursor / Grok Bot agent launches use `grok-4.7` at medium with fast off,
not this Anthropic block. Do not treat Claude as the only path.
### Priority 2 — Finance & Real-Time Research (Perplexity Sonar Reasoning Pro)

CLOUD_RESEARCH = { "provider": "perplexity", "model": "sonar-reasoning-pro", "trigger_conditions": [ "requires_recent_info == True", "is_finance_realtime == True", "query_date_range < 7_days" ], "max_calls_per_day": 2, "max_tokens_per_call": 1500, "estimated_cost_per_call": 0.03, "fallback": "qwen3-30b-critic" # Dell local, no real-time data }

### Budget Guard

BUDGET_GUARD = { "max_daily_spend_usd": 0.17, # ~$5/month / 30 days "max_daily_calls": 5, "redis_tracking": True, "hard_cutoff": True, # NEVER exceed, always fallback "fallback_on_exceed": "qwen3-30b-critic" }

---
## Local Model Routing Decision Tree

Task Received │ ├─ Privacy Critical? │ └─ YES → ALWAYS local, skip cloud │ ├─ Code task → win-rtx3080: Qwen3.5-27B (LM Studio) → qwen3-coder:14b → local LM Studio fallbacks │ └─ Standard → mac-studio: glm-5.3-flash:cloud probe → Qwen3.5-9B-MLX-4bit if GLM unavailable │ ├─ Budget exhausted OR Internet offline? │ └─ YES → win-rtx3080: qwen3-30b-critic (FALLBACK) │ ├─ Real-time data needed (< 7 days)? │ └─ YES + Budget OK → Perplexity: grok-4.1-thinking │ ├─ Strategic reasoning (> 200 steps)? │ └─ YES + Budget OK → Perplexity: claude-sonnet-4.5-thinking │ ├─ Heavy code generation (> 500 lines)? │ ├─ > 2000 lines → win-rtx3080: Qwen3.5-27B (LM Studio, context 16384) │ └─ 500-2000 lines → win-rtx3080: Qwen3.5-27B (LM Studio) │ ├─ Quick/interactive task? │ └─ mac-studio: glm-5.3-flash:cloud if reachable, else Qwen3.5-9B-MLX-4bit │ └─ Default → mac-studio: Qwen3.5-9B-MLX-4bit (LM Studio, context 4096)

---
## Critic & Refinement Pass (Qwen3-30B)
The `qwen3:30b-a3b-instruct-q4_K_M` model on Dell serves as:
1. **Default Offline Fallback** — Replaces any cloud model when unreachable
2. **Local Critic** — Reviews batch agent outputs for quality (score 1-10)
3. **Refiner** — Improves sub-agent outputs before synthesis
4. **Orchestration Fallback** — Decomposes tasks when Claude is unavailable

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 85 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

  • SKILL.md in the repositoryCheckingSKILL.md

Popularity

Repository stars
2
7-day trend score
5

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 21 May 2026, 6 months ago.

Extension points

  • hookPre/post lifecycle hooks
  • pluginCustom plugin integration

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/diazmelgarejo/perpetua-tools/perpetua-tools/badge)](https://verified-skill.com/skills/diazmelgarejo/perpetua-tools/perpetua-tools)

Something wrong with this skill or its page? Tell us.