konoha-mcp 2.1.12 → 2.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/.agents/skills/konoha/SKILL.md +25 -0
  2. package/.agents/skills/tokubetsu-jonin-skill/SKILL.md +48 -23
  3. package/.agents/skills/tokubetsu-jonin-skill/references/docx.md +25 -4
  4. package/.agents/skills/tokubetsu-jonin-skill/references/elite-powerpoint-designer.md +48 -23
  5. package/.agents/skills/tokubetsu-jonin-skill/references/pdf.md +78 -46
  6. package/.agents/skills/tokubetsu-jonin-skill/references/pptx-assets/scripts/office/soffice.py +15 -10
  7. package/.agents/skills/tokubetsu-jonin-skill/references/pptx.md +25 -3
  8. package/.agents/skills/tokubetsu-jonin-skill/references/xlsx-assets/scripts/office/soffice.py +15 -10
  9. package/.agents/skills/tokubetsu-jonin-skill/references/xlsx.md +60 -33
  10. package/.agents/skills/tokubetsu-jonin-skill/references/zero-ai-human-writing.md +34 -11
  11. package/.agents/skills.fingerprint +1 -1
  12. package/README.md +18 -6
  13. package/apps/web/build/adapter-node.js +1 -1
  14. package/apps/web/build/client/_app/version.json +1 -1
  15. package/apps/web/build/client/_app/version.json.br +0 -0
  16. package/apps/web/build/client/_app/version.json.gz +0 -0
  17. package/apps/web/build/server/chunks/instance.js +3 -3
  18. package/apps/web/build/server/chunks/internal.js +1 -1
  19. package/apps/web/package.json +1 -1
  20. package/bin/cli.js +11 -10
  21. package/docs/ALL-WORKFLOW-DIAGRAMS.md +642 -0
  22. package/docs/ARCHITECTURE.md +15 -5
  23. package/docs/SETUP-CLI.md +1 -1
  24. package/docs/SecurityCompliance/security_compliance_report_google_policy_2.1.13_2026-10-07.md +95 -0
  25. package/docs/SecurityCompliance/security_compliance_report_google_policy_2.1.14_2026-10-08.md +88 -0
  26. package/docs/diagrams/README.md +1 -1
  27. package/package.json +3 -2
  28. package/src/agent_manager.js +20 -4
  29. package/src/canonical_skills.js +381 -0
  30. package/src/cursor_manager.js +7 -11
  31. package/src/deploy_utils.js +3 -1
  32. package/src/file_tools_router.js +3 -1
  33. package/src/mcp/anti_slop.js +281 -0
  34. package/src/mcp/memory_reporting.js +21 -0
  35. package/src/mcp/skills.js +278 -0
  36. package/src/mcp/tool_dispatch.js +14 -1
  37. package/src/mcp/workflow.js +1 -1
  38. package/src/mcp_tool_manifest.json +59 -0
  39. package/src/migrate.js +23 -0
  40. package/src/templates/agents.yaml +21 -0
  41. package/src/templates/skills/konoha/SKILL.md +25 -0
  42. package/src/templates/skills/tokubetsu-jonin-skill/SKILL.md +48 -23
  43. package/src/templates/skills/tokubetsu-jonin-skill/references/docx.md +25 -4
  44. package/src/templates/skills/tokubetsu-jonin-skill/references/elite-powerpoint-designer.md +48 -23
  45. package/src/templates/skills/tokubetsu-jonin-skill/references/pdf.md +78 -46
  46. package/src/templates/skills/tokubetsu-jonin-skill/references/pptx-assets/scripts/office/soffice.py +15 -10
  47. package/src/templates/skills/tokubetsu-jonin-skill/references/pptx.md +25 -3
  48. package/src/templates/skills/tokubetsu-jonin-skill/references/xlsx-assets/scripts/office/soffice.py +15 -10
  49. package/src/templates/skills/tokubetsu-jonin-skill/references/xlsx.md +60 -33
  50. package/src/templates/skills/tokubetsu-jonin-skill/references/zero-ai-human-writing.md +34 -11
  51. package/src/vector_search.js +11 -6
  52. package/.agents/skills/helm-chart-scaffolding/SKILL.md +0 -71
  53. package/.agents/skills/helm-chart-scaffolding/assets/Chart.yaml.template +0 -42
  54. package/.agents/skills/helm-chart-scaffolding/assets/values.yaml.template +0 -185
  55. package/.agents/skills/helm-chart-scaffolding/references/chart-structure.md +0 -509
  56. package/.agents/skills/helm-chart-scaffolding/references/details.md +0 -497
  57. package/.agents/skills/helm-chart-scaffolding/scripts/validate-chart.sh +0 -244
  58. package/src/templates/skills/helm-chart-scaffolding/SKILL.md +0 -71
  59. package/src/templates/skills/helm-chart-scaffolding/references/chart-structure.md +0 -509
  60. package/src/templates/skills/helm-chart-scaffolding/references/details.md +0 -497
