@@ -4638,6 +4638,252 @@ ${FLOW_COLORS[bold]}LEARN MORE${FLOW_COLORS[reset]}
46384638EOF
46394639}
46404640
4641+ # =============================================================================
4642+ # TEACHING STYLE COMMANDS (v6.3.0 - Teaching Style Consolidation)
4643+ # =============================================================================
4644+
4645+ _teach_style () {
4646+ local subcmd=" ${1:- show} "
4647+ shift 2> /dev/null
4648+
4649+ case " $subcmd " in
4650+ show|s|" " )
4651+ _teach_style_show " $@ "
4652+ ;;
4653+ check|c)
4654+ _teach_style_check " $@ "
4655+ ;;
4656+ help|--help|-h)
4657+ _teach_style_help
4658+ ;;
4659+ * )
4660+ _teach_error " Unknown style command: $subcmd "
4661+ _teach_style_help
4662+ return 1
4663+ ;;
4664+ esac
4665+ }
4666+
4667+ _teach_style_show () {
4668+ # Color fallbacks
4669+ if [[ -z " $_C_BOLD " ]]; then
4670+ _C_BOLD=' \033[1m'
4671+ _C_DIM=' \033[2m'
4672+ _C_NC=' \033[0m'
4673+ _C_GREEN=' \033[32m'
4674+ _C_YELLOW=' \033[33m'
4675+ _C_CYAN=' \033[36m'
4676+ fi
4677+
4678+ echo " "
4679+ echo -e " ${_C_BOLD} ╭─────────────────────────────────────────────╮${_C_NC} "
4680+ echo -e " ${_C_BOLD} │ 📚 Teaching Style Configuration │${_C_NC} "
4681+ echo -e " ${_C_BOLD} ╰─────────────────────────────────────────────╯${_C_NC} "
4682+ echo " "
4683+
4684+ # Find source
4685+ if ! typeset -f _teach_find_style_source > /dev/null 2>&1 ; then
4686+ echo " ${FLOW_COLORS[error]} ✗${FLOW_COLORS[reset]} Teaching style helpers not loaded"
4687+ return 1
4688+ fi
4689+
4690+ local source
4691+ source=$( _teach_find_style_source " ." 2> /dev/null)
4692+
4693+ if [[ -z " $source " ]]; then
4694+ echo " ${FLOW_COLORS[warning]} ⚠${FLOW_COLORS[reset]} No teaching style configured"
4695+ echo " "
4696+ echo " ${FLOW_COLORS[muted]} Add a teaching_style section to .flow/teach-config.yml${FLOW_COLORS[reset]} "
4697+ echo " ${FLOW_COLORS[muted]} See: docs/reference/REFCARD-TEACH-CONFIG-SCHEMA.md${FLOW_COLORS[reset]} "
4698+ echo " "
4699+ return 0
4700+ fi
4701+
4702+ local path=" ${source%%:* } "
4703+ local type=" ${source##*: } "
4704+
4705+ # Source info
4706+ echo -e " ${_C_BOLD} Source:${_C_NC} $path "
4707+ case " $type " in
4708+ teach-config)
4709+ echo -e " ${_C_BOLD} Type:${_C_NC} ${_C_GREEN} Unified config${_C_NC} (recommended)"
4710+ ;;
4711+ legacy-md)
4712+ if _teach_style_is_redirect " ." ; then
4713+ echo -e " ${_C_BOLD} Type:${_C_NC} ${_C_YELLOW} Redirect shim${_C_NC} → .flow/teach-config.yml"
4714+ else
4715+ echo -e " ${_C_BOLD} Type:${_C_NC} ${_C_YELLOW} Legacy markdown${_C_NC} (consider migrating)"
4716+ fi
4717+ ;;
4718+ esac
4719+ echo " "
4720+
4721+ # Display key settings
4722+ if ! command -v yq & > /dev/null; then
4723+ echo " ${FLOW_COLORS[error]} ✗${FLOW_COLORS[reset]} yq required to display settings"
4724+ return 1
4725+ fi
4726+
4727+ local approach=$( _teach_get_style " pedagogical_approach.primary" 2> /dev/null)
4728+ local formality=$( _teach_get_style " explanation_style.formality" 2> /dev/null)
4729+ local proof_style=$( _teach_get_style " explanation_style.proof_style" 2> /dev/null)
4730+ local code_style=$( _teach_get_style " content_preferences.code_style" 2> /dev/null)
4731+ local tools=$( _teach_get_style " content_preferences.computational_tools" 2> /dev/null)
4732+ local exam_fmt=$( _teach_get_style " assessment_philosophy.exam_format" 2> /dev/null)
4733+
4734+ echo -e " ${_C_BOLD} Key Settings:${_C_NC} "
4735+ [[ -n " $approach " && " $approach " != " null" ]] && echo -e " Approach: ${_C_CYAN} $approach ${_C_NC} "
4736+ [[ -n " $formality " && " $formality " != " null" ]] && echo -e " Formality: ${_C_CYAN} $formality ${_C_NC} "
4737+ [[ -n " $proof_style " && " $proof_style " != " null" ]] && echo -e " Proofs: ${_C_CYAN} $proof_style ${_C_NC} "
4738+ [[ -n " $code_style " && " $code_style " != " null" ]] && echo -e " Code style: ${_C_CYAN} $code_style ${_C_NC} "
4739+ [[ -n " $tools " && " $tools " != " null" ]] && echo -e " Tools: ${_C_CYAN} $tools ${_C_NC} "
4740+ [[ -n " $exam_fmt " && " $exam_fmt " != " null" ]] && echo -e " Exams: ${_C_CYAN} $exam_fmt ${_C_NC} "
4741+ echo " "
4742+
4743+ # Show command overrides summary
4744+ if [[ " $type " == " teach-config" && -f " .flow/teach-config.yml" ]]; then
4745+ local overrides
4746+ overrides=$( yq ' .teaching_style.command_overrides // ""' " .flow/teach-config.yml" 2> /dev/null)
4747+ if [[ -n " $overrides " && " $overrides " != " null" && " $overrides " != " " ]]; then
4748+ local -a cmds
4749+ cmds=($( yq ' .teaching_style.command_overrides | keys | .[]' " .flow/teach-config.yml" 2> /dev/null) )
4750+ if (( ${# cmds} > 0 )) ; then
4751+ echo -e " ${_C_BOLD} Command Overrides:${_C_NC} "
4752+ for cmd in " ${cmds[@]} " ; do
4753+ echo -e " ${_C_CYAN} $cmd ${_C_NC} "
4754+ done
4755+ echo " "
4756+ fi
4757+ fi
4758+ fi
4759+ }
4760+
4761+ _teach_style_check () {
4762+ echo " "
4763+ echo " Running teaching style validation..."
4764+ echo " "
4765+
4766+ if ! typeset -f _teach_find_style_source > /dev/null 2>&1 ; then
4767+ echo " ${FLOW_COLORS[error]} ✗${FLOW_COLORS[reset]} Teaching style helpers not loaded"
4768+ return 1
4769+ fi
4770+
4771+ local -i issues=0
4772+
4773+ # 1. Check source exists
4774+ local source
4775+ source=$( _teach_find_style_source " ." 2> /dev/null)
4776+
4777+ if [[ -z " $source " ]]; then
4778+ echo " ${FLOW_COLORS[warning]} ⚠${FLOW_COLORS[reset]} No teaching style configured"
4779+ (( issues++ ))
4780+ else
4781+ local path=" ${source%%:* } "
4782+ local type=" ${source##*: } "
4783+ echo " ${FLOW_COLORS[success]} ✓${FLOW_COLORS[reset]} Source: $path ($type )"
4784+
4785+ # 2. Check yq can parse it
4786+ if command -v yq & > /dev/null; then
4787+ if [[ " $type " == " teach-config" ]]; then
4788+ if yq ' .teaching_style' " $path " & > /dev/null; then
4789+ echo " ${FLOW_COLORS[success]} ✓${FLOW_COLORS[reset]} YAML syntax valid"
4790+ else
4791+ echo " ${FLOW_COLORS[error]} ✗${FLOW_COLORS[reset]} YAML parse error in teaching_style"
4792+ (( issues++ ))
4793+ fi
4794+ fi
4795+
4796+ # 3. Check required sub-sections
4797+ local approach=$( _teach_get_style " pedagogical_approach" 2> /dev/null)
4798+ if [[ -z " $approach " || " $approach " == " null" ]]; then
4799+ echo " ${FLOW_COLORS[warning]} ⚠${FLOW_COLORS[reset]} Missing: pedagogical_approach"
4800+ (( issues++ ))
4801+ else
4802+ echo " ${FLOW_COLORS[success]} ✓${FLOW_COLORS[reset]} Has pedagogical_approach"
4803+ fi
4804+
4805+ local explanation=$( _teach_get_style " explanation_style" 2> /dev/null)
4806+ if [[ -z " $explanation " || " $explanation " == " null" ]]; then
4807+ echo " ${FLOW_COLORS[warning]} ⚠${FLOW_COLORS[reset]} Missing: explanation_style"
4808+ (( issues++ ))
4809+ else
4810+ echo " ${FLOW_COLORS[success]} ✓${FLOW_COLORS[reset]} Has explanation_style"
4811+ fi
4812+
4813+ local content=$( _teach_get_style " content_preferences" 2> /dev/null)
4814+ if [[ -z " $content " || " $content " == " null" ]]; then
4815+ echo " ${FLOW_COLORS[warning]} ⚠${FLOW_COLORS[reset]} Missing: content_preferences"
4816+ (( issues++ ))
4817+ else
4818+ echo " ${FLOW_COLORS[success]} ✓${FLOW_COLORS[reset]} Has content_preferences"
4819+ fi
4820+ else
4821+ echo " ${FLOW_COLORS[warning]} ⚠${FLOW_COLORS[reset]} yq not installed (brew install yq)"
4822+ (( issues++ ))
4823+ fi
4824+
4825+ # 4. Check redirect shim consistency
4826+ if [[ " $type " == " teach-config" && -f " .claude/teaching-style.local.md" ]]; then
4827+ if _teach_style_is_redirect " ." ; then
4828+ echo " ${FLOW_COLORS[success]} ✓${FLOW_COLORS[reset]} Legacy shim has redirect"
4829+ else
4830+ echo " ${FLOW_COLORS[warning]} ⚠${FLOW_COLORS[reset]} Legacy file exists without redirect"
4831+ (( issues++ ))
4832+ fi
4833+ fi
4834+ fi
4835+
4836+ echo " "
4837+ if (( issues == 0 )) ; then
4838+ echo " ${FLOW_COLORS[success]} ✓ All checks passed${FLOW_COLORS[reset]} "
4839+ else
4840+ echo " ${FLOW_COLORS[warning]} △ $issues issue(s) found${FLOW_COLORS[reset]} "
4841+ fi
4842+ echo " "
4843+
4844+ return $(( issues > 0 ? 1 : 0 ))
4845+ }
4846+
4847+ _teach_style_help () {
4848+ # Color fallbacks
4849+ if [[ -z " $_C_BOLD " ]]; then
4850+ _C_BOLD=' \033[1m'
4851+ _C_DIM=' \033[2m'
4852+ _C_NC=' \033[0m'
4853+ _C_GREEN=' \033[32m'
4854+ _C_YELLOW=' \033[33m'
4855+ _C_CYAN=' \033[36m'
4856+ fi
4857+
4858+ echo -e "
4859+ ${_C_BOLD} ╭─────────────────────────────────────────────╮${_C_NC}
4860+ ${_C_BOLD} │ teach style - Teaching Style Management │${_C_NC}
4861+ ${_C_BOLD} ╰─────────────────────────────────────────────╯${_C_NC}
4862+
4863+ ${_C_GREEN} 🔥 MOST COMMON${_C_NC} :
4864+ ${_C_CYAN} teach style${_C_NC} Show current teaching style
4865+ ${_C_CYAN} teach style check${_C_NC} Validate configuration
4866+
4867+ ${_C_YELLOW} 💡 QUICK EXAMPLES${_C_NC} :
4868+ ${_C_DIM} \$ ${_C_NC} teach style ${_C_DIM} # Display settings${_C_NC}
4869+ ${_C_DIM} \$ ${_C_NC} teach style show ${_C_DIM} # Same as above${_C_NC}
4870+ ${_C_DIM} \$ ${_C_NC} teach style check ${_C_DIM} # Validate config${_C_NC}
4871+
4872+ ${_C_BOLD} SUBCOMMANDS${_C_NC} :
4873+ ${_C_CYAN} show${_C_NC} (default) Display current style source and key settings
4874+ ${_C_CYAN} check${_C_NC} Validate teaching style configuration
4875+
4876+ ${_C_BOLD} RESOLUTION ORDER${_C_NC} :
4877+ 1. .flow/teach-config.yml → teaching_style section (preferred)
4878+ 2. .claude/teaching-style.local.md → YAML frontmatter (legacy)
4879+
4880+ ${_C_YELLOW} 💡 TIP${_C_NC} : Consolidate your teaching style into .flow/teach-config.yml
4881+ for a single source of truth.
4882+
4883+ ${_C_DIM} 📚 See also: teach config, teach doctor${_C_NC}
4884+ "
4885+ }
4886+
46414887_teach_dispatcher_help () {
46424888 # Color fallbacks
46434889 if [[ -z " $_C_BOLD " ]]; then
@@ -4684,6 +4930,7 @@ ${_C_BLUE}📋 SETUP & CONFIGURATION${_C_NC}:
46844930 ${_C_CYAN} teach templates${_C_NC} Template management
46854931 ${_C_CYAN} teach macros${_C_NC} LaTeX macro management
46864932 ${_C_CYAN} teach prompt${_C_NC} AI prompt management
4933+ ${_C_CYAN} teach style${_C_NC} Teaching style management
46874934 ${_C_CYAN} teach migrate-config${_C_NC} Extract lesson plans
46884935
46894936${_C_BLUE} 📋 CONTENT CREATION${_C_NC} ${_C_DIM} (Scholar AI)${_C_NC} :
@@ -4719,7 +4966,7 @@ ${_C_MAGENTA}💡 TIP${_C_NC}: Content generation requires Scholar plugin
47194966 ${_C_DIM} hw=assignment syl=syllabus rb=rubric fb=feedback${_C_NC}
47204967 ${_C_DIM} Quality: val=validate concept=analyze prof=profiles cl=clean${_C_NC}
47214968 ${_C_DIM} Manage: d=deploy s=status w=week bk=backup a=archive${_C_NC}
4722- ${_C_DIM} Tools: pl=plan tmpl=templates m=macros pr=prompt migrate=migrate-config${_C_NC}
4969+ ${_C_DIM} Tools: pl=plan tmpl=templates m=macros pr=prompt st=style migrate=migrate-config${_C_NC}
47234970
47244971${_C_DIM} 📚 See also:${_C_NC}
47254972 ${_C_CYAN} qu${_C_NC} - Quarto commands (qu preview, qu render)
@@ -4977,6 +5224,14 @@ teach() {
49775224 esac
49785225 ;;
49795226
5227+ # Teaching style management (v6.3.0 - Teaching Style Consolidation)
5228+ style|st)
5229+ case " $1 " in
5230+ --help|-h|help) _teach_style_help; return 0 ;;
5231+ * ) _teach_style " $@ " ;;
5232+ esac
5233+ ;;
5234+
49805235 * )
49815236 _teach_error " Unknown command: $cmd "
49825237 echo " "
0 commit comments