ariadna 1.3.1 → 2.0.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 (148) hide show
  1. checksums.yaml +4 -4
  2. data/ariadna.gemspec +0 -1
  3. data/data/agents/ariadna-codebase-mapper.md +34 -722
  4. data/data/agents/ariadna-debugger.md +44 -1139
  5. data/data/agents/ariadna-executor.md +75 -396
  6. data/data/agents/ariadna-planner.md +78 -1215
  7. data/data/agents/ariadna-roadmapper.md +55 -582
  8. data/data/agents/ariadna-verifier.md +60 -702
  9. data/data/ariadna/templates/config.json +8 -33
  10. data/data/ariadna/workflows/debug.md +28 -0
  11. data/data/ariadna/workflows/execute-phase.md +31 -513
  12. data/data/ariadna/workflows/map-codebase.md +20 -319
  13. data/data/ariadna/workflows/new-milestone.md +20 -365
  14. data/data/ariadna/workflows/new-project.md +19 -880
  15. data/data/ariadna/workflows/plan-phase.md +24 -443
  16. data/data/ariadna/workflows/progress.md +20 -376
  17. data/data/ariadna/workflows/quick.md +19 -221
  18. data/data/ariadna/workflows/roadmap-ops.md +28 -0
  19. data/data/ariadna/workflows/verify-work.md +23 -560
  20. data/data/commands/ariadna/add-phase.md +11 -22
  21. data/data/commands/ariadna/debug.md +11 -143
  22. data/data/commands/ariadna/execute-phase.md +12 -30
  23. data/data/commands/ariadna/insert-phase.md +7 -14
  24. data/data/commands/ariadna/map-codebase.md +16 -49
  25. data/data/commands/ariadna/new-milestone.md +12 -25
  26. data/data/commands/ariadna/new-project.md +22 -26
  27. data/data/commands/ariadna/plan-phase.md +13 -22
  28. data/data/commands/ariadna/progress.md +16 -6
  29. data/data/commands/ariadna/quick.md +9 -11
  30. data/data/commands/ariadna/remove-phase.md +9 -12
  31. data/data/commands/ariadna/verify-work.md +14 -19
  32. data/data/skills/rails-backend/API.md +138 -0
  33. data/data/skills/rails-backend/CONTROLLERS.md +154 -0
  34. data/data/skills/rails-backend/JOBS.md +132 -0
  35. data/data/skills/rails-backend/MODELS.md +213 -0
  36. data/data/skills/rails-backend/SKILL.md +169 -0
  37. data/data/skills/rails-frontend/ASSETS.md +154 -0
  38. data/data/skills/rails-frontend/COMPONENTS.md +253 -0
  39. data/data/skills/rails-frontend/SKILL.md +187 -0
  40. data/data/skills/rails-frontend/VIEWS.md +168 -0
  41. data/data/skills/rails-performance/PROFILING.md +106 -0
  42. data/data/skills/rails-performance/SKILL.md +217 -0
  43. data/data/skills/rails-security/AUDIT.md +118 -0
  44. data/data/skills/rails-security/SKILL.md +422 -0
  45. data/data/skills/rails-testing/FIXTURES.md +78 -0
  46. data/data/skills/rails-testing/SKILL.md +160 -0
  47. data/data/skills/rails-testing/SYSTEM-TESTS.md +73 -0
  48. data/lib/ariadna/installer.rb +11 -15
  49. data/lib/ariadna/tools/cli.rb +0 -12
  50. data/lib/ariadna/tools/config_manager.rb +10 -72
  51. data/lib/ariadna/tools/frontmatter.rb +23 -1
  52. data/lib/ariadna/tools/init.rb +201 -401
  53. data/lib/ariadna/tools/model_profiles.rb +6 -14
  54. data/lib/ariadna/tools/phase_manager.rb +1 -10
  55. data/lib/ariadna/tools/state_manager.rb +170 -451
  56. data/lib/ariadna/tools/template_filler.rb +4 -12
  57. data/lib/ariadna/tools/verification.rb +21 -399
  58. data/lib/ariadna/uninstaller.rb +9 -0
  59. data/lib/ariadna/version.rb +1 -1
  60. metadata +20 -91
  61. data/data/agents/ariadna-backend-executor.md +0 -261
  62. data/data/agents/ariadna-frontend-executor.md +0 -259
  63. data/data/agents/ariadna-integration-checker.md +0 -418
  64. data/data/agents/ariadna-phase-researcher.md +0 -469
  65. data/data/agents/ariadna-plan-checker.md +0 -622
  66. data/data/agents/ariadna-project-researcher.md +0 -618
  67. data/data/agents/ariadna-research-synthesizer.md +0 -236
  68. data/data/agents/ariadna-test-executor.md +0 -266
  69. data/data/ariadna/references/checkpoints.md +0 -772
  70. data/data/ariadna/references/continuation-format.md +0 -249
  71. data/data/ariadna/references/decimal-phase-calculation.md +0 -65
  72. data/data/ariadna/references/git-integration.md +0 -248
  73. data/data/ariadna/references/git-planning-commit.md +0 -38
  74. data/data/ariadna/references/model-profile-resolution.md +0 -32
  75. data/data/ariadna/references/model-profiles.md +0 -73
  76. data/data/ariadna/references/phase-argument-parsing.md +0 -61
  77. data/data/ariadna/references/planning-config.md +0 -194
  78. data/data/ariadna/references/questioning.md +0 -153
  79. data/data/ariadna/references/rails-conventions.md +0 -416
  80. data/data/ariadna/references/tdd.md +0 -267
  81. data/data/ariadna/references/ui-brand.md +0 -160
  82. data/data/ariadna/references/verification-patterns.md +0 -853
  83. data/data/ariadna/templates/codebase/architecture.md +0 -481
  84. data/data/ariadna/templates/codebase/concerns.md +0 -380
  85. data/data/ariadna/templates/codebase/conventions.md +0 -434
  86. data/data/ariadna/templates/codebase/integrations.md +0 -328
  87. data/data/ariadna/templates/codebase/stack.md +0 -189
  88. data/data/ariadna/templates/codebase/structure.md +0 -418
  89. data/data/ariadna/templates/codebase/testing.md +0 -606
  90. data/data/ariadna/templates/context.md +0 -283
  91. data/data/ariadna/templates/continue-here.md +0 -78
  92. data/data/ariadna/templates/debug-subagent-prompt.md +0 -91
  93. data/data/ariadna/templates/phase-prompt.md +0 -609
  94. data/data/ariadna/templates/planner-subagent-prompt.md +0 -117
  95. data/data/ariadna/templates/research-project/ARCHITECTURE.md +0 -439
  96. data/data/ariadna/templates/research-project/FEATURES.md +0 -168
  97. data/data/ariadna/templates/research-project/PITFALLS.md +0 -406
  98. data/data/ariadna/templates/research-project/STACK.md +0 -251
  99. data/data/ariadna/templates/research-project/SUMMARY.md +0 -247
  100. data/data/ariadna/templates/state.md +0 -176
  101. data/data/ariadna/templates/summary-complex.md +0 -59
  102. data/data/ariadna/templates/summary-minimal.md +0 -41
  103. data/data/ariadna/templates/summary-standard.md +0 -48
  104. data/data/ariadna/templates/user-setup.md +0 -310
  105. data/data/ariadna/workflows/add-phase.md +0 -111
  106. data/data/ariadna/workflows/add-todo.md +0 -157
  107. data/data/ariadna/workflows/audit-milestone.md +0 -241
  108. data/data/ariadna/workflows/check-todos.md +0 -176
  109. data/data/ariadna/workflows/complete-milestone.md +0 -644
  110. data/data/ariadna/workflows/diagnose-issues.md +0 -219
  111. data/data/ariadna/workflows/discovery-phase.md +0 -289
  112. data/data/ariadna/workflows/discuss-phase.md +0 -408
  113. data/data/ariadna/workflows/execute-plan.md +0 -448
  114. data/data/ariadna/workflows/help.md +0 -470
  115. data/data/ariadna/workflows/insert-phase.md +0 -129
  116. data/data/ariadna/workflows/list-phase-assumptions.md +0 -178
  117. data/data/ariadna/workflows/pause-work.md +0 -122
  118. data/data/ariadna/workflows/plan-milestone-gaps.md +0 -256
  119. data/data/ariadna/workflows/remove-phase.md +0 -154
  120. data/data/ariadna/workflows/research-phase.md +0 -74
  121. data/data/ariadna/workflows/resume-project.md +0 -306
  122. data/data/ariadna/workflows/set-profile.md +0 -80
  123. data/data/ariadna/workflows/settings.md +0 -145
  124. data/data/ariadna/workflows/transition.md +0 -493
  125. data/data/ariadna/workflows/update.md +0 -212
  126. data/data/ariadna/workflows/verify-phase.md +0 -226
  127. data/data/commands/ariadna/add-todo.md +0 -42
  128. data/data/commands/ariadna/audit-milestone.md +0 -42
  129. data/data/commands/ariadna/check-todos.md +0 -41
  130. data/data/commands/ariadna/complete-milestone.md +0 -136
  131. data/data/commands/ariadna/discuss-phase.md +0 -86
  132. data/data/commands/ariadna/help.md +0 -22
  133. data/data/commands/ariadna/list-phase-assumptions.md +0 -50
  134. data/data/commands/ariadna/pause-work.md +0 -35
  135. data/data/commands/ariadna/plan-milestone-gaps.md +0 -40
  136. data/data/commands/ariadna/reapply-patches.md +0 -110
  137. data/data/commands/ariadna/research-phase.md +0 -187
  138. data/data/commands/ariadna/resume-work.md +0 -40
  139. data/data/commands/ariadna/set-profile.md +0 -34
  140. data/data/commands/ariadna/settings.md +0 -36
  141. data/data/commands/ariadna/update.md +0 -37
  142. data/data/guides/backend.md +0 -3069
  143. data/data/guides/frontend.md +0 -1479
  144. data/data/guides/performance.md +0 -1193
  145. data/data/guides/security.md +0 -1522
  146. data/data/guides/style-guide.md +0 -1091
  147. data/data/guides/testing.md +0 -504
  148. data/data/templates.md +0 -94
