create-project-arch 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/LICENSE +21 -0
  3. package/README.md +662 -43
  4. package/dist/cli.js +151 -0
  5. package/dist/cli.test.js +191 -0
  6. package/package.json +28 -4
  7. package/templates/arch-ui/.arch/edges/decision_to_domain.json +0 -1
  8. package/templates/arch-ui/.arch/edges/milestone_to_task.json +0 -1
  9. package/templates/arch-ui/.arch/edges/task_to_decision.json +0 -1
  10. package/templates/arch-ui/.arch/edges/task_to_module.json +0 -1
  11. package/templates/arch-ui/.arch/graph.json +0 -1
  12. package/templates/arch-ui/.arch/nodes/decisions.json +0 -1
  13. package/templates/arch-ui/.arch/nodes/domains.json +0 -1
  14. package/templates/arch-ui/.arch/nodes/milestones.json +0 -1
  15. package/templates/arch-ui/.arch/nodes/modules.json +0 -1
  16. package/templates/arch-ui/.arch/nodes/tasks.json +0 -1
  17. package/templates/arch-ui/app/api/health/route.ts +5 -4
  18. package/templates/arch-ui/app/api/node-files/route.ts +6 -1
  19. package/templates/arch-ui/app/api/search/route.ts +0 -1
  20. package/templates/arch-ui/app/work/page.tsx +94 -64
  21. package/templates/arch-ui/components/app-shell.tsx +1 -7
  22. package/templates/arch-ui/components/graph/arch-node.tsx +13 -3
  23. package/templates/arch-ui/components/graph/build-graph-from-dataset.ts +6 -2
  24. package/templates/arch-ui/components/graph/build-initial-graph.ts +215 -221
  25. package/templates/arch-ui/components/graph/graph-types.ts +49 -49
  26. package/templates/arch-ui/components/graph/use-auto-layout.ts +51 -51
  27. package/templates/arch-ui/components/graph/use-connection-validation.ts +48 -48
  28. package/templates/arch-ui/components/graph/use-flow-persistence.ts +38 -38
  29. package/templates/arch-ui/components/graph-canvas.tsx +90 -74
  30. package/templates/arch-ui/components/inspector.tsx +56 -22
  31. package/templates/arch-ui/components/sidebar.tsx +18 -8
  32. package/templates/arch-ui/components/topbar.tsx +8 -11
  33. package/templates/arch-ui/components/work-table.tsx +1 -5
  34. package/templates/arch-ui/components/workspace-context.tsx +2 -1
  35. package/templates/arch-ui/eslint.config.js +2 -2
  36. package/templates/arch-ui/lib/graph-dataset.ts +4 -8
  37. package/templates/arch-ui/lib/graph-schema.ts +1 -4
  38. package/templates/arch-ui/package.json +0 -1
  39. package/templates/arch-ui/tsconfig.json +3 -11
  40. package/templates/architecture-specs/SPEC_TEMPLATE.md +49 -0
  41. package/templates/architecture-specs/example-system.md +42 -0
  42. package/templates/concept-map/concept-map.json +67 -0
  43. package/templates/decisions/DECISION_TEMPLATE.md +53 -0
  44. package/templates/decisions/README.md +19 -0
  45. package/templates/decisions/example-decision.md +45 -0
  46. package/templates/domains/DOMAIN_TEMPLATE.md +43 -0
  47. package/templates/domains/README.md +18 -0
  48. package/templates/domains/api.md +33 -0
  49. package/templates/domains/core.md +33 -0
  50. package/templates/domains/domains.json +19 -0
  51. package/templates/domains/ui.md +34 -0
  52. package/templates/foundation/goals.md +35 -0
  53. package/templates/foundation/project-overview.md +35 -0
  54. package/templates/foundation/prompt.md +23 -0
  55. package/templates/foundation/scope.md +35 -0
  56. package/templates/foundation/user-journey.md +37 -0
  57. package/templates/gap-closure/GAP_CLOSURE_TEMPLATE.md +50 -0
  58. package/templates/gap-closure/README.md +19 -0
  59. package/templates/gap-closure/example-gap-closure.md +43 -0
  60. package/templates/validation-hooks/.githooks/pre-commit +4 -0
  61. package/templates/validation-hooks/README.md +20 -0
  62. package/templates/validation-hooks/scripts/validate.sh +9 -0
