Skip to content

Commit f00810d

Browse files
authored
Replace skip with persisted other option for architecture (#20)
1 parent fcfae06 commit f00810d

6 files changed

Lines changed: 38 additions & 19 deletions

File tree

packages/cli/src/commands/conventions.integration.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ describe("architecture and practices facets integration", () => {
134134
// Facet order: process (select), architecture (select), practices (multiselect)
135135
vi.mocked(clack.select)
136136
.mockResolvedValueOnce("native-agents-md") // process
137-
.mockResolvedValueOnce("__skip__"); // architecture: skip
137+
.mockResolvedValueOnce("other"); // architecture: other
138138
vi.mocked(clack.multiselect)
139139
.mockResolvedValueOnce(["conventional-commits", "tdd-london"]) // practices
140140
.mockResolvedValueOnce(["claude-code"]); // harnesses
@@ -182,7 +182,7 @@ describe("architecture and practices facets integration", () => {
182182
// Facet order: process (select), architecture (select), practices (multiselect)
183183
vi.mocked(clack.select)
184184
.mockResolvedValueOnce("native-agents-md") // process
185-
.mockResolvedValueOnce("__skip__"); // architecture: skip
185+
.mockResolvedValueOnce("other"); // architecture: other
186186
vi.mocked(clack.multiselect)
187187
.mockResolvedValueOnce(["adr-nygard"])
188188
.mockResolvedValueOnce(["claude-code"]); // harnesses
@@ -199,13 +199,13 @@ describe("architecture and practices facets integration", () => {
199199
expect(adr).toContain("## Consequences");
200200
});
201201

202-
it("skips both architecture and practices when none selected", async () => {
202+
it("writes no .ade directory when architecture is other and no practices selected", async () => {
203203
const catalog = getDefaultCatalog();
204204

205205
// Facet order: process (select), architecture (select), practices (multiselect)
206206
vi.mocked(clack.select)
207207
.mockResolvedValueOnce("native-agents-md") // process
208-
.mockResolvedValueOnce("__skip__"); // architecture: skip
208+
.mockResolvedValueOnce("other"); // architecture: other
209209
vi.mocked(clack.multiselect)
210210
.mockResolvedValueOnce([]) // practices: none
211211
.mockResolvedValueOnce(["claude-code"]); // harnesses
@@ -215,9 +215,9 @@ describe("architecture and practices facets integration", () => {
215215
// No .ade directory should exist
216216
await expect(access(join(dir, ".ade"))).rejects.toThrow();
217217

218-
// config.yaml should not have architecture or practices keys
218+
// config.yaml should have architecture: "other" but no practices key
219219
const config = await readUserConfig(dir);
220-
expect(config!.choices).not.toHaveProperty("architecture");
220+
expect(config!.choices).toHaveProperty("architecture", "other");
221221
expect(config!.choices).not.toHaveProperty("practices");
222222
});
223223

@@ -227,7 +227,7 @@ describe("architecture and practices facets integration", () => {
227227
// Facet order: process (select), architecture (select), practices (multiselect)
228228
vi.mocked(clack.select)
229229
.mockResolvedValueOnce("native-agents-md") // process
230-
.mockResolvedValueOnce("__skip__"); // architecture: skip
230+
.mockResolvedValueOnce("other"); // architecture: other
231231
vi.mocked(clack.multiselect)
232232
.mockResolvedValueOnce(["tdd-london"])
233233
.mockResolvedValueOnce(["claude-code"]); // harnesses

packages/cli/src/commands/install.integration.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe("install integration (real temp dir)", () => {
4646
// Step 1: Run setup to create config.yaml + config.lock.yaml
4747
vi.mocked(clack.select)
4848
.mockResolvedValueOnce("codemcp-workflows") // process
49-
.mockResolvedValueOnce("__skip__"); // architecture
49+
.mockResolvedValueOnce("other"); // architecture
5050
vi.mocked(clack.multiselect).mockResolvedValueOnce([]); // practices: none
5151
await runSetup(dir, catalog);
5252

@@ -73,7 +73,7 @@ describe("install integration (real temp dir)", () => {
7373
// Setup first
7474
vi.mocked(clack.select)
7575
.mockResolvedValueOnce("codemcp-workflows") // process
76-
.mockResolvedValueOnce("__skip__"); // architecture
76+
.mockResolvedValueOnce("other"); // architecture
7777
vi.mocked(clack.multiselect).mockResolvedValueOnce([]); // practices: none
7878
await runSetup(dir, catalog);
7979

@@ -102,7 +102,7 @@ describe("install integration (real temp dir)", () => {
102102
// Setup with native-agents-md
103103
vi.mocked(clack.select)
104104
.mockResolvedValueOnce("native-agents-md") // process
105-
.mockResolvedValueOnce("__skip__"); // architecture
105+
.mockResolvedValueOnce("other"); // architecture
106106
vi.mocked(clack.multiselect).mockResolvedValueOnce([]); // practices: none
107107
await runSetup(dir, catalog);
108108

packages/cli/src/commands/knowledge.integration.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ describe("knowledge integration", () => {
9595

9696
vi.mocked(clack.select)
9797
.mockResolvedValueOnce("native-agents-md") // process
98-
.mockResolvedValueOnce("__skip__"); // architecture: skip
98+
.mockResolvedValueOnce("other"); // architecture: other
9999
vi.mocked(clack.multiselect).mockResolvedValueOnce(["tdd-london"]); // practices: tdd-london has no docsets
100100

101101
await runSetup(dir, catalog);

packages/cli/src/commands/setup.integration.spec.ts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,29 @@ describe("setup integration (real temp dir)", () => {
4545

4646
vi.mocked(clack.select)
4747
.mockResolvedValueOnce("codemcp-workflows") // process
48-
.mockResolvedValueOnce("__skip__"); // architecture
48+
.mockResolvedValueOnce("other"); // architecture
4949
vi.mocked(clack.multiselect).mockResolvedValueOnce([]); // practices: none
5050

5151
await runSetup(dir, catalog);
5252

5353
// ── config.yaml ──────────────────────────────────────────────────────
5454
const config = await readUserConfig(dir);
5555
expect(config).not.toBeNull();
56-
expect(config!.choices).toEqual({ process: "codemcp-workflows" });
56+
expect(config!.choices).toEqual({
57+
process: "codemcp-workflows",
58+
architecture: "other"
59+
});
5760
// harnesses must NOT be in config.yaml — setup no longer selects them
5861
expect(config).not.toHaveProperty("harnesses");
5962

6063
// ── config.lock.yaml ─────────────────────────────────────────────────
6164
const lock = await readLockFile(dir);
6265
expect(lock).not.toBeNull();
6366
expect(lock!.version).toBe(1);
64-
expect(lock!.choices).toEqual({ process: "codemcp-workflows" });
67+
expect(lock!.choices).toEqual({
68+
process: "codemcp-workflows",
69+
architecture: "other"
70+
});
6571
expect(lock!.generated_at).toBeTruthy();
6672
// harnesses must NOT be in the lock file
6773
expect(lock).not.toHaveProperty("harnesses");
@@ -78,16 +84,22 @@ describe("setup integration (real temp dir)", () => {
7884

7985
vi.mocked(clack.select)
8086
.mockResolvedValueOnce("native-agents-md") // process
81-
.mockResolvedValueOnce("__skip__"); // architecture
87+
.mockResolvedValueOnce("other"); // architecture
8288
vi.mocked(clack.multiselect).mockResolvedValueOnce([]); // practices: none
8389

8490
await runSetup(dir, catalog);
8591

8692
const config = await readUserConfig(dir);
87-
expect(config!.choices).toEqual({ process: "native-agents-md" });
93+
expect(config!.choices).toEqual({
94+
process: "native-agents-md",
95+
architecture: "other"
96+
});
8897

8998
const lock = await readLockFile(dir);
90-
expect(lock!.choices).toEqual({ process: "native-agents-md" });
99+
expect(lock!.choices).toEqual({
100+
process: "native-agents-md",
101+
architecture: "other"
102+
});
91103
expect(lock!.logical_config.instructions.length).toBeGreaterThan(0);
92104
});
93105

@@ -112,7 +124,7 @@ describe("setup integration (real temp dir)", () => {
112124

113125
vi.mocked(clack.select)
114126
.mockResolvedValueOnce("codemcp-workflows") // process
115-
.mockResolvedValueOnce("__skip__"); // architecture
127+
.mockResolvedValueOnce("other"); // architecture
116128
vi.mocked(clack.multiselect).mockResolvedValueOnce([]); // practices: none
117129

118130
await runSetup(dir, catalog);

packages/cli/src/commands/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function promptSelect(
194194
hint: o.description
195195
}));
196196

197-
if (!facet.required) {
197+
if (!facet.required && !facet.options.some((o) => o.id === "other")) {
198198
options.push({ value: "__skip__", label: "Skip", hint: "" });
199199
}
200200

packages/core/src/catalog/facets/architecture.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,13 @@ export const architectureFacet: Facet = {
464464
}
465465
}
466466
]
467+
},
468+
{
469+
id: "other",
470+
label: "Other",
471+
description:
472+
"Custom or unlisted architecture — no conventions will be applied",
473+
recipe: []
467474
}
468475
]
469476
};

0 commit comments

Comments
 (0)