chati-dev 4.2.2 → 4.3.1
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.
- package/README.md +80 -53
- package/bin/chati.js +170 -5
- package/framework/agents/build/dev.md +509 -76
- package/framework/agents/deploy/devops.md +40 -25
- package/framework/agents/discover/brief.md +158 -22
- package/framework/agents/discover/brownfield-wu.md +26 -14
- package/framework/agents/discover/greenfield-wu.md +102 -14
- package/framework/agents/plan/architect-data-engineer.md +6 -6
- package/framework/agents/plan/architect-system.md +46 -12
- package/framework/agents/plan/architect.md +40 -20
- package/framework/agents/plan/detail.md +38 -24
- package/framework/agents/plan/phases.md +36 -26
- package/framework/agents/plan/tasks.md +114 -33
- package/framework/agents/plan/ux-brand-architect.md +240 -8
- package/framework/agents/plan/ux-component-engineer.md +28 -13
- package/framework/agents/plan/ux-researcher.md +7 -6
- package/framework/agents/plan/ux.md +55 -22
- package/framework/agents/quality/qa-implementation.md +143 -74
- package/framework/agents/quality/qa-planning.md +115 -42
- package/framework/agents/quality/qa-visual.md +448 -0
- package/framework/agents/shared/visualizer.md +128 -0
- package/framework/config.yaml +7 -6
- package/framework/constitution.md +127 -44
- package/framework/context/governance.md +12 -7
- package/framework/context/quality.md +6 -5
- package/framework/context/root.md +6 -6
- package/framework/data/entity-registry.yaml +377 -4
- package/framework/data/model-limits.json +19 -0
- package/framework/domains/agents/qa-visual.yaml +74 -0
- package/framework/domains/constitution.yaml +46 -2
- package/framework/domains/workflows/greenfield-fullstack.yaml +2 -2
- package/framework/hooks/advance-trigger.js +131 -0
- package/framework/hooks/brief-validator.js +83 -0
- package/framework/hooks/constitution-guard.js +24 -5
- package/framework/hooks/license-guard.js +62 -27
- package/framework/hooks/mode-governance.js +13 -2
- package/framework/hooks/model-governance.js +1 -0
- package/framework/hooks/post-dev.js +207 -0
- package/framework/hooks/prism-engine.js +274 -105
- package/framework/hooks/reasoning-escalator.js +371 -0
- package/framework/hooks/reference-trigger.js +117 -0
- package/framework/hooks/session-digest.js +50 -1
- package/framework/hooks/settings.json +32 -1
- package/framework/hooks/style-guard.js +25 -6
- package/framework/hooks/team-quality-gate.js +19 -12
- package/framework/hooks/undercover-guard.js +4 -2
- package/framework/i18n/en.yaml +3 -3
- package/framework/i18n/es.yaml +3 -3
- package/framework/i18n/fr.yaml +3 -3
- package/framework/i18n/pt.yaml +3 -3
- package/framework/intelligence/context-engine.md +4 -5
- package/framework/intelligence/decision-engine.md +1 -1
- package/framework/intelligence/hooks-performance.md +3 -3
- package/framework/migrations/v1.0-to-v1.1.yaml +1 -1
- package/framework/migrations/v1.4-to-v2.0.yaml +11 -11
- package/framework/migrations/v4.0-to-v4.1.yaml +2 -2
- package/framework/migrations/v4.2-to-v4.3.yaml +29 -0
- package/framework/orchestrator/chati-router.js +441 -0
- package/framework/orchestrator/chati-update.md +40 -40
- package/framework/orchestrator/chati.md +295 -94
- package/framework/rules/human-writing-style.md +47 -0
- package/framework/scaffold/motion-premium/README.md +99 -0
- package/framework/scaffold/motion-premium/app/globals.css.template +400 -0
- package/framework/scaffold/motion-premium/app/layout.tsx.template +110 -0
- package/framework/scaffold/motion-premium/components/animation/BackgroundCrossfadeProvider.tsx.template +170 -0
- package/framework/scaffold/motion-premium/components/animation/LenisProvider.tsx.template +49 -0
- package/framework/scaffold/motion-premium/components/animation/PageTransitionWrapper.tsx.template +83 -0
- package/framework/scaffold/motion-premium/components/animation/Preloader.tsx.template +171 -0
- package/framework/scaffold/motion-premium/components/ui/Container.tsx.template +69 -0
- package/framework/scaffold/motion-premium/components/ui/PageSection.tsx.template +74 -0
- package/framework/scaffold/motion-premium/lib/animations/gsap.ts.template +112 -0
- package/framework/scaffold/motion-premium/lib/animations/refreshCoordinator.ts.template +75 -0
- package/framework/scaffold/motion-premium/lib/animations/tokens.ts.template +119 -0
- package/framework/scaffold/motion-premium/lib/animations/useGsapContext.ts.template +92 -0
- package/framework/scaffold/motion-premium/lib/animations/useScrollSnapStepper.ts.template +265 -0
- package/framework/scaffold/motion-premium/lib/animations/useSmoothScroll.ts.template +67 -0
- package/framework/scaffold/motion-premium/lib/brand.ts.template +43 -0
- package/framework/scaffold/motion-premium/scaffold.yaml +178 -0
- package/framework/scaffold/motion-premium-3d/README.md +90 -0
- package/framework/scaffold/motion-premium-3d/app/(3d)/scroll-demo/ScrollDemoCanvas.tsx.template +81 -0
- package/framework/scaffold/motion-premium-3d/app/(3d)/scroll-demo/ScrollDemoClient.tsx.template +75 -0
- package/framework/scaffold/motion-premium-3d/app/(3d)/scroll-demo/page.tsx.template +26 -0
- package/framework/scaffold/motion-premium-3d/components/3d/CameraRig.tsx.template +100 -0
- package/framework/scaffold/motion-premium-3d/components/3d/CanvasProvider.tsx.template +85 -0
- package/framework/scaffold/motion-premium-3d/components/3d/InvalidateOnScroll.tsx.template +51 -0
- package/framework/scaffold/motion-premium-3d/components/3d/MeshCrossfade.tsx.template +79 -0
- package/framework/scaffold/motion-premium-3d/components/3d/ScrollCrossfade.tsx.template +88 -0
- package/framework/scaffold/motion-premium-3d/components/3d/ScrollScene.tsx.template +121 -0
- package/framework/scaffold/motion-premium-3d/components/webgl/SceneFallback.tsx.template +65 -0
- package/framework/scaffold/motion-premium-3d/components/webgl/WebGLContext.tsx.template +68 -0
- package/framework/scaffold/motion-premium-3d/lib/webgl/detect.ts.template +69 -0
- package/framework/scaffold/motion-premium-3d/scaffold.yaml +136 -0
- package/framework/schemas/session.schema.json +109 -21
- package/framework/scripts/reference-capture.js +430 -0
- package/framework/scripts/visual-qa.js +686 -0
- package/framework/tasks/orchestrator-handoff.md +1 -1
- package/framework/tasks/orchestrator-resume.md +1 -1
- package/framework/tasks/orchestrator-route.md +1 -1
- package/framework/tasks/orchestrator-status.md +3 -3
- package/framework/tasks/qa-planning-gate-define.md +1 -1
- package/framework/templates/brandbook-html-tmpl.md +2 -2
- package/framework/templates/brandbook-tmpl.yaml +1 -1
- package/framework/templates/component-spec-tmpl.yaml +1 -1
- package/framework/templates/design-token-tmpl.yaml +1 -1
- package/framework/templates/icon-system-tmpl.yaml +1 -1
- package/framework/templates/team-planning-tasks.yaml +6 -5
- package/framework/workflows/brownfield-discovery.yaml +2 -2
- package/framework/workflows/brownfield-fullstack.yaml +15 -11
- package/framework/workflows/brownfield-service.yaml +14 -10
- package/framework/workflows/brownfield-ui.yaml +15 -11
- package/framework/workflows/greenfield-fullstack.yaml +16 -13
- package/framework/workflows/quick-flow.yaml +3 -3
- package/framework/workflows/standard-flow.yaml +12 -9
- package/package.json +12 -6
- package/src/autonomy/autonomous-gate.js +1 -0
- package/src/autonomy/build-state.js +1 -2
- package/src/autonomy/progress-reporter.js +1 -1
- package/src/config/agent-customizer.js +11 -3
- package/src/config/claude-settings-generator.js +27 -7
- package/src/config/context-file-generator.js +41 -21
- package/src/config/framework-adapter.js +1 -0
- package/src/config/gemini-hooks-generator.js +19 -7
- package/src/config/mcp-configs.js +1 -0
- package/src/context/layers/l1-global.js +2 -1
- package/src/dashboard/data-reader.js +4 -3
- package/src/dashboard/layout.js +2 -1
- package/src/decision/analyzer.js +6 -30
- package/src/decision/engine.js +4 -28
- package/src/decision/registry-healer.js +3 -2
- package/src/decision/registry-updater.js +23 -14
- package/src/extensions/loader.js +2 -8
- package/src/gates/g1-planning-complete.js +2 -1
- package/src/gates/g2-qa-planning.js +2 -1
- package/src/gates/g3-implementation.js +2 -1
- package/src/gates/g4-qa-implementation.js +3 -2
- package/src/gates/g5-deploy-ready.js +2 -1
- package/src/health/engine.js +4 -3
- package/src/installer/core.js +431 -81
- package/src/installer/preflight.js +131 -0
- package/src/installer/provider-overlay.js +3 -3
- package/src/installer/scaffold-applier.js +358 -0
- package/src/installer/templates.js +46 -29
- package/src/installer/validator.js +17 -12
- package/src/intelligence/registry-manager.js +22 -29
- package/src/intelligence/timeline.js +11 -6
- package/src/license/commands.js +1 -1
- package/src/license/wait.js +102 -0
- package/src/memory/agent-memory.js +81 -0
- package/src/memory/dream.js +32 -1
- package/src/merger/replace-merger.js +28 -15
- package/src/orchestrator/agent-selector.js +2 -1
- package/src/orchestrator/cli.js +1880 -71
- package/src/orchestrator/doctor.js +270 -0
- package/src/orchestrator/handoff-engine.js +4 -3
- package/src/orchestrator/index.js +2 -0
- package/src/orchestrator/pipeline-manager.js +306 -15
- package/src/orchestrator/session-manager.js +339 -6
- package/src/tasks/handoff.js +3 -2
- package/src/telemetry/config.js +4 -3
- package/src/telemetry/schema.js +1 -0
- package/src/terminal/collector.js +3 -2
- package/src/terminal/index.js +1 -2
- package/src/terminal/isolation.js +52 -18
- package/src/terminal/prompt-builder.js +42 -25
- package/src/terminal/run-parallel.js +1 -1
- package/src/terminal/run-team.js +3 -3
- package/src/terminal/team-task-list.js +43 -4
- package/src/upgrade/backup.js +3 -2
- package/src/upgrade/checker.js +3 -2
- package/src/upgrade/migrator.js +65 -7
- package/src/upgrade/tracked-files-detector.js +86 -0
- package/src/upgrade/user-messages.js +94 -0
- package/src/utils/config-parser.js +2 -1
- package/src/utils/feature-flags.js +2 -1
- package/src/utils/flatten-entities.js +69 -0
- package/src/utils/framework-dir.js +16 -0
- package/src/utils/model-id.js +85 -0
- package/src/utils/provider-limits.js +84 -23
- package/src/utils/schema-validator.js +1 -1
- package/src/wizard/i18n.js +5 -4
- package/src/wizard/index.js +14 -0
- package/assets/logo - c/303/263pia.png +0 -0
- package/assets/logo.svg +0 -42
- package/assets/logo2.png +0 -0
- package/assets/social-preview.png +0 -0
- package/scripts/bundle-framework.js +0 -69
- package/scripts/changelog-generator.js +0 -222
- package/scripts/codebase-mapper.js +0 -728
- package/scripts/commit-message-generator.js +0 -167
- package/scripts/coverage-analyzer.js +0 -260
- package/scripts/dependency-analyzer.js +0 -280
- package/scripts/doctor/checks/agents.js +0 -77
- package/scripts/doctor/checks/constitution.js +0 -41
- package/scripts/doctor/checks/domain-alignment.js +0 -58
- package/scripts/doctor/checks/prism-layers.js +0 -84
- package/scripts/doctor/checks/registry.js +0 -55
- package/scripts/doctor/checks/schemas.js +0 -61
- package/scripts/doctor/fixes/reference-fix.js +0 -100
- package/scripts/doctor/fixes/registry-fix.js +0 -56
- package/scripts/doctor/index.js +0 -212
- package/scripts/framework-analyzer.js +0 -308
- package/scripts/generate-constitution-domain.js +0 -253
- package/scripts/generate-signing-key.js +0 -33
- package/scripts/health-check.js +0 -481
- package/scripts/ide-sync.js +0 -326
- package/scripts/performance-analyzer.js +0 -325
- package/scripts/plan-tracker.js +0 -278
- package/scripts/populate-entity-registry.js +0 -481
- package/scripts/pr-review.js +0 -317
- package/scripts/rollback-manager.js +0 -310
- package/scripts/semantic-lint.js +0 -328
- package/scripts/sign-manifest.js +0 -53
- package/scripts/stuck-detector.js +0 -343
- package/scripts/test-quality-assessment.js +0 -257
- package/scripts/validate-agents.js +0 -368
- package/scripts/validate-package.js +0 -505
- package/scripts/validate-tasks.js +0 -465
- package/src/autonomy/worktree-manager.js +0 -250
- package/src/intelligence/decision-engine.js +0 -256
- package/src/intelligence/document-sharder.js +0 -221
- package/src/intelligence/elicitation.js +0 -265
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Advanced elicitation techniques for Brief agent.
|
|
3
|
-
*
|
|
4
|
-
* Provides 15 structured questioning techniques that adapt
|
|
5
|
-
* to project context for deeper requirement extraction.
|
|
6
|
-
*
|
|
7
|
-
* Constitution Protocol 8 — Interaction Model.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
// Techniques
|
|
12
|
-
// ---------------------------------------------------------------------------
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @typedef {object} Technique
|
|
16
|
-
* @property {string} id - Unique technique identifier
|
|
17
|
-
* @property {string} name - Human-readable name
|
|
18
|
-
* @property {string} description - When to use this technique
|
|
19
|
-
* @property {string} template - Prompt template with {placeholders}
|
|
20
|
-
* @property {string[]} bestFor - Context categories where this excels
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* All 15 elicitation techniques.
|
|
25
|
-
* @type {Technique[]}
|
|
26
|
-
*/
|
|
27
|
-
export const TECHNIQUES = [
|
|
28
|
-
{
|
|
29
|
-
id: 'open-ended',
|
|
30
|
-
name: 'Open-Ended Questions',
|
|
31
|
-
description: 'Discover broad goals and motivations',
|
|
32
|
-
template: 'What is the primary problem you want {project} to solve?',
|
|
33
|
-
bestFor: ['greenfield', 'discovery', 'early'],
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
id: 'closed',
|
|
37
|
-
name: 'Closed Questions',
|
|
38
|
-
description: 'Confirm specific decisions quickly',
|
|
39
|
-
template: 'Should {feature} support {option_a} or {option_b}?',
|
|
40
|
-
bestFor: ['confirmation', 'late', 'refinement'],
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
id: 'scaling',
|
|
44
|
-
name: 'Scaling Questions',
|
|
45
|
-
description: 'Quantify priorities and satisfaction levels',
|
|
46
|
-
template: 'On a scale of 1-10, how important is {aspect} for your project?',
|
|
47
|
-
bestFor: ['prioritization', 'nfr', 'tradeoffs'],
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
id: 'five-whys',
|
|
51
|
-
name: 'Five Whys',
|
|
52
|
-
description: 'Drill to root cause of requirements',
|
|
53
|
-
template: 'You mentioned {requirement}. Why is that important? (And why is that? Repeat 5x)',
|
|
54
|
-
bestFor: ['root-cause', 'deep-analysis', 'unclear'],
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
id: 'scenario',
|
|
58
|
-
name: 'Scenario-Based',
|
|
59
|
-
description: 'Explore behavior through concrete situations',
|
|
60
|
-
template: 'Imagine a user is trying to {action}. Walk me through what should happen step by step.',
|
|
61
|
-
bestFor: ['user-flow', 'ux', 'behavior'],
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: 'constraint',
|
|
65
|
-
name: 'Constraint Analysis',
|
|
66
|
-
description: 'Identify limitations and boundaries',
|
|
67
|
-
template: 'What are the hard constraints for {project}? (budget, timeline, technology, team size)',
|
|
68
|
-
bestFor: ['planning', 'nfr', 'feasibility'],
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
id: 'analogy',
|
|
72
|
-
name: 'Analogy Questions',
|
|
73
|
-
description: 'Reference existing products for clarity',
|
|
74
|
-
template: 'Is {project} more like {product_a} or {product_b}? What would you change?',
|
|
75
|
-
bestFor: ['greenfield', 'vision', 'discovery'],
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
id: 'day-in-life',
|
|
79
|
-
name: 'Day in the Life',
|
|
80
|
-
description: 'Understand user workflows holistically',
|
|
81
|
-
template: 'Walk me through a typical day for a {persona} using {project}.',
|
|
82
|
-
bestFor: ['user-research', 'ux', 'personas'],
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
id: 'persona',
|
|
86
|
-
name: 'Persona Questions',
|
|
87
|
-
description: 'Define user types and their needs',
|
|
88
|
-
template: 'Who are the main types of users for {project}? What does each one need most?',
|
|
89
|
-
bestFor: ['user-research', 'discovery', 'early'],
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
id: 'exception',
|
|
93
|
-
name: 'Exception Questions',
|
|
94
|
-
description: 'Explore edge cases and error scenarios',
|
|
95
|
-
template: 'What should happen if {action} fails or produces unexpected results?',
|
|
96
|
-
bestFor: ['edge-cases', 'error-handling', 'robustness'],
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
id: 'moscow',
|
|
100
|
-
name: 'MoSCoW Priority',
|
|
101
|
-
description: 'Classify features by criticality',
|
|
102
|
-
template: 'For the features you described, which are Must-Have, Should-Have, Could-Have, and Won\'t-Have?',
|
|
103
|
-
bestFor: ['prioritization', 'planning', 'scope'],
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
id: 'prototype',
|
|
107
|
-
name: 'Prototype Questions',
|
|
108
|
-
description: 'Validate UI/UX assumptions early',
|
|
109
|
-
template: 'If I showed you a rough mockup of {feature}, what would you check first?',
|
|
110
|
-
bestFor: ['ux', 'visual', 'validation'],
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
id: 'acceptance',
|
|
114
|
-
name: 'Acceptance Criteria',
|
|
115
|
-
description: 'Define clear "done" criteria',
|
|
116
|
-
template: 'How will you know {feature} is working correctly? What does success look like?',
|
|
117
|
-
bestFor: ['quality', 'testing', 'refinement'],
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
id: 'edge-case',
|
|
121
|
-
name: 'Edge Case Exploration',
|
|
122
|
-
description: 'Probe boundaries systematically',
|
|
123
|
-
template: 'What happens when {input} is empty/null/very large/negative? How should {feature} behave?',
|
|
124
|
-
bestFor: ['edge-cases', 'robustness', 'quality'],
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
id: 'stakeholder-map',
|
|
128
|
-
name: 'Stakeholder Mapping',
|
|
129
|
-
description: 'Identify all parties and their interests',
|
|
130
|
-
template: 'Besides end users, who else cares about {project}? (investors, ops team, regulators, partners)',
|
|
131
|
-
bestFor: ['stakeholders', 'discovery', 'enterprise'],
|
|
132
|
-
},
|
|
133
|
-
];
|
|
134
|
-
|
|
135
|
-
// ---------------------------------------------------------------------------
|
|
136
|
-
// Public API
|
|
137
|
-
// ---------------------------------------------------------------------------
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Select the top N most relevant techniques for a given context.
|
|
141
|
-
*
|
|
142
|
-
* @param {{ phase?: string, projectType?: string, keywords?: string[], userLevel?: string }} context
|
|
143
|
-
* @param {number} [topN=3]
|
|
144
|
-
* @returns {Technique[]}
|
|
145
|
-
*/
|
|
146
|
-
export function selectTechniques(context, topN = 3) {
|
|
147
|
-
const scored = TECHNIQUES.map(technique => ({
|
|
148
|
-
technique,
|
|
149
|
-
score: scoreTechnique(technique, context),
|
|
150
|
-
}));
|
|
151
|
-
|
|
152
|
-
// Sort by score descending
|
|
153
|
-
scored.sort((a, b) => b.score - a.score);
|
|
154
|
-
|
|
155
|
-
return scored.slice(0, topN).map(s => s.technique);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Build a formatted elicitation prompt for a specific technique.
|
|
160
|
-
*
|
|
161
|
-
* @param {Technique} technique
|
|
162
|
-
* @param {{ project?: string, feature?: string, action?: string, persona?: string }} projectContext
|
|
163
|
-
* @returns {string}
|
|
164
|
-
*/
|
|
165
|
-
export function buildElicitationPrompt(technique, projectContext = {}) {
|
|
166
|
-
let prompt = technique.template;
|
|
167
|
-
|
|
168
|
-
// Replace placeholders with context values or generic defaults
|
|
169
|
-
const defaults = {
|
|
170
|
-
project: 'the project',
|
|
171
|
-
feature: 'this feature',
|
|
172
|
-
action: 'perform this action',
|
|
173
|
-
persona: 'a typical user',
|
|
174
|
-
requirement: 'this requirement',
|
|
175
|
-
aspect: 'this aspect',
|
|
176
|
-
input: 'the input',
|
|
177
|
-
option_a: 'option A',
|
|
178
|
-
option_b: 'option B',
|
|
179
|
-
product_a: 'Product A',
|
|
180
|
-
product_b: 'Product B',
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
const merged = { ...defaults, ...projectContext };
|
|
184
|
-
|
|
185
|
-
for (const [key, value] of Object.entries(merged)) {
|
|
186
|
-
prompt = prompt.replace(new RegExp(`\\{${key}\\}`, 'g'), value);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
return prompt;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Get a technique by ID.
|
|
194
|
-
*
|
|
195
|
-
* @param {string} id
|
|
196
|
-
* @returns {Technique|null}
|
|
197
|
-
*/
|
|
198
|
-
export function getTechnique(id) {
|
|
199
|
-
return TECHNIQUES.find(t => t.id === id) || null;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
// ---------------------------------------------------------------------------
|
|
203
|
-
// Scoring
|
|
204
|
-
// ---------------------------------------------------------------------------
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Score how relevant a technique is for a given context.
|
|
208
|
-
*
|
|
209
|
-
* @param {Technique} technique
|
|
210
|
-
* @param {{ phase?: string, projectType?: string, keywords?: string[], userLevel?: string }} context
|
|
211
|
-
* @returns {number}
|
|
212
|
-
*/
|
|
213
|
-
function scoreTechnique(technique, context) {
|
|
214
|
-
let score = 0;
|
|
215
|
-
|
|
216
|
-
// Phase matching
|
|
217
|
-
if (context.phase) {
|
|
218
|
-
const phaseMap = {
|
|
219
|
-
discover: ['discovery', 'early', 'greenfield', 'user-research', 'vision'],
|
|
220
|
-
plan: ['planning', 'prioritization', 'scope', 'tradeoffs', 'nfr', 'feasibility'],
|
|
221
|
-
build: ['refinement', 'quality', 'testing', 'edge-cases', 'robustness'],
|
|
222
|
-
deploy: ['confirmation', 'late', 'validation'],
|
|
223
|
-
};
|
|
224
|
-
const phaseKeywords = phaseMap[context.phase] || [];
|
|
225
|
-
for (const kw of phaseKeywords) {
|
|
226
|
-
if (technique.bestFor.includes(kw)) {
|
|
227
|
-
score += 3;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// Project type matching
|
|
233
|
-
if (context.projectType === 'greenfield' && technique.bestFor.includes('greenfield')) {
|
|
234
|
-
score += 2;
|
|
235
|
-
}
|
|
236
|
-
if (context.projectType === 'brownfield' && technique.bestFor.includes('refinement')) {
|
|
237
|
-
score += 2;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// Keyword matching
|
|
241
|
-
if (context.keywords) {
|
|
242
|
-
for (const kw of context.keywords) {
|
|
243
|
-
if (technique.bestFor.includes(kw.toLowerCase())) {
|
|
244
|
-
score += 2;
|
|
245
|
-
}
|
|
246
|
-
if (technique.description.toLowerCase().includes(kw.toLowerCase())) {
|
|
247
|
-
score += 1;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// User level adjustment
|
|
253
|
-
if (context.userLevel === 'beginner') {
|
|
254
|
-
if (['open-ended', 'scenario', 'analogy'].includes(technique.id)) {
|
|
255
|
-
score += 1; // Easier techniques for beginners
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
if (context.userLevel === 'expert') {
|
|
259
|
-
if (['five-whys', 'constraint', 'stakeholder-map'].includes(technique.id)) {
|
|
260
|
-
score += 1; // More advanced for experts
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
return score;
|
|
265
|
-
}
|