@codyswann/lisa 2.204.8 → 2.205.1

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 (74) hide show
  1. package/package.json +1 -1
  2. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  3. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  4. package/plugins/lisa/rules/eager/upstream-to-lisa.md +8 -3
  5. package/plugins/lisa/rules/reference/upstream-to-lisa.md +15 -4
  6. package/plugins/lisa-agy/plugin.json +1 -1
  7. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  8. package/plugins/lisa-cdk/.codex-plugin/plugin.json +2 -1
  9. package/plugins/lisa-cdk/.codex-plugin/skills/lisa-setup-aws/SKILL.md +13 -0
  10. package/plugins/lisa-cdk/.codex-plugin/skills/lisa-setup-aws/agents/openai.yaml +4 -0
  11. package/plugins/lisa-cdk/.codex-plugin/skills/setup-aws-accounts/SKILL.md +292 -0
  12. package/plugins/lisa-cdk/.codex-plugin/skills/setup-aws-accounts/agents/openai.yaml +4 -0
  13. package/plugins/lisa-cdk/commands/setup/aws.md +7 -0
  14. package/plugins/lisa-cdk/skills/setup-aws-accounts/SKILL.md +292 -0
  15. package/plugins/lisa-cdk/skills/setup-aws-accounts/agents/openai.yaml +4 -0
  16. package/plugins/lisa-cdk-agy/commands/lisa/setup/aws.md +7 -0
  17. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  18. package/plugins/lisa-cdk-agy/skills/setup-aws-accounts/SKILL.md +292 -0
  19. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  20. package/plugins/lisa-cdk-copilot/commands/lisa/setup/aws.md +7 -0
  21. package/plugins/lisa-cdk-copilot/skills/setup-aws-accounts/SKILL.md +292 -0
  22. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  23. package/plugins/lisa-cdk-cursor/commands/lisa/setup/aws.md +7 -0
  24. package/plugins/lisa-cdk-cursor/skills/setup-aws-accounts/SKILL.md +292 -0
  25. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  26. package/plugins/lisa-copilot/rules/eager/upstream-to-lisa.md +8 -3
  27. package/plugins/lisa-copilot/rules/reference/upstream-to-lisa.md +15 -4
  28. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  29. package/plugins/lisa-cursor/rules/upstream-to-lisa-reference.mdc +15 -4
  30. package/plugins/lisa-cursor/rules/upstream-to-lisa.mdc +8 -3
  31. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  33. package/plugins/lisa-expo-agy/plugin.json +1 -1
  34. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  35. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  38. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  39. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  43. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  44. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  48. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  49. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  53. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  54. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  57. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  58. package/plugins/lisa-rails-agy/plugin.json +1 -1
  59. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  62. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  63. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  64. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  65. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  66. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  67. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  68. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  69. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  70. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  71. package/plugins/src/base/rules/eager/upstream-to-lisa.md +8 -3
  72. package/plugins/src/base/rules/reference/upstream-to-lisa.md +15 -4
  73. package/plugins/src/cdk/commands/setup/aws.md +7 -0
  74. package/plugins/src/cdk/skills/setup-aws-accounts/SKILL.md +292 -0
package/package.json CHANGED
@@ -95,7 +95,7 @@
95
95
  "ws": ">=8.20.1"
96
96
  },
97
97
  "name": "@codyswann/lisa",
98
- "version": "2.204.8",
98
+ "version": "2.205.1",
99
99
  "description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
100
100
  "main": "dist/index.js",
101
101
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "2.204.8",
3
+ "version": "2.205.1",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "2.204.8",
3
+ "version": "2.205.1",
4
4
  "description": "Universal governance: agents, skills, commands, hooks, and rules for all projects.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,15 +1,20 @@
1
1
  # Upstream To Lisa (load-bearing)
2
2
 
