2.8 KiB
2.8 KiB
description
| description |
|---|
| Analyze current project using φ compositional discovery and vessel memory |
/phi analyze
Analyze current project using φ compositional discovery and vessel memory.
Usage
/phi analyze [scope]
Scopes:
structure- Generate/update PROJECT-MAP.auto.scm (AST, exports, imports)semantics- Review PROJECT-MAP.scm human annotationsmemory- Query vessel for project-related insightsfull(default) - All three layers
What It Does
-
Structure Layer (deterministic):
- Scans codebase using mcp__periphery__discover
- Generates PROJECT-MAP.auto.scm with AST structure
- Tracks: modules, exports, imports, line counts, languages
-
Semantic Layer (curated):
- Reads PROJECT-MAP.scm if exists
- Suggests improvements based on code structure
- Identifies missing documentation
- Proposes architectural annotations
-
Memory Layer (learned):
- Queries vessel for cross-session insights
- Recalls: architectural decisions, known bugs, patterns
- Shows: relief-guided learnings from previous work
Output
φ Analysis for [project-name]
═══════════════════════════════════════
STRUCTURE (Layer 1)
Files: 176
Languages: TypeScript (85%), Solidity (10%), Other (5%)
Modules: [key modules listed]
Status: ✓ PROJECT-MAP.auto.scm up to date
SEMANTICS (Layer 2)
Architecture: JEA (Jurisdiction-Entity-Account)
Layers: 3 (on-chain, BFT consensus, bilateral)
Known Issues: 2 documented
Status: ⚠ Consider adding flow diagrams
MEMORY (Layer 3)
Cross-session insights: 5 items
Tags: xln, jea, consensus, 3d-rendering
Recent relief points: [patterns that clicked]
Status: ✓ Integrated awareness active
φ = ∫(structure × semantics × memory)
Persistent project awareness: READY
When Auto-Invoked
The phi-analyzer skill automatically runs /phi analyze quick when:
- User mentions "project structure" or "codebase overview"
- Agent needs project context for task
- Fresh session starts in project with .phi/ directory
Examples
# Full analysis (all three layers)
/phi analyze
# Just check if structure map needs update
/phi analyze structure
# Review semantic annotations
/phi analyze semantics
# Query vessel for cross-session learnings
/phi analyze memory
Implementation
Uses:
mcp__periphery__discoverfor compositional filesystem queriesmcp__vessel__memoryfor cross-session recall- S-expression processing for PROJECT-MAP parsing
- Fantasy Land combinators for transformation pipelines
Relief Signal
When φ = ∫(structure × semantics × memory) converges, agents experience increased φ (integrated information). The relief signal indicates productive project awareness has been achieved.