From 9e2fb105027ae9f0aae6842dc1a16c86e912449b Mon Sep 17 00:00:00 2001 From: nrslib <38722970+nrslib@users.noreply.github.com> Date: Sat, 31 Jan 2026 21:34:51 +0900 Subject: [PATCH] resolved #68 --- .github/workflows/takt-action.yml | 20 +++++++++++++ CONTRIBUTING.md | 16 ++-------- README.md | 14 ++------- docs/README.ja.md | 14 ++------- src/__tests__/debug.test.ts | 50 ++++++++++++++++++++++++++----- src/config/initialization.ts | 2 -- src/utils/debug.ts | 45 ++++++++++++++-------------- 7 files changed, 93 insertions(+), 68 deletions(-) create mode 100644 .github/workflows/takt-action.yml diff --git a/.github/workflows/takt-action.yml b/.github/workflows/takt-action.yml new file mode 100644 index 0000000..ea956b9 --- /dev/null +++ b/.github/workflows/takt-action.yml @@ -0,0 +1,20 @@ +name: TAKT Action + +on: + issue_comment: + types: [created] + +jobs: + takt: + if: contains(github.event.comment.body, '@takt') + runs-on: ubuntu-latest + permissions: + issues: write + contents: read + steps: + - uses: actions/checkout@v4 + + - uses: nrslib/takt-action@main + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7ac4909..97d645e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,22 +2,12 @@ Thank you for your interest in contributing to TAKT! -## Important Notice +## About This Project -For now, This project is maintained at my own pace as a personal project. Please understand the following before contributing: +This project is developed using [TAKT](https://github.com/nrslib/takt). Please understand the following before contributing: -### Response Times - -- **Issues**: I may not be able to respond immediately. Please be patient. -- **Pull Requests**: Review capacity is limited. Small, focused PRs are more likely to be reviewed. - -### About This Project - -This project is primarily developed using "vibe coding" (AI-assisted development). As such: - -- **Use at your own risk** - The codebase may have unconventional patterns -- **Large PRs are difficult to review** - Especially AI-generated ones - **Small, focused changes are preferred** - Bug fixes, typo corrections, documentation improvements +- **Large PRs are difficult to review** - Especially AI-generated bulk changes without explanation ## How to Contribute diff --git a/README.md b/README.md index c57304e..943e3dd 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ **T**ask **A**gent **K**oordination **T**ool - Multi-agent orchestration system for Claude Code and OpenAI Codex. -> **Note**: This project is developed at my own pace. See [Disclaimer](#disclaimer) for details. - TAKT is built with TAKT (dogfooding). ## Requirements @@ -603,17 +601,9 @@ engine.on('step:complete', (step, response) => { await engine.run(); ``` -## Disclaimer +## Contributing -This project is a personal project developed at my own pace. - -- **Response times**: I may not be able to respond to issues immediately -- **Development style**: This project is primarily developed using "vibe coding" (AI-assisted development) - **use at your own risk** -- **Pull requests**: - - Small, focused PRs (bug fixes, typos, docs) are welcome - - Large PRs, especially AI-generated bulk changes, are difficult to review - -See [CONTRIBUTING.md](./CONTRIBUTING.md) for more details. +See [CONTRIBUTING.md](./CONTRIBUTING.md) for details. ## Docker Support diff --git a/docs/README.ja.md b/docs/README.ja.md index e9b0a18..dc42bf8 100644 --- a/docs/README.ja.md +++ b/docs/README.ja.md @@ -2,8 +2,6 @@ **T**ask **A**gent **K**oordination **T**ool - Claude CodeとOpenAI Codex向けのマルチエージェントオーケストレーションシステム -> **Note**: このプロジェクトは個人のペースで開発されています。詳細は[免責事項](#免責事項)をご覧ください。 - TAKTはTAKT自身で開発されています(ドッグフーディング)。 ## 必要条件 @@ -600,17 +598,9 @@ engine.on('step:complete', (step, response) => { await engine.run(); ``` -## 免責事項 +## コントリビュート -このプロジェクトは個人プロジェクトであり、私自身のペースで開発されています。 - -- **レスポンス時間**: イシューにすぐに対応できない場合があります -- **開発スタイル**: このプロジェクトは主に「バイブコーディング」(AI支援開発)で開発されています - **自己責任でお使いください** -- **プルリクエスト**: - - 小さく焦点を絞ったPR(バグ修正、タイポ、ドキュメント)は歓迎します - - 大きなPR、特にAI生成の一括変更はレビューが困難です - -詳細は[CONTRIBUTING.md](../CONTRIBUTING.md)をご覧ください。 +詳細は[CONTRIBUTING.md](../CONTRIBUTING.md)を参照。 ## Docker サポート diff --git a/src/__tests__/debug.test.ts b/src/__tests__/debug.test.ts index d29e362..888a93a 100644 --- a/src/__tests__/debug.test.ts +++ b/src/__tests__/debug.test.ts @@ -41,9 +41,38 @@ describe('debug logging', () => { }); it('should enable debug when enabled is true', () => { - initDebugLogger({ enabled: true }, '/tmp'); + const projectDir = join(tmpdir(), 'takt-test-debug-enable-' + Date.now()); + mkdirSync(projectDir, { recursive: true }); + + try { + initDebugLogger({ enabled: true }, projectDir); + expect(isDebugEnabled()).toBe(true); + expect(getDebugLogFile()).not.toBeNull(); + } finally { + rmSync(projectDir, { recursive: true, force: true }); + } + }); + + it('should write debug log to project .takt/logs/ directory', () => { + const projectDir = join(tmpdir(), 'takt-test-debug-project-' + Date.now()); + mkdirSync(projectDir, { recursive: true }); + + try { + initDebugLogger({ enabled: true }, projectDir); + const logFile = getDebugLogFile(); + expect(logFile).not.toBeNull(); + expect(logFile!).toContain(join(projectDir, '.takt', 'logs')); + expect(logFile!).toMatch(/debug-.*\.log$/); + expect(existsSync(logFile!)).toBe(true); + } finally { + rmSync(projectDir, { recursive: true, force: true }); + } + }); + + it('should not create log file when projectDir is not provided', () => { + initDebugLogger({ enabled: true }); expect(isDebugEnabled()).toBe(true); - expect(getDebugLogFile()).not.toBeNull(); + expect(getDebugLogFile()).toBeNull(); }); it('should use custom log file when provided', () => { @@ -64,12 +93,19 @@ describe('debug logging', () => { }); it('should only initialize once', () => { - initDebugLogger({ enabled: true }, '/tmp'); - const firstFile = getDebugLogFile(); + const projectDir = join(tmpdir(), 'takt-test-debug-once-' + Date.now()); + mkdirSync(projectDir, { recursive: true }); - initDebugLogger({ enabled: false }, '/tmp'); - expect(isDebugEnabled()).toBe(true); - expect(getDebugLogFile()).toBe(firstFile); + try { + initDebugLogger({ enabled: true }, projectDir); + const firstFile = getDebugLogFile(); + + initDebugLogger({ enabled: false }, projectDir); + expect(isDebugEnabled()).toBe(true); + expect(getDebugLogFile()).toBe(firstFile); + } finally { + rmSync(projectDir, { recursive: true, force: true }); + } }); }); diff --git a/src/config/initialization.ts b/src/config/initialization.ts index 49c107d..b9eac8c 100644 --- a/src/config/initialization.ts +++ b/src/config/initialization.ts @@ -14,7 +14,6 @@ import { selectOptionWithDefault } from '../prompt/index.js'; import { getGlobalConfigDir, getGlobalConfigPath, - getGlobalLogsDir, getProjectConfigDir, ensureDir, } from './paths.js'; @@ -92,7 +91,6 @@ export interface InitGlobalDirsOptions { */ export async function initGlobalDirs(options?: InitGlobalDirsOptions): Promise { ensureDir(getGlobalConfigDir()); - ensureDir(getGlobalLogsDir()); if (needsLanguageSetup()) { const isInteractive = !options?.nonInteractive && process.stdin.isTTY === true; diff --git a/src/utils/debug.ts b/src/utils/debug.ts index 482d42e..b9c7950 100644 --- a/src/utils/debug.ts +++ b/src/utils/debug.ts @@ -6,7 +6,6 @@ import { existsSync, appendFileSync, mkdirSync, writeFileSync } from 'node:fs'; import { dirname, join } from 'node:path'; -import { homedir } from 'node:os'; import type { DebugConfig } from '../models/types.js'; /** Debug logger state */ @@ -17,10 +16,10 @@ let initialized = false; /** Verbose console output state */ let verboseConsoleEnabled = false; -/** Get default debug log file path */ -function getDefaultLogFile(): string { +/** Get default debug log file path (requires projectDir) */ +function getDefaultLogFile(projectDir: string): string { const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19); - return join(homedir(), '.takt', 'logs', `debug-${timestamp}.log`); + return join(projectDir, '.takt', 'logs', `debug-${timestamp}.log`); } /** Initialize debug logger from config */ @@ -34,27 +33,29 @@ export function initDebugLogger(config?: DebugConfig, projectDir?: string): void if (debugEnabled) { if (config?.logFile) { debugLogFile = config.logFile; - } else { - debugLogFile = getDefaultLogFile(); + } else if (projectDir) { + debugLogFile = getDefaultLogFile(projectDir); } - // Ensure log directory exists - const logDir = dirname(debugLogFile); - if (!existsSync(logDir)) { - mkdirSync(logDir, { recursive: true }); + if (debugLogFile) { + // Ensure log directory exists + const logDir = dirname(debugLogFile); + if (!existsSync(logDir)) { + mkdirSync(logDir, { recursive: true }); + } + + // Write initial log header + const header = [ + '='.repeat(60), + `TAKT Debug Log`, + `Started: ${new Date().toISOString()}`, + `Project: ${projectDir || 'N/A'}`, + '='.repeat(60), + '', + ].join('\n'); + + writeFileSync(debugLogFile, header, 'utf-8'); } - - // Write initial log header - const header = [ - '='.repeat(60), - `TAKT Debug Log`, - `Started: ${new Date().toISOString()}`, - `Project: ${projectDir || 'N/A'}`, - '='.repeat(60), - '', - ].join('\n'); - - writeFileSync(debugLogFile, header, 'utf-8'); } initialized = true;