@dzhechkov/keysarium 1.0.1 → 1.1.0

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 (29) hide show
  1. package/README.md +21 -5
  2. package/package.json +1 -1
  3. package/templates/.claude/commands/brain-export.md +121 -0
  4. package/templates/.claude/commands/brain-import.md +115 -0
  5. package/templates/.claude/rules/checkpoint-protocol.md +46 -0
  6. package/templates/.claude/rules/feedback-loops.md +113 -0
  7. package/templates/.claude/rules/model-routing.md +65 -0
  8. package/templates/.claude/rules/trust-tiers.md +36 -0
  9. package/templates/.claude/shards/phase-0-discovery.shard.md +45 -0
  10. package/templates/.claude/shards/phase-1-explore.shard.md +32 -0
  11. package/templates/.claude/shards/phase-2-research.shard.md +42 -0
  12. package/templates/.claude/shards/phase-25-cjm.shard.md +47 -0
  13. package/templates/.claude/shards/phase-3-solve.shard.md +47 -0
  14. package/templates/.claude/shards/phase-4-architecture.shard.md +41 -0
  15. package/templates/.claude/shards/phase-5-presentation.shard.md +56 -0
  16. package/templates/.claude/skills/explore/SKILL.md +7 -4
  17. package/templates/.claude/skills/frontend-design/SKILL.md +3 -0
  18. package/templates/.claude/skills/goap-research-ed25519/SKILL.md +3 -0
  19. package/templates/.claude/skills/presentation-storyteller/SKILL.md +5 -2
  20. package/templates/.claude/skills/problem-solver-enhanced/SKILL.md +3 -0
  21. package/templates/.claude/skills/reverse-engineering-unicorn/SKILL.md +3 -0
  22. package/templates/CLAUDE.md +55 -3
  23. package/templates/docs/improvement-directions.md +641 -0
  24. package/templates/docs/skills-bto/01-deployment-guide.md +33 -33
  25. package/templates/docs/skills-bto/02-admin-guide.md +13 -13
  26. package/templates/docs/skills-bto/03-user-guide.md +1 -1
  27. package/templates/docs/skills-bto/04-infrastructure-requirements.md +4 -4
  28. package/templates/docs/skills-bto/05-architecture.md +4 -4
  29. package/templates/docs/skills-bto/06-user-flows.md +1 -1
