@codyswann/lisa 2.225.5 → 2.226.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 (90) hide show
  1. package/README.md +7 -0
  2. package/all/create-only/scripts/remote-agent-aws-setup.sh +11 -0
  3. package/package.json +1 -1
  4. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  5. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  6. package/plugins/lisa/.codex-plugin/skills/lisa-analyze-claude-remote/SKILL.md +21 -18
  7. package/plugins/lisa/.codex-plugin/skills/lisa-generate-claude-remote-build-script/SKILL.md +15 -27
  8. package/plugins/lisa/.codex-plugin/skills/lisa-setup-remote-aws/SKILL.md +53 -0
  9. package/plugins/lisa/.codex-plugin/skills/lisa-setup-remote-aws/agents/openai.yaml +4 -0
  10. package/plugins/lisa/commands/setup-remote-aws.md +6 -0
  11. package/plugins/lisa/scripts/install-remote-agent-aws.mjs +248 -0
  12. package/plugins/lisa/scripts/remote-agent-aws-setup.sh +163 -0
  13. package/plugins/lisa/skills/lisa-analyze-claude-remote/SKILL.md +21 -18
  14. package/plugins/lisa/skills/lisa-generate-claude-remote-build-script/SKILL.md +15 -27
  15. package/plugins/lisa/skills/lisa-setup-remote-aws/SKILL.md +53 -0
  16. package/plugins/lisa/skills/lisa-setup-remote-aws/agents/openai.yaml +4 -0
  17. package/plugins/lisa-agy/commands/lisa/setup-remote-aws.md +6 -0
  18. package/plugins/lisa-agy/plugin.json +1 -1
  19. package/plugins/lisa-agy/scripts/install-remote-agent-aws.mjs +248 -0
  20. package/plugins/lisa-agy/scripts/remote-agent-aws-setup.sh +163 -0
  21. package/plugins/lisa-agy/skills/lisa-analyze-claude-remote/SKILL.md +21 -18
  22. package/plugins/lisa-agy/skills/lisa-generate-claude-remote-build-script/SKILL.md +15 -27
  23. package/plugins/lisa-agy/skills/lisa-setup-remote-aws/SKILL.md +53 -0
  24. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  25. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  26. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  27. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  28. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  29. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-copilot/commands/lisa/setup-remote-aws.md +6 -0
  31. package/plugins/lisa-copilot/scripts/install-remote-agent-aws.mjs +248 -0
  32. package/plugins/lisa-copilot/scripts/remote-agent-aws-setup.sh +163 -0
  33. package/plugins/lisa-copilot/skills/lisa-analyze-claude-remote/SKILL.md +21 -18
  34. package/plugins/lisa-copilot/skills/lisa-generate-claude-remote-build-script/SKILL.md +15 -27
  35. package/plugins/lisa-copilot/skills/lisa-setup-remote-aws/SKILL.md +53 -0
  36. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-cursor/commands/lisa/setup-remote-aws.md +6 -0
  38. package/plugins/lisa-cursor/scripts/install-remote-agent-aws.mjs +248 -0
  39. package/plugins/lisa-cursor/scripts/remote-agent-aws-setup.sh +163 -0
  40. package/plugins/lisa-cursor/skills/lisa-analyze-claude-remote/SKILL.md +21 -18
  41. package/plugins/lisa-cursor/skills/lisa-generate-claude-remote-build-script/SKILL.md +15 -27
  42. package/plugins/lisa-cursor/skills/lisa-setup-remote-aws/SKILL.md +53 -0
  43. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  45. package/plugins/lisa-expo-agy/plugin.json +1 -1
  46. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  48. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  49. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  50. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  51. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  53. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  54. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  55. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  56. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  58. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  60. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  61. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  63. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  64. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  65. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  66. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  68. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  69. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  70. package/plugins/lisa-rails-agy/plugin.json +1 -1
  71. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  73. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  74. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  75. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  76. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  77. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  78. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  79. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  80. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  81. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  82. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  83. package/plugins/src/base/commands/setup-remote-aws.md +6 -0
  84. package/plugins/src/base/scripts/install-remote-agent-aws.mjs +248 -0
  85. package/plugins/src/base/scripts/remote-agent-aws-setup.sh +163 -0
  86. package/plugins/src/base/skills/lisa-analyze-claude-remote/SKILL.md +21 -18
  87. package/plugins/src/base/skills/lisa-generate-claude-remote-build-script/SKILL.md +15 -27
  88. package/plugins/src/base/skills/lisa-setup-remote-aws/SKILL.md +53 -0
  89. package/scripts/claude-remote-setup.sh +9 -2
  90. package/scripts/remote-agent-aws-setup.sh +17 -0
