# Send Python Coding Guidelines to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "python",
    "name": "Python Coding Guidelines",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/adarshdigievo/python",
    "canonicalUrl": "https://clawhub.ai/adarshdigievo/python",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/python",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=python",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "python",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T15:55:00.593Z",
      "expiresAt": "2026-05-14T15:55:00.593Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=python",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=python",
        "contentDisposition": "attachment; filename=\"python-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "python"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/python"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/python",
    "downloadUrl": "https://openagent3.xyz/downloads/python",
    "agentUrl": "https://openagent3.xyz/skills/python/agent",
    "manifestUrl": "https://openagent3.xyz/skills/python/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/python/agent.md"
  }
}
```
## Documentation

### Code Style (PEP 8)

4 spaces for indentation (never tabs)
Max line length: 88 chars (Black default) or 79 (strict PEP 8)
Two blank lines before top-level definitions, one within classes
Imports: stdlib → third-party → local, alphabetized within groups
Snake_case for functions/variables, PascalCase for classes, UPPER_CASE for constants

### Before Committing

# Syntax check (always)
python -m py_compile *.py

# Run tests if present
python -m pytest tests/ -v 2>/dev/null || python -m unittest discover -v 2>/dev/null || echo "No tests found"

# Format check (if available)
ruff check . --fix 2>/dev/null || python -m black --check . 2>/dev/null

### Python Version

Minimum: Python 3.10+ (3.9 EOL Oct 2025)
Target: Python 3.11-3.13 for new projects
Never use Python 2 syntax or patterns
Use modern features: match statements, walrus operator, type hints

### Dependency Management

Check for uv first, fall back to pip:

# Prefer uv if available
if command -v uv &>/dev/null; then
    uv pip install <package>
    uv pip compile requirements.in -o requirements.txt
else
    pip install <package>
fi

For new projects with uv: uv init or uv venv && source .venv/bin/activate

### Pythonic Patterns

# ✅ List/dict comprehensions over loops
squares = [x**2 for x in range(10)]
lookup = {item.id: item for item in items}

# ✅ Context managers for resources
with open("file.txt") as f:
    data = f.read()

# ✅ Unpacking
first, *rest = items
a, b = b, a  # swap

# ✅ EAFP over LBYL
try:
    value = d[key]
except KeyError:
    value = default

# ✅ f-strings for formatting
msg = f"Hello {name}, you have {count} items"

# ✅ Type hints
def process(items: list[str]) -> dict[str, int]:
    ...

# ✅ dataclasses/attrs for data containers
from dataclasses import dataclass

@dataclass
class User:
    name: str
    email: str
    active: bool = True

# ✅ pathlib over os.path
from pathlib import Path
config = Path.home() / ".config" / "app.json"

# ✅ enumerate, zip, itertools
for i, item in enumerate(items):
    ...
for a, b in zip(list1, list2, strict=True):
    ...

### Anti-patterns to Avoid

# ❌ Mutable default arguments
def bad(items=[]):  # Bug: shared across calls
    ...
def good(items=None):
    items = items or []

# ❌ Bare except
try:
    ...
except:  # Catches SystemExit, KeyboardInterrupt
    ...
except Exception:  # Better
    ...

# ❌ Global state
# ❌ from module import * 
# ❌ String concatenation in loops (use join)
# ❌ == None (use \`is None\`)
# ❌ len(x) == 0 (use \`not x\`)

### Testing

Use pytest (preferred) or unittest
Name test files test_*.py, test functions test_*
Aim for focused unit tests, mock external dependencies
Run before every commit: python -m pytest -v

### Docstrings

def fetch_user(user_id: int, include_deleted: bool = False) -> User | None:
    """Fetch a user by ID from the database.
    
    Args:
        user_id: The unique user identifier.
        include_deleted: If True, include soft-deleted users.
    
    Returns:
        User object if found, None otherwise.
    
    Raises:
        DatabaseError: If connection fails.
    """

### Quick Checklist

Syntax valid (py_compile)
 Tests pass (pytest)
 Type hints on public functions
 No hardcoded secrets
 f-strings, not .format() or %
 pathlib for file paths
 Context managers for I/O
 No mutable default args
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: adarshdigievo
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-07T15:55:00.593Z
- Expires at: 2026-05-14T15:55:00.593Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/python)
- [Send to Agent page](https://openagent3.xyz/skills/python/agent)
- [JSON manifest](https://openagent3.xyz/skills/python/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/python/agent.md)
- [Download page](https://openagent3.xyz/downloads/python)