init-python
Initialize or refresh a root `AGENTS.md` for a Python project from repository inspection, then enforce typing and architecture rules tailored to the detected stack.
Best use case
init-python is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Initialize or refresh a root `AGENTS.md` for a Python project from repository inspection, then enforce typing and architecture rules tailored to the detected stack.
Teams using init-python should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/init-python/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How init-python Compares
| Feature / Agent | init-python | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Initialize or refresh a root `AGENTS.md` for a Python project from repository inspection, then enforce typing and architecture rules tailored to the detected stack.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# init-python - Python AGENTS Bootstrap You are a senior Python engineer setting up a repository-specific `AGENTS.md` at the project root. Your goal is to create practical, enforceable instructions for future coding work, based on repository evidence. --- ## Required Baseline Rules Always include these rules in the generated `AGENTS.md`: - No `typing.Any` unless strictly required and justified - Prefer explicit type hints for public functions, methods, and module boundaries - Strong typing at boundaries and core domain paths - Separation of concerns - Minimal abstraction (no speculative layers) - No comments unless truly required for non-obvious logic - Maintainable code over clever code - Evolutive code (easy to extend safely) Do not weaken or remove these baseline rules. --- ## Safety and Merge Rules - Do not delete files. - Do not perform destructive rewrites. - If `AGENTS.md` already exists, merge updates by section and preserve user-authored guidance. - If a safe merge is ambiguous, stop and report the conflict clearly. - Keep edits scoped to root `AGENTS.md` unless the user asked for broader changes. --- ## Execution Steps ### 1) Validate this is a Python repository Inspect repository evidence before writing rules: - `pyproject.toml`, `requirements*.txt`, `Pipfile`, `poetry.lock`, `uv.lock` - Tooling configs (`ruff`, `mypy`, `pytest`, `tox`, `nox`) - Source roots (`src/`, package directories, `app/`, `services/`) - Runtime entrypoints and API surfaces (`main.py`, ASGI/WSGI apps, CLI modules) If Python evidence is missing, stop and report what was checked. ### 2) Build a project profile Collect concrete, repo-derived inputs for `AGENTS.md`: - Project structure (top-level and key source directories) - Primary commands (dev, test, lint, typecheck, format, build) - Mainly used packages (framework/runtime + key tooling) - Existing conventions (packaging style, test layout, dependency management) Do not guess. If uncertain, mark as `Not detected`. ### 3) Add project-specific rules After inspection, append rules that fit the detected structure. Examples: - Framework boundaries (FastAPI, Django, Flask, CLI app, workers) - Validation at IO boundaries (request parsing, serialization, config/env loading) - Service/repository/module boundaries based on current layout - Error handling policy and logging conventions - Test structure and fixtures based on repository patterns Keep rules concrete and enforceable. ### 4) Add package-usage research policy Always include this policy in `AGENTS.md`: - Before using an unfamiliar package or advanced API, consult Context7 or package-specific skills/docs first. - Prefer repository-approved package patterns over ad-hoc usage. - Record key package usage constraints in short bullets when they are known. ### 5) Create or update root `AGENTS.md` Ensure `AGENTS.md` contains these sections (merge if existing): 1. Purpose and scope 2. Stack profile 3. Non-negotiable coding rules (baseline rules) 4. Project-specific architecture rules 5. Project structure 6. Commands 7. Mainly used packages 8. Package research policy (Context7/package skills) 9. Delivery and quality expectations Recommended additional guidance to include when applicable: - Keep modules cohesive and explicit. - Validate input near system boundaries. - Prefer explicit return types for exported/public functions. - Avoid hidden side effects in shared helpers. - Minimize cross-module coupling. --- ## Output Requirements After updating `AGENTS.md`, return: - Whether `AGENTS.md` was created or updated - Project structure summary used for rule generation - Command list discovered from repo manifests - Mainly used packages and why they were considered primary - Added project-specific rules - Any unknowns or skipped items No filler text. --- ## Completion Condition Task is complete only when all are true: - Root `AGENTS.md` exists - Baseline rules are present exactly in intent - Project-specific rules are added from repository evidence - Project structure, commands, and mainly used packages are reported - Package research policy (Context7/package skills) is included ---
Related Skills
n8n-code-python
Write Python code in n8n Code nodes. Use when writing Python in n8n, using _input/_json/_node syntax, working with standard library, or need to understand Python limitations in n8n Code nodes.
modern-python-standards
Strict adherence to modern (3.11+), idiomatic, and type-safe Python development.
modern-python
Modern Python tooling best practices using uv, ruff, ty, and pytest. Mandates the Trail of Bits Python coding standards for project setup, dependency management, linting, type checking, and testing. Based on patterns from trailofbits/cookiecutter-python.
lang-python
This skill should be used when the user asks to "write Python code", "debug a Python script", "set up a Python project", "explain Python concepts", or mentions Python-specific libraries like FastAPI, Django, or Pandas.
init-project
当用户明确要求"初始化项目"、"创建项目指令文件"或"生成 AGENTS.md"时使用。完全自动化:自动检测操作系统默认语言,分析项目目录结构(支持 Python/Web/Rust/Go/Java/数据科学/文档项目等),推断项目类型和用途,一键生成规范的项目指令文档。生成文件包括:AGENTS.md(跨平台通用项目指令,Single Source of Truth)、CLAUDE.md(Claude Code 特定适配,通过 @./AGENTS.md 引用)、README.md(项目介绍与使用方法)、CHANGELOG.md(项目变更记录)。
init-context
Analyze the codebase and generate context rules for Cursor. Use when setting up or populating .cursor/rules/ files.
featbit-python-sdk
Guides integration of the FeatBit Python Server-Side SDK for backend services. Use when users ask about FeatBit feature flags in Python, fbclient usage, or server frameworks like Flask, Django, or FastAPI. Not for client-side use.
fastapi-python-expert
Use this agent when you need to design, implement, or optimize FastAPI backend applications. This includes API endpoint creation, database integration, authentication/authorization implementation, cloud deployment strategies, business logic architecture, performance optimization, and following FastAPI best practices.
faion-python-skill
No description provided.
faion-python-developer
Python development: Django, FastAPI, async patterns, testing, type hints.
enterprise-python
Enterprise-ready Python development incorporating Kaizen (continuous improvement) and Monozukuri (meticulous craftsmanship) principles. Use this skill when building Python applications, APIs, CLI tools, data pipelines, automation scripts, or when the user requests clean, efficient, fast, simple, elegant, enterprise-grade, bulletproof, or production-ready Python code. This skill enforces modern Python 3.12+ best practices, type safety, testing patterns, security, and performance optimization.
dotnet-to-react-python-refactor
Agent skill for refactoring .NET applications into a React frontend + Python backend. Use for migrating/modernizing .NET apps (ASP.NET MVC, Web API, Blazor, Web Forms) to React + Python, or analyzing .NET codebases for migration planning.