@@ -0,0 +1,163 @@
1
+ #!/usr/bin/env bash
2
+ # Vendor-neutral AWS CLI bootstrap for remote coding environments. This is the
3
+ # source copied into every generated Lisa agent plugin.
4
+ #
5
+ # Required secret:
6
+ # LISA_AWS_BOOTSTRAP_JSON Complete SecretString emitted by cdkstarter's
7
+ # remote-agent IAM kit.
8
+ # Optional plain variables:
9
+ # LISA_REMOTE_AGENT claude | codex | cursor | copilot | agy | opencode
10
+ # LISA_AWS_DEFAULT_PROFILE Defaults to dev, then the first available profile.
11
+ # LISA_AWS_SKIP_VERIFY Set to 1 only for an offline image build.
12
+
13
+ set -euo pipefail
14
+ umask 077
15
+
16
+ BOOTSTRAP_PROFILE="lisa-remote-agent-bootstrap"
17
+
18
+ fail() {
19
+ echo "remote-agent-aws-setup: $*" >&2
20
+ exit 1
21
+ }
22
+
23
+ need() {
24
+ command -v "$1" >/dev/null 2>&1
25
+ }
26
+
27
+ as_root() {
28
+ if [ "$(id -u)" = "0" ]; then
29
+ "$@"
30
+ elif need sudo; then
31
+ sudo "$@"
32
+ else
33
+ fail "root access is required to install $1"
34
+ fi
35
+ }
36
+
37
+ install_base_tools() {
38
+ need curl && need unzip && need jq && return 0
39
+
40
+ if need apt-get; then
41
+ as_root apt-get update -y
42
+ as_root apt-get install -y curl unzip jq
43
+ elif need dnf; then
44
+ as_root dnf install -y curl unzip jq
45
+ elif need yum; then
46
+ as_root yum install -y curl unzip jq
47
+ else
48
+ fail "install curl, unzip, and jq in the remote image before running this script"
49
+ fi
50
+ }
51
+
52
+ install_aws_cli() {
53
+ need aws && return 0
54
+
55
+ local architecture aws_architecture temporary_directory
56
+ architecture="$(uname -m)"
57
+ case "$architecture" in
58
+ x86_64 | amd64) aws_architecture="x86_64" ;;
59
+ aarch64 | arm64) aws_architecture="aarch64" ;;
60
+ *) fail "unsupported AWS CLI architecture: $architecture" ;;
61
+ esac
62
+
63
+ temporary_directory="$(mktemp -d)"
64
+ trap 'rm -rf "${temporary_directory:-}"' EXIT
65
+ curl -fsSL \
66
+ "https://awscli.amazonaws.com/awscli-exe-linux-${aws_architecture}.zip" \
67
+ -o "$temporary_directory/awscliv2.zip"
68
+ unzip -q "$temporary_directory/awscliv2.zip" -d "$temporary_directory"
69
+ as_root "$temporary_directory/aws/install" \
70
+ --install-dir /usr/local/aws-cli \
71
+ --bin-dir /usr/local/bin
72
+ rm -rf "$temporary_directory"
73
+ trap - EXIT
74
+ }
75
+
76
+ sanitize_session_name() {
77
+ local candidate
78
+ candidate="$(printf '%s' "${LISA_REMOTE_AGENT:-remote-agent}" \
79
+ | sed 's/[^A-Za-z0-9_+=,.@-]/-/g' \
80
+ | cut -c1-64)"
81
+ [ "${#candidate}" -ge 2 ] || candidate="remote-agent"
82
+ printf '%s\n' "$candidate"
83
+ }
84
+
85
+ install_base_tools
86
+ install_aws_cli
87
+
88
+ [ -z "${AWS_ACCESS_KEY_ID:-}" ] || fail \
89
+ "do not set AWS_ACCESS_KEY_ID directly; set only LISA_AWS_BOOTSTRAP_JSON so role profiles cannot be bypassed"
90
+ [ -z "${AWS_SECRET_ACCESS_KEY:-}" ] || fail \
91
+ "do not set AWS_SECRET_ACCESS_KEY directly; set only LISA_AWS_BOOTSTRAP_JSON so role profiles cannot be bypassed"
92
+
93
+ bootstrap_json="${LISA_AWS_BOOTSTRAP_JSON:-}"
94
+ [ -n "$bootstrap_json" ] || fail "LISA_AWS_BOOTSTRAP_JSON is required"
95
+
96
+ printf '%s' "$bootstrap_json" | jq -e '
97
+ type == "object" and
98
+ (.accessKeyId | type == "string" and length > 0) and
99
+ (.secretAccessKey | type == "string" and length > 0) and
100
+ (.externalId | type == "string" and length > 0) and
101
+ (.profiles | (type == "object" or type == "string"))
102
+ ' >/dev/null || fail "LISA_AWS_BOOTSTRAP_JSON is not a valid remote-agent bootstrap bundle"
103
+
104
+ access_key_id="$(printf '%s' "$bootstrap_json" | jq -er '.accessKeyId')"
105
+ secret_access_key="$(printf '%s' "$bootstrap_json" | jq -er '.secretAccessKey')"
106
+ external_id="$(printf '%s' "$bootstrap_json" | jq -er '.externalId')"
107
+ session_token="$(printf '%s' "$bootstrap_json" | jq -r '.sessionToken // empty')"
108
+ profiles_json="$(printf '%s' "$bootstrap_json" | jq -c '
109
+ if (.profiles | type) == "string" then
110
+ .profiles | fromjson
111
+ else
112
+ .profiles
113
+ end
114
+ ')"
115
+
116
+ printf '%s' "$profiles_json" | jq -e '
117
+ type == "object" and length > 0 and
118
+ all(to_entries[];
119
+ (.key | test("^[A-Za-z0-9_-]+$")) and
120
+ (.value.roleArn | type == "string" and startswith("arn:aws:iam::")) and
121
+ (.value.region | type == "string" and length > 0)
122
+ )
123
+ ' >/dev/null || fail "bootstrap profiles must map safe names to roleArn and region"
124
+
125
+ mkdir -p "$HOME/.aws"
126
+ chmod 700 "$HOME/.aws"
127
+
128
+ aws configure set aws_access_key_id "$access_key_id" --profile "$BOOTSTRAP_PROFILE"
129
+ aws configure set aws_secret_access_key "$secret_access_key" --profile "$BOOTSTRAP_PROFILE"
130
+ if [ -n "$session_token" ]; then
131
+ aws configure set aws_session_token "$session_token" --profile "$BOOTSTRAP_PROFILE"
132
+ fi
133
+
134
+ session_name="$(sanitize_session_name)"
135
+ while IFS=$'\t' read -r profile_name role_arn region; do
136
+ aws configure set role_arn "$role_arn" --profile "$profile_name"
137
+ aws configure set source_profile "$BOOTSTRAP_PROFILE" --profile "$profile_name"
138
+ aws configure set external_id "$external_id" --profile "$profile_name"
139
+ aws configure set role_session_name "$session_name" --profile "$profile_name"
140
+ aws configure set region "$region" --profile "$profile_name"
141
+ done < <(printf '%s' "$profiles_json" | jq -r 'to_entries[] | [.key, .value.roleArn, .value.region] | @tsv')
142
+
143
+ default_profile="${LISA_AWS_DEFAULT_PROFILE:-dev}"
144
+ if ! printf '%s' "$profiles_json" | jq -e --arg profile "$default_profile" 'has($profile)' >/dev/null; then
145
+ default_profile="$(printf '%s' "$profiles_json" | jq -r 'keys[0]')"
146
+ fi
147
+
148
+ default_role_arn="$(printf '%s' "$profiles_json" | jq -er --arg profile "$default_profile" '.[$profile].roleArn')"
149
+ default_region="$(printf '%s' "$profiles_json" | jq -er --arg profile "$default_profile" '.[$profile].region')"
150
+ aws configure set role_arn "$default_role_arn" --profile default
151
+ aws configure set source_profile "$BOOTSTRAP_PROFILE" --profile default
152
+ aws configure set external_id "$external_id" --profile default
153
+ aws configure set role_session_name "$session_name" --profile default
154
+ aws configure set region "$default_region" --profile default
155
+
156
+ chmod 600 "$HOME/.aws/credentials" "$HOME/.aws/config"
157
+
158
+ if [ "${LISA_AWS_SKIP_VERIFY:-0}" != "1" ]; then
159
+ AWS_PAGER="" aws sts get-caller-identity --profile "$default_profile" >/dev/null
160
+ fi
161
+
162
+ profile_names="$(printf '%s' "$profiles_json" | jq -r 'keys | join(", ")')"
163
+ echo "remote-agent-aws-setup: ready (${session_name}; default=${default_profile}; profiles=${profile_names})"
@@ -150,24 +150,27 @@ Group the findings as:
150
150
  Terraform providers).
