container-superposition 0.1.3 → 0.1.5

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 (141) hide show
  1. package/README.md +72 -1014
  2. package/dist/scripts/init.js +512 -238
  3. package/dist/scripts/init.js.map +1 -1
  4. package/dist/tool/commands/adopt.d.ts +62 -0
  5. package/dist/tool/commands/adopt.d.ts.map +1 -0
  6. package/dist/tool/commands/adopt.js +767 -0
  7. package/dist/tool/commands/adopt.js.map +1 -0
  8. package/dist/tool/commands/doctor.js +2 -2
  9. package/dist/tool/commands/explain.d.ts.map +1 -1
  10. package/dist/tool/commands/explain.js +88 -0
  11. package/dist/tool/commands/explain.js.map +1 -1
  12. package/dist/tool/commands/hash.d.ts +36 -0
  13. package/dist/tool/commands/hash.d.ts.map +1 -0
  14. package/dist/tool/commands/hash.js +242 -0
  15. package/dist/tool/commands/hash.js.map +1 -0
  16. package/dist/tool/commands/plan.d.ts +53 -0
  17. package/dist/tool/commands/plan.d.ts.map +1 -1
  18. package/dist/tool/commands/plan.js +784 -42
  19. package/dist/tool/commands/plan.js.map +1 -1
  20. package/dist/tool/questionnaire/composer.d.ts +12 -3
  21. package/dist/tool/questionnaire/composer.d.ts.map +1 -1
  22. package/dist/tool/questionnaire/composer.js +133 -20
  23. package/dist/tool/questionnaire/composer.js.map +1 -1
  24. package/dist/tool/schema/project-config.d.ts +15 -0
  25. package/dist/tool/schema/project-config.d.ts.map +1 -0
  26. package/dist/tool/schema/project-config.js +359 -0
  27. package/dist/tool/schema/project-config.js.map +1 -0
  28. package/dist/tool/schema/types.d.ts +57 -1
  29. package/dist/tool/schema/types.d.ts.map +1 -1
  30. package/dist/tool/utils/backup.d.ts +23 -0
  31. package/dist/tool/utils/backup.d.ts.map +1 -0
  32. package/dist/tool/utils/backup.js +123 -0
  33. package/dist/tool/utils/backup.js.map +1 -0
  34. package/dist/tool/utils/gitignore.d.ts +15 -0
  35. package/dist/tool/utils/gitignore.d.ts.map +1 -0
  36. package/dist/tool/utils/gitignore.js +41 -0
  37. package/dist/tool/utils/gitignore.js.map +1 -0
  38. package/dist/tool/utils/services-export.d.ts +14 -0
  39. package/dist/tool/utils/services-export.d.ts.map +1 -0
  40. package/dist/tool/utils/services-export.js +478 -0
  41. package/dist/tool/utils/services-export.js.map +1 -0
  42. package/dist/tool/utils/summary.d.ts +69 -0
  43. package/dist/tool/utils/summary.d.ts.map +1 -0
  44. package/dist/tool/utils/summary.js +260 -0
  45. package/dist/tool/utils/summary.js.map +1 -0
  46. package/docs/README.md +12 -2
  47. package/docs/adopt.md +196 -0
  48. package/docs/custom-patches.md +1 -1
  49. package/docs/discovery-commands.md +55 -3
  50. package/docs/examples.md +40 -6
  51. package/docs/filesystem-contract.md +58 -0
  52. package/docs/hash.md +183 -0
  53. package/docs/minimal-and-editor.md +1 -1
  54. package/docs/overlays.md +108 -5
  55. package/docs/presets-architecture.md +1 -1
  56. package/docs/presets.md +1 -1
  57. package/docs/publishing.md +36 -23
  58. package/docs/security.md +43 -0
  59. package/docs/specs/001-verbose-plan-graph/checklists/requirements.md +36 -0
  60. package/docs/specs/001-verbose-plan-graph/contracts/plan-verbose-output.md +96 -0
  61. package/docs/specs/001-verbose-plan-graph/data-model.md +111 -0
  62. package/docs/specs/001-verbose-plan-graph/plan.md +127 -0
  63. package/docs/specs/001-verbose-plan-graph/quickstart.md +106 -0
  64. package/docs/specs/001-verbose-plan-graph/research.md +100 -0
  65. package/docs/specs/001-verbose-plan-graph/spec.md +128 -0
  66. package/docs/specs/001-verbose-plan-graph/tasks.md +223 -0
  67. package/docs/specs/002-superposition-config-file/checklists/requirements.md +36 -0
  68. package/docs/specs/002-superposition-config-file/contracts/init-project-config.md +98 -0
  69. package/docs/specs/002-superposition-config-file/data-model.md +126 -0
  70. package/docs/specs/002-superposition-config-file/plan.md +208 -0
  71. package/docs/specs/002-superposition-config-file/quickstart.md +140 -0
  72. package/docs/specs/002-superposition-config-file/research.md +144 -0
  73. package/docs/specs/002-superposition-config-file/spec.md +130 -0
  74. package/docs/specs/002-superposition-config-file/tasks.md +213 -0
  75. package/docs/team-workflow.md +27 -1
  76. package/docs/workflows.md +136 -0
  77. package/overlays/.presets/microservice.yml +32 -6
  78. package/overlays/.presets/sdd.yml +84 -0
  79. package/overlays/.presets/web-api.yml +76 -56
  80. package/overlays/README.md +7 -1
  81. package/overlays/amp/README.md +70 -0
  82. package/overlays/amp/devcontainer.patch.json +3 -0
  83. package/overlays/amp/overlay.yml +15 -0
  84. package/overlays/amp/setup.sh +21 -0
  85. package/overlays/amp/verify.sh +21 -0
  86. package/overlays/claude-code/README.md +83 -0
  87. package/overlays/claude-code/devcontainer.patch.json +3 -0
  88. package/overlays/claude-code/overlay.yml +15 -0
  89. package/overlays/claude-code/setup.sh +21 -0
  90. package/overlays/claude-code/verify.sh +21 -0
  91. package/overlays/cloudflared/README.md +190 -0
  92. package/overlays/cloudflared/devcontainer.patch.json +3 -0
  93. package/overlays/cloudflared/overlay.yml +15 -0
  94. package/overlays/cloudflared/setup.sh +49 -0
  95. package/overlays/cloudflared/verify.sh +21 -0
  96. package/overlays/direnv/README.md +6 -4
  97. package/overlays/direnv/setup.sh +0 -12
  98. package/overlays/gemini-cli/README.md +77 -0
  99. package/overlays/gemini-cli/devcontainer.patch.json +3 -0
  100. package/overlays/gemini-cli/overlay.yml +15 -0
  101. package/overlays/gemini-cli/setup.sh +21 -0
  102. package/overlays/gemini-cli/verify.sh +21 -0
  103. package/overlays/grpc-tools/README.md +242 -0
  104. package/overlays/grpc-tools/devcontainer.patch.json +14 -0
  105. package/overlays/grpc-tools/overlay.yml +14 -0
  106. package/overlays/grpc-tools/setup.sh +57 -0
  107. package/overlays/grpc-tools/verify.sh +47 -0
  108. package/overlays/keycloak/.env.example +5 -0
  109. package/overlays/keycloak/README.md +238 -0
  110. package/overlays/keycloak/devcontainer.patch.json +17 -0
  111. package/overlays/keycloak/docker-compose.yml +32 -0
  112. package/overlays/keycloak/overlay.yml +23 -0
  113. package/overlays/keycloak/verify.sh +54 -0
  114. package/overlays/mailpit/.env.example +4 -0
  115. package/overlays/mailpit/README.md +191 -0
  116. package/overlays/mailpit/devcontainer.patch.json +20 -0
  117. package/overlays/mailpit/docker-compose.yml +17 -0
  118. package/overlays/mailpit/overlay.yml +26 -0
  119. package/overlays/mailpit/verify.sh +52 -0
  120. package/overlays/ngrok/overlay.yml +2 -1
  121. package/overlays/opencode/README.md +76 -0
  122. package/overlays/opencode/devcontainer.patch.json +3 -0
  123. package/overlays/opencode/overlay.yml +14 -0
  124. package/overlays/opencode/setup.sh +21 -0
  125. package/overlays/opencode/verify.sh +21 -0
  126. package/overlays/python/README.md +51 -35
  127. package/overlays/python/devcontainer.patch.json +7 -4
  128. package/overlays/python/setup.sh +50 -23
  129. package/overlays/python/verify.sh +29 -1
  130. package/overlays/spec-kit/README.md +181 -0
  131. package/overlays/spec-kit/devcontainer.patch.json +6 -0
  132. package/overlays/spec-kit/overlay.yml +19 -0
  133. package/overlays/spec-kit/setup.sh +45 -0
  134. package/overlays/spec-kit/verify.sh +33 -0
  135. package/overlays/windsurf-cli/README.md +69 -0
  136. package/overlays/windsurf-cli/devcontainer.patch.json +3 -0
  137. package/overlays/windsurf-cli/overlay.yml +15 -0
  138. package/overlays/windsurf-cli/setup.sh +21 -0
  139. package/overlays/windsurf-cli/verify.sh +21 -0
  140. package/package.json +1 -1
  141. package/tool/schema/config.schema.json +138 -9
