diff --git a/.miyabi/README.md b/.miyabi/README.md new file mode 100644 index 0000000..9e26f91 --- /dev/null +++ b/.miyabi/README.md @@ -0,0 +1,66 @@ +# .miyabi Directory + +Miyabi CLI設定ディレクトリ + +## 構造 + +``` +.miyabi/ +├── agents/ +│ └── specs/ # Agent仕様定義 +├── commands/ # カスタムコマンド +├── prompts/ # 再利用可能プロンプト +├── templates/ # テンプレート +├── sessions/ # 保存されたセッション +└── config.toml # 設定ファイル +``` + +## 設定ファイル + +`config.toml` で設定をカスタマイズ: + +```toml +[api] +model = "claude-sonnet-4-20250514" +max_tokens = 8192 + +[ui] +theme = "tokyo-night" +vim_mode = false + +[session] +auto_save = true + +[tools] +enable_bash = true +``` + +## カスタムコマンド + +`commands/` 配下に `*.md` ファイルを作成してカスタムコマンドを定義。 + +## セッション管理 + +```bash +# セッション一覧 +miyabi sessions + +# Markdownエクスポート +miyabi sessions -m + +# 削除 +miyabi sessions -d +``` + +## 使い方 + +```bash +# TUI起動 +miyabi + +# バージョン情報 +miyabi version + +# ヘルプ +miyabi --help +``` diff --git a/.miyabi/config.toml b/.miyabi/config.toml new file mode 100644 index 0000000..64c718c --- /dev/null +++ b/.miyabi/config.toml @@ -0,0 +1,29 @@ +# Miyabi CLI Configuration + +[api] +# Anthropic API key (or set ANTHROPIC_API_KEY env var) +# api_key = "your-api-key-here" +model = "claude-sonnet-4-20250514" +max_tokens = 8192 +timeout_secs = 120 +max_retries = 3 + +[ui] +show_sidebar = false +show_status_bar = true +show_breadcrumb = true +theme = "tokyo-night" +vim_mode = false +show_line_numbers = true + +[session] +auto_save = true +auto_save_interval = 30 +max_sessions = 100 + +[tools] +enable_bash = true +enable_file_tools = true +enable_search_tools = true +auto_approve_low_risk = false +bash_timeout = 120 diff --git a/.miyabi/prompts/code-review.md b/.miyabi/prompts/code-review.md new file mode 100644 index 0000000..f3328ce --- /dev/null +++ b/.miyabi/prompts/code-review.md @@ -0,0 +1,15 @@ +# Code Review Prompt + +以下のコードをレビューしてください: + +## チェックポイント +- コードの品質と可読性 +- エラーハンドリング +- パフォーマンス +- セキュリティ +- テストカバレッジ + +## 出力形式 +1. 問題点(重要度順) +2. 改善提案 +3. 良い点 diff --git a/.miyabi/templates/issue.md b/.miyabi/templates/issue.md new file mode 100644 index 0000000..98a7319 --- /dev/null +++ b/.miyabi/templates/issue.md @@ -0,0 +1,15 @@ +# Issue Template + +## Description +[問題や機能の説明] + +## Requirements +- [ ] 要件1 +- [ ] 要件2 + +## Acceptance Criteria +- [ ] 完了条件1 +- [ ] 完了条件2 + +## Technical Notes +[技術的な注意点] diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..1bf44f3 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,27 @@ +# Repository Guidelines + +## Project Structure & Module Organization +- Rust workspace lives under `crates/`: `miyabi-cli` (CLI entry), `miyabi-tui` (UI), and `miyabi-core` (shared logic, config, sessions). Shared workspace config in `Cargo.toml`. +- TypeScript side sits in `src/` with `index.ts` as the entry point; Vitest specs live in `tests/`. Build artifacts output to `dist/`. +- Supporting assets: `.claude/` agent configs, `docs/` for design notes, `.miyabi/` for local runtime data, and `.github/` for CI workflows. + +## Build, Test, and Development Commands +- Rust: `cargo build --workspace --release` (release build), `cargo test --all` (unit/integration), `cargo clippy --all-targets -- -D warnings` (lint), `cargo fmt --all` (format). +- TypeScript: `npm run dev` (tsx watch), `npm run build` (tsc emit to `dist/`), `npm run typecheck` (tsc no emit), `npm run lint` (eslint per `.eslintrc.json`), `npm test` (vitest). +- Install toolchains: `npm install` for JS deps; Rust uses stable 1.75+ per workspace metadata. + +## Coding Style & Naming Conventions +- Rust: run `cargo fmt` before commits; clippy must be clean with `-D warnings`. Modules/files use `snake_case`, types/traits `PascalCase`, constants `SCREAMING_SNAKE_CASE`. Prefer `anyhow::Result` and `thiserror` for errors; avoid `unwrap` in non-test code. +- TypeScript: strict mode on; avoid `any` (warned), silence unused via `_` prefix. Follow ESLint rules and keep imports sorted logically. Prefer async/await over callbacks. + +## Testing Guidelines +- Rust tests colocated in each crate (`mod tests` blocks or `tests/` directories); write integration tests when touching cross-crate behavior. Run `cargo test --all` before PRs. +- TypeScript tests follow `*.test.ts` in `tests/`; structure with `describe/it` and keep fast. Aim to cover error paths and CLI flags. + +## Commit & Pull Request Guidelines +- Use Conventional Commits (`feat:`, `fix:`, `refactor:`, `docs:`, `test:`, `chore:`). Keep subject under ~72 chars; include scope when helpful (`feat(tui): add diff renderer`). +- PRs should describe the change, linked issue, and test evidence (`cargo test --all`, `npm test`, etc.). Add screenshots or terminal recordings for TUI changes when relevant. Keep diffs focused; separate refactors from feature work. + +## Environment & Configuration +- Environment defaults from `.env.example`; typical variables: `GITHUB_TOKEN`, `ANTHROPIC_API_KEY`, `REPOSITORY`, optional `RUST_LOG`/`RUST_BACKTRACE` for debugging. +- Local config/state lives in `~/.miyabi/` and `.miyabi/` (do not commit secrets). Review `.miyabi.yml` for runtime behavior before modifying agent workflows. diff --git a/MIYABI.md b/MIYABI.md new file mode 100644 index 0000000..f38ce3a Binary files /dev/null and b/MIYABI.md differ diff --git a/README.github.md b/README.github.md new file mode 100644 index 0000000..fa4740f --- /dev/null +++ b/README.github.md @@ -0,0 +1,2 @@ +# miyabi-cli-standalone +Autonomous development powered by Agentic OS