router.sh 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #!/usr/bin/env bash
  2. # Project Orchestration Skill Router
  3. set -e
  4. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  5. show_help() {
  6. cat << 'HELP'
  7. 📋 Project Orchestration Skill
  8. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  9. Orchestrate multi-agent workflows for feature development
  10. CONTEXT MANAGEMENT:
  11. create <feature> Create context index
  12. get-context <feature> <agent> Get minimal context for agent
  13. add-output <feature> <agent> <path> Track agent output
  14. show <feature> Show full context index
  15. SESSION MANAGEMENT:
  16. session-create <feature> <request> Create session context
  17. session-load <sessionId> Load session context
  18. session-summary <sessionId> Get session summary
  19. STAGE MANAGEMENT:
  20. stage-init <feature> Initialize 8-stage workflow
  21. stage-status <feature> Show stage progress
  22. stage-complete <feature> <stage> Mark stage complete
  23. stage-rollback <feature> <stage> Rollback stage
  24. stage-validate <feature> <stage> Validate stage
  25. stage-abort <feature> Abort workflow
  26. EXAMPLES:
  27. ./router.sh create auth-system
  28. ./router.sh get-context auth-system StoryMapper
  29. ./router.sh stage-init auth-system
  30. ./router.sh stage-status auth-system
  31. For detailed guides, see:
  32. workflows/context-handoff.md
  33. workflows/8-stage-delivery.md
  34. workflows/planning-agents.md
  35. HELP
  36. }
  37. if [ "$1" = "help" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ $# -eq 0 ]; then
  38. show_help
  39. exit 0
  40. fi
  41. # Find project root
  42. find_project_root() {
  43. local dir="$(pwd)"
  44. while [ "$dir" != "/" ]; do
  45. if [ -d "$dir/.git" ] || [ -f "$dir/package.json" ]; then
  46. echo "$dir"
  47. return 0
  48. fi
  49. dir="$(dirname "$dir")"
  50. done
  51. pwd
  52. }
  53. PROJECT_ROOT="$(find_project_root)"
  54. # Route commands
  55. case "$1" in
  56. create|get-context|add-output|show)
  57. cd "$PROJECT_ROOT" && npx ts-node "$SCRIPT_DIR/scripts/context-index.ts" "$@"
  58. ;;
  59. session-create|session-load|session-summary)
  60. cd "$PROJECT_ROOT" && npx ts-node "$SCRIPT_DIR/scripts/session-context-manager.ts" "$@"
  61. ;;
  62. stage-*)
  63. cd "$PROJECT_ROOT" && npx ts-node "$SCRIPT_DIR/scripts/stage-cli.ts" "$@"
  64. ;;
  65. *)
  66. echo "Unknown command: $1"
  67. show_help
  68. exit 1
  69. ;;
  70. esac