@@ -0,0 +1,18 @@
1
+ # Domain Specifications
2
+
3
+ <!-- Guidance: Define domain boundaries first, then map implementation surfaces and ownership. -->
4
+
5
+ This directory contains domain ownership artifacts for architecture-first planning.
6
+
7
+ ## What To Maintain
8
+
9
+ - `domains.json` - machine-readable domain registry
10
+ - `DOMAIN_TEMPLATE.md` - template for new domains
11
+ - `core.md`, `ui.md`, `api.md` - starter domain examples
12
+
13
+ ## Workflow
14
+
15
+ 1. Update `domains.json` when adding/removing a domain.
16
+ 2. Create or update a corresponding `<domain>.md` file.
17
+ 3. Keep ownership and interface contracts aligned with `arch-model/modules.json`.
18
+ 4. Reference milestone rollout in each domain spec.
@@ -0,0 +1,33 @@
1
+ # API Domain
2
+
3
+ <!-- Guidance: Service boundaries, data access, and system integration behavior. -->
4
+
5
+ ## Responsibilities
6
+
7
+ - Define service interfaces and orchestration policies.
8
+ - Own data access boundaries and integration adapters.
9
+
10
+ ## Primary Data Ownership
11
+
12
+ - Persistence models and storage interfaces
13
+ - Service-level request/response contracts
14
+
15
+ ## Interface Contracts
16
+
17
+ - API functions consumed by apps
18
+ - Data-access contracts consumed by orchestration logic
19
+
20
+ ## Non-Goals
21
+
22
+ - Rendering UI components
23
+ - Owning cross-cutting presentation concerns
24
+
25
+ ## Milestone Mapping
26
+
27
+ - milestone-1-foundation: establish service boundaries and data model assumptions
28
+ - milestone-2-build: implement core API adapters and persistence flows
29
+
30
+ ## Implementation Surfaces
31
+
32
+ - `packages/api`
33
+ - `packages/database`
@@ -0,0 +1,33 @@
1
+ # Core Domain
2
+
3
+ <!-- Guidance: Shared domain model, policies, and cross-cutting foundations. -->
4
+
5
+ ## Responsibilities
6
+
7
+ - Define shared domain concepts and invariants.
8
+ - Own cross-cutting configuration and type contracts.
9
+
10
+ ## Primary Data Ownership
11
+
12
+ - Canonical shared types
13
+ - Environment and runtime configuration schema
14
+
15
+ ## Interface Contracts
16
+
17
+ - Shared type exports consumed by UI/API domains
18
+ - Configuration contracts used across packages
19
+
20
+ ## Non-Goals
21
+
22
+ - Rendering user interface components
23
+ - Implementing transport-specific API adapters
24
+
25
+ ## Milestone Mapping
26
+
27
+ - milestone-1-foundation: establish canonical types/config and boundaries
28
+ - milestone-2-build: stabilize contracts used by runtime features
29
+
30
+ ## Implementation Surfaces
31
+
32
+ - `packages/types`
33
+ - `packages/config`
@@ -0,0 +1,19 @@
1
+ {
2
+ "domains": [
3
+ {
4
+ "name": "core",
5
+ "ownedPackages": ["packages/types", "packages/config"],
6
+ "ownedFeatures": ["domain-model", "shared-policies"]
7
+ },
8
+ {
9
+ "name": "ui",
10
+ "ownedPackages": ["apps/web", "apps/docs", "packages/ui"],
11
+ "ownedFeatures": ["user-experience", "design-system"]
12
+ },
13
+ {
14
+ "name": "api",
15
+ "ownedPackages": ["packages/api", "packages/database"],
16
+ "ownedFeatures": ["service-contracts", "data-access"]
17
+ }
18
+ ]
19
+ }
@@ -0,0 +1,34 @@
1
+ # UI Domain
2
+
3
+ <!-- Guidance: User-facing workflows and presentation-layer behavior. -->
4
+
5
+ ## Responsibilities
6
+
7
+ - Deliver user journeys in web/docs applications.
8
+ - Own component composition and interaction flows.
9
+
10
+ ## Primary Data Ownership
11
+
12
+ - View models for page-level UX states
13
+ - Design-system usage conventions
14
+
15
+ ## Interface Contracts
16
+
17
+ - UI contracts against API/domain services
18
+ - Shared component contracts in the UI package
19
+
20
+ ## Non-Goals
21
+
22
+ - Persisting domain data directly
23
+ - Defining backend data access policies
24
+
25
+ ## Milestone Mapping
26
+
27
+ - milestone-1-foundation: baseline information architecture and navigation
28
+ - milestone-2-build: implement key user workflows and feedback states
29
+
30
+ ## Implementation Surfaces
31
+
32
+ - `apps/web`
33
+ - `apps/docs`
34
+ - `packages/ui`
@@ -0,0 +1,35 @@
1
+ # Project Goals
2
+
3
+ <!-- Guidance: Define measurable outcomes used to evaluate implementation decisions. -->
4
+
5
+ Source: `architecture/foundation/prompt.md`
6
+
7
+ ## Primary Goals
8
+
9
+ <!-- Guidance: Add launch-critical goals with measurable success criteria. -->
10
+
11
+ - ...
12
+
13
+ ## Secondary Goals
14
+
15
+ <!-- Guidance: Add valuable but non-blocking goals for post-launch improvement. -->
16
+
17
+ - ...
18
+
19
+ ## Success Metrics
20
+
21
+ <!-- Guidance: Include concrete signals (latency, adoption, completion rate, etc.) for each primary goal. -->
22
+
23
+ - ...
24
+
25
+ ## Assumptions
26
+
27
+ - ...
28
+
29
+ ## Unknowns
30
+
31
+ - ...
32
+
33
+ ## Risks
34
+
35
+ - ...
@@ -0,0 +1,35 @@
1
+ # Project Overview
2
+
3
+ <!-- Guidance: Summarize what the project is, why it exists, and who it serves. Derive this from prompt.md. -->
4
+
5
+ Source: `architecture/foundation/prompt.md`
6
+
7
+ ## Problem Statement
8
+
9
+ <!-- Guidance: Describe the user/business pain this project solves. -->
10
+
11
+ ...
12
+
13
+ ## Intended Users
14
+
15
+ <!-- Guidance: Identify primary users and stakeholders who benefit from this system. -->
16
+
17
+ ...
18
+
19
+ ## Value Proposition
20
+
21
+ <!-- Guidance: State why this solution is better than alternatives in one concise paragraph. -->
22
+
23
+ ...
24
+
25
+ ## Assumptions
26
+
27
+ - ...
28
+
29
+ ## Unknowns
30
+
31
+ - ...
32
+
33
+ ## Risks
34
+
35
+ - ...
@@ -0,0 +1,23 @@
1
+ # Setup Prompt
2
+
3
+ <!-- Guidance: Paste the original product brief, request, or requirements doc below. This is the canonical source for all other foundation docs. -->
4
+
5
+ This file is the canonical source used to derive:
6
+
7
+ - `project-overview.md`
8
+ - `goals.md`
9
+ - `user-journey.md`
10
+ - `scope.md`
11
+
12
+ ## Prompt Status
13
+
14
+ - [ ] Replaced template text with real project prompt
15
+ - [ ] Prompt includes purpose, users, constraints, and non-goals
16
+
17
+ ## Source Prompt
18
+
19
+ <!-- Guidance: Replace this block with your actual prompt content. Keep enough detail for architecture planning. -->
20
+
21
+ ```md
22
+ PASTE_FOUNDATIONAL_PROMPT_HERE
23
+ ```
@@ -0,0 +1,35 @@
1
+ # Scope And Non-Scope
2
+
3
+ <!-- Guidance: Define explicit boundaries for what this phase will and will not deliver. -->
4
+
5
+ Source: `architecture/foundation/prompt.md`
6
+
7
+ ## In Scope
8
+
9
+ <!-- Guidance: List concrete capabilities that are required for this phase. -->
10
+
11
+ - ...
12
+
13
+ ## Out Of Scope
14
+
15
+ <!-- Guidance: List explicit exclusions to prevent scope creep. -->
16
+
17
+ - ...
18
+
19
+ ## Constraints
20
+
21
+ <!-- Guidance: Note constraints that shape delivery (team, time, budget, compliance, platform). -->
22
+
23
+ - ...
24
+
25
+ ## Assumptions
26
+
27
+ - ...
28
+
29
+ ## Unknowns
30
+
31
+ - ...
32
+
33
+ ## Risks
34
+
35
+ - ...
@@ -0,0 +1,37 @@
1
+ # User Journey
2
+
3
+ <!-- Guidance: Capture the end-to-end flow from first touch to successful outcome. -->
4
+
5
+ Source: `architecture/foundation/prompt.md`
6
+
7
+ ## Journey Steps
8
+
9
+ <!-- Guidance: Describe the primary happy path in ordered steps. -->
10
+
11
+ 1. ...
12
+ 2. ...
13
+ 3. ...
14
+
15
+ ## Key Scenarios
16
+
17
+ <!-- Guidance: Include important alternate paths (errors, retries, permission constraints). -->
18
+
19
+ - ...
20
+
21
+ ## User Outcomes
22
+
23
+ <!-- Guidance: Define what success looks like for the user at the end of the journey. -->
24
+
25
+ - ...
26
+
27
+ ## Assumptions
28
+
29
+ - ...
30
+
31
+ ## Unknowns
32
+
33
+ - ...
34
+
35
+ ## Risks
36
+
37
+ - ...
@@ -0,0 +1,50 @@
1
+ # Milestone Gap-Closure Report Template
2
+
3
+ <!-- Guidance: Use this at milestone completion to document closure quality and residual risk. -->
4
+
5
+ ## Executive Summary
6
+
7
+ <!-- Guidance: One paragraph summarizing closure outcome and release readiness. -->
8
+
9
+ ...
10
+
11
+ ## Gap Categories And Resolutions
12
+
13
+ <!-- Guidance: Group identified gaps by category and note final resolution status. -->
14
+
15
+ - Gap category: ...
16
+ - Finding: ...
17
+ - Resolution: ...
18
+ - Status: closed | partially-closed | open
19
+
20
+ ## Layer Synchronization Check
21
+
22
+ <!-- Guidance: Verify architecture, roadmap, and implementation surfaces remain aligned. -->
23
+
24
+ - [ ] Architecture docs updated
25
+ - [ ] Roadmap tasks/decisions synchronized
26
+ - [ ] Graph/parity checks pass (`pa check`)
27
+ - [ ] Report diagnostics reviewed (`pa report`)
28
+
29
+ ## Coverage Audit
30
+
31
+ <!-- Guidance: Confirm milestone requirements/specs are fully addressed or explicitly deferred. -->
32
+
33
+ - Requirement/spec: ...
34
+ - Coverage status: covered | deferred | partial
35
+ - Notes: ...
36
+
37
+ ## Remaining Gaps And Follow-On Items
38
+
39
+ <!-- Guidance: List unresolved items and where they are tracked next. -->
40
+
41
+ - Remaining gap: ...
42
+ - Follow-on task/decision: ...
43
+
44
+ ## Template Improvement Feedback
45
+
46
+ <!-- Guidance: Capture scaffold/process improvements discovered while executing this milestone. -->
47
+
48
+ - Improvement idea: ...
49
+ - Rationale: ...
50
+ - Proposed change: ...
@@ -0,0 +1,19 @@
1
+ # Milestone Gap-Closure Reports
2
+
3
+ <!-- Guidance: Use these reports to complete milestone governance and quality review. -->
4
+
5
+ ## When To Use
6
+
7
+ Create/update a closure report when a milestone reaches completion readiness.
8
+
9
+ ## Workflow
10
+
11
+ 1. Copy `GAP_CLOSURE_TEMPLATE.md` into the milestone or reference location.
12
+ 2. Fill each section with concrete findings and evidence.
13
+ 3. Run validation commands (`pa check`, `pa report`) and record outcomes.
14
+ 4. Track unresolved items as follow-on tasks/decisions.
15
+
16
+ ## Suggested Locations
17
+
18
+ - `architecture/reference/` for reusable report artifacts and examples
19
+ - `roadmap/phases/<phase>/milestones/<milestone>/closure.md` for milestone-specific closure records
@@ -0,0 +1,43 @@
1
+ # Milestone Gap-Closure Report - Example
2
+
3
+ ## Executive Summary
4
+
5
+ Milestone scope is complete, critical architecture artifacts are synchronized, and remaining low-risk gaps are tracked for the next milestone.
6
+
7
+ ## Gap Categories And Resolutions
8
+
9
+ - Traceability drift
10
+ - Finding: concept-map dependencies were incomplete for one feature cluster.
11
+ - Resolution: updated `arch-model/concept-map.json` and linked missing surfaces.
12
+ - Status: closed
13
+ - Documentation clarity
14
+ - Finding: architecture scope language was ambiguous for one boundary.
15
+ - Resolution: clarified in architecture spec and referenced decision note.
16
+ - Status: closed
17
+
18
+ ## Layer Synchronization Check
19
+
20
+ - [x] Architecture docs updated
21
+ - [x] Roadmap tasks/decisions synchronized
22
+ - [x] Graph/parity checks pass (`pa check`)
23
+ - [x] Report diagnostics reviewed (`pa report`)
24
+
25
+ ## Coverage Audit
26
+
27
+ - Spec section: service boundary constraints
28
+ - Coverage status: covered
29
+ - Notes: validated against acceptance checks and policy explain output.
30
+ - Spec section: advanced optimization strategy
31
+ - Coverage status: deferred
32
+ - Notes: deferred to next milestone to protect launch scope.
33
+
34
+ ## Remaining Gaps And Follow-On Items
35
+
36
+ - Remaining gap: deferred optimization strategy details
37
+ - Follow-on task/decision: roadmap task `phase-2/milestone-2-performance/003`
38
+
39
+ ## Template Improvement Feedback
40
+
41
+ - Improvement idea: add explicit section for policy conflict outcomes
42
+ - Rationale: closure reviews repeatedly reference policy findings
43
+ - Proposed change: add "Policy Findings" subsection to template
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ set -eu
3
+
4
+ sh scripts/validate.sh
@@ -0,0 +1,20 @@
1
+ # Validation Hook Scaffold
2
+
3
+ This scaffold adds baseline architecture validation automation.
4
+
5
+ ## Included Files
6
+
7
+ - `scripts/validate.sh` - local validation entrypoint
8
+ - `.githooks/pre-commit` - optional local pre-commit hook example
9
+
10
+ ## Default Workflow
11
+
12
+ 1. Run `sh scripts/validate.sh` locally.
13
+ 2. The script executes:
14
+ - `pnpm arch:check`
15
+ - `pnpm arch:report`
16
+ 3. Optionally run the same script from `.githooks/pre-commit` for local enforcement.
17
+
18
+ ## Task Verification Guidance
19
+
20
+ When writing or reviewing roadmap tasks, include architecture validation in acceptance checks and verification steps.
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env sh
2
+ set -eu
3
+
4
+ echo "Running architecture validation..."
5
+
6
+ pnpm arch:check
7
+ pnpm arch:report > architecture-report.txt
8
+
9
+ echo "Architecture validation complete."