nova-cli 0.1.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8b16c0ed1f907363ca8da83e0bd36e8757438840965d1eddd3001fee69e6dddd
4
+ data.tar.gz: d3f912358591fbd5d8774a3d55714d68ddbf7a2ccfe9c09043eeb5e5594237e7
5
+ SHA512:
6
+ metadata.gz: 62388046c98ee1da35437edde0a9e870207295615188fe55446b1c2f35e87d8373a3e0b392efaa58cf9ff627f04237db0a31c16c4ab8f6e8b6fb83b1876b80fb
7
+ data.tar.gz: d2a1220a45dbc82b81eb4be522a8478114111d130fc276839181ba0a6edcc09d1297d82ff5252ddc747c5d05f593a4d8df2f0484c7b0dc954ada6c5bc8d06803
data/README.md ADDED
@@ -0,0 +1,115 @@
1
+ # Nova
2
+
3
+ Nova is a command-line tool that generates a standardized project structure for product development and documentation. It guides teams through a structured workflow from strategic planning to code generation in an AI-driven environment.
4
+
5
+ ## The Nova Process
6
+
7
+ The Nova process guides product development through a series of steps, each building on the previous one to create a comprehensive plan for implementation:
8
+
9
+ 1. **Big Picture** → Define the strategic vision and goals
10
+ 2. **User Stories** → Break down the vision into specific user needs
11
+ 3. **Design System** → Establish the visual language and UI components
12
+ 4. **Prompts** → Create development prompts for implementation
13
+
14
+ Each step has its own directory with specialized templates and examples to guide your work.
15
+
16
+ ## Installation
17
+
18
+ To install the gem locally:
19
+
20
+ ```bash
21
+ cd nova
22
+ gem build nova-cli.gemspec
23
+ gem install nova-cli-0.1.2.gem
24
+ ```
25
+
26
+ Alternatively, you can run it directly:
27
+
28
+ ```bash
29
+ chmod +x bin/nova
30
+ ./bin/nova new [app_name]
31
+ ```
32
+
33
+ ## Usage
34
+
35
+ ```bash
36
+ # Create a new project structure
37
+ nova new [app_name]
38
+
39
+ # Show version
40
+ nova version
41
+
42
+ # Show help
43
+ nova help
44
+ ```
45
+
46
+ ## Generated Structure
47
+
48
+ When you run `nova new [app_name]`, it creates the following structure:
49
+
50
+ ```
51
+ [project_name]/
52
+ ├── shape/
53
+ │ ├── README.md
54
+ │ ├── 1_big-picture/
55
+ │ │ ├── README.md
56
+ │ │ ├── prd_example.md
57
+ │ │ ├── flowchart.md
58
+ │ ├── 2_user-stories/
59
+ │ │ ├── README.md
60
+ │ │ └── example.md
61
+ │ ├── 3_design-system/
62
+ │ │ ├── README.md
63
+ │ │ └── design_decisions.md
64
+ │ ├── 4_prompts/
65
+ │ │ ├── README.md
66
+ │ │ └── example.md
67
+ ├── code/
68
+ ├── design-system/
69
+ ```
70
+
71
+ - `shape/README.md`: Comprehensive documentation on how to structure product requirements and features
72
+ - `shape/1_big-picture/`: High-level strategic documents that define the vision and direction
73
+ - `shape/2_user-stories/`: User-focused requirements that capture specific needs and acceptance criteria
74
+ - `shape/3_design-system/`: Visual language and UI component documentation to ensure consistency
75
+ - `shape/4_prompts/`: Structured sequential tasks for AI-assisted implementation
76
+ - `code/`: Directory for actual code implementation
77
+ - `design-system/`: Directory for implemented design system code and assets
78
+
79
+ ## Best Practices
80
+
81
+ - **Start with Why**: Always begin by understanding the strategic purpose behind the project
82
+ - **Focus on User Value**: Keep the user's needs at the center of all planning
83
+ - **Be Specific**: Include enough detail for implementation but avoid over-specification
84
+ - **Maintain Traceability**: Ensure each document references related documents from previous steps
85
+ - **Collaborate Across Disciplines**: Involve all relevant team members in the appropriate steps
86
+ - **Iterate and Refine**: The process is not strictly linear - revisit and update documents as you learn
87
+ - **Follow TDD**: Follow Test-Driven Development principles when implementing code
88
+
89
+ ## Working with AI
90
+
91
+ The Nova framework is designed to work seamlessly with AI development assistants:
92
+
93
+ 1. Define your product requirements in the big picture section
94
+ 2. Break down functionality into user stories
95
+ 3. Establish a design system for consistency
96
+ 4. Write sequential development prompts in the prompts directory
97
+ 5. Share these prompts with AI assistants to generate implementation code
98
+
99
+ ## Mermaid Flowcharts
100
+
101
+ Nova includes support for creating flowcharts using Mermaid syntax in Markdown. To view and edit these flowcharts in VS Code, you need to install the [Markdown Preview Mermaid Support](https://open-vsx.org/vscode/item?itemName=bierner.markdown-mermaid) extension:
102
+
103
+ 1. Open VS Code
104
+ 2. Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X)
105
+ 3. Search for "Markdown Preview Mermaid Support"
106
+ 4. Click Install
107
+
108
+ You can also install it directly from the VS Marketplace:
109
+ [Markdown Preview Mermaid Support](https://open-vsx.org/vscode/item?itemName=bierner.markdown-mermaid)
110
+
111
+ With this extension installed, you'll be able to preview Mermaid diagrams in the `flowchart.md` file and any other Markdown files containing Mermaid syntax.
112
+
113
+ ## License
114
+
115
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/bin/nova ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/nova'
4
+
5
+ Nova::CLI.start(ARGV)
data/lib/nova/cli.rb ADDED
@@ -0,0 +1,37 @@
1
+ require 'optparse'
2
+ require_relative 'generator'
3
+
4
+ module Nova
5
+ class CLI
6
+ def self.start(args)
7
+ command = args.shift
8
+ case command
9
+ when 'new'
10
+ app_name = args.shift
11
+ if app_name.nil? || app_name.empty?
12
+ puts "Error: Please provide an app name"
13
+ puts "Usage: nova new [app_name]"
14
+ exit 1
15
+ end
16
+ Generator.new(app_name).generate
17
+ when 'version', '-v', '--version'
18
+ puts "Nova version #{Nova::VERSION}"
19
+ when 'help', '-h', '--help', nil
20
+ show_help
21
+ else
22
+ puts "Unknown command: #{command}"
23
+ show_help
24
+ exit 1
25
+ end
26
+ end
27
+
28
+ def self.show_help
29
+ puts "Nova - A CLI tool for generating project structures"
30
+ puts ""
31
+ puts "Usage:"
32
+ puts " nova new [app_name] # Create a new app with the specified name"
33
+ puts " nova version # Show the version"
34
+ puts " nova help # Show this help message"
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,170 @@
1
+ require 'fileutils'
2
+ require 'json'
3
+
4
+ module Nova
5
+ class Generator
6
+ attr_reader :app_name
7
+
8
+ # Flat structure for all template files
9
+ # Each entry contains:
10
+ # - path: relative path where the file should be created
11
+ # - template: name of the template file to use (nil for directories)
12
+ # - type: optional type for special handling (e.g., 'prefixed_example')
13
+ FILES = [
14
+ # Main README
15
+ { path: 'shape/README.md', template: 'readme_template.md' },
16
+
17
+ # 1_big-picture section
18
+ { path: 'shape/1_big-picture', template: nil }, # directory
19
+ { path: 'shape/1_big-picture/README.md', template: 'big_picture_readme_template.md' },
20
+ { path: 'shape/1_big-picture/prd_example.md', template: 'prd_example_template.md' },
21
+ { path: 'shape/1_big-picture/flowchart.md', template: 'flowchart_template.md' },
22
+
23
+ # 2_user-stories section
24
+ { path: 'shape/2_user-stories', template: nil }, # directory
25
+ { path: 'shape/2_user-stories/README.md', template: 'user_stories_readme_template.md' },
26
+ { path: 'shape/2_user-stories/example.md', template: 'user_story_example.md' },
27
+
28
+ # 3_design-system section
29
+ { path: 'shape/3_design-system', template: nil }, # directory
30
+ { path: 'shape/3_design-system/README.md', template: 'design_system_readme_template.md' },
31
+ { path: 'shape/3_design-system/design_decisions.md', template: 'design_decisions_example.md' },
32
+
33
+ # 4_prompts section
34
+ { path: 'shape/4_prompts', template: nil }, # directory
35
+ { path: 'shape/4_prompts/README.md', template: 'prompts_readme_template.md' },
36
+ { path: 'shape/4_prompts/01_generate_app.md', template: 'prompts_examples/01_generate_app.md' },
37
+ { path: 'shape/4_prompts/02_generate_styleguide.md', template: 'prompts_examples/02_generate_styleguide.md' },
38
+ { path: 'shape/4_prompts/03_generate_static_pages.md', template: 'prompts_examples/03_generate_static_pages.md' },
39
+ { path: 'shape/4_prompts/04_authentication_feature.md', template: 'prompts_examples/04_authentication_feature.md' },
40
+
41
+ # Code directory
42
+ { path: 'code', template: nil } # directory
43
+ ].freeze
44
+
45
+ def initialize(app_name)
46
+ @app_name = app_name
47
+ end
48
+
49
+ def generate
50
+ create_main_directories
51
+ create_all_files_and_directories
52
+ create_windsurfrules_file
53
+ create_cursorcontext_file
54
+ display_success_message
55
+ end
56
+
57
+ private
58
+
59
+ def create_main_directories
60
+ # These are the base directories that must exist before we create any files
61
+ FileUtils.mkdir_p(File.join(app_name, 'shape'))
62
+ FileUtils.mkdir_p(File.join(app_name, 'code'))
63
+ end
64
+
65
+ def create_all_files_and_directories
66
+ FILES.each do |file_entry|
67
+ path = File.join(app_name, file_entry[:path])
68
+
69
+ if file_entry[:template].nil?
70
+ # This is a directory entry
71
+ create_directory(path)
72
+ else
73
+ # This is a file entry
74
+ create_file_from_template(path, file_entry[:template])
75
+ end
76
+ end
77
+ end
78
+
79
+ def create_file_from_template(path, template_name)
80
+ # Ensure parent directory exists
81
+ FileUtils.mkdir_p(File.dirname(path))
82
+
83
+ template_path = template_path_for(template_name)
84
+ content = File.read(template_path)
85
+
86
+ write_file(path.sub("#{app_name}/", ''), content)
87
+ end
88
+
89
+ def create_windsurfrules_file
90
+ rules = ai_assistant_rules
91
+ content = rules.join("\n")
92
+ write_file('.windsurfrules', content)
93
+ end
94
+
95
+ def create_cursorcontext_file
96
+ rules = ai_assistant_rules
97
+ content = JSON.pretty_generate({
98
+ "rules" => rules
99
+ })
100
+ write_file('.cursorcontext', content)
101
+ end
102
+
103
+ def ai_assistant_rules
104
+ [
105
+ "The shape/ folder is where we collaborate to create product & feature documentation. shape/README.md clarifies how we document product & feature requirements and where to put stuff. Look at that file before writing documentation.",
106
+ "The code/ folder is where you write code. Do not write code unless I tell you to.",
107
+ "Important! Opt for the simplest version of any feature or requirement unless otherwise indicated.",
108
+ "Important! Any time a user requests a change to the product shape, even during coding, update the documentation in shape/",
109
+ "Be as concise as possible.",
110
+ "Follow TDD whenever writing code. Unit tests for back-end using rspec and E2E tests for front-end using Cypress."
111
+ ]
112
+ end
113
+
114
+ def display_success_message
115
+ puts "\nShape project created for #{app_name}!"
116
+ puts "\nDirectory structure:"
117
+ puts " #{app_name}/"
118
+ puts " ├── .windsurfrules"
119
+ puts " ├── .cursorcontext"
120
+ puts " ├── shape/"
121
+ puts " │ ├── README.md"
122
+ puts " │ ├── 1_big-picture/"
123
+ puts " │ ├── 2_user-stories/"
124
+ puts " │ ├── 3_design-system/"
125
+ puts " │ ├── 4_prompts/"
126
+ puts " └── code/"
127
+ end
128
+
129
+ # Utility methods
130
+ def create_directory(path)
131
+ FileUtils.mkdir_p(path) unless File.directory?(path)
132
+ end
133
+
134
+ def write_file(relative_path, content)
135
+ full_path = File.join(app_name, relative_path)
136
+ File.write(full_path, content)
137
+ end
138
+
139
+ def template_path_for(template_name)
140
+ File.expand_path("../templates/#{template_name}", __FILE__)
141
+ end
142
+
143
+ # The following methods are maintained for backward compatibility with tests
144
+ # but they now leverage the new flat structure implementation
145
+
146
+ def create_big_picture_files
147
+ create_files_for_path('shape/1_big-picture')
148
+ end
149
+
150
+ def create_prompts_files
151
+ create_files_for_path('shape/4_prompts')
152
+ end
153
+
154
+ def create_user_stories_files
155
+ create_files_for_path('shape/2_user-stories')
156
+ end
157
+
158
+ # Method kept for backwards compatibility with tests
159
+ def create_shape_readme_file
160
+ file_entry = FILES.find { |f| f[:path] == 'shape/README.md' }
161
+ create_file_from_template(File.join(app_name, file_entry[:path]), file_entry[:template])
162
+ end
163
+
164
+ def create_files_for_path(path_prefix)
165
+ FILES.select { |f| f[:path].start_with?(path_prefix) && f[:template] }.each do |file_entry|
166
+ create_file_from_template(File.join(app_name, file_entry[:path]), file_entry[:template])
167
+ end
168
+ end
169
+ end
170
+ end
@@ -0,0 +1,29 @@
1
+ # 1. Big Picture
2
+
3
+ This directory contains high-level strategic documents that define the background, vision, and goals of the project.
4
+
5
+ ## Purpose
6
+
7
+ The Big Picture documents establish the foundation and direction for the entire project. They help stakeholders align on objectives and priorities before diving into more detailed planning.
8
+
9
+ ## Files in this Directory
10
+
11
+ - **prd_example.md**: Defines a blueprint for the product.
12
+ - **flowchart.md**: Visual representation of the application's user flow using Mermaid diagrams
13
+
14
+ ## How to Use
15
+
16
+ 1. Create a new PRD file at 1_big-picture/prd.md and use 1_big-picture/prd_example.md as a template
17
+ 2. Create visual application flows in flowchart.md to illustrate user journeys
18
+
19
+ ## Best Practices
20
+
21
+ - Involve all key stakeholders in defining the Big Picture
22
+ - Keep these documents high-level and focused on strategy (details come later)
23
+ - Revisit and update these documents as the project evolves
24
+ - Use clear, concise language that all stakeholders can understand
25
+ - Use flowcharts to communicate complex user journeys visually
26
+
27
+ ## Next Steps
28
+
29
+ After completing the Big Picture documents, move on to [2_user-stories](../2_user-stories) to begin breaking down the product into more detailed user stories.
@@ -0,0 +1,85 @@
1
+ # Design Decisions
2
+
3
+ A concise guide to the application's visual style. Use these decisions consistently throughout the interface.
4
+
5
+ ## Color Palette
6
+
7
+ **Primary Colors:**
8
+ - Brand Primary: `#4A7AFF` - Main brand color, primary buttons
9
+ - Brand Secondary: `#6C47FF` - Secondary actions, highlights
10
+
11
+ **Neutral Colors:**
12
+ - Black: `#000000` - Headings, text, icons
13
+ - Dark Gray: `#333333` - Primary text
14
+ - Medium Gray: `#666666` - Secondary text
15
+ - Light Gray: `#CCCCCC` - Borders, dividers
16
+ - Off-White: `#F5F5F5` - Backgrounds, cards
17
+ - White: `#FFFFFF` - Page backgrounds
18
+
19
+ **Semantic Colors:**
20
+ - Success: `#4CAF50` - Confirmations, success states
21
+ - Warning: `#FF9800` - Warnings, caution states
22
+ - Error: `#F44336` - Errors, destructive actions
23
+ - Info: `#2196F3` - Information, help text
24
+
25
+ ## Typography
26
+
27
+ **Font Family:** Inter (with system fallbacks)
28
+
29
+ **Text Styles:**
30
+ - H1: 32px (2rem), bold (700), page titles
31
+ - H2: 24px (1.5rem), bold (700), section headings
32
+ - H3: 20px (1.25rem), semibold (600), subsection headings
33
+ - Body: 16px (1rem), regular (400), main content
34
+ - Small: 14px (0.875rem), regular (400), secondary text
35
+ - Button: 16px (1rem), medium (500), button labels
36
+
37
+ ## Spacing
38
+
39
+ - XS: 4px (0.25rem) - Minimal spacing, icons
40
+ - Small: 8px (0.5rem) - Tight spacing, compact elements
41
+ - Medium: 16px (1rem) - Standard spacing, form fields
42
+ - Large: 24px (1.5rem) - Section padding, card padding
43
+ - XL: 32px (2rem) - Section margins, page padding
44
+ - 2XL: 48px (3rem) - Large separations
45
+
46
+ ## Border Radius
47
+
48
+ - None: 0 - Tables, alerts
49
+ - Small: 4px (0.25rem) - Inputs, buttons
50
+ - Medium: 8px (0.5rem) - Cards, modals
51
+ - Large: 16px (1rem) - Feature cards, profile images
52
+ - Full: 9999px - Pills, badges, avatars
53
+
54
+ ## Key Components
55
+
56
+ **Buttons:**
57
+ - Primary: Brand Primary background, white text, small radius
58
+ - Secondary: White background, Brand Primary text and border
59
+ - Danger: Error color background, white text
60
+ - Text: No background, Brand Primary text, no border
61
+
62
+ **Inputs:**
63
+ - White background, Medium Gray border (1px)
64
+ - Small radius, black text
65
+ - Focus: Brand Primary border (2px)
66
+
67
+ **Cards:**
68
+ - White background, medium radius
69
+ - Optional Light Gray border, large padding
70
+ - Medium shadow (0 4px 6px rgba(0, 0, 0, 0.1))
71
+
72
+ **Navigation:**
73
+ - Desktop: Horizontal navbar with Brand Primary highlights
74
+ - Mobile: Hamburger menu with slide-out drawer
75
+
76
+ ## Accessibility
77
+
78
+ - Text contrast ratio: 4.5:1 minimum
79
+ - Clear focus states on interactive elements
80
+ - Support text resizing to 200%
81
+
82
+ ## Technical Stack
83
+
84
+ - CSS Framework: Tailwind CSS
85
+ - Interactive Components: Flowbite
@@ -0,0 +1,22 @@
1
+ # Design System
2
+
3
+ The Design System directory contains the visual language and UI component documentation for your application. It builds on the PRD and user stories and provides a consistent framework for implementing the user interface.
4
+
5
+ ## Purpose
6
+
7
+ A design system serves as a centralized resource for design guidelines, UI components, patterns, and principles. It ensures consistency, improves collaboration between designers and developers, and accelerates implementation.
8
+
9
+ ## Directory Structure
10
+
11
+ The design system is organized as follows:
12
+
13
+ ```
14
+ 3_design-system/
15
+ ├── README.md (this file)
16
+ └── design_decisions.md
17
+ ```
18
+
19
+ ## Design System Implementation
20
+
21
+ 1. **Review the PRD and user stories** to ensure visual consistency with the brand and planned user experience
22
+ 2. **Document design decisions** in the `design_decisions.md` file, including color palette, typography, spacing, and component styles
@@ -0,0 +1,72 @@
1
+ # Application Page Flow
2
+
3
+ This document provides a visual representation of the application's pages and the navigation paths between them.
4
+
5
+ ## Main Page Navigation
6
+
7
+ ```mermaid
8
+ flowchart TD
9
+ HomePage --> LoginPage
10
+ HomePage --> SignupPage
11
+ HomePage --> AboutPage
12
+ HomePage --> FeaturesPage
13
+
14
+ LoginPage --> DashboardPage
15
+ SignupPage --> VerificationPage
16
+ VerificationPage --> DashboardPage
17
+
18
+ DashboardPage --> ProfilePage
19
+ DashboardPage --> SettingsPage
20
+ DashboardPage --> ProjectsPage
21
+
22
+ ProjectsPage --> ProjectDetailPage
23
+ ProjectDetailPage --> TasksPage
24
+ ProjectDetailPage --> TeamPage
25
+ ProjectDetailPage --> DocumentsPage
26
+ ```
27
+
28
+ ## User Authentication Flow
29
+
30
+ ```mermaid
31
+ flowchart TD
32
+ HomePage --> LoginPage
33
+ LoginPage --> DashboardPage
34
+ LoginPage --> ForgotPasswordPage
35
+ ForgotPasswordPage --> ResetPasswordPage
36
+ ResetPasswordPage --> LoginPage
37
+
38
+ HomePage --> SignupPage
39
+ SignupPage --> VerificationPage
40
+ VerificationPage --> CompleteProfilePage
41
+ CompleteProfilePage --> DashboardPage
42
+ ```
43
+
44
+ ## Account Management Flow
45
+
46
+ ```mermaid
47
+ flowchart TD
48
+ DashboardPage --> ProfilePage
49
+ ProfilePage --> EditProfilePage
50
+
51
+ DashboardPage --> SettingsPage
52
+ SettingsPage --> SecurityPage
53
+ SettingsPage --> NotificationsPage
54
+ SettingsPage --> BillingPage
55
+
56
+ SecurityPage --> ChangePasswordPage
57
+ BillingPage --> PaymentMethodsPage
58
+ BillingPage --> SubscriptionPage
59
+ ```
60
+
61
+ ## Notes
62
+
63
+ - This flowchart represents the primary pages and navigation paths in the application
64
+ - Focus on page-to-page transitions rather than detailed component interactions
65
+ - Update this flowchart whenever new pages are added or navigation paths change
66
+
67
+ ## Best Practices
68
+
69
+ - Keep page navigation intuitive and consistent
70
+ - Minimize the number of clicks to reach important pages
71
+ - Ensure users can easily navigate back to key pages (like Dashboard)
72
+ - Use clear and descriptive page names in both the diagram and application
@@ -0,0 +1,41 @@
1
+ # Product Requirements Document - [Product Name]
2
+
3
+ ## Brief Product Overview
4
+ [Concise description of the product and the problem it solves for users and the business]
5
+
6
+ ## Objectives
7
+ 1. [Primary objective with measurable outcomes]
8
+ 2. [Secondary objective with measurable outcomes]
9
+ 3. [Additional objective with measurable outcomes]
10
+
11
+ ## End Users
12
+ - **Primary User Persona**: [Detailed description of main target user]
13
+ - **Secondary User Persona**: [Detailed description of secondary target user]
14
+
15
+ ## Approach Overview
16
+ [Description of the product approach, core functionality, and how it will solve the stated problem]
17
+
18
+ ## Feature List
19
+ 1. **[Feature 1 Name]**
20
+ - Description: [What this feature does]
21
+ - Priority: [High/Medium/Low]
22
+ - Why it matters: [Why this feature is important]
23
+
24
+ 2. **[Feature 2 Name]**
25
+ - Description: [What this feature does]
26
+ - Priority: [High/Medium/Low]
27
+ - Why it matters: [Why this feature is important]
28
+
29
+ 3. **[Feature 3 Name]**
30
+ - Description: [What this feature does]
31
+ - Priority: [High/Medium/Low]
32
+ - Why it matters: [Why this feature is important]
33
+
34
+ ## Tech Stack
35
+ - Back-end: Ruby on Rails 8 Server Rendered App
36
+ - Front-end: ERB / Stimulus / Tailwind CSS / Flowbite
37
+ - Testing: Rspec
38
+ - Hosting: Heroku
39
+ - Background jobs: Sidekiq
40
+ - Emails: SendGrid
41
+ - File Storage: s3