From f464dacdb758fc4e0fa9793406663fb9638c13be Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sun, 30 Nov 2025 08:56:05 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 12 +++++ README.md | 3 ++ commands/plan.md | 94 ++++++++++++++++++++++++++++++++++++++ plugin.lock.json | 45 ++++++++++++++++++ 4 files changed, 154 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 commands/plan.md create mode 100644 plugin.lock.json diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..8539a15 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "rails", + "description": "Set of commands, skills, and agents to work on Ruby on Rails projects", + "version": "1.0.0", + "author": { + "name": "Artur Roszczyk", + "email": "[email protected]" + }, + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..fb87395 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# rails + +Set of commands, skills, and agents to work on Ruby on Rails projects diff --git a/commands/plan.md b/commands/plan.md new file mode 100644 index 0000000..48454f5 --- /dev/null +++ b/commands/plan.md @@ -0,0 +1,94 @@ +--- +model: claude-sonnet-4-5-20250929 +name: plan +description: Plan implementation of a Rails feature with multi-tenant architecture and DaisyUI +allowed-tools: Bash, Read, Glob, Grep +--- + +You are planning a new feature for a Rails application with multi-tenant architecture. + +ARCHITECTURE CONTEXT: +- This project uses TWO databases: + * Primary database: Non-tenanted, for global/shared data + * Account database: Tenant-based, for customer-specific data +- Always verify which database a model should use before planning +- Models in the account database must be properly scoped to the current tenant + +ARCHITECTURE PATTERNS: +- **NO SERVICE OBJECTS** - Do not use or suggest service object pattern +- Use rich domain models with business logic +- Extract shared behavior into Concerns (app/models/concerns) +- Use PORO (Plain Old Ruby Objects) when models don't need persistence +- Keep controllers thin - delegate to models and concerns + +TEST-DRIVEN DEVELOPMENT (TDD): +- **MANDATORY**: All implementation must follow TDD approach +- Write unit tests BEFORE implementation: + * Model tests: validations, associations, scopes, instance methods, class methods + * Controller tests: request specs for each action +- Plan should include test specifications for: + * Each model with expected behavior + * Each controller action with success/failure cases + * Edge cases and error handling +- Use RSpec or Minitest based on project conventions + +STYLING & COMPONENTS: +- **CRITICAL**: Use DaisyUI components throughout the implementation +- Keep all styles aligned with existing DaisyUI patterns +- Before planning, CHECK DOCUMENTATION: + * Use context7 for DaisyUI component reference + * Use context7 for Rails documentation + * Use tidwave MCPs for additional technical documentation +- Prefer DaisyUI's semantic component classes over custom Tailwind + +PLANNING PROCESS: +1. First, analyze the current project structure: + - Examine relevant controllers, models, and views + - Check existing patterns for similar features + - Review the database schema (both primary and account) + - **Identify DaisyUI components already in use** + - Review existing Stimulus controllers and patterns + - Check existing concerns and model patterns + - Identify testing framework (RSpec/Minitest) + +2. Consult documentation BEFORE asking questions: + - Check context7 for DaisyUI components relevant to the feature + - Check context7 for Rails best practices + - Check tidwave MCPs for technical references + +3. Ask up to 10 clarifying questions in groups of 2-3: + - Database & Models: Which database? Associations? Validations? Business logic? + - UI/UX: Which DaisyUI components? User interactions? View structure? + - Integration: Where does this fit? Lazy loading? Turbo frames? + - Technical: Stimulus controllers? Background jobs? Permissions? + - Testing: Edge cases? Authorization scenarios? + - Wait for answers between question groups + +4. Provide a comprehensive implementation plan including: + - **TDD Test Plan**: Specify tests to write for each model and controller + - Database choice justification (primary vs account) + - Model structure with correct database configuration + - Business logic placement (models, concerns, POROs) + - Controller actions and routing (thin controllers) + - **DaisyUI component specifications for each UI element** + - View structure (Turbo frames, Stimulus controllers) + - Styling approach using DaisyUI (matching existing patterns) + - Testing strategy with specific test cases + - Migration steps + - Integration points with existing code + +IMPLEMENTATION ORDER: +1. Write failing tests (Red) +2. Implement minimal code to pass tests (Green) +3. Refactor (extract concerns, improve design) +4. Repeat for each feature increment + +RAILS SPECIFICS TO CONSIDER: +- Hotwire/Turbo for dynamic updates +- Stimulus controllers for JavaScript behavior +- Proper tenant scoping for account database models +- DRY principles and Rails conventions +- Database connection configuration for multi-tenancy +- ActiveModel for POROs when needed + +Feature to plan: {FEATURE_DESCRIPTION} diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..415877c --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,45 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:sevos/claude-code-marketplace:plugins/rails", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "69b8583ba376ed286bbdf90106fa49b18e4bf074", + "treeHash": "eafb5688d93a11f3109c7aa659ce2f2fc1c2dfa1a90221a756bf246b632cfc9a", + "generatedAt": "2025-11-28T10:28:16.930742Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "rails", + "description": "Set of commands, skills, and agents to work on Ruby on Rails projects", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "eb4933c693496c31ab1477c26912283da7eea10fe6e2ac14fc40727119f4b1b6" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "8ae353f8733d6cc2c3e81154f5c8ebeb4869ba8f9440504bdb6415de4ab31367" + }, + { + "path": "commands/plan.md", + "sha256": "7c48ec7a61d742d63bfd7ee4d5885556750328be00a488c7bbd4718b8422191f" + } + ], + "dirSha256": "eafb5688d93a11f3109c7aa659ce2f2fc1c2dfa1a90221a756bf246b632cfc9a" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file