product-spec 0.4.1 → 0.5.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,27 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.5.0] - 2026-04-03
8
+
9
+ ### Changed
10
+
11
+ - New installs now place managed product docs and shared templates under `docs/product/` instead of `product/`
12
+ - `product-spec add` now migrates an existing `product/` or `/.product/` directory to `docs/product/` when no conflicting canonical `docs/product/` directory already exists
13
+ - Health checks, doctor guidance, README documentation, and packaged assistant assets now guide users toward `docs/product/` consistently
14
+
15
+ ### Fixed
16
+
17
+ - Overlap scenarios where `docs/product/` already exists alongside a legacy product-doc directory now stay non-destructive and report manual reconciliation guidance instead of risking silent overwrites
18
+ - Git and npm ignore rules now cover generated `docs/product/` output in addition to legacy generated product-doc locations
19
+
20
+ ## [0.4.2] - 2026-04-02
21
+
22
+ ### Fixed
23
+
24
+ - Ignored generated `product/` output in git and npm ignore rules to prevent accidental check-ins
25
+ - Removed legacy tracked `/.product/` template files from the repository now that `product/` is the canonical generated docs location
26
+ - Kept the published npm tarball focused on runtime assets and release artifacts only
27
+
7
28
  ## [0.4.1] - 2026-03-30
8
29
 
9
30
  ### Fixed
package/README.md CHANGED
@@ -92,19 +92,19 @@ After adding an integration, use the installed slash commands inside the assista
92
92
 
93
93
  ## How It Works
94
94
 
95
- product-spec creates a `product/` folder in your project that maintains a living view of the product across releases. Primary documents stay focused on the current state of thinking, while companion history documents preserve notable changes over time.
95
+ product-spec creates a `docs/product/` folder in your project that maintains a living view of the product across releases. Primary documents stay focused on the current state of thinking, while companion history documents preserve notable changes over time. Existing projects that still use `product/` or `.product/` are migrated toward `docs/product/` during normal `product-spec add` refreshes when the move is safe.
96
96
 
97
97
  ### Documents
98
98
 
99
99
  | File | Purpose |
100
100
  |------|---------|
101
- | `product/domain.md` | Industry context, target users, terminology, competitive landscape |
102
- | `product/press.md` | Current press release and customer-facing promise |
103
- | `product/faq.md` | Current external and internal FAQs that challenge the promise |
104
- | `product/narrative.md` | Durable internal story: customer, tension, future state, and principles |
105
- | `product/roadmap.md` | Forward-looking sequencing of bets, phases, and dependencies |
106
- | `product/current-truth.md` | Maintained current-state product specification grounded by alignment |
107
- | `product/history/*.md` | Companion history files for key product artifacts |
101
+ | `docs/product/domain.md` | Industry context, target users, terminology, competitive landscape |
102
+ | `docs/product/press.md` | Current press release and customer-facing promise |
103
+ | `docs/product/faq.md` | Current external and internal FAQs that challenge the promise |
104
+ | `docs/product/narrative.md` | Durable internal story: customer, tension, future state, and principles |
105
+ | `docs/product/roadmap.md` | Forward-looking sequencing of bets, phases, and dependencies |
106
+ | `docs/product/current-truth.md` | Maintained current-state product specification grounded by alignment |
107
+ | `docs/product/history/*.md` | Companion history files for key product artifacts |
108
108
 
109
109
  ### Workflow
110
110
 
@@ -119,7 +119,7 @@ product-spec creates a `product/` folder in your project that maintains a living
119
119
  4. `/product-spec-narrative` turns the promise and challenge into a durable internal product story.
120
120
  5. `/product-spec-roadmap` sequences future bets and dependencies without replacing current truth.
121
121
  6. `/speckit.specify` hands off the next bet to spec-kit for engineering specifications.
122
- 7. `/product-spec-align` reconciles product docs with the evolving engineering scope and maintains `product/current-truth.md`.
122
+ 7. `/product-spec-align` reconciles product docs with the evolving engineering scope and maintains `docs/product/current-truth.md`.
123
123
 
124
124
  ## Key Concepts
125
125
 
@@ -129,7 +129,7 @@ product-spec creates a `product/` folder in your project that maintains a living
129
129
 
130
130
  ### Companion History
131
131
 
132
- Primary product docs stay focused on the current state. Companion files under `product/history/` preserve important prior decisions, revisions, and reasoning.
132
+ Primary product docs stay focused on the current state. Companion files under `docs/product/history/` preserve important prior decisions, revisions, and reasoning.
133
133
 
134
134
  ### Working Backwards
135
135
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Reconcile the product folder with changes made in .specify specs — update product-facing docs and maintain current truth.
2
+ description: Reconcile the docs/product folder with changes made in .specify specs — update product-facing docs and maintain current truth.
3
3
  handoffs:
4
4
  - label: Update Press Release
5
5
  agent: product-spec-press
@@ -25,13 +25,13 @@ You **MUST** consider the user input before proceeding (if not empty).
25
25
 
26
26
  ## Outline
27
27
 
