@codyswann/lisa 2.138.2 → 2.140.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/core/instruction-files-migration.d.ts +14 -1
  2. package/dist/core/instruction-files-migration.d.ts.map +1 -1
  3. package/dist/core/instruction-files-migration.js +12 -5
  4. package/dist/core/instruction-files-migration.js.map +1 -1
  5. package/dist/core/lisa.d.ts +18 -0
  6. package/dist/core/lisa.d.ts.map +1 -1
  7. package/dist/core/lisa.js +30 -0
  8. package/dist/core/lisa.js.map +1 -1
  9. package/package.json +1 -1
  10. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  11. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  12. package/plugins/lisa/commands/pull-request/review.md +3 -3
  13. package/plugins/lisa/commands/sync-down.md +7 -0
  14. package/plugins/lisa/rules/reference/config-resolution.md +42 -1
  15. package/plugins/lisa/skills/doctor/SKILL.md +15 -0
  16. package/plugins/lisa/skills/drive-pr-to-merge/SKILL.md +126 -0
  17. package/plugins/lisa/skills/drive-pr-to-merge/agents/openai.yaml +4 -0
  18. package/plugins/lisa/skills/git-submit-pr/SKILL.md +1 -7
  19. package/plugins/lisa/skills/implement/SKILL.md +1 -1
  20. package/plugins/lisa/skills/pull-request-review/SKILL.md +64 -48
  21. package/plugins/lisa/skills/pull-request-review/agents/openai.yaml +2 -2
  22. package/plugins/lisa/skills/repair-intake/SKILL.md +11 -4
  23. package/plugins/lisa/skills/sync-down/SKILL.md +137 -0
  24. package/plugins/lisa/skills/sync-down/agents/openai.yaml +4 -0
  25. package/plugins/lisa-agy/commands/pull-request/review.md +3 -3
  26. package/plugins/lisa-agy/commands/sync-down.md +7 -0
  27. package/plugins/lisa-agy/plugin.json +1 -1
  28. package/plugins/lisa-agy/skills/doctor/SKILL.md +15 -0
  29. package/plugins/lisa-agy/skills/drive-pr-to-merge/SKILL.md +126 -0
  30. package/plugins/lisa-agy/skills/git-submit-pr/SKILL.md +1 -7
  31. package/plugins/lisa-agy/skills/implement/SKILL.md +1 -1
  32. package/plugins/lisa-agy/skills/pull-request-review/SKILL.md +64 -48
  33. package/plugins/lisa-agy/skills/repair-intake/SKILL.md +11 -4
  34. package/plugins/lisa-agy/skills/sync-down/SKILL.md +137 -0
  35. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  37. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  38. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  39. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-copilot/commands/pull-request/review.md +3 -3
  42. package/plugins/lisa-copilot/commands/sync-down.md +7 -0
  43. package/plugins/lisa-copilot/rules/reference/config-resolution.md +42 -1
  44. package/plugins/lisa-copilot/skills/doctor/SKILL.md +15 -0
  45. package/plugins/lisa-copilot/skills/drive-pr-to-merge/SKILL.md +126 -0
  46. package/plugins/lisa-copilot/skills/git-submit-pr/SKILL.md +1 -7
  47. package/plugins/lisa-copilot/skills/implement/SKILL.md +1 -1
  48. package/plugins/lisa-copilot/skills/pull-request-review/SKILL.md +64 -48
  49. package/plugins/lisa-copilot/skills/repair-intake/SKILL.md +11 -4
  50. package/plugins/lisa-copilot/skills/sync-down/SKILL.md +137 -0
  51. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-cursor/commands/pull-request/review.md +3 -3
  53. package/plugins/lisa-cursor/commands/sync-down.md +7 -0
  54. package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +42 -1
  55. package/plugins/lisa-cursor/skills/doctor/SKILL.md +15 -0
  56. package/plugins/lisa-cursor/skills/drive-pr-to-merge/SKILL.md +126 -0
  57. package/plugins/lisa-cursor/skills/git-submit-pr/SKILL.md +1 -7
  58. package/plugins/lisa-cursor/skills/implement/SKILL.md +1 -1
  59. package/plugins/lisa-cursor/skills/pull-request-review/SKILL.md +64 -48
  60. package/plugins/lisa-cursor/skills/repair-intake/SKILL.md +11 -4
  61. package/plugins/lisa-cursor/skills/sync-down/SKILL.md +137 -0
  62. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  64. package/plugins/lisa-expo-agy/plugin.json +1 -1
  65. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  68. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  69. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  70. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  71. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  73. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  74. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  75. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  76. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  79. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  80. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  81. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  82. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  84. package/plugins/lisa-rails-agy/plugin.json +1 -1
  85. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  87. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  88. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  89. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  90. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  91. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  92. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  93. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  94. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  95. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  96. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  97. package/plugins/src/base/commands/pull-request/review.md +3 -3
  98. package/plugins/src/base/commands/sync-down.md +7 -0
  99. package/plugins/src/base/rules/reference/config-resolution.md +42 -1
  100. package/plugins/src/base/skills/doctor/SKILL.md +15 -0
  101. package/plugins/src/base/skills/drive-pr-to-merge/SKILL.md +126 -0
  102. package/plugins/src/base/skills/git-submit-pr/SKILL.md +1 -7
  103. package/plugins/src/base/skills/implement/SKILL.md +1 -1
  104. package/plugins/src/base/skills/pull-request-review/SKILL.md +64 -48
  105. package/plugins/src/base/skills/repair-intake/SKILL.md +11 -4
  106. package/plugins/src/base/skills/sync-down/SKILL.md +137 -0
  107. package/rails/create-only/.github/workflows/claude-sync-down-branches.yml +16 -8
  108. package/scripts/migrate-deploy-order.sh +159 -0
  109. package/typescript/create-only/.github/workflows/claude-sync-down-branches.yml +16 -8