151
151
  - `aws sso login`, `aws:signin:*`, `sso_start_url`, `sso_account_id`, `sso_role_name`, or
152
152
  `sso_session` in docs or config.
153
- - `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`, `AWS_DEFAULT_REGION`,
154
- `AWS_PROFILE`, role ARN, external ID, account, or CloudWatch/STS references.
153
+ - `LISA_AWS_BOOTSTRAP_JSON`, legacy `AWS_ACCESS_KEY_ID` /
154
+ `AWS_SECRET_ACCESS_KEY`, `AWS_PROFILE`, role ARN, external ID, account, or
155
+ CloudWatch/STS references.
155
156
 
156
157
  If AWS is present, emit an AWS credential finding and inventory entry. If the repo's current
157
158
  local path is `aws sso login` or an `aws:signin:*` script, classify that local path as a `GAP`
158
159
  for headless remote routines: it is an interactive browser/device-authorization flow and cannot
159
160
  complete in the cloud. Route to the AWS row in the Credential reference instead of suggesting
160
- SSO auth. The finding must name the headless substrate: a dedicated IAM principal (user or role)
161
- with only permission to `sts:AssumeRole`, environment credentials in the routine UI, and
162
- `~/.aws/config` profiles using `role_arn`, `credential_source = Environment`, optional
163
- `external_id`, and `region`.
161
+ SSO auth. The finding must name Lisa's headless substrate: one dedicated IAM
162
+ user with only `sts:AssumeRole`; one complete Secrets Manager SecretString
163
+ set as `LISA_AWS_BOOTSTRAP_JSON`; and `/lisa:setup-remote-aws`, which writes a
164
+ named source profile plus automatically refreshed role profiles. Explicitly
165
+ reject standard `AWS_ACCESS_KEY_ID` variables because they can bypass the
166
+ intended assume-role profile.
164
167
 
