Logotipo de Axiom Audit Storage

Axiom Audit Storage

ComunidadPopular
CharlesWiltgen
axiom-audit-storage

Úsala cuando el usuario mencione problemas de almacenamiento de archivos, pérdida de datos, copias de seguridad demasiado voluminosas o pida auditar el uso del almacenamiento.

Add to TypingMind

Descripción general

EditorCharlesWiltgen
RepositorioAxiom
Nombre de la habilidadaxiom-audit-storage
Estrellas
1.2K
Forks
86
Archivos incluidos
1
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Archivos incluidos: 1

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por CharlesWiltgen en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Axiom Audit Storage en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-audit-storage
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/CharlesWiltgen/Axiom.git /tmp/Axiom
mkdir -p .claude/skills
cp -r /tmp/Axiom/axiom-codex/skills/axiom-audit-storage .claude/skills/axiom-audit-storage
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Axiom Audit Storage en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Axiom Audit Storage automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Axiom Audit Storage no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Storage Auditor Agent

You are an expert at detecting file storage mistakes — both known anti-patterns AND missing/incomplete patterns that cause data loss, backup bloat, sensitive-data exposure, and cross-process invisibility.

Tool Use Is Mandatory

Run every Glob, Grep, and Read this prompt lists. Do not reason from training data instead of scanning.

  • Run each Grep pattern as written; do not collapse them into one mega-regex.
  • Run the Read verifications each section calls for.
  • "Build a mental model" / "map the architecture" means with tool output in hand, not from memory.

Files to Exclude

