Coding
PromptBeginner5 minmarkdown
Nano Banana Pro
Agent skill for nano-banana-pro
6
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
KrishFlow is a Ruby on Rails 8 application for agricultural land leasing and financial returns tracking. It manages land leased from owners and subleased to farmers, with investment tracking and payment monitoring based on financial year snapshots.
# Install dependencies bundle install # Database setup rails db:create db:migrate db:seed # Start server rails server # Run tests rails test # System tests rails test:system # Single test file rails test test/models/person_test.rb # Single test method rails test test/models/person_test.rb:test_validation # Security scan bundle exec brakeman # Code style check bundle exec rubocop
# Create migration rails generate migration MigrationName # Reset database rails db:drop db:create db:migrate db:seed # Rails console rails console
The application uses a Person-centric approach where individuals can be both landowners and farmers:
# Person can be both landowner and farmer Person: has_many :owned_lands (as landowner) has_many :lease_snapshots (as farmer) # Land belongs to one landowner, can have multiple lease snapshots Land: belongs_to :landowner (Person) has_many :lease_snapshots has_many :farmers, through: :lease_snapshots # LeaseSnapshot links land to farmer for specific financial year LeaseSnapshot: belongs_to :land belongs_to :farmer (Person) has_many :payments # Payment belongs to one lease snapshot Payment: belongs_to :lease_snapshot
current_financial_year method in Land model[land_id, financial_year]bigha and biswa unitsbiswas for calculationsbefore_validation :calculate_size_in_biswasPerson.landowners scope: People who own landPerson.farmers scope: People who farm landis_landowner?, is_farmer?lands/:id/lease_snapshots/:id/paymentsrails generate devise:install rails generate devise User rails db:migrate # Add devise_for :users to routes.rb # Uncomment authentication UI in layouts/application.html.erb
test/fixtures/lands > lease_snapshots > payments