Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ドキュメントからコードを生成したい on Rails 開発
Search
Seiya Miyata
August 01, 2023
Programming
1
610
ドキュメントからコードを生成したい on Rails 開発
めぐろ LT #5 で発表した「ドキュメントからコードを生成したい on Rails 開発 」の資料です。
Seiya Miyata
August 01, 2023
Tweet
Share
More Decks by Seiya Miyata
See All by Seiya Miyata
「攻め」のリプレース --- ナレッジワークのユーザー体験を支えるコンテンツ処理システムについて
38tter
0
770
Other Decks in Programming
See All in Programming
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
900
CSC307 Lecture 14
javiergs
PRO
0
440
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
380
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
12
7.1k
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
280
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
7
1.2k
AI巻き込み型コードレビューのススメ
nealle
2
2.4k
CSC307 Lecture 08
javiergs
PRO
0
690
AWS Infrastructure as Code の新機能 2025 総まとめ~ SA 4人による怒涛のデモ祭り ~
konokenj
8
2.3k
CSC307 Lecture 10
javiergs
PRO
1
690
Oxlint JS plugins
kazupon
1
1.1k
AIに仕事を丸投げしたら、本当に楽になれるのか
dip_tech
PRO
0
170
Featured
See All Featured
Fireside Chat
paigeccino
41
3.8k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
75
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Mind Mapping
helmedeiros
PRO
1
100
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Test your architecture with Archunit
thirion
1
2.2k
Technical Leadership for Architectural Decision Making
baasie
2
270
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
610
The Invisible Side of Design
smashingmag
302
51k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
94
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Transcript
社外秘 Confidential ドキュメントからコードを生成したい on Rails 開発 ラクスル株式会社 宮田 聖也
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential 自己紹介
サーバーサイドエンジニア 印刷のラクスルのエンタープライズ向け開発 • 16 時退勤が夢です 好き:DevOps、エレキギター、フィルムカメラ、 欧州サッカー、クラフトビール 2 @38tter_miya
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential よくある
Rails 新規開発の流れ Ruby on Rails : MVC (Model - View - Controller) フレームワーク 1. モデル設計 ドメイン知識をモデル定義に落とし込む ER 図等でドキュメント管理する 2. マイグレーション マイグレーションファイルを書く 3. ビジネスロジックの記述 3
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential モデル設計:Notion
に、 ER 図描きつつ、あーだこーだ(字余り) 4 オンラインでありがちな状況 最近よく使うのは mermaid 記法
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential モデル設計:Notion
に、 ER 図描きつつ、あーだこーだ(字余り) 5 https://mermaid.js.org/
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential 悩み:熱いうちに鉄を打ちたい
モデル定義が固まったあとはすぐ開発に取り掛かりたい モデル議論の後 = 開発効率が高い状態 ドキュメントからマイグレーションへの変換 地味にまどろっこしい `rails generate migration` でボイラープレートを生成する感覚で、変換したい ... そこで... 6
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential mergration
という gem を作りました (mer)maid の ER 図をパースして mi(gration) ファイルを生成 7
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential mergration
という gem を作りました (mer)maid の ER 図をパースして mi(gration) ファイルを生成 8
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential デモ
9
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential やっていること
1. mermaid 記法のパース kramdown という markdown パーサーを拡張して mermaid に対応 2. マイグレーションファイルの生成 マイグレーションのテンプレートを用意 パース結果を元にマイグレーションを動的に生成 10
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential 所感&これからやりたいこと
「ドキュメントからボイラープレート生成」の開発者体験は良い プロトタイピング、ハッカソン等、開発時間限られる場合にも good 「ドキュメントとコードを同期できる」体験にも近づけたい 編集後の ER 図から差分のマイグレーションファイルの生成 シーケンス図による記述から、コードの雛形を生成 11
© 2021 RAKSUL, inc. All rights reserved. 社外秘 Confidential PR,
issue, feature request コメント等々 お待ちしています!! 12 https://github.com/38tter/mergration