Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions .agents/skills/python-docs-samples/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
```markdown
# python-docs-samples Development Patterns

> Auto-generated skill from repository analysis

## Overview

This skill teaches the core development patterns and workflows used in the `python-docs-samples` repository. It covers coding conventions for Python sample code, including file naming, import/export styles, and commit message patterns. It also documents the main workflow for bulk dependency updates across multiple sample projects, and provides guidance on testing patterns and useful automation commands.

## Coding Conventions

### File Naming

- **Style:** kebab-case (lowercase words separated by hyphens)
- **Example:**
```
bigquery-quickstart.py
storage-upload-file.py
```

### Import Style

- **Style:** Relative imports are preferred within packages.
- **Example:**
```python
from . import helper_module
from .utils import parse_config
```

### Export Style

- **Style:** Named exports (explicitly define what is exported)
- **Example:**
```python
__all__ = ['main', 'helper_function']
```

### Commit Message Patterns

- **Type:** Conventional commits
- **Prefix:** `chore`
- **Example:**
```
chore: update requirements for security patches
```

## Workflows

### Bulk Dependency Update for Pip Requirements

**Trigger:**
When dependencies need to be updated across multiple Python sample directories for consistency, security, or new features.

**Command:** `/bulk-update-dependencies`

**Step-by-step Instructions:**

1. **Identify Out-of-Date Dependencies**
Use tools like `pip list --outdated` or automated bots (e.g., Dependabot) to find outdated dependencies in each subproject.

2. **Update Dependency Versions**
Edit the following files in each affected directory to update the relevant dependencies:
- `requirements-test.txt`
- `requirements.txt`
- `constraints.txt`
- Optionally, `setup.py` if present

**Example:**
```diff
- pytest==6.2.5
+ pytest==7.1.2
```

3. **Commit All Changes**
Make a single commit with a detailed message listing all updated dependencies and their new versions.

**Example commit message:**
```
chore: bulk update dependencies (pytest 7.1.2, lxml 4.9.1, pyarrow 8.0.0)
```

4. **(Optional) Run Tests**
Ensure that all tests pass after the update.

**Files Involved:**
- `**/requirements-test.txt`
- `**/requirements.txt`
- `**/constraints.txt`
- `**/setup.py`

**Frequency:**
~2-4 times per month

---

## Testing Patterns

- **Framework:** Not explicitly detected; likely uses `pytest` or similar.
- **Test File Pattern:** Files matching `*.test.*` (e.g., `bigquery_quickstart.test.py`)
- **Example Test File:**
```python
def test_main():
assert main() == "Hello, World!"
```

---

## Commands

| Command | Purpose |
|---------------------------|-----------------------------------------------------------------|
| /bulk-update-dependencies | Update all pip requirements across subprojects in bulk |

```
6 changes: 6 additions & 0 deletions .agents/skills/python-docs-samples/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
interface:
display_name: "Python Docs Samples"
short_description: "Repo-specific patterns and workflows for python-docs-samples"
default_prompt: "Use the python-docs-samples repo skill to follow existing architecture, testing, and workflow conventions."
policy:
allow_implicit_invocation: true
39 changes: 39 additions & 0 deletions .claude/commands/bulk-dependency-update-pip-requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: bulk-dependency-update-pip-requirements
description: Workflow command scaffold for bulk-dependency-update-pip-requirements in python-docs-samples.
allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"]
---

# /bulk-dependency-update-pip-requirements

Use this workflow when working on **bulk-dependency-update-pip-requirements** in `python-docs-samples`.

## Goal

Updates Python dependencies (such as pytest, pyarrow, lxml, apache-airflow, keras, nbconvert, etc.) across many subproject requirements files in a mono-repo, typically via automated tooling like Dependabot.

## Common Files

- `**/requirements-test.txt`
- `**/requirements.txt`
- `**/constraints.txt`
- `**/setup.py`

## Suggested Sequence

1. Understand the current state and failure mode before editing.
2. Make the smallest coherent change that satisfies the workflow goal.
3. Run the most relevant verification for touched files.
4. Summarize what changed and what still needs review.

## Typical Commit Signals

- Identify out-of-date dependencies across all subprojects.
- Update the relevant dependency version(s) in requirements-test.txt, requirements.txt, and constraints.txt files in each affected directory.
- Optionally update setup.py if present.
- Commit all changes in a single commit with a detailed message listing all updated dependencies and versions.

## Notes

- Treat this as a scaffold, not a hard-coded script.
- Update the command if the workflow evolves materially.
Loading