@@ -0,0 +1,213 @@
1
+ # Tasks: Project Configuration File
2
+
3
+ **Input**: Design documents from `docs/specs/002-superposition-config-file/`
4
+ **Prerequisites**: [plan.md](plan.md), [spec.md](spec.md), [research.md](research.md), [data-model.md](data-model.md), [init-project-config.md](contracts/init-project-config.md), [quickstart.md](quickstart.md)
5
+
6
+ **Tests**: Add automated coverage for config discovery, precedence, no-config fallback, explicit `--from-project`, implicit project-file regen, manifest isolation, source-conflict validation, validation failures, and customization parity in `tool/__tests__/commands.test.ts`, `tool/__tests__/composition.test.ts`, `tool/__tests__/manifest-only.test.ts`, and `tool/__tests__/minimal-and-editor.test.ts`, then run `npm test`, `npm run lint`, and `npm run test:smoke`.
7
+
8
+ **Organization**: Tasks are grouped by user story to enable independent implementation and testing of each story.
9
+
10
+ ## Format: `[ID] [P?] [Story] Description`
11
+
12
+ - **[P]**: Can run in parallel (different files, no dependencies)
13
+ - **[Story]**: Which user story this task belongs to (e.g. `US1`, `US2`, `US3`)
14
+ - Include exact repo-relative file paths in descriptions
15
+
16
+ ## Phase 1: Setup (Shared Infrastructure)
17
+
18
+ **Purpose**: Record the approved spec gate and align the feature docs with the implementation baseline before code changes.
19
+
20
+ - [x] T001 Confirm approved spec status and implementation gate in `docs/specs/002-superposition-config-file/spec.md`
21
+ - [x] T002 Align implementation sequencing and verification scope in `docs/specs/002-superposition-config-file/plan.md`
22
+ - [x] T003 Align parity examples and validation steps in `docs/specs/002-superposition-config-file/quickstart.md`
23
+ - [x] T004 [P] Record supported project-config surface and customization parity expectations in `docs/specs/002-superposition-config-file/contracts/init-project-config.md`
24
+
25
+ ---
26
+
27
+ ## Phase 2: Foundational (Blocking Prerequisites)
28
+
29
+ **Purpose**: Add the shared project-config schema and merge-path support that every story depends on.
30
+
31
+ **⚠️ CRITICAL**: No user story work can begin until this phase is complete
32
+
33
+ - [x] T005 Define project-config file discovery, parsed shape, and validation helpers in `tool/schema/project-config.ts`
34
+ - [x] T006 Extend shared config types and `QuestionnaireAnswers` parity fields in `tool/schema/types.ts`
35
+ - [x] T007 Update supported config schema entries for project-config parity in `tool/schema/config.schema.json`
36
+ - [x] T008 Refactor answer-source merging to accept project-config defaults alongside manifest and CLI inputs in `scripts/init.ts`
37
+ - [x] T009 Add foundational regression coverage for project-config discovery, merge precedence, and dual-file ambiguity in `tool/__tests__/commands.test.ts`
38
+ - [x] T010 Add fixture coverage for supported customization parity inputs in `tool/__tests__/composition.test.ts`
39
+
40
+ **Checkpoint**: Foundation ready - user story implementation can now begin in priority order
41
+
42
+ ---
43
+
44
+ ## Phase 3: User Story 1 - Generate from committed project config (Priority: P1) 🎯 MVP
45
+
46
+ **Goal**: Let maintainers define the full supported generation intent, including supported customizations, in one repository-root config file and generate the same output as clean generation.
47
+
48
+ **Independent Test**: Put a valid `.superposition.yml` in the repository root with stack, overlays, output path, and supported customization inputs such as custom container definitions, environment-related settings, and additional generated features, run `npm run init`, and confirm the generated output matches equivalent clean-generation input without re-entering declared values.
49
+
50
+ ### Verification for User Story 1
51
+
52
+ - [x] T011 [US1] Add command regression coverage for valid project-config driven generation in `tool/__tests__/commands.test.ts`
53
+ - [x] T012 [US1] Add composition parity coverage for project-config custom image and container definition inputs in `tool/__tests__/composition.test.ts`
54
+ - [x] T013 [US1] Add parity coverage for environment-related settings and additional generated features in `tool/__tests__/minimal-and-editor.test.ts`
55
+
56
+ ### Implementation for User Story 1
57
+
58
+ - [x] T014 [US1] Load repository-root `.superposition.yml` and `superposition.yml` defaults into the standard init flow in `scripts/init.ts`
59
+ - [x] T015 [US1] Map project-config selections into the clean-generation answer model in `tool/schema/project-config.ts`
60
+ - [x] T016 [US1] Preserve supported customization inputs through generation and summary rendering in `scripts/init.ts`
61
+ - [x] T017 [US1] Ensure project-config driven answers produce the same composed output as equivalent clean-generation input in `tool/questionnaire/composer.ts`
62
+ - [x] T018 [US1] Keep generated run summaries accurate for project-config sourced generation in `tool/utils/summary.ts`
63
+
64
+ **Checkpoint**: User Story 1 should now be fully functional and testable on its own
65
+
66
+ ---
67
+
68
+ ## Phase 4: User Story 2 - Use config-driven setup in automation (Priority: P2)
69
+
70
+ **Goal**: Let teams run unattended generation from a committed project config while preserving per-run overrides and explicit manifest isolation.
71
+
72
+ **Independent Test**: Run `npm run init` in a non-interactive repository with a valid project config and confirm declared values are not prompted again, direct CLI flags override only that run, and `--from-manifest` remains isolated from project-config defaults.
73
+
74
+ ### Verification for User Story 2
75
+
76
+ - [x] T019 [US2] Add non-interactive command regression coverage for project-config defaults and CLI override precedence in `tool/__tests__/commands.test.ts`
77
+ - [x] T020 [US2] Add manifest-isolation regression coverage for project-config and `--from-manifest` interactions in `tool/__tests__/manifest-only.test.ts`
78
+ - [x] T021 [US2] Add regression coverage for no-config fallback to current interactive and flag-driven behavior in `tool/__tests__/commands.test.ts`
79
+ - [x] T022 [US2] Add regression coverage for partial project-config defaults that still require remaining answers in `tool/__tests__/commands.test.ts`
80
+
81
+ ### Implementation for User Story 2
82
+
83
+ - [x] T023 [US2] Apply project-config values as default persisted input for standard init without prompting for already-declared values in `scripts/init.ts`
84
+ - [x] T024 [US2] Preserve partial project-config values as shared defaults while collecting only unresolved required answers in `scripts/init.ts`
85
+ - [x] T025 [US2] Preserve run-scoped CLI override precedence over project-config defaults in `scripts/init.ts`
86
+ - [x] T026 [US2] Keep explicit manifest mode isolated from repository project-config defaults in `scripts/init.ts`
87
+
88
+ **Checkpoint**: User Stories 1 and 2 should both work independently
89
+
90
+ ---
91
+
92
+ ## Phase 5: User Story 3 - Correct invalid or ambiguous config quickly (Priority: P3)
93
+
94
+ **Goal**: Stop invalid, unsupported, conflicting, or ambiguous project-config input before generation and point users to the corrective action.
95
+
96
+ **Independent Test**: Introduce invalid YAML, unsupported keys, unsupported customization values, conflicting selections, missing non-interactive requirements, and both supported filenames, then confirm generation stops before output with actionable guidance tied to the repository state or config entry.
97
+
98
+ ### Verification for User Story 3
99
+
100
+ - [x] T027 [US3] Add command regression coverage for invalid YAML, unsupported keys, and unsupported values in `tool/__tests__/commands.test.ts`
101
+ - [x] T028 [US3] Add regression coverage for conflicting selections, missing required non-interactive values, and dual-file ambiguity in `tool/__tests__/commands.test.ts`
102
+ - [x] T029 [US3] Add regression coverage for unsupported customization declarations outside the clean-generation surface in `tool/__tests__/commands.test.ts`
103
+
104
+ ### Implementation for User Story 3
105
+
106
+ - [x] T030 [US3] Validate project-config syntax, supported keys, supported values, and conflicting selections before generation in `tool/schema/project-config.ts`
107
+ - [x] T031 [US3] Report repository-root ambiguity and non-interactive missing-value failures with actionable guidance in `scripts/init.ts`
108
+ - [x] T032 [US3] Reject unsupported customization declarations that fall outside the supported clean-generation surface in `tool/schema/project-config.ts`
109
+
110
+ **Checkpoint**: All user stories should now be independently functional
111
+
112
+ ---
113
+
114
+ ## Phase 6: Polish & Cross-Cutting Concerns
115
+
116
+ **Purpose**: Finish documentation, changelog, and end-to-end verification for the declarative workflow.
117
+
118
+ - [x] T033 [P] Document project-config usage, parity scope, and supported customization examples in `README.md`
119
+ - [x] T034 [P] Document local and CI workflow examples for project config in `docs/workflows.md`
120
+ - [x] T035 [P] Document project-config parity examples and customization cases in `docs/examples.md`
121
+ - [x] T036 Update the user-visible project-config change summary in `CHANGELOG.md`
122
+ - [x] T037 Run the maintainer workflow review for SC-003 and record the outcome in `docs/specs/002-superposition-config-file/quickstart.md`
123
+ - [x] T038 Record final verification steps and observed outcomes in `docs/specs/002-superposition-config-file/quickstart.md`
124
+ - [x] T039 Run `npm test`, `npm run lint`, and `npm run test:smoke`, then record the results in `docs/specs/002-superposition-config-file/quickstart.md`
125
+ - [x] T040 Add explicit `--from-project` and implicit `regen` project-file regression coverage in `tool/__tests__/commands.test.ts`
126
+ - [x] T041 Implement `--from-project`, implicit project-file `regen`, and source-conflict validation in `scripts/init.ts`
127
+ - [x] T042 Update project-file regeneration and conflict-resolution documentation in `README.md`, `docs/workflows.md`, and `docs/examples.md`
128
+ - [x] T043 Update the user-visible changelog entry to include `regen --from-project`, implicit project-file `regen`, and source-conflict validation in `CHANGELOG.md`
129
+
130
+ ---
131
+
132
+ ## Dependencies & Execution Order
133
+
134
+ ### Phase Dependencies
135
+
136
+ - **Setup (Phase 1)**: Starts immediately
137
+ - **Foundational (Phase 2)**: Depends on Setup completion and blocks all user story work
138
+ - **User Story 1 (Phase 3)**: Depends on Foundational completion
139
+ - **User Story 2 (Phase 4)**: Depends on Foundational completion and should follow US1 because it extends the same answer-resolution path into unattended and manifest-sensitive flows
140
+ - **User Story 3 (Phase 5)**: Depends on Foundational completion and should follow US1 and US2 because validation rules depend on the final supported project-config surface and precedence behavior
141
+ - **Polish (Phase 6)**: Depends on the desired user stories being complete and now also covers explicit source-selection and regeneration workflow updates
142
+
143
+ ### User Story Dependencies
144
+
145
+ - **User Story 1 (P1)**: No dependency on other stories after Phase 2
146
+ - **User Story 2 (P2)**: Depends on the project-config merge path from US1 and extends it to automation, overrides, and manifest isolation
147
+ - **User Story 3 (P3)**: Depends on the supported config surface from US1 and the precedence rules from US2 so failure behavior matches the completed feature
148
+
149
+ ### Within Each User Story
150
+
151
+ - Add or update verification tasks before implementation for that story
152
+ - Land project-config loading and normalization before parity-sensitive generation changes
153
+ - Complete precedence and failure-handling behavior before final docs and smoke validation
154
+
155
+ ### Parallel Opportunities
156
+
157
+ - `T003` and `T004` can run in parallel during Setup
158
+ - `T009` and `T010` can run in parallel after the foundational schema shape is settled
159
+ - `T012` and `T013` can run in parallel once project-config mapping is defined
160
+ - `T033`, `T034`, and `T035` can run in parallel after behavior is stable
161
+ - `T040`, `T042`, and `T043` can run in parallel after the source-selection behavior is stable
162
+
163
+ ---
164
+
165
+ ## Parallel Example: User Story 1
166
+
167
+ ```bash
168
+ Task: "Add composition parity coverage for project-config custom image and container definition inputs in tool/__tests__/composition.test.ts"
169
+ Task: "Add parity coverage for environment-related settings and additional generated features in tool/__tests__/minimal-and-editor.test.ts"
170
+ ```
171
+
172
+ ## Parallel Example: Polish
173
+
174
+ ```bash
175
+ Task: "Document project-config usage, parity scope, and supported customization examples in README.md"
176
+ Task: "Document local and CI workflow examples for project config in docs/workflows.md"
177
+ Task: "Document project-config parity examples and customization cases in docs/examples.md"
178
+ ```
179
+
180
+ ---
181
+
182
+ ## Implementation Strategy
183
+
184
+ ### MVP First (User Story 1 Only)
185
+
186
+ 1. Complete Phase 1: Setup
187
+ 2. Complete Phase 2: Foundational
188
+ 3. Complete Phase 3: User Story 1
189
+ 4. Validate project-config driven generation against equivalent clean-generation output
190
+ 5. Stop for review before extending into unattended and failure-handling behavior
191
+
192
+ ### Incremental Delivery
193
+
194
+ 1. Land project-config discovery, typing, and merge foundations
195
+ 2. Deliver User Story 1 for repository-root config driven generation with customization parity
196
+ 3. Add User Story 2 for automation, CLI overrides, no-config fallback, and manifest isolation
197
+ 4. Add User Story 3 for validation, ambiguity handling, and corrective guidance
198
+ 5. Finish docs, changelog, and full verification
199
+ 6. Add explicit source-selection and project-file regeneration follow-through so spec, plan, tasks, and CLI behavior stay aligned
200
+
201
+ ### Parallel Team Strategy
202
+
203
+ 1. One developer completes Setup and Foundational work
204
+ 2. After the project-config schema and merge path are stable, one developer can drive US1 implementation while another prepares the parity-focused verification cases
205
+ 3. After US1 is stable, the same command owner should complete US2 and US3 because they concentrate in `scripts/init.ts` and shared validation helpers
206
+
207
+ ---
208
+
209
+ ## Notes
210
+
211
+ - All tasks use the required checklist format with IDs, optional `[P]` markers, story labels for story phases, and exact repo-relative file paths
212
+ - The approved spec gate is already satisfied; execution readiness now depends on completing implementation, verification, and documentation tasks cleanly
213
+ - Favor command-level and composition-level regression tests because the risk is user-visible generation behavior and customization parity drift
@@ -33,6 +33,31 @@ my-project/
33
33
 
