completeness-calculator
# Completeness Calculator Skill
What this skill does
# Completeness Calculator Skill
Deterministic calculation of specification completeness scores.
## Purpose
Provides consistent, reproducible completeness scoring based on answered questions and their categories/priorities.
## Algorithm
### Category Weights
```typescript
const CATEGORY_WEIGHTS = {
functional: 0.30, // What the system does
technical: 0.25, // How it's built
ux: 0.20, // User experience
edgeCases: 0.15, // Error handling
constraints: 0.10 // Business limits
};
```
### Priority Weights
```typescript
const PRIORITY_WEIGHTS = {
critical: 40,
important: 35,
nice_to_have: 25
};
```
### Calculation
```typescript
function calculateCompleteness(
clarifications: Clarification[],
pendingQuestions: Question[]
): Completeness {
const allQuestions = [
...clarifications.map(c => ({
category: c.category,
priority: getPriority(c.questionId),
answered: true
})),
...pendingQuestions.map(q => ({
category: q.category,
priority: q.priority,
answered: false
}))
];
const categoryScores: Record<Category, number> = {
functional: 0,
technical: 0,
ux: 0,
edgeCases: 0,
constraints: 0
};
// Calculate per-category scores
for (const category of Object.keys(categoryScores) as Category[]) {
const categoryQuestions = allQuestions.filter(q => q.category === category);
if (categoryQuestions.length === 0) {
// No questions in category = assume partial coverage
categoryScores[category] = 30;
continue;
}
const maxPoints = categoryQuestions.reduce(
(sum, q) => sum + PRIORITY_WEIGHTS[q.priority],
0
);
const earnedPoints = categoryQuestions
.filter(q => q.answered)
.reduce((sum, q) => sum + PRIORITY_WEIGHTS[q.priority], 0);
categoryScores[category] = Math.round((earnedPoints / maxPoints) * 100);
}
// Calculate weighted overall
const overall = Math.round(
categoryScores.functional * CATEGORY_WEIGHTS.functional +
categoryScores.technical * CATEGORY_WEIGHTS.technical +
categoryScores.ux * CATEGORY_WEIGHTS.ux +
categoryScores.edgeCases * CATEGORY_WEIGHTS.edgeCases +
categoryScores.constraints * CATEGORY_WEIGHTS.constraints
);
return {
overall,
functional: categoryScores.functional,
technical: categoryScores.technical,
ux: categoryScores.ux,
edgeCases: categoryScores.edgeCases,
constraints: categoryScores.constraints
};
}
```
## Thresholds
```typescript
const THRESHOLDS = {
LOW: 40, // Below this: significant gaps
PARTIAL: 60, // Below this: needs more work
GOOD: 80, // At or above: can generate
EXCELLENT: 90 // High confidence spec
};
function getStatus(overall: number): string {
if (overall < THRESHOLDS.LOW) return 'low';
if (overall < THRESHOLDS.PARTIAL) return 'partial';
if (overall < THRESHOLDS.GOOD) return 'good';
return 'ready';
}
function canGenerate(completeness: Completeness): boolean {
return completeness.overall >= THRESHOLDS.GOOD;
}
```
## Visual Representation
```typescript
function renderProgressBar(score: number, width: number = 20): string {
const filled = Math.round((score / 100) * width);
const empty = width - filled;
return '█'.repeat(filled) + '░'.repeat(empty);
}
function renderCompleteness(completeness: Completeness): string {
return `
Completeness:
Overall: ${renderProgressBar(completeness.overall)} ${completeness.overall}%
Functional: ${renderProgressBar(completeness.functional)} ${completeness.functional}%
Technical: ${renderProgressBar(completeness.technical)} ${completeness.technical}%
UX: ${renderProgressBar(completeness.ux)} ${completeness.ux}%
Edge Cases: ${renderProgressBar(completeness.edgeCases)} ${completeness.edgeCases}%
Constraints: ${renderProgressBar(completeness.constraints)} ${completeness.constraints}%
`.trim();
}
```
## Usage
```typescript
// After answering questions
const completeness = calculateCompleteness(
session.clarifications,
session.pendingQuestions || []
);
// Update session
session.completeness = completeness;
// Check if ready
if (canGenerate(completeness)) {
session.status = 'ready_to_generate';
}
```
## Edge Cases
### No Questions Asked Yet
- Return baseline scores (15-20% overall)
- All categories start low
### Category Has No Questions
- Assign default 30% (unknown coverage)
- Note in gap analysis
### All Questions Answered
- Can still be < 100% if no nice-to-have questions
- 100% requires comprehensive question coverage
### Round Limits
- If max rounds reached but < 80%, force ready
- Add warning to spec generation
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.