@@ -0,0 +1,642 @@
1
+ # 🌊 Konoha Complete Workflows Architecture & Flow Diagrams
2
+
3
+ This document defines all active architectural workflows within **Konoha** (`konoha-mcp`) using native, responsive, and publication-ready **Mermaid** diagrams.
4
+
5
+ ---
6
+
7
+ ## 📑 Table of Contents
8
+
9
+ 1. [Master Orchestration Architecture & Client-Specialist Flow](#1-master-orchestration-architecture--client-specialist-flow)
10
+ 2. [Workflow 1: Core Multi-Agent MCP SDLC Orchestration Pipeline](#2-workflow-1-core-multi-agent-mcp-sdlc-orchestration-pipeline)
11
+ 3. [Workflow 2: Definition-of-Readiness (DoR) Gate & Dispatch Flow](#3-workflow-2-definition-of-readiness-dor-gate--dispatch-flow)
12
+ 4. [Workflow 3: Text-Based Website Build Pipeline (`build_from_text`)](#4-workflow-3-text-based-website-build-pipeline-build_from_text)
13
+ 5. [Workflow 4: Mockup / Design Image Build Pipeline (`build_from_source`)](#5-workflow-4-mockup--design-image-build-pipeline-build_from_source)
14
+ 6. [Workflow 5: Two-Step Zero-AI-Slop Pre-Gate & Autonomous Remediation Loop](#6-workflow-5-two-step-zero-ai-slop-pre-gate--autonomous-remediation-loop)
15
+ 7. [Workflow 6: QA Automation & Token-Efficient E2E Validation Flow](#7-workflow-6-qa-automation--token-efficient-e2e-validation-flow)
16
+ 8. [Workflow 7: Skills Lifecycle, SQLite FTS5 & Cross-Client 5-Tree Synchronization](#8-workflow-7-skills-lifecycle-sqlite-fts5--cross-client-5-tree-synchronization)
17
+ 9. [Workflow 8: Local LLM Proxy Bridge Gateway & Sidecar Binary RPC](#9-workflow-8-local-llm-proxy-bridge-gateway--sidecar-binary-rpc)
18
+ 10. [Workflow 9: Socket.dev Supply Chain Security Gate & Policy Evaluation](#10-workflow-9-socketdev-supply-chain-security-gate--policy-evaluation)
19
+ 11. [Workflow 10: Kage Reviewer 98% Minimum Confidence Delivery Gate](#11-workflow-10-kage-reviewer-98-minimum-confidence-delivery-gate)
20
+
21
+ ---
22
+
23
+ ## 1. Master Orchestration Architecture & Client-Specialist Flow
24
+
25
+ ```mermaid
26
+ ---
27
+ title: Konoha Master System Architecture & Specialist Orchestration Flow
28
+ config:
29
+ theme: base
30
+ themeVariables:
31
+ background: '#ffffff'
32
+ mainBkg: '#ffffff'
33
+ primaryColor: '#dbeafe'
34
+ primaryTextColor: '#1e3a8a'
35
+ primaryBorderColor: '#2563eb'
36
+ lineColor: '#0f172a'
37
+ arrowheadColor: '#0f172a'
38
+ secondaryColor: '#ede9fe'
39
+ tertiaryColor: '#d1fae5'
40
+ fontFamily: 'Inter, system-ui, sans-serif'
41
+ fontSize: '14px'
42
+ flowchart:
43
+ nodeSpacing: 45
44
+ rankSpacing: 55
45
+ padding: 24
46
+ wrappingWidth: 380
47
+ ---
48
+ flowchart TB
49
+ UserPrompt["End User / Client Prompt"] --> Clients["7 Supported Coding Environments<br/>Antigravity CLI/IDE · Cursor · Claude Code<br/>OpenCode · Command Code · Codex · Pi"]
50
+ Clients --> Orchestrator["Main Orchestrator Agent<br/>(Structured MCP Router)"]
51
+
52
+ subgraph CoreMCP ["Konoha MCP & Storage Foundation"]
53
+ SanninRouter["✧ Sannin MCP Router<br/>(Prompt Triage & Delegation)"]
54
+ SQLiteDB[("Unified SQLite DB<br/>~/.konoha/konoha.db<br/>(FTS5 · WAL Mode · busy_timeout=5000)")]
55
+ SembleSearch["Semble MCP Server<br/>(Project Code Search & Symbol Index)"]
56
+ AislopScanner["Aislop MCP Server<br/>(Zero-AI-Slop Code Hygiene)"]
57
+ SanninRouter <--> SQLiteDB
58
+ end
59
+
60
+ Orchestrator --> CoreMCP
61
+
62
+ subgraph NinjaTeam ["Specialist Ninja Subagents"]
63
+ Genin["⚑ genin<br/>(Read-only Code Scout)"]
64
+ Kage["◎ kage<br/>(Architecture & Security)"]
65
+ Chunin["▫ chunin<br/>(Web Intel & Citations)"]
66
+ Jonin["♦ jonin<br/>(Frontend UI & Tailwind)"]
67
+ Anbu["♠ anbu<br/>(Backend, DevOps & QA)"]
68
+ Tokubetsu["⬡ tokubetsu-jonin<br/>(Documentation Scribe)"]
69
+ end
70
+
71
+ CoreMCP --> NinjaTeam
72
+
73
+ subgraph QualityGate ["Verification & Quality Enforcement"]
74
+ DoRGate["Definition-of-Readiness Gate<br/>(Advisory / Enforced Check)"]
75
+ SlopGate["Two-Step Zero-AI-Slop Gate<br/>(100/100 Mechanical Scan)"]
76
+ SocketGate["Socket.dev Security Gate<br/>(0 High / 0 Medium Alerts)"]
77
+ ConfidenceGate["Kage 98% Confidence Gate<br/>(Delivery Sign-off)"]
78
+ end
79
+
80
+ NinjaTeam --> QualityGate
81
+ QualityGate --> Delivery["Final Delivery & User Response<br/>(Structured Confidence Report)"]
82
+
83
+ linkStyle default stroke:#0f172a,stroke-width:2px;
84
+ classDef user fill:#dbeafe,stroke:#2563eb,color:#1e3a8a,stroke-width:2px;
85
+ classDef mcp fill:#d1fae5,stroke:#059669,color:#065f46,stroke-width:2px;
86
+ classDef agents fill:#ede9fe,stroke:#7c3aed,color:#4c1d95,stroke-width:2px;
87
+ classDef gates fill:#fef3c7,stroke:#d97706,color:#78350f,stroke-width:2px;
88
+ class UserPrompt,Delivery user;
89
+ class CoreMCP,SanninRouter,SQLiteDB,SembleSearch,AislopScanner mcp;
90
+ class Genin,Kage,Chunin,Jonin,Anbu,Tokubetsu agents;
91
+ class DoRGate,SlopGate,SocketGate,ConfidenceGate gates;
92
+ ```
93
+
94
+ ---
95
+
96
+ ## 2. Workflow 1: Core Multi-Agent MCP SDLC Orchestration Pipeline
97
+
98
+ ```mermaid
99
+ ---
100
+ title: Core Multi-Agent MCP SDLC 8-Phase Lifecycle
101
+ config:
102
+ theme: base
103
+ themeVariables:
104
+ background: '#ffffff'
105
+ mainBkg: '#ffffff'
106
+ primaryColor: '#ede9fe'
107
+ primaryTextColor: '#1e1b4b'
108
+ primaryBorderColor: '#7c3aed'
109
+ lineColor: '#0f172a'
110
+ arrowheadColor: '#0f172a'
111
+ secondaryColor: '#d1fae5'
112
+ tertiaryColor: '#dbeafe'
113
+ fontFamily: 'Inter, system-ui, sans-serif'
114
+ fontSize: '14px'
115
+ flowchart:
116
+ nodeSpacing: 45
117
+ rankSpacing: 55
118
+ padding: 24
119
+ wrappingWidth: 380
120
+ ---
121
+ flowchart TD
122
+ Init["Prompt Ingestion"] --> Phase0["Phase 0: ROUTE (✧ Sannin)<br/>• Read prompt.md<br/>• Initialize status.json & SQLite WAL<br/>• Assess task readiness"]
123
+ Phase0 --> Phase1["Phase 1: EXPLORE (⚑ Genin)<br/>• Read-only symbol discovery<br/>• Map blast radius & dependencies<br/>• Output findings.md & result.md"]
124
+ Phase1 --> Phase2["Phase 2: PLAN (◎ Kage)<br/>• Evaluate architecture & trade-offs<br/>• Formulate plan.md checklist<br/>• Register tasks in sdlc_tasks"]
125
+
126
+ Phase2 --> CheckResearch{"External Intel<br/>Required?"}
127
+ CheckResearch -- "needs_research: true" --> Phase2b["Phase 2b: RESEARCH (▫ Chunin)<br/>• Web search & official doc extraction<br/>• Synthesize citations into findings.md"]
128
+ Phase2b --> Phase2
129
+ CheckResearch -- "needs_replan: true" --> Phase2
130
+ CheckResearch -- "Ready to execute" --> Phase3["Phase 3: EXECUTE (♦ Jonin / ♠ Anbu)<br/>• Dispatches tasks sequentially<br/>• Jonin: UI/Frontend / Tailwind v4<br/>• Anbu: Backend, API, DB & DevOps<br/>• Runs build & validation commands"]
131
+
132
+ Phase3 --> Phase4["Phase 4: DOCUMENT (⬡ Tokubetsu-Jonin)<br/>• Generate final_docs.md & API specs<br/>• Synchronize CHANGELOG.md"]
133
+ Phase4 --> Phase5["Phase 5: REVIEW (◎ Kage)<br/>• Two-Step Zero-AI-Slop Pre-Gate<br/>• Socket.dev Supply Chain Gate<br/>• Definition-of-Done Verification"]
134
+
135
+ Phase5 --> CheckReview{"Kage Review<br/>Approved?"}
136
+ CheckReview -- "Approved (≥ 98% Confidence)" --> Phase6["Phase 6: SYNTHESIZE (✧ Sannin)<br/>• Assemble final_report.md<br/>• Consolidate task evidence"]
137
+ Phase6 --> Phase7["Phase 7: DONE<br/>• Clean transient scratch directories<br/>• Present final deliverable to user"]
138
+
139
+ CheckReview -- "Findings Detected" --> Remediation["Autonomous Remediation Loop<br/>• Convert findings into fix tasks<br/>• Circuit Breaker check (slop_cycles <= 7)<br/>• Dispatch to Jonin (UI) or Anbu (Backend)"]
140
+ Remediation --> Phase3
141
+
142
+ linkStyle default stroke:#0f172a,stroke-width:2px;
143
+ classDef route fill:#dbeafe,stroke:#2563eb,color:#1e3a8a,stroke-width:2px;
144
+ classDef execute fill:#ede9fe,stroke:#7c3aed,color:#4c1d95,stroke-width:2px;
145
+ classDef review fill:#fef3c7,stroke:#d97706,color:#78350f,stroke-width:2px;
146
+ classDef remediation fill:#fee2e2,stroke:#dc2626,color:#991b1b,stroke-width:2px;
147
+ class Phase0,Init,Phase7 route;
148
+ class Phase1,Phase2,Phase2b,Phase3,Phase4,Phase6 execute;
149
+ class Phase5,CheckReview review;
150
+ class Remediation remediation;
151
+ ```
152
+
153
+ ---
154
+
155
+ ## 3. Workflow 2: Definition-of-Readiness (DoR) Gate & Dispatch Flow
156
+
157
+ ```mermaid
158
+ ---
159
+ title: Definition-of-Readiness (DoR) Pre-Dispatch Validation Gate
160
+ config:
161
+ theme: base
162
+ themeVariables:
163
+ background: '#ffffff'
164
+ mainBkg: '#ffffff'
165
+ primaryColor: '#ffffff'
166
+ primaryTextColor: '#0f172a'
167
+ primaryBorderColor: '#0284c7'
168
+ lineColor: '#0f172a'
169
+ arrowheadColor: '#0f172a'
170
+ fontFamily: 'Inter, system-ui, sans-serif'
171
+ fontSize: '14px'
172
+ flowchart:
173
+ nodeSpacing: 45
174
+ rankSpacing: 55
175
+ padding: 24
176
+ wrappingWidth: 350
177
+ ---
178
+ flowchart TD
179
+ Trigger["Task Dispatch Trigger"] --> Inspect["Inspect Task Definition<br/>(title, prompt, context, parameters)"]
180
+ Inspect --> Engine["DoR Assessment Engine<br/>(`src/sdlc_manager.js`)"]
181
+
182
+ subgraph AssessmentRules ["Multi-Rule Verification Engine"]
183
+ R1["Length & Context Rule<br/>• Prompt > 4 words<br/>• Explicit functional directive"]
184
+ R2["Placeholder Hygiene<br/>• Zero TODO / FIXME / ???<br/>• No unresolved pseudocode"]
185
+ R3["File Existence Check<br/>• Target files must exist on disk<br/>• Workspace boundaries valid"]
186
+ R4["Domain Alignment<br/>• Keywords match target specialist"]
187
+ end
188
+
189
+ Engine --> AssessmentRules
190
+ AssessmentRules --> ModeGate{"Governance Mode<br/>Configuration"}
191
+
192
+ ModeGate -- "mode: advisory (Default)" --> AdvisoryEval{"Issues<br/>Found?"}
193
+ AdvisoryEval -- "No issues" --> Dispatch1["Dispatch Task to Specialist"]
194
+ AdvisoryEval -- "Issues found" --> InjectHint["Inject Diagnostic Hints & Warnings<br/>• Record warning in task metadata<br/>• Proceed with dispatch"]
195
+ InjectHint --> Dispatch1
196
+
197
+ ModeGate -- "mode: enforced" --> EnforcedEval{"Issues<br/>Found?"}
198
+ EnforcedEval -- "No issues" --> Dispatch2["Dispatch Task to Specialist"]
199
+ EnforcedEval -- "Issues found" --> BlockDispatch["BLOCK TASK DISPATCH<br/>• Reject execution<br/>• Return DoR failure diagnostics<br/>• Require clarified prompt"]
200
+
201
+ linkStyle default stroke:#0f172a,stroke-width:2px;
202
+ classDef trigger fill:#dbeafe,stroke:#2563eb,color:#1e3a8a,stroke-width:2px;
203
+ classDef pass fill:#d1fae5,stroke:#059669,color:#065f46,stroke-width:2px;
204
+ classDef block fill:#fee2e2,stroke:#dc2626,color:#991b1b,stroke-width:2px;
205
+ class Trigger,Inspect,Engine trigger;
206
+ class Dispatch1,Dispatch2 pass;
207
+ class BlockDispatch block;
208
+ ```
209
+
210
+ ---
211
+
212
+ ## 4. Workflow 3: Text-Based Website Build Pipeline (`build_from_text`)
213
+
214
+ ```mermaid
215
+ ---
216
+ title: Text-Based Website & UI Build Pipeline (build_from_text)
217
+ config:
218
+ theme: base
219
+ themeVariables:
220
+ background: '#ffffff'
221
+ mainBkg: '#ffffff'
222
+ primaryColor: '#ede9fe'
223
+ primaryTextColor: '#1e1b4b'
224
+ primaryBorderColor: '#7c3aed'
225
+ lineColor: '#0f172a'
226
+ arrowheadColor: '#0f172a'
227
+ fontFamily: 'Inter, system-ui, sans-serif'
228
+ fontSize: '14px'
229
+ flowchart:
230
+ nodeSpacing: 45
231
+ rankSpacing: 55
232
+ padding: 24
233
+ wrappingWidth: 380
234
+ ---
235
+ flowchart TD
236
+ UserReq["User Prompt:<br/>'Build an e-commerce / dashboard / SaaS platform'"] --> Step1["Step 1: MCP Call `konoha.build_from_text`<br/>(name, description, framework, taste_dials)"]
237
+ Step1 --> Step2["Step 2: Generate Specification Object<br/>• Canonical Framework Resolved (Next.js, Svelte, Nuxt, Angular)<br/>• Validation commands formulated<br/>• Archetype layout directives applied"]
238
+
239
+ Step2 --> Step3["Step 3: Framework-Native CLI Scaffolding<br/>• Next.js: pnpm create next-app@latest<br/>• Nuxt: pnpm dlx nuxi@latest init<br/>• Angular: pnpm dlx @angular/cli@latest new<br/>• SvelteKit: pnpm dlx sv create"]
240
+
241
+ subgraph MandatoryInvariants ["Mandatory Konoha Layout Invariants"]
242
+ I1["Brand Logo Far-Left<br/>(Never centered; actions on right)"]
243
+ I2["Zero Mobile Header Toggle<br/>(No broken hamburger menu)"]
244
+ I3["Archetype-Adaptive Mobile Dock<br/>(Fixed bottom navigation bar)"]
245
+ I4["Fixed Left Sidebar (Desktop)<br/>(Dashboard / Admin / Infra builds)"]
246
+ I5["Floating Theme Switcher Modal<br/>(Bottom-left FAB, 10-theme picker)"]
247
+ I6["Hero Banner Carousel<br/>(4+ HD slides, 5000ms autoplay)"]
248
+ I7["Mandatory package.json Scripts<br/>('build', 'lint', 'start', 'check')"]
249
+ end
250
+
251
+ Step3 --> MandatoryInvariants
252
+ MandatoryInvariants --> Step4["Step 4: Elite Implementation (♦ Jonin)<br/>• Semantic Tailwind CSS v4 styling<br/>• Reduced-motion accessible transitions<br/>• Pure Light Mode fidelity"]
253
+
254
+ Step4 --> Step5["Step 5: Framework Validation Suite<br/>• pnpm run build ──► 0 Errors<br/>• pnpm run lint ──► 0 Warnings<br/>• pnpm run check ──► Clean"]
255
+
256
+ Step5 --> Step6["Step 6: Kage Two-Step Review Gate<br/>• 100/100 aislop scan<br/>• ≥ 98% Delivery Confidence"]
257
+
258
+ linkStyle default stroke:#0f172a,stroke-width:2px;
259
+ classDef req fill:#dbeafe,stroke:#2563eb,color:#1e3a8a,stroke-width:2px;
260
+ classDef scaffold fill:#ede9fe,stroke:#7c3aed,color:#4c1d95,stroke-width:2px;
261
+ classDef validate fill:#d1fae5,stroke:#059669,color:#065f46,stroke-width:2px;
262
+ class UserReq req;
263
+ class Step1,Step2,Step3,MandatoryInvariants,Step4 scaffold;
264
+ class Step5,Step6 validate;
265
+ ```
266
+
267
+ ---
268
+
269
+ ## 5. Workflow 4: Mockup / Design Image Build Pipeline (`build_from_source`)
270
+
271
+ ```mermaid
272
+ ---
273
+ title: Mockup & Design Image Build Pipeline (build_from_source)
274
+ config:
275
+ theme: base
276
+ themeVariables:
277
+ background: '#ffffff'
278
+ mainBkg: '#ffffff'
279
+ primaryColor: '#dbeafe'
280
+ primaryTextColor: '#1e3a8a'
281
+ primaryBorderColor: '#2563eb'
282
+ lineColor: '#0f172a'
283
+ arrowheadColor: '#0f172a'
284
+ fontFamily: 'Inter, system-ui, sans-serif'
285
+ fontSize: '14px'
286
+ flowchart:
287
+ nodeSpacing: 45
288
+ rankSpacing: 55
289
+ padding: 24
290
+ wrappingWidth: 380
291
+ ---
292
+ flowchart TD
293
+ SourceDesign["User Prompt with Design Images / Mockup Dir"] --> Step1["Step 1: MCP Call `konoha.build_from_source`<br/>(name, source_dir, framework, taste_dials)"]
294
+ Step1 --> Step2["Step 2: Specification Validation<br/>• status == 'success'<br/>• absolute_image_paths extracted<br/>• Canonical framework verified"]
295
+
296
+ Step2 --> Step3["Step 3: Bounded Asset Inspection<br/>• Inspect images via bounded file tools<br/>• Extract colors, typography, spacing & layout<br/>• NEVER install packages inside MCP tool"]
297
+
298
+ subgraph FidelityRule ["100% Exact Mockup Fidelity Invariant"]
299
+ F1["Strict Visual Replication<br/>• Layout, colors, typography, and spacing"]
300
+ F2["Zero Silent Structural Alterations<br/>• DO NOT force carousels or theme pickers<br/>unless explicitly present in mockup!"]
301
+ F3["Non-Structural Polish Only<br/>• Taste-Skill applied strictly for smooth transitions"]
302
+ end
303
+
304
+ Step3 --> FidelityRule
305
+ FidelityRule --> Step4["Step 4: Implementation (♦ Jonin)<br/>• Replicate source layout pixel-for-pixel<br/>• Framework-native component tree"]
306
+
307
+ Step4 --> Step5["Step 5: Visual Verification (`agent-browser`)<br/>• Local rendering screenshot capture<br/>• Side-by-side design match audit"]
308
+
309
+ Step5 --> Step6["Step 6: Framework Build Validation<br/>• pnpm run build & lint pass cleanly<br/>• 0 Errors, 0 Warnings"]
310
+
311
+ Step6 --> Step7["Step 7: Delivery Verification Gate"]
312
+
313
+ linkStyle default stroke:#0f172a,stroke-width:2px;
314
+ classDef start fill:#dbeafe,stroke:#2563eb,color:#1e3a8a,stroke-width:2px;
315
+ classDef process fill:#ede9fe,stroke:#7c3aed,color:#4c1d95,stroke-width:2px;
316
+ classDef finish fill:#d1fae5,stroke:#059669,color:#065f46,stroke-width:2px;
317
+ class SourceDesign start;
318
+ class Step1,Step2,Step3,FidelityRule,Step4,Step5 process;
319
+ class Step6,Step7 finish;
320
+ ```
321
+
322
+ ---
323
+
324
+ ## 6. Workflow 5: Two-Step Zero-AI-Slop Pre-Gate & Autonomous Remediation Loop
325
+
326
+ ```mermaid
327
+ ---
328
+ title: Two-Step Zero-AI-Slop Delivery Pre-Gate & Remediation Loop
329
+ config:
330
+ theme: base
331
+ themeVariables:
332
+ background: '#ffffff'
333
+ mainBkg: '#ffffff'
334
+ primaryColor: '#fef3c7'
335
+ primaryTextColor: '#78350f'
336
+ primaryBorderColor: '#d97706'
337
+ lineColor: '#0f172a'
338
+ arrowheadColor: '#0f172a'
339
+ fontFamily: 'Inter, system-ui, sans-serif'
340
+ fontSize: '14px'
341
+ flowchart:
342
+ nodeSpacing: 45
343
+ rankSpacing: 55
344
+ padding: 24
345
+ wrappingWidth: 380
346
+ ---
347
+ flowchart TD
348
+ Trigger["Pre-Delivery Review Gate Triggered"] --> Step1["Step 1: Mechanical Scan Gate<br/>• Run `aislop_scan` (or CLI `rtk aislop scan --changes`)<br/>• CircuitBreaker fail-safe degrade (recovery=120s)<br/>• Dynamic file mtime cache invalidation<br/>• TARGET: Exactly 100 / 100 Score, 0 Findings"]
349
+
350
+ Step1 --> Step2["Step 2: Anti-Slop Rule Review<br/>• Load vendored `antislop` skill family<br/>• Audit code comments (zero syntax narration)<br/>• Audit implementations (zero lazy TODOs / stubs)<br/>• Audit accessibility (contrast, focus states)"]
351
+
352
+ Step2 --> CheckSlop{"Any AI Slop<br/>Findings Found?"}
353
+
354
+ CheckSlop -- "Zero Findings (100/100 Clean)" --> PassGate["Delivery Pre-Gate Passed<br/>• ai_slop_clean: true<br/>• ai_slop_findings: 0<br/>• Score: 100 / 100"]
355
+ PassGate --> KageGate["Proceed to Kage Confidence Scoring<br/>(Target ≥ 98%)"]
356
+
357
+ CheckSlop -- "Findings Detected" --> LoopInit["Increment slop_cycles Counter"]
358
+ LoopInit --> CheckBreaker{"Circuit Breaker<br/>slop_cycles > 7?"}
359
+
360
+ CheckBreaker -- "YES (> 7 cycles)" --> Tripped["TRIP CIRCUIT BREAKER<br/>• Halt autonomous recursion<br/>• Set status = 'blocked'<br/>• Surface findings to user"]
361
+
362
+ CheckBreaker -- "NO (<= 7 cycles)" --> Triage["Autonomous Triage Engine<br/>(`src/sdlc_manager.js`)"]
363
+ Triage --> CheckType{"Are findings<br/>UI / Frontend related?"}
364
+
365
+ CheckType -- "YES" --> AssignJonin["Dispatch Fix Task to ♦ JONIN<br/>• Priority: High<br/>• Focus: CSS / Component / Tailwind fixes"]
366
+ CheckType -- "NO" --> AssignAnbu["Dispatch Fix Task to ♠ ANBU<br/>• Priority: High<br/>• Focus: Backend / Logic / Clean Code fixes"]
367
+
368
+ AssignJonin --> ReExecute["Execute Fixes, Re-run Tests & Re-enter Gate"]
369
+ AssignAnbu --> ReExecute
370
+ ReExecute --> Step1
371
+
372
+ linkStyle default stroke:#0f172a,stroke-width:2px;
373
+ classDef trigger fill:#dbeafe,stroke:#2563eb,color:#1e3a8a,stroke-width:2px;
374
+ classDef pass fill:#d1fae5,stroke:#059669,color:#065f46,stroke-width:2px;
375
+ classDef loop fill:#fee2e2,stroke:#dc2626,color:#991b1b,stroke-width:2px;
376
+ class Trigger,Step1,Step2 trigger;
377
+ class PassGate,KageGate pass;
378
+ class LoopInit,CheckBreaker,Tripped,Triage,AssignJonin,AssignAnbu,ReExecute loop;
379
+ ```
380
+
381
+ ---
382
+
383
+ ## 7. Workflow 6: QA Automation & Token-Efficient E2E Validation Flow
384
+
385
+ ```mermaid
386
+ ---
387
+ title: Token-Efficient QA Automation Pipeline (♠ Anbu Owner)
388
+ config:
389
+ theme: base
390
+ themeVariables:
391
+ background: '#ffffff'
392
+ mainBkg: '#ffffff'
393
+ primaryColor: '#ffffff'
394
+ primaryTextColor: '#0f172a'
395
+ primaryBorderColor: '#0284c7'
396
+ lineColor: '#0f172a'
397
+ arrowheadColor: '#0f172a'
398
+ fontFamily: 'Inter, system-ui, sans-serif'
399
+ fontSize: '14px'
400
+ flowchart:
401
+ nodeSpacing: 45
402
+ rankSpacing: 55
403
+ padding: 24
404
+ wrappingWidth: 350
405
+ ---
406
+ flowchart LR
407
+ Start["QA Task Ingestion"] --> S1["1. Test Discovery<br/>(Check tests/ & prevent duplicates)"]
408
+ S1 --> S2["2. Flow Recording<br/>(agent-browser captures JSON steps)"]
409
+ S2 --> S3["3. Test Codification<br/>(qa_codify compiles Playwright spec)"]
410
+ S3 --> S4["4. Headless Execution<br/>(qa_e2e_run runs Playwright test)"]
411
+ S4 --> S5["5. Evidence Capping<br/>(Clean exit 0 & output < 2,000 chars)"]
412
+ S5 --> S6["6. Persistence<br/>(Save run_id to SQLite sdlc_tasks)"]
413
+ S6 --> Done["Kage Verification Sign-off"]
414
+
415
+ linkStyle default stroke:#0f172a,stroke-width:2px;
416
+ classDef step fill:#dbeafe,stroke:#2563eb,color:#1e3a8a,stroke-width:2px;
417
+ classDef pass fill:#d1fae5,stroke:#059669,color:#065f46,stroke-width:2px;
418
+ class Start,S1,S2,S3,S4,S5 step;
419
+ class S6,Done pass;
420
+ ```
421
+
422
+ ---
423
+
424
+ ## 8. Workflow 7: Skills Lifecycle, SQLite FTS5 & Cross-Client 5-Tree Synchronization
425
+
426
+ ```mermaid
427
+ ---
428
+ title: Skills Indexing, Retrieval & Cross-Client Synchronization Flow
429
+ config:
430
+ theme: base
431
+ themeVariables:
432
+ background: '#ffffff'
433
+ mainBkg: '#ffffff'
434
+ primaryColor: '#ede9fe'
435
+ primaryTextColor: '#1e1b4b'
436
+ primaryBorderColor: '#7c3aed'
437
+ lineColor: '#0f172a'
438
+ arrowheadColor: '#0f172a'
439
+ fontFamily: 'Inter, system-ui, sans-serif'
440
+ fontSize: '14px'
441
+ flowchart:
442
+ nodeSpacing: 45
443
+ rankSpacing: 55
444
+ padding: 24
445
+ wrappingWidth: 380
446
+ ---
447
+ flowchart TB
448
+ SourceTree["Canonical Source of Truth<br/>`.agents/skills/` (16 Skills + Embedded References)"] --> SyncScript["Additive Mirror Synchronization<br/>`node scripts/sync_skills.js`"]
449
+
450
+ subgraph MirrorTrees ["Cross-Client 5-Tree Repository Mirrors"]
451
+ M1["src/templates/skills/"]
452
+ M2[".cursor/skills/"]
453
+ M3[".gemini/skills/"]
454
+ M4[".commandcode/skills/"]
455
+ M5[".claude/skills/"]
456
+ end
457
+
458
+ SyncScript --> MirrorTrees
459
+
460
+ SourceTree --> FTS5Migrate["SQLite FTS5 Ingestion<br/>`src/migrate.js` (Non-destructive UPSERT)"]
461
+ FTS5Migrate --> SQLiteDB[("Unified Database: `~/.konoha/konoha.db`<br/>• skills (exact name, type, metadata)<br/>• skills_fts (BM25 token index)<br/>• skill_chunks (384d semantic vectors)")]
462
+
463
+ subgraph ClientQueries ["On-Demand Retrieval Pipeline"]
464
+ Find["Step 1: Discover<br/>konoha.find_skill('keyword')<br/>(Fast SQLite snippet & score preview)"]
465
+ Load["Step 2: Ingest<br/>konoha.get_skill('canonical-name')<br/>(Full documentation manual on demand)"]
466
+ end
467
+
468
+ SQLiteDB <--> Find
469
+ Find --> Load
470
+
471
+ subgraph AutoCompaction ["High-Efficiency Auto-Compaction (Turn >= 2)"]
472
+ AC1["Project Memory Continuity<br/>(Tech stack & invariants permanently retained)"]
473
+ AC2["Prompt Boilerplate Compaction<br/>(Instruction boilerplate compressed)"]
474
+ AC3["250-char SOP Preview Invariant<br/>(Always preserved even in compact mode)"]
475
+ end
476
+
477
+ Load --> AutoCompaction
478
+
479
+ linkStyle default stroke:#0f172a,stroke-width:2px;
480
+ classDef source fill:#dbeafe,stroke:#2563eb,color:#1e3a8a,stroke-width:2px;
481
+ classDef db fill:#d1fae5,stroke:#059669,color:#065f46,stroke-width:2px;
482
+ classDef retrieval fill:#ede9fe,stroke:#7c3aed,color:#4c1d95,stroke-width:2px;
483
+ class SourceTree,SyncScript,MirrorTrees source;
484
+ class FTS5Migrate,SQLiteDB db;
485
+ class Find,Load,AutoCompaction retrieval;
486
+ ```
487
+
488
+ ---
489
+
490
+ ## 9. Workflow 8: Local LLM Proxy Bridge Gateway & Sidecar Binary RPC
491
+
492
+ ```mermaid
493
+ ---
494
+ title: Local LLM Proxy Bridge Gateway & Protobuf Sidecar Architecture
495
+ config:
496
+ theme: base
497
+ themeVariables:
498
+ background: '#ffffff'
499
+ mainBkg: '#ffffff'
500
+ primaryColor: '#ffe6cc'
501
+ primaryTextColor: '#78350f'
502
+ primaryBorderColor: '#d97706'
503
+ lineColor: '#0f172a'
504
+ arrowheadColor: '#0f172a'
505
+ fontFamily: 'Inter, system-ui, sans-serif'
506
+ fontSize: '14px'
507
+ flowchart:
508
+ nodeSpacing: 45
509
+ rankSpacing: 55
510
+ padding: 24
511
+ wrappingWidth: 380
512
+ ---
513
+ flowchart TB
514
+ Client["AI Coding Client<br/>(Antigravity IDE with konoha-bridge VSIX)"] --> OuterGateway["Local Bridge Router<br/>`127.0.0.1:1404` / :19999"]
515
+
516
+ OuterGateway --> Intercept["Request Multiplexer & Model Classifier<br/>• Maps model names from SQLite bridges table<br/>• Pure JavaScript routing (Zero native binaries)"]
517
+
518
+ subgraph SidecarProtocol ["Sidecar Binary Serialization (`src/bridge/sidecar/proto.js`)"]
519
+ ProtoEncoder["Protobuf Binary Serialization<br/>• Hand-crafted descriptors (StartCascade, Messages)<br/>• Uses @bufbuild/protobuf@2.16.0<br/>• Reads BUF_BIGINT_DISABLE for runtime fallback"]
520
+ end
521
+
522
+ Intercept --> ProtoEncoder
523
+
524
+ subgraph ModelEndpoints ["Destination Providers"]
525
+ CloudLLM["Upstream Cloud LLM<br/>(OpenAI / Gemini / Claude API)"]
526
+ LocalLLM["Local Small Language Model<br/>(Ollama `127.0.0.1:11434`)"]
527
+ end
528
+
529
+ ProtoEncoder --> CloudLLM
530
+ ProtoEncoder --> LocalLLM
531
+
532
+ linkStyle default stroke:#0f172a,stroke-width:2px;
533
+ classDef client fill:#dbeafe,stroke:#2563eb,color:#1e3a8a,stroke-width:2px;
534
+ classDef router fill:#ede9fe,stroke:#7c3aed,color:#4c1d95,stroke-width:2px;
535
+ classDef sidecar fill:#fef3c7,stroke:#d97706,color:#78350f,stroke-width:2px;
536
+ class Client client;
537
+ class OuterGateway,Intercept router;
538
+ class ProtoEncoder sidecar;
539
+ ```
540
+
541
+ ---
542
+
543
+ ## 10. Workflow 9: Socket.dev Supply Chain Security Gate & Policy Evaluation
544
+
545
+ ```mermaid
546
+ ---
547
+ title: Socket.dev Supply Chain Security Policy & Scan Workflow
548
+ config:
549
+ theme: base
550
+ themeVariables:
551
+ background: '#ffffff'
552
+ mainBkg: '#ffffff'
553
+ primaryColor: '#ffffff'
554
+ primaryTextColor: '#0f172a'
555
+ primaryBorderColor: '#0284c7'
556
+ lineColor: '#0f172a'
557
+ arrowheadColor: '#0f172a'
558
+ fontFamily: 'Inter, system-ui, sans-serif'
559
+ fontSize: '14px'
560
+ flowchart:
561
+ nodeSpacing: 45
562
+ rankSpacing: 55
563
+ padding: 24
564
+ wrappingWidth: 380
565
+ ---
566
+ flowchart TD
567
+ Commit["Repository Commit / Pull Request"] --> Config["Load `socket.yml` Configuration<br/>(Repository-Level Policy)"]
568
+
569
+ subgraph PolicyEngine ["Policy Filtering Rules"]
570
+ Ignores["projectIgnorePaths<br/>• Exclude: tests, docs, apps/web, .agents<br/>• Scopes static scanner strictly to root manifest"]
571
+ Rules["issueRules Override<br/>• envVars: false (Protobuf BUF_BIGINT_DISABLE)<br/>• urlStrings: false (Localhost / Docs / MCP ports)<br/>• networkAccess: false"]
572
+ end
573
+
574
+ Config --> PolicyEngine
575
+ PolicyEngine --> SocketCI["Execute Socket Scan<br/>`rtk socket ci` / `socket scan create`"]
576
+
577
+ SocketCI --> AuditAlerts{"Evaluate Alerts<br/>Against Threshold"}
578
+ AuditAlerts -- "0 High & 0 Medium Alerts" --> GatePass["Supply Chain Gate PASSED<br/>• Score Target ≥ 98 / 100<br/>• Approved for Production"]
579
+ AuditAlerts -- "High or Medium Alert Detected" --> GateFail["BLOCK DELIVERY<br/>• Surface alert locations<br/>• Enforce dependency remediation"]
580
+
581
+ linkStyle default stroke:#0f172a,stroke-width:2px;
582
+ classDef commit fill:#dbeafe,stroke:#2563eb,color:#1e3a8a,stroke-width:2px;
583
+ classDef pass fill:#d1fae5,stroke:#059669,color:#065f46,stroke-width:2px;
584
+ classDef fail fill:#fee2e2,stroke:#dc2626,color:#991b1b,stroke-width:2px;
585
+ class Commit,Config commit;
586
+ class GatePass pass;
587
+ class GateFail fail;
588
+ ```
589
+
590
+ ---
591
+
592
+ ## 11. Workflow 10: Kage Reviewer 98% Minimum Confidence Delivery Gate
593
+
594
+ ```mermaid
595
+ ---
596
+ title: Kage Reviewer 98% Minimum Confidence Delivery Gate
597
+ config:
598
+ theme: base
599
+ themeVariables:
600
+ background: '#ffffff'
601
+ mainBkg: '#ffffff'
602
+ primaryColor: '#fef3c7'
603
+ primaryTextColor: '#78350f'
604
+ primaryBorderColor: '#d97706'
605
+ lineColor: '#0f172a'
606
+ arrowheadColor: '#0f172a'
607
+ fontFamily: 'Inter, system-ui, sans-serif'
608
+ fontSize: '14px'
609
+ flowchart:
610
+ nodeSpacing: 45
611
+ rankSpacing: 55
612
+ padding: 24
613
+ wrappingWidth: 380
614
+ ---
615
+ flowchart TD
616
+ TasksDone["All Implementation Tasks Completed"] --> KageAudit["◎ Kage Independent Audit Review"]
617
+
618
+ subgraph CriteriaMatrix ["5-Category Comprehensive Verification Matrix"]
619
+ C1["Category 1: Task Verification (Weight: 20%)<br/>• 100% tasks completed in status.json<br/>• All referenced files exist on disk"]
620
+ C2["Category 2: Validation Evidence (Weight: 25%)<br/>• 0 errors, 0 warnings in test output<br/>• Clean exit codes across test runners"]
621
+ C3["Category 3: Security & Supply Chain (Weight: 20%)<br/>• Socket CLI: 0 High, 0 Medium alerts<br/>• Documented rollback procedures"]
622
+ C4["Category 4: Zero-AI-Slop Pre-Gate (Weight: 20%)<br/>• Step 1: 100/100 mechanical scan score<br/>• Step 2: 0 antislop rule findings"]
623
+ C5["Category 5: Invariant Compliance (Weight: 15%)<br/>• Stable Bridge Gateway untouched<br/>• Token Savings flow logic preserved"]
624
+ end
625
+
626
+ KageAudit --> CriteriaMatrix
627
+ CriteriaMatrix --> Aggregate["Aggregate Overall Confidence Score<br/>Confidence = Sum(Category Confidences * Weights)"]
628
+
629
+ Aggregate --> ConfidenceThreshold{"Is Confidence Score<br/>≥ 98.0%?"}
630
+
631
+ ConfidenceThreshold -- "Confidence >= 98.0%" --> Approved["DELIVERY APPROVED<br/>• Render Box Header Banner<br/>• Output Structured Score Breakdown<br/>• Complete Synthesis Phase (✧ Sannin)"]
632
+
633
+ ConfidenceThreshold -- "Confidence < 98.0%" --> Blocked["DELIVERY BLOCKED<br/>• Reject final synthesis<br/>• Re-dispatch failed categories for remediation<br/>• Re-run verification upon resubmission"]
634
+
635
+ linkStyle default stroke:#0f172a,stroke-width:2px;
636
+ classDef audit fill:#dbeafe,stroke:#2563eb,color:#1e3a8a,stroke-width:2px;
637
+ classDef pass fill:#d1fae5,stroke:#059669,color:#065f46,stroke-width:2px;
638
+ classDef block fill:#fee2e2,stroke:#dc2626,color:#991b1b,stroke-width:2px;
639
+ class TasksDone,KageAudit,Aggregate audit;
640
+ class Approved pass;
641
+ class Blocked block;
642
+ ```