diazmelgarejo/perpetua-tools/perpetua-tools
Claude Code and agent skill by diazmelgarejo/perpetua-tools
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"},{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install diazmelgarejo/perpetua-tools/perpetua-toolsSemi-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-08Repo: https://github.com/diazMelgarejo/Perpetua-Tools · Branch:main
Layering (all interoperable and independently configurable):
| Layer | Repo | Role | |
|---|---|---|---|
| Orchestrator & instance manager | Perpetua-Tools (this repo) | Top-level agent lifecycle, ModelRegistry / config/*.yml, FastAPI /orchestrate, idempotency | |
| Reasoning & routing methodology | orama-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 Tools | Default subagent routing unless the top-level orchestrator overrides roles | |
| AutoResearch sync | uditgoenka/autoresearch | Idempotent 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, seedocs/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 sameroleandtask_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 ID | Architecture | Core Specialization | Primary Use Case | |
|---|---|---|---|---|
mac-studio | Apple Silicon | Low-latency, Large RAM | Orchestration, Synthesis, Multi-step reasoning | |
win-rtx3080 | x86-64 / CUDA | Parallel GPU compute | Heavy 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.pyValidation: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
| Layer | Component | |
|---|---|---|
| Policy | config/model_hardware_policy.yml | |
| API | src/utils/hardware_policy.py (load_policy, check_affinity, filter_models_for_platform) | |
| CLI | scripts/hardware_policy_cli.py (delegates to API — never duplicate parsers) | |
| Researchers | scripts/launch_researchers.py (_platform_for_role, _pick_model_with_affinity) | |
| Runtime | agent_launcher.py, orchestrator/supervisor.py, worker_registry.py | |
| Discovery | src/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 andsrc/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:cloudvia local Ollama when the live probe succeeds - Local Fallback:
Qwen3.5-9B-MLX-4bit(LM Studio, Metal full offload, context 4096) orqwen3.5:9b-mlxvia 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=40layers max; probe/api/tagsor/v1/modelsfor available quant variants (gemma-4-26b-a4b-it,qwen3.5:35b-a3b-q4_K_M, orqwen3-coderfamily athttp://<YOUR_WINDOWS_IP>:11434).
Canonical Model Routing Decision Tree
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 }
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 = { "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" }
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)
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 hookspluginCustom 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
[](https://verified-skill.com/skills/diazmelgarejo/perpetua-tools/perpetua-tools)