Logo Incremental Python Programmer

Incremental Python Programmer

Cộng đồng
ArabelaTso
incremental-python-programmer

Takes a Python repository and natural language feature description as input, implements the feature with proper code placement, generates comprehensive tests, and ensures all tests pass. Use when Claude needs to: (1) Add new features to existing Python projects, (2) Implement functions, classes, or modules based on requirements, (3) Modify existing code to add functionality, (4) Generate unit and integration tests for new code, (5) Fix failing tests after implementation, (6) Ensure code follows existing patterns and conventions.

Tổng quan

Nhà phát hànhArabelaTso
Kho mãSkills-4-SE
Tên kỹ năngincremental-python-programmer
Sao
258
Bản fork
25
Tệp đi kèm
3
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 3 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được ArabelaTso công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Incremental Python Programmer trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/incremental-python-programmer
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git /tmp/Skills-4-SE
mkdir -p .claude/skills
cp -r /tmp/Skills-4-SE/skills/incremental-python-programmer .claude/skills/incremental-python-programmer
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Incremental Python Programmer trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Incremental Python Programmer ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Incremental Python Programmer không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Incremental Python Programmer

Implement new features in Python repositories with automated testing and validation.

Workflow

1. Understand the Feature Request

Parse the request:

  • Identify what functionality is being requested
  • Determine scope (function, class, module, or modification)
  • Understand expected behavior and inputs/outputs
  • Note any specific requirements or constraints

Clarify if needed:

  • Ask about edge cases
  • Confirm integration points
  • Verify expected behavior
  • Check for dependencies

2. Analyze Repository Structure

Automated analysis:

bash
python scripts/analyze_repo_structure.py <repo_path>

Manual analysis:

  • Identify relevant modules and files
  • Understand existing code organization
  • Find similar existing implementations
  • Locate test directory structure
  • Check coding conventions and patterns

Key questions:

  • Where should the new code be placed?
  • What existing code needs modification?
  • What dependencies are needed?
  • What patterns should be followed?

See implementation-patterns.md for common patterns.

3. Plan Implementation

Determine implementation approach:

For new functions:

  • Identify appropriate module
  • Determine function signature
  • Plan implementation logic
  • Identify dependencies

For new classes:

  • Identify appropriate module or create new one
  • Design class structure and methods
  • Plan initialization and attributes
  • Consider inheritance if applicable

For new modules:

  • Determine module name and location
  • Plan module structure
  • Identify exports and public API
  • Plan integration with existing code

For modifications:

  • Identify code to modify
  • Plan backward compatibility
  • Determine parameter additions
  • Plan integration with existing logic

4. Implement the Feature

Follow this order:

Step 1: Add necessary imports

python
# Standard library
import os
from typing import List, Dict, Optional

# Third-party (add to requirements.txt if new)
import requests

# Local imports
from .existing_module import helper_function

Step 2: Implement core functionality

  • Follow existing code style and conventions
  • Use type hints consistently
  • Add docstrings for all public functions/classes
  • Include error handling
  • Follow patterns from similar code

Step 3: Integrate with existing code

  • Update relevant functions/classes
  • Add new module to __init__.py if needed
  • Update configuration if required
  • Ensure backward compatibility

Example: Adding a new function

python
def new_feature_function(param1: str, param2: int = 10) -> dict:
    """
    Brief description of what the function does.

    Args:
        param1: Description of param1
        param2: Description of param2 (default: 10)

    Returns:
        Dictionary containing results

    Raises:
        ValueError: If param1 is empty
        TypeError: If param2 is not an integer
    """
    # Validate inputs
    if not param1:
        raise ValueError("param1 cannot be empty")

    # Implementation
    result = {
        "input": param1,
        "multiplier": param2,
        "output": len(param1) * param2
    }

    return result

Example: Adding a new class

python
class NewFeatureClass:
    """
    Class for handling new feature functionality.

    Attributes:
        attribute1: Description of attribute1
        attribute2: Description of attribute2
    """

    def __init__(self, param1: str, param2: int = 10):
        """
        Initialize NewFeatureClass.

        Args:
            param1: Description
            param2: Description (default: 10)
        """
        self.attribute1 = param1
        self.attribute2 = param2

    def method1(self) -> str:
        """Method description."""
        return f"{self.attribute1}_{self.attribute2}"

    def method2(self, value: int) -> int:
        """Method description."""
        return value * self.attribute2

Example: Modifying existing code

python
# Before
def existing_function(param: str) -> str:
    return param.upper()