3
- When working in a project that has Lisa installed, you will sometimes find that the **real fix belongs upstream in Lisa**, not in this project — a bug or gap in a Lisa-distributed template, rule, skill, agent, hook, or CI workflow, or a governance pattern worth generalizing back to the templates. Tell-tale signs: the file you want to change is Lisa-managed (carries Lisa governance markers, or lives in a path Lisa owns), and any edit you make here would be **overwritten on the next `lisa apply`**.
3
+ When working in a project that has Lisa installed, you will sometimes find that the **real fix belongs upstream in Lisa**, not in this project — a bug or gap in a Lisa-distributed template, rule, skill, agent, hook, or CI workflow, or a governance pattern worth generalizing back to the templates. The defining test: **does the root cause live in a Lisa-distributed artifact?** If yes, file upstream, regardless of whether your local fix survives the next `lisa apply`.
4
+
5
+ Tell-tale signs include:
6
+
7
+ - The file is Lisa-managed (carries Lisa governance markers, or lives in a path Lisa owns) and any edit you make here would be **overwritten on the next `lisa apply`**.
8
+ - The file was created from a Lisa `create-only` template and carries language such as `Lisa will not overwrite it`. That header is a positive upstream signal: existing repos will keep their local copy, but every newly scaffolded repo still inherits the broken template until Lisa is fixed.
4
9
 
5
10
  When that happens, you have **two obligations — do both**:
6
11
 
7
- 1. **Fix it locally so you are not blocked.** Apply the stopgap in this project so you can keep working. Treat it as temporary: it will be clobbered when the upstream fix ships and Lisa re-applies. Do not wait on the upstream fix.
12
+ 1. **Fix it locally so you are not blocked.** Apply the stopgap in this project so you can keep working. For copy-overwrite files, treat the local fix as temporary because it will be clobbered when the upstream fix ships and Lisa re-applies. For create-only files, keep the local fix because Lisa will not overwrite it, but still file upstream so new repos stop inheriting the bug.
8
13
  2. **File an upstream issue in the Lisa repository.** Use the `github-write-issue` skill (`lisa-github-write-issue`) to create an issue **in Lisa's source repo `CodySwannGT/lisa`** (pass it as the target repo, e.g. `gh ... --repo CodySwannGT/lisa`) — **not** in this project's own repo. Capture: the root cause, the symptom you hit here, and the proposed durable fix in Lisa's templates/rules/skills.
9
14
 
10
15
  ## Do not
11
16
 
12
- - Do **not** only fix it locally and move on — the local fix is throwaway; without the upstream issue the root cause is lost and re-breaks on the next apply.
17
+ - Do **not** only fix it locally and move on — even when a create-only local fix survives, the broken template keeps shipping to every new repo until it is fixed upstream.
13
18
  - Do **not** try to edit Lisa's templates from inside this project — you are not in the Lisa repo; those edits don't exist upstream and get overwritten.
14
19
  - Do **not** file the issue in this project's repo — it must land in `CodySwannGT/lisa`.
15
20
 
@@ -9,14 +9,25 @@ You are working in a downstream/host project (not the Lisa source repo) and you
9
9
  - A bug or gap in a Lisa-distributed **template, rule, skill, agent, hook, or CI workflow**.
10
10
  - A **governance pattern** discovered here that should be generalized back into Lisa's templates so every project benefits.
11
11
  - Anything where the file you want to change is **Lisa-managed** — it carries Lisa governance markers, lives in a path Lisa owns, or any edit would be **overwritten on the next `lisa apply`**.
12
+ - Anything where the root cause is in a Lisa **create-only** template, even if the generated file says Lisa will not overwrite it.
12
13
 
13
- The defining test: *if I fix this only here, does `lisa apply` wipe it out next time?* If yes, the root cause lives in Lisa and must be upstreamed.
14
+ The defining test: **does the root cause live in a Lisa-distributed artifact?** If yes, file upstream. The wipe-out test is a sufficient signal, not the only signal.
15
+
16
+ | Template class | Local fix survives `lisa apply`? | Why it is still upstream-worthy |
17
+ | --- | --- | --- |
18
+ | **copy-overwrite** (managed) | No — clobbered on next apply | The local fix is throwaway; without the upstream fix it re-breaks. |
19
+ | **create-only** (first setup) | Yes — Lisa never overwrites it | No existing repo self-heals, and every newly scaffolded repo inherits the bug. |
20
+
21
+ For create-only files, header text such as `Lisa will not overwrite it` is a **positive** upstream signal, not a reason to stay local. Keep the downstream fix because Lisa will not replace it, and still file upstream so future projects receive the corrected template.
14
22
 
15
23
  ## What to do — both steps, always
16
24
 
17
25
  ### 1. Fix it locally so you are not blocked
18
26
 
