# Python Data State

> |-

- **Type:** Skill
- **Install:** `agentstack add skill-ahgraber-skills-python-data-state`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ahgraber](https://agentstack.voostack.com/s/ahgraber)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** CC0-1.0
- **Upstream author:** [ahgraber](https://github.com/ahgraber)
- **Source:** https://github.com/ahgraber/skills/tree/main/skills/python-data-state

## Install

```sh
agentstack add skill-ahgraber-skills-python-data-state
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Python Data and State

## Overview

Every data bug traces back to an unclear answer to three questions: who owns this data, where is it validated, and how far does it travel?
This skill encodes boundary-first thinking — make ownership explicit, validate at the edge, and minimize what crosses a boundary.

Treat these defaults as starting points.
When project constraints demand deviation, call out tradeoffs and compensating controls (tests, observability, rollback).

## When to Use

- Data ownership is ambiguous or split across modules.
- Validation logic is scattered or duplicated instead of concentrated at ingress.
- Mutable state is shared across module or layer boundaries.
- Multiple modules participate in a single transaction.
- Configuration is stringly-typed, read lazily, or inconsistent across environments.
- Lifecycle of a data object (creation, transformation, persistence) spans unclear boundaries.

### When NOT to Use

- Pure algorithmic or computational logic with no shared state.
- Prototypes or throwaway scripts where boundary discipline adds no value.
- UI/presentation-layer styling decisions with no data modeling impact.

## Quick Reference

- Make module ownership and invariants explicit.
- Validate at ingress and normalize before domain decisions.
- Share minimal data across boundaries — prefer narrow, typed interfaces.
- Avoid cross-module transactions by default; if unavoidable, isolate coordination logic.
- Keep configuration typed, environment-driven, and startup-validated.

## Common Mistakes

- **Validating deep inside the call stack** — pushing checks into domain logic instead of catching bad data at the boundary where it enters.
- **Exposing internal models across module boundaries** — sharing ORM objects or rich domain models instead of narrow DTOs or typed dicts.
- **Relying on implicit ownership** — assuming "whoever wrote it last" owns the data, leading to conflicting mutations and no single source of truth.
- **Lazy, untyped config reads** — calling `os.getenv()` at point-of-use with string defaults, so missing or malformed config surfaces as a runtime surprise instead of a startup failure.
- **Wrapping unrelated modules in a shared transaction** — coupling independent data stores for perceived consistency, creating hidden rollback complexity and contention.

## Scope Note

- Treat these recommendations as preferred defaults for common cases, not universal rules.
- If a default conflicts with project constraints or worsens the outcome, suggest a better-fit alternative and explain why it is better for this case.
- When deviating, call out tradeoffs and compensating controls (tests, observability, migration, rollback).

## Invocation Notice

- Inform the user when this skill is being invoked by name: `python-data-state`.

## References

- `references/data-lifecycle.md`
- `references/consistency-boundaries.md`
- `references/configuration.md`

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ahgraber](https://github.com/ahgraber)
- **Source:** [ahgraber/skills](https://github.com/ahgraber/skills)
- **License:** CC0-1.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ahgraber-skills-python-data-state
- Seller: https://agentstack.voostack.com/s/ahgraber
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
