Google AntigravityとGET SHIT DONEとGemini 3 Flashで開発してみる 4

Google AntigravityとGET SHIT DONEとGemini 3 Flashで開発してみる 3の続き。

警告やエラーの対応をしていく。

/gsd-quick や/gsd-debugを使用して、軽微な修正やエラーに対応していく。

実行結果

/gsd-quick “frontendで非推奨やエラーになっている箇所をReact v19に合わせて修正してください。”

I have successfully modernized the frontend codebase to align with **React v19** best practices and resolved several architectural patterns that are now considered legacy or deprecated.

### Modernization Summary
- **Context API**: Updated `ToastContext.tsx` to use the new direct context provider syntax (`<ToastContext value={...}>` instead of `<ToastContext.Provider>`).
- **Metadata Management**: Integrated native React 19 metadata support in `App.tsx`. SEO tags like `<title>` and `<meta>` are now managed declaratively within the component.
- **Form Actions**: Refactored `TaskInput.tsx` to utilize React 19's **Form Actions**. This significantly simplifies the component by:
- Removing manual `useState` and `onSubmit` event handling.
- Using the native `action` prop and `FormData` for automatic input extraction.
- Leveraging built-in browser validation via the `required` attribute.

### Verification Results
- [x] Context provider logic remains fully functional for toast notifications.
- [x] Metadata correctly updates the document title and description.
- [x] Task addition via Form Actions is verified and operational.
- [x] All existing automated tests pass with the new React 19 patterns.

**Committed:** `refactor: align frontend with React 19 best practices` (7a2d4f1) [ignoring loop detection]

他にも下記の通り実施した。(実行結果は省略)

/gsd-quick “React is declared but its value is never read.を最新版に合わせて修正してください。”
/gsd-quick “ReactNode is a type and must be imported using a type-only import when ‘verbatimModuleSyntax’ is enabled.を修正してください。”
/gsd-debug “Web画面からAddしたらエラーになりました。”

ここまでの実行でToDoアプリが最初の仕様通り動くようになったことを確認した。

これで、最初のmilestoneが完了となる。

/gsd-audit-milestone
を実施して、全ての実装が完了しているか確認させる。

The **v1.0 Milestone Audit** has passed with **100% requirements coverage**. 

All core functional gates—including the recent integration fix for task creation—are successfully verified. The application is now ready for formal archiving.

### Next Action
You can now proceed to archive the milestone:

`@[/gsd-complete-milestone]`

This will generate the release documentation, archive the roadmap and requirements, and tag the repository for v1.0.

/gsd-complete-milestone
を実施して、milestoneを完了とする。

The **v1.0 Milestone** is officially complete and archived.

### 🏆 Milestone Accomplishments (v1.0)
- **High-Performance Architecture**: Established a decoupled Spring Boot 4.0.6 (Virtual Threads) and React 19.2 (Vite) foundation.
- **Full CRUD Integration**: Seamless task management (Add, Toggle, Delete, View) with persistent H2 storage.
- **Premium UX**: Implemented optimistic updates and a dark-mode "Deep Space" theme for a low-latency, modern feel.
- **React 19 Readiness**: Early adoption of Form Actions, metadata support, and type-only imports for a future-proof frontend.

### 📂 Archive Record
- **Roadmap**: Archived to `.planning/milestones/v1.0-ROADMAP.md`
- **Requirements**: Archived to `.planning/milestones/v1.0-REQUIREMENTS.md`
- **Git Tag**: `v1.0` created successfully.

### 🚀 Next Steps
The workspace is now reset and ready for the next development cycle.

Would you like to start the next milestone?
`@[/gsd-new-milestone]` — Define the vision for v1.1 (e.g., PostgreSQL persistence, priorities, and deadlines).

まとめ

最後エラーが出ていたのは、React v19などの最新版を使用したためと思われる。それでも簡単なアプリであればGemini 3 Flashでも開発できた。

自分はGeminiのProプランに契約しているのだが、今回の実行では、Gemini 3 FlashのModel Quotaを3割ほど使用した。Model Quotaは5時間でリセットされるため、この利用制限が将来も続くのならば、かなり使い込んでも大丈夫じゃないだろうか。

Google AntigravityとGET SHIT DONEとGemini 3 Flashで開発してみる 3

Google AntigravityとGET SHIT DONEとGemini 3 Flashで開発してみる 2の続き。

実行結果

/gsd-discuss-phase 2

Phase 2: Frontend Foundation
Domain: React 19 Project Initialization & Infrastructure

We'll clarify **HOW** to implement the frontend foundation. (The core CRUD features will be built in Phases 3.)

**Carrying forward from earlier phases:**
- **Decoupled Architecture**: Frontend will reside in a separate `frontend/` directory.
- **Integration**: We will use a Vite proxy to route `/api` calls to the Spring Boot backend on port 8080.
- **Rich Aesthetics**: As per core instructions, we'll focus on premium, modern design using Vanilla CSS.

Which areas do you want to discuss for Frontend Foundation?

1. **Development Language** — TypeScript vs. JavaScript?
(Vite supports both; TypeScript provides better type safety for our ToDo model, but JavaScript is faster to scaffold.)

2. **Styling Strategy** — CSS Modules vs. Plain CSS?
(The developer prompt specifies Vanilla CSS. Using CSS Modules (`.module.css`) would help prevent class name collisions as the app grows while keeping it "Vanilla.")

3. **Folder Structure** — Feature-based vs. Type-based?
(A feature-based structure (`features/tasks/...`) is great for scalability, while a type-based structure (`components/`, `hooks/`, `services/`) is simpler for a bare-minimum v1.)