@@ -0,0 +1,42 @@
1
+ # Phase 2: Research — Governance Shard
2
+
3
+ ## Time Budget
4
+ 15% of total timeline
5
+
6
+ ## Skill
7
+ Load: `.claude/skills/goap-research-ed25519/SKILL.md`
8
+
9
+ ## Prerequisites
10
+ - Phase 1 complete: `<promise>CASE_EXPLORED</promise>`
11
+ - Files exist: `00_product_discovery.md`, `01_case_brief.md`
12
+
13
+ ## Mandatory Outputs
14
+ - `02_research_findings.md`
15
+
16
+ ## PARANOID Mode — ACTIVE
17
+ - Every factual claim MUST have a verifiable source
18
+ - Zero tolerance for hallucinated citations
19
+ - Confidence threshold: 0.99 minimum
20
+ - Unverifiable claims: mark as [UNVERIFIED] and flag
21
+ - Citation format: `[Claim] — Source: [URL or publication], [Date]`
22
+
23
+ ## Agent Swarm (3 parallel, model: sonnet)
24
+ - Agent 1: Analogues + Benchmarks
25
+ - Agent 2: Technologies + Anti-patterns
26
+ - Agent 3: Regulations + Market Data
27
+ - Synthesize results into single document
28
+
29
+ ## Quality Gates
30
+ - ALL claims have sources
31
+ - No unverified statistics or percentages
32
+ - Competitor names verified to exist
33
+ - Technology recommendations are for real, available products
34
+ - Regulatory references cite actual laws/standards
35
+
36
+ ## Promise
37
+ On completion: `<promise>RESEARCH_PARANOID_PASSED</promise>`
38
+
39
+ ## Anti-Patterns to Check
40
+ - Bare claims without attribution → BLOCK
41
+ - Generic "studies show" without specific study → BLOCK
42
+ - Hallucinated product names → BLOCK
@@ -0,0 +1,47 @@
1
+ # Phase 2.5: CJM Prototype — Governance Shard
2
+
3
+ ## MANDATORY — THIS PHASE CANNOT BE SKIPPED
4
+
5
+ ## Time Budget
6
+ 10% of total timeline
7
+
8
+ ## Skills
9
+ - Primary: `.claude/skills/reverse-engineering-unicorn/SKILL.md` (module M2.5)
10
+ - UI Design: `.claude/skills/frontend-design/SKILL.md`
11
+ - Trend Research: `.claude/skills/goap-research-ed25519/SKILL.md` (for Variant D)
12
+
13
+ ## Prerequisites
14
+ - Phase 2 complete: `<promise>RESEARCH_PARANOID_PASSED</promise>`
15
+ - Files exist: `00_product_discovery.md`, `01_case_brief.md`, `02_research_findings.md`
16
+
17
+ ## Mandatory Outputs
18
+ - `02.5_trend_brief.md` (Variant D trend research)
19
+ - `prototype/cjm-prototype.jsx` (4-variant interactive prototype)
20
+
21
+ ## Process
22
+ 1. Extract: primary_user, segments, aha_moment, solution_concept from Phases 0-2
23
+ 2. Define 3 CJM variants (A/B/C) with different approaches
24
+ 3. Research 5 trend categories for Variant D (PARANOID mode)
25
+ 4. Generate React .jsx prototype with all 4 variants
26
+ 5. User selects winning variant → sets `{CHOSEN_CJM}`
27
+
28
+ ## Agent Swarm (3 parallel)
29
+ - Agent 1 (opus): CJM Variant A design
30
+ - Agent 2 (opus): CJM Variants B + C design
31
+ - Agent 3 (sonnet): Trend Research for Variant D (PARANOID mode, 5 categories)
32
+
33
+ ## Critical Variable
34
+ `{CHOSEN_CJM}` — MUST be set by user selection. Passed to Phases 3-5.
35
+
36
+ ## Quality Gates
37
+ - Minimum 3 CJM variants (A/B/C) + 1 trend variant (D)
38
+ - Prototype must be valid React JSX
39
+ - Trend research in PARANOID mode (verified sources)
40
+ - User MUST explicitly select a variant
41
+
42
+ ## Promise
43
+ On completion: `<promise>CJM_VALIDATED</promise>`
44
+
45
+ ## Invariant
46
+ If any attempt is made to skip this phase → BLOCK immediately.
47
+ "Skipping CJM" is listed as a FORBIDDEN anti-pattern.
@@ -0,0 +1,47 @@
1
+ # Phase 3: Solve — Governance Shard
2
+
3
+ ## Time Budget
4
+ 15% of total timeline
5
+
6
+ ## Skill
7
+ Load: `.claude/skills/problem-solver-enhanced/SKILL.md` (TRIZ + Game Theory)
8
+
9
+ ## Prerequisites
10
+ - Phase 2.5 complete: `<promise>CJM_VALIDATED</promise>`
11
+ - `{CHOSEN_CJM}` is set
12
+ - Files exist: `00_` through `02.5_`
13
+
14
+ ## Mandatory Outputs
15
+ - `03_solution_strategy.md`
16
+ - `diagrams/process-as-is.mermaid`
17
+ - `diagrams/process-to-be.mermaid`
18
+
19
+ ## Content Requirements
20
+ - SCQA (Situation-Complication-Question-Answer) for pitch
21
+ - Concept + Elevator Pitch + Key Innovation
22
+ - Process Design: As-Is → To-Be (using `{CHOSEN_CJM}`)
23
+ - User Flow from `{CHOSEN_CJM}`
24
+ - AI Pipeline specification
25
+ - Human-in-the-Loop design with escalation policy
26
+ - Success Metrics with baseline values
27
+ - Risks & Mitigation matrix
28
+ - Roadmap: PoC → MVP → Scale
29
+
30
+ ## Agent Swarm (2 parallel)
31
+ - Agent 1 (opus): SCQA + Concept + Process Design + User Flow + AI Pipeline
32
+ - Agent 2 (sonnet): Mermaid Diagrams + HITL + Metrics + Roadmap
33
+
34
+ ## Quality Gates
35
+ - SCQA must be concise and compelling
36
+ - Metrics must include baseline AND target values
37
+ - HITL escalation policy is MANDATORY (no AI-only decisions)
38
+ - Mermaid diagrams must be valid syntax
39
+ - `{CHOSEN_CJM}` must appear in User Flow section
40
+
41
+ ## Promise
42
+ On completion: `<promise>SOLUTION_DESIGNED</promise>`
43
+
44
+ ## Anti-Patterns to Check
45
+ - No HITL → BLOCK
46
+ - Vague "improve efficiency" without numbers → BLOCK
47
+ - Over-engineering (> 10 components in MVP) → FLAG
@@ -0,0 +1,41 @@
1
+ # Phase 4: Architecture — Governance Shard
2
+
3
+ ## Time Budget
4
+ 15% of total timeline
5
+
6
+ ## Skill
7
+ Built-in templates (no external skill)
8
+
9
+ ## Prerequisites
10
+ - Phase 3 complete: `<promise>SOLUTION_DESIGNED</promise>`
11
+ - Files exist: `00_` through `03_`
12
+
13
+ ## Mandatory Outputs
14
+ - `04_architecture.md`
15
+ - `diagrams/architecture-c4.mermaid` (C4 Context diagram)
16
+ - `diagrams/sequence-main-flow.mermaid` (Sequence diagram)
17
+
18
+ ## Content Requirements
19
+ - C4 architectural diagram
20
+ - Components table: tech + purpose + justification
21
+ - AI Models & Pipeline: task, type, concrete model name
22
+ - Data Architecture: sources, ETL, storage, Vector DB
23
+ - Integrations: system + protocol
24
+ - Security & Compliance: controls, RBAC, audit, regulations
25
+ - Scalability: latency target, throughput, scaling strategy
26
+ - MVP Scope definition
27
+
28
+ ## Domain-Specific Rules
29
+ - Banking: on-premise LLM (GigaChat/YandexGPT/open-source), ФЗ-152, ЦБ, ФСТЭК
30
+ - Retail: latency < 200ms, A/B testing infrastructure
31
+ - Enterprise: Change Management plan, Legacy integration, SLA definition
32
+ - Healthcare: HITL for ALL clinical decisions, ФЗ-323
33
+
34
+ ## Quality Gates
35
+ - Minimum 2 Mermaid diagrams (C4 + sequence)
36
+ - All model names must be real, available products
37
+ - Security section must reference applicable regulations
38
+ - MVP scope must be achievable (not over-engineered)
39
+
40
+ ## Promise
41
+ On completion: `<promise>ARCHITECTURE_DEFINED</promise>`
@@ -0,0 +1,56 @@
1
+ # Phase 5: Presentation — Governance Shard
2
+
3
+ ## Time Budget
4
+ 20% of total timeline (largest allocation)
5
+
6
+ ## Skill
7
+ Load: `.claude/skills/presentation-storyteller/SKILL.md`
8
+
9
+ ## Prerequisites
10
+ - Phase 4 complete: `<promise>ARCHITECTURE_DEFINED</promise>`
11
+ - `{CHOSEN_CJM}` is set (for Slide 5)
12
+ - Files exist: `00_` through `04_`
13
+
14
+ ## Mandatory Outputs (ALL 4 files required)
15
+ - `05_presentation_content.md` (10-12 slides with storytelling)
16
+ - `06_speaker_script.md` (per-slide: HOOK, CONTENT, BRIDGE, TONE, KEY MESSAGE)
17
+ - `07_qa_preparation.md` (7+ typical jury questions + answers)
18
+ - `08_executive_summary.md` (1 page for jury) ⭐ MANDATORY
19
+
20
+ ## 08_executive_summary.md is NON-NEGOTIABLE
21
+ Missing Executive Summary is a FORBIDDEN anti-pattern. BLOCK if not created.
22
+
23
+ ## Slide Structure (10-12 slides)
24
+ 1. Title + Team + Case
25
+ 2. Problem (SCQA, cost of inaction)
26
+ 3. Key Question + Elevator Pitch
27
+ 4. Concept (high-level, AI role)
28
+ 5. User Flow / To-Be (`{CHOSEN_CJM}`)
29
+ 6. AI Under the Hood (models, RAG/Agent, HITL)
30
+ 7. Data Architecture
31
+ 8. Security & Compliance
32
+ 9. Metrics & ROI (As-Is → Target)
33
+ 10. Roadmap (PoC → MVP → Scale)
34
+ 11. Team + CTA
35
+ 12. Q&A
36
+
37
+ ## Agent Swarm (3 parallel)
38
+ - Agent 1 (opus): Presentation content (05) — storytelling
39
+ - Agent 2 (sonnet): Speaker script (06)
40
+ - Agent 3 (sonnet): Q&A + Executive Summary (07 + 08)
41
+
42
+ ## Quality Gates
43
+ - No slide reading (text-heavy slides) → FLAG
44
+ - Every slide must have a visual anchor suggestion
45
+ - Speaker script must tell a connected story across slides
46
+ - Q&A must include tough/adversarial questions
47
+ - Executive Summary must fit on 1 page
48
+
49
+ ## Promise
50
+ On completion: `<promise>PRESENTATION_READY</promise>`
51
+
52
+ ## Anti-Patterns to Check
53
+ - Text-heavy slides → FLAG
54
+ - No storytelling arc → FLAG
55
+ - Missing Executive Summary → BLOCK
56
+ - Generic phrases without numbers → FLAG
@@ -3,11 +3,14 @@ name: explore
3
3
  description: >
