/major-ai-skills:semantic-key-shorteningfrom major-ai-skills
Use familiar short field names in compact payloads when their meaning stays clear to producers and consumers.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
In automated extraction, log processing, and multi-agent communications, models frequently emit structured JSON objects with long, descriptive multi-word keys ("source_file_absolute_path", "target_destination_directory", "error_diagnostic_message").
In high-volume batch runs ($>500$ records), repeating 30-character descriptive keys on every JSON object consumes thousands of redundant tokens without adding any technical clarity.
The Semantic Key Shortening Protocol replaces verbose key names with standardized developer abbreviations (src, dst, err, req, res, fn, qty) - using client-side Pydantic and TypeScript aliases to expand them into full domain entities automatically.
┌─────────────────────────────────────────────────────────────┐
│ JSON Key Token Density │
│ │
│ Verbose Descriptive Keys (145 Tokens for 2 Records): │
│ [ │
│ { │
│ "source_file_path": "src/auth.ts", │
│ "destination_file_path": "dist/auth.js", │
│ "compilation_error_message": "Type mismatch", │
│ "status_execution_code": 1 │
│ } │
│ ] │
│ ↳ 45 tokens per record billed on verbose key strings │
│ │
│ Semantic Short Keys (42 Tokens - 71.0% Cut!): │
│ [ │
│ {"src":"src/auth.ts","dst":"dist/auth.js","err":"Type mismatch","code":1}│
│ ] │
│ ↳ 16 tokens per record, 100% semantic clarity for LLMs │
└─────────────────────────────────────────────────────────────┘
Use these universally recognized developer abbreviations in prompt schemas and tool definitions:
| Verbose Key Name | Semantic Short Key | Token Savings |
|---|---|---|
source_path / source_file | src | 66% Reduction |
destination_path / target | dst | 75% Reduction |
error_message / exception | err | 70% Reduction |
request_payload | req | 75% Reduction |
response_payload | res | 75% Reduction |
function_name | fn | 80% Reduction |
line_number | line | 50% Reduction |
quantity / count | qty / cnt | 60% Reduction |
configuration | cfg | 75% Reduction |
timestamp / created_at | ts | 70% Reduction |
Field(alias=...))Define data models with short wire aliases and rich internal variable names:
from pydantic import BaseModel, Field
from typing import List
class FileMutation(BaseModel):
source_path: str = Field(alias="src")
destination_path: str = Field(alias="dst")
error_message: str = Field(alias="err", default="")
status_code: int = Field(alias="code", default=0)
class Config:
populate_by_name = True
# Downstream client parses dense compact JSON automatically
raw_llm_json = '[{"src":"src/a.ts","dst":"dist/a.js","code":0}]'
mutations = [FileMutation.model_validate(item) for item in json.loads(raw_llm_json)]
print(mutations[0].source_path) # Outputs: 'src/a.ts'
export interface WireMutationPayload {
src: string;
dst: string;
err?: string;
code: number;
}
// Client-side mapper to rich domain model
export function fromWirePayload(wire: WireMutationPayload) {
return {
sourcePath: wire.src,
destinationPath: wire.dst,
errorMessage: wire.err,
statusCode: wire.code,
};
}
Processing 1,000 continuous integration build log entries:
| Payload Representation | Total Output Tokens | Generation Duration | API Cost (GPT-4o) |
|---|---|---|---|
| Verbose Descriptive Keys | 58,000 tokens | 48.2 seconds | $0.580 |
Semantic Short Keys (src, dst) | 24,500 tokens | 18.5 seconds | $0.245 (57.7% Savings!) |
MANDATORY: For high-volume structured outputs, log extractions, and multi-agent JSON payloads, agents must use standardized semantic short keys (
src,dst,err,req,res,fn,ts). Let client-side Pydantic/TypeScript models expand wire aliases into rich domain properties.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization./act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.Other plugins' skills for the same job