@@ -0,0 +1,159 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # migrate-deploy-order.sh — backfill `deploy.order` into workspace projects and,
4
+ # where provably safe, switch their back-sync wrapper from a hardcoded `chain`
5
+ # to the config-derived one.
6
+ #
7
+ # Context: `reusable-claude-sync-down-branches.yml` now derives its source->target
8
+ # chain from `.lisa.config.json` `deploy.order` + `deploy.branches`. An explicit
9
+ # `chain:` in a project's `claude-sync-down-branches.yml` wrapper still overrides
10
+ # the derived value, so this migration is OPT-IN and non-breaking.
11
+ #
12
+ # Per project (read from .lisa.workspaces.json):
13
+ # 1. If no wrapper file → SKIP.
14
+ # 2. If no deploy.branches in config → SKIP (cannot derive; keep explicit chain).
15
+ # 3. If single-env → propose removing the (redundant) wrapper chain ONLY when it
16
+ # derives to the same value; otherwise REVIEW (drift — chain targets envs the
17
+ # config doesn't declare).
18
+ # 4. If multi-env:
19
+ # - Determine deploy.order (existing, or derive conventionally dev<staging<production).
20
+ # - Compute the derived chain.
21
+ # - SAFE → derived chain == current wrapper chain: add deploy.order (if missing)
22
+ # and drop the wrapper `chain:` line. Behavior provably unchanged.
23
+ # - REVIEW → derived chain != wrapper chain, or env rank unknown: report, change nothing.
24
+ #
25
+ # Default mode is DRY RUN. Pass --apply to write changes.
26
+ #
27
+ # Usage:
28
+ # scripts/migrate-deploy-order.sh # dry run, all workspace projects
29
+ # scripts/migrate-deploy-order.sh --apply # write changes
30
+ # scripts/migrate-deploy-order.sh --workspaces /path/to/.lisa.workspaces.json
31
+
32
+ set -euo pipefail
33
+
34
+ APPLY=false
35
+ WS="${HOME}/workspace/lisa/.lisa.workspaces.json"
36
+ while [ $# -gt 0 ]; do
37
+ case "$1" in
38
+ --apply) APPLY=true; shift ;;
39
+ --workspaces) WS="$2"; shift 2 ;;
40
+ *) echo "Unknown arg: $1" >&2; exit 2 ;;
41
+ esac
42
+ done
43
+
44
+ command -v jq >/dev/null || { echo "jq is required" >&2; exit 1; }
45
+ [ -f "$WS" ] || { echo "Workspaces file not found: $WS" >&2; exit 1; }
46
+
47
+ # Conventional env rank (low -> high). Unknown env names => REVIEW.
48
+ env_rank() {
49
+ case "$1" in
50
+ dev|develop|development) echo 10 ;;
51
+ qa|test) echo 20 ;;
52
+ staging|stage|stg) echo 30 ;;
53
+ preprod|preproduction|uat) echo 40 ;;
54
+ prod|production|prd) echo 50 ;;
55
+ *) echo "" ;;
56
+ esac
57
+ }
58
+
59
+ # Derive deploy.order (JSON array, low->high) from deploy.branches keys by rank.
60
+ # Echoes the array on success, or "ERR_UNKNOWN:<env>" if a key has no known rank.
61
+ derive_order() {
62
+ local cfg="$1" envs e r pairs
63
+ envs=$(jq -r '(.deploy.branches // {}) | keys[]' "$cfg")
64
+ pairs=""
65
+ while IFS= read -r e; do
66
+ [ -z "$e" ] && continue
67
+ r=$(env_rank "$e")
68
+ [ -z "$r" ] && { echo "ERR_UNKNOWN:$e"; return 0; }
69
+ pairs+="$r $e"$'\n'
70
+ done <<< "$envs"
71
+ printf '%s' "$pairs" | sort -n | awk '{print $2}' | jq -R . | jq -sc .
72
+ }
73
+
74
+ # Compute derived chain JSON from a config that already has branches+order.
75
+ derive_chain() {
76
+ jq -e -r '
77
+ (.deploy.branches // {}) as $b | (.deploy.order // []) as $o
78
+ | ($b|keys|sort) as $bk | ($o|sort) as $ok
79
+ | if ($b|length)<=1 then "{}" elif ($o|length)==0 then "ERR_NO_ORDER"
80
+ elif ($bk!=$ok) then "ERR_MISMATCH"
81
+ else ($o|reverse) as $hl
82
+ | [ range(0;($hl|length)-1) | {($b[$hl[.]]):$b[$hl[.+1]]} ] | add | tojson end
83
+ ' "$1" 2>/dev/null || echo "ERR_PARSE"
84
+ }
85
+
86
+ # Extract the explicit chain JSON from a wrapper file, or empty string if none.
87
+ wrapper_chain() {
88
+ grep -oE "chain:[[:space:]]*'[^']*'" "$1" 2>/dev/null | head -1 | sed -E "s/chain:[[:space:]]*'(.*)'/\1/" || true
89
+ }
90
+
91
+ SAFE=0; REVIEW=0; SKIP=0
92
+ echo "Mode: $([ "$APPLY" = true ] && echo APPLY || echo DRY-RUN)"
93
+ echo "Workspaces: $WS"
94
+ echo
95
+
96
+ while IFS= read -r proj; do
97
+ dir="${proj/#\~/$HOME}"
98
+ cfg="$dir/.lisa.config.json"
99
+ wrap="$dir/.github/workflows/claude-sync-down-branches.yml"
100
+
101
+ [ -f "$wrap" ] || { printf "SKIP %-45s (no wrapper)\n" "$proj"; SKIP=$((SKIP+1)); continue; }
102
+ [ -f "$cfg" ] || { printf "SKIP %-45s (no .lisa.config.json — keep explicit chain)\n" "$proj"; SKIP=$((SKIP+1)); continue; }
103
+
104
+ nb=$(jq -r '(.deploy.branches // {}) | length' "$cfg" 2>/dev/null || echo 0)
105
+ [ "$nb" -ge 1 ] 2>/dev/null || { printf "SKIP %-45s (no deploy.branches — keep explicit chain)\n" "$proj"; SKIP=$((SKIP+1)); continue; }
106
+
107
+ cur_chain=$(wrapper_chain "$wrap")
108
+ has_order=$(jq -r 'has("deploy") and (.deploy|has("order"))' "$cfg" 2>/dev/null || echo false)
109
+
110
+ if [ "$has_order" = "true" ]; then
111
+ order_json=$(jq -c '.deploy.order' "$cfg")
112
+ else
113
+ order_json=$(derive_order "$cfg")
114
+ if [[ "$order_json" == ERR_UNKNOWN:* ]]; then
115
+ printf "REVIEW %-45s (unknown env name '%s' — set deploy.order manually)\n" "$proj" "${order_json#ERR_UNKNOWN:}"
116
+ REVIEW=$((REVIEW+1)); continue
117
+ fi
118
+ fi
119
+
120
+ # Compute derived chain against a config that has both branches and the order.
121
+ tmp=$(mktemp)
122
+ jq --argjson o "$order_json" '.deploy.order = $o' "$cfg" > "$tmp"
123
+ derived=$(derive_chain "$tmp")
124
+
125
+ case "$derived" in
126
+ ERR_*) printf "REVIEW %-45s (%s computing chain)\n" "$proj" "$derived"; REVIEW=$((REVIEW+1)); rm -f "$tmp"; continue ;;
127
+ esac
128
+
129
+ # Normalise both chains for comparison (sorted keys).
130
+ norm() { echo "$1" | jq -cS . 2>/dev/null || echo "$1"; }
131
+ d_norm=$(norm "$derived"); c_norm=$([ -n "$cur_chain" ] && norm "$cur_chain" || echo '""')
132
+
133
+ if [ -z "$cur_chain" ]; then
134
+ # No explicit wrapper chain already → just ensure deploy.order is present.
135
+ if [ "$has_order" = "true" ]; then
136
+ printf "SKIP %-45s (already config-driven, deploy.order set)\n" "$proj"; SKIP=$((SKIP+1))
137
+ else
138
+ printf "SAFE %-45s add deploy.order=%s (wrapper already chain-less)\n" "$proj" "$order_json"
139
+ SAFE=$((SAFE+1))
140
+ if [ "$APPLY" = true ]; then mv "$tmp" "$cfg"; tmp=""; fi
141
+ fi
142
+ elif [ "$d_norm" = "$c_norm" ]; then
143
+ printf "SAFE %-45s derived==wrapper (%s); add order + drop wrapper chain\n" "$proj" "$derived"
144
+ SAFE=$((SAFE+1))
145
+ if [ "$APPLY" = true ]; then
146
+ [ "$has_order" = "true" ] || { mv "$tmp" "$cfg"; tmp=""; }
147
+ # Drop the `chain:` line and the now-orphaned `with:` if it becomes empty.
148
+ perl -0pi -e 's/^[[:space:]]*with:\n[[:space:]]*chain:[[:space:]]*'"'"'[^'"'"']*'"'"'\n//m; s/^[[:space:]]*chain:[[:space:]]*'"'"'[^'"'"']*'"'"'\n//m;' "$wrap"
149
+ fi
150
+ else
151
+ printf "REVIEW %-45s derived=%s != wrapper=%s\n" "$proj" "$derived" "$cur_chain"
152
+ REVIEW=$((REVIEW+1))
153
+ fi
154
+ [ -n "${tmp:-}" ] && rm -f "$tmp" || true
155
+ done < <(jq -r 'keys[]' "$WS")
156
+
157
+ echo
158
+ echo "Summary: SAFE=$SAFE REVIEW=$REVIEW SKIP=$SKIP"
159
+ [ "$APPLY" = false ] && echo "(dry run — re-run with --apply to write)"
@@ -5,13 +5,23 @@
5
5
  # Example: PR merged to main -> opens a sync PR to staging.