165
168
  When the repository contains concrete non-secret AWS metadata (role ARNs, account aliases,
166
169
  profile names, regions, or ExternalId values), include it in an `awsProfiles` inventory array so
167
170
  `/lisa:generate-claude-remote-build-script` can write matching `~/.aws/config` profiles. Never
168
- invent account IDs, ExternalIds, role names, or regions. If AWS is detected but profile metadata
169
- is absent, emit the required AWS secret names plus an action to add project-specific profile
170
- metadata to the generated artifact or environment notes.
171
+ invent account IDs, ExternalIds, role names, or regions. If AWS is detected
172
+ but profile metadata is absent, require a cdkstarter bootstrap bundle rather
173
+ than asking the repository to reconstruct account metadata by hand.
171
174
 
172
175
  5. **MCP servers** — read every committed `.mcp.json`. For each server report transport and auth.
173
176
  Project-scoped HTTP/SSE servers with no interactive auth are `OK`. Flag stdio servers as
@@ -276,14 +279,14 @@ unsuffixed `…_TOKEN`/`…_KEY` is the simplest to set in a single-account rout
276
279
  - Access: the personal API key inherits the user's workspace permissions — the user must be able to read/create/update Issues in the destination team.
277
280
 
278
281
  ### AWS — host-project operations, logs, deploys, CDK/Serverless/SST, or AWS SDK usage
