router.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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
  44. dir="$(pwd)"
  45. while [ "$dir" != "/" ]; do
  46. if [ -d "$dir/.git" ] || [ -f "$dir/package.json" ]; then
  47. echo "$dir"
  48. return 0
  49. fi
  50. dir="$(dirname "$dir")"
  51. done
  52. pwd
  53. }
  54. PROJECT_ROOT="$(find_project_root)"
  55. # Route commands
  56. case "$1" in
  57. create|get-context|add-output|show)
  58. cd "$PROJECT_ROOT" && npx ts-node "$SCRIPT_DIR/scripts/context-index.ts" "$@"
  59. ;;
  60. session-create|session-load|session-summary)
  61. cd "$PROJECT_ROOT" && npx ts-node "$SCRIPT_DIR/scripts/session-context-manager.ts" "$@"
  62. ;;
  63. stage-*)
  64. cd "$PROJECT_ROOT" && npx ts-node "$SCRIPT_DIR/scripts/stage-cli.ts" "$@"
  65. ;;
  66. *)
  67. echo "Unknown command: $1"
  68. show_help
  69. exit 1
  70. ;;
  71. esac