agent-skill-foundry 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .venv/
7
+ venv/
8
+ .env
9
+ *.env
10
+ .DS_Store
11
+ requirements.md
12
+ context.md
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sanath Goutham
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,50 @@
1
+ Metadata-Version: 2.4
2
+ Name: agent-skill-foundry
3
+ Version: 0.1.0
4
+ Summary: A Python framework for managing reusable AI skills throughout their lifecycle.
5
+ Project-URL: Homepage, https://github.com/lancer59/agent-skill-foundry
6
+ Project-URL: Repository, https://github.com/lancer59/agent-skill-foundry
7
+ Project-URL: Issues, https://github.com/lancer59/agent-skill-foundry/issues
8
+ Author: Sanath Goutham
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: agent-skill-foundry,agentic-ai,agents,ai,llm,skill-management,skills
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: pydantic>=2.0
23
+ Provides-Extra: all
24
+ Requires-Dist: httpx>=0.25; extra == 'all'
25
+ Requires-Dist: openai>=1.0; extra == 'all'
26
+ Provides-Extra: ollama
27
+ Requires-Dist: httpx>=0.25; extra == 'ollama'
28
+ Provides-Extra: openai
29
+ Requires-Dist: openai>=1.0; extra == 'openai'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Agent Skill Foundry
33
+
34
+ > ⚠️ **This project is currently under active development. APIs may change without notice.**
35
+
36
+ **Agent Skill Foundry (ASF)** is an open-source Python framework for managing reusable AI skills throughout their lifecycle — acquisition, validation, storage, retrieval, evolution, and governance.
37
+
38
+ More documentation and features coming soon.
39
+
40
+ ---
41
+
42
+ ## Installation
43
+
44
+ ```bash
45
+ pip install agent-skill-foundry
46
+ ```
47
+
48
+ ## License
49
+
50
+ MIT
@@ -0,0 +1,19 @@
1
+ # Agent Skill Foundry
2
+
3
+ > ⚠️ **This project is currently under active development. APIs may change without notice.**
4
+
5
+ **Agent Skill Foundry (ASF)** is an open-source Python framework for managing reusable AI skills throughout their lifecycle — acquisition, validation, storage, retrieval, evolution, and governance.
6
+
7
+ More documentation and features coming soon.
8
+
9
+ ---
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ pip install agent-skill-foundry
15
+ ```
16
+
17
+ ## License
18
+
19
+ MIT
@@ -0,0 +1,8 @@
1
+ """Agent Skill Foundry — reusable AI skill lifecycle management."""
2
+
3
+ from agent_skill_foundry.core import AgentSkillFoundry
4
+ from agent_skill_foundry.models.skill import Skill
5
+ from agent_skill_foundry.providers.base import LLMProvider
6
+
7
+ __version__ = "0.1.0"
8
+ __all__ = ["AgentSkillFoundry", "Skill", "LLMProvider"]
@@ -0,0 +1,105 @@
1
+ """Core AgentSkillFoundry class."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import re
7
+ from typing import Literal
8
+
9
+ from agent_skill_foundry.models.skill import Skill
10
+ from agent_skill_foundry.providers.base import LLMProvider
11
+
12
+ _SKILL_PROMPT = """\
13
+ You are an AI skill designer. Given a task description, produce a JSON object \
14
+ that defines a reusable AI skill.
15
+
16
+ Task description: {description}
17
+
18
+ Respond with ONLY a valid JSON object — no markdown fences, no extra text — \
19
+ with exactly these keys:
20
+ {{
21
+ "name": "<short human-readable name>",
22
+ "instructions": "<step-by-step instructions an AI agent should follow>",
23
+ "tags": ["<tag1>", "<tag2>", ...],
24
+ "category": "<single category word>"
25
+ }}
26
+ """
27
+
28
+
29
+ class AgentSkillFoundry:
30
+ """Entry point for the Agent Skill Foundry framework."""
31
+
32
+ def __init__(
33
+ self,
34
+ provider: Literal["openai", "ollama"] | LLMProvider = "openai",
35
+ *,
36
+ api_key: str | None = None,
37
+ model: str | None = None,
38
+ ollama_base_url: str = "http://localhost:11434",
39
+ ) -> None:
40
+ """
41
+ Initialise ASF with an LLM provider.
42
+
43
+ Args:
44
+ provider: Either a provider name string ("openai" | "ollama") or a
45
+ custom LLMProvider instance.
46
+ api_key: OpenAI API key. Falls back to the OPENAI_API_KEY env var.
47
+ model: Override the default model for the chosen provider.
48
+ ollama_base_url: Base URL for a local Ollama instance.
49
+ """
50
+ if isinstance(provider, LLMProvider):
51
+ self._provider = provider
52
+ elif provider == "openai":
53
+ from agent_skill_foundry.providers.openai import OpenAIProvider
54
+
55
+ self._provider: LLMProvider = OpenAIProvider(
56
+ api_key=api_key,
57
+ model=model or "gpt-4o-mini",
58
+ )
59
+ elif provider == "ollama":
60
+ from agent_skill_foundry.providers.ollama import OllamaProvider
61
+
62
+ self._provider = OllamaProvider(
63
+ model=model or "llama3",
64
+ base_url=ollama_base_url,
65
+ )
66
+ else:
67
+ raise ValueError(
68
+ f"Unknown provider '{provider}'. "
69
+ "Use 'openai', 'ollama', or pass a custom LLMProvider instance."
70
+ )
71
+
72
+ def create_skill(self, description: str) -> Skill:
73
+ """
74
+ Create a Skill from a natural language description.
75
+
76
+ The LLM infers the name, instructions, tags, and category.
77
+
78
+ Args:
79
+ description: What the skill should do.
80
+
81
+ Returns:
82
+ A populated Skill object.
83
+ """
84
+ prompt = _SKILL_PROMPT.format(description=description)
85
+ raw = self._provider.complete(prompt)
86
+
87
+ # Strip accidental markdown fences if the model adds them anyway
88
+ raw = re.sub(r"^```(?:json)?\s*", "", raw.strip())
89
+ raw = re.sub(r"\s*```$", "", raw.strip())
90
+
91
+ try:
92
+ data = json.loads(raw)
93
+ except json.JSONDecodeError as e:
94
+ raise ValueError(
95
+ f"LLM returned invalid JSON for skill creation.\n"
96
+ f"Raw response:\n{raw}"
97
+ ) from e
98
+
99
+ return Skill(
100
+ name=data.get("name", "Unnamed Skill"),
101
+ description=description,
102
+ instructions=data.get("instructions", ""),
103
+ tags=data.get("tags", []),
104
+ category=data.get("category", "general"),
105
+ )
@@ -0,0 +1,3 @@
1
+ from agent_skill_foundry.models.skill import Skill
2
+
3
+ __all__ = ["Skill"]
@@ -0,0 +1,26 @@
1
+ """Skill data model."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import uuid
6
+ from datetime import datetime, timezone
7
+ from typing import Any
8
+
9
+ from pydantic import BaseModel, Field
10
+
11
+
12
+ class Skill(BaseModel):
13
+ """A reusable AI skill."""
14
+
15
+ skill_id: str = Field(default_factory=lambda: str(uuid.uuid4()))
16
+ name: str
17
+ description: str
18
+ version: str = "1.0.0"
19
+ instructions: str
20
+ tags: list[str] = Field(default_factory=list)
21
+ category: str = "general"
22
+ created_at: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ """Serialize the skill to a JSON-compatible dict."""
26
+ return self.model_dump(mode="json")
@@ -0,0 +1,5 @@
1
+ from agent_skill_foundry.providers.base import LLMProvider
2
+ from agent_skill_foundry.providers.ollama import OllamaProvider
3
+ from agent_skill_foundry.providers.openai import OpenAIProvider
4
+
5
+ __all__ = ["LLMProvider", "OpenAIProvider", "OllamaProvider"]
@@ -0,0 +1,14 @@
1
+ """Abstract base class for LLM providers."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from abc import ABC, abstractmethod
6
+
7
+
8
+ class LLMProvider(ABC):
9
+ """Interface every LLM provider must implement."""
10
+
11
+ @abstractmethod
12
+ def complete(self, prompt: str) -> str:
13
+ """Send a prompt and return the text response."""
14
+ ...
@@ -0,0 +1,36 @@
1
+ """Ollama LLM provider."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from agent_skill_foundry.providers.base import LLMProvider
6
+
7
+
8
+ class OllamaProvider(LLMProvider):
9
+ """LLM provider backed by a local Ollama instance."""
10
+
11
+ def __init__(
12
+ self,
13
+ model: str = "llama3",
14
+ base_url: str = "http://localhost:11434",
15
+ ) -> None:
16
+ try:
17
+ import httpx
18
+ except ImportError as e:
19
+ raise ImportError(
20
+ "httpx package is required for the Ollama provider. "
21
+ "Install it with: pip install httpx"
22
+ ) from e
23
+
24
+ self._model = model
25
+ self._base_url = base_url.rstrip("/")
26
+
27
+ def complete(self, prompt: str) -> str:
28
+ import httpx
29
+
30
+ response = httpx.post(
31
+ f"{self._base_url}/api/generate",
32
+ json={"model": self._model, "prompt": prompt, "stream": False},
33
+ timeout=120,
34
+ )
35
+ response.raise_for_status()
36
+ return response.json().get("response", "")
@@ -0,0 +1,31 @@
1
+ """OpenAI LLM provider."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+
7
+ from agent_skill_foundry.providers.base import LLMProvider
8
+
9
+
10
+ class OpenAIProvider(LLMProvider):
11
+ """LLM provider backed by the OpenAI API."""
12
+
13
+ def __init__(self, api_key: str | None = None, model: str = "gpt-4o-mini") -> None:
14
+ try:
15
+ from openai import OpenAI
16
+ except ImportError as e:
17
+ raise ImportError(
18
+ "openai package is required for the OpenAI provider. "
19
+ "Install it with: pip install openai"
20
+ ) from e
21
+
22
+ self._model = model
23
+ self._client = OpenAI(api_key=api_key or os.environ.get("OPENAI_API_KEY"))
24
+
25
+ def complete(self, prompt: str) -> str:
26
+ response = self._client.chat.completions.create(
27
+ model=self._model,
28
+ messages=[{"role": "user", "content": prompt}],
29
+ temperature=0.3,
30
+ )
31
+ return response.choices[0].message.content or ""
@@ -0,0 +1,45 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "agent-skill-foundry"
7
+ version = "0.1.0"
8
+ description = "A Python framework for managing reusable AI skills throughout their lifecycle."
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ requires-python = ">=3.10"
12
+ authors = [
13
+ { name = "Sanath Goutham" }
14
+ ]
15
+ keywords = [
16
+ "ai", "agents", "skills", "llm", "agentic-ai",
17
+ "skill-management", "agent-skill-foundry"
18
+ ]
19
+ classifiers = [
20
+ "Development Status :: 3 - Alpha",
21
+ "Intended Audience :: Developers",
22
+ "License :: OSI Approved :: MIT License",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
28
+ "Topic :: Software Development :: Libraries :: Python Modules",
29
+ ]
30
+ dependencies = [
31
+ "pydantic>=2.0",
32
+ ]
33
+
34
+ [project.optional-dependencies]
35
+ openai = ["openai>=1.0"]
36
+ ollama = ["httpx>=0.25"]
37
+ all = ["openai>=1.0", "httpx>=0.25"]
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/lancer59/agent-skill-foundry"
41
+ Repository = "https://github.com/lancer59/agent-skill-foundry"
42
+ Issues = "https://github.com/lancer59/agent-skill-foundry/issues"
43
+
44
+ [tool.hatch.build.targets.wheel]
45
+ packages = ["agent_skill_foundry"]