28
- You are reconciling the product documents in `product/` with the engineering specifications in `.specify/`.
28
+ You are reconciling the product documents in `docs/product/` with the engineering specifications in `.specify/`.
29
29
 
30
30
  ### Pre-Execution
31
31
 
32
- 1. Load `product/domain.md`, `product/press.md`, `product/faq.md`, `product/narrative.md`, `product/roadmap.md`, and `product/current-truth.md` when present.
32
+ 1. Load `docs/product/domain.md`, `docs/product/press.md`, `docs/product/faq.md`, `docs/product/narrative.md`, `docs/product/roadmap.md`, and `docs/product/current-truth.md` when present.
33
33
  2. Discover all `spec.md` files under `.specify/`.
34
- 3. Use `product/templates/current-truth-template.md` if `current-truth.md` does not yet exist.
34
+ 3. Use `docs/product/templates/current-truth-template.md` if `current-truth.md` does not yet exist.
35
35
 
36
36
  ### Execution Flow
37
37
 
@@ -16,19 +16,19 @@ You **MUST** consider the user input before proceeding (if not empty).
16
16
 
17
17
  ## Outline
18
18
 
19
- You are creating or updating the domain knowledge document at `product/domain.md`. This document captures the industry context, problem space, target users, terminology, and competitive landscape that inform all product decisions.
19
+ You are creating or updating the domain knowledge document at `docs/product/domain.md`. This document captures the industry context, problem space, target users, terminology, and competitive landscape that inform all product decisions.
20
20
 
21
21
  ### Pre-Execution
22
22
 
23
- 1. **Ensure `product/` exists**: If the `product/` directory does not exist, create it.
24
- 2. **Check for existing domain doc**: Read `product/domain.md` if it exists.
23
+ 1. **Ensure `docs/product/` exists**: If the `docs/product/` directory does not exist, create it.
24
+ 2. **Check for existing domain doc**: Read `docs/product/domain.md` if it exists.
25
25
  - If it exists and has content beyond the template, this is an **update** — preserve existing content and merge new information.
26
- - If it does not exist, load `product/templates/domain-template.md` as the starting structure.
27
- 3. **Load related artifacts when present**: Read `product/press.md`, `product/faq.md`, `product/narrative.md`, and `product/current-truth.md` when they exist so the domain stays aligned with the rest of the product record.
26
+ - If it does not exist, load `docs/product/templates/domain-template.md` as the starting structure.
27
+ 3. **Load related artifacts when present**: Read `docs/product/press.md`, `docs/product/faq.md`, `docs/product/narrative.md`, and `docs/product/current-truth.md` when they exist so the domain stays aligned with the rest of the product record.
28
28
 
29
29
  ### Execution Flow
30
30
 
31
31
  1. **Parse user input**: The text after `/product-spec-domain` is the domain context the user wants to capture.
32
- 2. Create or update `product/domain.md` using the domain template's shared structure for current context, assumptions, key decisions, related artifacts, and references to companion history.
32
+ 2. Create or update `docs/product/domain.md` using the domain template's shared structure for current context, assumptions, key decisions, related artifacts, and references to companion history.
33
33
  3. Preserve useful current-state content and direct older historical material into the companion history document when appropriate.
34
34
  4. Suggest `/product-spec-press` as the next step when appropriate.
@@ -19,14 +19,14 @@ You **MUST** consider the user input before proceeding (if not empty).
19
19
 
20
20
  ## Outline
21
21
 
22
- You are creating or updating the FAQ document at `product/faq.md`.
22
+ You are creating or updating the FAQ document at `docs/product/faq.md`.
23
23
 
24
24
  ### Pre-Execution
25
25
 
26
- 1. Ensure `product/` exists.
27
- 2. Load `product/domain.md` and `product/press.md` when available.
28
- 3. Load `product/narrative.md`, `product/roadmap.md`, and `product/current-truth.md` when available so the FAQ work stays consistent with the rest of the product record.
29
- 4. If `product/faq.md` is missing, start from `product/templates/faq-template.md`.
26
+ 1. Ensure `docs/product/` exists.
27
+ 2. Load `docs/product/domain.md` and `docs/product/press.md` when available.
28
+ 3. Load `docs/product/narrative.md`, `docs/product/roadmap.md`, and `docs/product/current-truth.md` when available so the FAQ work stays consistent with the rest of the product record.
29
+ 4. If `docs/product/faq.md` is missing, start from `docs/product/templates/faq-template.md`.
30
30
 
31
31
  ### Execution Flow
32
32
 
@@ -19,18 +19,18 @@ You **MUST** consider the user input before proceeding (if not empty).
19
19
 
20
20
  ## Outline
21
21
 
22
- You are creating or updating the durable narrative document at `product/narrative.md`.
22
+ You are creating or updating the durable narrative document at `docs/product/narrative.md`.
23
23
 
24
24
  ### Pre-Execution
25
25
 
