python-skills 1.0.0__py3-none-any.whl
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.
- python_skills/__init__.py +10 -0
- python_skills/__main__.py +6 -0
- python_skills/adapters/__init__.py +48 -0
- python_skills/adapters/agent_skills.py +415 -0
- python_skills/adapters/aider_adapter.py +226 -0
- python_skills/adapters/base.py +153 -0
- python_skills/adapters/claude.py +474 -0
- python_skills/adapters/cline.py +332 -0
- python_skills/adapters/codex.py +24 -0
- python_skills/adapters/continue_adapter.py +198 -0
- python_skills/adapters/cursor.py +327 -0
- python_skills/adapters/gemini.py +26 -0
- python_skills/adapters/goose.py +26 -0
- python_skills/adapters/junie.py +25 -0
- python_skills/adapters/kiro.py +382 -0
- python_skills/adapters/opencode.py +27 -0
- python_skills/adapters/roo.py +25 -0
- python_skills/adapters/universal.py +203 -0
- python_skills/adapters/vscode.py +27 -0
- python_skills/adapters/windsurf.py +26 -0
- python_skills/adapters/zed.py +27 -0
- python_skills/cli.py +326 -0
- python_skills/config.py +160 -0
- python_skills/detector.py +152 -0
- python_skills/installer.py +163 -0
- python_skills/markers.py +115 -0
- python_skills/skills/__init__.py +14 -0
- python_skills/skills/loader.py +171 -0
- python_skills/skills/metadata.py +152 -0
- python_skills/skills/registry.py +101 -0
- python_skills/state.py +204 -0
- python_skills-1.0.0.dist-info/METADATA +99 -0
- python_skills-1.0.0.dist-info/RECORD +105 -0
- python_skills-1.0.0.dist-info/WHEEL +4 -0
- python_skills-1.0.0.dist-info/entry_points.txt +2 -0
- python_skills-1.0.0.dist-info/licenses/LICENSE +21 -0
- skills/advanced_python.md +239 -0
- skills/anti_patterns/index.md +406 -0
- skills/comprehensions.md +167 -0
- skills/control_flow.md +175 -0
- skills/data_structures.md +243 -0
- skills/debugging/common_bugs.md +222 -0
- skills/debugging/inspection_techniques.md +249 -0
- skills/debugging/root_cause.md +203 -0
- skills/engineering/application_logging.md +195 -0
- skills/engineering/cli_apps.md +207 -0
- skills/engineering/configuration.md +218 -0
- skills/engineering/database.md +240 -0
- skills/engineering/dependency_management.md +205 -0
- skills/engineering/http_clients.md +267 -0
- skills/engineering/modules_packages.md +211 -0
- skills/engineering/packaging.md +197 -0
- skills/engineering/project_structure.md +155 -0
- skills/engineering/pyproject_toml.md +302 -0
- skills/engineering/virtual_environments.md +206 -0
- skills/functions.md +244 -0
- skills/generation/async_concurrency.md +291 -0
- skills/generation/error_handling.md +276 -0
- skills/generation/protocols_generics.md +243 -0
- skills/generation/type_hints.md +290 -0
- skills/generation/validation_pipeline.md +274 -0
- skills/generation/workflow.md +190 -0
- skills/oop.md +228 -0
- skills/quality/abstractions.md +154 -0
- skills/quality/comments.md +177 -0
- skills/quality/documentation.md +176 -0
- skills/quality/duplication.md +137 -0
- skills/quality/maintainability.md +142 -0
- skills/quality/naming.md +171 -0
- skills/quality/quality_functions.md +245 -0
- skills/quality/readability.md +239 -0
- skills/quality/type_annotations.md +192 -0
- skills/refactoring/behavior_preservation.md +157 -0
- skills/refactoring/incremental.md +187 -0
- skills/refactoring/interface_stability.md +199 -0
- skills/refactoring/safe_refactoring.md +206 -0
- skills/security/auth_boundaries.md +200 -0
- skills/security/command_injection.md +207 -0
- skills/security/dependency_risks.md +282 -0
- skills/security/file_handling.md +156 -0
- skills/security/input_validation.md +190 -0
- skills/security/path_traversal.md +172 -0
- skills/security/secrets.md +171 -0
- skills/security/sql_injection.md +188 -0
- skills/security/unsafe_deserialization.md +164 -0
- skills/stdlib/argparse.md +178 -0
- skills/stdlib/collections.md +212 -0
- skills/stdlib/datetime.md +187 -0
- skills/stdlib/functools.md +238 -0
- skills/stdlib/itertools.md +183 -0
- skills/stdlib/json.md +162 -0
- skills/stdlib/logging.md +185 -0
- skills/stdlib/os_sys.md +184 -0
- skills/stdlib/pathlib.md +218 -0
- skills/stdlib/re.md +171 -0
- skills/stdlib/statistics.md +112 -0
- skills/stdlib/subprocess.md +211 -0
- skills/testing/async_tests.md +249 -0
- skills/testing/coverage.md +168 -0
- skills/testing/edge_cases.md +197 -0
- skills/testing/fixtures_mocks.md +203 -0
- skills/testing/organization.md +205 -0
- skills/testing/parameterized.md +174 -0
- skills/testing/regression_tests.md +165 -0
- skills/variables_types.md +107 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"""Skill registry - central skill discovery and management."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
from .loader import SkillLoader
|
|
7
|
+
from .metadata import SkillMetadata
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass
|
|
11
|
+
class SkillRegistry:
|
|
12
|
+
"""Registry of all available skills."""
|
|
13
|
+
skills_root: Path
|
|
14
|
+
loader: SkillLoader = field(init=False)
|
|
15
|
+
_skills: dict[str, SkillMetadata] = field(default_factory=dict)
|
|
16
|
+
_by_category: dict[str, list[SkillMetadata]] = field(default_factory=dict)
|
|
17
|
+
_loaded: bool = False
|
|
18
|
+
|
|
19
|
+
def __post_init__(self):
|
|
20
|
+
self.loader = SkillLoader(self.skills_root)
|
|
21
|
+
|
|
22
|
+
def load_all(self) -> dict[str, SkillMetadata]:
|
|
23
|
+
"""Load all skills into registry."""
|
|
24
|
+
if self._loaded:
|
|
25
|
+
return self._skills
|
|
26
|
+
|
|
27
|
+
self._skills = {}
|
|
28
|
+
self._by_category = {}
|
|
29
|
+
|
|
30
|
+
for skill_name in self.loader.get_all_skill_names():
|
|
31
|
+
metadata = self.loader.load_skill(skill_name)
|
|
32
|
+
if metadata:
|
|
33
|
+
self._skills[skill_name] = metadata
|
|
34
|
+
if metadata.category not in self._by_category:
|
|
35
|
+
self._by_category[metadata.category] = []
|
|
36
|
+
self._by_category[metadata.category].append(metadata)
|
|
37
|
+
|
|
38
|
+
self._loaded = True
|
|
39
|
+
return self._skills
|
|
40
|
+
|
|
41
|
+
def get_skill(self, name: str) -> SkillMetadata | None:
|
|
42
|
+
"""Get a skill by name."""
|
|
43
|
+
if not self._loaded:
|
|
44
|
+
self.load_all()
|
|
45
|
+
return self._skills.get(name)
|
|
46
|
+
|
|
47
|
+
def get_skills_by_category(self, category: str) -> list[SkillMetadata]:
|
|
48
|
+
"""Get all skills in a category."""
|
|
49
|
+
if not self._loaded:
|
|
50
|
+
self.load_all()
|
|
51
|
+
return self._by_category.get(category, [])
|
|
52
|
+
|
|
53
|
+
def get_all_skills(self) -> list[SkillMetadata]:
|
|
54
|
+
"""Get all skills as a list."""
|
|
55
|
+
if not self._loaded:
|
|
56
|
+
self.load_all()
|
|
57
|
+
return list(self._skills.values())
|
|
58
|
+
|
|
59
|
+
def get_skill_names(self) -> list[str]:
|
|
60
|
+
"""Get all skill names."""
|
|
61
|
+
if not self._loaded:
|
|
62
|
+
self.load_all()
|
|
63
|
+
return list(self._skills.keys())
|
|
64
|
+
|
|
65
|
+
def get_categories(self) -> list[str]:
|
|
66
|
+
"""Get all categories."""
|
|
67
|
+
if not self._loaded:
|
|
68
|
+
self.load_all()
|
|
69
|
+
return list(self._by_category.keys())
|
|
70
|
+
|
|
71
|
+
def get_skill_content(self, name: str) -> str | None:
|
|
72
|
+
"""Get raw SKILL.md content for a skill."""
|
|
73
|
+
return self.loader.get_skill_content(name)
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
def count(self) -> int:
|
|
77
|
+
if not self._loaded:
|
|
78
|
+
self.load_all()
|
|
79
|
+
return len(self._skills)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
# Global registry instance
|
|
83
|
+
_registry: SkillRegistry | None = None
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def get_registry(skills_root: Path | None = None) -> SkillRegistry:
|
|
87
|
+
"""Get or create the global skill registry."""
|
|
88
|
+
global _registry
|
|
89
|
+
if _registry is None:
|
|
90
|
+
if skills_root is None:
|
|
91
|
+
# Try to find skills directory relative to this file
|
|
92
|
+
current = Path(__file__).resolve().parent.parent.parent
|
|
93
|
+
skills_root = current / "skills"
|
|
94
|
+
_registry = SkillRegistry(skills_root)
|
|
95
|
+
return _registry
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def reset_registry() -> None:
|
|
99
|
+
"""Reset the global registry (for testing)."""
|
|
100
|
+
global _registry
|
|
101
|
+
_registry = None
|
python_skills/state.py
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"""Installation state and lock file management."""
|
|
2
|
+
|
|
3
|
+
import hashlib
|
|
4
|
+
import json
|
|
5
|
+
from dataclasses import asdict, dataclass, field
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass
|
|
11
|
+
class FileRecord:
|
|
12
|
+
"""Record of a managed file."""
|
|
13
|
+
path: str
|
|
14
|
+
hash: str
|
|
15
|
+
size: int
|
|
16
|
+
region_hash: str | None = None # For AGENTS.md managed section
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@dataclass
|
|
20
|
+
class TargetState:
|
|
21
|
+
"""State for a single target."""
|
|
22
|
+
scope: str
|
|
23
|
+
status: str = "installed"
|
|
24
|
+
files: list[FileRecord] = field(default_factory=list)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dataclass
|
|
28
|
+
class LockState:
|
|
29
|
+
"""Complete lock state for python-skills installation."""
|
|
30
|
+
version: str = "1.0.0"
|
|
31
|
+
schema_version: int = 1
|
|
32
|
+
installed_at: str = ""
|
|
33
|
+
updated_at: str = ""
|
|
34
|
+
canonical_skills_hash: str = ""
|
|
35
|
+
targets: dict[str, TargetState] = field(default_factory=dict)
|
|
36
|
+
skill_count: int = 69
|
|
37
|
+
adapter_version: str = "1.0.0"
|
|
38
|
+
|
|
39
|
+
def __post_init__(self):
|
|
40
|
+
if not self.installed_at:
|
|
41
|
+
self.installed_at = datetime.utcnow().isoformat() + "Z"
|
|
42
|
+
if not self.updated_at:
|
|
43
|
+
self.updated_at = datetime.utcnow().isoformat() + "Z"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class LockManager:
|
|
47
|
+
"""Manages the lock file for python-skills installation state."""
|
|
48
|
+
|
|
49
|
+
def __init__(self, project_root: Path):
|
|
50
|
+
self.project_root = Path(project_root).resolve()
|
|
51
|
+
self.lock_dir = self.project_root / ".python-skills"
|
|
52
|
+
self.lock_file = self.lock_dir / "lock.json"
|
|
53
|
+
self._lock: LockState | None = None
|
|
54
|
+
|
|
55
|
+
def _compute_file_hash(self, path: Path) -> str:
|
|
56
|
+
"""Compute SHA256 hash of a file."""
|
|
57
|
+
hasher = hashlib.sha256()
|
|
58
|
+
with open(path, "rb") as f:
|
|
59
|
+
for chunk in iter(lambda: f.read(8192), b""):
|
|
60
|
+
hasher.update(chunk)
|
|
61
|
+
return hasher.hexdigest()
|
|
62
|
+
|
|
63
|
+
def _compute_region_hash(self, path: Path, start_marker: str, end_marker: str) -> str | None:
|
|
64
|
+
"""Compute hash of content between markers."""
|
|
65
|
+
try:
|
|
66
|
+
content = path.read_text(encoding="utf-8")
|
|
67
|
+
start_idx = content.find(start_marker)
|
|
68
|
+
end_idx = content.find(end_marker)
|
|
69
|
+
if start_idx == -1 or end_idx == -1 or end_idx <= start_idx:
|
|
70
|
+
return None
|
|
71
|
+
region_content = content[start_idx + len(start_marker):end_idx]
|
|
72
|
+
return hashlib.sha256(region_content.encode("utf-8")).hexdigest()
|
|
73
|
+
except Exception:
|
|
74
|
+
return None
|
|
75
|
+
|
|
76
|
+
def _compute_skills_hash(self, skills_root: Path) -> str:
|
|
77
|
+
"""Compute combined hash of all canonical skills."""
|
|
78
|
+
hasher = hashlib.sha256()
|
|
79
|
+
skill_dirs = sorted([d for d in skills_root.iterdir() if d.is_dir()])
|
|
80
|
+
for skill_dir in skill_dirs:
|
|
81
|
+
skill_file = skill_dir / "SKILL.md"
|
|
82
|
+
if skill_file.exists():
|
|
83
|
+
hasher.update(skill_file.read_bytes())
|
|
84
|
+
return hasher.hexdigest()
|
|
85
|
+
|
|
86
|
+
def load(self) -> LockState:
|
|
87
|
+
"""Load lock state from file."""
|
|
88
|
+
if self._lock is not None:
|
|
89
|
+
return self._lock
|
|
90
|
+
|
|
91
|
+
if self.lock_file.exists():
|
|
92
|
+
try:
|
|
93
|
+
data = json.loads(self.lock_file.read_text(encoding="utf-8"))
|
|
94
|
+
self._lock = LockState(**data)
|
|
95
|
+
return self._lock
|
|
96
|
+
except Exception:
|
|
97
|
+
pass
|
|
98
|
+
|
|
99
|
+
# Return empty lock state
|
|
100
|
+
self._lock = LockState()
|
|
101
|
+
return self._lock
|
|
102
|
+
|
|
103
|
+
def save(self, lock: LockState | None = None) -> None:
|
|
104
|
+
"""Save lock state to file."""
|
|
105
|
+
if lock is not None:
|
|
106
|
+
self._lock = lock
|
|
107
|
+
if self._lock is None:
|
|
108
|
+
self._lock = LockState()
|
|
109
|
+
|
|
110
|
+
self._lock.updated_at = datetime.utcnow().isoformat() + "Z"
|
|
111
|
+
self.lock_dir.mkdir(parents=True, exist_ok=True)
|
|
112
|
+
self.lock_file.write_text(json.dumps(asdict(self._lock), indent=2), encoding="utf-8")
|
|
113
|
+
|
|
114
|
+
def get_state(self) -> LockState:
|
|
115
|
+
"""Get current lock state."""
|
|
116
|
+
return self.load()
|
|
117
|
+
|
|
118
|
+
def record_file(self, target: str, scope: str, path: Path, region_markers: tuple[str, str] = None) -> None:
|
|
119
|
+
"""Record a managed file in the lock state."""
|
|
120
|
+
lock = self.load()
|
|
121
|
+
|
|
122
|
+
if target not in lock.targets:
|
|
123
|
+
lock.targets[target] = TargetState(scope=scope)
|
|
124
|
+
elif lock.targets[target].scope != scope:
|
|
125
|
+
# Scope changed - treat as new
|
|
126
|
+
lock.targets[target] = TargetState(scope=scope)
|
|
127
|
+
|
|
128
|
+
target_state = lock.targets[target]
|
|
129
|
+
|
|
130
|
+
# Compute file hash
|
|
131
|
+
file_hash = self._compute_file_hash(path)
|
|
132
|
+
file_size = path.stat().st_size
|
|
133
|
+
|
|
134
|
+
# Compute region hash if markers provided
|
|
135
|
+
region_hash = None
|
|
136
|
+
if region_markers:
|
|
137
|
+
region_hash = self._compute_region_hash(path, region_markers[0], region_markers[1])
|
|
138
|
+
|
|
139
|
+
# Check if file already recorded
|
|
140
|
+
existing = next((f for f in target_state.files if f.path == str(path.relative_to(self.project_root))), None)
|
|
141
|
+
if existing:
|
|
142
|
+
existing.hash = file_hash
|
|
143
|
+
existing.size = file_size
|
|
144
|
+
existing.region_hash = region_hash
|
|
145
|
+
else:
|
|
146
|
+
target_state.files.append(FileRecord(
|
|
147
|
+
path=str(path.relative_to(self.project_root)),
|
|
148
|
+
hash=file_hash,
|
|
149
|
+
size=file_size,
|
|
150
|
+
region_hash=region_hash
|
|
151
|
+
))
|
|
152
|
+
|
|
153
|
+
self.save(lock)
|
|
154
|
+
|
|
155
|
+
def remove_file(self, target: str, path: Path) -> bool:
|
|
156
|
+
"""Remove a file record from lock state. Returns True if removed."""
|
|
157
|
+
lock = self.load()
|
|
158
|
+
|
|
159
|
+
if target not in lock.targets:
|
|
160
|
+
return False
|
|
161
|
+
|
|
162
|
+
target_state = lock.targets[target]
|
|
163
|
+
rel_path = str(path.relative_to(self.project_root))
|
|
164
|
+
|
|
165
|
+
for i, f in enumerate(target_state.files):
|
|
166
|
+
if f.path == rel_path:
|
|
167
|
+
target_state.files.pop(i)
|
|
168
|
+
self.save(lock)
|
|
169
|
+
return True
|
|
170
|
+
|
|
171
|
+
return False
|
|
172
|
+
|
|
173
|
+
def get_managed_files(self, target: str, scope: str) -> list[FileRecord]:
|
|
174
|
+
"""Get all managed files for a target and scope."""
|
|
175
|
+
lock = self.load()
|
|
176
|
+
if target not in lock.targets:
|
|
177
|
+
return []
|
|
178
|
+
if lock.targets[target].scope != scope:
|
|
179
|
+
return []
|
|
180
|
+
return lock.targets[target].files
|
|
181
|
+
|
|
182
|
+
def get_target_status(self, target: str) -> TargetState | None:
|
|
183
|
+
"""Get status for a target."""
|
|
184
|
+
lock = self.load()
|
|
185
|
+
return lock.targets.get(target)
|
|
186
|
+
|
|
187
|
+
def clear_target(self, target: str) -> bool:
|
|
188
|
+
"""Clear all file records for a target. Returns True if target existed."""
|
|
189
|
+
lock = self.load()
|
|
190
|
+
if target in lock.targets:
|
|
191
|
+
del lock.targets[target]
|
|
192
|
+
self.save(lock)
|
|
193
|
+
return True
|
|
194
|
+
return False
|
|
195
|
+
|
|
196
|
+
def update_canonical_hash(self, skills_root: Path) -> None:
|
|
197
|
+
"""Update the canonical skills hash."""
|
|
198
|
+
lock = self.load()
|
|
199
|
+
lock.canonical_skills_hash = self._compute_skills_hash(skills_root)
|
|
200
|
+
self.save(lock)
|
|
201
|
+
|
|
202
|
+
def get_all_targets(self) -> dict[str, TargetState]:
|
|
203
|
+
"""Get all target states."""
|
|
204
|
+
return self.load().targets
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: python-skills
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Python engineering skills for AI coding agents
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Requires-Dist: click>=8.0
|
|
8
|
+
Requires-Dist: pyyaml>=6.0
|
|
9
|
+
Requires-Dist: rich>=13.0
|
|
10
|
+
Provides-Extra: dev
|
|
11
|
+
Requires-Dist: mypy>=1.0; extra == 'dev'
|
|
12
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
13
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# Python Skills
|
|
17
|
+
|
|
18
|
+
Python engineering skills for AI coding agents.
|
|
19
|
+
|
|
20
|
+
## Overview
|
|
21
|
+
|
|
22
|
+
Python Skills is a comprehensive knowledge base of 69 skills across 10 categories, designed to help AI coding agents write better Python code. It supports 16 AI coding agents via a unified adapter system.
|
|
23
|
+
|
|
24
|
+
## Supported Agents
|
|
25
|
+
|
|
26
|
+
| Agent | Skills Dir | Native Dir | Type |
|
|
27
|
+
|-------|-----------|------------|------|
|
|
28
|
+
| **OpenCode** | `.agents/skills/` | `.opencode/skills/` | A-NativeSkills |
|
|
29
|
+
| **Windsurf** | `.agents/skills/` | `.windsurf/skills/` | A-NativeSkills |
|
|
30
|
+
| **VS Code / Copilot** | `.agents/skills/` | `.github/skills/` | A-NativeSkills |
|
|
31
|
+
| **Gemini** | `.agents/skills/` | `.gemini/skills/` | A-NativeSkills |
|
|
32
|
+
| **Roo Code** | `.agents/skills/` | `.roo/skills/` | A-NativeSkills |
|
|
33
|
+
| **Codex** | `.agents/skills/` | — | A-NativeSkills |
|
|
34
|
+
| **Goose** | `.agents/skills/` | — | A-NativeSkills |
|
|
35
|
+
| **Junie (JetBrains)** | `.agents/skills/` | `.junie/skills/` | A-NativeSkills |
|
|
36
|
+
| **Zed** | `.agents/skills/` | — | A-NativeSkills |
|
|
37
|
+
| **Continue** | `.continue/rules/` | — | B-NativeRules |
|
|
38
|
+
| **Aider** | `PYTHON_SKILLS.md` | `.aider.conf.yml` | D-Config |
|
|
39
|
+
| **Claude Code** | `.claude/skills/` | — | A-NativeSkills |
|
|
40
|
+
| **Cursor** | `.cursor/rules/` | — | B-NativeRules |
|
|
41
|
+
| **Kiro** | `.kiro/skills/` | — | A-NativeSkills |
|
|
42
|
+
| **Cline** | `.agents/skills/` | `.clinerules` | A-NativeSkills |
|
|
43
|
+
| **Universal** | `AGENTS.md` | — | E-Universal |
|
|
44
|
+
|
|
45
|
+
## Shared Skills Directory
|
|
46
|
+
|
|
47
|
+
Targets that support the [Agent Skills specification](https://github.com/opencode-ai/agent-skills) share a single `.agents/skills/` directory. Each target also gets its own vendor-specific directory (e.g., `.opencode/skills/`). Installing multiple targets produces only 67 skill directories, not 67 per target.
|
|
48
|
+
|
|
49
|
+
## Skill Categories
|
|
50
|
+
|
|
51
|
+
- **Core**: Python language fundamentals (variables, control flow, functions, data structures, OOP)
|
|
52
|
+
- **Stdlib**: Standard library modules (argparse, collections, datetime, functools, itertools, json, logging, pathlib, re, statistics, subprocess)
|
|
53
|
+
- **Generation**: Code generation patterns (type hints, protocols, async, error handling, validation, workflow)
|
|
54
|
+
- **Engineering**: Production engineering (CLI apps, configuration, databases, HTTP clients, packaging, virtual environments)
|
|
55
|
+
- **Quality**: Code quality standards (abstractions, comments, documentation, duplication, functions, maintainability, naming, readability, type annotations)
|
|
56
|
+
- **Security**: Security engineering (auth boundaries, command injection, dependency risks, file handling, input validation, path traversal, secrets, SQL injection, unsafe deserialization)
|
|
57
|
+
- **Testing**: Testing methodologies (async tests, coverage, edge cases, fixtures/mocks, organization, parameterized, regression tests)
|
|
58
|
+
- **Refactoring**: Safe refactoring patterns (behavior preservation, incremental, interface stability, safe refactoring)
|
|
59
|
+
- **Debugging**: Debugging techniques (common bugs, inspection, root cause analysis)
|
|
60
|
+
- **Anti-patterns**: Anti-pattern prevention
|
|
61
|
+
|
|
62
|
+
## Installation
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install python-skills
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Or from source:
|
|
69
|
+
```bash
|
|
70
|
+
git clone https://github.com/FoxPink-dev/python-skills.git
|
|
71
|
+
cd python-skills
|
|
72
|
+
pip install -e .
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Usage
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Detect available agents
|
|
79
|
+
python -m python_skills detect
|
|
80
|
+
|
|
81
|
+
# Install for all compatible agents
|
|
82
|
+
python -m python_skills install --auto
|
|
83
|
+
|
|
84
|
+
# Install for specific targets
|
|
85
|
+
python -m python_skills install --target opencode --target windsurf
|
|
86
|
+
|
|
87
|
+
# Sync installed skills with latest
|
|
88
|
+
python -m python_skills sync
|
|
89
|
+
|
|
90
|
+
# Check installation status
|
|
91
|
+
python -m python_skills status
|
|
92
|
+
|
|
93
|
+
# Uninstall from all targets
|
|
94
|
+
python -m python_skills uninstall --auto
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
MIT License
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
python_skills/__init__.py,sha256=XkS7V5xdMl4wTw8wujp03LqKoQRhAthO8is8LZwb6MY,261
|
|
2
|
+
python_skills/__main__.py,sha256=RRkZJQNhRiklnyHFeZiueFy08L3c1tQYKm96y5wD_OE,121
|
|
3
|
+
python_skills/cli.py,sha256=n2jdpW-fjzVQF-oKFl1OP2iaWHTDlI9rE9u_oMTdSqw,10884
|
|
4
|
+
python_skills/config.py,sha256=NScTGUQU1O3EE9squ-AGF-q9Xr8cwCnrTZj1W6BkDGQ,5568
|
|
5
|
+
python_skills/detector.py,sha256=LRDWjQiyoWoZerhFtz2dHO2-j3U_A07Nru2iOFBBOD4,6599
|
|
6
|
+
python_skills/installer.py,sha256=an0oDz6mIW2XWbOq040Vf0QqkaxA4-dY6cb7DmIFGeM,7007
|
|
7
|
+
python_skills/markers.py,sha256=VUpr8AUXK_n9vZhubdg-hN_KjBl6TqUCCoN0JtcEcls,3768
|
|
8
|
+
python_skills/state.py,sha256=wlsWkMdrgWhR9BxqoVTaJ1_94j3A5VMzcLwLnJWzQU8,7014
|
|
9
|
+
python_skills/adapters/__init__.py,sha256=hfmxjhOYcTmLWpMTrOu3qMmXDlbxXSINWax9SdKP8gw,1676
|
|
10
|
+
python_skills/adapters/agent_skills.py,sha256=_X3-Pgq6uMgeWwn2E4KbkS8Q4S_GfEvqsTmeVnl7-qE,17637
|
|
11
|
+
python_skills/adapters/aider_adapter.py,sha256=Ik0jRS3mwv2O5xTmPGHdDVjipcVXd61mAowxuQJuE50,8144
|
|
12
|
+
python_skills/adapters/base.py,sha256=YOznJi-NfXA2XQEoDMTKyACv77ifhxFkyRia24SVXjk,5045
|
|
13
|
+
python_skills/adapters/claude.py,sha256=jUdy5l0gGFVsb9hmj4a_j-lftevRpw443UA49BliQM4,16658
|
|
14
|
+
python_skills/adapters/cline.py,sha256=0mNUh2GbjLbtdubNH7e3tS6ar9PDwinsG5AzQtnlNB0,12986
|
|
15
|
+
python_skills/adapters/codex.py,sha256=6_wxR_rT8Gd_V86PhyWTC1EvSSbU7lMRAci5_9OeyxQ,629
|
|
16
|
+
python_skills/adapters/continue_adapter.py,sha256=rlYCqn2KY4wXk0pjWHQfVQgUNDqthTGMOGCwzw8Z33w,7092
|
|
17
|
+
python_skills/adapters/cursor.py,sha256=QoPoJgbp4ra6keeUVJyTvO8O7h4qE1UI-kaPEO3_qUM,12946
|
|
18
|
+
python_skills/adapters/gemini.py,sha256=74813mTYiPt_K_PPRYsYi_vF4cXFFAlPtkKfPDxTIGQ,758
|
|
19
|
+
python_skills/adapters/goose.py,sha256=pMh2DwZPqwve5Kh9Pxe02ARRyV_cSkHGr5fBuAqWliw,753
|
|
20
|
+
python_skills/adapters/junie.py,sha256=XLZoUx3OeTxflCuVlwMPHLqfc229r_vlA-34_AQymJA,717
|
|
21
|
+
python_skills/adapters/kiro.py,sha256=oEked9C7qVeEEN-iX7uaIpSnDGx8WVNs_-3xcHTfLK0,15239
|
|
22
|
+
python_skills/adapters/opencode.py,sha256=Zc2qmtA5Wc3DtK2KZKE6pFxiE662t2jw-3aUcptU8Rw,868
|
|
23
|
+
python_skills/adapters/roo.py,sha256=yj0BUYQxXC1BDUeW3YdCNQuZHB8bEvzDxK46wf5dr0o,706
|
|
24
|
+
python_skills/adapters/universal.py,sha256=-fiuwa9N2WIUz1P91eb8CXPUCAJ3I2s-Jce_jWJfc0M,7823
|
|
25
|
+
python_skills/adapters/vscode.py,sha256=2wMuqdV_rRlGa9fTpEt1QkMKpdL92uLA5z0SOqWSEKY,855
|
|
26
|
+
python_skills/adapters/windsurf.py,sha256=fDqHNqUVO6oWL02HoicLRIlDmp7bgQFtMCyI2E_CJRk,811
|
|
27
|
+
python_skills/adapters/zed.py,sha256=lAPBckK_JOJpRkW_mRUSTNKIbXsDAtPV2Av9ArMqFOM,754
|
|
28
|
+
python_skills/skills/__init__.py,sha256=ycRYRBmFQJMgHFU_L07e_D24SrVtLSl-9vHS0QcaRKA,341
|
|
29
|
+
python_skills/skills/loader.py,sha256=NuT1b-z9E8vGm0bpxySRqJH-REPbtP6qypah83id8cI,6124
|
|
30
|
+
python_skills/skills/metadata.py,sha256=AHosru5pR-9aP4EEr88Yup2qCDhb4KFmk-LaGooswvg,4840
|
|
31
|
+
python_skills/skills/registry.py,sha256=WzG2OWHQepgcARh9vuJ19898vfZmMcASbh4ghdA2hPU,3167
|
|
32
|
+
skills/advanced_python.md,sha256=S_3i5KxesA-cy1Qv73RHqFSPOd191wwxXGUJseW-cbU,5723
|
|
33
|
+
skills/comprehensions.md,sha256=ee-6d_vQwJc7Mt-mKPUaB5D349VTWfR2BiY0tVKpblk,3746
|
|
34
|
+
skills/control_flow.md,sha256=8qb7PQYq_WD0QYclkH6-n2goMESbZlXN3qsYavmaQVI,3708
|
|
35
|
+
skills/data_structures.md,sha256=VUrysfE-hR-p6CZAfHEuObDNpOctFTcwz2gQ3SFqR-M,5180
|
|
36
|
+
skills/functions.md,sha256=2WKQ8umeR9FewiYvCcLK5wm0qRins5CVbM7Ic6uQfHs,5407
|
|
37
|
+
skills/oop.md,sha256=bZEzrWhwjkj6XoNqTDbzcfSFslWaqtjqjkjCl3DZ8YM,5798
|
|
38
|
+
skills/variables_types.md,sha256=ERl32_qqc_7-4O5GKUp160uSAXfGowTZDG5q0trfujY,3114
|
|
39
|
+
skills/anti_patterns/index.md,sha256=5QIT5cwbIyIJLr35G8rqVHxrsQ_h1X6BldcsjoIRDz8,9696
|
|
40
|
+
skills/debugging/common_bugs.md,sha256=Eez9Mdw9fQ7vEgTr4vIS4NA9SNsgh7Z3cO_s3PUeNbY,4506
|
|
41
|
+
skills/debugging/inspection_techniques.md,sha256=1nMWVnFn4SWALwGlYBN5wSNK8AYqpqnXO0kpdT7pm88,4850
|
|
42
|
+
skills/debugging/root_cause.md,sha256=2sujopmp2E4vlrCtEs2-pmdCeKkSl9fHL6sloExtupY,4761
|
|
43
|
+
skills/engineering/application_logging.md,sha256=Lzq_dPFp5v2TKxq_VvAJcshWXSdVZgz8tvQ_UU0VCCo,5426
|
|
44
|
+
skills/engineering/cli_apps.md,sha256=iaGhtYcmqhRFW7ZyFEhOsOaQprTkRXyNdO4VZFER5Yc,4818
|
|
45
|
+
skills/engineering/configuration.md,sha256=U8MOfi0SfilON5nKqELoxFm8lrAPGuoFsMNz-h94UiY,5070
|
|
46
|
+
skills/engineering/database.md,sha256=rnMqltSYEAggsTb2SA9bh0UR900XUlKolBsEIjre77g,6175
|
|
47
|
+
skills/engineering/dependency_management.md,sha256=Ge30-Wp6dKppF1JV7OIjCHWjW1YqRjHWqB3VlXKjQdI,4592
|
|
48
|
+
skills/engineering/http_clients.md,sha256=9c4kzk11P6hu7OzTyS_H98dG8CQuydx_aQrGpoBzryY,6261
|
|
49
|
+
skills/engineering/modules_packages.md,sha256=zHMzZLHFHpIS_fvHd4mm8mIiQV5e9dkR884t9ZheLn4,4446
|
|
50
|
+
skills/engineering/packaging.md,sha256=QFLcFvOBZ_kz1tQYzB-TNo_MR0_rurE55MkhDxAZz84,3920
|
|
51
|
+
skills/engineering/project_structure.md,sha256=HqcKQibNHBZqKYFl1OWMxQ8jYUEtdLJeKh45jbb8ktw,3882
|
|
52
|
+
skills/engineering/pyproject_toml.md,sha256=xLbncafbjQ61vcLBSjorPdpwvaRNnkZtAoJEieK0S0c,6368
|
|
53
|
+
skills/engineering/virtual_environments.md,sha256=TamynQD9l-TlXwT5xMHaU6AuQrlLvAYPJXgRxcan5h0,4001
|
|
54
|
+
skills/generation/async_concurrency.md,sha256=XwM2h4TRVkQEQBm1uiO5wrOJsUxcL9hC531gcxbjjxI,6739
|
|
55
|
+
skills/generation/error_handling.md,sha256=WOGWGD9u4v-cuNUi0OinzmWpFbHesy-7ZQbURQcGGuE,7664
|
|
56
|
+
skills/generation/protocols_generics.md,sha256=6g0ZKcv4eOmUYoG8vCZ0NajonWbwnftsHQ07Rz_GlJY,5857
|
|
57
|
+
skills/generation/type_hints.md,sha256=E2syRL2QyabuuVdNqD8Ll0Ysy6UAglc1ukN08br7WdU,5925
|
|
58
|
+
skills/generation/validation_pipeline.md,sha256=oVJCVT9imYdLJbn4bP6ux5Cp6Hwdlx0HAhVSu05sgsk,6247
|
|
59
|
+
skills/generation/workflow.md,sha256=4fjs0eYNt9aM0INsIMQovI6I2vM64fhqut09AAC7X_A,4918
|
|
60
|
+
skills/quality/abstractions.md,sha256=iTUpVo_a9WF5-VYe3bKYJc-s6W-E0UVAlCZGBWxbN5c,3602
|
|
61
|
+
skills/quality/comments.md,sha256=adFdzZwcPh1CaHN1i-UPNoXcrokTNgEY6nYL0vIzmQA,4419
|
|
62
|
+
skills/quality/documentation.md,sha256=kkJziNgWH1VL5FlwgYjEoSL2wc4aOmF6m4YaDiVOKCk,3928
|
|
63
|
+
skills/quality/duplication.md,sha256=wI_andgFv7JyZXqWGy7jmHEkg2LWIpDsVDG5O_iVVlA,3821
|
|
64
|
+
skills/quality/maintainability.md,sha256=6UjCa1NjHeaUqSiAsNgb6JHLMfUGtbdBYeoWCEMQO9w,3736
|
|
65
|
+
skills/quality/naming.md,sha256=YSJPnV1-UTAx41qGhTagGWKjg_4OEfuI4n9Sfqm21u4,3742
|
|
66
|
+
skills/quality/quality_functions.md,sha256=ROiKM7r23zVv_uKH_NHr_eEqugpz5iD9_3xsiOG7WpY,6000
|
|
67
|
+
skills/quality/readability.md,sha256=GcZCIyYQt0n9Fgbk-ec6jivy47Pjgbui8JSfqsCYK4Y,5697
|
|
68
|
+
skills/quality/type_annotations.md,sha256=6bJzhy7SCaFvvs66qTPv9Rw9xSRagjQJ2-zNhYkiK1o,4047
|
|
69
|
+
skills/refactoring/behavior_preservation.md,sha256=hh039R1JnlSXRhfYt4tU11YKebojOWH-UG499ud1WJc,4391
|
|
70
|
+
skills/refactoring/incremental.md,sha256=eCwdWnzNzdLeTDR9pToYmg-WrYnH_eWtgVHztJq5wso,4418
|
|
71
|
+
skills/refactoring/interface_stability.md,sha256=63iYHMH9Fq1uocTP3GSJJ-jlQX6cNnsgZVtH5_RJgpk,4384
|
|
72
|
+
skills/refactoring/safe_refactoring.md,sha256=nOrfAkDhm2H_3Blr37j1RkYpOHLJkZPAqCbN6LOrqzw,4564
|
|
73
|
+
skills/security/auth_boundaries.md,sha256=TfiJVvQyY-9aT2BLvqP97-0I68F12cfnjU6mXivd5yM,5421
|
|
74
|
+
skills/security/command_injection.md,sha256=k1e3QiaNbYdlekferBSG8jF6QgXj6Pql-9-mgNF90zs,5155
|
|
75
|
+
skills/security/dependency_risks.md,sha256=dSpqbcrAyyujIiLrrnpG_F-HDmR5IovKvUGchtBqiBw,6495
|
|
76
|
+
skills/security/file_handling.md,sha256=UyhWyyR9CV-XYcSgXjym7nQN1OsiscwD77W_hzD348o,3883
|
|
77
|
+
skills/security/input_validation.md,sha256=u-l5Pn7VBtBKvgRd1NUCWSpXAjF_aAeRyZh8Z89EH3I,4778
|
|
78
|
+
skills/security/path_traversal.md,sha256=HAmlYk5cVFb9nY7maAFwjN2OGNFLPo5BxMEnjxSKWJY,4594
|
|
79
|
+
skills/security/secrets.md,sha256=EKzyvRulzwpcWH9kynIB7h_dOEGluqMt7dw14HC-bV8,4009
|
|
80
|
+
skills/security/sql_injection.md,sha256=0gX0yVvmVg8SOwcKQzueGgnIByC0vRRqRrTcffzIZzo,4781
|
|
81
|
+
skills/security/unsafe_deserialization.md,sha256=FFRloj8pQ8-6EgHa6qslvC1dFtZLCmyyacYT9HndHMU,4154
|
|
82
|
+
skills/stdlib/argparse.md,sha256=YUludAUDMdkRuCZznC7UQX3wX6-LbpGGs1kpaVKu6ug,4245
|
|
83
|
+
skills/stdlib/collections.md,sha256=7tRYLen5FAbIhP5doH6wME-rLzzGIJWqkAQaq1MnCpA,4966
|
|
84
|
+
skills/stdlib/datetime.md,sha256=eoXbRD-qD_1bzdLizBSdddHcW-DrBz79LijVni3ileA,4214
|
|
85
|
+
skills/stdlib/functools.md,sha256=oG2xuXADxX4V1qCDuUs9JGaj6ecIixDqUsgUqzOvsKs,5730
|
|
86
|
+
skills/stdlib/itertools.md,sha256=mzsCEZzccY-0ATIKfqr90VYW2AscnfjkjBEtWT7mIxA,5259
|
|
87
|
+
skills/stdlib/json.md,sha256=zXqfxAJwxaGu3mMHJu8oWDRR6ds6WdnTln0QWKD0l68,4073
|
|
88
|
+
skills/stdlib/logging.md,sha256=fHDoA8Deb9A1LTZlsFA-1Kc4SyPhFQ-NH5WwTCevE2o,4600
|
|
89
|
+
skills/stdlib/os_sys.md,sha256=Yfbe5wbEM8CC35GVCmYQ-0PuFq2398FVVwy33kLcnZo,4553
|
|
90
|
+
skills/stdlib/pathlib.md,sha256=k0dZ8CxzvD6oVtF4OkjU5-dW1wemIAvCv8M_bbqpzAM,5398
|
|
91
|
+
skills/stdlib/re.md,sha256=qd3MjpszZ0qxilneSX_evdILW2qoNVNcXPZiiSkZyvU,3996
|
|
92
|
+
skills/stdlib/statistics.md,sha256=RWEGKk9F3g7qZ2L8JL2muOEzDQ1WjB2qYScsgyR53Cw,2869
|
|
93
|
+
skills/stdlib/subprocess.md,sha256=pUY8-qZ3V-0UhEkk0XIYoWc59QJq8kz8kpMLDDeQUpA,5048
|
|
94
|
+
skills/testing/async_tests.md,sha256=vCY8HTTMrgcwcb4bnsZifd8w8ik4b5XdCjrBtEc8X8o,5708
|
|
95
|
+
skills/testing/coverage.md,sha256=8GBQY51tzfRzZ1__bYO279dic0Rp8EHOBOteM-TdU7g,4148
|
|
96
|
+
skills/testing/edge_cases.md,sha256=2WzudXL5pU3GZGq-3xW9yHO5FC5SE9O1MgyyYild1cQ,5018
|
|
97
|
+
skills/testing/fixtures_mocks.md,sha256=t_IktBaRKveMNV_nZR40FBd4XlGUrsnY5H_4sz7DTW0,5010
|
|
98
|
+
skills/testing/organization.md,sha256=GnzSVvIh_a3C7qb45-63sCcgvC_hnOwnKFmhAA84cBU,4996
|
|
99
|
+
skills/testing/parameterized.md,sha256=7-Qgbz8DYJ4vWVpsNRrpFLy1VnGd9syJROvoYK4hKt0,4549
|
|
100
|
+
skills/testing/regression_tests.md,sha256=n_IUp_pgmzn4vppln0K5NFnGtFaNsSDoty8KgmPJkLc,4499
|
|
101
|
+
python_skills-1.0.0.dist-info/METADATA,sha256=WrV3X4KRBts3GVIeLuz3BSze6Xe2sW1p1OImw-gMnkI,4099
|
|
102
|
+
python_skills-1.0.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
103
|
+
python_skills-1.0.0.dist-info/entry_points.txt,sha256=klwCTcgy9EVbVbdqioVPaR1fDUGYQtwpxKg_3iHKpwg,57
|
|
104
|
+
python_skills-1.0.0.dist-info/licenses/LICENSE,sha256=egSlKb9VmxTz6K41wgslpZPPR_NgGhkYuboy48r0emI,1067
|
|
105
|
+
python_skills-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 FoxPink-dev
|
|
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.
|