4. **UI Foundation** — Dark mode and Color Palette?
(Should we implement a dark-first aesthetic (premium feel) or a clean light mode? Do you have a specific primary color in mind (e.g., Indigo, Emerald, Slate)?)

*Or would you like to discuss something else?*

discussの内容については省略。

/gsd-plan-phase 2

### Research Recommendation

Phase 2 involves initializing a **React 19** project with **Vite**, configuring a **proxy** to our Spring Boot backend, and establishing a **Dark Mode** foundation using **CSS Modules**. Since React 19 and Vite 6 are relatively new, I recommend a quick research step to ensure we use the latest best practices and avoid common pitfalls.

**Research before planning Phase 2: Frontend Foundation?**

1. **Research first (Recommended)** — Investigate React 19/Vite 6 patterns, proxy configuration, and modern Dark Mode strategies.
2. **Skip research** — Plan directly from context and requirements.

*Type **1** or **2** to proceed.*
1
## Phase 2: Research & Validation Ready

I have completed the technical research and established a validation strategy for the **Frontend Foundation**.

### Research Highlights:
- **Tech Stack**: React 19 + Vite 6 + TypeScript.
- **Proxy**: Vite `server.proxy` configured to route `/api` to `localhost:8080`.
- **Styling**: Vanilla CSS + CSS Modules + Dark Mode foundation using CSS variables.
- **Testing**: Vitest + React Testing Library + MSW for API mocking.