# After - adding new parameter with default
def existing_function(param: str, enable_new_feature: bool = False) -> str:
    result = param.upper()
    if enable_new_feature:
        result = apply_new_transformation(result)
    return result

def apply_new_transformation(text: str) -> str:
    """New feature logic."""
    return f"[TRANSFORMED] {text}"

See implementation-patterns.md for detailed patterns.

5. Generate Tests

Identify test requirements:

  • What needs to be tested?
  • What are the edge cases?
  • What are the integration points?
  • What error conditions exist?

Generate unit tests:

python
import pytest
from module import new_feature_function, NewFeatureClass

class TestNewFeatureFunction:
    """Test suite for new_feature_function."""

    def test_basic_functionality(self):
        """Test basic functionality."""
        result = new_feature_function("test", 5)
        assert result["input"] == "test"
        assert result["multiplier"] == 5
        assert result["output"] == 20

    def test_default_parameter(self):
        """Test with default parameter."""
        result = new_feature_function("hello")
        assert result["multiplier"] == 10
        assert result["output"] == 50

    def test_empty_string_raises_error(self):
        """Test that empty string raises ValueError."""
        with pytest.raises(ValueError, match="cannot be empty"):
            new_feature_function("", 5)

    @pytest.mark.parametrize("input_str,multiplier,expected", [
        ("a", 1, 1),
        ("ab", 2, 4),
        ("abc", 3, 9),
    ])
    def test_various_inputs(self, input_str, multiplier, expected):
        """Test with various inputs."""
        result = new_feature_function(input_str, multiplier)
        assert result["output"] == expected


class TestNewFeatureClass:
    """Test suite for NewFeatureClass."""

    @pytest.fixture
    def instance(self):
        """Create instance for testing."""
        return NewFeatureClass("test", 5)

    def test_initialization(self, instance):
        """Test class initialization."""
        assert instance.attribute1 == "test"
        assert instance.attribute2 == 5

    def test_method1(self, instance):
        """Test method1."""
        result = instance.method1()
        assert result == "test_5"

    def test_method2(self, instance):
        """Test method2."""
        result = instance.method2(3)
        assert result == 15

Generate integration tests if needed:

python
def test_integration_with_existing_code():
    """Test that new feature integrates with existing code."""
    # Setup
    data = prepare_test_data()

    # Execute workflow using new feature
    result = existing_workflow(data, use_new_feature=True)

    # Verify
    assert result["status"] == "success"
    assert "new_feature_output" in result

See testing-strategies.md for comprehensive testing patterns.

6. Run Tests

Execute test suite:

bash
# Run all tests
pytest

# Run with coverage
pytest --cov=module --cov-report=term-missing

# Run specific test file
pytest tests/test_new_feature.py

# Run with verbose output
pytest -v

Check results:

  • All tests should pass
  • Coverage should be adequate (>80% for new code)
  • No regressions in existing tests

7. Fix Failing Tests

If tests fail, diagnose and fix:

Common issues:

1. Assertion failures

  • Check expected vs actual values
  • Verify test logic
  • Fix implementation or test

2. Import errors

  • Verify module paths
  • Check __init__.py exports
  • Ensure dependencies installed

3. Type errors

  • Check function signatures
  • Verify parameter types
  • Update type hints if needed

4. Logic errors

  • Debug implementation
  • Add print statements
  • Use pytest debugger: pytest --pdb

Example fix:

python
# Failing test
def test_calculation():
    result = calculate(5, 3)
    assert result == 15  # AssertionError: assert 8 == 15

# Diagnosis: Expected value is wrong
# Fix: Update test expectation
def test_calculation():
    result = calculate(5, 3)
    assert result == 8  # Corrected

See testing-strategies.md for test fixing strategies.

8. Verify and Document

Final verification:

  • All tests pass
  • Code follows existing conventions
  • Documentation is complete
  • No regressions introduced
  • Integration points work correctly

Documentation checklist:

  • Docstrings for all public functions/classes
  • Type hints for parameters and returns
  • Examples in docstrings if complex
  • Update README if needed
  • Add comments for complex logic

Summary to provide:

  1. Files modified/created:

    • List all changed files
    • Indicate new vs modified
  2. Implementation summary:

    • What was implemented
    • Key design decisions
    • Integration points
  3. Tests added:

    • Number of tests
    • Coverage achieved
    • Test types (unit/integration)
  4. Test results:

    • All tests passing
    • Coverage percentage
    • Any notes or warnings

Implementation Guidelines

Code Placement

Functions:

  • Add to existing module if related functionality exists
  • Create new module if distinct feature area
  • Place after imports and constants
  • Group related functions together