@@ -1,418 +0,0 @@
1
- # Structure Template
2
-
3
- Template for `.ariadna_planning/codebase/STRUCTURE.md` - captures physical file organization.
4
-
5
- **Purpose:** Document where things physically live in the codebase. Answers "where do I put X?"
6
-
7
- ---
8
-
9
- ## File Template
10
-
11
- ```markdown
12
- # Codebase Structure
13
-
14
- **Analysis Date:** [YYYY-MM-DD]
15
-
16
- ## Directory Layout
17
-
18
- [ASCII box-drawing tree of top-level directories with purpose - use ├── └── │ characters for tree structure only]
19
-
20
- ```
21
- [app-name]/
22
- ├── app/ # [Application code]
23
- │ ├── assets/ # [Stylesheets, images]
24
- │ ├── controllers/ # [Request handlers]
25
- │ ├── helpers/ # [View helpers]
26
- │ ├── javascript/ # [Stimulus controllers, JS]
27
- │ ├── jobs/ # [Background jobs]
28
- │ ├── mailers/ # [Email classes]
29
- │ ├── models/ # [Domain models and concerns]
30
- │ └── views/ # [Templates and layouts]
31
- ├── bin/ # [Rails executables]
32
- ├── config/ # [Configuration files]
33
- ├── db/ # [Database schema and migrations]
34
- ├── lib/ # [Non-Rails code, Rake tasks]
35
- ├── public/ # [Static files]
36
- ├── test/ # [Test files]
37
- ├── Gemfile # [Ruby dependencies]
38
- └── Rakefile # [Rake task loader]
39
- ```
40
-
41
- ## Directory Purposes
42
-
43
- **[Directory Name]:**
44
- - Purpose: [What lives here]
45
- - Contains: [Types of files: e.g., "`.rb` model files", "ERB templates"]
46
- - Key files: [Important files in this directory]
47
- - Subdirectories: [If nested, describe structure]
48
-
49
- **[Directory Name]:**
50
- - Purpose: [What lives here]
51
- - Contains: [Types of files]
52
- - Key files: [Important files]
53
- - Subdirectories: [Structure]
54
-
55
- ## Key File Locations
56
-
57
- **Entry Points:**
58
- - [Path]: [Purpose: e.g., "`config/routes.rb` — route definitions"]
59
- - [Path]: [Purpose: e.g., "`config/application.rb` — app configuration"]
60
-
61
- **Configuration:**
62
- - [Path]: [Purpose: e.g., "`config/database.yml` — database connection"]
63
- - [Path]: [Purpose: e.g., "`config/credentials.yml.enc` — encrypted secrets"]
64
- - [Path]: [Purpose: e.g., "`config/environments/production.rb` — production config"]
65
-
66
- **Core Logic:**
67
- - [Path]: [Purpose: e.g., "`app/models/` — domain models"]
68
- - [Path]: [Purpose: e.g., "`app/controllers/` — request handlers"]
69
- - [Path]: [Purpose: e.g., "`app/jobs/` — background processing"]
70
-
71
- **Testing:**
72
- - [Path]: [Purpose: e.g., "`test/models/` — model tests"]
73
- - [Path]: [Purpose: e.g., "`test/fixtures/` — YAML test data"]
74
-
75
- **Documentation:**
76
- - [Path]: [Purpose: e.g., "User-facing docs"]
77
- - [Path]: [Purpose: e.g., "Developer guide"]
78
-
79
- ## Naming Conventions
80
-
81
- **Files:**
82
- - [Pattern]: [Example: e.g., "`snake_case.rb` for all Ruby files"]
83
- - [Pattern]: [Example: e.g., "`*_controller.rb` for controllers"]
84
- - [Pattern]: [Example: e.g., "`*_test.rb` for test files"]
85
-
86
- **Directories:**
87
- - [Pattern]: [Example: e.g., "snake_case for all directories"]
88
- - [Pattern]: [Example: e.g., "plural names for collections (`models/`, `controllers/`)"]
89
-
90
- **Special Patterns:**
91
- - [Pattern]: [Example: e.g., "`*_job.rb` suffix for background jobs"]
92
- - [Pattern]: [Example: e.g., "`*_mailer.rb` suffix for mailer classes"]
93
-
94
- ## Where to Add New Code
95
-
96
- **New Model:**
97
- - Primary code: [Directory path]
98
- - Tests: [Directory path]
99
- - Migration: [Directory path]
100
-
101
- **New Controller:**
102
- - Implementation: [Directory path]
103
- - Views: [Directory path]
104
- - Tests: [Directory path]
105
-
106
- **New Background Job:**
107
- - Implementation: [Directory path]
108
- - Tests: [Directory path]
109
-
110
- **New Mailer:**
111
- - Implementation: [Directory path]
112
- - Views: [Directory path]
113
- - Tests: [Directory path]
114
-
115
- ## Special Directories
116
-
117
- [Any directories with special meaning or generation]
118
-
119
- **[Directory]:**
120
- - Purpose: [e.g., "Generated migration files"]
121
- - Source: [e.g., "`rails generate migration`"]
122
- - Committed: [Yes/No - in `.gitignore`?]
123
-
124
- ---
125
-
126
- *Structure analysis: [date]*
127
- *Update when directory structure changes*
128
- ```
129
-
130
- <good_examples>
131
- ```markdown
132
- # Codebase Structure
133
-
134
- **Analysis Date:** 2025-01-20
135
-
136
- ## Directory Layout
137
-
138
- ```
139
- myapp/
140
- ├── app/ # Application code
141
- │ ├── assets/ # Stylesheets, images
142
- │ ├── controllers/ # Request handlers
143
- │ │ └── concerns/ # Shared controller behavior
144
- │ ├── helpers/ # View helpers
145
- │ ├── javascript/ # Stimulus controllers, JS
146
- │ │ └── controllers/
147
- │ ├── jobs/ # Background jobs
148
- │ ├── mailers/ # Email classes
149
- │ ├── models/ # Domain models
150
- │ │ ├── concerns/ # Shared model concerns
151
- │ │ ├── card/ # Card-specific concerns
152
- │ │ └── board/ # Board-specific concerns
153
- │ └── views/ # Templates (ERB)
154
- │ └── layouts/ # Layout templates
155
- ├── bin/ # Rails executables (rails, rake, setup)
156
- ├── config/ # Configuration
157
- │ ├── environments/ # Per-environment config
158
- │ ├── initializers/ # Boot-time setup
159
- │ └── locales/ # I18n translations
160
- ├── db/ # Database
161
- │ ├── migrate/ # Migration files
162
- │ └── schema.rb # Current schema
163
- ├── lib/ # Non-Rails code, Rake tasks
164
- │ └── tasks/ # Custom Rake tasks
165
- ├── log/ # Log files
166
- ├── public/ # Static files
167
- ├── storage/ # ActiveStorage files (dev)
168
- ├── test/ # Test files
169
- │ ├── controllers/ # Controller tests
170
- │ ├── fixtures/ # YAML test data
171
- │ ├── models/ # Model tests
172
- │ ├── system/ # System (browser) tests
173
- │ └── test_helper.rb # Test configuration
174
- ├── tmp/ # Temporary files
175
- ├── Gemfile # Ruby dependencies
176
- ├── Gemfile.lock # Locked versions
177
- ├── Rakefile # Rake task loader
178
- └── config.ru # Rack configuration
179
- ```
180
-
181
- ## Directory Purposes
182
-
183
- **`app/models/`**
184
- - Purpose: Domain models and business logic
185
- - Contains: `*.rb` model files, one class per file
186
- - Key files: `application_record.rb` (base class), `current.rb` (CurrentAttributes)
187
- - Subdirectories: `concerns/` (shared concerns like `Eventable`, `Searchable`), model-specific directories (`card/`, `board/`) for namespaced concerns (`Card::Closeable`, `Board::Accessible`)
188
-
189
- **`app/controllers/`**
190
- - Purpose: Handle HTTP requests and render responses
191
- - Contains: `*_controller.rb` files, one per resource
192
- - Key files: `application_controller.rb` (base class with shared filters and error handling)
193
- - Subdirectories: `concerns/` (shared behavior like `CardScoped`, `BoardScoped`), namespace directories for nested resources (`cards/`)
194
-
195
- **`app/views/`**
196
- - Purpose: Response templates
197
- - Contains: ERB templates organized by controller name
198
- - Key files: `layouts/application.html.erb` (main layout)
199
- - Subdirectories: One directory per controller (`cards/`, `boards/`), `layouts/` for layout templates, `shared/` for cross-controller partials
200
-
201
- **`app/jobs/`**
202
- - Purpose: Background job classes
203
- - Contains: `*_job.rb` files, one per job
204
- - Key files: `application_job.rb` (base class with tenant context handling)
205
- - Subdirectories: None (flat structure)
206
-
207
- **`app/mailers/`**
208
- - Purpose: Email delivery classes
209
- - Contains: `*_mailer.rb` files, one per mailer
210
- - Key files: `application_mailer.rb` (base class with default settings)
211
- - Subdirectories: None (flat structure, views live in `app/views/` under mailer name)
212
-
213
- **`app/javascript/`**
214
- - Purpose: Client-side JavaScript
215
- - Contains: Stimulus controllers, Turbo configuration
216
- - Key files: `application.js` (JS entry point)
217
- - Subdirectories: `controllers/` (Stimulus controllers)
218
-
219
- **`config/`**
220
- - Purpose: Application and framework configuration
221
- - Contains: YAML config files, Ruby initializers, environment configs
222
- - Key files: `routes.rb` (URL routing), `database.yml` (database connection), `application.rb` (app config), `credentials.yml.enc` (encrypted secrets)
223
- - Subdirectories: `environments/` (per-environment overrides), `initializers/` (boot-time setup), `locales/` (I18n translation YAML)
224
-
225
- **`db/`**
226
- - Purpose: Database schema and migrations
227
- - Contains: Migration files, schema definition, seed data
228
- - Key files: `schema.rb` (current schema snapshot), `seeds.rb` (seed data)
229
- - Subdirectories: `migrate/` (timestamped migration files)
230
-
231
- **`test/`**
232
- - Purpose: Automated tests
233
- - Contains: `*_test.rb` files organized by type
234
- - Key files: `test_helper.rb` (test configuration, shared setup)
235
- - Subdirectories: `models/` (model tests), `controllers/` (controller tests), `system/` (browser-driven system tests), `fixtures/` (YAML test data), `integration/` (multi-request flow tests)
236
-
237
- **`lib/`**
238
- - Purpose: Non-Rails code and custom Rake tasks
239
- - Contains: Standalone Ruby classes, Rake task definitions
240
- - Key files: Depends on project
241
- - Subdirectories: `tasks/` (custom `.rake` files)
242
-
243
- **`bin/`**
244
- - Purpose: Rails executable scripts
245
- - Contains: Binstubs for project tools
246
- - Key files: `rails` (Rails CLI), `rake` (Rake runner), `setup` (project setup script)
247
- - Subdirectories: None
248
-
249
- ## Key File Locations
250
-
251
- **Entry Points:**
252
- - `config/routes.rb`: Route definitions — maps URLs to controller actions
253
- - `config/application.rb`: Application class and framework configuration
254
- - `config.ru`: Rack configuration — boots the Rails app for the web server
255
-
256
- **Configuration:**
257
- - `config/database.yml`: Database connection settings (per-environment)
258
- - `config/credentials.yml.enc`: Encrypted secrets (API keys, service credentials)
259
- - `config/environments/production.rb`: Production-specific settings
260
- - `config/environments/development.rb`: Development-specific settings
261
- - `config/initializers/`: Boot-time setup files (one per gem/concern)
262
-
263
- **Core Logic:**
264
- - `app/models/`: Domain models, associations, validations, business logic
265
- - `app/controllers/`: Request handling, auth checks, response rendering
266
- - `app/jobs/`: Background processing (email delivery, data imports, cleanup)
267
- - `app/models/concerns/`: Shared model behavior (`Eventable`, `Searchable`)
268
- - `app/controllers/concerns/`: Shared controller behavior (`CardScoped`, `BoardScoped`)
269
-
270
- **Testing:**
271
- - `test/test_helper.rb`: Test configuration, shared helpers, fixture loading
272
- - `test/models/`: Model unit tests
273
- - `test/controllers/`: Controller tests (request-level)
274
- - `test/system/`: System tests (browser-driven via Capybara)
275
- - `test/fixtures/`: YAML fixture data for test database
276
-
277
- **Documentation:**
278
- - `README.md`: Project overview and setup instructions
279
- - `CLAUDE.md`: Instructions for Claude Code when working in this repo
280
-
281
- ## Naming Conventions
282
-
283
- **Files:**
284
- - `snake_case.rb`: All Ruby files (`user.rb`, `board.rb`, `event.rb`)
285
- - `*_controller.rb`: Controller files (`users_controller.rb`, `boards_controller.rb`)
286
- - `*_test.rb`: Test files (`user_test.rb`, `boards_controller_test.rb`)
287
- - `*_job.rb`: Background job files (`notify_recipients_job.rb`)
288
- - `*_mailer.rb`: Mailer files (`invitation_mailer.rb`)
289
- - `*.html.erb`: View templates (`show.html.erb`, `_card.html.erb`)
290
- - `_*.html.erb`: Partials (leading underscore: `_form.html.erb`, `_header.html.erb`)
291
-
292
- **Directories:**
293
- - `snake_case`: All directories (`active_storage/`, `action_mailbox/`)
294
- - Plural for collections: `models/`, `controllers/`, `views/`, `helpers/`
295
- - Singular for model-specific concern namespaces: `card/`, `board/`
296
-
297
- **Special Patterns:**
298
- - `application_*.rb`: Base classes (`application_record.rb`, `application_controller.rb`, `application_job.rb`, `application_mailer.rb`)
299
- - `concerns/`: Shared behavior modules in both `models/` and `controllers/`
300
- - `YYYYMMDDHHMMSS_*.rb`: Timestamped migration files (`20250120143052_create_cards.rb`)
301
-
302
- ## Where to Add New Code
303
-
304
- **New Model:**
305
- - Primary code: `app/models/thing.rb`
306
- - Tests: `test/models/thing_test.rb`
307
- - Migration: `db/migrate/YYYYMMDDHHMMSS_create_things.rb` (via `rails generate migration`)
308
- - Fixtures: `test/fixtures/things.yml`
309
-
310
- **New Shared Concern:**
311
- - Implementation: `app/models/concerns/eventable.rb`
312
- - Usage: `include Eventable` in model files
313
-
314
- **New Model-Specific Concern:**
315
- - Implementation: `app/models/card/closeable.rb` (defines `Card::Closeable`)
316
- - Tests: Tested through the model that includes it (`test/models/card_test.rb`)
317
-
318
- **New Controller:**
319
- - Implementation: `app/controllers/things_controller.rb`
320
- - Views: `app/views/things/` (one template per action)
321
- - Tests: `test/controllers/things_controller_test.rb`
322
- - Routes: Add `resources :things` to `config/routes.rb`
323
-
324
- **New Background Job:**
325
- - Implementation: `app/jobs/thing_job.rb`
326
- - Tests: `test/jobs/thing_job_test.rb`
327
-
328
- **New Mailer:**
329
- - Implementation: `app/mailers/thing_mailer.rb`
330
- - Views: `app/views/thing_mailer/` (one template per email action)
331
- - Tests: `test/mailers/thing_mailer_test.rb`
332
-
333
- **New Rake Task:**
334
- - Implementation: `lib/tasks/thing.rake`
335
-
336
- **New Initializer:**
337
- - Implementation: `config/initializers/thing.rb`
338
-
339
- ## Special Directories
340
-
341
- **`db/migrate/`:**
342
- - Purpose: Generated migration files that alter database schema
343
- - Source: `rails generate migration` or `rails generate model`
344
- - Committed: Yes — migrations are shared across environments
345
-
346
- **`tmp/`:**
347
- - Purpose: Cache files, PID files, sockets
348
- - Source: Generated at runtime by Rails and Puma
349
- - Committed: No — in `.gitignore`
350
-
351
- **`log/`:**
352
- - Purpose: Development, test, and production log files
353
- - Source: Written by Rails logger during execution
354
- - Committed: No — in `.gitignore`
355
-
356
- **`storage/`:**
357
- - Purpose: ActiveStorage file uploads in development
358
- - Source: Uploaded files stored locally via ActiveStorage
359
- - Committed: No — in `.gitignore`
360
-
361
- **`node_modules/`:**
362
- - Purpose: JavaScript dependencies (if using Node-based bundler)
363
- - Source: Installed by `yarn install` or `npm install`
364
- - Committed: No — in `.gitignore`
365
-
366
- **`public/`:**
367
- - Purpose: Static files served directly by the web server
368
- - Source: Manually placed or compiled assets
369
- - Committed: Yes — static assets like `404.html`, `robots.txt`
370
-
371
- ---
372
-
373
- *Structure analysis: 2025-01-20*
374
- *Update when directory structure changes*
375
- ```
376
- </good_examples>
377
-
378
- <guidelines>
379
- **What belongs in STRUCTURE.md:**
380
- - Directory layout (ASCII box-drawing tree for structure visualization)
381
- - Purpose of each directory
382
- - Key file locations (entry points, configs, core logic)
383
- - Naming conventions
384
- - Where to add new code (by type)
385
- - Special/generated directories
386
-
387
- **What does NOT belong here:**
388
- - Conceptual architecture (that's ARCHITECTURE.md)
389
- - Technology stack (that's STACK.md)
390
- - Code implementation details (defer to code reading)
391
- - Every single file (focus on directories and key files)
392
-
393
- **When filling this template:**
394
- - Use `tree -L 2` or similar to visualize the Rails app structure
395
- - Identify top-level directories and their purposes
396
- - Note naming patterns by observing existing files (snake_case, suffixes)
397
- - Locate entry points (`config/routes.rb`, `config/application.rb`), configs, and main logic areas
398
- - Check for model-specific concern directories (`app/models/card/`, `app/models/board/`) — these indicate concern architecture depth
399
- - Keep directory tree concise (max 2-3 levels)
400
-
401
- **Tree format (ASCII box-drawing characters for structure only):**
402
- ```
403
- myapp/
404
- ├── app/ # Purpose
405
- │ ├── models/ # Purpose
406
- │ └── controllers/ # Purpose
407
- ├── config/ # Purpose
408
- └── Gemfile # Purpose
409
- ```
410
-
411
- **Useful for phase planning when:**
412
- - Adding new models (create model + migration + test + fixture)
413
- - Adding new controllers and views (where do templates go? what about routes?)
414
- - Extracting shared behavior (which `concerns/` directory? shared or model-specific?)
415
- - Adding background jobs or mailers (follow naming conventions and directory structure)
416
- - Understanding where configuration lives (`config/initializers/` vs `config/environments/`)
417
- - Following existing conventions for file naming and directory organization
418
- </guidelines>