oneie 3.5.0 → 3.6.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.
- package/.claude/agents/agent-director.md +902 -22
- package/.claude/agents/agent-onboard-example-output.md +600 -0
- package/.claude/agents/agent-onboard.md +576 -0
- package/.claude/commands/ONBOARDING_ENHANCEMENT_SUMMARY.md +266 -0
- package/.claude/commands/one.md +375 -5
- package/.claude/commands/release.md +64 -3
- package/CLAUDE.md +55 -69
- package/dist/commands/init.d.ts +5 -6
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +101 -101
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/utils/installation-setup.d.ts +24 -1
- package/dist/utils/installation-setup.d.ts.map +1 -1
- package/dist/utils/installation-setup.js +85 -1
- package/dist/utils/installation-setup.js.map +1 -1
- package/dist/utils/launch-claude.d.ts +6 -0
- package/dist/utils/launch-claude.d.ts.map +1 -0
- package/dist/utils/launch-claude.js +51 -0
- package/dist/utils/launch-claude.js.map +1 -0
- package/dist/utils/validation.d.ts +48 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +73 -0
- package/dist/utils/validation.js.map +1 -0
- package/folders.yaml +1 -1
- package/one/.obsidian/core-plugins.json +33 -0
- package/one/.obsidian/workspace.json +20 -20
- package/one/connections/workflow-onboarding.md +683 -0
- package/one/events/CART-DRAWER-INTEGRATION-GUIDE.md +354 -0
- package/one/events/CRITICAL-FIXES-COMPLETE.md +504 -0
- package/one/events/DEPLOYMENT.md +178 -0
- package/one/events/ECOMMERCE-DEMO-PLAN.md +225 -0
- package/one/events/ECOMMERCE-LIVE-DEMO.md +363 -0
- package/one/events/ECOMMERCE-TEMPLATE-COMPLETE.md +735 -0
- package/one/events/ECOMMERCE-TEMPLATES-SUMMARY.md +923 -0
- package/one/events/GRADIENT-TEXT-PERMANENT-FIX.md +223 -0
- package/one/events/HANDOFF.md +313 -0
- package/one/events/IMPLEMENTATION-SUMMARY-FINAL.md +503 -0
- package/one/events/IMPLEMENTATION_SUMMARY.md +529 -0
- package/one/events/LANDING-PAGE-EXAMPLE-OUTPUT.md +666 -0
- package/one/events/LANDING-PAGE-IMPLEMENTATION.md +642 -0
- package/one/events/LANDING-PAGE-QUICKSTART.md +407 -0
- package/one/events/MULTI-ONTOLOGY-COMPLETE-GUIDE.md +1627 -0
- package/one/events/MULTI-ONTOLOGY-IMPLEMENTATION-COMPLETE.md +573 -0
- package/one/events/ONBOARDING-IMPLEMENTATION-COMPLETE copy.md +398 -0
- package/one/events/ONTOLOGY-TUTORIALS-SUMMARY.md +525 -0
- package/one/events/ONTOLOGY-TYPE-GENERATOR-SUMMARY.md +455 -0
- package/one/events/ONTOLOGY_DISCOVERY_IMPLEMENTATION.md +486 -0
- package/one/events/ONTOLOGY_DISCOVERY_QUICKSTART.md +203 -0
- package/one/events/SECURITY-AUDIT-FIXES.md +376 -0
- package/one/events/SECURITY-SCAN-COMPLETE.md +281 -0
- package/one/events/SHOP-BUILD-STATUS.md +114 -0
- package/one/events/SHOP-PREMIUM-UPDATE.md +149 -0
- package/one/events/SITE-WIDE-GRADIENT-FIX.md +299 -0
- package/one/events/STORE-PRODUCTION-READY-STATUS.md +359 -0
- package/one/events/STRIPE-PAYMENT-METHODS-GUIDE.md +429 -0
- package/one/events/agent-director-enhancement-summary.md +386 -0
- package/one/events/agent-onboard-implementation-summary.md +457 -0
- package/one/events/clean-agent-ontology-cleanup-report.md +353 -0
- package/one/events/landing-page-generator.md +458 -0
- package/one/events/onboarding-implementation-complete.md +505 -0
- package/one/events/release.md +254 -0
- package/one/events/separate-implementation-status.md +537 -0
- package/one/knowledge/100-inference-quick-reference.md +431 -0
- package/one/knowledge/agent-onboard-usage.md +612 -0
- package/one/knowledge/cli-claude-handoff.md +718 -0
- package/one/knowledge/ontology-blog.yaml +31 -0
- package/one/knowledge/ontology-cheatsheet.md +591 -0
- package/one/knowledge/ontology-community.yaml +42 -0
- package/one/knowledge/ontology-core-universal.md +722 -0
- package/one/knowledge/ontology-core.yaml +50 -0
- package/one/knowledge/ontology-courses.yaml +53 -0
- package/one/knowledge/ontology-creator.md +376 -0
- package/one/knowledge/ontology-developer-guide.md +789 -0
- package/one/knowledge/ontology-education.md +920 -0
- package/one/knowledge/ontology-index.md +354 -0
- package/one/knowledge/ontology-migration-guide.md +811 -0
- package/one/knowledge/ontology-minimal.yaml +1 -1
- package/one/knowledge/ontology-portfolio.yaml +31 -0
- package/one/knowledge/ontology-quickstart.md +576 -0
- package/one/knowledge/ontology-shop.yaml +121 -0
- package/one/knowledge/ontology-tokens.yaml +32 -0
- package/one/knowledge/ontology-tutorial.md +434 -0
- package/one/knowledge/ontology-video-script.md +890 -0
- package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +467 -0
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +408 -0
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +369 -0
- package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +396 -0
- package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +468 -0
- package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +582 -0
- package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +449 -0
- package/one/things/docs/ecommerce/QUICK-START.md +368 -0
- package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +498 -0
- package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +237 -0
- package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +171 -0
- package/one/things/docs/ecommerce/demo.astro +309 -0
- package/one/things/plans/agent-director-100-inference-plans.md +410 -0
- package/one/things/plans/dual-website-strategy.md +612 -0
- package/one/things/plans/feature-based-sites.md +821 -0
- package/one/things/plans/multi-ontology-architecture.md +836 -0
- package/one/things/plans/onboarding.md +32 -0
- package/one/things/plans/separate.md +15 -17
- package/one/things/plans/start-new.md +738 -0
- package/package.json +2 -2
- package/one/things/claude/hooks/agent-hook-manager.js +0 -525
- package/one/things/claude/hooks/agent-load-balancer.js +0 -271
- package/one/things/claude/hooks/agent-request-interceptor.js +0 -70
- package/one/things/claude/hooks/cascade-feedback.js +0 -297
- package/one/things/claude/hooks/cascade-integration-hooks.js +0 -648
- package/one/things/claude/hooks/continuous-improvement-monitor.js +0 -510
- package/one/things/claude/hooks/file-organization-engine.js +0 -427
- package/one/things/claude/hooks/file-organization-monitor.js +0 -269
- package/one/things/claude/hooks/hook-config-manager.js +0 -202
- package/one/things/claude/hooks/hook-orchestrator.js +0 -662
- package/one/things/claude/hooks/hook-performance-report.js +0 -120
- package/one/things/claude/hooks/mcp-cascade-integration.js +0 -816
- package/one/things/claude/hooks/memory-optimizer.js +0 -510
- package/one/things/claude/hooks/ontology-compliance.js +0 -394
- package/one/things/claude/hooks/ontology-hook-manager.js +0 -316
- package/one/things/claude/hooks/ontology-validation-engine.js +0 -317
- package/one/things/claude/hooks/performance-monitoring-hook.js +0 -422
- package/one/things/claude/hooks/quality-scoring-engine.js +0 -834
- package/one/things/claude/hooks/simple-load-balancer.js +0 -238
- package/one/things/claude/hooks/startup-optimizer.js +0 -625
- package/one/things/claude/hooks/story-scoring-system.js +0 -445
- package/one/things/claude/hooks/story-validation-engine.js +0 -473
- package/one/things/claude/hooks/structure-synchronizer.js +0 -194
- package/one/things/claude/hooks/sub-agent-output-validator.js +0 -647
- package/one/things/claude/hooks/sub-agent-validation-hook.js +0 -343
- package/one/things/claude/hooks/trinity-validation-system.js +0 -392
- package/one/things/plans/organizations-to-groups.md +0 -705
|
@@ -1,445 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Story Scoring System - Quality Assessment and Metrics
|
|
5
|
-
* Provides detailed scoring analysis and improvement recommendations
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import fs from 'fs';
|
|
9
|
-
import path from 'path';
|
|
10
|
-
|
|
11
|
-
class StoryScoringSystem {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.metrics = {
|
|
14
|
-
templateCompliance: 0,
|
|
15
|
-
acceptanceCriteria: 0,
|
|
16
|
-
technicalFeasibility: 0,
|
|
17
|
-
taskStructure: 0,
|
|
18
|
-
securityConsiderations: 0,
|
|
19
|
-
testability: 0,
|
|
20
|
-
claritySpecificity: 0,
|
|
21
|
-
businessValue: 0,
|
|
22
|
-
implementationReadiness: 0,
|
|
23
|
-
qualityAssurance: 0
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
this.weightings = {
|
|
27
|
-
templateCompliance: 0.15,
|
|
28
|
-
acceptanceCriteria: 0.15,
|
|
29
|
-
technicalFeasibility: 0.15,
|
|
30
|
-
taskStructure: 0.10,
|
|
31
|
-
securityConsiderations: 0.10,
|
|
32
|
-
testability: 0.10,
|
|
33
|
-
claritySpecificity: 0.10,
|
|
34
|
-
businessValue: 0.05,
|
|
35
|
-
implementationReadiness: 0.05,
|
|
36
|
-
qualityAssurance: 0.05
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
this.recommendations = [];
|
|
40
|
-
this.insights = [];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
analyzeStory(storyContent, validationResult) {
|
|
44
|
-
this.scoreTemplateCompliance(storyContent);
|
|
45
|
-
this.scoreAcceptanceCriteria(storyContent);
|
|
46
|
-
this.scoreTechnicalFeasibility(storyContent);
|
|
47
|
-
this.scoreTaskStructure(storyContent);
|
|
48
|
-
this.scoreSecurityConsiderations(storyContent);
|
|
49
|
-
this.scoreTestability(storyContent);
|
|
50
|
-
this.scoreClaritySpecificity(storyContent);
|
|
51
|
-
this.scoreBusinessValue(storyContent);
|
|
52
|
-
this.scoreImplementationReadiness(storyContent);
|
|
53
|
-
this.scoreQualityAssurance(storyContent, validationResult);
|
|
54
|
-
|
|
55
|
-
return this.generateScoringReport();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
scoreTemplateCompliance(content) {
|
|
59
|
-
const requiredSections = [
|
|
60
|
-
'Status', 'Story', 'Acceptance Criteria', 'Tasks / Subtasks',
|
|
61
|
-
'Dev Notes', 'Change Log', 'Dev Agent Record'
|
|
62
|
-
];
|
|
63
|
-
|
|
64
|
-
let presentSections = 0;
|
|
65
|
-
requiredSections.forEach(section => {
|
|
66
|
-
if (new RegExp(`^##\\s+${section}`, 'm').test(content)) {
|
|
67
|
-
presentSections++;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
this.metrics.templateCompliance = (presentSections / requiredSections.length) * 10;
|
|
72
|
-
|
|
73
|
-
if (this.metrics.templateCompliance < 8) {
|
|
74
|
-
this.recommendations.push('Ensure all required template sections are present and properly formatted');
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
scoreAcceptanceCriteria(content) {
|
|
79
|
-
const acSection = this.extractSection(content, 'Acceptance Criteria');
|
|
80
|
-
if (!acSection) {
|
|
81
|
-
this.metrics.acceptanceCriteria = 0;
|
|
82
|
-
this.recommendations.push('Add detailed acceptance criteria with measurable outcomes');
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const criteria = acSection.split('\n').filter(line => line.trim().match(/^\d+\./));
|
|
87
|
-
const criteriaCount = criteria.length;
|
|
88
|
-
|
|
89
|
-
// Check for SMART criteria (Specific, Measurable, Achievable, Relevant, Time-bound)
|
|
90
|
-
let smartScore = 0;
|
|
91
|
-
criteria.forEach(criterion => {
|
|
92
|
-
if (this.isMeasurable(criterion)) smartScore += 0.3;
|
|
93
|
-
if (this.isSpecific(criterion)) smartScore += 0.3;
|
|
94
|
-
if (this.isActionable(criterion)) smartScore += 0.4;
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
this.metrics.acceptanceCriteria = Math.min(10, (criteriaCount * 2) + smartScore);
|
|
98
|
-
|
|
99
|
-
if (this.metrics.acceptanceCriteria < 7) {
|
|
100
|
-
this.recommendations.push('Improve acceptance criteria specificity and measurability');
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
scoreTechnicalFeasibility(content) {
|
|
105
|
-
let feasibilityScore = 5; // Base score
|
|
106
|
-
|
|
107
|
-
// Check for technical architecture details
|
|
108
|
-
if (/technical architecture|system design|implementation approach/i.test(content)) {
|
|
109
|
-
feasibilityScore += 2;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Check for dependency analysis
|
|
113
|
-
if (/dependencies|prerequisite|requirement/i.test(content)) {
|
|
114
|
-
feasibilityScore += 1;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Check for complexity assessment
|
|
118
|
-
if (/complexity|effort|timeline|estimation/i.test(content)) {
|
|
119
|
-
feasibilityScore += 1;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// Check for risk assessment
|
|
123
|
-
if (/risk|challenge|blocker|limitation/i.test(content)) {
|
|
124
|
-
feasibilityScore += 1;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
this.metrics.technicalFeasibility = Math.min(10, feasibilityScore);
|
|
128
|
-
|
|
129
|
-
if (this.metrics.technicalFeasibility < 6) {
|
|
130
|
-
this.recommendations.push('Add more technical feasibility analysis and risk assessment');
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
scoreTaskStructure(content) {
|
|
135
|
-
const tasksSection = this.extractSection(content, 'Tasks / Subtasks');
|
|
136
|
-
if (!tasksSection) {
|
|
137
|
-
this.metrics.taskStructure = 0;
|
|
138
|
-
this.recommendations.push('Add comprehensive task breakdown with subtasks');
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const tasks = tasksSection.match(/- \[ \]/g);
|
|
143
|
-
const taskCount = tasks ? tasks.length : 0;
|
|
144
|
-
|
|
145
|
-
// Check for hierarchical structure
|
|
146
|
-
const hasPhases = /### Phase|## Phase/i.test(tasksSection);
|
|
147
|
-
const hasSubtasks = / - \[ \]/g.test(tasksSection);
|
|
148
|
-
|
|
149
|
-
let structureScore = Math.min(5, taskCount * 0.5);
|
|
150
|
-
if (hasPhases) structureScore += 2;
|
|
151
|
-
if (hasSubtasks) structureScore += 2;
|
|
152
|
-
if (taskCount >= 10) structureScore += 1;
|
|
153
|
-
|
|
154
|
-
this.metrics.taskStructure = Math.min(10, structureScore);
|
|
155
|
-
|
|
156
|
-
if (this.metrics.taskStructure < 6) {
|
|
157
|
-
this.recommendations.push('Improve task structure with clear phases and subtasks');
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
scoreSecurityConsiderations(content) {
|
|
162
|
-
const securityKeywords = [
|
|
163
|
-
'security', 'authentication', 'authorization', 'validation',
|
|
164
|
-
'sanitization', 'encryption', 'access control', 'audit'
|
|
165
|
-
];
|
|
166
|
-
|
|
167
|
-
let securityScore = 3; // Base score for basic consideration
|
|
168
|
-
|
|
169
|
-
securityKeywords.forEach(keyword => {
|
|
170
|
-
if (content.toLowerCase().includes(keyword)) {
|
|
171
|
-
securityScore += 0.5;
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
// Check for security section
|
|
176
|
-
if (/security consideration|security requirement|security note/i.test(content)) {
|
|
177
|
-
securityScore += 2;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
this.metrics.securityConsiderations = Math.min(10, securityScore);
|
|
181
|
-
|
|
182
|
-
if (this.metrics.securityConsiderations < 5) {
|
|
183
|
-
this.recommendations.push('Consider security implications and add security requirements');
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
scoreTestability(content) {
|
|
188
|
-
let testabilityScore = 2; // Base score
|
|
189
|
-
|
|
190
|
-
// Check for testing strategy
|
|
191
|
-
if (/testing strategy|test plan|testing approach/i.test(content)) {
|
|
192
|
-
testabilityScore += 3;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// Check for test types mentioned
|
|
196
|
-
const testTypes = ['unit test', 'integration test', 'end-to-end', 'performance test'];
|
|
197
|
-
testTypes.forEach(type => {
|
|
198
|
-
if (content.toLowerCase().includes(type)) {
|
|
199
|
-
testabilityScore += 1;
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
// Check for testable acceptance criteria
|
|
204
|
-
const acSection = this.extractSection(content, 'Acceptance Criteria');
|
|
205
|
-
if (acSection && this.hasTestableElements(acSection)) {
|
|
206
|
-
testabilityScore += 2;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
this.metrics.testability = Math.min(10, testabilityScore);
|
|
210
|
-
|
|
211
|
-
if (this.metrics.testability < 6) {
|
|
212
|
-
this.recommendations.push('Add comprehensive testing strategy and testable criteria');
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
scoreClaritySpecificity(content) {
|
|
217
|
-
let clarityScore = 5; // Base score
|
|
218
|
-
|
|
219
|
-
// Check for clear user story format
|
|
220
|
-
if (/\*\*As a\*\*.*\*\*I want\*\*.*\*\*so that\*\*/i.test(content)) {
|
|
221
|
-
clarityScore += 2;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// Check for specific terminology vs vague language
|
|
225
|
-
const vague = ['improve', 'enhance', 'optimize', 'better', 'good'];
|
|
226
|
-
const specific = ['implement', 'create', 'add', 'remove', 'update', 'integrate'];
|
|
227
|
-
|
|
228
|
-
let vagueCount = 0;
|
|
229
|
-
let specificCount = 0;
|
|
230
|
-
|
|
231
|
-
vague.forEach(word => {
|
|
232
|
-
vagueCount += (content.toLowerCase().match(new RegExp(word, 'g')) || []).length;
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
specific.forEach(word => {
|
|
236
|
-
specificCount += (content.toLowerCase().match(new RegExp(word, 'g')) || []).length;
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
if (specificCount > vagueCount) clarityScore += 2;
|
|
240
|
-
if (vagueCount > specificCount * 2) clarityScore -= 1;
|
|
241
|
-
|
|
242
|
-
this.metrics.claritySpecificity = Math.min(10, clarityScore);
|
|
243
|
-
|
|
244
|
-
if (this.metrics.claritySpecificity < 6) {
|
|
245
|
-
this.recommendations.push('Use more specific language and reduce vague terminology');
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
scoreBusinessValue(content) {
|
|
250
|
-
let valueScore = 3; // Base score
|
|
251
|
-
|
|
252
|
-
// Check for business value articulation
|
|
253
|
-
if (/business value|benefit|impact|roi|return on investment/i.test(content)) {
|
|
254
|
-
valueScore += 2;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// Check for user benefit in story format
|
|
258
|
-
if (/so that.*\b(can|will|able to|improve|increase|reduce|save)\b/i.test(content)) {
|
|
259
|
-
valueScore += 2;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
// Check for success metrics
|
|
263
|
-
if (/metric|measure|kpi|success|target|goal/i.test(content)) {
|
|
264
|
-
valueScore += 2;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
this.metrics.businessValue = Math.min(10, valueScore);
|
|
268
|
-
|
|
269
|
-
if (this.metrics.businessValue < 5) {
|
|
270
|
-
this.recommendations.push('Clarify business value and success metrics');
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
scoreImplementationReadiness(content) {
|
|
275
|
-
let readinessScore = 4; // Base score
|
|
276
|
-
|
|
277
|
-
// Check for implementation details
|
|
278
|
-
if (/implementation|approach|technical details|architecture/i.test(content)) {
|
|
279
|
-
readinessScore += 2;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
// Check for file structure or code examples
|
|
283
|
-
if (/```|file structure|directory|component|class|function/i.test(content)) {
|
|
284
|
-
readinessScore += 2;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// Check for dependency identification
|
|
288
|
-
if (/dependency|prerequisite|library|framework|tool/i.test(content)) {
|
|
289
|
-
readinessScore += 1;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
this.metrics.implementationReadiness = Math.min(10, readinessScore);
|
|
293
|
-
|
|
294
|
-
if (this.metrics.implementationReadiness < 6) {
|
|
295
|
-
this.recommendations.push('Add more implementation details and technical specifications');
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
scoreQualityAssurance(content, validationResult) {
|
|
300
|
-
let qaScore = 5; // Base score
|
|
301
|
-
|
|
302
|
-
// Factor in validation result
|
|
303
|
-
if (validationResult) {
|
|
304
|
-
if (validationResult.issues.critical.length === 0) qaScore += 2;
|
|
305
|
-
if (validationResult.issues.shouldFix.length <= 2) qaScore += 1;
|
|
306
|
-
if (validationResult.issues.niceToHave.length <= 3) qaScore += 1;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
// Check for QA considerations
|
|
310
|
-
if (/quality|review|validation|verification/i.test(content)) {
|
|
311
|
-
qaScore += 1;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
this.metrics.qualityAssurance = Math.min(10, qaScore);
|
|
315
|
-
|
|
316
|
-
if (this.metrics.qualityAssurance < 6) {
|
|
317
|
-
this.recommendations.push('Address validation issues and improve quality considerations');
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
calculateWeightedScore() {
|
|
322
|
-
let totalScore = 0;
|
|
323
|
-
Object.keys(this.metrics).forEach(metric => {
|
|
324
|
-
totalScore += this.metrics[metric] * this.weightings[metric];
|
|
325
|
-
});
|
|
326
|
-
return totalScore;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
generateScoringReport() {
|
|
330
|
-
const weightedScore = this.calculateWeightedScore();
|
|
331
|
-
|
|
332
|
-
return {
|
|
333
|
-
overallScore: weightedScore.toFixed(1),
|
|
334
|
-
detailedMetrics: this.metrics,
|
|
335
|
-
recommendations: this.recommendations,
|
|
336
|
-
insights: this.generateInsights(),
|
|
337
|
-
readinessLevel: this.getReadinessLevel(weightedScore),
|
|
338
|
-
improvementPriorities: this.getImprovementPriorities()
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
generateInsights() {
|
|
343
|
-
const insights = [];
|
|
344
|
-
|
|
345
|
-
const topMetrics = Object.entries(this.metrics)
|
|
346
|
-
.sort(([,a], [,b]) => b - a)
|
|
347
|
-
.slice(0, 3);
|
|
348
|
-
|
|
349
|
-
const bottomMetrics = Object.entries(this.metrics)
|
|
350
|
-
.sort(([,a], [,b]) => a - b)
|
|
351
|
-
.slice(0, 3);
|
|
352
|
-
|
|
353
|
-
insights.push(`Strongest areas: ${topMetrics.map(([name]) => name).join(', ')}`);
|
|
354
|
-
insights.push(`Areas for improvement: ${bottomMetrics.map(([name]) => name).join(', ')}`);
|
|
355
|
-
|
|
356
|
-
return insights;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
getReadinessLevel(score) {
|
|
360
|
-
if (score >= 9) return 'Excellent - Ready for immediate implementation';
|
|
361
|
-
if (score >= 8) return 'Good - Minor refinements recommended';
|
|
362
|
-
if (score >= 7) return 'Acceptable - Some improvements needed';
|
|
363
|
-
if (score >= 6) return 'Needs Work - Significant improvements required';
|
|
364
|
-
if (score >= 5) return 'Poor - Major revision needed';
|
|
365
|
-
return 'Critical - Complete rewrite recommended';
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
getImprovementPriorities() {
|
|
369
|
-
return Object.entries(this.metrics)
|
|
370
|
-
.filter(([, score]) => score < 6)
|
|
371
|
-
.sort(([,a], [,b]) => a - b)
|
|
372
|
-
.map(([name]) => name);
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
// Helper methods
|
|
376
|
-
extractSection(content, sectionName) {
|
|
377
|
-
const sectionPattern = new RegExp(`^##\\s+${sectionName}\\s*$`, 'm');
|
|
378
|
-
const match = content.match(sectionPattern);
|
|
379
|
-
|
|
380
|
-
if (!match) return null;
|
|
381
|
-
|
|
382
|
-
const sectionStart = match.index + match[0].length;
|
|
383
|
-
const nextSectionPattern = /^##\s+/m;
|
|
384
|
-
const remainingContent = content.slice(sectionStart);
|
|
385
|
-
const nextSectionMatch = remainingContent.match(nextSectionPattern);
|
|
386
|
-
|
|
387
|
-
const sectionEnd = nextSectionMatch ? sectionStart + nextSectionMatch.index : content.length;
|
|
388
|
-
return content.slice(sectionStart, sectionEnd).trim();
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
isMeasurable(criterion) {
|
|
392
|
-
return /\d+|percent|%|measure|metric|count|number|score|rate|time|duration/i.test(criterion);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
isSpecific(criterion) {
|
|
396
|
-
return !/vague|general|improve|enhance|better|good|bad/i.test(criterion);
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
isActionable(criterion) {
|
|
400
|
-
return /implement|create|add|remove|update|build|deploy|configure|test|validate/i.test(criterion);
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
hasTestableElements(content) {
|
|
404
|
-
return /verify|validate|test|measure|check|confirm|ensure/i.test(content);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
// Main execution for CLI usage
|
|
409
|
-
async function main() {
|
|
410
|
-
const args = process.argv.slice(2);
|
|
411
|
-
if (args.length < 1) {
|
|
412
|
-
console.error('Usage: story-scoring-system.js <story_file_path> [validation_result_json]');
|
|
413
|
-
process.exit(1);
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
const storyPath = args[0];
|
|
417
|
-
const validationResultPath = args[1];
|
|
418
|
-
|
|
419
|
-
if (!fs.existsSync(storyPath)) {
|
|
420
|
-
console.error(`Story file not found: ${storyPath}`);
|
|
421
|
-
process.exit(1);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
const storyContent = fs.readFileSync(storyPath, 'utf8');
|
|
425
|
-
let validationResult = null;
|
|
426
|
-
|
|
427
|
-
if (validationResultPath && fs.existsSync(validationResultPath)) {
|
|
428
|
-
validationResult = JSON.parse(fs.readFileSync(validationResultPath, 'utf8'));
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
const scoringSystem = new StoryScoringSystem();
|
|
432
|
-
const report = scoringSystem.analyzeStory(storyContent, validationResult);
|
|
433
|
-
|
|
434
|
-
console.log(JSON.stringify(report, null, 2));
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
// Check if this is the main module (ES module equivalent of require.main === module)
|
|
438
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
439
|
-
main().catch(error => {
|
|
440
|
-
console.error('Scoring error:', error.message);
|
|
441
|
-
process.exit(1);
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
export default StoryScoringSystem;
|