34
34
  ## Step-by-Step Setup
35
35
 
36
+ ### 0. Migrating an Existing Devcontainer (Optional)
37
+
38
+ If you already have a hand-crafted `.devcontainer/`, use `adopt` to create the
39
+ initial manifest automatically instead of writing it by hand:
40
+
41
+ ```bash
42
+ # See what would be detected and generated (nothing is written)
43
+ npx container-superposition adopt --dry-run
44
+
45
+ # Run the adoption (writes superposition.json and custom/ patches)
46
+ npx container-superposition adopt
47
+ ```
48
+
49
+ `adopt` reads every feature URI, VS Code extension, and Docker Compose service
50
+ image in your existing configuration and maps them to overlays. Anything with
51
+ no overlay equivalent (custom features, project-specific services, custom
52
+ mounts, unmatched environment variables, …) is written to
53
+ `.devcontainer/custom/` so it survives every subsequent `regen`.
54
+
55
+ `superposition.json` is written to the **project root** (not inside
56
+ `.devcontainer/`), so it can be committed alongside your application code and
57
+ shared with the rest of the team — matching the standard team workflow.
58
+
59
+ See the [Adopt Command guide](adopt.md) for full details.
60
+
36
61
  ### 1. Create the Team Manifest
37
62
 
38
63
  The team lead or maintainer creates the initial manifest:
