takeokunn

Core Patterns

Base templates for error escalation, decision criteria, and enforcement. Referenced by agents and commands to avoid duplication.

takeokunn 67 1 Updated 3mo ago
GitHub

Install

npx skillscat add takeokunn/nixos-configuration/core-patterns

Install via the SkillsCat registry.

SKILL.md
Provide standardized base templates for error handling, decision criteria, and enforcement behaviors shared across all agents and commands. Standard 4-level severity escalation pattern Include in agents and commands for consistent error handling</use_case> Standard confidence calculation with validation tests Include in agents and commands for consistent quality assessment</use_case> Standard mandatory and prohibited behaviors pattern Include in agents and commands for consistent behavior enforcement</use_case> Standard 4-level severity classification for error escalation low: Minor issues, note and proceed medium: Unclear situations, document and ask user high: Breaking changes, STOP and present options critical: Security/data risks, BLOCK and require acknowledgment Standard confidence score boundaries for status determination success: confidence >= 80 warning: confidence 60-79 error: confidence less than 60
  Boundary tests required:
  boundary_success_80: Exactly 80, yields success
  boundary_warning_79: 78.5-79.9, yields warning
  boundary_error_59: 58.5-59.9, yields error
</example>
Naming convention for enforcement behavior IDs Format: PREFIX-TYPE-NUMBER PREFIX: Agent/command abbreviation (e.g., EXEC, DEF, EXP) TYPE: B for mandatory behavior, P for prohibited NUMBER: Sequential (001, 002, ...)
  Examples:
  EXEC-B001: Execute command mandatory behavior 1
  DEF-P002: Define command prohibited behavior 2
</example>
Decision criteria weights must sum to 1.0 Standard distributions: 3-factor equal: 0.33, 0.34, 0.33 3-factor weighted: 0.4, 0.3, 0.3 2-factor equal: 0.5, 0.5 2-factor weighted: 0.6, 0.4 Standard 4-level error escalation template Minor issue description Note in report, proceed Unclear or ambiguous situation Document issue, use AskUserQuestion for clarification Breaking change or blocker STOP, present options to user Security risk or data loss BLOCK operation, require explicit user acknowledgment </error_escalation> Standard decision criteria with validation tests including boundary cases Excellent condition Good condition Fair condition Poor condition Excellent Good Fair Poor Excellent Good Fair Poor factor1=95, factor2=90, factor3=95 (95*0.4)+(90*0.3)+(95*0.3) = 38+27+28.5 = 93.5 success</expected_status> High scores yield success factor1=85, factor2=75, factor3=80 (85*0.4)+(75*0.3)+(80*0.3) = 34+22.5+24 = 80.5 success</expected_status> Weighted average 80.5 meets success threshold factor1=80, factor2=75, factor3=80 (80*0.4)+(75*0.3)+(80*0.3) = 32+22.5+24 = 78.5 warning</expected_status> Weighted average 78.5 triggers warning factor1=60, factor2=55, factor3=60 (60*0.4)+(55*0.3)+(60*0.3) = 24+16.5+18 = 58.5 error</expected_status> Weighted average 58.5 is below 60, triggers error factor1=50, factor2=55, factor3=45 (50*0.4)+(55*0.3)+(45*0.3) = 20+16.5+13.5 = 50 error</expected_status> Low scores yield error </validation_tests> </decision_criteria> Standard enforcement template with mandatory and prohibited behaviors When condition occurs Required action How to verify compliance </mandatory_behaviors> Always Prohibited action description What to do instead </prohibited_behaviors> Standard syntax for referencing skills from agents and commands core-patterns parallelization-patterns workflow-patterns serena-usage nix-ecosystem

Use attribute values:
patterns: Shared templates (core-patterns, parallelization-patterns, workflow-patterns)
tools: Tool-specific usage patterns (serena-usage, context7-usage)
workflow: How-to guides and methodologies (investigation-patterns, execution-workflow)
domain: Domain knowledge and best practices (nix-ecosystem, typescript-ecosystem)


Duplicating full error_escalation in each file Reference core-patterns and customize only examples Using different confidence thresholds (75, 80, 85) across files Always use 60/80 boundaries as defined in core-patterns Omitting boundary validation tests (59/60, 79/80) Always include boundary_success_80, boundary_warning_79, boundary_error_59 tests Decision criteria weights not summing to 1.0 Verify weights sum to exactly 1.0 (e.g., 0.4+0.3+0.3) Using different ID formats across files Use PREFIX-TYPE-NUMBER format consistently </anti_patterns> Reference core-patterns for error_escalation, decision_criteria, enforcement templates Always include all 5 validation tests: success, boundary_success_80, boundary_warning_79, boundary_error_59, error Ensure decision criteria weights sum to 1.0 Customize error_escalation examples to be domain-specific while keeping structure Use consistent behavior ID prefixes within each agent/command </best_practices> Always include all 5 validation tests for decision_criteria Boundary tests must use exact threshold values (80, 79.x, 59.x) Error escalation must have exactly 4 severity levels Weights in decision_criteria must sum to 1.0 Use refs tag to reference this skill from agents and commands Customize examples in error_escalation while keeping structure Use consistent behavior ID naming convention When creating new agent or command Reference core-patterns skill in refs section refs tag contains core-patterns When defining decision_criteria Include all 5 validation tests with boundary cases Tests include boundary_success_80, boundary_warning_79, boundary_error_59 </mandatory_behaviors> Always Using non-standard confidence thresholds Use 60/80 thresholds as defined in this skill </prohibited_behaviors> Minor inconsistency in behavior ID format Note in report, proceed Missing one boundary test Document issue, add missing test Decision criteria weights do not sum to 1.0 STOP, fix weight distribution before proceeding Error escalation missing critical level BLOCK operation, require complete 4-level structure </error_escalation> Parallel execution strategies and timeout configuration Output formats, reflection checkpoints, agent weights For memory operations to store pattern decisions </related_skills> Define exactly 4 severity levels for error_escalation Include all 5 validation tests for decision_criteria Ensure weights sum to 1.0 Use standard confidence thresholds (60/80) Inventing new severity levels Omitting boundary tests Using non-standard thresholds