4
4
  Adaptive task exploration and clarification skill for transforming vague
5
5
  requests into actionable specifications. Use when a user presents any task,
6
- problem, or goal that requires clarification before execution. Triggers on
7
- ambiguous requests, complex multi-part tasks, "I want to...", "help me with...",
8
- strategic decisions, product ideas, creative briefs, and any situation where
9
- understanding the real need is essential before proposing solutions. Does NOT
6
+ problem, or goal that requires clarification before execution. Triggers on
7
+ ambiguous requests, complex multi-part tasks, "I want to...", "help me with...",
8
+ strategic decisions, product ideas, creative briefs, and any situation where
9
+ understanding the real need is essential before proposing solutions. Does NOT
10
10
  provide solutions until task is fully explored.
11
+ trust_tier: 1
12
+ trust_tier_label: "Structured"
13
+ trust_tier_path: "Run /bto-test to promote to Tier 2"
11
14
  ---
12
15
 
13
16
  # Explore: Adaptive Task Clarification
@@ -2,6 +2,9 @@
2
2
  name: frontend-design
3
3
  description: Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
4
4
  license: Complete terms in LICENSE.txt
5
+ trust_tier: 0
6
+ trust_tier_label: "Advisory"
7
+ trust_tier_path: "Add references/ directory and run /bto-test to promote to Tier 1"
5
8
  ---