@@ -51,7 +76,7 @@ This creates `superposition.json` in the current directory:
51
76
  ```json
52
77
  {
53
78
  "manifestVersion": "1",
54
- "generatedBy": "0.1.2",
79
+ "generatedBy": "X.Y.Z",
55
80
  "generated": "2026-02-17T14:00:00.000Z",
56
81
  "baseTemplate": "compose",
57
82
  "baseImage": "bookworm",
@@ -535,6 +560,7 @@ code .
535
560
 
536
561
  ## See Also
537
562
 
563
+ - [Adopt Command](adopt.md) - Migrate an existing devcontainer to the overlay-based workflow
538
564
  - [Quick Reference](quick-reference.md) - Common commands and flags
539
565
  - [Overlay Documentation](overlays.md) - Available overlays
540
566
  - [Custom Patches](../tool/README.md#custom-patches) - Custom patch format
@@ -0,0 +1,136 @@
1
+ # Workflows and Regeneration
2
+
3
+ This guide covers project-config driven generation, manifest-based regeneration,
4
+ and common workflows.
5
+
6
+ ## Project Config Workflow
7
+
8
+ Commit exactly one project config file at the repository root:
9
+
10
+ - `.superposition.yml`
11
+ - `superposition.yml`
12
+
13
+ Use it when you want standard `init` runs to start from committed defaults
14
+ instead of a copied command line.
15
+
16
+ ```bash
17
+ npx container-superposition init
18
+ ```
19
+
20
+ Use `--no-interactive` when the config fully describes the intended setup and
21
+ you want unattended generation:
22
+
23
+ ```bash
24
+ npx container-superposition init --no-interactive
25
+ ```
26
+
27
+ Direct CLI flags still win for that run only:
28
+
29
+ ```bash
30
+ npx container-superposition init --no-interactive --output ./tmp-devcontainer
31
+ ```
32
+
33
+ ## Manifest Basics
34
+
35
+ Every generation writes a `superposition.json` manifest that records your choices. It enables:
36
+
37
+ - Reproducible environments
38
+ - Safe upgrades
39
+ - Team sharing
40
+ - Regeneration with backups
41
+
42
+ ## When to Regenerate
43
+
44
+ Use `regen` when you:
45
+
46
+ - Add or remove overlays
47
+ - Update to newer overlay versions
48
+ - Change port offsets
49
+ - Switch base templates
50
+
51
+ Use `init --from-project` or `init --from-manifest` when you:
52
+
53
+ - Want to start from a persisted source and then adjust choices interactively
54
+ - Want a persisted source to provide defaults before making a targeted change
55
+
56
+ Use manual edits when you:
57
+
58
+ - Adjust VS Code settings
59
+ - Add small scripts or config files
60
+ - Tweak a single setting in custom patches
61
+
62
+ ## Quick Regeneration
63
+
64
+ ```bash
65
+ # Uses the repository project file when one exists
66
+ npx container-superposition regen
67
+
68
+ # Or select the project file explicitly
69
+ npx container-superposition regen --from-project
70
+
71
+ # Falls back to manifest discovery when no project file exists
72
+ npx container-superposition regen
73
+ ```
74
+
75
+ ## Regeneration With Changes
76
+
77
+ ```bash
78
+ # Uses manifest as defaults, then prompts for changes
79
+ npx container-superposition init --from-manifest ./.devcontainer/superposition.json
80
+
81
+ # Uses the repository project file as defaults, then prompts for changes
82
+ npx container-superposition init --from-project
83
+ ```
84
+
85
+ ## Source-Selection Conflicts
86
+
87
+ Persisted-input source flags are mutually exclusive and do not mix with
88
+ clean-generation selection flags:
89
+
90
+ ```bash
91
+ # Invalid: two persisted sources
92
+ npx container-superposition regen --from-project --from-manifest ./.devcontainer/superposition.json
93
+
94
+ # Invalid: persisted source plus structural selection flags
95
+ npx container-superposition init --from-project --stack compose
96
+ ```
97
+
98
+ ## Non-Interactive (CI/CD)
99
+
100
+ ```bash
101
+ npx container-superposition init --no-interactive
102
+
103
+ # Or keep using an explicit manifest when you want that mode
104
+ npx container-superposition init \
105
+ --from-manifest ./.devcontainer/superposition.json \
106
+ --no-interactive \
107
+ --no-backup
108
+ ```
109
+
110
+ ## Backup Behavior
111
+
112
+ - Default: creates `.devcontainer.backup-<timestamp>/`
113
+ - `--no-backup`: skips backup
114
+ - `--backup-dir <path>`: writes backups to a custom location
115
+
116
+ ## Example Workflow
117
+
118
+ ```bash
119
+ # 1. Initial setup
120
+ npx container-superposition init --stack compose --language nodejs --database postgres
121
+
122
+ # 2. Later: reapply the committed project file
123
+ npx container-superposition regen
124
+
125
+ # 3. Or regenerate explicitly from a manifest when that is the intended source
126
+ npx container-superposition init --from-manifest ./.devcontainer/superposition.json
127
+
128
+ # 4. Update to latest overlays
129
+ npx container-superposition@latest regen
130
+ ```
131
+
132
+ ## Team Workflow
133
+
134
+ For a manifest-first approach (commit only `superposition.json`), see:
135
+
136
+ - [team-workflow.md](team-workflow.md)
@@ -26,11 +26,35 @@ selects:
26
26
  options: [dotnet, nodejs, python, go, java]
27
27
  defaultOption: nodejs
28
28
 
29
- messaging:
30
- id: messaging
31
- prompt: Select message broker
32
- options: [rabbitmq, redpanda, nats]
33
- defaultOption: rabbitmq
29
+ # Parameterized slots
30
+ parameters:
31
+ broker:
32
+ description: 'Message broker'
33
+ default: rabbitmq
34
+ options:
35
+ - id: rabbitmq
36
+ overlays: [rabbitmq]
37
+ description: 'RabbitMQ AMQP message broker'
38
+ - id: nats
39
+ overlays: [nats]
40
+ description: 'NATS lightweight messaging'
41
+ - id: redpanda
42
+ overlays: [redpanda]
43
+ description: 'Redpanda Kafka-compatible streaming'
44
+ - id: none
45
+ overlays: []
46
+ description: 'No message broker'
47
+
48
+ observability:
49
+ description: 'Observability stack level'
50
+ default: standard
51
+ options:
52
+ - id: standard
53
+ overlays: []
54
+ description: 'Standard (Jaeger + Prometheus + Grafana, already included)'
55
+ - id: full
56
+ overlays: [loki]
57
+ description: 'Full stack - adds Loki for log aggregation'
34
58
 
35
59
  # Glue configuration - integration helpers
36
60
  glueConfig:
@@ -66,11 +90,12 @@ glueConfig:
66
90
 
67
91
  ### Services
68
92
 
69
- - **Message Broker**: Async communication between services
93
+ - **Message Broker**: Async communication between services (RabbitMQ/NATS/Redpanda based on your choice)
70
94
  - **OpenTelemetry Collector**: Distributed tracing collection (ports 4317, 4318)
71
95
  - **Jaeger**: Distributed tracing UI (port 16686)
72
96
  - **Prometheus**: Metrics storage (port 9090)
73
97
  - **Grafana**: Unified observability dashboard (port 3000)
98
+ - **Loki** _(full observability only)_: Log aggregation (port 3100)
74
99
 
75
100
  ### Connection Strings
76
101
 
@@ -100,6 +125,7 @@ glueConfig:
100
125
  2. Publish/subscribe to messages via your chosen broker
101
126
  3. View distributed traces in Jaeger at http://localhost:16686
102
127
  4. Monitor metrics in Grafana at http://localhost:3000
128
+ 5. _(Full observability)_ Query logs in Loki via Grafana at http://localhost:3000
103
129
 
104
130
  ### Distributed Tracing
105
131
 
@@ -0,0 +1,84 @@
1
+ # Spec-Driven Development Preset
2
+ # Complete environment for SDD with specify-cli and your choice of AI coding agent
3
+
4
+ id: sdd
5
+ name: Spec-Driven Development
6
+ description: Complete Spec-Driven Development environment with specify-cli and your choice of AI coding agent
7
+ type: meta
8
+ category: preset
9
+ supports: []
10
+ tags: [preset, sdd, spec-driven, ai, specify, spec-kit]
11
+
12
+ # Overlays to always include
13
+ selects:
14
+ required:
15
+ - spec-kit
16
+
17
+ # Parameterized agent selection
18
+ # Option 'id' is the value passed to `specify init --ai <id>`.
19
+ # 'overlays' is the list of container-superposition overlay IDs to include.
20
+ parameters:
21
+ agent:
22
+ description: AI coding agent to use with Spec Kit
23
+ default: codex
24
+ options:
25
+ - id: codex
26
+ overlays: [codex]
27
+ description: OpenAI Codex CLI (--ai codex)
28
+ - id: claude
29
+ overlays: [claude-code]
30
+ description: Anthropic Claude Code (--ai claude)
31
+ - id: gemini
32
+ overlays: [gemini-cli]
33
+ description: Google Gemini CLI (--ai gemini)
34
+ - id: amp
35
+ overlays: [amp]
36
+ description: Sourcegraph Amp (--ai amp)
37
+ - id: windsurf
38
+ overlays: [windsurf-cli]
39
+ description: Codeium Windsurf (--ai windsurf)
40
+ - id: opencode
41
+ overlays: [opencode]
42
+ description: opencode (--ai opencode)
43
+ - id: copilot
44
+ overlays: []
45
+ description: GitHub Copilot (IDE-integrated, no extra CLI needed) (--ai copilot)
46
+
47
+ # Glue configuration
48
+ glueConfig:
49
+ # environment values support {{parameters.<key>.id}} template substitution —
50
+ # the preset expander replaces it with the selected option's id at generation time.
51
+ environment:
52
+ SPECIFY_AI_AGENT: '{{parameters.agent.id}}'
53
+
54
+ readme: |
55
+ ## Spec-Driven Development (SDD)
56
+
57
+ This devcontainer is configured for Spec-Driven Development using [Spec Kit](https://github.com/github/spec-kit).
58
+
59
+ ### Getting Started
60
+
61
+ Initialize SDD in your project:
62
+
63
+ ```bash
64
+ specify init . --here --ai ${SPECIFY_AI_AGENT:-codex}
65
+ ```
66
+
67
+ ### SDD Workflow
68
+
69
+ Use these slash commands in your AI agent:
70
+
71
+ | Step | Command | Description |
72
+ |------|---------|-------------|
73
+ | 1 | `/speckit.constitution` | Create project governing principles |
74
+ | 2 | `/speckit.specify` | Define requirements |
75
+ | 3 | `/speckit.clarify` | Clarify ambiguities |
76
+ | 4 | `/speckit.plan` | Create implementation plan |
77
+ | 5 | `/speckit.analyze` | Cross-artifact consistency check |
78
+ | 6 | `/speckit.tasks` | Break plan into tasks |
79
+ | 7 | `/speckit.implement` | Execute tasks with AI |
80
+
81
+ ### References
82
+
83
+ - [Spec Kit GitHub](https://github.com/github/spec-kit)
84
+ - [SDD Methodology](https://github.com/github/spec-kit/blob/main/spec-driven.md)