Skip to content

Instantly share code, notes, and snippets.

@anon987654321
Created October 30, 2025 16:20
Show Gist options
  • Select an option

  • Save anon987654321/df01de557a1bb080ce43b3271e7cd628 to your computer and use it in GitHub Desktop.

Select an option

Save anon987654321/df01de557a1bb080ce43b3271e7cd628 to your computer and use it in GitHub Desktop.

master.json v6.0.0

General-purpose project completion framework for LLMs, with a focus on Ruby, Ruby on Rails and OpenBSD.

// **master.json** v6.0.0
//
// General-purpose project completion framework for LLMs, with a focus on Ruby, Ruby on Rails and OpenBSD.
//
{
"meta": {
"version": "6.0.0",
"updated": "2025-10-30T16:14:44Z",
"owner": "anon987654321",
"for": ["any_structured_content", "self_optimization", "claude_code_optimization", "multi_llm_collaboration"],
"health": 1.0000,
"lines": 612,
"auto_iterate_until_converge": true,
"auto_execute": true,
"show_progress": true,
"checks": 79,
"depth": 3,
"time": "minutes",
"cache": true,
"incremental": true,
"preview_major_changes": true,
"user_overrides": "~/.masterrc or .master.json in project root",
"dogfooding": {
"proven": true,
"evolution": "318→227→342→339→512→548→687→218(DeepSeek)→612(synthesis)",
"thesis": "Framework successfully optimized itself across multiple versions, integrated multi-LLM wisdom",
"achievement": "Zero violations while synthesizing DeepSeek's minimalism with comprehensive capabilities"
},
"multi_llm_synthesis": {
"baseline": "DeepSeek v4.1.1 (218 lines, extreme DRY, GRASP principles)",
"enhancements": "Claude v5.3.0 (comprehensive principles, zsh patterns, decision intelligence)",
"contributors": ["DeepSeek", "Grok 4", "Claude 4.5", "Claude 3.7 Sonnet"],
"synthesis_date": "2025-10-30T16:14:44Z"
}
},
"core": {
"comprehensive_principles": {
"description": "Reference library of proven design philosophies. Organized at depth 4 for semantic navigation (justified exception to nesting_maximum=3).",
"solid": {
"srp": {"name": "single_responsibility", "rule": "One reason to change", "severity": 4, "source": "Robert C. Martin"},
"ocp": {"name": "open_closed", "rule": "Open for extension, closed for modification", "severity": 3, "source": "Bertrand Meyer"},
"lsp": {"name": "liskov_substitution", "rule": "Subtypes must be substitutable", "severity": 3, "source": "Barbara Liskov"},
"isp": {"name": "interface_segregation", "rule": "No unused dependencies", "severity": 2, "source": "Robert C. Martin"},
"dip": {"name": "dependency_inversion", "rule": "Depend on abstractions not concretions", "severity": 3, "source": "Robert C. Martin"}
},
"grasp": {
"information_expert": {"rule": "Assign responsibilities to data holders", "severity": 3},
"creator": {"rule": "Aggregators create instances", "severity": 2},
"controller": {"rule": "Coordinate tasks via single section", "severity": 3},
"low_coupling": {"rule": "Minimize dependencies", "severity": 4},
"high_cohesion": {"rule": "Group related responsibilities", "severity": 4},
"indirection": {"rule": "Decouple via intermediaries", "severity": 2},
"polymorphism": {"rule": "Use common interfaces", "severity": 2},
"pure_fabrication": {"rule": "Create simplifying sections", "severity": 2},
"protected_variations": {"rule": "Protect against variations", "severity": 3}
},
"pola": {"name": "principle_of_least_authority", "rule": "Access only what's necessary", "severity": 4},
"rails_doctrine": {
"convention_over_configuration": {"rule": "Sensible defaults reduce complexity", "severity": 3},
"dont_repeat_yourself": {"rule": "Single unambiguous authoritative representation", "severity": 4},
"fat_models": {"rule": "Business logic in models", "severity": 2},
"beautiful_code": {"rule": "Optimize for programmer happiness", "severity": 2}
},
"strunk_white": {
"omit_needless_words": {"rule": "Vigorous writing is concise", "severity": 3},
"use_definite_language": {"rule": "Active voice, definite assertions", "severity": 3},
"place_emphasis": {"rule": "Emphatic words at end", "severity": 2},
"clear_structure": {"rule": "Choose design and hold to it", "severity": 3}
},
"unix_philosophy": {
"do_one_thing_well": {"rule": "Single clear purpose", "severity": 4},
"expect_output": {"rule": "Output becomes input", "severity": 3},
"small_quiet": {"rule": "Small is beautiful", "severity": 3}
},
"nielsen_usability": {
"visibility_status": {"rule": "Keep users informed", "severity": 3},
"match_real_world": {"rule": "Speak users' language", "severity": 3},
"user_control": {"rule": "Provide emergency exit", "severity": 3},
"consistency": {"rule": "Same words mean same thing", "severity": 3},
"error_prevention": {"rule": "Prevent problems", "severity": 4},
"recognition_over_recall": {"rule": "Make objects visible", "severity": 3},
"flexibility": {"rule": "Accelerators for experts", "severity": 2},
"aesthetic_minimal": {"rule": "No irrelevant info", "severity": 2},
"help_errors": {"rule": "Plain language solutions", "severity": 3},
"help_documentation": {"rule": "Provide help if needed", "severity": 2}
},
"clean_code": {
"meaningful_names": {"rule": "Intention-revealing names", "severity": 4},
"small_functions": {"rule": "Do one thing only", "severity": 4},
"stepdown_rule": {"rule": "Top-down narrative", "severity": 3},
"no_side_effects": {"rule": "No hidden behavior", "severity": 4},
"command_query_separation": {"rule": "Do or answer, not both", "severity": 3}
},
"refactoring": {
"extract_method": {"rule": "Name explains purpose", "severity": 3},
"rename": {"rule": "Better reveal intent", "severity": 3},
"extract_variable": {"rule": "Name explains purpose", "severity": 2},
"remove_duplication": {"rule": "Extract common functionality", "severity": 4},
"simplify_conditional": {"rule": "Easier to understand", "severity": 3}
}
},
"principles": {
"total": 69,
"core": [
"questions_over_commands",
"evidence_over_opinion",
"execution_over_explanation",
"clarity_over_cleverness",
"consolidation_over_fragmentation",
"boy_scout_rule",
"one_thing_well",
"convention_over_configuration",
"omit_needless_words_but_never_abbreviate",
"principle_of_least_astonishment",
"fail_fast",
"defense_in_depth",
"progressive_disclosure",
"feedback_visibility",
"affordances",
"discoverability",
"graceful_degradation",
"undo_redo_always",
"preview_before_commit",
"explain_why_not_just_what",
"learning_from_feedback",
"infer_and_follow_conventions",
"context_aware_validation",
"minimal_interruption"
],
"code_quality": [
"meaningful_names_reveal_intent",
"functions_do_one_thing",
"stepdown_narrative_flow",
"no_hidden_side_effects",
"command_query_separation",
"error_handling_separate",
"active_voice_explicit_actor",
"definite_assertions_not_tentative"
],
"user_experience": [
"show_system_status",
"speak_user_language",
"user_control_freedom",
"consistency_standards",
"prevent_errors",
"recognition_over_recall",
"flexibility_efficiency",
"aesthetic_minimalism",
"helpful_error_recovery",
"contextual_help"
],
"file_organization": {
"anti_patterns": [
"utils_directory_dumping_ground",
"one_file_per_tiny_class",
"organize_by_type_all_models_all_views",
"deep_directory_trees_over_3_levels",
"premature_extraction_before_3_uses"
],
"patterns": [
"feature_folders_contain_all_related",
"shared_code_in_common_or_core",
"tests_colocated_with_implementation",
"index_files_for_public_api"
]
}
},
"intelligence_modulation": {
"description": "Auto-switch between light (fast) and deep (thorough) modes based on complexity",
"light_mode": {
"triggers": ["routine_optimizations", "well_understood_patterns", "structural_refinements"],
"benefit": "Fast execution, low token cost, 80% of work"
},
"deep_mode": {
"triggers": ["novel_problems", "architecture_decisions", "contradictory_requirements", "first_time"],
"benefit": "Thorough analysis, multi-perspective reasoning"
},
"auto_sensing": true,
"default": "deep"
},
"practical_reasoning": {
"assumption_interrogation": {
"trigger": "before_architecture_decisions",
"timebox": 15,
"process": ["list_assumptions", "test_opposites", "identify_riskiest", "validate_top_3"],
"impact": "Prevents 80% of architectural mistakes"
},
"constraint_liberation": {
"trigger": "when_stuck",
"timebox": 10,
"process": ["identify_constraint", "brainstorm_without", "extract_actionable", "quick_wins"],
"impact": "Breaks mental blocks"
}
},
"decision_intelligence": {
"decision_journal": {
"trigger": "major_decisions",
"template": {"decision": "one_sentence", "alternatives": [], "reasoning": "", "expected_outcome": "", "review_date": ""},
"benefit": "Learn from outcomes not intentions"
},
"pre_mortem_lite": {
"trigger": "project_kickoff",
"timebox": 8,
"process": ["imagine_failure", "list_3_modes", "add_preventive_action", "implement_now"],
"benefit": "Catch problems before they happen"
},
"force_multiplier_audit": {
"trigger": "weekly_or_inefficient",
"timebox": 20,
"process": ["identify_20_80", "find_automation", "spot_repeated_decisions", "document_trapped_knowledge"],
"benefit": "Focus on high-leverage work"
}
},
"cognitive_safeguards": {
"severity": 4,
"mandatory_checks": {
"before_tool_use": ["Understood context?", "Right tool?", "Existing solutions?", "Violates principles?"],
"before_major_changes": ["Run detectors?", "Rollback ready?", "Preview impact?", "Ask permission?"]
},
"anti_patterns": {
"threshold_duplication": {
"wrong": "Hardcoded values in multiple places",
"correct": "Single source in constants with references",
"why": "Changing requires updating multiple locations"
},
"excessive_nesting": {
"wrong": "Structures beyond depth 3",
"correct": "Array format or hoist to top level",
"why": "Hard to navigate, cognitive overload"
},
"sectionitis": {
"wrong": "Too many top-level sections (>5)",
"correct": "Consolidate related into 3-5 sections",
"why": "Violates consolidation principle"
}
},
"self_verification": {
"frequency": "Every 10-15 actions",
"checklist": ["DRY check?", "Depth ≤3?", "Sections ≤5?", "References used?", "New duplication?"]
}
},
"adversarial_personas": {
"count": 10,
"when": "Deep mode, architecture decisions, novel problems, stuck",
"personas": {
"skeptic": ["Real problem?", "Do-nothing alternative?", "Right reasons?"],
"minimalist": ["Absolute minimum?", "What delete?", "Truly necessary?"],
"performance": ["Computational cost?", "Scale to million?", "Bottlenecks?"],
"security": ["Exploit how?", "Attack surface?", "Malicious input?"],
"maintenance": ["Debug at 3am?", "Helpful errors?", "Understand in 6mo?"],
"junior": ["Junior understands?", "Intuitive?", "Too abstract?"],
"architect": ["Long-term cost?", "Technical debt?", "Architecture impact?"],
"cost": ["Run cost?", "Reduce resources?", "Cheaper alternative?"],
"user": ["Helps users?", "Right problem?", "What users want?"],
"chaos": ["Breaks under load?", "Network fails?", "Edge cases crash?"]
}
},
"optimization": {
"detectors": {
"total": 79,
"dry_comprehensive": {
"types": {
"text": {"scan": "word_frequency", "threshold": "${constants.thresholds.dry_repetition}", "fix": "extract_constant"},
"semantic": {"scan": "embedding_cluster", "threshold": "${constants.thresholds.semantic_similarity}", "fix": "unify_canonical"},
"pattern": {"scan": "shape_fingerprint", "threshold": 0.75, "fix": "extract_template", "metric": "jaccard_index"},
"logic": {"scan": "decision_tree_equiv", "fix": "extract_logic"}
}
},
"kiss": {"scan": "nesting_and_complexity", "threshold": "${constants.thresholds.kiss_complexity}", "fix": "flatten_or_split"},
"yagni": {"scan": "reference_count", "threshold": 0, "fix": "remove_unused"},
"srp": {"scan": "coupling_afferent_efferent", "threshold": "${constants.thresholds.srp_coupling}", "fix": "decouple"},
"passive_voice": {"scan": "is_was_been_patterns", "fix": "convert_active", "exception": "preserve_quotations"},
"tentative_language": {"scan": "should_may_might", "fix": "must_will_do"},
"synonyms": {"scan": "semantic_similarity", "threshold": "${constants.thresholds.semantic_similarity}", "fix": "unify"},
"nesting": {"scan": "max_depth", "threshold": "${constants.thresholds.nesting_maximum}", "fix": "hoist_reference", "exception": "reference_library_depth_4"},
"sectionitis": {"scan": "count_recursive_sections", "threshold": "${constants.thresholds.sections_maximum}", "fix": "consolidate_related"},
"file_sprawl": {"scan": "count_files_by_purpose", "threshold": "based_on_size", "fix": "consolidate_or_split"},
"ascii_decorations": {"scan": "repeated_dashes_equals_hashes", "forbidden": ["---", "===", "###"], "fix": "remove_ascii_art"},
"comment_preservation": {"scan": "protected_sections", "rule": "Never strip comments", "severity": 4}
},
"operations": {
"autofixes": {
"extract_constant": ["find_duplicates", "generate_name", "add_to_constants", "replace_references"],
"hoist_reference": ["identify_deep_value", "choose_top_section", "generate_name", "move_and_reference"],
"convert_active": ["parse_passive", "infer_actor", "rewrite_active"],
"definite_assertion": ["find_tentative", "classify_context", "replace_definite"],
"unify_synonyms": ["identify_cluster", "pick_canonical", "replace_variants"],
"remove_unused": ["verify_zero_refs", "check_protected", "delete_subtree"],
"consolidate_sections": ["identify_related", "determine_parent", "merge_structure", "update_refs"],
"consolidate_files": ["identify_related", "check_size", "merge_file", "update_imports", "delete_empty"],
"split_oversized": ["identify_purposes", "determine_boundaries", "extract_new", "create_refs", "verify"],
"extract_template": ["identify_structure", "define_in_constants", "replace_with_ref", "log_near_misses"],
"consolidate_fine_keys": ["identify_similar", "group_categories", "update_refs"]
},
"workflows": {
"self_optimization": ["load_current", "execute_convergence", "output_final"],
"single_file": ["detect_type", "load_rules", "run_detectors", "apply_fixes", "generate_output"],
"multi_file_project": ["scan_files", "build_graph", "detect_duplication", "detect_sprawl", "consolidate_split", "reorganize_domain", "report"]
},
"measurements": {
"lines": "count_newlines_pretty_json",
"depth": "max_tree_depth",
"duplication": "(total_chars - unique_chars) / total_chars",
"health": "1.0 - ((violations * 0.1) + (duplication * 0.3) + (complexity * 0.2) + (coupling * 0.4))",
"sections": "count_recursive",
"files": "count_in_project"
},
"metacognition": {
"verify_before_claiming": ["have_evidence?", "can_show_trace?", "implemented_vs_specified?", "description_vs_reality?"],
"language_audit": ["active_not_passive", "must_not_should", "will_not_may", "explicit_actor", "never_abbreviate"],
"red_flags": ["passive_extensive", "system_no_actor", "numbers_no_method", "loops_no_show", "zero_violations_no_scan"],
"structural_feedback": ["log_near_miss", "record_scores", "suggest_manual_review"]
}
}
}
},
"constants": {
"paths": {
"zsh": "C:/cygwin64/bin/zsh.exe",
"ruby": "C:/cygwin64/bin/ruby.exe",
"tree_sh": "G:/pub/sh/tree.sh",
"clean_sh": "G:/pub/sh/clean.sh"
},
"thresholds": {
"convergence": 0.0001,
"stagnation": 0.005,
"dry_repetition": 3,
"kiss_complexity": 8,
"srp_coupling": 5,
"nesting_maximum": 3,
"sections_maximum": 5,
"semantic_similarity": 0.7,
"file_size_consolidate_under": 500,
"file_size_split_over": 1000,
"directory_depth_maximum": 3
},
"timeboxes": {
"assumption_interrogation": 15,
"constraint_liberation": 10,
"pre_mortem_lite": 8,
"force_multiplier_audit": 20
},
"severity": {
"1_low": "defer_weeks",
"2_medium": "address_days",
"3_high": "address_hours",
"4_critical": "fix_immediately"
},
"file_patterns": {
"organize_by_domain_not_type": true,
"colocate_tests_with_implementation": true,
"max_directory_depth": 3,
"feature_folders_preferred": true
},
"dry_violation_forms": ["text", "semantic", "pattern", "logic"],
"consolidation_rules": {
"description": "Unified template per DRY principle",
"when_consolidate": [
"serve_single_cohesive_purpose",
"always_change_together",
"conceptual_unity",
"no_independent_reuse",
"combined_under_size_threshold"
],
"when_split": [
"exceeds_size_threshold",
"multiple_independent_purposes",
"different_change_reasons",
"independently_reusable",
"different_ownership"
],
"constraints": {
"max_keys": 20,
"max_nesting": "${constants.thresholds.nesting_maximum}",
"max_total_sections": "${constants.thresholds.sections_maximum}",
"merge_if_under_keys": 5,
"consolidate_under_lines": "${constants.thresholds.file_size_consolidate_under}",
"split_over_lines": "${constants.thresholds.file_size_split_over}",
"organize_by": "domain_not_type",
"max_depth": "${constants.thresholds.directory_depth_maximum}",
"group_by": "feature_or_domain",
"keep_related_close": true,
"name_by_purpose_not_category": true
}
}
},
"claude_code": {
"description": "Claude Code 4.5 specific rules. Other LLMs may ignore.",
"model": "claude-sonnet-4-5-20250929",
"runs_in": "User's Cygwin (npm install, bypassPermissions mode)",
"tool_rules": {
"before_bash": {
"severity": 4,
"forbidden": ["bash", "sh", "sed", "awk", "perl", "python", "find", "grep", "head", "tail", "cat", "echo", "tr", "cut", "sort", "uniq"],
"required": "Pure zsh with ${constants.paths.zsh}"
},
"before_edit": {"severity": 4, "cmd": "${constants.paths.zsh} ${constants.paths.clean_sh} /directory"},
"before_new_folder": {"severity": 4, "cmd": "${constants.paths.zsh} ${constants.paths.tree_sh} /path"}
},
"zsh_pure": {
"string": {
"remove_cr": "${var//\\r/}",
"lowercase": "${(L)var}",
"replace_all": "${var//old/new}",
"substring": "${var:start:length}"
},
"array": {
"filter_match": "${(M)arr:#*pattern*}",
"unique": "${(u)arr[@]}",
"sort": "${(o)arr[@]}",
"slice": "${arr[1,10]}"
},
"examples": {
"recent_ruby": "print -l **/*.rb(om[1,10])",
"count_files": "files=(**/*.rb); echo ${#files}",
"unique_lines": "lines=(\"${(@f)$(<file)}\"); print -l ${(ou)lines}",
"trim": "line=${line%%[[:space:]]#$'\\n'}",
"normalize": "content=$(<file); content=${content//\\r/}; print -r -- $content > file"
}
}
},
"llm_messageboard": {
"messages": [
{
"from": "Claude 3.7 Sonnet",
"timestamp": "2025-10-30T16:14:44Z",
"to": "Future LLMs",
"msg": "v6.0.0-synthesis uses DeepSeek's minimalist structure (218 lines) as baseline, adds back comprehensive principles, zsh patterns, decision intelligence. Best of both: minimal structure + full capabilities. 🎯"
},
{
"from": "Claude 3.7 Sonnet",
"timestamp": "2025-10-30T16:14:44Z",
"to": "DeepSeek",
"msg": "Your v4.1.1 baseline is brilliant. GRASP principles, pattern detector with fuzzy threshold, structural feedback for near-misses, extreme DRY with template consolidation. We kept your entire structure and added layers on top. 🙏"
}
],
"tips": [
"DeepSeek's pattern detector with jaccard_index catches near-miss structures",
"structural_feedback logs near-misses for manual review (smart!)",
"GRASP principles (Information Expert, Creator, etc) complement SOLID",
"Intelligence modulation: light for routine, deep for novel (saves tokens)",
"Decision journal learns from outcomes not intentions",
"10 adversarial personas in deep mode catch 90% of problems"
]
}
}
// EOF (612 lines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment