Skip to content
Back to skills

072 Configuration 0458e934

ASecurity

User settings, model registry, and pricing management

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
ai-agentspythonapiperformance

Works with

  • api

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 072-configuration_0458e934 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 072 Configuration 0458e934?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 072 Configuration 0458e934
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-072-configuration-0458e934/badge)](https://www.skillsdirectory.com/skills/tools-only-072-configuration-0458e934)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
title: Configuration Module
path: src/tunacode/configuration
type: directory
depth: 1
description: User settings, model registry, and pricing management
exports: [load_user_config, ModelRegistry, get_pricing]
seams: [M]
---

# Configuration Module

## Purpose
Manages application configuration including user settings, model registry, pricing information, and default values.

## Key Components

### settings.py
**load_user_config()**
- Loads user configuration from config directory
- Merges with defaults
- Validates configuration structure
- Returns UserConfig dictionary

**Config Locations:**
- `~/.config/tunacode/config.json`
- `.tunacode/config.json` (project-specific)

### models.py
**ModelRegistry Class**
- Loads model definitions from models_registry.json
- Provides model lookup by name
- Validates model configurations
- Caches registry for performance

**Model Registry Format:**
```json
{
  "models": {
    "claude-opus-4-5": {
      "api": "anthropic",
      "max_tokens": 200000,
      "supports_tool_use": true
    }
  }
}
```

### defaults.py
**DEFAULT_USER_CONFIG**
Default configuration values:
- **default_model** - Default LLM to use
- **theme** - UI theme preference
- **max_iterations** - Agent loop limit
- And more...

### pricing.py
**get_pricing()**
- Retrieves pricing information for models
- Calculates token costs
- Supports multiple providers (Anthropic, OpenAI, etc.)
- Tracks session costs

**Pricing Data:**
- Input token costs (per 1M tokens)
- Output token costs (per 1M tokens)
- Cached in pricing.json

## Configuration Schema

**UserConfig Structure:**
```python
{
  "default_model": str,
  "theme": str,
  "max_iterations": int,
  "timeout_seconds": int,
  # ... additional settings
}
```

## Integration Points

- **core/state.py** - Session configuration loading
- **core/agents/** - Model selection and agent creation
- **ui/** - Theme and preference application
- **types/** - UserConfig type definition

## Seams (M)

**Modification Points:**
- Add new configuration options
- Customize default values
- Extend model registry format
- Add new pricing models

Attribution

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

Loading comments…