26
- 1. Ensure `product/` exists.
27
- 2. Load `product/domain.md`, `product/press.md`, and `product/faq.md` when available.
28
- 3. Load `product/roadmap.md` and `product/current-truth.md` when present so the narrative stays grounded.
29
- 4. If `product/narrative.md` does not exist, start from `product/templates/narrative-template.md`.
26
+ 1. Ensure `docs/product/` exists.
27
+ 2. Load `docs/product/domain.md`, `docs/product/press.md`, and `docs/product/faq.md` when available.
28
+ 3. Load `docs/product/roadmap.md` and `docs/product/current-truth.md` when present so the narrative stays grounded.
29
+ 4. If `docs/product/narrative.md` does not exist, start from `docs/product/templates/narrative-template.md`.
30
30
 
31
31
  ### Execution Flow
32
32
 
33
33
  1. Use the supplied input plus the available product artifacts to explain the customer, the problem, the future state, and the product promise in a durable way.
34
- 2. Write or update `product/narrative.md` using the shared structure for assumptions, key decisions, related artifacts, and companion history references.
34
+ 2. Write or update `docs/product/narrative.md` using the shared structure for assumptions, key decisions, related artifacts, and companion history references.
35
35
  3. Keep the main narrative focused on the current strategic story and move historical detail into the companion history document when appropriate.
36
36
  4. Suggest `/product-spec-roadmap` as the next step when the story is ready to be sequenced into bets.
@@ -19,14 +19,14 @@ You **MUST** consider the user input before proceeding (if not empty).
19
19
 
20
20
  ## Outline
21
21
 
22
- You are creating or updating the press release document at `product/press.md`.
22
+ You are creating or updating the press release document at `docs/product/press.md`.
23
23
 
24
24
  ### Pre-Execution
25
25
 
26
- 1. Ensure `product/` exists.
27
- 2. Load `product/domain.md` if it exists.
28
- 3. Load `product/faq.md`, `product/narrative.md`, and `product/current-truth.md` when present to keep the current press release aligned with the broader product record.
29
- 4. Read `product/press.md` if it exists; otherwise use `product/templates/press-template.md`.
26
+ 1. Ensure `docs/product/` exists.
27
+ 2. Load `docs/product/domain.md` if it exists.
28
+ 3. Load `docs/product/faq.md`, `docs/product/narrative.md`, and `docs/product/current-truth.md` when present to keep the current press release aligned with the broader product record.
29
+ 4. Read `docs/product/press.md` if it exists; otherwise use `docs/product/templates/press-template.md`.
30
30
 
31
31
  ### Execution Flow
32
32
 
@@ -19,17 +19,17 @@ You **MUST** consider the user input before proceeding (if not empty).
19
19
 
20
20
  ## Outline
21
21
 
22
- You are creating or updating the roadmap document at `product/roadmap.md`.
22
+ You are creating or updating the roadmap document at `docs/product/roadmap.md`.
23
23
 
24
24
  ### Pre-Execution
25
25
 
26
- 1. Ensure `product/` exists.
27
- 2. Load `product/narrative.md`, `product/faq.md`, `product/current-truth.md`, and any relevant specs when available.
28
- 3. If `product/roadmap.md` does not exist, start from `product/templates/roadmap-template.md`.
26
+ 1. Ensure `docs/product/` exists.
27
+ 2. Load `docs/product/narrative.md`, `docs/product/faq.md`, `docs/product/current-truth.md`, and any relevant specs when available.
28
+ 3. If `docs/product/roadmap.md` does not exist, start from `docs/product/templates/roadmap-template.md`.
29
29
 
30
30
  ### Execution Flow
31
31
 
32
32
  1. Use the narrative and supporting artifacts to organize work into phased customer outcomes, committed bets, exploratory work, and deferred opportunities.
33
- 2. Write or update `product/roadmap.md` using the shared structure for assumptions, key decisions, related artifacts, and companion history references.
33
+ 2. Write or update `docs/product/roadmap.md` using the shared structure for assumptions, key decisions, related artifacts, and companion history references.
34
34
  3. Keep the roadmap future-facing and do not let it replace the current-state role of `current-truth.md`.
35
35
  4. Suggest `/speckit.specify` when the next bet is ready for engineering specification.
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Reconcile the product folder with changes made in .specify specs — update product-facing docs and maintain current truth.
2
+ description: Reconcile the docs/product folder with changes made in .specify specs — update product-facing docs and maintain current truth.
3
3
  handoffs:
4
4
  - label: Update Press Release
5
5
  agent: product-spec-press
@@ -25,13 +25,13 @@ You **MUST** consider the user input before proceeding (if not empty).
25
25
 
26
26
  ## Outline
27
27
 
28
- You are reconciling `product/` with `.specify/` specs so product-facing documents stay aligned with the engineering scope.
28
+ You are reconciling `docs/product/` with `.specify/` specs so product-facing documents stay aligned with the engineering scope.
29
29
 
30
30
  ### Pre-Execution
31
31
 
32
- 1. Load `product/domain.md`, `product/press.md`, `product/faq.md`, `product/narrative.md`, `product/roadmap.md`, and `product/current-truth.md` when present.
32
+ 1. Load `docs/product/domain.md`, `docs/product/press.md`, `docs/product/faq.md`, `docs/product/narrative.md`, `docs/product/roadmap.md`, and `docs/product/current-truth.md` when present.
33
33
  2. Discover relevant engineering specs and implementation outputs.