### Validation Strategy:
- Created [02-VALIDATION.md](file:///home/hide6644/vscode/todo_web/.planning/phases/02-frontend-foundation/02-VALIDATION.md) with a Vitest-based architecture.

---

## ⚠ UI-SPEC.md missing for Phase 2
Since this phase involves UI development (React project initialization, UI shell, and styling foundation), a **UI Design Contract** is required before planning.

▶ **Recommended next step:**
`@[/gsd-ui-phase] 2` — generate UI design contract before planning

───────────────────────────────────────────────
**Also available:**
- `@[/gsd-plan-phase] 2 --skip-ui` — plan without UI-SPEC (not recommended for frontend phases)

作業がFrontendの場合は、
/gsd-ui-phase 2
を実施するように言われるため、実施する。

### UI-SPEC READY ✓

**Phase 2: Frontend Foundation** — UI design contract approved.

| Dimension | Status | Notes |
|-----------|--------|-------|
| Aesthetic | ✓ | Delivered "Deep Space" Premium Dark Mode. |
| Correctness | ✓ | Colors, Typography, and Spacing clearly defined as CSS variables. |
| Accessibility | ✓ | High contrast ratios (Slate 50 on Slate 950). |
| Consistency | ✓ | Aligned with TypeScript and Feature-based structure. |
| Implementation | ✓ | Tokens are ready for Vanilla CSS implementation. |
| Responsiveness | ✓ | Centered card layout with 90% mobile width. |

---

## ▶ Next Up — [TODO] todo_web

**Phase 2: Frontend Foundation** — Create the implementation plan.

`/clear` then:

`@[/gsd-plan-phase] 2`

**Committed:** `docs(02): approved UI design contract` (b7f2fe0) [ignoring loop detection]

もう一度、
/gsd-plan-phase 2
を実施し、続けて、
/gsd-execute-phase 2
を実施する。
以降3は同じように実施するため、省略。

//省略//

## ▶ Project Complete — v1.0 milestone achieved

The basic ToDo application is now fully built and verified according to the v1 requirements.

`/clear` then:

`@[/gsd-complete-milestone]` — archive the phase artifacts and prepare the final v1.0 release summary.

**Committed:** `feat(03): core integration complete - v1.0 functional` (bc39e8f) [ignoring loop detection]

まとめ

ここまでで実装完了になるが、VSCODEを見ると、警告やエラーが出ている。次回はこれの対応をしていく。

Google AntigravityとGET SHIT DONEとGemini 3 Flashで開発してみる 2

Google AntigravityとGET SHIT DONEとGemini 3 Flashで開発してみる 1の続き。ただし、環境をUbuntu Desktopに変更して同じようにやり直している。

続きの手順

/gsd-discuss-phase 1 プラン作成前に方向性を決めるために好みなど確認する
/gsd-plan-phase 1 どのような実装にするかプランを作成する
/gsd-execute-phase 1 プランに沿って実装する
必要なら
/gsd-verify-work 1 マニュアルでテストを行う
ここまで繰り返し。/gsd-discuss-phase 2、3と続けていく。

実行結果

/gsd-discuss-phase 1

We're starting **Phase 1: Backend Foundation**. The goal is to set up a functional REST API using Spring Boot 4 and H2.

I've identified a few implementation decisions we should clarify before I start planning:

* **Project Metadata**: What base package name (e.g., `com.example.todo`) and Group ID would you like to use?
* **API Design**: Are you comfortable with `/api/tasks` as the base endpoint? Also, should we use simple `Long` IDs or `UUID`s for the tasks?
* **H2 Console & Config**: Should I enable the H2 web console for easy data inspection?
* **Java 21 Virtual Threads**: I'll enable these by default as recommended in the research, unless you have other preferences.

Which of these would you like to discuss?

1. **Project Metadata** (Package/Group ID)
2. **API Design** (Endpoint naming/ID type)
3. **H2 Console & Config**
4. **Java 21 Virtual Threads setup** [ignoring loop detection]

複数質問があれば「1」とだけ回答すれば、上から順に詳細を確認してくれる。それか確認するのが面倒であればとりあえず全て推奨設定で良いと返答してしまうことも可能。

全ての質問に答え終わったら、
/gsd-plan-phase 1
を入力して次のphaseに進む。

We're ready to plan **Phase 1: Backend Foundation**. 

Since this phase involves setting up a new Spring Boot 4 project, I recommend a quick research step to confirm the optimal project structure, Maven/Gradle dependencies for SB 4.0.6, and the exact configuration properties for Virtual Threads.

1. **Research first (Recommended)**: Investigate the best way to initialize and configure the SB4 backend.
2. **Skip research**: Plan directly from our previous context and requirements. [ignoring loop detection]
1
I've completed the planning for **Phase 1: Backend Foundation**.

### Research Findings
I've verified the implementation details for **Spring Boot 4.0.6**:
* **Virtual Threads**: Enabled via `spring.threads.virtual.enabled=true`.
* **H2**: Configured for in-memory mode with the web console enabled for debugging.
* **Dependencies**: Using Spring Web, Spring Data JPA, H2, and Lombok.

### Plans Created
1. [01-01-PLAN.md](file:///home/hide6644/vscode/todo_web/.planning/phases/01-backend-foundation/01-01-PLAN.md): **Project Setup** — Initialize the Maven project and configure infrastructure.
2. [01-02-PLAN.md](file:///home/hide6644/vscode/todo_web/.planning/phases/01-backend-foundation/01-02-PLAN.md): **Task CRUD API** — Implement the data model, repository, service, and REST endpoints.

### Validation Strategy
I've defined a [VALIDATION.md](file:///home/hide6644/vscode/todo_web/.planning/phases/01-backend-foundation/01-VALIDATION.md) that includes:
* Automated JUnit 5 and Mockito tests for all CRUD operations.
* A "quick run" command for rapid feedback during development.
* Verification of Virtual Threads activation and H2 console access.

**Ready to start execution?** [ignoring loop detection]

プランが作成されたので、
/gsd-execute-phase 1
を入力して実装に進む。

I've completed **Phase 1: Backend Foundation**.

### Accomplishments
- **Spring Boot 4.0.6 Backend**: Initialized a decoupled Maven project in the `backend/` directory.
- **Java 25 Support**: Successfully configured the project to use Java 25 (matching the local environment) with full JDK support.
- **Virtual Threads**: Enabled Loom-based concurrency via `spring.threads.virtual.enabled=true`.
- **H2 Database**: Configured an in-memory database with the web console enabled at `/h2-console`.
- **Task CRUD API**: Implemented the full Entity-Repository-Service-Controller stack for managing tasks.
- **Lombok Integration**: Configured annotation processing for clean, boilerplate-free code.

### REST API Endpoints
- `GET /api/tasks`: List all tasks.
- `POST /api/tasks`: Create a new task.
- `PATCH /api/tasks/{id}`: Update an existing task.
- `DELETE /api/tasks/{id}`: Remove a task.

### Verification Results
- **Build**: `mvn clean compile` passed successfully.
- **Tests**: `mvn test` passed (Context load test).
- **Virtual Threads**: Configuration verified in `application.properties`.

### Created Walkthrough
I've documented the changes and how to run the application in a new walkthrough.

**Phase 1 is complete. Shall we proceed to Phase 2: Frontend Foundation?** [ignoring loop detection]

Edited walkthrough.md

I've completed **Phase 1: Backend Foundation**.

### Accomplishments
- **Spring Boot 4.0.6 Backend**: Initialized a decoupled Maven project in the `backend/` directory.
- **Java 25 Support**: Successfully configured the project to use Java 25 with full JDK support.
- **Virtual Threads**: Enabled Loom-based concurrency via `spring.threads.virtual.enabled=true`.
- **H2 Database**: Configured an in-memory database with the web console enabled.
- **Task CRUD API**: Implemented the full stack (Entity, Repository, Service, Controller) for managing tasks.

### REST API Endpoints
- `GET /api/tasks`: List all tasks.
- `POST /api/tasks`: Create a new task.
- `PATCH /api/tasks/{id}`: Update an existing task.
- `DELETE /api/tasks/{id}`: Remove a task.

### Verification
- **Build & Test**: `mvn clean compile` and `mvn test` passed successfully.
- **Lombok**: Annotation processing is correctly configured.

You can find the detailed summary in the [walkthrough.md](file:///home/hide6644/.gemini/antigravity/brain/22e64e01-7f77-4166-8ff8-7e37bef10b51/walkthrough.md).

**Phase 1 is complete. Shall we proceed to Phase 2: Frontend Foundation?** [ignoring loop detection]

/gsd-progress
で全体の進捗を確認できる。

## Progress Report: todo_web (v1.0)

**Phase 1: Backend Foundation** is now **COMPLETE**! We have a working Spring Boot 4.0.6 backend with Java 25, Virtual Threads, and a functional Task CRUD API.

### Current Status
| Phase | Status | Progress |
|-------|--------|----------|
| 1. Backend Foundation | ✅ Complete | 2/2 Plans done |
| 2. Frontend Foundation | ⬜ Not started | 0 Plans |
| 3. Core Integration | ⬜ Not started | 0 Plans |

### Recent Accomplishments
* Initialized Spring Boot 4 project with Java 25.
* Enabled Virtual Threads and H2 Database.
* Implemented `Task` CRUD REST API (`GET`, `POST`, `PATCH`, `DELETE`).
* Verified backend functionality with JUnit and compilation checks.

---

### Intelligent Routing

Based on our progress, we should now move to **Phase 2: Frontend Foundation**.

#### Recommended Path
**Route A: Start Phase 2: Frontend Foundation**
Initialize the React 19 application using Vite and set up the development proxy to communicate with our new backend.

**Next Action**: `/gsd-discuss-phase 2` [ignoring loop detection]

以降phaseが完了するまで、続ける。

まとめ

次回は「/gsd-discuss-phase 2」へと進みFrontendの実装に進む。

Google AntigravityとGET SHIT DONEとGemini 3 Flashで開発してみる 1

目的

最近、AIの利用料金が上がったり、利用制限がきつくなったりしている。なるべく低コストで実行したい。トークン毎の単価が安いGemini 3 Flashでどこまで出来るのかテストしてみる。

環境

Windows11→後でLinuxに変更
nodejs、git導入済み

準備

GSDでは自動的にGitコミットを行い履歴を管理することが出来る。そのままだと不要なファイルまでコミットしていしまうため、フォルダを作成し、.gitignoreを最初に配置する。.gitignoreファイルはGET SHIT DONEのレポジトリのものをコピーした。

GSDのインストール

アプリ作成予定のフォルダで下記のコマンドを実行する。

npx get-shit-done-cc@latest

オプション選択は下記の通り。

2) Antigravity
2) Local (./.agent) – this project only

実行

上記のフォルダをAntigravityで開き、Antigravity上のチャットウィンドウで下記を実行する。

/gsd-new-project

What do you want to build? Tell me about your idea, the problem it solves, or even just a rough concept. I'll help you flesh it out.

下記の通り日本語で書いてみる。

Spring Boot 4.0.6とReact 19.2を使って、タスク管理システムを作成したい。
That sounds like a powerful stack for a task management system. React 19 and Spring Boot 4 (anticipating the next major release) will provide a very modern foundation.

To help me shape the project correctly, could you tell me more about the vision?

1. **Who is this for?** Is it a personal tool for you, or something designed for teams to collaborate?
2. **What's the "killer feature"?** Besides basic tasks, is there something specific you're looking for (e.g., AI assistance, complex recurring patterns, specific integrations)?
3. **What does "done" look like for the first version?**

I've also prepared some specific directions we could take:

- **Collaboration**: Focus on multi-user support, comments, and real-time updates.
- **Productivity**: Focus on tagging, priorities, deadlines, and dashboard analytics.
- **Simplicity**: A clean, distraction-free "just get it done" interface.
- **Something else**: I'd like to describe my vision in detail.
個人向けのツール。タスクの登録、更新、削除、一覧表示できる状態を最初のゴールとしたい。
シンプルで集中して作業できるインターフェースに重点を置く。
Got it. A minimalist, personal task manager focusing on pure CRUD first.

Regarding the "Simple and Focus-oriented" interface, what does that mean to you in practice?

- **List-Centric**: A single, clean vertical list where you can quickly type and add tasks.
- **Kanban-Lite**: Simple "To Do", "Doing", "Done" columns to see flow at a glance.
- **Focus Mode**: A view that highlights only the "Current Task" to minimize distractions.
- **Minimalist Grid**: A dashboard that shows tasks in a clean grid format.

Also, for the **v1 tasks**, what information should each task hold?
- Just a Title
- Title + Description
- Title + Priority + Due Date
- Title + Status (Done/Not Done)

I'm starting to see the shape of the project. Once we settle these, I can create the `PROJECT.md`.
タスクの流れを一目で把握できる、「ToDo」「進行中」「完了」のシンプルな列。
I think I understand what you're after: a clean, 3-column Kanban-style task manager (ToDo, In Progress, Done) built with the latest Spring Boot and React.

Ready to create `PROJECT.md`?

- **Create PROJECT.md**: Let's move forward
- **Keep exploring**: I want to share more / ask me more
PROJECT.mdを作成してください。
`PROJECT.md` is initialized! Now, let's configure your workflow preferences.

Currently, your `.gitignore` excludes the `.planning/` directory.

I have some recommended settings for our work together:

- **Mode**: **YOLO** (Auto-approve execution) or **Interactive** (I'll ask for approval at each step).
- **Git Tracking**: Should we track planning documents (like `PROJECT.md`, `ROADMAP.md`) in Git? (I'll need to remove `.planning/` from your `.gitignore` if so).
- **Execution**: Run plans in **Parallel** (Faster) or **Sequential** (One by one).
- **AI Agents**: Should I use additional agents for **Research**, **Plan Checking**, and **Verification**? (Improves quality but uses more tokens).

How would you like to proceed?

- **Use Recommended Defaults**: YOLO, track planning docs, parallel execution, all agents enabled.
- **Modify Settings**: Let's go through them one by one.
- **Configure Fresh**: Walk through all options.

PROJECT.md

# Simple Kanban Task Manager

## What This Is

A minimalist, personal task management system that helps users stay focused and organized. It features a simple 3-column Kanban board to visualize the flow of tasks from "To Do" to "In Progress" and finally "Done."

## Core Value

A simple and focus-oriented interface that provides a clear overview of task progress at a glance.

## Requirements

### Validated

(None yet — ship to validate)

### Active

- [ ] Task Dashboard: Display 3 columns ("ToDo", "進行中", "完了") for task visualization.
- [ ] Task Creation: Register new tasks into the "ToDo" column.
- [ ] Task Management: Update task details and move tasks between columns.
- [ ] Task Deletion: Remove tasks that are no longer needed.
- [ ] Single User focus: Designed for individual productivity without complex multi-user overhead.

### Out of Scope

- Multi-user collaboration — Focus is on personal use for v1.
- Complex task details (attachments, subtasks) — Keeping the interface minimalist.
- Third-party integrations (Google Calendar, etc.) — Maintaining a self-contained system.

## Context

- The user wants a modern, cutting-edge foundation using Spring Boot 4.0.6 and React 19.2.
- The primary goal is to have a functional CRUD application with a clean UI that minimizes distractions.

## Constraints

- **Tech Stack**: Spring Boot 4.0.6 — User specified version (anticipating latest features).
- **Tech Stack**: React 19.2 — User specified version for modern UI development.
- **Timeline**: v1 goal is basic CRUD functionality in a Kanban layout.

## Key Decisions

| Decision | Rationale | Outcome |
|----------|-----------|---------|
| Kanban Layout | User requested "ToDo", "進行中", "完了" columns for one-glance tracking. | — Pending |
| Minimalist UI | Focus on reducing distractions for personal productivity. | — Pending |

## Evolution

This document evolves at phase transitions and milestone boundaries.

**After each phase transition** (via `/gsd-transition`):
1. Requirements invalidated? → Move to Out of Scope with reason
2. Requirements validated? → Move to Validated with phase reference
3. New requirements emerged? → Add to Active
4. Decisions to log? → Add to Key Decisions
5. "What This Is" still accurate? → Update if drifted

**After each milestone** (via `/gsd-complete-milestone`):
1. Full review of all sections
2. Core Value check — still the right priority?
3. Audit Out of Scope — reasons still valid?
4. Update Context with current state

---
*Last updated: 2026-05-02 after initialization*

まとめ

ここまでは問題なさそう。次回は「/gsd-discuss-phase 1」に進む。

GET SHIT DONEを既存プロジェクトで実行してみる

GET SHIT DONEの概要

この言葉の本質は、単なる「忙しさ」ではなく「完了(Done)」に全神経を集中させることです。

  • 完璧主義の排除: 80%の出来でも良いから、まずは終わらせて世に出す。
  • スピード重視: 議論や計画に時間をかけすぎるのを嫌い、即座に手を動かす。
  • 結果への執着: 「プロセス」ではなく「何が成し遂げられたか」という結果だけで自分を評価する。

インストール

プロジェクトのフォルダに移動して、下記コマンドを実行し、最新版をインストールする。

npx get-shit-done-cc@latest

2を選択。

2を選択。

実行

下記コマンドを実行し、既存のコードを読み込ませる。

/gsd-map-codebase

下記コマンドを実行し、マイルストーンを作成する。

/gsd-new-milestone

実行結果

It looks like .planning/PROJECT.md doesn't exist yet (we recently mapped the codebase but haven't formally initialized the project yet), but we can configure this as our first milestone.

What do you want to build next in this milestone? (e.g. Any specific new features, enhancements, or bug fixes?)

上記のような質問が帰って来たため、以下の通り指示をする。

今後の機能拡張に備えて修正しておいた方が良い箇所はありますか?

最終的な出力

先ほどのコードベースの調査(gsd-map-codebase)の結果を踏まえると、今後の機能拡張をスムーズかつ安全に進めるために、現在の段階で整備・修正しておきたい箇所(技術的負債や準備不足の領域)がいくつか見受けられます。

次回のマイルストーン(機能追加)に着手する前に、あるいはその最初のフェーズとして、以下の点を解消しておくことを強くお勧めします。

1. データベースのマイグレーション管理(最優先)

  • 現状: バックエンドでは backend/sql/create_tables.sql を利用してDBの初期化を行っています(Dockerの docker-entrypoint-initdb.d にもマウントされています)。
  • 課題: 今後新しい機能を追加する際に「テーブルに新しいカラムを追加する」「既存のデータ構造を変更する」といった変更(ALTER)が発生しますが、現状の仕組みではスキーマのバージョン管理ができません。
  • 対策: FlywayLiquibase といったマイグレーションツールを Spring Boot に導入し、SQLスクリプトをバージョン付き(例: V1__init.sql, V2__add_user_columns.sql)で管理できる体制に変更することをお勧めします。

2. フロントエンドのテスト環境の構築

  • 現状: バックエンド(Spring Boot)には JUnit を用いたテスト機構が含まれていますが、フロントエンドの package.json を見る限り、自動テストフレームワーク(Vitest や Jest、React Testing Library)が設定されていません。
  • 課題: 今後 UI や状態管理(React Queryなど)が複雑化していくと、デグレ(既存機能の予期せぬ破壊)を手動で防ぐのが困難になります。
  • 対策: VitestReact Testing Library のベース環境だけでも構築しておき、今後作成する重要なコンポーネント(フォームなど)に対して単体テストを書ける土台を用意しておくべきです。

3. フロントエンドの API クライアント層の整備

  • 現状: frontend/src/api/ の下には axios.js(設定ファイルのみ)しか存在していません。
  • 課題: エンドポイントが増えるにつれて、各コンポーネント内で直接 axios.get('/api/xxx') のように記述すると、将来的な URL の変更や、型の不整合を管理しきれなくなります。
  • 対策: バックエンドの OpenAPI (Swagger) からフロントエンドの API クライアント(と TypeScript 型定義相当の Zod スキーマなど)を自動生成するツール(例: Orval など)を導入するか、少なくとも src/api/ パッケージ以下にエンドポイントごとの関数の切り出しと、エラーの共通ハンドリング(Axios Interceptorsでの共通トースト通知など)を整備しておくべきです。

4. 認証・セキュリティ情報などのハードコード排除の確認

  • 現状: docker-compose.yml 内で一部の設定(${DB_PASSWORD} など)を変数化していますが、開発中の暫定値などに依存している可能性があります。
  • 対策: Local用・Production用等に向けた Spring の Profile (application-{profile}.properties) や .env ファイルでの環境変数管理が隅々まで行き届いているか点検しておくと、後々デプロイする時に慌てずに済みます。

▶ 次のアクションの提案

もしよろしければ、このまま次期マイルストーンを作成し、
「機能拡張を始めるための技術基盤の整備(インフラ・テスト・API設計基盤)」 を最初のフェーズ (Phase 1) としてロードマップに組み込むことができます。

この流れで /gsd-new-milestone による次期マイルストーンの策定に進みますか? もしくは先述の課題のうち、特にどれか一つを先に修正したい領域はありますか?

さらに下記の通り指示をする。

2. フロントエンドのテスト環境の構築のみを次期マイルストーンとしたいです。

フロントエンドのテスト環境構築をマイルストーン v1.0 として進めるための実装計画を implementation_plan.md に作成しました(エディタまたはコンソール上で確認できるはずです)。

具体的には、プロジェクト管理としてGSDファイル (PROJECT.md, ROADMAP.md など) の初期化を行うと同時に、フロントエンドでの VitestReact Testing Library の設定作業などを行います。

内容をご確認いただき、問題なければこの計画に沿ってインストールやファイル作成の作業を進めさせていただきます。「承認(または進めてOK)」とお知らせください!

結果

やることが明確になって良い。

Google Antigravityすごい!

論より証拠ということで、Antigravityで作成したプログラムをGithub公開した。

プログラムを自分で書いたり、テストデータを作成したりは一切していない。Agentへの指示のみでここまで出来た。

まとめ

  • AIに指示を出すときにある程度のシステム知識は必要。あればあるほど良い。
  • AIの間違いを指摘する程度の知識は必要。
  • ループしてAIの作業が終わらないときがある。
  • AIの知識が古い。数か月前のバージョンを指定される。勝手にバージョンを古いものに戻されたりする。古いバージョンは脆弱性があったりするのでWebアプリ開発では特に注意が必要。
  • 楽だけど早くはない。
  • なぜそのような処理になっているのかAIに回答を求めること出来るため、プログラムを勉強するには良い。

Novel Search System

A full-stack web application for managing and searching novels, built with modern technologies including Spring Boot and React.

Overview

This project is a comprehensive system designed to handle novel data, authors, and user authentication. It features a robust backend API and a responsive, internationalized frontend interface.

Tech Stack

Backend

  • Java: 25
  • Framework: Spring Boot 4
  • Database: MariaDB
  • Security: Spring Security
  • Tools: Maven, Lombok

Frontend

  • Framework: React 19 (Vite)
  • UI Library: Material UI (MUI) v7
  • State Management: TanStack Query (React Query) v5
  • Routing: React Router
  • Forms: React Hook Form + Zod
  • Internationalization: i18next
  • HTTP Client: Axios

Features

  • User Authentication: Secure login and registration system.
  • Novel Management: Create, read, update, and delete novels.
  • Author Management: Manage author profiles and link them to novels.
  • Internationalization (i18n): Full support for English and Japanese languages.
  • Responsive Design: Modern UI adapted for various screen sizes.

Getting Started

Prerequisites

  • Java JDK 25
  • Node.js (Latest LTS recommended)
  • MariaDB Server

Backend Setup

  1. Navigate to the backend directory: cd backend
  2. Configure the database connection in src/main/resources/application.properties if necessary (defaults to localhost:3306).
  3. Build and run the application: ./mvnw spring-boot:run The backend server will start on http://localhost:8080.

Frontend Setup

  1. Navigate to the frontend directory: cd frontend
  2. Install dependencies: npm install
  3. Start the development server: npm run dev The frontend application will be accessible at http://localhost:5173.

Logging

The application is configured to output logs to the logs/ directory:

  • app.log: General application logs.
  • error.log: Error-level logs.
  • debug.log: Debug-level logs for the application package.
  • sql.log: SQL statements and Hibernate logs.

License

MIT

Xのタイムラインから誹謗中傷や攻撃的な投稿を非表示にする

生成AIに「最強のミュートワードリスト」を作らせる(スマホ・PC共通)

「Xの標準機能(ミュート)」と「ChatGPTなどのAI」を組み合わせる、現実的で効果が高い方法です。

手順:

  1. AI(ChatGPTやGemini)に指示する: 誹謗中傷によく使われる言葉、不快な言い回し、暴言のパターンをAIに列挙させます。

    プロンプト例: 「X(Twitter)のタイムラインで、他人を攻撃したり誹謗中傷したりする投稿を見たくありません。そのような投稿によく含まれる単語、フレーズ、隠語を50個リストアップしてください。カンマ区切りで出力してください。」
  2. Xの設定にコピー&ペースト: 出力された単語リストを、Xの「設定とプライバシー」>「プライバシーと安全」>「ミュートとブロック」>「ミュートするキーワード」に登録します。
    • メリット: 無料で、スマホアプリにも適用され、確実に消えます。
    • デメリット: 定期的にリストを更新する必要があります。

    その他の設定項目

    対象を「フォローしていないアカウント」にすると良いでしょう。

    Dockerイメージを軽くする「マルチステージビルド」について

    前回の記事では、複数のコンテナを操る docker-compose.yml の書き方を紹介した。今回は、そのコンテナの中身を定義する Dockerfile について書く。

    今回作成したバックエンド(Java/Spring Boot)とフロントエンド(React/Node.js)のDockerfileには、「マルチステージビルド」と使っている。

    これを使うと、「イメージサイズが小さくなり、セキュリティも向上する」

    バックエンド編:Java (Spring Boot)

    Javaアプリを動かすには、ビルドツールの「Maven」や「Gradle」が必要だが、実行時にこれらは不要となる。そこで、ビルドする段階と、実行する段階を分ける。

    # --- Stage 1: ビルド環境 ---
    FROM maven:3.9-eclipse-temurin-25 AS build
    WORKDIR /app
    COPY pom.xml .
    COPY src ./src
    # テストはCIでやる前提でスキップし、ビルド時間を短縮
    RUN mvn clean package -DskipTests
    
    # --- Stage 2: 実行環境 ---
    FROM eclipse-temurin:25-jre
    WORKDIR /app
    # ビルド環境(Stage 1)で作った成果物(jar)だけをコピー
    COPY --from=build /app/target/*.jar app.jar
    EXPOSE 8080
    ENTRYPOINT ["java", "-jar", "app.jar"]

    • AS build と COPY –from=build: 最初の FROM で「build」という名前をつけ、そこで mvn package して jarファイルを作る。2つ目の FROM が本番用イメージ。ここには Maven もソースコードも含まれない。あるのは 「JRE(Java実行環境)」と「jarファイル」だけ。 これにより、数百MB単位で容量を節約できる。
    • eclipse-temurin:25-jre: JDK(開発キット)ではなく、JRE(実行環境)を選んでいる。コンパイラなどが含まれないため、攻撃者に悪用されるリスクが減る。

    フロントエンド編:Node.js (React/Vueなど)

    フロントエンド開発では npm run dev サーバーを使うが、本番環境でNode.jsサーバーをそのまま動かすのはパフォーマンス的に最適ではない。 ビルドした静的ファイル(HTML/CSS/JS)を、高速なWebサーバーである Nginx に配信させる。

    # --- Stage 1: ビルド環境 ---
    FROM node:24-alpine AS build
    WORKDIR /app
    COPY package.json package-lock.json ./
    # npm install より高速で、lockファイルに忠実な ci を使用
    RUN npm ci
    COPY . .
    RUN npm run build
    
    # --- Stage 2: 配信環境 (Nginx) ---
    FROM nginx:alpine
    # ビルド成果物(dist)をNginxの公開ディレクトリに配置
    COPY --from=build /app/dist /usr/share/nginx/html
    # SPA用の設定ファイルをコピー
    COPY nginx.conf /etc/nginx/conf.d/default.conf
    EXPOSE 80
    CMD ["nginx", "-g", "daemon off;"]

    • Node.js はビルド時のみ使用: Reactなどのコードはブラウザで動くJavaScriptに変換(トランスパイル)する必要がある。これには Node.js が必要だが、変換が終われば Node.js 自体は不要となる。 最終的なイメージは nginx:alpine ベースになるため、サイズはわずか数十MBに収まる。
    • npm ci の採用: npm install ではなく npm ci を使っている。これは package-lock.json を厳密に守ってインストールを行うコマンドで、CI/CDやDockerビルドでの再現性を保証する。
    • カスタムNginx設定: ReactのようなSPA(シングルページアプリケーション)では、どのURLにアクセスしても index.html を返す設定が必要になるため、デフォルト設定を上書きしている。

    まとめ

    今回作成した2つのDockerfileに共通するのは、「作る道具(Maven/Node)」と「動かす場所(JRE/Nginx)」を明確に分けている点となる。

    Docker Composeで、Webアプリ開発環境を作る

    今回は、典型的な「フロントエンド(React等) + バックエンド(Spring/Node等) + データベース(MariaDB)」の構成を例に docker-compose.yml を書いた。

    今回の構成

    3つのコンテナ(Service)が専用のネットワーク内で連携し、データはボリュームによって永続化される構成。

    完成した docker-compose.yml

    以下が今回解説する設定ファイル。例として小説検索システム(Novel Search System)のようなアプリケーションを想定している。

    services:
      backend:
        build: ./backend
        container_name: novel-backend
        ports:
          - "8080:8080"
        environment:
          - DB_URL=jdbc:mariadb://novel-db:3306/${DB_NAME}
          # ... (省略)
        depends_on:
          novel-db:
            condition: service_healthy # ここが重要!
        networks:
          - novel-network
    
      frontend:
        build: ./frontend
        container_name: novel-frontend
        ports:
          - "80:80"
        depends_on:
          - backend
        networks:
          - novel-network
    
      novel-db:
        image: mariadb:12.1
        container_name: novel-db
        environment:
          - MARIADB_DATABASE=${DB_NAME}
          # ... (省略)
        healthcheck:
          test: ["CMD-SHELL", "mariadb-admin ping -h localhost -u root -p$$MARIADB_ROOT_PASSWORD || exit 1"]
          interval: 10s
          timeout: 5s
          retries: 10
        volumes:
          - db_data:/var/lib/mysql
          - ./backend/sql:/docker-entrypoint-initdb.d
        networks:
          - novel-network
    
    networks:
      novel-network:
        driver: bridge
    
    volumes:
      db_data:

    1.データベースの「起動待ち」を完璧にする healthcheck

    Docker Composeでよくあるトラブルが、「DBが完全に立ち上がる前にバックエンドが接続に行き、エラーで落ちる」という現象。

    単なる depends_on: – novel-db だけでは、「コンテナが作成された」ことしか確認できず、「DB接続の準備ができた」ことまでは保証されない。

    そこでHealthcheck(ヘルスチェック) を行う。

    novel-db:
        # ...
        healthcheck:
          test: ["CMD-SHELL", "mariadb-admin ping ..."]
          interval: 10s
          retries: 10

    ここでは mariadb-admin ping コマンドを定期的に実行し、DBが応答するかを監視している。

    backend側では以下のように記述する。

    backend:
        depends_on:
          novel-db:
            condition: service_healthy

    これにより、「DBのヘルスチェックがOKになるまで、バックエンドを起動させない」という制御が可能になる。

    2.データの永続化と初期データの投入

    データベースをコンテナ化する際、コンテナを削除するとデータも消えてしまう。これを防ぐのが volumes 。

    volumes:
          - db_data:/var/lib/mysql
          - ./backend/sql:/docker-entrypoint-initdb.d

    • db_data:/var/lib/mysql: ホスト側(Docker管理領域)にデータを保存する。コンテナを作り直しても、小説データやユーザーデータは消えない。
    • ./backend/sql:/docker-entrypoint-initdb.d: MariaDBやMySQLの公式イメージは、/docker-entrypoint-initdb.d に置かれた .sql ファイルを、初回起動時に自動実行してくれる。 テーブル作成や初期データの投入を自動化できるため、開発メンバー全員が docker compose up 一発で同じDB状態から開発をスタートできる。

    EclipseからVS Codeに開発環境を移した

    フロントエンドの開発をしたかったので、VS Codeを触ってみた。

    殆ど問題なく作業を進めることが出来たが、一部戸惑った点を書き残しておく。

    起動構成はJSON形式で書く

    {
        "configurations": [
            {
                "type": "java",
                "name": "Spring Boot App",
                "request": "launch",
                "mainClass": "com.example.novel.NovelApplication",
                "projectName": "",
                "env": {
                    "DEV_DB_URL": "jdbc:mariadb://url",
                    "DEV_DB_USERNAME": "id",
                    "DEV_DB_PASSWORD": "pass"
                }
            },
            {
                "type": "node",
                "name": "React App",
                "request": "launch",
                "runtimeExecutable": "npm",
                "runtimeArgs": [
                    "run-script",
                    "dev"
                ],
                "cwd": "${workspaceFolder}/frontend",
                "console": "integratedTerminal"
            }
        ]
    }

    1. ひとつ目の設定:Java (Spring Boot) アプリケーション用

    Javaのプログラム(Spring Bootなど)を起動するための設定。

    • "type": "java"
      • Java拡張機能を使ってデバッグ
    • "name": "Spring Boot App"
      • VS Codeの「実行とデバッグ」画面のプルダウンメニューに表示される名前
    • "request": "launch"
      • 新しくプログラムを起動するという意味(対義語は "attach" で、既に動いているプロセスに接続する場合に使う)
    • "mainClass": "com.example.novel.NovelApplication"
      • プログラムのエントリーポイント(public static void main メソッドがあるクラス)を指定
    • "projectName": ""
      • 通常、VS Codeが認識しているJavaプロジェクト名(フォルダ名など)が入る
      • 空欄 "" のままだと、複数のプロジェクトがある場合に起動できない可能性がある。1つだけなら問題なし
    • "env"
      • プログラム実行時にOSの環境変数として渡す値を設定している
      • アプリケーション側(application.properties など)で、DB接続情報をハードコードせずに、ここから読み込むようにしている
        • DEV_DB_URL: 接続先データベースのURL
        • DEV_DB_USERNAME: データベースのユーザーID
        • DEV_DB_PASSWORD: データベースのパスワード

    2. ふたつ目の設定:Node.js (NPM) アプリケーション用

    フロントエンド開発(React, Vueなど)の開発サーバーを起動するための設定。

    • "type": "node"
      • Node.js用のデバッグ
    • "name": "React App"
      • VS Codeの「実行とデバッグ」画面のプルダウンメニューに表示される名前
    • "request": "launch"
      • 新しくプログラムを起動するという意味
    • "runtimeExecutable": "npm"
      • 直接 node コマンドを実行するのではなく、npm コマンドを実行する
    • "runtimeArgs": [ "run-script", "dev" ]
      • npm コマンドに渡す引数
      • つまり、ターミナルで npm run-script dev (または単に npm run dev)と打つのと同じコマンドが実行される
    • "cwd": "${workspaceFolder}/frontend"
      • Current Working Directory(作業ディレクトリ)の指定
      • ${workspaceFolder} はVS Codeで開いているルートフォルダを指す
    • "console": "integratedTerminal"
      • ログの出力先を「デバッグコンソール」ではなく、VS Codeの**「統合ターミナル」**にする

    VS Codeの設定はJSON形式で書く

    {
        "java.configuration.updateBuildConfiguration": "automatic",
        "java.compile.nullAnalysis.mode": "automatic",
        "maven.terminal.customEnv": [
            {
                "environmentVariable": "DEV_DB_URL",
                "value": "jdbc:mariadb://url"
            },
            {
                "environmentVariable": "DEV_DB_USERNAME",
                "value": "id"
            },
            {
                "environmentVariable": "DEV_DB_PASSWORD",
                "value": "pass"
            }
        ]
    }

    1. Javaのビルド・解析設定

    VS CodeがJavaプロジェクトをどう扱うかという、エディタの挙動設定

    • "java.configuration.updateBuildConfiguration": "automatic"
      • 意味: pom.xml(や build.gradle)が書き換えられた際、自動的にプロジェクト構成を更新する
      • Eclipseで言うと: プロジェクトを右クリックして行う 「Maven > プロジェクトの更新 (Alt+F5)」を、保存のたびに全自動でやってくれる機能
      • メリット: 依存ライブラリを追加した際、いちいち手動更新しなくてもすぐにimportできるようになる
    • "java.compile.nullAnalysis.mode": "automatic"
      • 意味: Javaのコードに対するNull(ヌル)分析機能のモード
      • 動作: プロジェクト内にNull注釈(@Nullable@NonNull など)が含まれている場合、自動的にNullポインタ参照の警告を出してくれる
      • メリット: 「ここでNullになる可能性があります」という警告がエディタ上で出るようになり、NullPointerExceptionを未然に防ぎやすくなる

    2. Maven実行時の環境変数設定

    • "maven.terminal.customEnv": [ ... ]
      • 意味: VS CodeのMaven拡張機能を使ってコマンド(例: mvn spring-boot:runmvn test)を実行する際、一時的にセットする環境変数を定義