6
6
  # PR merged to staging -> opens a sync PR to dev.
7
7
  #
8
+ # The source -> target chain is DERIVED from .lisa.config.json:
9
+ # "deploy": {
10
+ # "branches": { "dev": "dev", "staging": "staging", "production": "main" },
11
+ # "order": ["dev", "staging", "production"] // low env -> high env
12
+ # }
13
+ # The reusable workflow walks deploy.order from the highest environment down,
14
+ # mapping each env's branch to the next-lower env's branch. The example above
15
+ # yields main -> staging and staging -> dev. Single-environment projects (one
16
+ # entry in deploy.branches) produce an empty chain and the workflow no-ops.
17
+ #
8
18
  # Customize for your project:
9
- # - `branches`: list each branch that should *trigger* a back-sync
10
- # (typically the keys of `chain` below).
11
- # - `chain`: JSON map of source -> target. Examples:
12
- # 3-env: '{"main":"staging","staging":"dev"}'
13
- # 2-env main/staging: '{"main":"staging"}'
14
- # 2-env master/preprod: '{"master":"preprod"}'
19
+ # - `branches` (the trigger filter below): list each branch whose merged PRs
20
+ # should *trigger* a back-sync i.e. every non-lowest branch in deploy.order.
21
+ # - To override the derived chain, pass it explicitly:
22
+ # with:
23
+ # chain: '{"main":"staging","staging":"dev"}'
24
+ # An explicit `chain` always wins over the config-derived one.
15
25
 
16
26
  name: Claude Sync Down Branches
17
27
 
@@ -31,7 +41,5 @@ jobs:
31
41
  sync:
32
42
  if: github.event.pull_request.merged == true
33
43
  uses: CodySwannGT/lisa/.github/workflows/reusable-claude-sync-down-branches.yml@main
34
- with:
35
- chain: '{"main":"staging","staging":"dev"}'
36
44
  secrets:
37
45
  CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}