34
- 3. Use `product/templates/current-truth-template.md` if `current-truth.md` does not yet exist.
34
+ 3. Use `docs/product/templates/current-truth-template.md` if `current-truth.md` does not yet exist.
35
35
 
36
36
  ### Execution Flow
37
37
 
@@ -16,16 +16,16 @@ You **MUST** consider the user input before proceeding (if not empty).
16
16
 
17
17
  ## Outline
18
18
 
19
- You are creating or updating the domain knowledge document at `product/domain.md`. This document captures the industry context, problem space, target users, terminology, and competitive landscape that inform all product decisions.
19
+ You are creating or updating the domain knowledge document at `docs/product/domain.md`. This document captures the industry context, problem space, target users, terminology, and competitive landscape that inform all product decisions.
20
20
 
21
21
  ### Pre-Execution
22
22
 
23
- 1. Ensure `product/` exists.
24
- 2. Read `product/domain.md` if it exists; otherwise start from `product/templates/domain-template.md`.
25
- 3. Load `product/press.md`, `product/faq.md`, `product/narrative.md`, and `product/current-truth.md` when present.
23
+ 1. Ensure `docs/product/` exists.
24
+ 2. Read `docs/product/domain.md` if it exists; otherwise start from `docs/product/templates/domain-template.md`.
25
+ 3. Load `docs/product/press.md`, `docs/product/faq.md`, `docs/product/narrative.md`, and `docs/product/current-truth.md` when present.
26
26
 
27
27
  ### Execution Flow
28
28
 
29
29
  1. Use the user input as new market or customer context.
30
- 2. Update `product/domain.md` with current context, assumptions, key decisions, related artifacts, and companion history references.
30
+ 2. Update `docs/product/domain.md` with current context, assumptions, key decisions, related artifacts, and companion history references.
31
31
  3. Preserve still-valid current-state content and suggest `/product-spec-press` as the next step.
@@ -19,14 +19,14 @@ You **MUST** consider the user input before proceeding (if not empty).
19
19
 
20
20
  ## Outline
21
21
 
22
- You are creating or updating the FAQ document at `product/faq.md`.
22
+ You are creating or updating the FAQ document at `docs/product/faq.md`.
23
23
 
24
24
  ### Pre-Execution
25
25
 
26
- 1. Ensure `product/` exists.
27
- 2. Load `product/domain.md` and `product/press.md` when available.
28
- 3. Load `product/narrative.md`, `product/roadmap.md`, and `product/current-truth.md` when available so the FAQ work stays consistent with the rest of the product record.
29
- 4. If `product/faq.md` is missing, start from `product/templates/faq-template.md`.
26
+ 1. Ensure `docs/product/` exists.
27
+ 2. Load `docs/product/domain.md` and `docs/product/press.md` when available.
28
+ 3. Load `docs/product/narrative.md`, `docs/product/roadmap.md`, and `docs/product/current-truth.md` when available so the FAQ work stays consistent with the rest of the product record.
29
+ 4. If `docs/product/faq.md` is missing, start from `docs/product/templates/faq-template.md`.
30
30
 
31
31
  ### Execution Flow
32
32
 
@@ -19,16 +19,16 @@ You **MUST** consider the user input before proceeding (if not empty).
19
19
 
20
20
  ## Outline
21
21
 
22
- You are creating or updating the durable product narrative at `product/narrative.md`.
22
+ You are creating or updating the durable product narrative at `docs/product/narrative.md`.
23
23
 
24
24
  ### Pre-Execution
25
25
 
26
- 1. Ensure `product/` exists.
27
- 2. Load `product/domain.md`, `product/press.md`, `product/faq.md`, `product/roadmap.md`, and `product/current-truth.md` when available.
28
- 3. If `product/narrative.md` is missing, start from `product/templates/narrative-template.md`.
26
+ 1. Ensure `docs/product/` exists.
27
+ 2. Load `docs/product/domain.md`, `docs/product/press.md`, `docs/product/faq.md`, `docs/product/roadmap.md`, and `docs/product/current-truth.md` when available.
28
+ 3. If `docs/product/narrative.md` is missing, start from `docs/product/templates/narrative-template.md`.
29
29
 
30
30
  ### Execution Flow
31
31
 
32
32
  1. Synthesize the available product artifacts into a durable internal story.
33
- 2. Update `product/narrative.md` with current context, assumptions, key decisions, related artifacts, and history references.
33
+ 2. Update `docs/product/narrative.md` with current context, assumptions, key decisions, related artifacts, and history references.
34
34
  3. Suggest `/product-spec-roadmap` when the narrative is ready to become a roadmap.
@@ -19,14 +19,14 @@ You **MUST** consider the user input before proceeding (if not empty).
19
19
 
20
20
  ## Outline
21
21
 
22
- You are creating or updating the press release document at `product/press.md`.
22
+ You are creating or updating the press release document at `docs/product/press.md`.
23
23
 
24
24
  ### Pre-Execution