19
- Apply the stopgap in this project so you can keep working. Do **not** stall waiting for an upstream fix to land. Treat the local change as temporary — it will be clobbered when the upstream fix ships and Lisa re-applies. That is expected and fine; the upstream issue (step 2) is what makes it durable.
27
+ Apply the stopgap in this project so you can keep working. Do **not** stall waiting for an upstream fix to land.
28
+
29
+ - For copy-overwrite files, treat the local change as temporary: it will be clobbered when the upstream fix ships and Lisa re-applies.
30
+ - For create-only files, keep the local change: Lisa will not overwrite it. The upstream issue is still mandatory because new projects keep inheriting the broken template until Lisa changes.
20
31
 
21
32
  ### 2. File an upstream issue in the Lisa repository
22
33
 
@@ -27,11 +38,11 @@ The issue should capture, following the skill's three-audience / acceptance-crit
27
38
  - **Root cause** — which Lisa template/rule/skill/agent/hook/workflow is wrong or missing, with the path under `plugins/src/...` (or the relevant template source) if known.
28
39
  - **Symptom** — what broke or was missing in *this* project, and how it surfaced. Reference this project so the fix can be validated against a real case.
29
40
  - **Proposed durable fix** — the change to make in Lisa's source so it propagates to all projects on the next apply.
30
- - **Local stopgap applied** — note that a temporary local fix is in place here, so the maintainer knows the host project is unblocked and the local change will be superseded.
41
+ - **Local stopgap applied** — note that a local fix is in place here, whether it is temporary copy-overwrite work or a retained create-only patch.
31
42
 
32
43
  ## Do not
33
44
 
34
- - Do **not** only fix it locally and move on. The local fix is throwaway; without the upstream issue the root cause is lost and re-breaks for every project on the next apply.
45
+ - Do **not** only fix it locally and move on. For copy-overwrite files, the local fix is throwaway and re-breaks on the next apply. For create-only files, the local fix survives, but the broken template still ships to every new project.
35
46
  - Do **not** edit Lisa's templates from inside this project. You are not in the Lisa repo; those edits don't exist upstream and get overwritten — they create the illusion of a fix while the real source stays broken.
36
47
  - Do **not** file the issue in this project's own repo. The durable fix is tracked in `CodySwannGT/lisa`.
37
48
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "2.204.8",
3
+ "version": "2.205.1",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "2.204.8",
3
+ "version": "2.205.1",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "2.204.8",
3
+ "version": "2.205.1",
4
4
  "description": "AWS CDK-specific Lisa plugin.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -13,6 +13,7 @@
13
13
  "dependencies": [
14
14
  "lisa-typescript"
15
15
  ],
