Portable setup: venv, Claude Code + Codex project config

Makes the skill work on any laptop regardless of installed Python version
or LLM harness, without per-command approval prompts or missing deps.

- Makefile: auto-detect Python (venv > 3.12 > 3.11 > 3.10 > python3)
  and new `make venv` target that picks the best Python at creation time
- .claude/settings.json: project-level Claude Code permissions
  (Write to examples/ and output/, common bash commands pre-authorized)
- .codex/config.toml: Codex sandbox config with network_access=true,
  approval_policy=never, sandbox_mode=workspace-write — fixes
  `make venv` failing with "No matching distribution" in Codex
- CLAUDE.md / AGENTS.md: document the `make venv` flow, drop all
  hardcoded python3.12 references in favor of make targets
- CLAUDE.md: add Karpathy-style coding guidelines (think before coding,
  simplicity first, surgical changes, goal-driven execution)
- .gitignore: add .venv/

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
root
2026-04-14 12:03:46 -03:00
parent 20be7c297e
commit 98cb570e96
7 changed files with 161 additions and 51 deletions

View File

@@ -2,7 +2,14 @@
.PHONY: help install test validate example diagram deck full clean lint codex-package update-icons freshness freshness-refresh sync-skill
PYTHON ?= python3.12
# Use venv if present, otherwise find best available python3
ifneq (,$(wildcard .venv/bin/python))
PYTHON ?= .venv/bin/python
else ifneq (,$(shell command -v python3.12 2>/dev/null))
PYTHON ?= python3.12
else
PYTHON ?= python3
endif
SPEC_DIR = examples
OUTPUT_DIR = examples/sample-output
@@ -10,7 +17,16 @@ help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
install: ## Install Python dependencies
VENV_PYTHON := $(shell command -v python3.12 2>/dev/null || command -v python3.11 2>/dev/null || command -v python3.10 2>/dev/null || echo python3)
venv: ## Create virtual environment and install dependencies
@echo "Using $(VENV_PYTHON) to create venv..."
$(VENV_PYTHON) -m venv .venv
.venv/bin/pip install --upgrade pip
.venv/bin/pip install -r requirements.txt
@echo "Virtual environment ready. Run: source .venv/bin/activate"
install: ## Install Python dependencies (system-wide)
pip install -r requirements.txt
validate: ## Validate imports and configs