279
- - Headless substrate: a dedicated IAM principal (user or role) with long-lived bootstrap credentials
280
- stored in the routine environment, used only to call `sts:AssumeRole` into per-account operational
281
- roles. The routine writes `~/.aws/config` profiles with `role_arn`, `credential_source =
282
- Environment`, optional `external_id`, and `region`; agents use `aws --profile <profile> ...`.
283
- - Env: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`; optional `AWS_SESSION_TOKEN` for temporary
284
- bootstrap credentials; `AWS_DEFAULT_REGION` when no profile region is provided. Role ARNs,
285
- ExternalIds, profile names, and regions are non-secret project metadata and belong in generated
286
- artifacts or project docs, not in the skill's global guidance.
282
+ - Headless substrate: cdkstarter's vendor-neutral remote-agent kit. Its single
283
+ Secrets Manager SecretString contains the assume-only access key, ExternalId,
284
+ and per-account role metadata. `/lisa:setup-remote-aws` writes a private named
285
+ source profile and renewable role profiles; agents use
286
+ `aws --profile <profile> ...`.
287
+ - Env: `LISA_AWS_BOOTSTRAP_JSON` (secret, required) and
288
+ `LISA_REMOTE_AGENT` (plain platform label). Do not set `AWS_ACCESS_KEY_ID` or
289
+ `AWS_SECRET_ACCESS_KEY` in the remote environment.
287
290
  - Allowlist: `*.amazonaws.com`, or narrower service hosts such as `sts.amazonaws.com`,
288
291
  `logs.<region>.amazonaws.com`, `cloudwatch.<region>.amazonaws.com`,
289
292
  `xray.<region>.amazonaws.com`, `ssm.<region>.amazonaws.com`, and service-specific endpoints the
@@ -366,7 +369,7 @@ so the generator can render acquisition comments into its template:
366
369
  {
367
370
  "name": "dev",
368
371
  "roleArn": "arn:aws:iam::<account-id>:role/<role-name>",
369
- "credentialSource": "Environment",
372
+ "credentialSource": "lisa-remote-agent-bootstrap",
370
373
  "externalId": "<project-external-id>",
371
374
  "region": "us-east-1"
372
375
  }
@@ -71,9 +71,9 @@ tracker/source, plus the host project's own package manager and tooling — not
71
71
  include `JAM_PAT`, `SONAR_TOKEN`, or similar documented substrate env vars
72
72
  only as optional secrets, with their acquire/scope comments when the analysis
73
73
  supplied them. Never invent values or promote dormant substrates to required.
74
- When AWS entries are present, list `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, optional
75
- `AWS_SESSION_TOKEN`, and `AWS_DEFAULT_REGION` exactly as the analysis reported. State that these
76
- bootstrap credentials are for STS assume-role only; do not emit or recommend `aws sso login`.
74
+ When AWS entries are present, list only `LISA_AWS_BOOTSTRAP_JSON` as the
75
+ required secret and `LISA_REMOTE_AGENT=claude` as plain configuration. Never
76
+ emit standard `AWS_ACCESS_KEY_ID` variables and never recommend `aws sso login`.
77
77
 