16
+ "skills": "./.codex-plugin/skills/",
16
17
  "interface": {
17
18
  "displayName": "Lisa CDK",
18
19
  "shortDescription": "AWS CDK workflows",
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: lisa-setup-aws
3
+ description: "Provision the dev/staging/produc…"
4
+ ---
5
+ ## Lisa Command Compatibility
6
+
7
+ - Original Claude command: `/lisa:setup:aws`
8
+ - Codex invocation: `$lisa-setup-aws` or a plain-English request that matches this skill.
9
+ - Treat the user's surrounding request as the command arguments.
10
+ - Claude argument hint: `[management-profile] [region] [dry-run]`
11
+ - Claude allowed tools: `Skill`. Codex tool access is governed by the active Codex runtime and project policy.
12
+
13
+ Use the setup-aws-accounts skill (/lisa-cdk:setup-aws-accounts on harnesses with plugin commands; $setup-aws-accounts on Codex) to assess the AWS organization, run the aws-soc2-setup foundation and account vending, write the SSO profiles, cdk-bootstrap every account with cross-account trust, and wire the resulting account IDs into config/environments.ts, GitHub secrets, and .lisa.config.json. Use the user's surrounding request as this command's arguments.
@@ -0,0 +1,4 @@
1
+ display_name: "Setup AWS"
2
+ short_description: "Provision the dev/staging/produc…"
3
+ default_prompt:
4
+ - "Use $lisa-setup-aws: Provision the dev/staging/produc…."
@@ -0,0 +1,292 @@
1
+ ---
2
+ name: setup-aws-accounts
3
+ description: "Provision the multi-account AWS…"
4
+ allowed-tools: ["Bash", "Read", "Edit", "Write", "AskUserQuestion"]
5
+ ---
6
+
7
+ # Setup AWS Accounts (SOC 2 Landing Zone)
8
+
9
+ Provision and wire the AWS accounts a CDK project deploys into. The account
10
+ supply side runs through the [`@codyswann/aws-soc2-setup`](https://www.npmjs.com/package/@codyswann/aws-soc2-setup)
11
+ CLI (AWS Organizations, Control Tower, IAM Identity Center, security services,
12
+ SOC 2 controls); the demand side — profiles, `cdk bootstrap`, config files, CI
13
+ secrets — is wired by this skill so the project goes from `PLACEHOLDER` account
14
+ IDs to deployable in one flow.
15
+
16
+ ## When to use
17
+
18
+ - A CDK project's `config/environments.ts` still has `accountId: "PLACEHOLDER"`
19
+ entries, so `cdk deploy` silently skips those environments.
20
+ - The user asks to "create the AWS accounts", "set up dev/staging/production
21
+ accounts", "bootstrap AWS for this project", or similar.
22
+ - `scripts/pre-deployment-checklist.sh` fails because `<prefix>-<env>` AWS
23
+ profiles don't exist or don't authenticate.
24
+ - A fresh organization needs the SOC 2 foundation (Control Tower, guardrails,
25
+ security services) before workload accounts are vended.
26
+
27
+ Not for: deploying stacks (that's `cdk deploy` / CI), or GitHub repo governance
28
+ (that's `lisa-setup-github-repo`).
29
+
30
+ ## How the CLI behaves (read before scripting it)
31
+
32
+ - Invoke as `npx -y @codyswann/aws-soc2-setup@1 <command>`. Pin at least the
33
+ major version — an unpinned `npx` pull is a supply-chain risk for a tool that
34
+ runs with management-account credentials. Always set `NO_COLOR=1` so output
35
+ parses cleanly.
36
+ - It is an **actuator, not an API** — no `--json` output. Drive it for side
37
+ effects, then read authoritative state back with the plain `aws` CLI
38
+ (`aws organizations list-accounts`, `aws sts get-caller-identity`). Never
39
+ trust scraped text alone for account IDs.
40
+ - It is idempotent per resource (ensure-semantics against live AWS), so
41
+ re-running `setup` is safe — **except** `controltower provision-account`,
42
+ which is not deduped by name. Always check `aws organizations list-accounts`
43
+ before provisioning and skip accounts that already exist.
44
+ - `--dry-run` previews every mutating command; `status` and `whoami` are
45
+ read-only.
46
+ - `controltower provision-account -o` takes the OU **name** (e.g. `Workloads`);
47
+ `register-ou` and `enable-controls` take the OU **id/ARN**. Don't mix them up.
48
+
49
+ ## Step 1 — Assess the environment (read-only)
50
+
51
+ ```bash
52
+ NO_COLOR=1 npx -y @codyswann/aws-soc2-setup@1 whoami -p <management-profile> -r <region>
53
+ NO_COLOR=1 npx -y @codyswann/aws-soc2-setup@1 status -p <management-profile> -r <region>
54
+ ```
55
+
56
+ `status` reports five independent checks: credentials, Organizations,
57
+ recommended OUs, IAM Identity Center, member accounts.
58
+
59
+ **The human gate.** Three prerequisites are console-only and must never be
60
+ automated. If `status` shows Identity Center or the landing zone missing, stop
61
+ and present this checklist in plain language a non-technical operator can
62
+ follow, then end the run:
63
+
64
+ 1. Sign in to the AWS console as the account **root** user and enable MFA on
65
+ the root account.
66
+ 2. In the console, enable **IAM Identity Center** (in your home region).
67
+ 3. In the console, create the **AWS Control Tower landing zone** (this creates
68
+ the Audit and Log Archive accounts; takes ~30–60 minutes).
69
+ 4. Configure a management-account admin profile locally:
70
+ `aws configure sso` (interactive).
71
+
72
+ Re-run this skill after those are done — Step 1 will pass and the flow
73
+ continues from wherever it left off.
74
+
75
+ ## Step 2 — Gather inputs
76
+
77
+ Collect (via arguments if provided, `AskUserQuestion` otherwise; use stated
78
+ defaults when running unattended):
79
+
80
+ | Input | Default | Notes |
81
+ | --- | --- | --- |
82
+ | Management profile | `AWS_PROFILE` | Must be the org management account |
83
+ | Region | `us-east-1` | Match the project's `config/environments.ts` |
84
+ | Profile prefix | project name from `package.json` | Matches `AWS_PROFILE_PREFIX` used by `scripts/pre-deployment-checklist.sh` |
85
+ | Environments | `dev`, `staging`, `production`, `shared` | `shared` hosts the pipeline and gets cross-account trust |
86
+ | Root email pattern | ask — no safe default | Each account needs a **unique** root email; suggest plus-addressing: `aws+<prefix>-<env>@<domain>` |
87
+ | Identity Center username | ask — no safe default | The Identity Store user that gets `AWSAdministratorAccess` on each new account in Step 5; verify it exists (create with `sso create-user` if not) |
88
+ | Identity Center start URL | from `status` output or the console | The **full** `sso_start_url` for the `sso-session` block in Step 5 (default form `https://<domain>.awsapps.com/start`, but custom domains differ — never reconstruct it from parts) |
89
+
90
+ ## Step 3 — Foundation (org, OUs, controls, security services)
91
+
92
+ Show the plan, get explicit approval, then apply:
93
+
94
+ ```bash
95
+ NO_COLOR=1 npx -y @codyswann/aws-soc2-setup@1 setup --dry-run -p <mgmt> -r <region>
96
+ ```
97
+
98
+ Present the dry-run output and **stop for confirmation** before mutating the
99
+ organization — `AskUserQuestion` when interactive, or an unambiguous
100
+ apply/confirm argument from the caller when running unattended. Silence is not
101
+ approval. Only then:
102
+
103
+ ```bash
104
+ NO_COLOR=1 npx -y @codyswann/aws-soc2-setup@1 setup -p <mgmt> -r <region> \
105
+ [--ou <workloads-ou-id>] [--central-account <id>] [--admin-account <id>] [--audit-account <id>]
106
+ ```
107
+
108
+ This ensures the organization, creates the Infrastructure/Workloads/Sandbox
109
+ OUs, enables the security services (GuardDuty, Security Hub, Config, …),
110
+ conformance packs, and — when `--ou` is passed — registers the OU with Control
111
+ Tower and enables the SOC 2 control baseline. Safe to re-run.
112
+
113
+ ## Step 4 — Vend the workload accounts
114
+
115
+ For each environment, **first** check it doesn't already exist:
116
+
117
+ ```bash
118
+ aws organizations list-accounts --profile <mgmt> \
119
+ --query "Accounts[?Name=='<prefix>-<env>'].{Id:Id,Name:Name,State:State}" --output table
120
+ ```
121
+
122
+ (Use `State`, not `Status` — AWS is retiring the `Status` field in favor of
123
+ `State`.)
124
+
125
+ Then provision the missing ones, one at a time, each with a unique root email.
126
+ Stage accounts go into the `Workloads` OU:
127
+
128
+ ```bash
129
+ NO_COLOR=1 npx -y @codyswann/aws-soc2-setup@1 controltower provision-account \
130
+ -p <mgmt> -r <region> \
131
+ -n <prefix>-<env> -e aws+<prefix>-<env>@<domain> -o Workloads --wait
132
+ ```
133
+
134
+ The `shared` (pipeline) account goes into `Infrastructure` instead:
135
+
136
+ ```bash
137
+ NO_COLOR=1 npx -y @codyswann/aws-soc2-setup@1 controltower provision-account \
138
+ -p <mgmt> -r <region> \
139
+ -n <prefix>-shared -e aws+<prefix>-shared@<domain> -o Infrastructure --wait
140
+ ```
141
+
142
+ `--wait` polls Account Factory (~minutes per account) and prints
143
+ `New account ID: <id>`. After all accounts finish, harvest the authoritative
144
+ env → account-ID map from `aws organizations list-accounts` — that map drives
145
+ every later step.
146
+
147
+ ## Step 5 — Identity Center access + local AWS profiles
148
+
149
+ Grant the operator admin on each new account, using the Identity Center
150
+ username collected in Step 2:
151
+
152
+ ```bash
153
+ NO_COLOR=1 npx -y @codyswann/aws-soc2-setup@1 sso assign \
154
+ -p <mgmt> -u <username> -a <account-id> -r AWSAdministratorAccess
155
+ ```
156
+
157
+ (or `sso group -g <prefix>-admins --all-users -a <account-id> -r AWSAdministratorAccess`
158
+ for group-based access. If the user doesn't exist yet, create it first with
159
+ `sso create-user`.)
160
+
161
+ The CLI does **not** generate AWS CLI profiles — write them yourself. Append to
162
+ `~/.aws/config` (never overwrite existing sections; skip blocks that already
163
+ exist):
164
+
165
+ ```ini
166
+ [sso-session <prefix>]
167
+ sso_start_url = <start-url>
168
+ sso_region = <region>
169
+ sso_registration_scopes = sso:account:access
170
+
171
+ [profile <prefix>-dev]
172
+ sso_session = <prefix>
173
+ sso_account_id = <dev-account-id>
174
+ sso_role_name = AWSAdministratorAccess
175
+ region = <region>
176
+ ```
177
+
178
+ `<start-url>` is the full Identity Center start URL collected in Step 2 —
179
+ paste it verbatim, never rebuild it from a domain fragment. One
180
+ `[profile <prefix>-<env>]` block per environment — this exact naming is
181
+ what `scripts/pre-deployment-checklist.sh` and the db-connect scripts resolve.
182
+ Then authenticate and verify every profile maps to the expected account:
183
+
184
+ ```bash
185
+ aws sso login --sso-session <prefix>
186
+ for env in dev staging production shared; do
187
+ aws sts get-caller-identity --profile <prefix>-$env --query Account --output text
188
+ done
189
+ ```
190
+
191
+ ## Step 6 — CDK bootstrap with pipeline trust
192
+
193
+ Bootstrap the shared (pipeline) account first, then each stage account with
194
+ trust back to shared. Honor the project's `CDK_BOOTSTRAP_QUALIFIER` and
195
+ `CDK_BOOTSTRAP_EXECUTION_POLICY_ARN` env vars rather than hardcoding their
196
+ defaults (`config/env.ts` defaults: `hnb659fds` /
197
+ `arn:aws:iam::aws:policy/AdministratorAccess`):
198
+
199
+ ```bash
200
+ qualifier="${CDK_BOOTSTRAP_QUALIFIER:-hnb659fds}"
201
+ exec_policy="${CDK_BOOTSTRAP_EXECUTION_POLICY_ARN:-arn:aws:iam::aws:policy/AdministratorAccess}"
202
+
203
+ npx cdk bootstrap aws://<shared-id>/<region> --profile <prefix>-shared \
204
+ --qualifier "$qualifier"
205
+
206
+ for env in dev staging production; do
207
+ npx cdk bootstrap aws://<env-id>/<region> --profile <prefix>-$env \
208
+ --qualifier "$qualifier" \
209
+ --trust <shared-id> \
210
+ --cloudformation-execution-policies "$exec_policy"
211
+ done
212
+ ```
213
+
214
+ The `--trust` flag is the manual chicken-and-egg step the project's
215
+ `trust-policy-stack` documents as CfnOutputs — this skill is where it actually
216
+ runs.
217
+
218
+ ## Step 7 — Wire the project
219
+
220
+ 1. **`config/environments.ts`** (when the project has it): replace each
221
+ environment's `accountId: "PLACEHOLDER"` with the real 12-digit ID from the
222
+ Step 4 map, and confirm `region` matches. This single edit is what flips
223
+ each environment from synth-only to deployable. If the project uses a
224
+ different layout, skip with a note — the `.lisa.config.json` record below
225
+ still applies.
226
+ 2. **GitHub secrets** — only when `.github/workflows/ci.yml` references them:
227
+ ```bash
228
+ gh secret set AWS_ACCOUNT_ID_DEV --body "<dev-id>"
229
+ gh secret set AWS_ACCOUNT_ID_STAGING --body "<staging-id>"
230
+ gh secret set AWS_ACCOUNT_ID_PRODUCTION --body "<production-id>"
231
+ gh secret set AWS_INFRA_ACCOUNT_ID --body "<shared-id>"
232
+ ```
233
+ 3. **`.lisa.config.json`** — record the machine-readable account map (merge
234
+ with `jq`, preserving every other key):
235
+ ```json
236
+ {
237
+ "aws": {
238
+ "region": "<region>",
239
+ "profilePrefix": "<prefix>",
240
+ "accounts": {
241
+ "dev": "<dev-id>",
242
+ "staging": "<staging-id>",
243
+ "production": "<production-id>",
244
+ "shared": "<shared-id>"
245
+ }
246
+ }
247
+ }
248
+ ```
249
+
250
+ ## Step 8 — Verify and report
251
+
252
+ - Every `<prefix>-<env>` profile authenticates to its expected account ID
253
+ (`aws sts get-caller-identity`).
254
+ - `scripts/pre-deployment-checklist.sh` passes when the project ships it.
255
+ - `npx cdk synth` succeeds and no environment is skipped as non-deployable.
256
+ - Report a table: environment → account ID → profile → bootstrapped (yes/no).
257
+ - Name what remains manual, in operator-readable language — e.g. the GitHub
258
+ CodeConnections handshake for pipeline mode (`config/github.ts`
259
+ `codeConnectionArn`) is an interactive console step outside this skill's
260
+ scope, and hardening extras (`root remove-access`, `scp deny-iam-users`,
261
+ `scp alert-management`) are offered but require explicit confirmation since
262
+ they are org-wide and destructive.
263
+
264
+ ## Cross-agent invocation
265
+
266
+ The same SKILL.md ships to every supported runtime via the plugin build; all
267
+ logic lives here, never in the command shim.
268
+
269
+ - Claude Code / OpenCode / Cursor: `/lisa-cdk:setup:aws` command, or invoke the
270
+ skill directly.
271
+ - Codex (no slash commands): `$setup-aws-accounts` (the command shim also
272
+ installs as `$lisa-setup-aws`).
273
+ - agy / Copilot: the skill is delivered through the generated plugin variants;
274
+ invoke it by name.
275
+
276
+ ## Rules
277
+
278
+ - **Never automate the console-only steps** (root MFA, enabling Identity
279
+ Center, landing zone creation). Present the checklist, stop, and let a human
280
+ do them. Every blocked reason must be readable by a non-technical operator.
281
+ - Always `--dry-run` (or `status`) first and show the plan before mutating an
282
+ organization. `root` and `scp` subcommands are destructive org-wide — never
283
+ run them without explicit user confirmation in this session.
284
+ - Check before create: `list-accounts` before `provision-account`; read
285
+ `~/.aws/config` before appending profile blocks; never clobber existing
286
+ profiles or config keys.
287
+ - Harvest account IDs from `aws organizations list-accounts`, not from scraped
288
+ CLI text.
289
+ - Never write credentials or secrets into the repository. Account IDs are not
290
+ secret and belong in config; keys and tokens never do.
291
+ - Do not stage or modify unrelated working-tree files; the only repo edits are
292
+ `config/environments.ts` and `.lisa.config.json`.
@@ -0,0 +1,4 @@
1
+ display_name: "Setup AWS Accounts"
2
+ short_description: "Provision the multi-account AWS…"
3
+ default_prompt:
4
+ - "Use $setup-aws-accounts: Provision the multi-account AWS…."
@@ -0,0 +1,7 @@
1
+ ---
2
+ description: "Provision the dev/staging/production/shared AWS accounts this CDK project deploys into via the @codyswann/aws-soc2-setup CLI (Organizations, Control Tower, IAM Identity Center, SOC 2 controls), then wire them in end-to-end: SSO profiles, cdk bootstrap with pipeline trust, PLACEHOLDER account IDs in config/environments.ts, AWS_ACCOUNT_ID_* GitHub secrets, and the .lisa.config.json account map. Idempotent; console-only prerequisites (root MFA, Identity Center, landing zone) surface as a human checklist instead of being automated."
3
+ allowed-tools: ["Skill"]
4
+ argument-hint: "[management-profile] [region] [dry-run]"
5
+ ---
6
+
7
+ Use the setup-aws-accounts skill (/lisa-cdk:setup-aws-accounts on harnesses with plugin commands; $setup-aws-accounts on Codex) to assess the AWS organization, run the aws-soc2-setup foundation and account vending, write the SSO profiles, cdk-bootstrap every account with cross-account trust, and wire the resulting account IDs into config/environments.ts, GitHub secrets, and .lisa.config.json. $ARGUMENTS