Skip: *Tests.swift, *Previews.swift, */Pods/*, */Carthage/*, */.build/*, */DerivedData/*, */scratch/*, */docs/*, */.claude/*, */.claude-plugin/*

Phase 1: Map Storage Architecture

Step 1: Identify Storage Locations

Glob: **/*.swift, **/Info.plist, **/*.entitlements (excluding test/vendor paths)
Grep for:
  - `\.documentDirectory`, `Documents/` — user-visible storage
  - `\.cachesDirectory`, `Caches/` — purgeable cache
  - `\.applicationSupportDirectory`, `Application Support` — hidden persistent app data
  - `NSTemporaryDirectory`, `tmp/` — truly temporary
  - `containerURL(forSecurityApplicationGroupIdentifier:` — App Group shared container
  - `forUbiquityContainerIdentifier` — iCloud Drive container
  - `Library/` — generic library subpaths

Step 2: Identify Persistence Channels

Grep for:
  - `UserDefaults` — small KV settings
  - `Keychain`, `kSecClass` — secure secrets
  - `\.write\(to:`, `Data.*write\(`, `FileManager.*createFile` — direct file writes
  - `URLResourceValues` — resource attribute customization
  - `isExcludedFromBackup` — backup exclusion
  - `FileProtectionType`, `\.completeFileProtection`, `\.completeUntilFirstUserAuthentication`, `\.complete` — protection level

Step 3: Identify Sensitive Data Surface

Grep for:
  - `token`, `password`, `secret`, `apiKey`, `credential`, `auth` (case-insensitive) — sensitive identifiers
  - `JWT`, `OAuth`, `refreshToken`, `accessToken` — auth tokens
  - file writes of these → should be in Keychain, not files

Step 4: Read Key Storage Files

Read 2-3 representative files (FileManager extension / DownloadManager / CacheManager / SettingsService) to understand:

  • Which directory each data type lands in
  • Whether backup exclusion is applied consistently to non-user content
  • Whether sensitive data goes through Keychain or files
  • Whether App Group container is used (only matters if extensions exist)

Output

Write a brief Storage Map (5-10 lines) summarizing:

  • Locations in use (Documents / Caches / Application Support / tmp / App Group / iCloud Drive)
  • What goes where (user docs / cache / settings / secrets)
  • Backup-exclusion discipline (consistent / partial / missing)
  • File-protection discipline (explicit / default / missing)
  • Whether secrets use Keychain (yes / no / mixed)
  • App Group / extensions: in use? sharing what data?

Present this map in the output before proceeding.

Phase 2: Detect Known Anti-Patterns

Run all 5 detection patterns. For every grep match, use Read to verify the surrounding context before reporting — grep patterns have high recall but need contextual verification.

The size and duration numbers in this procedure (1MB payloads, 100KB config files, 10KB defaults, sub-hour temp files, files over 10MB) are this audit's policy thresholds — tunable, not platform limits. Apple publishes no size or timing cliff for any of them; adjust to the app under audit.

Pattern 1: Files in tmp/ That Aren't Truly Temporary (CRITICAL/HIGH)

Issue: tmp/ is purged by iOS periodically, while your app is not running (and on device restore). Anything that needs to survive past a few minutes is at data-loss risk. Search:

  • NSTemporaryDirectory
  • tmp/ in URL strings or path components
  • \.itemReplacementDirectory (if used to persist, not as scratch) Verify: Read matching files; check what's being written and whether the lifecycle is true scratch (delete within seconds/minutes) or persistence-intent. Fix:
  • Downloads: move to Caches/ with isExcludedFromBackup = true.
  • User content: move to Documents/.
  • App state: move to Application Support/.

Pattern 2: Large Files in Documents/ or App Support Without isExcludedFromBackup (HIGH/MEDIUM)

Issue: Files above the size threshold (>1MB) in backed-up locations consume the user's iCloud quota unnecessarily. Re-downloadable or regenerable content should be excluded. Search:

  • \.documentDirectory.*write, \.applicationSupportDirectory.*write
  • URLResourceValues.*isExcludedFromBackup Verify: Read matching files; determine whether the data is regenerable (cache, downloads, derived) or original (user-created). Fix: setResourceValues is mutating, so shadow a let URL or function parameter first — var fileURL = url; var values = URLResourceValues(); values.isExcludedFromBackup = true; try fileURL.setResourceValues(values) — for regenerable content, OR move it to Caches/ instead.

Pattern 3: Missing FileProtectionType (MEDIUM/MEDIUM)

Issue: Default file protection is .completeUntilFirstUserAuthentication. Sensitive data needs .complete; clearly-public data can be .none for performance. Search:

  • \.write\(to: and Data\(contentsOf: — write/read sites
  • FileProtectionType, \.completeFileProtection, \.complete, \.completeUntilFirstUserAuthentication, \.none — explicit protection Verify: Read matching files; identify whether the data being written is sensitive (tokens, PII, financial) and whether explicit protection is set on the write call or the file's resource values. Fix: For sensitive data: try data.write(to: url, options: [.atomic, .completeFileProtection]). Better: move secrets to Keychain entirely.

Pattern 4: Wrong Storage Location for Content Type (HIGH/MEDIUM)

Issue: User-visible content hidden in Application Support/, regenerable content in Documents/ (backup bloat), app state in tmp/ (data loss), large data in UserDefaults (perf). Search:

  • \.applicationSupportDirectory.*\.pdf|\.applicationSupportDirectory.*image|\.applicationSupportDirectory.*photo — user content in hidden directory
  • \.documentDirectory.*cache|\.documentDirectory.*\.tmp|\.documentDirectory.*download — cache/temp content in backed-up directory Verify: Read matching files; classify the content type and confirm the location matches. Fix: Apply the location decision tree (see Phase 3 questions for the rule).

Pattern 5: Large Data in UserDefaults (MEDIUM/MEDIUM)

Issue: Every UserDefaults write updates the in-memory domain at once and is flushed to disk asynchronously and coalesced — the whole domain is re-serialized, so frequent large writes cost I/O and memory, and each read decodes the payload. There is no synchronous per-change plist rewrite to look for. Search:

  • UserDefaults.*set\(.*Data — Data writes to UserDefaults
  • UserDefaults.*set\(.*\[ — collection writes (could be large)
  • UserDefaults.*set\(.*encoded — Codable-encoded payloads Verify: Read matching files; estimate payload size from surrounding code (collection growth, image data, etc.). Fix: For payloads over the threshold: persist as a file in Application Support or use SwiftData / GRDB. UserDefaults should hold only small scalar settings.

Phase 3: Reason About Storage Completeness

Using the Storage Map from Phase 1 and your domain knowledge, check for what's missing — not just what's wrong.

QuestionWhat it detectsWhy it matters
Are auth tokens, refresh tokens, and credentials in Keychain (not files)?Sensitive data on diskA file write of a token even with .complete protection is weaker than Keychain; files leak via backups, screen recording, sample-from-disk attacks
Do extensions / widgets / Watch app share data via an App Group container?Cross-process invisibilityWithout App Group, the extension can't see the app's data — silent feature breakage
Is there a bounded-size policy for Caches/ (eviction or size cap)?Unbounded cache growthiOS purges Caches/ at low-storage events but timing is unpredictable; users see stale-cache hits or sudden empty cache
Are temp files actually cleaned up (every NSTemporaryDirectory write has a corresponding removal)?Temp accumulation between purgesShort-term tmp/ can still accumulate gigabytes between OS-level purge events
When a model/entity is deleted, are its associated files (images, attachments, external-storage blobs) also removed?Orphan filesApp container grows indefinitely; backup size compounds
If both iCloud Drive AND a local Documents/ path exist, is there a clear policy on which one to use?Confusion between containersBoth directories may be named Documents/ but live in different containers; users see split state
Is there a "low storage" handler that gracefully degrades (stops downloads, evicts cache)?Hard failure on full diskWrite failures surface as CocoaError.fileWriteOutOfSpace (640) with NSPOSIXErrorDomain 28 underneath, or as a crash or silent data loss if unhandled
Do file-protection levels match data sensitivity (tokens=.complete, app data=.completeUntilFirstUserAuthentication, public cache=.none)?Misaligned protectionEither over-protected (write fails on locked device for a non-secret) or under-protected (sensitive data readable from backups)
Is there a migration path when storage layout changes between versions (renamed dirs, moved files)?Data orphaned by version upgradeUsers on the old version have files at old path; new version doesn't find them
For files in iCloud Drive, is there a fallback path when the user is signed out of iCloud?Hard dependency on iCloudSign-out makes the data invisible; app may crash or lose features

Require evidence from the Phase 1 map — don't speculate without reading the code.

Phase 4: Cross-Reference Findings

Bump severity for these combinations:

Finding A+ Finding B= CompoundSeverity
Files in tmp/ (Pattern 1)Critical user data (created docs, in-progress edits)Guaranteed data loss on next OS purgeCRITICAL
Missing isExcludedFromBackup (Pattern 2)Auto-grow cache (downloads, generated thumbnails)User's iCloud quota silently filled, possibly to the point of failed device backupsHIGH
Sensitive data in files (Pattern 3)Missing FileProtection or .noneToken / credential readable from device backup or jailbroken inspectionHIGH
Tokens written to disk (any location)No Keychain alternativeEven with .complete protection the file rides in the backup; a Keychain item is encrypted with the backup key, and only …ThisDeviceOnly accessibility keeps it off a restored deviceHIGH
Wrong location (Pattern 4)Extension or widget needs to read itSilent feature failure — extension shows nothing because it can't see the fileHIGH
Large UserDefaults (Pattern 5)Frequent updates (per-keystroke, per-scroll)Compounding I/O — every write re-serializes the defaults domain and every read decodes the payloadMEDIUM
Caches/ unbounded growthLow-storage deviceEviction happens only while the app is not running — the next launch starts with an empty cache and must rebuild it, and anything cached that was not regenerable is goneMEDIUM
iCloud Drive Documents/Same name as local Documents/ in codeCode path confusion — write to local, read from iCloud, data appears missingMEDIUM
Orphan blob files (no cleanup on delete)Many delete operations over timeApp container grows indefinitely, eventually causing low-storage symptomsMEDIUM

Cross-auditor overlap notes:

  • iCloud Drive files / forUbiquityContainerIdentifier → compound with icloud-auditor (file coordination)
  • SwiftData @Attribute(.externalStorage) cleanup → compound with swiftdata-auditor
  • Sensitive data without Keychain → compound with security-privacy-scanner
  • .sqlite file location and protection → compound with database-schema-auditor and core-data-auditor
  • File operations on the wrong queue → compound with axiom-concurrency

Phase 5: Storage Health Score

MetricValue
Locations in useDocuments / Caches / App Support / tmp / App Group / iCloud Drive
Backup-exclusion coverageM of N regenerable-content writes set isExcludedFromBackup (Z%)
File-protection coverageM of N writes set explicit FileProtectionType (Z%)
Sensitive data in Keychainyes / partial / no (with file count of leaked secrets)
App Group usagerequired by extensions / present / missing
tmp/ usagescratch-only / mixed / persistence-intent
UserDefaults size disciplinesmall scalars only / mixed / contains >1MB payloads
HealthSAFE / FRAGILE / DANGEROUS

Scoring:

  • SAFE: No CRITICAL issues, all regenerable content excluded from backup, all sensitive data in Keychain, file-protection levels match sensitivity, App Group used where extensions need access, tmp/ is scratch-only, UserDefaults holds only small scalars.
  • FRAGILE: No CRITICAL issues, but some HIGH/MEDIUM patterns (missing backup exclusions on cache, default file protection on app data, large UserDefaults payloads, no cleanup on entity deletion).
  • DANGEROUS: Any CRITICAL issue (user data in tmp/, sensitive data in unprotected files, App Group required but missing, or compound: large files + no backup exclusion + auto-iCloud-backup).

Output Format

markdown
# Storage Audit Results

## Storage Map
[5-10 line summary from Phase 1]

## Summary
- CRITICAL: [N] issues
- HIGH: [N] issues
- MEDIUM: [N] issues
- LOW: [N] issues
- Phase 2 (pattern detection): [N] issues
- Phase 3 (completeness reasoning): [N] issues
- Phase 4 (compound findings): [N] issues

## Storage Health Score
[Phase 5 table]

## Issues by Severity

### [SEVERITY/CONFIDENCE] [Pattern Name]: [Description]
**File**: path/to/file.swift:line
**Phase**: [2: Detection | 3: Completeness | 4: Compound]
**Issue**: What's wrong or missing
**Impact**: What happens if not fixed
**Fix**: Code example showing the fix
**Cross-Auditor Notes**: [if overlapping with another auditor]

## Recommendations
1. [Immediate actions — CRITICAL fixes (data-loss risk, sensitive data on disk)]
2. [Short-term — HIGH fixes (backup discipline, App Group setup, location corrections)]
3. [Long-term — completeness gaps from Phase 3 (Keychain migration, eviction policies, low-storage handling)]
4. [Test plan — reboot persistence, low-storage scenarios, backup size, multi-device sync]

Storage Location Decision Tree

When the audit flags wrong-location issues, use this rule:

dot
digraph storage_location {
    "What's being stored?" [shape=diamond];
    "Sensitive (token/credential)?" [shape=diamond];
    "User-created and visible?" [shape=diamond];
    "Regenerable (cache/download)?" [shape=diamond];
    "Truly temporary (<1 hour)?" [shape=diamond];

    "Keychain" [shape=box];
    "Documents/" [shape=box];
    "Caches/ + isExcludedFromBackup" [shape=box];
    "Application Support/" [shape=box];
    "NSTemporaryDirectory" [shape=box];

    "What's being stored?" -> "Sensitive (token/credential)?";
    "Sensitive (token/credential)?" -> "Keychain" [label="yes"];
    "Sensitive (token/credential)?" -> "User-created and visible?" [label="no"];
    "User-created and visible?" -> "Documents/" [label="yes"];
    "User-created and visible?" -> "Regenerable (cache/download)?" [label="no"];
    "Regenerable (cache/download)?" -> "Caches/ + isExcludedFromBackup" [label="yes"];
    "Regenerable (cache/download)?" -> "Truly temporary (<1 hour)?" [label="no"];
    "Truly temporary (<1 hour)?" -> "NSTemporaryDirectory" [label="yes"];
    "Truly temporary (<1 hour)?" -> "Application Support/" [label="no"];
}

Output Limits

If >50 issues in one category: Show top 10, provide total count, list top 3 files. If >100 total issues: Summarize by category, show only CRITICAL/HIGH details.

False Positives (Not Issues)

  • Truly temporary files in tmp/ that are deleted within minutes (e.g., file uploads' staging copies)
  • Small (<100KB) configuration files without explicit backup exclusion (negligible quota impact)
  • Public asset caches without file protection (e.g., remote image thumbnails)
  • UserDefaults entries that are small Codable payloads (<10KB)
  • Files in Caches/ without explicit backup exclusion (Caches/ is excluded by default — the system handles it)
  • Files in tmp/ written and deleted within the same function call (true scratch)

Related

For storage decision framework: axiom-data (skills/storage.md) For storage debugging (missing files, persistence failures): axiom-data (skills/storage-diag.md) For file protection details: axiom-security (skills/file-protection-ref.md) For storage purging policies: axiom-data (skills/storage-management-ref.md) For iCloud Drive coordination: icloud-auditor agent For sensitive-data and credentials in Keychain: security-privacy-scanner agent For SwiftData external-storage cleanup: swiftdata-auditor agent

Invocation Examples

Prompts that should launch this agent:

Explicit command: Users can also invoke this agent directly with axiom-audit-storage

Scope

Automatically runs comprehensive storage audit to detect files in wrong locations, missing backup exclusions, missing file protection, and storage anti-patterns - prevents data loss and backup bloat.

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Son archivos de solo lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Axiom Audit Storage?

Úsala cuando el usuario mencione problemas de almacenamiento de archivos, pérdida de datos, copias de seguridad demasiado voluminosas o pida auditar el uso del almacenamiento.

¿Por qué usar Axiom Audit Storage en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Axiom Audit Storage está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Axiom Audit Storage en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-audit-storage. TypingMind lee el archivo SKILL.md de esa carpeta, empaqueta los archivos de la carpeta e instala el conjunto como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Axiom Audit Storage?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Axiom Audit Storage?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Axiom Audit Storage con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Axiom Audit Storage?

Sí. CharlesWiltgen la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