This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- Rules (
.claude/rules/): Automatically loaded based on file paths. Source of truth for project conventions. - Skills (
.agents/skills/,.claude/skills/): Managed by Nix via agent-skills-nix. Skills are sourced from StackOneHQ/skills and installed automatically when enteringnix develop. - Cursor rules (
.cursor/rules/): Symlinks to.claude/rules/for consistency.
| Skill | Usage | Description |
|---|---|---|
| release-please | /release-please <version> |
Trigger a release-please PR for a specific version |
| Rule | Applies To | Description |
|---|---|---|
| git-workflow | All files | Commit conventions, branch strategy, PR guidelines |
| development-workflow | All files | Code style, file naming, project conventions |
| release-please-standards | All files | Release versioning with release-please |
| nix-workflow | All files | Nix development environment and CI configuration |
| no-relative-imports | **/*.py |
Enforce absolute imports in Python files |
| package-installation | **/pyproject.toml |
UV package management standards |
| uv-scripts | scripts/**/*.py |
Utility script standards with UV |
| examples-standards | examples/**/* |
Example requirements and organization |
| Skill | Description |
|---|---|
| just-commands | Available just commands (dynamically loaded) |
StackOne AI SDK is a Python library that provides a unified interface for accessing various SaaS tools through AI-friendly APIs with support for OpenAI, LangChain, CrewAI, and Model Context Protocol (MCP).
-
StackOneToolSet (
stackone_ai/toolset.py): Main entry point- Handles authentication (API key + optional account ID)
- Manages tool loading with glob pattern filtering
- Provides format converters for OpenAI/LangChain
-
Models (
stackone_ai/models.py): Data structuresStackOneTool: Base class with execution logicTools: Container for managing multiple tools- Format converters for different AI frameworks
# Use glob patterns for tool selection
tools = StackOneToolSet(include_tools=["bamboohr_*", "!bamboohr_create_*"])# Uses environment variables or direct configuration
toolset = StackOneToolSet(
api_key="your-api-key", # or STACKONE_API_KEY env var
account_id="optional-id" # explicit account ID required
)- Full type annotations required (Python 3.10+)
- Strict ty configuration
- Use generics for better IDE support
- Snapshot testing for tool parsing (
tests/snapshots/) - Async tests use
pytest-asyncio - See
examples-standardsrule for example validation
- Dependencies: See
package-installationrule for uv dependency management - Pre-commit: Hooks configured for ruff and ty - run on all commits
- Python Version: Requires Python >=3.10
- Error Handling: Custom exceptions (
StackOneError,StackOneAPIError) - File Uploads: Binary parameters auto-detected from OpenAPI specs
- Context Window: Tool loading warns when loading all tools (large context)
- Add OpenAPI spec to
stackone_ai/oas/ - Parser automatically converts to tool definitions
- Test with
make test-tools
- Core execution logic in
StackOneTool.execute()method - HTTP configuration via
ExecuteConfigclass - Response handling in
_process_response()