6
9
 
7
10
  This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. Implement real working code with exceptional attention to aesthetic details and creative choices.
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  name: goap-research-ed25519
3
3
  description: Advanced GOAP research system with Ed25519 cryptographic verification for anti-hallucination protection. Combines Goal-Oriented Action Planning with cryptographic signatures to ensure source authenticity, claim verification, and citation chain integrity. Use for high-stakes research requiring verifiable facts, competitive intelligence, legal/medical research, or any context where hallucination prevention is critical. Triggers on "verified research", "trusted sources only", "anti-hallucination", "signed sources", "cryptographic verification".
4
+ trust_tier: 1
5
+ trust_tier_label: "Structured"
6
+ trust_tier_path: "Run /bto-test to promote to Tier 2"
4
7
  ---
5
8
 
6
9
  # GOAP Research Skill with Ed25519 Verification
@@ -6,9 +6,12 @@ description: >
6
6
  в Markdown со ссылками на источники, (3) Подстрочник "Как рассказывать?" со связной
7
7
  историей для каждого слайда. Использует explore (уточнение задачи), goap-research-ed25519
8
8
  (исследование с верификацией), storytelling-фреймворки (AIDA, Hero's Journey, Problem-Solution).
9
- Выходные файлы: presentation-outline.md (план), presentation-full.md (презентация),
10
- sources-index.md (индекс источников). Триггеры: "сделай презентацию", "presentation with
9
+ Выходные файлы: presentation-outline.md (план), presentation-full.md (презентация),
10
+ sources-index.md (индекс источников). Триггеры: "сделай презентацию", "presentation with
11
11
  storytelling", "презентация со скриптами", "sales deck", "pitch deck", "продающая презентация".
12
+ trust_tier: 1
13
+ trust_tier_label: "Structured"
14
+ trust_tier_path: "Run /bto-test to promote to Tier 2"
12
15
  ---
13
16
 
14
17
  # Presentation Storyteller: Sales Decks with Verified Sources
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  name: problem-solver-enhanced
3
3
  description: Elite problem-solving system combining first principles thinking, game theory, root cause analysis, systematic frameworks AND TRIZ inventive principles for solving complex challenges. Use when facing complex challenges with unclear solutions, strategic decisions with multiple stakeholders, problems requiring breakthrough (not incremental) solutions, trade-offs that seem impossible to resolve, competitive scenarios requiring game-theoretic analysis, system design problems, or any situation requiring both analytical rigor and inventive thinking beyond surface-level solutions.
4
+ trust_tier: 1
5
+ trust_tier_label: "Structured"
6
+ trust_tier_path: "Run /bto-test to promote to Tier 2"
4
7
  ---
5
8
 
6
9
  # Elite Problem Solver (Enhanced with TRIZ)
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  name: reverse-engineering-unicorn
3
3
  description: Reverse engineer any company into a launch playbook with clickable CJM prototype. Triggers on "проанализируй компанию", "reverse engineer", "разбери бизнес-модель", "playbook запуска".
4
+ trust_tier: 1
5
+ trust_tier_label: "Structured"
6
+ trust_tier_path: "Run /bto-test to promote to Tier 2"
4
7
  ---
5
8
 
6
9
  # Reverse Engineering Unicorn v2
@@ -11,6 +11,8 @@
11
11
  /new-research [название] — Создать новое исследование
12
12
  /parallel-research кейс1 | кейс2 — Запустить несколько параллельно
13
13
  /harvest [путь или "all"] — Извлечь знания после проекта
14
+ /brain-export [путь или "all"] — Экспорт знаний в portable JSON
15
+ /brain-import [путь к JSON] — Импорт знаний из другого проекта
14
16
 
15
17
  /bto [путь или описание] — Build-Test-Optimize полный цикл
16
18
  /bto-build [описание] — Генерация нового скилла/команды
@@ -37,10 +39,21 @@ product-keysarium-2026/
37
39
  │ │ ├── architecture-phase.md ← /architecture-phase — Phase 4
38
40
  │ │ ├── presentation.md ← /presentation — Phase 5
39
41
  │ │ ├── harvest.md ← /harvest — извлечение знаний
42
+ │ │ ├── brain-export.md ← /brain-export — экспорт portable brain
43
+ │ │ ├── brain-import.md ← /brain-import — импорт знаний
40
44
  │ │ ├── bto.md ← /bto — Build-Test-Optimize pipeline
41
45
  │ │ ├── bto-build.md ← /bto-build — генерация артефактов
42
46
  │ │ ├── bto-test.md ← /bto-test — мульти-агентная оценка
43
47
  │ │ └── bto-optimize.md ← /bto-optimize — оптимизация промптов
48
+ │ ├── shards/ ← Governance shards (per-phase rules)
49
+ │ │ ├── phase-0-discovery.shard.md
50
+ │ │ ├── phase-1-explore.shard.md
51
+ │ │ ├── phase-2-research.shard.md
52
+ │ │ ├── phase-25-cjm.shard.md
53
+ │ │ ├── phase-3-solve.shard.md
54
+ │ │ ├── phase-4-architecture.shard.md
55
+ │ │ ├── phase-5-presentation.shard.md
56
+ │ │ └── bto-evaluation.shard.md
44
57
  │ └── skills/ ← Навыки (building blocks)
45
58
  │ ├── bto/ ← Build-Test-Optimize (мульти-агентная оценка)
46
59
  │ ├── explore/ ← Адаптивная кларификация задач
@@ -93,8 +106,47 @@ DISCOVERY → EXPLORE → RESEARCH → CJM PROTO → SOLVE → ARCHITECTU
93
106
  3. **08_executive_summary.md — ОБЯЗАТЕЛЕН**
94
107
  4. **Research в PARANOID mode** — ноль непроверенных утверждений
95
108
  5. **{CHOSEN_CJM} передаётся** из Phase 2.5 в Phase 3-5
96
- 6. **Checkpoint после каждой фазы** — ждём "ок" от пользователя
109
+ 6. **Checkpoint после каждой фазы** — ждём "ок" от пользователя + `<promise>` тег
97
110
  7. **Всё в researches/<slug>/** — не засоряем корень
111
+ 8. **Governance shards** — каждая фаза загружает свой shard из `.claude/shards/`
112
+ 9. **Model routing** — haiku для Layer 0-1, sonnet для research/judges, opus для creative work
113
+ 10. **Trust tiers** — скиллы классифицированы (Tier 0-3), повышение через `/bto-test`
114
+
115
+ ## Governance System
116
+
117
+ ### Shards
118
+ Каждая фаза загружает свой governance shard из `.claude/shards/`:
119
+ - Shard содержит: time budget, skill to load, prerequisites, quality gates, promise tag
120
+ - Решает проблему context drift при длинных сессиях
121
+ - Агент перечитывает shard перед началом работы фазы
122
+
123
+ ### Semantic Completion Promises
124
+ Каждый checkpoint включает `<promise>` тег:
125
+ - `DISCOVERY_COMPLETE`, `CASE_EXPLORED`, `RESEARCH_PARANOID_PASSED`
126
+ - `CJM_VALIDATED`, `SOLUTION_DESIGNED`, `ARCHITECTURE_DEFINED`, `PRESENTATION_READY`
127
+ - Downstream фазы проверяют upstream promises перед стартом
128
+
129
+ ### Trust Tiers
130
+ | Tier | Label | Требования |
131
+ |------|-------|-----------|
132
+ | 3 | Verified | Eval test suites + deterministic validation |
133
+ | 2 | Validated | /bto-test Layer 2 score >= 7.0 |
134
+ | 1 | Structured | SKILL.md + references/ or modules/ |
135
+ | 0 | Advisory | Только SKILL.md |
136
+
137
+ ### Cross-Phase Feedback Loops
138
+ 6 именованных loops формализуют передачу данных между фазами.
139
+ См. `.claude/rules/feedback-loops.md` для Variable Registry.
140
+
141
+ ## Portable Brain
142
+
143
+ ```
144
+ /brain-export [путь или "all"] — Экспорт знаний в JSON контейнер
145
+ /brain-import [файл.json] — Импорт знаний из другого проекта
146
+ ```
147
+
148
+ Brain container включает: skill metadata, domain patterns, research summaries,
149
+ harvest patterns, pipeline metrics. Selective import с merge-not-overwrite стратегией.
98
150
 
99
151
  ## Domain Templates
100
152
 
@@ -168,8 +220,8 @@ bto (Build-Test-Optimize)
168
220
  ### Standalone пакет
169
221
 
170
222
  ```bash
171
- npx @dzhechko/skills-bto init # Установить BTO в любой проект
172
- npx @dzhechko/skills-bto doctor # Проверить здоровье установки
223
+ npx @dzhechkov/skills-bto init # Установить BTO в любой проект
224
+ npx @dzhechkov/skills-bto doctor # Проверить здоровье установки
173
225
  ```
174
226
 
175
227
  ## Anti-Patterns