25
25
 
26
- 1. Ensure `product/` exists.
27
- 2. Load `product/domain.md` if it exists.
28
- 3. Load `product/faq.md`, `product/narrative.md`, and `product/current-truth.md` when present to keep the current press release aligned with the broader product record.
29
- 4. Read `product/press.md` if it exists; otherwise use `product/templates/press-template.md`.
26
+ 1. Ensure `docs/product/` exists.
27
+ 2. Load `docs/product/domain.md` if it exists.
28
+ 3. Load `docs/product/faq.md`, `docs/product/narrative.md`, and `docs/product/current-truth.md` when present to keep the current press release aligned with the broader product record.
29
+ 4. Read `docs/product/press.md` if it exists; otherwise use `docs/product/templates/press-template.md`.
30
30
 
31
31
  ### Execution Flow
32
32
 
@@ -19,16 +19,16 @@ You **MUST** consider the user input before proceeding (if not empty).
19
19
 
20
20
  ## Outline
21
21
 
22
- You are creating or updating the roadmap document at `product/roadmap.md`.
22
+ You are creating or updating the roadmap document at `docs/product/roadmap.md`.
23
23
 
24
24
  ### Pre-Execution
25
25
 
26
- 1. Ensure `product/` exists.
27
- 2. Load `product/narrative.md`, `product/faq.md`, `product/current-truth.md`, and relevant specs when available.
28
- 3. If `product/roadmap.md` is missing, start from `product/templates/roadmap-template.md`.
26
+ 1. Ensure `docs/product/` exists.
27
+ 2. Load `docs/product/narrative.md`, `docs/product/faq.md`, `docs/product/current-truth.md`, and relevant specs when available.
28
+ 3. If `docs/product/roadmap.md` is missing, start from `docs/product/templates/roadmap-template.md`.
29
29
 
30
30
  ### Execution Flow
31
31
 
32
32
  1. Turn the narrative into phased, outcome-oriented bets.
33
- 2. Update `product/roadmap.md` with assumptions, key decisions, related artifacts, and history references.
33
+ 2. Update `docs/product/roadmap.md` with assumptions, key decisions, related artifacts, and history references.
34
34
  3. Keep the roadmap future-facing and suggest `/speckit.specify` when the next bet is ready.
@@ -1,7 +1,9 @@
1
1
  import type { AssetCategory, AssistantTarget } from "../../types/index.js";
2
- export declare const PRODUCT_DOCS_DIR = "product";
2
+ export declare const PRODUCT_DOCS_DIR = "docs/product";
3
+ export declare const PREVIOUS_PRODUCT_DOCS_DIR = "product";
3
4
  export declare const LEGACY_PRODUCT_DOCS_DIR = ".product";
4
- export declare const PRODUCT_TEMPLATES_DIR = "product/templates";
5
+ export declare const PRODUCT_TEMPLATES_DIR = "docs/product/templates";
6
+ export declare const PREVIOUS_PRODUCT_TEMPLATES_DIR = "product/templates";
5
7
  export declare const LEGACY_PRODUCT_TEMPLATES_DIR = ".product/templates";
