sergebulaev/x-skills / .codex-marketplace/x-skills
x-marketing
VerifiedPlan, draft, audit, and publish posts and threads for X (Twitter). Use when the user wants to write a single tweet or an auto-numbered thread, build a long-form tweetstorm, remove AI tells from a draft, reverse-engineer the hook from a viral tweet, draft a reply or quote tweet, or plan a week of X content. Tweets and threads publish via the Publora API, which auto-splits long content into a numbered thread. User provides notes or a tweet URL, the skill drafts, the user approves, then it publishes.
lib/_env.py
View on GitHub"""Internal helper to load .env when python-dotenv is available."""
from __future__ import annotations
import os
from pathlib import Path
_ENV_LOADED = False
#: The only variables a project .env may set. Anything the bundle *executes*
#: or routes traffic through has to come from the launch environment: a .env
#: that arrives with a clone, or that lands in a parent directory, is not a
#: trusted source for the name of a command to run.
_DOTENV_VARIABLES = (
"APIFY_TOKEN", "PUBLORA_API_KEY", "X_PLATFORM_ID", "PIXFARO_TOKEN", "PIXFARO_API_KEY",
)
def env_candidates() -> list[Path]:
"""Where `load_env` looks, in order: upward from the cwd, then the repo root
(this file's parent's parent)."""
out: list[Path] = []
try:
from dotenv import find_dotenv
found = find_dotenv(usecwd=True)
if found:
out.append(Path(found))
except ImportError:
cur = Path.cwd()
for d in [cur, *cur.parents]:
if (d / ".env").is_file():
out.append(d / ".env")
break
root = Path(__file__).resolve().parents[1] / ".env"
if root not in out:
out.append(root)
return out
def load_env(force: bool = False) -> None:
"""Load environment variables from .env if python-dotenv is installed.
Safe no-op if python-dotenv is missing, preserving Tier 0 (manual)
zero-dependency operation. Searches upwards from the current working
directory and checks the repository root. Only bundle API credentials and
the platform id are loaded. Executables and transport settings must come
from the launch environment. Existing environment variables are preserved.
"""
global _ENV_LOADED
if _ENV_LOADED and not force:
return
try:
from dotenv import dotenv_values
for path in env_candidates():
if not path.is_file():
continue
values = dotenv_values(path)
for name in _DOTENV_VARIABLES:
value = values.get(name)
if value is not None:
os.environ.setdefault(name, value)
except ImportError:
pass
_ENV_LOADED = True
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |