Coding.make function private

From causify-ai/helpers · View interactive version

Coding.make function private is an AI agent skill from the GitHub repository causify-ai/helpers. Identify private or public functions in a file and rename with underscore

How to use this skill

Skill file

Goal

For each function <FUNC> in the passed Python file <FILE>, determine if it

should be private or public by checking if it's called by Python files or

Jupyter notebooks outside <FILE>.

Conventions

Definitions

External Files

file

from lib_notes_to_pdf.py)

it's called by a test files

PUBLIC, even if they're not called from a __main__ entry point. If a module

exports utility functions for use by other scripts in the package, those are

PUBLIC functions

Private Functions

a private function and should be renamed and prepended with a _

```python

# lib_helper.py

def public_function():

_internal_helper() # Only called within this file, so private.

def _internal_helper():

pass

```

Public Functions

public function and its name must not start with _

name

```python

# lib_notes_to_pdf.py

def preprocess_notes(file_name, prefix): # Called by notes_to_pdf.py, so public.

_internal_step_1(file_name) # Private helper.

def _internal_step_1(file_name): # Only used within lib_notes_to_pdf.py, so private.

pass

```

Workflow

Find All Functions

Search for External Calls

```bash

grep -r "<FUNC>" --include=".py" --include=".ipynb" --exclude="test_*.py"

```

Classify and Rename

Verification

correctly

```bash

grep -r "old_name\|new_name" --include=".py" --include=".ipynb"

```

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.