Claude-skill-registry docs-acset
Google Docs/Sheets management via ACSet condensation. Transforms documents into GF(3)-typed Interactions, tracks comments/cells, detects saturation when all comments resolved. Use for document workflows, spreadsheet automation, or applying ANIMA principles to Workspace documents.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/docs-acset" ~/.claude/skills/majiayu000-claude-skill-registry-docs-acset && rm -rf "$T"
skills/data/docs-acset/SKILL.mdDocs ACSet Skill
Transform Google Docs/Sheets into an ACSet-condensed system with GF(3) conservation.
Trit: 0 (ERGODIC - coordinator)
Principle: Published Document = Condensed State
Implementation: DocsACSet + CommentTracker + CellSaturation
Overview
Docs ACSet applies category-theoretic structure to documents:
- Transform - Documents/Sheets → GF(3)-typed Interactions
- Track - Comments/Cells → Saturation state
- Detect - All resolved → ANIMA condensed state
- Verify - Narya proofs for consistency
DocsACSet Schema
┌────────────────────────────────────────────────────────────────────┐ │ DocsACSet Schema │ ├────────────────────────────────────────────────────────────────────┤ │ │ │ Document ────────┬────▶ Section │ │ ├─ doc_id: String│ ├─ heading: String │ │ ├─ title: String │ ├─ level: Int │ │ └─ published: Bool └─ content_hash: String │ │ │ │ │ Comment ─────────┼────▶ Thread (doc) │ │ ├─ content: String ├─ resolved: Bool │ │ ├─ author: String └─ reply_count: Int │ │ └─ trit: Trit │ │ │ │ │ │ Spreadsheet ─────┼────▶ Sheet │ │ ├─ ss_id: String │ ├─ name: String │ │ └─ locale: String └─ row_count: Int │ │ │ │ │ Cell ────────────┴────▶ Range │ │ ├─ value: String ├─ a1_notation: String │ │ ├─ formula: String └─ dirty: Bool │ │ └─ trit: Trit │ └────────────────────────────────────────────────────────────────────┘
Objects
| Object | Description | Trit Role |
|---|---|---|
| Google Doc with publish state | Aggregate |
| Heading-delimited content block | Node |
| Review comment with resolution state | Interaction |
| Google Sheets workbook | Aggregate |
| Individual tab within spreadsheet | Node |
| Single cell with value/formula | Data |
GF(3) Verb Typing
Docs/Sheets actions assigned trits based on information flow:
VERB_TRIT_MAP = { # MINUS (-1): Consumption/Reading "get_doc_content": -1, "read_sheet_values": -1, "get_spreadsheet_info": -1, "inspect_doc_structure": -1, "read_document_comments": -1, "debug_table_structure": -1, # ERGODIC (0): Coordination/Metadata "modify_doc_text": 0, "find_and_replace_doc": 0, "update_doc_headers_footers": 0, "resolve_document_comment": 0, "create_sheet": 0, "reply_to_document_comment": 0, # PLUS (+1): Generation/Creation "create_doc": +1, "create_spreadsheet": +1, "insert_doc_elements": +1, "insert_doc_image": +1, "create_table_with_data": +1, "modify_sheet_values": +1, "create_document_comment": +1, "export_doc_to_pdf": +1, }
MCP Tool → Trit Mapping
| Tool | Trit | Description |
|---|---|---|
| -1 | Read document (MINUS) |
| -1 | Read cells (MINUS) |
| -1 | Read comments (MINUS) |
| 0 | Edit text (ERGODIC) |
| 0 | Resolve thread (ERGODIC) |
| +1 | Create document (PLUS) |
| +1 | Create workbook (PLUS) |
| +1 | Write cells (PLUS) |
Doc-Thread Morphism
Documents and Gmail threads form a natural morphism:
┌─────────────────────────────────────────────────────────────────┐ │ Doc-Thread Morphism │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ Document ◀─────────────▶ Thread │ │ ├─ doc_id ├─ thread_id │ │ ├─ published ├─ saturated │ │ └─ all_comments_resolved └─ needs_action │ │ │ │ Functorial mapping: │ │ F(doc) = thread where doc shares via gmail │ │ F(comment) = message in review workflow │ │ F(resolve) = archive/reply │ │ │ └─────────────────────────────────────────────────────────────────┘
Workflow Paths
# Doc → Email (share for review) share_path = doc_read >> email_compose # -1 + 1 = 0 ✓ # Email feedback → Doc update feedback_path = email_read >> doc_modify >> comment_resolve # -1 + 0 + 0 = -1 (needs PLUS balance) balanced = feedback_path >> doc_export # -1 + 1 = 0 ✓
Saturation Detection
Saturation occurs when all comments are resolved:
def is_saturated(doc_id: str) -> bool: """Document is saturated when: 1. All comments resolved (no open threads) 2. GF(3) cycle closure: sum(trits) ≡ 0 (mod 3) 3. Published state stable """ comments = get_all_comments(doc_id) all_resolved = all(c.resolved for c in comments) cycle_sum = sum(c.trit for c in comments) return all_resolved and (cycle_sum % 3) == 0
ANIMA Detection
def detect_anima(doc_ids: List[str]) -> Dict: """System at ANIMA when: 1. All documents saturated (comments resolved) 2. All spreadsheets consistent (no dirty cells) 3. GF(3) conserved globally """ return { "at_anima": all_docs_saturated and all_sheets_clean, "condensed_fingerprint": sha256(all_content_hashes), "published_count": sum(1 for d in docs if d.published), }
Published Document as ANIMA: When all comments are resolved and document is published, it's in condensed equilibrium.
Source Files
| File | Description | Trit |
|---|---|---|
| docs_acset.py | ACSet schema + comment tracking | 0 |
| sheet_saturation.py | Cell dirty state + formula deps | 0 |
| doc_thread_morphism.py | Functorial Doc↔Gmail mapping | 0 |
Workflows
Workflow 1: Document Review to Saturation
from docs_acset import DocsACSet acset = DocsACSet("user@gmail.com") # MINUS: Read document and comments doc = acset.get_doc_content(doc_id) # trit=-1 comments = acset.read_document_comments(doc_id) # trit=-1 # ERGODIC: Process each comment for comment in comments: acset.reply_to_document_comment(doc_id, comment.id, "Addressed") acset.resolve_document_comment(doc_id, comment.id) # trit=0 # PLUS: Export final version acset.export_doc_to_pdf(doc_id) # trit=+1 # GF(3): -1 + -1 + 0 + 1 = -1 (needs one more PLUS)
Workflow 2: Spreadsheet Update Cycle
# MINUS: Read current state values = acset.read_sheet_values(ss_id, "A1:Z100") # trit=-1 # PLUS: Write updates acset.modify_sheet_values(ss_id, "A1:B10", new_data) # trit=+1 # ERGODIC: Add new sheet for audit acset.create_sheet(ss_id, "Audit Log") # trit=0 # GF(3): -1 + 1 + 0 = 0 ✓
Workflow 3: Cross-Document Sync
# Read source doc source = acset.get_doc_content(source_id) # -1 # Create target from template target = acset.create_doc("Derived Document", source.content) # +1 # Link via comment acset.create_document_comment(target.id, f"Derived from {source_id}") # +1 # Balance needed: -1 + 1 + 1 = 1 → add MINUS acset.read_document_comments(target.id) # -1 → total = 0 ✓
Integration with Other Skills
| Skill | Trit | Integration |
|---|---|---|
| google-workspace | 0 | MCP tool provider |
| gmail-anima | 0 | Thread↔Doc morphism |
| gay-mcp | +1 | SplitMixTernary RNG |
| sheaf-cohomology | -1 | Section consistency |
| acsets-algebraic-databases | 0 | Schema foundation |
GF(3) Triadic Conservation
docs-acset (0) ⊗ gmail-anima (0) ⊗ sheaf-cohomology (-1) + gay-mcp (+1) = 0 ✓ read (-1) ⊗ modify (0) ⊗ create (+1) = 0 ✓ comment (-1) ⊗ reply (0) ⊗ resolve (0) + export (+1) = 0 ✓
Skill Name: docs-acset
Type: Document Management / ACSet Framework
Trit: 0 (ERGODIC - coordinator)
GF(3): Conserved via verb typing
ANIMA: Published Document = Condensed State
Scientific Skill Interleaving
This skill connects to the K-Dense-AI/claude-scientific-skills ecosystem:
Annotated Data
- anndata [○] via bicomodule
Bibliography References
: 734 citations in bib.duckdbgeneral
SDF Interleaving
This skill connects to Software Design for Flexibility (Hanson & Sussman, 2021):
Primary Chapter: 10. Adventure Game Example
Concepts: autonomous agent, game, synthesis
GF(3) Balanced Triad
docs-acset (+) + SDF.Ch10 (+) + [balancer] (+) = 0
Skill Trit: 1 (PLUS - generation)
Secondary Chapters
- Ch7: Propagators
- Ch3: Variations on an Arithmetic Theme
- Ch6: Layering
- Ch1: Flexibility through Abstraction
Connection Pattern
Adventure games synthesize techniques. This skill integrates multiple patterns.
Cat# Integration
This skill maps to Cat# = Comod(P) as a bicomodule in the equipment structure:
Trit: 0 (ERGODIC) Home: Prof Poly Op: ⊗ Kan Role: Adj Color: #26D826
GF(3) Naturality
The skill participates in triads satisfying:
(-1) + (0) + (+1) ≡ 0 (mod 3)
This ensures compositional coherence in the Cat# equipment structure.