graph TB
subgraph USER["User Layer"]
Input["User Input"]
SlashCmd["/skill-name"]
end
subgraph GATEWAY["Neural Gateway v5.7"]
direction TB
Hook1["route-interceptor"]
Tokenizer["Tokenize + Synonym Expand\n22 groups"]
BM25["BM25 + TF-IDF\n3-tier keywords"]
ContextFusion["Context Fusion\nBM25*0.6 + Session*0.2\n+ Project*0.1 + Workflow*0.1"]
Disambig["Disambiguation\n31 JSON rules"]
BWR["BWR Directive Inject"]
end
subgraph COMPLIANCE["Compliance Gate"]
PreTool["route-compliance-gate\n(PreToolUse:Skill)"]
PostAudit["route-auditor\n(Stop)"]
end
subgraph SKILLS["Skills (52)"]
direction LR
S_AI["AI/Data (3)"]
S_DEV["Dev (12)"]
S_ARCH["Arch (8)"]
S_OPS["DevOps (4)"]
S_SEC["Security (1)"]
S_QA["Quality (3)"]
S_PROD["Product (4)"]
S_BIZ["Business (9)"]
S_CONTENT["Content (5)"]
S_META["Meta (3)"]
end
subgraph AGENTS["Agents (10)"]
direction LR
A_OPUS["Opus (2)\norchestrator\ncode-reviewer"]
A_SONNET["Sonnet (8)\nresearch-analyst | full-stack-builder\nquality-gate | self-auditor\nself-healer | canvas-ui-designer\ntest-writer | pre-deploy-checker"]
end
subgraph MCP_LAYER["MCP Ecosystem (22+3)"]
direction LR
MCP_LOCAL["Local (12)"]
MCP_CLOUD["Cloud (9)"]
MCP_PLUGIN["Plugin (1)"]
MCP_ONDEMAND["On-demand (3)"]
end
subgraph EVOLUTION["Self-Evolution"]
direction LR
DriftDetect["drift-detector"]
Auditor["self-auditor\n8-dim audit"]
Healer["self-healer\nmetadata fix"]
EvoLog["evolution-log\n18 seq"]
end
Input --> Hook1
SlashCmd -.->|"Priority 1"| SKILLS
Hook1 --> Tokenizer --> BM25 --> ContextFusion --> Disambig --> BWR
BWR -->|"BWR directive"| PreTool
PreTool -->|"PASS"| SKILLS
SKILLS --> PostAudit
SKILLS -.->|"complex"| AGENTS
AGENTS --> MCP_LAYER
SKILLS --> MCP_LAYER
PostAudit -->|"feedback"| EVOLUTION
DriftDetect --> Auditor --> Healer --> EvoLog
EvoLog -.->|"weight learning"| BM25
style GATEWAY fill:#1a1a2e,color:#e0e0ff,stroke:#4a4aff
style COMPLIANCE fill:#2d1b2e,color:#ffccff,stroke:#aa44aa
style SKILLS fill:#1b2e1b,color:#ccffcc,stroke:#44aa44
style AGENTS fill:#2e2e1b,color:#ffffcc,stroke:#aaaa44
style MCP_LAYER fill:#1b2e2e,color:#ccffff,stroke:#44aaaa
style EVOLUTION fill:#2e1b1b,color:#ffcccc,stroke:#aa4444
flowchart LR
subgraph INPUT["Input"]
Raw["Raw Input"]
Seg["Tokenize"]
Syn["Synonym Expand\n22 groups"]
end
subgraph SCORING["Scoring"]
BM25["BM25\nk1=1.2, b=0.75"]
TF["TF-IDF\ncore/strong/extended"]
CTX["Context Fusion\nwindow=10, decay=0.85"]
PRJ["Project Detect\n9 types"]
WF["Workflow n-gram"]
end
subgraph DECISION["Decision"]
Fusion["Score Fusion\nBM25x0.6+CTXx0.2\n+PRJx0.1+WFx0.1"]
Disamb["Disambiguation\n31 rules"]
Chain["Skill Chain\ncomposable graph"]
Confidence{"Confidence?"}
end
subgraph OUTPUT["Output"]
HIGH["HIGH gte 0.8\nDirect Route"]
MED["MED 0.5-0.8\nRoute + Hints"]
LOW["LOW lt 0.5\ndeveloper-expert"]
end
Raw --> Seg --> Syn
Syn --> BM25
BM25 --> TF --> Fusion
CTX --> Fusion
PRJ --> Fusion
WF --> Fusion
Fusion --> Disamb --> Chain --> Confidence
Confidence -->|"gte 0.8"| HIGH
Confidence -->|"0.5~0.8"| MED
Confidence -->|"lt 0.5"| LOW
mindmap
root((Bookworm v5.7\n52 Skills))
AI / Data 3
ai-ml-expert
data-analyst-expert
data-engineer-expert
Dev 12
frontend-expert
backend-builder
mobile-expert
miniprogram-expert
developer-expert
debugger-expert
api-integration-specialist
regex-shell-wizard
ultimate-code-expert
browser-automation-expert
workflow-automation-expert
notification-system-expert
Architecture 8
architect-expert
database-tuning-expert
cloud-native-expert
edge-computing-expert
performance-expert
impact-analyst
diagram-as-code-expert
zero-defect-guardian
DevOps 4
devops-expert
devsecops-expert
git-operation-master
sre-expert
Security 1
security-expert
Quality 3
tester-expert
reviewer-expert
project-audit-expert
Product 4
product-manager-expert
designer-expert
ux-researcher
project-coordinator
Business 9
business-plan-skill
finance-advisor
sales-consultant
pricing-strategist
customer-success-expert
growth-hacker
investor-review-guide
industry-research-cn
legal-review-skill
Content 5
tech-writer-expert
copywriter-expert
email-communicator
social-media-manager
technical-seo-expert
Meta 3
genesis-engine
prompt-optimizer
tech-lead-mentor
graph TB
subgraph OPUS["Opus (2)"]
ORC["orchestrator\nDecompose - Schedule - Verify"]
CR["code-reviewer\nMulti-dim Review"]
end
subgraph SONNET_C["Sonnet Compound (3)"]
RA["research-analyst\nExplore + Research"]
FSB["full-stack-builder\nFront+Back+DB E2E"]
QG["quality-gate\nPASS / BLOCKED"]
end
subgraph SONNET_S["Sonnet Specialist (3)"]
CUD["canvas-ui-designer\nHi-fi UI/UX"]
TW["test-writer\nAuto Test Gen"]
PDC["pre-deploy-checker\nDeploy Safety"]
end
subgraph SONNET_M["Sonnet Meta (2)"]
SA["self-auditor\n8-dim Audit"]
SH["self-healer\nDrift Fix"]
end
ORC -->|"research"| RA
ORC -->|"implement"| FSB
ORC -->|"review"| CR
ORC -->|"verify"| QG
FSB -.->|"after impl"| TW
TW -.->|"tests pass"| PDC
SA -->|"audit report"| SH
SH -.->|"after fix"| SA
style OPUS fill:#4a1942,color:#ffccff,stroke:#aa44aa
style SONNET_C fill:#1a3a1a,color:#ccffcc,stroke:#44aa44
style SONNET_S fill:#1a2a3a,color:#cce0ff,stroke:#4488cc
style SONNET_M fill:#3a2a1a,color:#ffe0cc,stroke:#cc8844
flowchart TB
subgraph SUBMIT["UserPromptSubmit (1)"]
H1["route-interceptor\nNeural Gateway"]
end
subgraph PRE["PreToolUse (5)"]
H2["block-sensitive-files\nWrite/Edit"]
H3["block-dangerous-commands\nBash"]
H4["commit-message-lint\ngit commit"]
H5["code-quality-gate\nBash"]
H6["route-compliance-gate\nSkill"]
end
subgraph POST["PostToolUse (4 main + 4 sub)"]
H7["post-edit-dispatcher\nParallel Dispatch"]
H7a["check-typescript"]
H7b["check-lint"]
H7c["suggest-tests"]
H7d["drift-detector\n+ integrity-check"]
H8["build-outcome-tracker"]
H9["post-edit-quality-check"]
H10["activity-logger"]
end
subgraph OTHER["SubagentStart / Stop (2)"]
H11["subagent-route-injector"]
H12["route-auditor\nE2E Audit"]
end
H1 -->|"BWR"| PRE
PRE -->|"PASS"| POST
H7 --> H7a & H7b & H7c & H7d
POST --> OTHER
H12 -.->|"feedback"| H1
style SUBMIT fill:#2a1a3a,color:#e0ccff,stroke:#8844cc
style PRE fill:#3a1a1a,color:#ffcccc,stroke:#cc4444
style POST fill:#1a3a2a,color:#ccffe0,stroke:#44cc88
style OTHER fill:#1a2a3a,color:#cce0ff,stroke:#4488cc
graph LR
subgraph T1["Tier 1 - Local (12)"]
direction TB
subgraph T1A["AI/Research"]
DR["deep-research"]
C7["context7"]
ST["sequential-thinking"]
end
subgraph T1B["Browser"]
PW["playwright"]
CD["chrome-devtools"]
BB["browserbase"]
end
subgraph T1C["Device"]
MB["mobile"]
end
subgraph T1D["SaaS"]
GH["github"]
SK["slack"]
LN["linear"]
AT["atlassian"]
SB["supabase"]
end
end
subgraph T2["Tier 2 - Cloud (9)"]
direction TB
SE["sentry"]
FG["figma"]
NO["notion"]
GA["gamma"]
CA["canva"]
VE["vercel"]
CL["cloudinary"]
SGW["scholar-gateway"]
GP["graphos"]
end
subgraph T3["Tier 3 - Plugin + On-demand (1+3)"]
direction TB
FB["firebase"]
PG["postgres"]
RD["redis"]
K8["kubernetes"]
end
T1 ---|"always on"| CORE["Claude Code\nRuntime"]
T2 ---|"deferred tools"| CORE
T3 ---|"manual install"| CORE
style T1 fill:#1a2e2e,color:#ccffff,stroke:#44aaaa
style T2 fill:#2e2e1b,color:#ffffcc,stroke:#aaaa44
style T3 fill:#2e1b2e,color:#ffccff,stroke:#aa44aa
flowchart LR
subgraph TRIGGER["Trigger"]
Edit["File Edit"]
Session["Session End"]
end
subgraph DETECT["Detection"]
Drift["drift-detector"]
Integrity["integrity-check\nSHA256 x 24"]
end
subgraph AUDIT["Audit - 10 Dimensions"]
H1a["H1 Config 13%"]
H2a["H2 Baseline 13%"]
H3a["H3 Disk 10%"]
H4a["H4 Hooks 13%"]
H5a["H5 Skills 9%"]
H6a["H6 Rules 9%"]
H7a["H7 Accuracy 13%"]
H8a["H8 Learning 10%"]
H9a["H9 Compliance 10%"]
H10a["H10 Hook Eff. 9%"]
end
subgraph HEAL["Healing"]
SelfHeal["self-healer\nmetadata only"]
Actions["Version Sync\nCount Fix\nRegistry Fix"]
end
subgraph LOG["Logging"]
EvoLog["evolution-log\n18 seq"]
Weights["route-weights\nlimit pm 0.5"]
Feedback["route-feedback"]
end
Edit --> Drift --> Integrity
Session --> AUDIT
Integrity --> AUDIT
AUDIT -->|"CRITICAL/WARN"| SelfHeal
SelfHeal --> Actions --> EvoLog
AUDIT --> Weights
AUDIT --> Feedback
Feedback -.->|"adaptive learning\n5-day half-life"| Weights
graph TB
subgraph CONFIG["Config Layer (Source of Truth)"]
CLAUDE["CLAUDE.md"]
SKILL_MD["skills/*/SKILL.md x52"]
AGENT_MD["agents/*.md x10"]
SETTINGS["settings.json"]
end
subgraph COMPILED["Compiled Artifacts"]
INDEX["skills-index.json\n52 x 2573 keywords"]
STATS["stats-compiled.json"]
RULES["rules-compiled.json"]
DISAMB["disambiguation-rules.json\n31 rules"]
SYNS["synonyms.json\n22 groups"]
CHECKSUMS["checksums.json\n24 files SHA256"]
end
subgraph RUNTIME["Runtime Data"]
RF["route-feedback.jsonl"]
RW["route-weights.json"]
AL["activity-log.jsonl"]
EL["evolution-log.jsonl"]
SM["session-memory.json"]
end
subgraph SCRIPTS["Script Engine (46)"]
RA2["route-analyzer.js"]
TF2["tfidf-engine.js"]
SE2["synonym-expander.js"]
CT2["context-tracker.js"]
PD2["project-detector.js"]
WP2["workflow-patterns.js"]
SCR["skill-chain-recommender.js"]
GEN["generate-skill-index.js"]
end
SKILL_MD -->|"extract"| GEN --> INDEX
INDEX --> RA2
SYNS --> SE2 --> RA2
RA2 --> TF2
CT2 --> RA2
PD2 --> RA2
WP2 --> RA2
DISAMB --> RA2
RA2 -->|"scores"| RF
RF -->|"learn"| RW
SETTINGS -->|"register"| COMPILED
CLAUDE --> STATS
AGENT_MD --> STATS
style CONFIG fill:#1a1a2e,color:#e0e0ff,stroke:#4a4aff
style COMPILED fill:#2e2e1b,color:#ffffcc,stroke:#aaaa44
style RUNTIME fill:#1b2e1b,color:#ccffcc,stroke:#44aa44
style SCRIPTS fill:#2e1b2e,color:#ffccff,stroke:#aa44aa
sequenceDiagram
actor U as User
participant HK1 as route-interceptor
participant RE as Route Engine
participant HK2 as compliance-gate
participant SK as Skill
participant HK3 as post-edit-dispatcher
participant SUB as sub-hooks x4
participant HK4 as activity-logger
participant HK5 as route-auditor
U->>HK1: Input text
HK1->>RE: Tokenize + Synonym expand
RE->>RE: BM25 + TF-IDF score
RE->>RE: Context fusion (0.6+0.2+0.1+0.1)
RE->>RE: Disambiguate (31 rules)
RE-->>HK1: BWR directive
HK1-->>U: additionalContext inject
U->>HK2: Call Skill
HK2->>HK2: Validate BWR match
alt Compliant
HK2-->>SK: PASS
else Violation
HK2-->>U: BLOCKED + suggestion
end
SK->>SK: Execute skill logic
SK->>HK3: Edit/Write trigger
par Parallel Dispatch
HK3->>SUB: check-typescript
HK3->>SUB: check-lint
HK3->>SUB: suggest-tests
HK3->>SUB: drift-detector + integrity
end
SK->>HK4: Activity log (JSONL)
Note over U,HK5: Session End
HK5->>HK5: E2E route audit
HK5->>HK5: actualSkill feedback
HK5-->>RE: route-feedback.jsonl
graph TB
subgraph L1["Layer 1 - Input Defense (PreToolUse)"]
B1["block-sensitive-files\n.env / credentials"]
B2["block-dangerous-commands\nrm -rf / DROP TABLE"]
B3["commit-message-lint"]
B4["code-quality-gate"]
B5["route-compliance-gate\nBWR validation"]
end
subgraph L2["Layer 2 - Execution Defense (PostToolUse)"]
P1["post-edit-quality-check\nAnti-pattern scan"]
P2["integrity-check\nSHA256 x 24 files"]
P3["drift-detector\nReal-time drift"]
P4["build-outcome-tracker\nSuccess rate"]
end
subgraph L3["Layer 3 - Audit Defense (Stop + Meta)"]
A1["route-auditor\nE2E audit + compliance"]
A2["self-auditor\n10-dim health check"]
A3["activity-logger\nFull JSONL trail"]
end
subgraph SAFEGUARD["Safety Constraints"]
SG1["self-healer: metadata only\nno business logic"]
SG2["Weight clamp +/-0.5\nwhitelist + holdout"]
SG3["Checksums HMAC\ntamper-proof"]
end
L1 -->|"pass"| L2
L2 -->|"pass"| L3
L3 -.->|"CRITICAL/WARNING"| SAFEGUARD
style L1 fill:#3a1a1a,color:#ffcccc,stroke:#cc4444
style L2 fill:#3a2a1a,color:#ffe0cc,stroke:#cc8844
style L3 fill:#1a2a3a,color:#cce0ff,stroke:#4488cc
style SAFEGUARD fill:#1a3a1a,color:#ccffcc,stroke:#44aa44
flowchart TB
subgraph COLLECT["Data Collection"]
Explicit["Explicit Feedback\nUser route corrections"]
Implicit["Implicit Feedback\n5-min post-route usage"]
ComplianceD["Compliance Log\ngate-pass / blocked"]
Build["Build Results\nsuccess / fail / timeout"]
end
subgraph LEARN["Learning Engine"]
Decay["Exponential Decay\nhalf-life 5 days"]
Whitelist["Whitelist Validation\nregistered skills only"]
Clamp["Weight Clamp\n-0.5 to +0.5"]
Holdout["Holdout Validation\n20% reserved"]
Snapshot["Weight Snapshot\nrollback protection"]
end
subgraph APPLY["Application"]
Weights["route-weights.json\nweight delta"]
Index["skills-index.json\n2573 keywords"]
BM25["BM25 Scoring\nbase + learned delta"]
end
subgraph MONITOR["Monitoring"]
H7M["H7 Route Accuracy 13%"]
H8M["H8 Learning Convergence 10%"]
Stale["Stale Detection\nexpired data alert"]
end
Explicit --> Decay
Implicit --> Decay
Decay --> Whitelist --> Clamp --> Holdout
Holdout -->|"validated"| Weights
Holdout -->|"failed"| Snapshot -->|"rollback"| Weights
Weights --> BM25
Index --> BM25
ComplianceD --> H7M
Build --> H8M
H7M --> Stale
H8M --> Stale
style COLLECT fill:#2e1b2e,color:#ffccff,stroke:#aa44aa
style LEARN fill:#1a2e2e,color:#ccffff,stroke:#44aaaa
style APPLY fill:#1b2e1b,color:#ccffcc,stroke:#44aa44
style MONITOR fill:#2e2e1b,color:#ffffcc,stroke:#aaaa44
pie title Health Score Weight Distribution (100%)
"H1 Config Consistency" : 13
"H2 Behavior Baseline" : 13
"H3 Disk Health" : 10
"H4 Hook Integrity" : 13
"H5 Skill Index" : 9
"H6 Rule Cache" : 9
"H7 Route Accuracy" : 13
"H8 Learning Convergence" : 10
"H9 Route Compliance" : 10
"H10 Hook Effectiveness" : 9
graph LR
subgraph STATIC["Static Checks (54%)"]
H1["H1 Config 13%"]
H4["H4 Hooks 13%"]
H5["H5 Skills 9%"]
H6["H6 Rules 9%"]
H10["H10 Hook Eff. 9%"]
end
subgraph DYNAMIC["Dynamic Analysis (36%)"]
H2["H2 Baseline 13%\nIQR + Z-score"]
H7["H7 Accuracy 13%"]
H8["H8 Learning 10%"]
end
subgraph INFRA["Infrastructure (10%)"]
H3["H3 Disk 10%"]
end
subgraph COMP["Compliance (10%)"]
H9["H9 Compliance 10%"]
end
subgraph TUNE["Self-Tuning"]
EWMA["EWMA Threshold"]
TREND["Trend Prediction"]
WOPT["Weight Auto-Opt"]
end
STATIC --> TUNE
DYNAMIC --> TUNE
INFRA --> TUNE
COMP --> TUNE
TUNE -->|"aggregate"| SCORE["Health: 0-100"]
style STATIC fill:#1a2a3a,color:#cce0ff,stroke:#4488cc
style DYNAMIC fill:#2e1b2e,color:#ffccff,stroke:#aa44aa
style INFRA fill:#1a3a1a,color:#ccffcc,stroke:#44aa44
style COMP fill:#3a2a1a,color:#ffe0cc,stroke:#cc8844
graph TB
subgraph CLIENT["Clients"]
EXT["Chrome Extension"]
WEB["Web Dashboard\n:3005"]
end
subgraph HOST["Server "]
subgraph DOCKER["Docker Compose"]
API["FastAPI\n:8002 - :8000"]
PG["PostgreSQL"]
REDIS["Redis"]
end
subgraph OBSERVE["Observability"]
PROM["Prometheus\n:9091"]
GRAF["Grafana\n:3101"]
JAEGER["Jaeger\n:16686 + :4317"]
end
end
subgraph EXTERNAL["External"]
XY["Xianyu WS"]
LLM["LLM API"]
end
EXT -->|"WebSocket"| API
WEB -->|"HTTP REST"| API
API --> PG
API --> REDIS
API -->|"WS dual-path"| XY
API -->|"AI reply gen"| LLM
API -->|"OTel gRPC"| JAEGER
PROM -->|"scrape"| API
GRAF -->|"query"| PROM
GRAF -->|"trace"| JAEGER
style CLIENT fill:#2e2e1b,color:#ffffcc,stroke:#aaaa44
style DOCKER fill:#1a2e2e,color:#ccffff,stroke:#44aaaa
style OBSERVE fill:#1b2e1b,color:#ccffcc,stroke:#44aa44
style EXTERNAL fill:#2e1b2e,color:#ffccff,stroke:#aa44aa
timeline
title Bookworm Evolution (v5.4 - v5.7)
section v5.4 (Feb 23-24)
seq 1-3 : 3-Layer Defense + Disambiguation (18 rules)
: Learning Safety (whitelist + snapshot + holdout)
: Keyword Gap Detection + Health Trends
section v5.5 (Feb 26 - Mar 01)
seq 4-13 : Dispatcher delegation pattern
: Disambiguation externalized (22 rules JSON)
: H9/H10 scoring fix
: 1320 tests all green
section v5.6 (Mar 01)
seq 14-17 : actualSkill compliance loop
: detectPipeline detection
: Framework summary detection (12)
: 27 disambiguation rules
section v5.7 (Mar 01-02)
seq 18 : MCP 3-tier ecosystem 13 to 22
: Skills 50 to 52
: Disambiguation 28 to 31
: Route accuracy 98%
| Dimension | Count | Notes |
|---|---|---|
| Skills | 52 | 10 categories, all stable, 22 composable |
| Agents | 10 | 2 opus + 8 sonnet |
| Hooks | 17 | 13 registered + 4 sub-hooks |
| MCP | 22+3 | 12 local + 9 cloud + 1 plugin + 3 on-demand |
| Scripts | 46 | 45 .js + 1 .py |
| Disambiguation | 31 | JSON externalized rules |
| Synonyms | 22 | Dictionary expansion groups |
| Keywords | 2573 | core / strong / extended 3-tier |
| Health Dims | 10 | Auto-tuning weights + EWMA |
| Evolution | 18 seq | v5.4 - v5.5 - v5.6 - v5.7 |
| Route Accuracy | 98% | With A/B experiment framework |