78
78
  3a. **Emit substrate setup snippets.** When the inventory marks an MCP
79
79
  `headlessUsable: true` through a documented substrate, render the matching
@@ -91,18 +91,11 @@ tracker/source, plus the host project's own package manager and tooling — not
91
91
  transport supports static-token auth. Do not print a Jam `.mcp.json` header snippet because
92
92
  Jam's preferred headless substrate is its PAT-authenticated CLI.
93
93
 
94
- 3b. **Emit AWS assume-role profile setup.** When the inventory includes `awsProfiles`, write an
95
- idempotent `~/.aws/config` block gated on `[ -n "${AWS_ACCESS_KEY_ID:-}" ]`. The generated block
96
- must:
97
- - `mkdir -p "$HOME/.aws"` and create or append profile stanzas without writing secrets.
98
- - Emit one `[profile <name>]` stanza per inventory profile with `role_arn`,
99
- `credential_source = Environment`, `region` when present, and `external_id` when present.
100
- - Keep regions and ExternalIds as non-secret project metadata from the inventory; never invent
101
- account IDs, role names, profile names, regions, or ExternalIds.
102
- - Warn and skip profile writing when AWS profile metadata is absent, while still listing the
103
- required `AWS_*` env var names in the secret template.
104
- - Include a comment that agents should use `aws --profile <name> ...` and must not run
105
- `aws sso login` in headless routines.
94
+ 3b. **Install the shared AWS bootstrap.** When AWS is present, invoke
95
+ `/lisa:setup-remote-aws --platform=claude`. Reuse the resulting
96
+ `scripts/remote-agent-aws-setup.sh`; do not generate a second credential or
97
+ profile implementation. Add `bash scripts/remote-agent-aws-setup.sh` to the
98
+ generated cloud setup after required package installation.
106
99
 
107
100
  4. **Emit the allowlist + gaps notice.** List any custom domains the setup or runtime reaches
108
101
  (from `networkAccess.allowlistDomains`, falling back to legacy `allowlistDomains`) that the user
@@ -139,9 +132,9 @@ shape, not a fixed payload):
139
132
  # # Note: GH_TOKEN is for gh CLI only. Raw git uses Claude's connected-GitHub proxy/identity;
140
133
  # # sibling repos reached only by raw git do not need to be in this token scope.
141
134
  # - GH_TOKEN=<token> # REQUIRED, github is the active tracker+source
142
- # - AWS_ACCESS_KEY_ID=<access-key-id> # REQUIRED when AWS inventory is active
143
- # - AWS_SECRET_ACCESS_KEY=<secret-access-key> # REQUIRED when AWS inventory is active
144
- # - AWS_SESSION_TOKEN=<session-token> # OPTIONAL for temporary bootstrap creds
135
+ # - LISA_AWS_BOOTSTRAP_JSON=<complete SecretString> # REQUIRED for AWS
136
+ # PLAIN:
137
+ # - LISA_REMOTE_AGENT=claude
145
138
  # NETWORK: set the environment to Custom and allowlist these non-default domains if not on Full:
146
139
  # - <networkAccess.allowlistDomains, if any>
147
140
  set -uo pipefail
@@ -184,13 +177,8 @@ need gh || (sudo apt-get update -y && sudo apt-get install -y gh)
184
177
  need jq || sudo apt-get install -y jq
185
178
  require gh; require jq
186
179
 