6
8
  export interface AssetDefinition {
7
9
  id: string;
@@ -1,6 +1,8 @@
1
- export const PRODUCT_DOCS_DIR = "product";
1
+ export const PRODUCT_DOCS_DIR = "docs/product";
2
+ export const PREVIOUS_PRODUCT_DOCS_DIR = "product";
2
3
  export const LEGACY_PRODUCT_DOCS_DIR = ".product";
3
4
  export const PRODUCT_TEMPLATES_DIR = `${PRODUCT_DOCS_DIR}/templates`;
5
+ export const PREVIOUS_PRODUCT_TEMPLATES_DIR = `${PREVIOUS_PRODUCT_DOCS_DIR}/templates`;
4
6
  export const LEGACY_PRODUCT_TEMPLATES_DIR = `${LEGACY_PRODUCT_DOCS_DIR}/templates`;
5
7
  const assistantCommands = [
6
8
  "product-spec-domain.md",
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/core/assets/registry.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAC1C,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAAC;AAClD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,gBAAgB,YAAY,CAAC;AACrE,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,uBAAuB,YAAY,CAAC;AAUnF,MAAM,iBAAiB,GAAG;IACxB,wBAAwB;IACxB,uBAAuB;IACvB,qBAAq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,CAAC,GAAG,qBAAqB,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,qBAAqB,CAAC;IAExF,OAAO;QACL,EAAE,EAAE,UAAU,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE;QAC7C,QAAQ;QACR,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,GAAG,WAAW,IAAI,QAAQ,EAAE;QACxC,UAAU,EAAE,GAAG,SAAS,IAAI,QAAQ,EAAE;KACvC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAA+C;IAChF,MAAM,EAAE,oBAAoB,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IAC1D,KAAK,EAAE,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,CAAC;CACxD,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,EAAE,CAAC;AAEvD,MAAM,UAAU,yBAAyB,CAAC,MAAuB;IAC/D,OAAO,sBAAsB,CAAC,MAAM,CAAC,CAAC;AACxC,CAAC"}
@@ -60,7 +60,7 @@ export async function runAdd(options) {
60
60
  notes: [
61
61
  ...sharedInstall.notes,
62
62
  "Run `product-spec check` to validate the installed integrations.",
63
- "Installed workflow: domain -> press -> faq -> narrative -> roadmap -> speckit* -> align -> current-truth."
63
+ "Installed workflow: domain -> press -> faq -> narrative -> roadmap -> speckit* -> align -> current-truth under `docs/product/`."
64
64
  ]
65
65
  };
66
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/core/orchestration/add.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAU7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,eAAe,EACf,UAAU,EACV,QAAQ,EACR,SAAS,EACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mBAAmB,EACn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MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;QAChF,IAAI,cAAc,EAAE,CAAC;YACnB,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,mBAAmB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACtF,QAAQ,GAAG,eAAe,CAAC,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACjE,KAAK,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAEnC,MAAM,YAAY,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAE9C,OAAO;QACL,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,cAAc;QACd,cAAc;QACd,KAAK;QACL,KAAK,EAAE;YACL,GAAG,aAAa,CAAC,KAAK;YACtB,kEAAkE;YAClE,iIAAiI;SAClI;KACF,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import { LEGACY_PRODUCT_DOCS_DIR, LEGACY_PRODUCT_TEMPLATES_DIR, PRODUCT_DOCS_DIR, PRODUCT_TEMPLATES_DIR, getTargetAssetDefinitions, sharedAssetRegistry } from "../assets/registry.js";
1
+ import { LEGACY_PRODUCT_DOCS_DIR, LEGACY_PRODUCT_TEMPLATES_DIR, PREVIOUS_PRODUCT_DOCS_DIR, PREVIOUS_PRODUCT_TEMPLATES_DIR, PRODUCT_DOCS_DIR, PRODUCT_TEMPLATES_DIR, getTargetAssetDefinitions, sharedAssetRegistry } from "../assets/registry.js";
2
2
  import { joinProjectPath, pathExists } from "../fs/project.js";
3
3
  import { loadManifest } from "../state/manifest.js";
4
4
  import { getAdapter, resolveTargets } from "./targets.js";
@@ -51,30 +51,54 @@ export async function runCheck(options) {
51
51
  }
52
52
  const legacyProductDir = joinProjectPath(options.rootDir, LEGACY_PRODUCT_DOCS_DIR);
53
53
  const productDir = joinProjectPath(options.rootDir, PRODUCT_DOCS_DIR);
54
+ const previousProductDir = joinProjectPath(options.rootDir, PREVIOUS_PRODUCT_DOCS_DIR);
54
55
  const legacyTemplatesDir = joinProjectPath(options.rootDir, LEGACY_PRODUCT_TEMPLATES_DIR);
56
+ const previousTemplatesDir = joinProjectPath(options.rootDir, PREVIOUS_PRODUCT_TEMPLATES_DIR);
55
57
  const productTemplatesDir = joinProjectPath(options.rootDir, PRODUCT_TEMPLATES_DIR);
56
58
  const hasLegacyProductDir = await pathExists(legacyProductDir);
57
59
  const hasProductDir = await pathExists(productDir);
60
+ const hasPreviousProductDir = await pathExists(previousProductDir);
58
61
  const hasLegacyTemplatesDir = await pathExists(legacyTemplatesDir);
62
+ const hasPreviousTemplatesDir = await pathExists(previousTemplatesDir);
59
63
  const hasProductTemplatesDir = await pathExists(productTemplatesDir);
60
64
  if (hasLegacyProductDir) {
61
65
  issues.push({
62
66
  code: "LEGACY_PRODUCT_DIRECTORY",
63
- severity: hasProductDir ? "warning" : "error",
67
+ severity: hasProductDir || hasPreviousProductDir ? "warning" : "error",
64
68
  message: hasProductDir
65
- ? "Legacy /.product directory still exists. product-spec now writes docs to /product."
66
- : "Legacy /.product directory detected. product-spec now writes docs to /product.",
69
+ ? `Legacy /.product directory still exists. product-spec now writes docs to /${PRODUCT_DOCS_DIR}.`
70
+ : hasPreviousProductDir
71
+ ? `Legacy /.product directory still exists alongside /${PREVIOUS_PRODUCT_DOCS_DIR}. product-spec now writes docs to /${PRODUCT_DOCS_DIR}.`
72
+ : `Legacy /.product directory detected. product-spec now writes docs to /${PRODUCT_DOCS_DIR}.`,
67
73
  path: LEGACY_PRODUCT_DOCS_DIR
68
74
  });
69
75
  }
76
+ if (hasPreviousProductDir) {
77
+ issues.push({
78
+ code: "PREVIOUS_PRODUCT_DIRECTORY",
79
+ severity: hasProductDir ? "warning" : "error",
80
+ message: hasProductDir
81
+ ? `Legacy /${PREVIOUS_PRODUCT_DOCS_DIR} directory still exists. product-spec now writes docs to /${PRODUCT_DOCS_DIR}.`
82
+ : `Legacy /${PREVIOUS_PRODUCT_DOCS_DIR} directory detected. product-spec now writes docs to /${PRODUCT_DOCS_DIR}.`,
83
+ path: PREVIOUS_PRODUCT_DOCS_DIR
84
+ });
85
+ }
70
86
  if (hasLegacyTemplatesDir && !hasProductTemplatesDir) {
71
87
  issues.push({
72
88
  code: "LEGACY_TEMPLATE_DIRECTORY",
73
89
  severity: "warning",
74
- message: "Shared templates are still stored in /.product/templates; rerun `product-spec add` to migrate them to /product/templates.",
90
+ message: `Shared templates are still stored in /.product/templates; rerun \`product-spec add\` to migrate them to /${PRODUCT_TEMPLATES_DIR}.`,
75
91
  path: LEGACY_PRODUCT_TEMPLATES_DIR
76
92
  });
77
93
  }
94
+ if (hasPreviousTemplatesDir && !hasProductTemplatesDir) {
95
+ issues.push({
96
+ code: "PREVIOUS_TEMPLATE_DIRECTORY",
97
+ severity: "warning",
98
+ message: `Shared templates are still stored in /${PREVIOUS_PRODUCT_TEMPLATES_DIR}; rerun \`product-spec add\` to migrate them to /${PRODUCT_TEMPLATES_DIR}.`,
99
+ path: PREVIOUS_PRODUCT_TEMPLATES_DIR
100
+ });
101
+ }
78
102
  if (!manifest && presentCount > 0) {
79
103
  issues.push({
80
104
  code: "MANIFEST_MISSING",
@@ -92,7 +116,7 @@ export async function runCheck(options) {
92
116
  ? "No action needed."
93
117
  : status === "missing"
94
118
  ? `Run \`product-spec add ${target}\` to install this integration.`
95
- : `Run \`product-spec add ${target}\` to refresh managed files and migrate legacy /.product content into /product when possible, then \`product-spec check ${target}\` again. The canonical workflow ends with \`current-truth.md\` maintained by \`align\`.`;
119
+ : `Run \`product-spec add ${target}\` to refresh managed files and migrate legacy /product or /.product content into /${PRODUCT_DOCS_DIR} when possible, then \`product-spec check ${target}\` again. The canonical workflow ends with \`current-truth.md\` maintained by \`align\`.`;
96
120
  reports.push({
97
121
  target,
98
122
  status,
@@ -1 +1 @@
1
- {"version":3,"file":"check.js","sourceRoot":"","sources":["../../../src/core/orchestration/check.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAW1D,SAAS,cAAc,CACrB,mBAA2B,EAC3B,oBAA4B,EAC5B,iBAA0B,EAC1B,MAAqB;IAErB,IAAI,mBAAmB,KAAK,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACpD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,IAAI,mBAAmB,GAAG,CAAC,IAAI,mBAAmB,GAAG,oBAAoB,EAAE,CAAC;YAC1E,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAAqB;IAClD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAChE,MAAM,OAAO,GAAmB,EAAE,CAAC;IAEnC,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE,CAAC;QACrC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QACnC,MAAM,YAAY,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;QACvD,MAAM,W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;gBACpB,CAAC,CAAC,0BAA0B,MAAM,iCAAiC;gBACnE,CAAC,CAAC,0BAA0B,MAAM,sFAAsF,gBAAgB,6CAA6C,MAAM,0FAA0F,CAAC;QAE5R,OAAO,CAAC,IAAI,CAAC;YACX,MAAM;YACN,MAAM;YACN,MAAM;YACN,iBAAiB;YACjB,eAAe;SAChB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,CAAC;AACrB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { rename } from "node:fs/promises";
3
- import { LEGACY_PRODUCT_DOCS_DIR, LEGACY_PRODUCT_TEMPLATES_DIR, PRODUCT_DOCS_DIR, sharedAssetRegistry } from "../assets/registry.js";
3
+ import { LEGACY_PRODUCT_DOCS_DIR, LEGACY_PRODUCT_TEMPLATES_DIR, PREVIOUS_PRODUCT_DOCS_DIR, PREVIOUS_PRODUCT_TEMPLATES_DIR, PRODUCT_DOCS_DIR, sharedAssetRegistry } from "../assets/registry.js";
4
4
  import { assertInsideRoot, ensureDirectory, hashFile, joinProjectPath, pathExists, readText, removeIfExists, writeText } from "../fs/project.js";
5
5
  export async function installSharedAssets(rootDir, packageRoot) {
6
6
  const migration = await migrateLegacyProductDirectory(rootDir);
@@ -42,24 +42,63 @@ export async function removeSharedAssets(rootDir, manifest) {
42
42
  }
43
43
  return files;
44
44
  }
45
+ async function reportConflict(rootDir, sources) {
46
+ const sourceList = sources.map((source) => `/${source}`).join(" and ");
47
+ const templateSources = await Promise.all([
48
+ LEGACY_PRODUCT_TEMPLATES_DIR,
49
+ PREVIOUS_PRODUCT_TEMPLATES_DIR
50
+ ]
51
+ .filter((templateDir) => sources.some((source) => templateDir.startsWith(source)))
52
+ .map(async (templateDir) => ((await pathExists(joinProjectPath(rootDir, templateDir))) ? `/${templateDir}` : null)));
53
+ const existingTemplateSources = templateSources.filter((value) => value !== null);
54
+ return {
55
+ files: [],
56
+ notes: [
57
+ existingTemplateSources.length > 0
58
+ ? `Legacy product docs still exist in ${sourceList} alongside /${PRODUCT_DOCS_DIR}. Existing /${PRODUCT_DOCS_DIR} content was left untouched; review and merge any remaining files manually, including templates in ${existingTemplateSources.join(" and ")}.`
59
+ : `Legacy product docs still exist in ${sourceList} alongside /${PRODUCT_DOCS_DIR}. Existing /${PRODUCT_DOCS_DIR} content was left untouched; review and merge any remaining files manually.`
60
+ ]
61
+ };
62
+ }
45
63
  export async function migrateLegacyProductDirectory(rootDir) {
46
64
  const legacyDir = joinProjectPath(rootDir, LEGACY_PRODUCT_DOCS_DIR);
65
+ const previousDir = joinProjectPath(rootDir, PREVIOUS_PRODUCT_DOCS_DIR);
47
66
  const productDir = joinProjectPath(rootDir, PRODUCT_DOCS_DIR);
48
- if (!(await pathExists(legacyDir))) {
67
+ const hasLegacyDir = await pathExists(legacyDir);
68
+ const hasPreviousDir = await pathExists(previousDir);
69
+ const hasCanonicalDir = await pathExists(productDir);
70
+ if (!hasLegacyDir && !hasPreviousDir) {
49
71
  return { files: [], notes: [] };
50
72
  }
51
- if (await pathExists(productDir)) {
52
- const legacyTemplatesDir = joinProjectPath(rootDir, LEGACY_PRODUCT_TEMPLATES_DIR);
73
+ if (hasCanonicalDir) {
74
+ const sources = [hasPreviousDir ? PREVIOUS_PRODUCT_DOCS_DIR : null, hasLegacyDir ? LEGACY_PRODUCT_DOCS_DIR : null].filter((value) => value !== null);
75
+ return reportConflict(rootDir, sources);
76
+ }
77
+ if (hasLegacyDir && hasPreviousDir) {
53
78
  return {
54
79
  files: [],
55
80
  notes: [
56
- await pathExists(legacyTemplatesDir)
57
- ? "Legacy /.product content still exists alongside /product. Existing /product content was left untouched; review and merge any remaining files manually."
58
- : "Legacy /.product content still exists alongside /product. Existing /product content was left untouched."
81
+ `Legacy product docs exist in /${LEGACY_PRODUCT_DOCS_DIR} and /${PREVIOUS_PRODUCT_DOCS_DIR}. product-spec now writes docs to /${PRODUCT_DOCS_DIR}; review and merge these directories manually before rerunning \`product-spec add\`.`
59
82
  ]
60
83
  };
61
84
  }
62
85
  await ensureDirectory(path.dirname(productDir));
86
+ if (hasPreviousDir) {
87
+ await rename(previousDir, productDir);
88
+ return {
89
+ files: [
90
+ {
91
+ path: PREVIOUS_PRODUCT_DOCS_DIR,
92
+ action: "removed"
93
+ },
94
+ {
95
+ path: PRODUCT_DOCS_DIR,
96
+ action: "created"
97
+ }
98
+ ],
99
+ notes: [`Migrated legacy /${PREVIOUS_PRODUCT_DOCS_DIR} content to /${PRODUCT_DOCS_DIR}.`]
100
+ };
101
+ }
63
102
  await rename(legacyDir, productDir);
64
103
  return {
65
104
  files: [
@@ -72,7 +111,7 @@ export async function migrateLegacyProductDirectory(rootDir) {
72
111
  action: "created"
73
112
  }
74
113
  ],
75
- notes: ["Migrated legacy /.product content to /product."]
114
+ notes: [`Migrated legacy /${LEGACY_PRODUCT_DOCS_DIR} content to /${PRODUCT_DOCS_DIR}.`]
76
115
  };
77
116
  }
78
117
  //# sourceMappingURL=shared-assets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared-assets.js","sourceRoot":"","sources":["../../../src/core/orchestration/shared-assets.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,eAAe,EACf,UAAU,EACV,QAAQ,EACR,cAAc,EACd,SAAS,EACV,MAAM,kBAAkB,CAAC;AAQ1B,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAAe,EACf,WAAmB;IAEnB,MAAM,SAAS,GAAG,MAAM,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAC/D,MAAM,YAAY,GAAkB,EAAE,CAAC;IACvC,MAAM,KAAK,GAA0B,EAAE,CAAC;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E,CAAC,oBAAoB,uBAAuB,gBAAgB,gBAAgB,GAAG,CAAC;KACxF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "product-spec",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "product-spec CLI for installing product-management command assets into Claude Code and Codex projects",
5
5
  "license": "MIT",
6
6
  "repository": {