Classes:

  • Add to existing module if related
  • Create new module for new feature areas
  • Place after imports and before functions
  • Follow existing class organization

Modules:

  • Create in appropriate package directory
  • Follow existing naming conventions
  • Add to __init__.py for public API
  • Include module docstring

Code Style

Follow existing conventions:

  • Indentation (spaces vs tabs)
  • Line length limits
  • Naming conventions (snake_case, PascalCase)
  • Import organization
  • Docstring style (Google, NumPy, etc.)

Type hints:

  • Use for all function parameters
  • Use for return values
  • Import from typing module
  • Be specific (List[str] not just List)

Error handling:

  • Validate inputs
  • Raise appropriate exceptions
  • Include error messages
  • Follow existing error patterns

Testing Best Practices

Test coverage:

  • Test all public functions/methods
  • Test edge cases and boundaries
  • Test error conditions
  • Test integration points

Test organization:

  • One test file per module
  • Group related tests in classes
  • Use descriptive test names
  • Use fixtures for setup

Test quality:

  • Tests should be independent
  • Tests should be fast
  • Tests should be deterministic
  • Tests should be readable

Common Scenarios

Scenario 1: Add New Function to Existing Module

Request: "Add a function to validate email addresses"

Steps:

  1. Analyze: Find appropriate module (e.g., validators.py)
  2. Implement: Add validate_email() function
  3. Test: Create test_validate_email() with various cases
  4. Verify: Run tests, ensure all pass

Scenario 2: Add New Class

Request: "Create a UserManager class to handle user operations"

Steps:

  1. Analyze: Determine if new module needed or add to existing
  2. Implement: Create UserManager class with methods
  3. Test: Create TestUserManager class with method tests
  4. Verify: Run tests, check integration

Scenario 3: Modify Existing Function

Request: "Add optional caching to the data_loader function"

Steps:

  1. Analyze: Understand current implementation
  2. Implement: Add cache parameter and logic
  3. Test: Add tests for cached and non-cached behavior
  4. Verify: Run all tests including existing ones

Scenario 4: Add New Module

Request: "Add a reporting module with PDF generation"

Steps:

  1. Analyze: Plan module structure and dependencies
  2. Implement: Create reporting.py with functions/classes
  3. Test: Create test_reporting.py with comprehensive tests
  4. Verify: Run tests, update __init__.py

Troubleshooting

Implementation Issues

Problem: Don't know where to place code

  • Solution: Look for similar functionality in codebase
  • Use repository analyzer script
  • Follow existing module organization

Problem: Unclear how to integrate with existing code

  • Solution: Find similar integration points
  • Check how existing features are integrated
  • Ask for clarification if needed

Problem: Missing dependencies

  • Solution: Check requirements.txt
  • Look at imports in similar modules
  • Add to requirements.txt if new

Testing Issues

Problem: Tests fail after implementation

  • Solution: Read error messages carefully
  • Check test expectations
  • Debug implementation
  • Fix code or tests as appropriate

Problem: Low test coverage

  • Solution: Run coverage report
  • Identify uncovered lines
  • Add tests for uncovered code

Problem: Tests are flaky

  • Solution: Check for timing issues
  • Remove randomness
  • Ensure test independence
  • Use mocks for external dependencies

Best Practices

Implementation

  • Start with simplest solution
  • Follow existing patterns
  • Write clean, readable code
  • Add comprehensive documentation
  • Consider edge cases

Testing

  • Write tests as you implement
  • Test behavior, not implementation
  • Use descriptive test names
  • Keep tests simple and focused
  • Aim for high coverage

Integration

  • Ensure backward compatibility
  • Test integration points
  • Update documentation
  • Consider migration path if breaking changes

Quality

  • Run all tests before finishing
  • Check code style consistency
  • Review error handling
  • Verify documentation completeness
  • Test edge cases thoroughly

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Incremental Python Programmer làm được gì?

Takes a Python repository and natural language feature description as input, implements the feature with proper code placement, generates comprehensive tests, and ensures all tests pass. Use when Claude needs to: (1) Add new features to existing Python projects, (2) Implement functions, classes, or modules based on requirements, (3) Modify existing code to add functionality, (4) Generate unit and integration tests for new code, (5) Fix failing tests after implementation, (6) Ensure code follows existing patterns and conventions.

Vì sao nên dùng Incremental Python Programmer trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Incremental Python Programmer là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Incremental Python Programmer trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/incremental-python-programmer. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Incremental Python Programmer?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Incremental Python Programmer với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Incremental Python Programmer với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Incremental Python Programmer có miễn phí không?

Có. Kỹ năng này được ArabelaTso phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