187
- # --- AWS assume-role profiles, when inventory includes awsProfiles ---
188
- if [ -n "${AWS_ACCESS_KEY_ID:-}" ]; then
189
- mkdir -p "$HOME/.aws"
190
- # Generated stanzas use credential_source=Environment and contain no secrets.
191
- # Agents should run: aws --profile <profile> ...
192
- # Do not run aws sso login in headless routines; SSO requires an interactive browser/device flow.
193
- fi
180
+ # --- AWS assume-role profiles, when AWS inventory is active ---
181
+ bash scripts/remote-agent-aws-setup.sh
194
182
 
195
183
  # --- optional, only with --include-optional ---
196
184
  # (docker / ruby / chromium / etc., guarded)
@@ -213,8 +201,8 @@ to stop are: the analysis could not run, or the `--out` path is not writable.
213
201
  raw git/cross-repo clone guidance must not expand the token scope to sibling repositories.
214
202
  - Never emit an install for a tool the analysis did not surface, and never install `OPTIONAL` tools
215
203
  unless `--include-optional` is set.
216
- - When AWS is in the inventory, generate environment-backed assume-role profile stanzas from
217
- `awsProfiles`; never emit `aws sso login` as a remote setup step.
204
+ - When AWS is in the inventory, reuse `/lisa:setup-remote-aws` and its shared
205
+ setup script; never emit a second profile implementation or `aws sso login`.
218
206
  - Prefer `networkAccess.allowlistDomains` over legacy top-level `allowlistDomains`; never emit
219
207
  domains already covered by the routine environment's default Trusted list.
220
208
  - Keep the script idempotent and detect-before-install so it is safe to re-run and cache.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: lisa-setup-remote-aws
3
+ description: "Install and validate Lisa's drop-in AWS CLI bootstrap for remote coding environments. Supports Claude, Codex, Cursor, GitHub Copilot, Antigravity on user-managed hosts, OpenCode on user-managed hosts, and future Linux remote agents through one capability contract. Writes no secrets; it installs the common setup script, merges native Cursor/Copilot adapters, and emits exact operator guidance for the selected platform."
4
+ allowed-tools: ["Bash", "Read", "Write", "Glob", "Grep"]
5
+ ---
6
+
7
+ # Set up remote-agent AWS access: $ARGUMENTS
8
+
9
+ Install the vendor-neutral AWS bootstrap into the current repository.
10
+
11
+ ## Arguments
12
+
13
+ - `--platform=all|claude|codex|cursor|copilot|agy|opencode` (default `all`)
14
+ - `--project=<path>` (default current working directory)
15
+ - `--secret-name=<name>` (default `remote-agent-credentials`)
16
+
17
+ ## Procedure
18
+
19
+ 1. Resolve the plugin root from `PLUGIN_ROOT`, `CLAUDE_PLUGIN_ROOT`,
20
+ `CURSOR_PLUGIN_ROOT`, or the installed `@codyswann/lisa/plugins/lisa` package.
21
+ 2. Run:
22
+
23
+ ```bash
24
+ node "$PLUGIN_ROOT/scripts/install-remote-agent-aws.mjs" $ARGUMENTS
25
+ ```
26
+
27
+ 3. Inspect every path returned by the installer. It must install
28
+ `scripts/remote-agent-aws-setup.sh`; for Cursor it merges
29
+ `.cursor/environment.json`; for Copilot it creates or merges
30
+ `.github/workflows/copilot-setup-steps.yml`; and it always writes
31
+ `docs/remote-agent-aws.md`.
32
+ 4. Run `bash -n scripts/remote-agent-aws-setup.sh`.
33
+ 5. Never write or request the actual bootstrap SecretString in repository
34
+ files. Tell the operator to retrieve the `remote-agent-credentials` secret
35
+ from the shared AWS account and paste its complete SecretString into the
36
+ platform secret named `LISA_AWS_BOOTSTRAP_JSON`. The default cdkstarter
37
+ secret name is `remote-agent-credentials`; downstream infrastructure may
38
+ configure a different name. Pass that name with `--secret-name` so the
39
+ generated runbook contains the exact retrieval command.
40
+ 6. Report the external step that remains: configure that one secret in the
41
+ remote environment and launch a smoke session.
42
+
43
+ ## Contract
44
+
45
+ A future coding agent is supported without an AWS change when its remote
46
+ environment provides a Linux shell, a setup/start hook, one opaque secret,
47
+ a writable home directory, and HTTPS access to AWS STS plus the allowed service
48
+ endpoints. Set `LISA_REMOTE_AGENT` to a stable lowercase platform label; it is
49
+ used only as `role_session_name`.
50
+
51
+ Do not create per-repository or per-agent IAM users. Do not expose the bootstrap
52
+ key through standard `AWS_ACCESS_KEY_ID` variables. Do not add production repair
53
+ permissions; production repair is a human-driven local-workstation workflow.
@@ -23,6 +23,9 @@
23
23
  # # Pull requests R/W, Metadata R (+Workflows R/W if editing .github/workflows,
