Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

Missing References - SKILL-STRUCTURE-AND-ROUTING and skill-workflow-notification

Open 1activegeek opened this issue 11 months ago • 2 comments

Reference: ${PAI_DIR}/skills/CORE/SKILL-STRUCTURE-AND-ROUTING.md from CONSTITUTION (a dozen lines down at bottom of the section) I've seen this file mentioned but I'm not finding this file in the repo. Searched the code, but I'm not finding this file anywhere.

${PAI_DIR}/tools/skill-workflow-notification WorkflowName CORE And additionally in the CORE SKILL file there is mention of a notification tool, that doesn't seem to exist?

1activegeek avatar Dec 15 '25 11:12 1activegeek

Fixed in commit f8a04c3!

Summary

Both missing references have been resolved:

1. SKILL-STRUCTURE-AND-ROUTING.md → SkillSystem.md

The file SKILL-STRUCTURE-AND-ROUTING.md never existed - SkillSystem.md is the canonical skill structure document.

Updated 4 references:

  • .claude/Skills/CORE/CONSTITUTION.md (3 instances)
  • .claude/Skills/BrightData/SKILL.md (1 instance)

All now correctly point to SkillSystem.md.

2. skill-workflow-notification → SkillWorkflowNotification

The script exists in Kai but was missing from the PAI template repository.

Fixed by:

  • Copied SkillWorkflowNotification from Kai to PAI's .claude/Tools/
  • Updated references in SKILL.md and SkillSystem.md
  • Fixed path casing: tools/ → Tools/ (proper Title Case)
  • Enhanced workflow routing instructions with dual notification pattern:
    1. Call notification script for observability tracking
    2. Output text notification for user visibility

The script is now available in PAI and properly documented.

danielmiessler avatar Dec 20 '25 12:12 danielmiessler

Fix Verification & Root Cause Analysis

Status: ✅ VERIFIED - Issue is fully resolved in commit f8a04c3

Root Causes Identified

Root Cause 1: Broken File Reference

  • Problem: Documentation referenced non-existent file SKILL-STRUCTURE-AND-ROUTING.md
  • Impact: Users following docs would get file-not-found errors when looking for skill structure guidance
  • Files affected:
    • .claude/Skills/CORE/CONSTITUTION.md (3 references)
    • .claude/Skills/BrightData/SKILL.md (1 reference)
  • Solution: Renamed reference to canonical file SkillSystem.md (which exists)

Root Cause 2: Missing Executable Script

  • Problem: Workflow routing instructions referenced ${PAI_DIR}/tools/skill-workflow-notification but script didn't exist
  • Impact:
    • Workflows couldn't emit observability signals
    • Dashboard couldn't detect workflow activations
    • Users get "command not found" errors when trying to use PAI slash commands
  • Files affected:
    • .claude/Skills/CORE/SKILL.md (path & instructions)
    • .claude/Skills/CORE/SkillSystem.md (path & instructions)
  • Solution: Added missing script to .claude/Tools/SkillWorkflowNotification with proper shebang and documentation

Why This Was Breaking PAI Slash Commands

The skill system routing mechanism depends on this workflow notification pattern:

  1. Skill invokes a workflow
  2. Workflow calls ~/.claude/Tools/SkillWorkflowNotification WORKFLOWNAME SKILLNAME
  3. Notification script outputs signal for observability system
  4. System recognizes workflow activation and routes correctly

Without the script: Workflows fail to notify → routing breaks → slash commands don't execute

Fix Details (Commit f8a04c3)

Path corrections:

  • ${PAI_DIR}/tools/ → ~/.claude/Tools/ (proper Title Case alignment)
  • SKILL-STRUCTURE-AND-ROUTING.md → SkillSystem.md

Dual notification pattern introduced:

# 1. Call notification script for observability
~/.claude/Tools/SkillWorkflowNotification WORKFLOWNAME SKILLNAME

# 2. Output text notification for user visibility
echo "Running the **WorkflowName** workflow..."

Verification Steps

To verify the fix is working:

# 1. Check that the script exists
ls -la ~/.claude/Tools/SkillWorkflowNotification

# 2. Test it directly
~/.claude/Tools/SkillWorkflowNotification TestWorkflow TestSkill

# 3. Verify all doc references are correct
grep -r "SKILL-STRUCTURE-AND-ROUTING" ~/.claude/Skills/
# Should return 0 results

# 4. Test a PAI slash command (e.g., /paiupdate)
/paiupdate
# Should execute successfully

Lessons Learned

This bug illustrates three important patterns:

  1. Documentation references must point to real files - Consider a pre-commit check for reference validity
  2. Scripts referenced in docs must exist - Consider shipping all referenced tooling
  3. Path case sensitivity matters - Title Case conventions (Tools/ not tools/) should be enforced

Contribution by: PAI community member (verified on main branch, commit f8a04c3)

fayerman-source avatar Dec 29 '25 14:12 fayerman-source