-
Notifications
You must be signed in to change notification settings - Fork 25
adding AGENTS.md #428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
adding AGENTS.md #428
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
405bc3e
adding AGENTS.md
Borda a23a2fe
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e21fe44
Update AGENTS.md
Borda 44900af
update gpt5
Borda c7ceb6f
Merge branch 'main' into add/AGENTS.md
Borda f9747b0
links
Borda fffb5ab
Merge branch 'add/AGENTS.md' of https://github.com/Lightning-AI/utili…
Borda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,166 @@ | ||
| # AGENTS.md | ||
|
|
||
| This document identifies and describes all agent and agent-like components in the [Lightning-AI/utilities](https://github.com/Lightning-AI/utilities) repository. Agents are defined as independently-triggerable components responsible for automating tasks, orchestrating workflows, or executing delegated utility operations. For each agent, its **name**, **purpose**, **functionality**, and **relative file location** are given. | ||
|
|
||
| ______________________________________________________________________ | ||
|
|
||
| ## 1. GitHub Workflow Agents | ||
|
|
||
| ### Agent: check-schema | ||
|
|
||
| - **Purpose**: Validates configuration or data schema on code pushes. | ||
| - **Functionality**: Automatically runs schema checks as a job for every push, using centralized logic. | ||
| - **Relative Location**: `.github/workflows/check-schema.yml` | ||
|
|
||
| ### Agent: check-code | ||
|
|
||
| - **Purpose**: Ensures code quality and standards compliance before merging or release. | ||
| - **Functionality**: Runs code style, lint, and other static analysis checks. | ||
| - **Relative Location**: `.github/workflows/check-code.yml` | ||
|
|
||
| ### Agent: ci-use-checks | ||
|
|
||
| - **Purpose**: Coordinates schema and code validation jobs for broad CI coverage. | ||
| - **Functionality**: Calls multiple reusable workflows; acts as a top-level CI orchestrator. | ||
| - **Relative Location**: `.github/workflows/ci-use-checks.yaml` | ||
|
|
||
| ### Agent: cron-clear-cache | ||
|
|
||
| - **Purpose**: Maintains clean build environments by scheduled cache clearance. | ||
| - **Functionality**: Invokes Python/environment cache clearing on a weekly schedule to keep CI fast. | ||
| - **Relative Location**: `.github/workflows/cron-clear-cache.yml` | ||
|
|
||
| ______________________________________________________________________ | ||
|
|
||
| ## 2. GitHub Composite Actions | ||
|
|
||
| ### Agent: cache | ||
|
|
||
| - **Purpose**: Facilitates caching of Python dependencies and environments. | ||
| - **Functionality**: Stores and restores pip/wheel caches, reducing CI overhead and redundant downloads. | ||
| - **Relative Location**: `.github/actions/cache` | ||
|
|
||
| ### Agent: setup-python (in workflows) | ||
|
|
||
| - **Purpose**: Sets up specified Python version for CI jobs. | ||
| - **Functionality**: Ensures a clean Python install with exact version matching workflow needs. | ||
| - **Relative Location**: Referenced in `.github/workflows/*.yml` | ||
|
|
||
| ______________________________________________________________________ | ||
|
|
||
| ## 3. CLI Utility Agents | ||
|
|
||
| ### Agent: lightning_utilities.cli.requirements | ||
|
|
||
| - **Purpose**: Automates manipulation of requirements files for testing compatibility. | ||
| - **Functionality**: CLI group for managing and editing dependency specification (e.g., pinning constraints). | ||
| - **Relative Location**: `src/lightning_utilities/cli/requirements.py` | ||
|
|
||
| ### Agent: lightning_utilities.cli.run | ||
|
|
||
| - **Purpose**: Provides entry point for executing Python scripts. | ||
| - **Functionality**: Runs user-specified scripts/modules with logging and reproducibility enhancements. | ||
| - **Relative Location**: `src/lightning_utilities/cli/run.py` | ||
|
|
||
| ### Agent: lightning_utilities.cli.install | ||
|
|
||
| - **Purpose**: Automates Python dependency installation. | ||
| - **Functionality**: CLI agent for installing required packages with optional command-line constraints or options. | ||
| - **Relative Location**: `src/lightning_utilities/cli/install.py` | ||
|
|
||
| ### Agent: lightning_utilities.cli.console | ||
|
|
||
| - **Purpose**: Manages output, error, and logging for CLI commands. | ||
| - **Functionality**: Formats and routes output, controls verbosity, and ensures consistent messaging. | ||
| - **Relative Location**: `src/lightning_utilities/cli/console.py` | ||
|
|
||
| ### Agent: lightning_utilities.cli.run_app | ||
|
|
||
| - **Purpose**: Launches application modules through the CLI. | ||
| - **Functionality**: Orchestrates app startup and configuration via command-line interface. | ||
| - **Relative Location**: `src/lightning_utilities/cli/run_app.py` | ||
|
|
||
| ______________________________________________________________________ | ||
|
|
||
| ## 4. Core Python Utility Agents | ||
|
|
||
| ### Agent: module_available (from core.imports) | ||
|
|
||
| - **Purpose**: Checks runtime availability of a named module or package. | ||
| - **Functionality**: Returns Boolean status for importability; supports conditional execution patterns. | ||
| - **Relative Location**: `src/lightning_utilities/core/imports.py` | ||
|
|
||
| ### Agent: RequirementCache | ||
|
|
||
| - **Purpose**: Encapsulates package requirement availability and version checks. | ||
| - **Functionality**: Determines if current environment meets module/package specs, with diagnostics. | ||
| - **Relative Location**: `src/lightning_utilities/core/imports.py` | ||
|
|
||
| ### Agent: LazyModule | ||
|
|
||
| - **Purpose**: Defers import of a Python module until actually accessed. | ||
| - **Functionality**: Creates a proxy agent for cost-saving, lazy import pattern on first attribute look-up. | ||
| - **Relative Location**: `src/lightning_utilities/core/imports.py` | ||
|
|
||
| ### Agent: requires (decorator) | ||
|
|
||
| - **Purpose**: Ensures that decorated routines only execute if required modules/packages are present. | ||
| - **Functionality**: Throws warning or error if preconditions not met, halting execution. | ||
| - **Relative Location**: `src/lightning_utilities/core/imports.py` | ||
|
|
||
| ### Agent: apply_func | ||
|
|
||
| - **Purpose**: Applies a function recursively to all items within complex/nested data collections. | ||
| - **Functionality**: Recursively transforms dicts, lists, tuples with a callable, supporting agent-style iteration. | ||
| - **Relative Location**: `src/lightning_utilities/core/apply_func.py` | ||
|
|
||
| ### Agent: packaging | ||
|
|
||
| - **Purpose**: Parses, verifies and resolves package metadata and versions. | ||
| - **Functionality**: Provides robust version and compatibility checking for automation and CI tasks. | ||
| - **Relative Location**: `src/lightning_utilities/core/packaging.py` | ||
|
|
||
| ______________________________________________________________________ | ||
|
|
||
| ## 5. Agent-like Scripts | ||
|
|
||
| ### Agent: install.sh | ||
|
|
||
| - **Purpose**: Automates environment setup and dependency installation. | ||
| - **Functionality**: Executable shell script for batch installations, often called in setup routines. | ||
| - **Relative Location**: `scripts/install.sh` | ||
|
|
||
| ### Agent: (other scripts) | ||
|
|
||
| - **Purpose**: (Varies) May provide changelog, release, or status automation. | ||
| - **Functionality**: Targeted agents for specialized project tasks. | ||
| - **Relative Location**: `scripts/` (per script) | ||
|
|
||
| ______________________________________________________________________ | ||
|
|
||
| ## 6. Orchestration and Decision Agents | ||
|
|
||
| ### Agent pattern: Declarative workflow orchestration | ||
|
|
||
| - **Purpose**: Enables CI jobs and composite actions to trigger, communicate, and conditionally execute based on context or outputs. | ||
| - **Functionality**: Uses matrix, outputs, and conditional logic in YAML to link agent logic across jobs. | ||
| - **Relative Location**: `.github/workflows/*.yml` (see usage of `needs`, `if`, `with`, outputs) | ||
|
|
||
| ### Agent pattern: Enum/decisionflow agents | ||
|
|
||
| - **Purpose**: Encodes execution paths and decisions for agents. | ||
| - **Functionality**: Provides enumerated constants used throughout automation logic. | ||
| - **Relative Location**: `src/lightning_utilities/core/enums.py` | ||
|
|
||
| ______________________________________________________________________ | ||
|
|
||
| ## AGENTS.md Conventions | ||
|
|
||
| - Document each agent by **name**, **purpose**, **functionality**, and **location**. | ||
| - Use flat Markdown headings for agent categories and individual agents. | ||
| - Reference file locations relative to repository root. | ||
| - Update and expand this file as new agents, utilities, CLI commands, or automation scripts are introduced. | ||
| - Align all documentation with [standard AGENTS.md conventions](https://github.com/openai/agents.md), [Agent Rules](https://agent-rules.org/), and [modern markdown guidelines](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax). | ||
| - Keep instructions clear, explicit, and brief for both human collaborators and machine/agent consumers. | ||
|
|
||
| ______________________________________________________________________ | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.