24
24
  # # +Projects R/W if using ProjectV2). Identity needs WRITE+ on the repo.
25
25
  # - GH_TOKEN=<token> # REQUIRED unless the routine's repo connection already auths `gh`
26
+ # AWS (when this routine needs account access):
27
+ # - LISA_AWS_BOOTSTRAP_JSON=<complete remote-agent-credentials SecretString>
28
+ # - LISA_REMOTE_AGENT=claude
26
29
  # Dormant (set ONLY if you switch .lisa.config.json tracker/source):
27
30
  # - JIRA_API_TOKEN / JIRA_SERVER / JIRA_LOGIN / JIRA_PROJECT # tracker=jira
28
31
  # - ATLASSIAN_API_TOKEN # source=confluence (8 Confluence scopes)
@@ -70,6 +73,12 @@ fi
70
73
  require jq
71
74
  require gh
72
75
 
76
+ # --- AWS CLI + renewable role profiles (when configured) ---
77
+ if [ -n "${LISA_AWS_BOOTSTRAP_JSON:-}" ]; then
78
+ LISA_REMOTE_AGENT="${LISA_REMOTE_AGENT:-claude}" \
79
+ bash scripts/remote-agent-aws-setup.sh
80
+ fi
81
+
73
82
  # --- gitleaks (REQUIRED: pre-commit secret scan) ---
74
83
  if ! need gitleaks; then
75
84
  echo "Installing gitleaks..."
@@ -133,8 +142,6 @@ if [ "$INCLUDE_OPTIONAL" = "1" ]; then
133
142
  # Chromium for Lighthouse/Playwright (heavy — can strain the cache budget)
134
143
  npx playwright install chromium || echo "WARN: chromium install failed (optional)"
135
144
 
136
- # aws CLI (cleanup scripts)
137
- need aws || apt_get install -y awscli || echo "WARN: awscli install failed (optional)"
138
145
  fi
139
146
 
140
147
  echo "claude-remote-setup: done."
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env bash
2
+ # Package-level convenience wrapper. The implementation is authored upstream
3
+ # in plugins/src/base and copied into plugins/lisa by build:plugins.
4
+
5
+ set -euo pipefail
6
+
7
+ REPOSITORY_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
8
+ for candidate in \
9
+ "$REPOSITORY_ROOT/plugins/lisa/scripts/remote-agent-aws-setup.sh" \
10
+ "$REPOSITORY_ROOT/plugins/src/base/scripts/remote-agent-aws-setup.sh"; do
11
+ if [ -x "$candidate" ]; then
12
+ exec "$candidate" "$@"
13
+ fi
14
+ done
15
+
16
+ echo "remote-agent-aws-setup: Lisa plugin script is missing; run bun run build:plugins" >&2
17
+ exit 1