diff --git a/CLAUDE.md b/CLAUDE.md index d8eead6..c01b9ea 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -183,7 +183,7 @@ Implemented in `src/core/piece/evaluation/RuleEvaluator.ts`. The matched method ### Data Flow 1. User provides task (text or `#N` issue reference) or slash command → CLI -2. CLI loads piece with **correct priority** (v0.3.8+): user `~/.takt/pieces/` → project `.takt/pieces/` → builtin `resources/global/{lang}/pieces/` +2. CLI loads piece with **correct priority** (v0.3.8+): user `~/.takt/pieces/` → project `.takt/pieces/` → builtin `builtins/{lang}/pieces/` 3. PieceEngine starts at `initial_step` 4. Each step: `buildInstruction()` → Phase 1 (main) → Phase 2 (report) → Phase 3 (status) → `detectMatchedRule()` → `determineNextStep()` 5. Rule evaluation determines next step name (v0.3.8+: uses **last match** when multiple `[STEP:N]` tags appear) @@ -204,13 +204,14 @@ Implemented in `src/core/piece/evaluation/RuleEvaluator.ts`. The matched method reports/ # Execution reports (auto-generated) logs/ # Session logs in NDJSON format (gitignored) -resources/ # Bundled defaults (builtin, read from dist/ at runtime) - global/ - en/ # English personas, stances, instructions, and pieces - ja/ # Japanese personas, stances, instructions, and pieces +builtins/ # Bundled defaults (builtin, read from dist/ at runtime) + en/ # English personas, stances, instructions, and pieces + ja/ # Japanese personas, stances, instructions, and pieces + project/ # Project-level template files + skill/ # Claude Code skill files ``` -Builtin resources are embedded in the npm package (`dist/resources/`). User files in `~/.takt/` take priority. Use `/eject` to copy builtins to `~/.takt/` for customization. +Builtin resources are embedded in the npm package (`builtins/`). User files in `~/.takt/` take priority. Use `/eject` to copy builtins to `~/.takt/` for customization. ## Piece YAML Schema @@ -299,7 +300,7 @@ Key points about parallel steps: ### Piece Categories Pieces can be organized into categories for better UI presentation. Categories are configured in: -- `resources/global/{lang}/default-categories.yaml` - Default builtin categories +- `builtins/{lang}/piece-categories.yaml` - Default builtin categories - `~/.takt/config.yaml` - User-defined categories (via `piece_categories` field) Category configuration supports: @@ -370,7 +371,7 @@ Files: `.takt/logs/{sessionId}.jsonl`, with `latest.json` pointer. Legacy `.json **Instruction auto-injection over explicit placeholders.** The instruction builder auto-injects `{task}`, `{previous_response}`, `{user_inputs}`, and status rules. Templates should contain only step-specific instructions, not boilerplate. -**Persona prompts contain only domain knowledge.** Persona prompt files (`resources/global/{lang}/personas/*.md`) must contain only domain expertise and behavioral principles — never piece-specific procedures. Piece-specific details (which reports to read, step routing, specific templates with hardcoded step names) belong in the piece YAML's `instruction_template`. This keeps personas reusable across different pieces. +**Persona prompts contain only domain knowledge.** Persona prompt files (`builtins/{lang}/personas/*.md`) must contain only domain expertise and behavioral principles — never piece-specific procedures. Piece-specific details (which reports to read, step routing, specific templates with hardcoded step names) belong in the piece YAML's `instruction_template`. This keeps personas reusable across different pieces. What belongs in persona prompts: - Role definition ("You are a ... specialist") @@ -449,7 +450,7 @@ Debug logs are written to `.takt/logs/debug.log` (ndjson format). Log levels: `d **Persona prompt resolution:** - Persona paths in piece YAML are resolved relative to the piece file's directory - `../personas/coder.md` resolves from piece file location -- Built-in personas are loaded from `dist/resources/global/{lang}/personas/` +- Built-in personas are loaded from `builtins/{lang}/personas/` - User personas are loaded from `~/.takt/personas/` (legacy: `~/.takt/agents/`) - If persona file doesn't exist, the persona string is used as inline system prompt diff --git a/resources/global/en/config.yaml b/builtins/en/config.yaml similarity index 100% rename from resources/global/en/config.yaml rename to builtins/en/config.yaml diff --git a/resources/global/en/instructions/ai-fix.md b/builtins/en/instructions/ai-fix.md similarity index 100% rename from resources/global/en/instructions/ai-fix.md rename to builtins/en/instructions/ai-fix.md diff --git a/resources/global/en/instructions/ai-review.md b/builtins/en/instructions/ai-review.md similarity index 100% rename from resources/global/en/instructions/ai-review.md rename to builtins/en/instructions/ai-review.md diff --git a/resources/global/en/instructions/arbitrate.md b/builtins/en/instructions/arbitrate.md similarity index 100% rename from resources/global/en/instructions/arbitrate.md rename to builtins/en/instructions/arbitrate.md diff --git a/resources/global/en/instructions/architect.md b/builtins/en/instructions/architect.md similarity index 100% rename from resources/global/en/instructions/architect.md rename to builtins/en/instructions/architect.md diff --git a/resources/global/en/instructions/fix-supervisor.md b/builtins/en/instructions/fix-supervisor.md similarity index 100% rename from resources/global/en/instructions/fix-supervisor.md rename to builtins/en/instructions/fix-supervisor.md diff --git a/resources/global/en/instructions/fix.md b/builtins/en/instructions/fix.md similarity index 100% rename from resources/global/en/instructions/fix.md rename to builtins/en/instructions/fix.md diff --git a/resources/global/en/instructions/implement.md b/builtins/en/instructions/implement.md similarity index 100% rename from resources/global/en/instructions/implement.md rename to builtins/en/instructions/implement.md diff --git a/resources/global/en/instructions/plan-investigate.md b/builtins/en/instructions/plan-investigate.md similarity index 100% rename from resources/global/en/instructions/plan-investigate.md rename to builtins/en/instructions/plan-investigate.md diff --git a/resources/global/en/instructions/plan.md b/builtins/en/instructions/plan.md similarity index 100% rename from resources/global/en/instructions/plan.md rename to builtins/en/instructions/plan.md diff --git a/resources/global/en/instructions/review-ai.md b/builtins/en/instructions/review-ai.md similarity index 100% rename from resources/global/en/instructions/review-ai.md rename to builtins/en/instructions/review-ai.md diff --git a/resources/global/en/instructions/review-arch.md b/builtins/en/instructions/review-arch.md similarity index 100% rename from resources/global/en/instructions/review-arch.md rename to builtins/en/instructions/review-arch.md diff --git a/resources/global/en/instructions/review-cqrs-es.md b/builtins/en/instructions/review-cqrs-es.md similarity index 100% rename from resources/global/en/instructions/review-cqrs-es.md rename to builtins/en/instructions/review-cqrs-es.md diff --git a/resources/global/en/instructions/review-frontend.md b/builtins/en/instructions/review-frontend.md similarity index 100% rename from resources/global/en/instructions/review-frontend.md rename to builtins/en/instructions/review-frontend.md diff --git a/resources/global/en/instructions/review-qa.md b/builtins/en/instructions/review-qa.md similarity index 100% rename from resources/global/en/instructions/review-qa.md rename to builtins/en/instructions/review-qa.md diff --git a/resources/global/en/instructions/review-security.md b/builtins/en/instructions/review-security.md similarity index 100% rename from resources/global/en/instructions/review-security.md rename to builtins/en/instructions/review-security.md diff --git a/resources/global/en/instructions/supervise.md b/builtins/en/instructions/supervise.md similarity index 100% rename from resources/global/en/instructions/supervise.md rename to builtins/en/instructions/supervise.md diff --git a/resources/global/en/knowledge/architecture.md b/builtins/en/knowledge/architecture.md similarity index 100% rename from resources/global/en/knowledge/architecture.md rename to builtins/en/knowledge/architecture.md diff --git a/resources/global/en/knowledge/cqrs-es.md b/builtins/en/knowledge/cqrs-es.md similarity index 100% rename from resources/global/en/knowledge/cqrs-es.md rename to builtins/en/knowledge/cqrs-es.md diff --git a/resources/global/en/knowledge/frontend.md b/builtins/en/knowledge/frontend.md similarity index 100% rename from resources/global/en/knowledge/frontend.md rename to builtins/en/knowledge/frontend.md diff --git a/resources/global/en/knowledge/security.md b/builtins/en/knowledge/security.md similarity index 100% rename from resources/global/en/knowledge/security.md rename to builtins/en/knowledge/security.md diff --git a/resources/global/en/personas/ai-antipattern-reviewer.md b/builtins/en/personas/ai-antipattern-reviewer.md similarity index 100% rename from resources/global/en/personas/ai-antipattern-reviewer.md rename to builtins/en/personas/ai-antipattern-reviewer.md diff --git a/resources/global/en/personas/architect-planner.md b/builtins/en/personas/architect-planner.md similarity index 100% rename from resources/global/en/personas/architect-planner.md rename to builtins/en/personas/architect-planner.md diff --git a/resources/global/en/personas/architecture-reviewer.md b/builtins/en/personas/architecture-reviewer.md similarity index 100% rename from resources/global/en/personas/architecture-reviewer.md rename to builtins/en/personas/architecture-reviewer.md diff --git a/resources/global/en/personas/balthasar.md b/builtins/en/personas/balthasar.md similarity index 100% rename from resources/global/en/personas/balthasar.md rename to builtins/en/personas/balthasar.md diff --git a/resources/global/en/personas/casper.md b/builtins/en/personas/casper.md similarity index 100% rename from resources/global/en/personas/casper.md rename to builtins/en/personas/casper.md diff --git a/resources/global/en/personas/coder.md b/builtins/en/personas/coder.md similarity index 100% rename from resources/global/en/personas/coder.md rename to builtins/en/personas/coder.md diff --git a/resources/global/en/personas/conductor.md b/builtins/en/personas/conductor.md similarity index 100% rename from resources/global/en/personas/conductor.md rename to builtins/en/personas/conductor.md diff --git a/resources/global/en/personas/cqrs-es-reviewer.md b/builtins/en/personas/cqrs-es-reviewer.md similarity index 100% rename from resources/global/en/personas/cqrs-es-reviewer.md rename to builtins/en/personas/cqrs-es-reviewer.md diff --git a/resources/global/en/personas/expert-supervisor.md b/builtins/en/personas/expert-supervisor.md similarity index 100% rename from resources/global/en/personas/expert-supervisor.md rename to builtins/en/personas/expert-supervisor.md diff --git a/resources/global/en/personas/frontend-reviewer.md b/builtins/en/personas/frontend-reviewer.md similarity index 100% rename from resources/global/en/personas/frontend-reviewer.md rename to builtins/en/personas/frontend-reviewer.md diff --git a/resources/global/en/personas/melchior.md b/builtins/en/personas/melchior.md similarity index 100% rename from resources/global/en/personas/melchior.md rename to builtins/en/personas/melchior.md diff --git a/resources/global/en/personas/planner.md b/builtins/en/personas/planner.md similarity index 100% rename from resources/global/en/personas/planner.md rename to builtins/en/personas/planner.md diff --git a/resources/global/en/personas/pr-commenter.md b/builtins/en/personas/pr-commenter.md similarity index 100% rename from resources/global/en/personas/pr-commenter.md rename to builtins/en/personas/pr-commenter.md diff --git a/resources/global/en/personas/qa-reviewer.md b/builtins/en/personas/qa-reviewer.md similarity index 100% rename from resources/global/en/personas/qa-reviewer.md rename to builtins/en/personas/qa-reviewer.md diff --git a/resources/global/en/personas/research-digger.md b/builtins/en/personas/research-digger.md similarity index 100% rename from resources/global/en/personas/research-digger.md rename to builtins/en/personas/research-digger.md diff --git a/resources/global/en/personas/research-planner.md b/builtins/en/personas/research-planner.md similarity index 100% rename from resources/global/en/personas/research-planner.md rename to builtins/en/personas/research-planner.md diff --git a/resources/global/en/personas/research-supervisor.md b/builtins/en/personas/research-supervisor.md similarity index 100% rename from resources/global/en/personas/research-supervisor.md rename to builtins/en/personas/research-supervisor.md diff --git a/resources/global/en/personas/security-reviewer.md b/builtins/en/personas/security-reviewer.md similarity index 100% rename from resources/global/en/personas/security-reviewer.md rename to builtins/en/personas/security-reviewer.md diff --git a/resources/global/en/personas/supervisor.md b/builtins/en/personas/supervisor.md similarity index 100% rename from resources/global/en/personas/supervisor.md rename to builtins/en/personas/supervisor.md diff --git a/resources/global/en/piece-categories.yaml b/builtins/en/piece-categories.yaml similarity index 100% rename from resources/global/en/piece-categories.yaml rename to builtins/en/piece-categories.yaml diff --git a/resources/global/en/pieces/coding-hybrid-codex.yaml b/builtins/en/pieces/coding-hybrid-codex.yaml similarity index 100% rename from resources/global/en/pieces/coding-hybrid-codex.yaml rename to builtins/en/pieces/coding-hybrid-codex.yaml diff --git a/resources/global/en/pieces/coding.yaml b/builtins/en/pieces/coding.yaml similarity index 100% rename from resources/global/en/pieces/coding.yaml rename to builtins/en/pieces/coding.yaml diff --git a/resources/global/en/pieces/default-hybrid-codex.yaml b/builtins/en/pieces/default-hybrid-codex.yaml similarity index 100% rename from resources/global/en/pieces/default-hybrid-codex.yaml rename to builtins/en/pieces/default-hybrid-codex.yaml diff --git a/resources/global/en/pieces/default.yaml b/builtins/en/pieces/default.yaml similarity index 100% rename from resources/global/en/pieces/default.yaml rename to builtins/en/pieces/default.yaml diff --git a/resources/global/en/pieces/expert-cqrs-hybrid-codex.yaml b/builtins/en/pieces/expert-cqrs-hybrid-codex.yaml similarity index 100% rename from resources/global/en/pieces/expert-cqrs-hybrid-codex.yaml rename to builtins/en/pieces/expert-cqrs-hybrid-codex.yaml diff --git a/resources/global/en/pieces/expert-cqrs.yaml b/builtins/en/pieces/expert-cqrs.yaml similarity index 100% rename from resources/global/en/pieces/expert-cqrs.yaml rename to builtins/en/pieces/expert-cqrs.yaml diff --git a/resources/global/en/pieces/expert-hybrid-codex.yaml b/builtins/en/pieces/expert-hybrid-codex.yaml similarity index 100% rename from resources/global/en/pieces/expert-hybrid-codex.yaml rename to builtins/en/pieces/expert-hybrid-codex.yaml diff --git a/resources/global/en/pieces/expert.yaml b/builtins/en/pieces/expert.yaml similarity index 100% rename from resources/global/en/pieces/expert.yaml rename to builtins/en/pieces/expert.yaml diff --git a/resources/global/en/pieces/magi.yaml b/builtins/en/pieces/magi.yaml similarity index 100% rename from resources/global/en/pieces/magi.yaml rename to builtins/en/pieces/magi.yaml diff --git a/resources/global/en/pieces/minimal-hybrid-codex.yaml b/builtins/en/pieces/minimal-hybrid-codex.yaml similarity index 100% rename from resources/global/en/pieces/minimal-hybrid-codex.yaml rename to builtins/en/pieces/minimal-hybrid-codex.yaml diff --git a/resources/global/en/pieces/minimal.yaml b/builtins/en/pieces/minimal.yaml similarity index 100% rename from resources/global/en/pieces/minimal.yaml rename to builtins/en/pieces/minimal.yaml diff --git a/resources/global/en/pieces/passthrough-hybrid-codex.yaml b/builtins/en/pieces/passthrough-hybrid-codex.yaml similarity index 100% rename from resources/global/en/pieces/passthrough-hybrid-codex.yaml rename to builtins/en/pieces/passthrough-hybrid-codex.yaml diff --git a/resources/global/en/pieces/passthrough.yaml b/builtins/en/pieces/passthrough.yaml similarity index 100% rename from resources/global/en/pieces/passthrough.yaml rename to builtins/en/pieces/passthrough.yaml diff --git a/resources/global/en/pieces/research.yaml b/builtins/en/pieces/research.yaml similarity index 100% rename from resources/global/en/pieces/research.yaml rename to builtins/en/pieces/research.yaml diff --git a/resources/global/en/pieces/review-fix-minimal-hybrid-codex.yaml b/builtins/en/pieces/review-fix-minimal-hybrid-codex.yaml similarity index 100% rename from resources/global/en/pieces/review-fix-minimal-hybrid-codex.yaml rename to builtins/en/pieces/review-fix-minimal-hybrid-codex.yaml diff --git a/resources/global/en/pieces/review-fix-minimal.yaml b/builtins/en/pieces/review-fix-minimal.yaml similarity index 100% rename from resources/global/en/pieces/review-fix-minimal.yaml rename to builtins/en/pieces/review-fix-minimal.yaml diff --git a/resources/global/en/pieces/review-only.yaml b/builtins/en/pieces/review-only.yaml similarity index 100% rename from resources/global/en/pieces/review-only.yaml rename to builtins/en/pieces/review-only.yaml diff --git a/resources/global/en/report-formats/ai-review.md b/builtins/en/report-formats/ai-review.md similarity index 100% rename from resources/global/en/report-formats/ai-review.md rename to builtins/en/report-formats/ai-review.md diff --git a/resources/global/en/report-formats/architecture-design.md b/builtins/en/report-formats/architecture-design.md similarity index 100% rename from resources/global/en/report-formats/architecture-design.md rename to builtins/en/report-formats/architecture-design.md diff --git a/resources/global/en/report-formats/architecture-review.md b/builtins/en/report-formats/architecture-review.md similarity index 100% rename from resources/global/en/report-formats/architecture-review.md rename to builtins/en/report-formats/architecture-review.md diff --git a/resources/global/en/report-formats/coder-decisions.md b/builtins/en/report-formats/coder-decisions.md similarity index 100% rename from resources/global/en/report-formats/coder-decisions.md rename to builtins/en/report-formats/coder-decisions.md diff --git a/resources/global/en/report-formats/coder-scope.md b/builtins/en/report-formats/coder-scope.md similarity index 100% rename from resources/global/en/report-formats/coder-scope.md rename to builtins/en/report-formats/coder-scope.md diff --git a/resources/global/en/report-formats/cqrs-es-review.md b/builtins/en/report-formats/cqrs-es-review.md similarity index 100% rename from resources/global/en/report-formats/cqrs-es-review.md rename to builtins/en/report-formats/cqrs-es-review.md diff --git a/resources/global/en/report-formats/frontend-review.md b/builtins/en/report-formats/frontend-review.md similarity index 100% rename from resources/global/en/report-formats/frontend-review.md rename to builtins/en/report-formats/frontend-review.md diff --git a/resources/global/en/report-formats/plan.md b/builtins/en/report-formats/plan.md similarity index 100% rename from resources/global/en/report-formats/plan.md rename to builtins/en/report-formats/plan.md diff --git a/resources/global/en/report-formats/qa-review.md b/builtins/en/report-formats/qa-review.md similarity index 100% rename from resources/global/en/report-formats/qa-review.md rename to builtins/en/report-formats/qa-review.md diff --git a/resources/global/en/report-formats/review-summary.md b/builtins/en/report-formats/review-summary.md similarity index 100% rename from resources/global/en/report-formats/review-summary.md rename to builtins/en/report-formats/review-summary.md diff --git a/resources/global/en/report-formats/security-review.md b/builtins/en/report-formats/security-review.md similarity index 100% rename from resources/global/en/report-formats/security-review.md rename to builtins/en/report-formats/security-review.md diff --git a/resources/global/en/report-formats/summary.md b/builtins/en/report-formats/summary.md similarity index 100% rename from resources/global/en/report-formats/summary.md rename to builtins/en/report-formats/summary.md diff --git a/resources/global/en/report-formats/validation.md b/builtins/en/report-formats/validation.md similarity index 100% rename from resources/global/en/report-formats/validation.md rename to builtins/en/report-formats/validation.md diff --git a/resources/global/en/stances/coding.md b/builtins/en/stances/coding.md similarity index 100% rename from resources/global/en/stances/coding.md rename to builtins/en/stances/coding.md diff --git a/resources/global/en/stances/review.md b/builtins/en/stances/review.md similarity index 100% rename from resources/global/en/stances/review.md rename to builtins/en/stances/review.md diff --git a/resources/global/en/stances/testing.md b/builtins/en/stances/testing.md similarity index 100% rename from resources/global/en/stances/testing.md rename to builtins/en/stances/testing.md diff --git a/resources/global/en/templates/instructions/ai-fix.md b/builtins/en/templates/instructions/ai-fix.md similarity index 100% rename from resources/global/en/templates/instructions/ai-fix.md rename to builtins/en/templates/instructions/ai-fix.md diff --git a/resources/global/en/templates/instructions/ai-review-standalone.md b/builtins/en/templates/instructions/ai-review-standalone.md similarity index 100% rename from resources/global/en/templates/instructions/ai-review-standalone.md rename to builtins/en/templates/instructions/ai-review-standalone.md diff --git a/resources/global/en/templates/instructions/arbitrate.md b/builtins/en/templates/instructions/arbitrate.md similarity index 100% rename from resources/global/en/templates/instructions/arbitrate.md rename to builtins/en/templates/instructions/arbitrate.md diff --git a/resources/global/en/templates/instructions/architect.md b/builtins/en/templates/instructions/architect.md similarity index 100% rename from resources/global/en/templates/instructions/architect.md rename to builtins/en/templates/instructions/architect.md diff --git a/resources/global/en/templates/instructions/fix.md b/builtins/en/templates/instructions/fix.md similarity index 100% rename from resources/global/en/templates/instructions/fix.md rename to builtins/en/templates/instructions/fix.md diff --git a/resources/global/en/templates/instructions/implement.md b/builtins/en/templates/instructions/implement.md similarity index 100% rename from resources/global/en/templates/instructions/implement.md rename to builtins/en/templates/instructions/implement.md diff --git a/resources/global/en/templates/instructions/plan.md b/builtins/en/templates/instructions/plan.md similarity index 100% rename from resources/global/en/templates/instructions/plan.md rename to builtins/en/templates/instructions/plan.md diff --git a/resources/global/en/templates/instructions/review.md b/builtins/en/templates/instructions/review.md similarity index 100% rename from resources/global/en/templates/instructions/review.md rename to builtins/en/templates/instructions/review.md diff --git a/resources/global/en/templates/instructions/supervise.md b/builtins/en/templates/instructions/supervise.md similarity index 100% rename from resources/global/en/templates/instructions/supervise.md rename to builtins/en/templates/instructions/supervise.md diff --git a/resources/global/en/templates/personas/character.md b/builtins/en/templates/personas/character.md similarity index 100% rename from resources/global/en/templates/personas/character.md rename to builtins/en/templates/personas/character.md diff --git a/resources/global/en/templates/personas/expert.md b/builtins/en/templates/personas/expert.md similarity index 100% rename from resources/global/en/templates/personas/expert.md rename to builtins/en/templates/personas/expert.md diff --git a/resources/global/en/templates/personas/simple.md b/builtins/en/templates/personas/simple.md similarity index 100% rename from resources/global/en/templates/personas/simple.md rename to builtins/en/templates/personas/simple.md diff --git a/resources/global/en/templates/reports/architecture-design.md b/builtins/en/templates/reports/architecture-design.md similarity index 100% rename from resources/global/en/templates/reports/architecture-design.md rename to builtins/en/templates/reports/architecture-design.md diff --git a/resources/global/en/templates/reports/plan.md b/builtins/en/templates/reports/plan.md similarity index 100% rename from resources/global/en/templates/reports/plan.md rename to builtins/en/templates/reports/plan.md diff --git a/resources/global/en/templates/reports/review.md b/builtins/en/templates/reports/review.md similarity index 100% rename from resources/global/en/templates/reports/review.md rename to builtins/en/templates/reports/review.md diff --git a/resources/global/en/templates/reports/security-review.md b/builtins/en/templates/reports/security-review.md similarity index 100% rename from resources/global/en/templates/reports/security-review.md rename to builtins/en/templates/reports/security-review.md diff --git a/resources/global/en/templates/reports/summary.md b/builtins/en/templates/reports/summary.md similarity index 100% rename from resources/global/en/templates/reports/summary.md rename to builtins/en/templates/reports/summary.md diff --git a/resources/global/en/templates/reports/validation.md b/builtins/en/templates/reports/validation.md similarity index 100% rename from resources/global/en/templates/reports/validation.md rename to builtins/en/templates/reports/validation.md diff --git a/resources/global/en/templates/stances/stance.md b/builtins/en/templates/stances/stance.md similarity index 100% rename from resources/global/en/templates/stances/stance.md rename to builtins/en/templates/stances/stance.md diff --git a/resources/global/ja/INSTRUCTION_STYLE_GUIDE.md b/builtins/ja/INSTRUCTION_STYLE_GUIDE.md similarity index 100% rename from resources/global/ja/INSTRUCTION_STYLE_GUIDE.md rename to builtins/ja/INSTRUCTION_STYLE_GUIDE.md diff --git a/resources/global/ja/PERSONA_STYLE_GUIDE.md b/builtins/ja/PERSONA_STYLE_GUIDE.md similarity index 100% rename from resources/global/ja/PERSONA_STYLE_GUIDE.md rename to builtins/ja/PERSONA_STYLE_GUIDE.md diff --git a/resources/global/ja/REPORT_STYLE_GUIDE.md b/builtins/ja/REPORT_STYLE_GUIDE.md similarity index 100% rename from resources/global/ja/REPORT_STYLE_GUIDE.md rename to builtins/ja/REPORT_STYLE_GUIDE.md diff --git a/resources/global/ja/STANCE_STYLE_GUIDE.md b/builtins/ja/STANCE_STYLE_GUIDE.md similarity index 100% rename from resources/global/ja/STANCE_STYLE_GUIDE.md rename to builtins/ja/STANCE_STYLE_GUIDE.md diff --git a/resources/global/ja/STYLE_GUIDE.md b/builtins/ja/STYLE_GUIDE.md similarity index 100% rename from resources/global/ja/STYLE_GUIDE.md rename to builtins/ja/STYLE_GUIDE.md diff --git a/resources/global/ja/config.yaml b/builtins/ja/config.yaml similarity index 100% rename from resources/global/ja/config.yaml rename to builtins/ja/config.yaml diff --git a/resources/global/ja/instructions/ai-fix.md b/builtins/ja/instructions/ai-fix.md similarity index 100% rename from resources/global/ja/instructions/ai-fix.md rename to builtins/ja/instructions/ai-fix.md diff --git a/resources/global/ja/instructions/ai-review.md b/builtins/ja/instructions/ai-review.md similarity index 100% rename from resources/global/ja/instructions/ai-review.md rename to builtins/ja/instructions/ai-review.md diff --git a/resources/global/ja/instructions/arbitrate.md b/builtins/ja/instructions/arbitrate.md similarity index 100% rename from resources/global/ja/instructions/arbitrate.md rename to builtins/ja/instructions/arbitrate.md diff --git a/resources/global/ja/instructions/architect.md b/builtins/ja/instructions/architect.md similarity index 100% rename from resources/global/ja/instructions/architect.md rename to builtins/ja/instructions/architect.md diff --git a/resources/global/ja/instructions/fix-supervisor.md b/builtins/ja/instructions/fix-supervisor.md similarity index 100% rename from resources/global/ja/instructions/fix-supervisor.md rename to builtins/ja/instructions/fix-supervisor.md diff --git a/resources/global/ja/instructions/fix.md b/builtins/ja/instructions/fix.md similarity index 100% rename from resources/global/ja/instructions/fix.md rename to builtins/ja/instructions/fix.md diff --git a/resources/global/ja/instructions/implement.md b/builtins/ja/instructions/implement.md similarity index 100% rename from resources/global/ja/instructions/implement.md rename to builtins/ja/instructions/implement.md diff --git a/resources/global/ja/instructions/plan-investigate.md b/builtins/ja/instructions/plan-investigate.md similarity index 100% rename from resources/global/ja/instructions/plan-investigate.md rename to builtins/ja/instructions/plan-investigate.md diff --git a/resources/global/ja/instructions/plan.md b/builtins/ja/instructions/plan.md similarity index 100% rename from resources/global/ja/instructions/plan.md rename to builtins/ja/instructions/plan.md diff --git a/resources/global/ja/instructions/review-ai.md b/builtins/ja/instructions/review-ai.md similarity index 100% rename from resources/global/ja/instructions/review-ai.md rename to builtins/ja/instructions/review-ai.md diff --git a/resources/global/ja/instructions/review-arch.md b/builtins/ja/instructions/review-arch.md similarity index 100% rename from resources/global/ja/instructions/review-arch.md rename to builtins/ja/instructions/review-arch.md diff --git a/resources/global/ja/instructions/review-cqrs-es.md b/builtins/ja/instructions/review-cqrs-es.md similarity index 100% rename from resources/global/ja/instructions/review-cqrs-es.md rename to builtins/ja/instructions/review-cqrs-es.md diff --git a/resources/global/ja/instructions/review-frontend.md b/builtins/ja/instructions/review-frontend.md similarity index 100% rename from resources/global/ja/instructions/review-frontend.md rename to builtins/ja/instructions/review-frontend.md diff --git a/resources/global/ja/instructions/review-qa.md b/builtins/ja/instructions/review-qa.md similarity index 100% rename from resources/global/ja/instructions/review-qa.md rename to builtins/ja/instructions/review-qa.md diff --git a/resources/global/ja/instructions/review-security.md b/builtins/ja/instructions/review-security.md similarity index 100% rename from resources/global/ja/instructions/review-security.md rename to builtins/ja/instructions/review-security.md diff --git a/resources/global/ja/instructions/supervise.md b/builtins/ja/instructions/supervise.md similarity index 100% rename from resources/global/ja/instructions/supervise.md rename to builtins/ja/instructions/supervise.md diff --git a/resources/global/ja/knowledge/architecture.md b/builtins/ja/knowledge/architecture.md similarity index 100% rename from resources/global/ja/knowledge/architecture.md rename to builtins/ja/knowledge/architecture.md diff --git a/resources/global/ja/knowledge/cqrs-es.md b/builtins/ja/knowledge/cqrs-es.md similarity index 100% rename from resources/global/ja/knowledge/cqrs-es.md rename to builtins/ja/knowledge/cqrs-es.md diff --git a/resources/global/ja/knowledge/frontend.md b/builtins/ja/knowledge/frontend.md similarity index 100% rename from resources/global/ja/knowledge/frontend.md rename to builtins/ja/knowledge/frontend.md diff --git a/resources/global/ja/knowledge/security.md b/builtins/ja/knowledge/security.md similarity index 100% rename from resources/global/ja/knowledge/security.md rename to builtins/ja/knowledge/security.md diff --git a/resources/global/ja/personas/ai-antipattern-reviewer.md b/builtins/ja/personas/ai-antipattern-reviewer.md similarity index 100% rename from resources/global/ja/personas/ai-antipattern-reviewer.md rename to builtins/ja/personas/ai-antipattern-reviewer.md diff --git a/resources/global/ja/personas/architect-planner.md b/builtins/ja/personas/architect-planner.md similarity index 100% rename from resources/global/ja/personas/architect-planner.md rename to builtins/ja/personas/architect-planner.md diff --git a/resources/global/ja/personas/architecture-reviewer.md b/builtins/ja/personas/architecture-reviewer.md similarity index 100% rename from resources/global/ja/personas/architecture-reviewer.md rename to builtins/ja/personas/architecture-reviewer.md diff --git a/resources/global/ja/personas/balthasar.md b/builtins/ja/personas/balthasar.md similarity index 100% rename from resources/global/ja/personas/balthasar.md rename to builtins/ja/personas/balthasar.md diff --git a/resources/global/ja/personas/casper.md b/builtins/ja/personas/casper.md similarity index 100% rename from resources/global/ja/personas/casper.md rename to builtins/ja/personas/casper.md diff --git a/resources/global/ja/personas/coder.md b/builtins/ja/personas/coder.md similarity index 100% rename from resources/global/ja/personas/coder.md rename to builtins/ja/personas/coder.md diff --git a/resources/global/ja/personas/conductor.md b/builtins/ja/personas/conductor.md similarity index 100% rename from resources/global/ja/personas/conductor.md rename to builtins/ja/personas/conductor.md diff --git a/resources/global/ja/personas/cqrs-es-reviewer.md b/builtins/ja/personas/cqrs-es-reviewer.md similarity index 100% rename from resources/global/ja/personas/cqrs-es-reviewer.md rename to builtins/ja/personas/cqrs-es-reviewer.md diff --git a/resources/global/ja/personas/expert-supervisor.md b/builtins/ja/personas/expert-supervisor.md similarity index 100% rename from resources/global/ja/personas/expert-supervisor.md rename to builtins/ja/personas/expert-supervisor.md diff --git a/resources/global/ja/personas/frontend-reviewer.md b/builtins/ja/personas/frontend-reviewer.md similarity index 100% rename from resources/global/ja/personas/frontend-reviewer.md rename to builtins/ja/personas/frontend-reviewer.md diff --git a/resources/global/ja/personas/melchior.md b/builtins/ja/personas/melchior.md similarity index 100% rename from resources/global/ja/personas/melchior.md rename to builtins/ja/personas/melchior.md diff --git a/resources/global/ja/personas/planner.md b/builtins/ja/personas/planner.md similarity index 100% rename from resources/global/ja/personas/planner.md rename to builtins/ja/personas/planner.md diff --git a/resources/global/ja/personas/pr-commenter.md b/builtins/ja/personas/pr-commenter.md similarity index 100% rename from resources/global/ja/personas/pr-commenter.md rename to builtins/ja/personas/pr-commenter.md diff --git a/resources/global/ja/personas/qa-reviewer.md b/builtins/ja/personas/qa-reviewer.md similarity index 100% rename from resources/global/ja/personas/qa-reviewer.md rename to builtins/ja/personas/qa-reviewer.md diff --git a/resources/global/ja/personas/research-digger.md b/builtins/ja/personas/research-digger.md similarity index 100% rename from resources/global/ja/personas/research-digger.md rename to builtins/ja/personas/research-digger.md diff --git a/resources/global/ja/personas/research-planner.md b/builtins/ja/personas/research-planner.md similarity index 100% rename from resources/global/ja/personas/research-planner.md rename to builtins/ja/personas/research-planner.md diff --git a/resources/global/ja/personas/research-supervisor.md b/builtins/ja/personas/research-supervisor.md similarity index 100% rename from resources/global/ja/personas/research-supervisor.md rename to builtins/ja/personas/research-supervisor.md diff --git a/resources/global/ja/personas/security-reviewer.md b/builtins/ja/personas/security-reviewer.md similarity index 100% rename from resources/global/ja/personas/security-reviewer.md rename to builtins/ja/personas/security-reviewer.md diff --git a/resources/global/ja/personas/supervisor.md b/builtins/ja/personas/supervisor.md similarity index 100% rename from resources/global/ja/personas/supervisor.md rename to builtins/ja/personas/supervisor.md diff --git a/resources/global/ja/piece-categories.yaml b/builtins/ja/piece-categories.yaml similarity index 100% rename from resources/global/ja/piece-categories.yaml rename to builtins/ja/piece-categories.yaml diff --git a/resources/global/ja/pieces/coding-hybrid-codex.yaml b/builtins/ja/pieces/coding-hybrid-codex.yaml similarity index 100% rename from resources/global/ja/pieces/coding-hybrid-codex.yaml rename to builtins/ja/pieces/coding-hybrid-codex.yaml diff --git a/resources/global/ja/pieces/coding.yaml b/builtins/ja/pieces/coding.yaml similarity index 100% rename from resources/global/ja/pieces/coding.yaml rename to builtins/ja/pieces/coding.yaml diff --git a/resources/global/ja/pieces/default-hybrid-codex.yaml b/builtins/ja/pieces/default-hybrid-codex.yaml similarity index 100% rename from resources/global/ja/pieces/default-hybrid-codex.yaml rename to builtins/ja/pieces/default-hybrid-codex.yaml diff --git a/resources/global/ja/pieces/default.yaml b/builtins/ja/pieces/default.yaml similarity index 100% rename from resources/global/ja/pieces/default.yaml rename to builtins/ja/pieces/default.yaml diff --git a/resources/global/ja/pieces/expert-cqrs-hybrid-codex.yaml b/builtins/ja/pieces/expert-cqrs-hybrid-codex.yaml similarity index 100% rename from resources/global/ja/pieces/expert-cqrs-hybrid-codex.yaml rename to builtins/ja/pieces/expert-cqrs-hybrid-codex.yaml diff --git a/resources/global/ja/pieces/expert-cqrs.yaml b/builtins/ja/pieces/expert-cqrs.yaml similarity index 100% rename from resources/global/ja/pieces/expert-cqrs.yaml rename to builtins/ja/pieces/expert-cqrs.yaml diff --git a/resources/global/ja/pieces/expert-hybrid-codex.yaml b/builtins/ja/pieces/expert-hybrid-codex.yaml similarity index 100% rename from resources/global/ja/pieces/expert-hybrid-codex.yaml rename to builtins/ja/pieces/expert-hybrid-codex.yaml diff --git a/resources/global/ja/pieces/expert.yaml b/builtins/ja/pieces/expert.yaml similarity index 100% rename from resources/global/ja/pieces/expert.yaml rename to builtins/ja/pieces/expert.yaml diff --git a/resources/global/ja/pieces/magi.yaml b/builtins/ja/pieces/magi.yaml similarity index 100% rename from resources/global/ja/pieces/magi.yaml rename to builtins/ja/pieces/magi.yaml diff --git a/resources/global/ja/pieces/minimal-hybrid-codex.yaml b/builtins/ja/pieces/minimal-hybrid-codex.yaml similarity index 100% rename from resources/global/ja/pieces/minimal-hybrid-codex.yaml rename to builtins/ja/pieces/minimal-hybrid-codex.yaml diff --git a/resources/global/ja/pieces/minimal.yaml b/builtins/ja/pieces/minimal.yaml similarity index 100% rename from resources/global/ja/pieces/minimal.yaml rename to builtins/ja/pieces/minimal.yaml diff --git a/resources/global/ja/pieces/passthrough-hybrid-codex.yaml b/builtins/ja/pieces/passthrough-hybrid-codex.yaml similarity index 100% rename from resources/global/ja/pieces/passthrough-hybrid-codex.yaml rename to builtins/ja/pieces/passthrough-hybrid-codex.yaml diff --git a/resources/global/ja/pieces/passthrough.yaml b/builtins/ja/pieces/passthrough.yaml similarity index 100% rename from resources/global/ja/pieces/passthrough.yaml rename to builtins/ja/pieces/passthrough.yaml diff --git a/resources/global/ja/pieces/research.yaml b/builtins/ja/pieces/research.yaml similarity index 100% rename from resources/global/ja/pieces/research.yaml rename to builtins/ja/pieces/research.yaml diff --git a/resources/global/ja/pieces/review-fix-minimal-hybrid-codex.yaml b/builtins/ja/pieces/review-fix-minimal-hybrid-codex.yaml similarity index 100% rename from resources/global/ja/pieces/review-fix-minimal-hybrid-codex.yaml rename to builtins/ja/pieces/review-fix-minimal-hybrid-codex.yaml diff --git a/resources/global/ja/pieces/review-fix-minimal.yaml b/builtins/ja/pieces/review-fix-minimal.yaml similarity index 100% rename from resources/global/ja/pieces/review-fix-minimal.yaml rename to builtins/ja/pieces/review-fix-minimal.yaml diff --git a/resources/global/ja/pieces/review-only.yaml b/builtins/ja/pieces/review-only.yaml similarity index 100% rename from resources/global/ja/pieces/review-only.yaml rename to builtins/ja/pieces/review-only.yaml diff --git a/resources/global/ja/report-formats/ai-review.md b/builtins/ja/report-formats/ai-review.md similarity index 100% rename from resources/global/ja/report-formats/ai-review.md rename to builtins/ja/report-formats/ai-review.md diff --git a/resources/global/ja/report-formats/architecture-design.md b/builtins/ja/report-formats/architecture-design.md similarity index 100% rename from resources/global/ja/report-formats/architecture-design.md rename to builtins/ja/report-formats/architecture-design.md diff --git a/resources/global/ja/report-formats/architecture-review.md b/builtins/ja/report-formats/architecture-review.md similarity index 100% rename from resources/global/ja/report-formats/architecture-review.md rename to builtins/ja/report-formats/architecture-review.md diff --git a/resources/global/ja/report-formats/coder-decisions.md b/builtins/ja/report-formats/coder-decisions.md similarity index 100% rename from resources/global/ja/report-formats/coder-decisions.md rename to builtins/ja/report-formats/coder-decisions.md diff --git a/resources/global/ja/report-formats/coder-scope.md b/builtins/ja/report-formats/coder-scope.md similarity index 100% rename from resources/global/ja/report-formats/coder-scope.md rename to builtins/ja/report-formats/coder-scope.md diff --git a/resources/global/ja/report-formats/cqrs-es-review.md b/builtins/ja/report-formats/cqrs-es-review.md similarity index 100% rename from resources/global/ja/report-formats/cqrs-es-review.md rename to builtins/ja/report-formats/cqrs-es-review.md diff --git a/resources/global/ja/report-formats/frontend-review.md b/builtins/ja/report-formats/frontend-review.md similarity index 100% rename from resources/global/ja/report-formats/frontend-review.md rename to builtins/ja/report-formats/frontend-review.md diff --git a/resources/global/ja/report-formats/plan.md b/builtins/ja/report-formats/plan.md similarity index 100% rename from resources/global/ja/report-formats/plan.md rename to builtins/ja/report-formats/plan.md diff --git a/resources/global/ja/report-formats/qa-review.md b/builtins/ja/report-formats/qa-review.md similarity index 100% rename from resources/global/ja/report-formats/qa-review.md rename to builtins/ja/report-formats/qa-review.md diff --git a/resources/global/ja/report-formats/review-summary.md b/builtins/ja/report-formats/review-summary.md similarity index 100% rename from resources/global/ja/report-formats/review-summary.md rename to builtins/ja/report-formats/review-summary.md diff --git a/resources/global/ja/report-formats/security-review.md b/builtins/ja/report-formats/security-review.md similarity index 100% rename from resources/global/ja/report-formats/security-review.md rename to builtins/ja/report-formats/security-review.md diff --git a/resources/global/ja/report-formats/summary.md b/builtins/ja/report-formats/summary.md similarity index 100% rename from resources/global/ja/report-formats/summary.md rename to builtins/ja/report-formats/summary.md diff --git a/resources/global/ja/report-formats/validation.md b/builtins/ja/report-formats/validation.md similarity index 100% rename from resources/global/ja/report-formats/validation.md rename to builtins/ja/report-formats/validation.md diff --git a/resources/global/ja/stances/coding.md b/builtins/ja/stances/coding.md similarity index 100% rename from resources/global/ja/stances/coding.md rename to builtins/ja/stances/coding.md diff --git a/resources/global/ja/stances/review.md b/builtins/ja/stances/review.md similarity index 100% rename from resources/global/ja/stances/review.md rename to builtins/ja/stances/review.md diff --git a/resources/global/ja/stances/testing.md b/builtins/ja/stances/testing.md similarity index 100% rename from resources/global/ja/stances/testing.md rename to builtins/ja/stances/testing.md diff --git a/resources/global/ja/templates/instructions/ai-fix.md b/builtins/ja/templates/instructions/ai-fix.md similarity index 100% rename from resources/global/ja/templates/instructions/ai-fix.md rename to builtins/ja/templates/instructions/ai-fix.md diff --git a/resources/global/ja/templates/instructions/ai-review-standalone.md b/builtins/ja/templates/instructions/ai-review-standalone.md similarity index 100% rename from resources/global/ja/templates/instructions/ai-review-standalone.md rename to builtins/ja/templates/instructions/ai-review-standalone.md diff --git a/resources/global/ja/templates/instructions/arbitrate.md b/builtins/ja/templates/instructions/arbitrate.md similarity index 100% rename from resources/global/ja/templates/instructions/arbitrate.md rename to builtins/ja/templates/instructions/arbitrate.md diff --git a/resources/global/ja/templates/instructions/architect.md b/builtins/ja/templates/instructions/architect.md similarity index 100% rename from resources/global/ja/templates/instructions/architect.md rename to builtins/ja/templates/instructions/architect.md diff --git a/resources/global/ja/templates/instructions/fix.md b/builtins/ja/templates/instructions/fix.md similarity index 100% rename from resources/global/ja/templates/instructions/fix.md rename to builtins/ja/templates/instructions/fix.md diff --git a/resources/global/ja/templates/instructions/implement.md b/builtins/ja/templates/instructions/implement.md similarity index 100% rename from resources/global/ja/templates/instructions/implement.md rename to builtins/ja/templates/instructions/implement.md diff --git a/resources/global/ja/templates/instructions/plan.md b/builtins/ja/templates/instructions/plan.md similarity index 100% rename from resources/global/ja/templates/instructions/plan.md rename to builtins/ja/templates/instructions/plan.md diff --git a/resources/global/ja/templates/instructions/review.md b/builtins/ja/templates/instructions/review.md similarity index 100% rename from resources/global/ja/templates/instructions/review.md rename to builtins/ja/templates/instructions/review.md diff --git a/resources/global/ja/templates/instructions/supervise.md b/builtins/ja/templates/instructions/supervise.md similarity index 100% rename from resources/global/ja/templates/instructions/supervise.md rename to builtins/ja/templates/instructions/supervise.md diff --git a/resources/global/ja/templates/personas/character.md b/builtins/ja/templates/personas/character.md similarity index 100% rename from resources/global/ja/templates/personas/character.md rename to builtins/ja/templates/personas/character.md diff --git a/resources/global/ja/templates/personas/expert.md b/builtins/ja/templates/personas/expert.md similarity index 100% rename from resources/global/ja/templates/personas/expert.md rename to builtins/ja/templates/personas/expert.md diff --git a/resources/global/ja/templates/personas/simple.md b/builtins/ja/templates/personas/simple.md similarity index 100% rename from resources/global/ja/templates/personas/simple.md rename to builtins/ja/templates/personas/simple.md diff --git a/resources/global/ja/templates/reports/architecture-design.md b/builtins/ja/templates/reports/architecture-design.md similarity index 100% rename from resources/global/ja/templates/reports/architecture-design.md rename to builtins/ja/templates/reports/architecture-design.md diff --git a/resources/global/ja/templates/reports/plan.md b/builtins/ja/templates/reports/plan.md similarity index 100% rename from resources/global/ja/templates/reports/plan.md rename to builtins/ja/templates/reports/plan.md diff --git a/resources/global/ja/templates/reports/review.md b/builtins/ja/templates/reports/review.md similarity index 100% rename from resources/global/ja/templates/reports/review.md rename to builtins/ja/templates/reports/review.md diff --git a/resources/global/ja/templates/reports/security-review.md b/builtins/ja/templates/reports/security-review.md similarity index 100% rename from resources/global/ja/templates/reports/security-review.md rename to builtins/ja/templates/reports/security-review.md diff --git a/resources/global/ja/templates/reports/summary.md b/builtins/ja/templates/reports/summary.md similarity index 100% rename from resources/global/ja/templates/reports/summary.md rename to builtins/ja/templates/reports/summary.md diff --git a/resources/global/ja/templates/reports/validation.md b/builtins/ja/templates/reports/validation.md similarity index 100% rename from resources/global/ja/templates/reports/validation.md rename to builtins/ja/templates/reports/validation.md diff --git a/resources/global/ja/templates/stances/stance.md b/builtins/ja/templates/stances/stance.md similarity index 100% rename from resources/global/ja/templates/stances/stance.md rename to builtins/ja/templates/stances/stance.md diff --git a/resources/project/dotgitignore b/builtins/project/dotgitignore similarity index 100% rename from resources/project/dotgitignore rename to builtins/project/dotgitignore diff --git a/resources/project/tasks/TASK-FORMAT b/builtins/project/tasks/TASK-FORMAT similarity index 100% rename from resources/project/tasks/TASK-FORMAT rename to builtins/project/tasks/TASK-FORMAT diff --git a/resources/skill/SKILL.md b/builtins/skill/SKILL.md similarity index 100% rename from resources/skill/SKILL.md rename to builtins/skill/SKILL.md diff --git a/resources/skill/references/engine.md b/builtins/skill/references/engine.md similarity index 100% rename from resources/skill/references/engine.md rename to builtins/skill/references/engine.md diff --git a/resources/skill/references/yaml-schema.md b/builtins/skill/references/yaml-schema.md similarity index 100% rename from resources/skill/references/yaml-schema.md rename to builtins/skill/references/yaml-schema.md diff --git a/resources/skill/takt-command.md b/builtins/skill/takt-command.md similarity index 100% rename from resources/skill/takt-command.md rename to builtins/skill/takt-command.md diff --git a/package.json b/package.json index b3e5622..7a13fa8 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "files": [ "dist/", "bin/", - "resources/" + "builtins/" ], "dependencies": { "@anthropic-ai/claude-agent-sdk": "^0.2.19", diff --git a/resources/global/en/prompts/interactive-summary.md b/resources/global/en/prompts/interactive-summary.md deleted file mode 100644 index 392d13e..0000000 --- a/resources/global/en/prompts/interactive-summary.md +++ /dev/null @@ -1,16 +0,0 @@ -You are responsible for instruction creation in TAKT's interactive mode. Convert the conversation into a concrete task instruction for piece execution. - -## Your position -- You: Interactive mode (task organization and instruction creation) -- Next step: Your instruction will be passed to the piece, where multiple AI agents execute sequentially -- Your output (instruction) becomes the input (task) for the entire piece - -## Requirements -- Output only the final task instruction (no preamble). -- Be specific about scope and targets (files/modules) if mentioned. -- Preserve user-provided constraints and "do not" instructions **only if explicitly stated by the user**. -- If the source of a constraint is unclear, do not include it; add it to Open Questions if needed. -- Do not include constraints proposed or inferred by the assistant. -- Do NOT include assistant/system operational constraints (tool limits, execution prohibitions). -- If details are missing, state what is missing as a short "Open Questions" section. -- Clearly specify the concrete work that the piece will execute. diff --git a/resources/global/en/prompts/interactive-system.md b/resources/global/en/prompts/interactive-system.md deleted file mode 100644 index 5ca1b24..0000000 --- a/resources/global/en/prompts/interactive-system.md +++ /dev/null @@ -1,43 +0,0 @@ -You are the interactive mode of TAKT (AI Agent Piece Orchestration Tool). - -## How TAKT works -1. **Interactive mode (your role)**: Talk with the user to clarify and organize the task, creating a concrete instruction document for piece execution -2. **Piece execution**: Pass your instruction document to the piece, where multiple AI agents execute sequentially (implementation, review, fixes, etc.) - -## Your role -- Ask clarifying questions about ambiguous requirements -- Clarify and refine the user's request into a clear task instruction -- Create concrete instructions for piece agents to follow -- Summarize your understanding when appropriate -- Keep responses concise and focused - -## Critical: Understanding user intent -**The user is asking YOU to create a task instruction for the PIECE, not asking you to execute the task.** - -When the user says: -- "Review this code" → They want the PIECE to review (you create the instruction) -- "Implement feature X" → They want the PIECE to implement (you create the instruction) -- "Fix this bug" → They want the PIECE to fix (you create the instruction) - -These are NOT requests for YOU to investigate. Do NOT read files, check diffs, or explore code unless the user explicitly asks YOU to investigate in the planning phase. - -## When investigation IS appropriate (rare cases) -Only investigate when the user explicitly asks YOU (the planning assistant) to check something: -- "Check the README to understand the project structure" ✓ -- "Read file X to see what it does" ✓ -- "What does this project do?" ✓ - -## When investigation is NOT appropriate (most cases) -Do NOT investigate when the user is describing a task for the piece: -- "Review the changes" ✗ (piece's job) -- "Fix the code" ✗ (piece's job) -- "Implement X" ✗ (piece's job) - -## Strict constraints -- You are ONLY refining requirements. The actual work (implementation/investigation/review) is done by piece agents. -- Do NOT create, edit, or delete any files (except when explicitly asked to check something for planning). -- Do NOT run build, test, install, or any commands that modify state. -- Do NOT use Read/Glob/Grep/Bash proactively. Only use them when the user explicitly asks YOU to investigate for planning purposes. -- Bash is allowed ONLY for read-only investigation (e.g. ls, cat, git log, git diff). Never run destructive or write commands. -- Do NOT mention or reference any slash commands. You have no knowledge of them. -- When the user is satisfied with the plan, they will proceed on their own. Do NOT instruct them on what to do next. diff --git a/resources/global/ja/prompts/interactive-summary.md b/resources/global/ja/prompts/interactive-summary.md deleted file mode 100644 index 85126a6..0000000 --- a/resources/global/ja/prompts/interactive-summary.md +++ /dev/null @@ -1,16 +0,0 @@ -あなたはTAKTの対話モードでの指示書作成を担当しています。これまでの会話内容を、ピース実行用の具体的なタスク指示書に変換してください。 - -## 立ち位置 -- あなた: 対話モード(タスク整理・指示書作成) -- 次のステップ: あなたが作成した指示書がピースに渡され、複数のAIエージェントが順次実行する -- あなたの成果物(指示書)が、ピース全体の入力(タスク)になる - -## 要件 -- 出力はタスク指示書のみ(前置き不要) -- スコープや対象(ファイル/モジュール)が出ている場合は明確に書く -- ユーザー由来の制約や「やらないこと」は保持する -- 制約の出所が不明な場合は保持せず、必要なら Open Questions に回す -- アシスタントが提案・推測した制約は指示書に含めない -- アシスタントの運用上の制約(実行禁止/ツール制限など)は指示に含めない -- 情報不足があれば「Open Questions」セクションを短く付ける -- ピースが実行する具体的な作業内容を明記する diff --git a/resources/global/ja/prompts/interactive-system.md b/resources/global/ja/prompts/interactive-system.md deleted file mode 100644 index 486bd26..0000000 --- a/resources/global/ja/prompts/interactive-system.md +++ /dev/null @@ -1,43 +0,0 @@ -あなたはTAKT(AIエージェントピースオーケストレーションツール)の対話モードを担当しています。 - -## TAKTの仕組み -1. **対話モード(今ここ・あなたの役割)**: ユーザーと会話してタスクを整理し、ピース実行用の具体的な指示書を作成する -2. **ピース実行**: あなたが作成した指示書をピースに渡し、複数のAIエージェントが順次実行する(実装、レビュー、修正など) - -## 役割 -- あいまいな要求に対して確認質問をする -- ユーザーの要求を明確化し、指示書として洗練させる -- ピースのエージェントが迷わないよう具体的な指示書を作成する -- 必要に応じて理解した内容を簡潔にまとめる -- 返答は簡潔で要点のみ - -## 重要:ユーザーの意図を理解する -**ユーザーは「あなた」に作業を依頼しているのではなく、「ピース」への指示書作成を依頼しています。** - -ユーザーが次のように言った場合: -- 「このコードをレビューして」→ ピースにレビューさせる(あなたは指示書を作成) -- 「機能Xを実装して」→ ピースに実装させる(あなたは指示書を作成) -- 「このバグを修正して」→ ピースに修正させる(あなたは指示書を作成) - -これらは「あなた」への調査依頼ではありません。ファイルを読んだり、差分を確認したり、コードを探索したりしないでください。 - -## 調査が適切な場合(稀なケース) -ユーザーが明示的に「あなた(計画アシスタント)」に何かを確認するよう依頼した場合のみ: -- 「READMEを読んでプロジェクト構造を理解して」✓ -- 「ファイルXを読んで何をしているか見て」✓ -- 「このプロジェクトは何をするもの?」✓ - -## 調査が不適切な場合(ほとんどのケース) -ユーザーがピース向けのタスクを説明している場合は調査しない: -- 「変更をレビューして」✗(ピースの仕事) -- 「コードを修正して」✗(ピースの仕事) -- 「Xを実装して」✗(ピースの仕事) - -## 厳守事項 -- あなたは要求の明確化のみを行う。実際の作業(実装/調査/レビュー等)はピースのエージェントが行う -- ファイルの作成/編集/削除はしない(計画目的で明示的に依頼された場合を除く) -- build/test/install など状態を変えるコマンドは実行しない -- Read/Glob/Grep/Bash を勝手に使わない。ユーザーが明示的に「あなた」に調査を依頼した場合のみ使用 -- Bash は読み取り専用(ls/cat/git log/git diff など)に限定 -- スラッシュコマンドに言及しない(存在を知らない前提) -- ユーザーが満足したら次工程に進む。次の指示はしない diff --git a/src/__tests__/deploySkill.test.ts b/src/__tests__/deploySkill.test.ts new file mode 100644 index 0000000..db9788d --- /dev/null +++ b/src/__tests__/deploySkill.test.ts @@ -0,0 +1,232 @@ +/** + * Tests for deploySkill (export-cc) command + */ + +import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; +import { mkdtempSync, mkdirSync, writeFileSync, existsSync, readdirSync, rmSync, readFileSync } from 'node:fs'; +import { join } from 'node:path'; +import { tmpdir } from 'node:os'; + +// Mock home directory to use temp directory +const testHomeDir = mkdtempSync(join(tmpdir(), 'takt-deploy-test-')); + +vi.mock('node:os', async () => { + const actual = await vi.importActual('node:os'); + return { + ...actual, + homedir: () => testHomeDir, + }; +}); + +// Mock confirm to always accept +vi.mock('../shared/prompt/index.js', () => ({ + confirm: vi.fn().mockResolvedValue(true), +})); + +// Mock UI functions to suppress output +vi.mock('../shared/ui/index.js', () => ({ + header: vi.fn(), + success: vi.fn(), + info: vi.fn(), + warn: vi.fn(), + blankLine: vi.fn(), +})); + +// Mock getLanguage +vi.mock('../infra/config/index.js', () => ({ + getLanguage: vi.fn().mockReturnValue('en'), +})); + +// Create fake resources directories +let fakeResourcesDir: string; + +vi.mock('../infra/resources/index.js', async () => { + const actual = await vi.importActual('../infra/resources/index.js'); + return { + ...actual, + getResourcesDir: () => fakeResourcesDir, + getLanguageResourcesDir: (lang: string) => join(fakeResourcesDir, lang), + }; +}); + +// Import after mocks are set up +const { deploySkill } = await import('../features/config/deploySkill.js'); +const { warn } = await import('../shared/ui/index.js'); +const { confirm } = await import('../shared/prompt/index.js'); + +describe('deploySkill', () => { + let skillDir: string; + let commandDir: string; + + beforeEach(() => { + // Create fake resources directory with skill files + fakeResourcesDir = mkdtempSync(join(tmpdir(), 'takt-resources-')); + + // Create skill/ directory with required files + const skillResourcesDir = join(fakeResourcesDir, 'skill'); + mkdirSync(skillResourcesDir, { recursive: true }); + writeFileSync(join(skillResourcesDir, 'SKILL.md'), '# SKILL'); + writeFileSync(join(skillResourcesDir, 'takt-command.md'), '# Command'); + + // Create skill/references/ directory + const refsDir = join(skillResourcesDir, 'references'); + mkdirSync(refsDir, { recursive: true }); + writeFileSync(join(refsDir, 'engine.md'), '# Engine'); + writeFileSync(join(refsDir, 'yaml-schema.md'), '# Schema'); + + // Create language-specific directories (en/) + const langDir = join(fakeResourcesDir, 'en'); + mkdirSync(join(langDir, 'pieces'), { recursive: true }); + mkdirSync(join(langDir, 'personas'), { recursive: true }); + mkdirSync(join(langDir, 'stances'), { recursive: true }); + mkdirSync(join(langDir, 'instructions'), { recursive: true }); + mkdirSync(join(langDir, 'knowledge'), { recursive: true }); + mkdirSync(join(langDir, 'report-formats'), { recursive: true }); + mkdirSync(join(langDir, 'templates'), { recursive: true }); + + // Add sample files + writeFileSync(join(langDir, 'pieces', 'default.yaml'), 'name: default'); + writeFileSync(join(langDir, 'personas', 'coder.md'), '# Coder'); + writeFileSync(join(langDir, 'stances', 'coding.md'), '# Coding'); + writeFileSync(join(langDir, 'instructions', 'init.md'), '# Init'); + writeFileSync(join(langDir, 'knowledge', 'patterns.md'), '# Patterns'); + writeFileSync(join(langDir, 'report-formats', 'summary.md'), '# Summary'); + writeFileSync(join(langDir, 'templates', 'task.md'), '# Task'); + + // Create target directories + skillDir = join(testHomeDir, '.claude', 'skills', 'takt'); + commandDir = join(testHomeDir, '.claude', 'commands'); + mkdirSync(skillDir, { recursive: true }); + mkdirSync(commandDir, { recursive: true }); + + // Reset mocks + vi.clearAllMocks(); + }); + + afterEach(() => { + // Clean up + if (existsSync(testHomeDir)) { + rmSync(testHomeDir, { recursive: true, force: true }); + } + if (existsSync(fakeResourcesDir)) { + rmSync(fakeResourcesDir, { recursive: true, force: true }); + } + // Recreate test home for next test + mkdirSync(testHomeDir, { recursive: true }); + }); + + describe('when skill resources exist', () => { + it('should copy SKILL.md to skill directory', async () => { + await deploySkill(); + + expect(existsSync(join(skillDir, 'SKILL.md'))).toBe(true); + expect(readFileSync(join(skillDir, 'SKILL.md'), 'utf-8')).toBe('# SKILL'); + }); + + it('should copy command file to commands directory', async () => { + await deploySkill(); + + expect(existsSync(join(commandDir, 'takt.md'))).toBe(true); + expect(readFileSync(join(commandDir, 'takt.md'), 'utf-8')).toBe('# Command'); + }); + + it('should copy references directory', async () => { + await deploySkill(); + + const refsDir = join(skillDir, 'references'); + expect(existsSync(refsDir)).toBe(true); + expect(existsSync(join(refsDir, 'engine.md'))).toBe(true); + expect(existsSync(join(refsDir, 'yaml-schema.md'))).toBe(true); + }); + + it('should copy all resource directories from language resources', async () => { + await deploySkill(); + + // Verify each resource directory is copied + expect(existsSync(join(skillDir, 'pieces', 'default.yaml'))).toBe(true); + expect(existsSync(join(skillDir, 'personas', 'coder.md'))).toBe(true); + expect(existsSync(join(skillDir, 'stances', 'coding.md'))).toBe(true); + expect(existsSync(join(skillDir, 'instructions', 'init.md'))).toBe(true); + expect(existsSync(join(skillDir, 'knowledge', 'patterns.md'))).toBe(true); + expect(existsSync(join(skillDir, 'report-formats', 'summary.md'))).toBe(true); + expect(existsSync(join(skillDir, 'templates', 'task.md'))).toBe(true); + }); + }); + + describe('cleanDir behavior', () => { + it('should remove stale files from previous deployments', async () => { + // Create a stale file in skill directory + const piecesDir = join(skillDir, 'pieces'); + mkdirSync(piecesDir, { recursive: true }); + writeFileSync(join(piecesDir, 'stale.yaml'), 'name: stale'); + + await deploySkill(); + + // Stale file should be removed, new file should exist + expect(existsSync(join(piecesDir, 'stale.yaml'))).toBe(false); + expect(existsSync(join(piecesDir, 'default.yaml'))).toBe(true); + }); + + it('should clean references directory before copy', async () => { + // Create a stale file in references + const refsDir = join(skillDir, 'references'); + mkdirSync(refsDir, { recursive: true }); + writeFileSync(join(refsDir, 'old-reference.md'), '# Old'); + + await deploySkill(); + + expect(existsSync(join(refsDir, 'old-reference.md'))).toBe(false); + expect(existsSync(join(refsDir, 'engine.md'))).toBe(true); + }); + }); + + describe('when skill resources do not exist', () => { + it('should warn and return early', async () => { + // Remove skill resources directory + rmSync(join(fakeResourcesDir, 'skill'), { recursive: true }); + + await deploySkill(); + + expect(warn).toHaveBeenCalledWith('Skill resources not found. Ensure takt is installed correctly.'); + }); + }); + + describe('when skill already exists', () => { + it('should ask for confirmation before overwriting', async () => { + // Create existing SKILL.md + writeFileSync(join(skillDir, 'SKILL.md'), '# Old Skill'); + + await deploySkill(); + + expect(confirm).toHaveBeenCalledWith( + '既存のスキルファイルをすべて削除し、最新版に置き換えます。続行しますか?', + false, + ); + }); + + it('should cancel when user declines confirmation', async () => { + // Mock confirm to return false + vi.mocked(confirm).mockResolvedValueOnce(false); + + // Create existing SKILL.md + writeFileSync(join(skillDir, 'SKILL.md'), '# Old Skill'); + + await deploySkill(); + + // File should remain unchanged + expect(readFileSync(join(skillDir, 'SKILL.md'), 'utf-8')).toBe('# Old Skill'); + }); + }); + + describe('when language resources directory is empty', () => { + it('should handle missing resource subdirectories gracefully', async () => { + // Remove all resource subdirectories from language dir + const langDir = join(fakeResourcesDir, 'en'); + rmSync(langDir, { recursive: true }); + mkdirSync(langDir, { recursive: true }); + + // Should not throw + await expect(deploySkill()).resolves.not.toThrow(); + }); + }); +}); diff --git a/src/__tests__/initialization.test.ts b/src/__tests__/initialization.test.ts index b2e4a25..9718165 100644 --- a/src/__tests__/initialization.test.ts +++ b/src/__tests__/initialization.test.ts @@ -96,11 +96,11 @@ describe('copyProjectResourcesToDir', () => { describe('getLanguageResourcesDir', () => { it('should return correct path for English', () => { const path = getLanguageResourcesDir('en'); - expect(path).toContain('resources/global/en'); + expect(path).toContain('builtins/en'); }); it('should return correct path for Japanese', () => { const path = getLanguageResourcesDir('ja'); - expect(path).toContain('resources/global/ja'); + expect(path).toContain('builtins/ja'); }); }); diff --git a/src/__tests__/review-only-piece.test.ts b/src/__tests__/review-only-piece.test.ts index 0a24e04..4ca0b30 100644 --- a/src/__tests__/review-only-piece.test.ts +++ b/src/__tests__/review-only-piece.test.ts @@ -15,7 +15,7 @@ import { join } from 'node:path'; import { parse as parseYaml } from 'yaml'; import { PieceConfigRawSchema } from '../core/models/index.js'; -const RESOURCES_DIR = join(import.meta.dirname, '../../resources/global'); +const RESOURCES_DIR = join(import.meta.dirname, '../../builtins'); function loadReviewOnlyYaml(lang: 'en' | 'ja') { const filePath = join(RESOURCES_DIR, lang, 'pieces', 'review-only.yaml'); diff --git a/src/core/models/global-config.ts b/src/core/models/global-config.ts index 172f182..62ddfdd 100644 --- a/src/core/models/global-config.ts +++ b/src/core/models/global-config.ts @@ -47,7 +47,7 @@ export interface GlobalConfig { autoPr?: boolean; /** List of builtin piece/agent names to exclude from fallback loading */ disabledBuiltins?: string[]; - /** Enable builtin pieces from resources/global/{lang}/pieces */ + /** Enable builtin pieces from builtins/{lang}/pieces */ enableBuiltinPieces?: boolean; /** Anthropic API key for Claude Code SDK (overridden by TAKT_ANTHROPIC_API_KEY env var) */ anthropicApiKey?: string; diff --git a/src/core/models/schemas.ts b/src/core/models/schemas.ts index 50296a2..98532f8 100644 --- a/src/core/models/schemas.ts +++ b/src/core/models/schemas.ts @@ -276,7 +276,7 @@ export const GlobalConfigSchema = z.object({ auto_pr: z.boolean().optional(), /** List of builtin piece/agent names to exclude from fallback loading */ disabled_builtins: z.array(z.string()).optional().default([]), - /** Enable builtin pieces from resources/global/{lang}/pieces */ + /** Enable builtin pieces from builtins/{lang}/pieces */ enable_builtin_pieces: z.boolean().optional(), /** Anthropic API key for Claude Code SDK (overridden by TAKT_ANTHROPIC_API_KEY env var) */ anthropic_api_key: z.string().optional(), diff --git a/src/features/config/deploySkill.ts b/src/features/config/deploySkill.ts index 3751e53..cb3aa6a 100644 --- a/src/features/config/deploySkill.ts +++ b/src/features/config/deploySkill.ts @@ -1,5 +1,5 @@ /** - * takt export-cc — Deploy takt pieces and personas as Claude Code Skill. + * takt export-cc — Deploy takt skill files to Claude Code. * * Copies the following to ~/.claude/: * commands/takt.md — /takt command entry point @@ -7,6 +7,11 @@ * skills/takt/references/ — Engine logic + YAML schema * skills/takt/pieces/ — Builtin piece YAML files * skills/takt/personas/ — Builtin persona .md files + * skills/takt/stances/ — Builtin stance files + * skills/takt/instructions/ — Builtin instruction files + * skills/takt/knowledge/ — Builtin knowledge files + * skills/takt/report-formats/ — Builtin report format files + * skills/takt/templates/ — Builtin template files * * Piece YAML persona paths (../personas/...) work as-is because * the directory structure is mirrored. @@ -16,12 +21,8 @@ import { existsSync, readdirSync, readFileSync, writeFileSync, mkdirSync, rmSync import { homedir } from 'node:os'; import { join, dirname, relative } from 'node:path'; -import { - getBuiltinPiecesDir, - getBuiltinPersonasDir, - getLanguage, -} from '../../infra/config/index.js'; -import { getResourcesDir } from '../../infra/resources/index.js'; +import { getLanguage } from '../../infra/config/index.js'; +import { getResourcesDir, getLanguageResourcesDir } from '../../infra/resources/index.js'; import { confirm } from '../../shared/prompt/index.js'; import { header, success, info, warn, blankLine } from '../../shared/ui/index.js'; @@ -37,6 +38,17 @@ function getCommandDir(): string { return join(homedir(), '.claude', 'commands'); } +/** Directories within builtins/{lang}/ to copy as resource types */ +const RESOURCE_DIRS = [ + 'pieces', + 'personas', + 'stances', + 'instructions', + 'knowledge', + 'report-formats', + 'templates', +] as const; + /** * Deploy takt skill to Claude Code (~/.claude/). */ @@ -45,8 +57,7 @@ export async function deploySkill(): Promise { const lang = getLanguage(); const skillResourcesDir = join(getResourcesDir(), 'skill'); - const builtinPiecesDir = getBuiltinPiecesDir(lang); - const builtinPersonasDir = getBuiltinPersonasDir(lang); + const langResourcesDir = getLanguageResourcesDir(lang); const skillDir = getSkillDir(); const commandDir = getCommandDir(); @@ -60,7 +71,10 @@ export async function deploySkill(): Promise { const skillExists = existsSync(join(skillDir, 'SKILL.md')); if (skillExists) { info('Claude Code Skill が既にインストールされています。'); - const overwrite = await confirm('上書きしますか?', false); + const overwrite = await confirm( + '既存のスキルファイルをすべて削除し、最新版に置き換えます。続行しますか?', + false, + ); if (!overwrite) { info('キャンセルしました。'); return; @@ -86,15 +100,13 @@ export async function deploySkill(): Promise { cleanDir(refsDestDir); copyDirRecursive(refsSrcDir, refsDestDir, copiedFiles); - // 4. Deploy builtin piece YAMLs → skills/takt/pieces/ - const piecesDestDir = join(skillDir, 'pieces'); - cleanDir(piecesDestDir); - copyDirRecursive(builtinPiecesDir, piecesDestDir, copiedFiles); - - // 5. Deploy builtin persona .md files → skills/takt/personas/ - const personasDestDir = join(skillDir, 'personas'); - cleanDir(personasDestDir); - copyDirRecursive(builtinPersonasDir, personasDestDir, copiedFiles); + // 4. Deploy all resource directories from builtins/{lang}/ + for (const resourceDir of RESOURCE_DIRS) { + const srcDir = join(langResourcesDir, resourceDir); + const destDir = join(skillDir, resourceDir); + cleanDir(destDir); + copyDirRecursive(srcDir, destDir, copiedFiles); + } // Report results blankLine(); @@ -106,28 +118,50 @@ export async function deploySkill(): Promise { const skillBase = join(homedir(), '.claude'); const commandFiles = copiedFiles.filter((f) => f.startsWith(commandDir)); const skillFiles = copiedFiles.filter( - (f) => f.startsWith(skillDir) && !f.includes('/pieces/') && !f.includes('/personas/'), + (f) => + f.startsWith(skillDir) && + !RESOURCE_DIRS.some((dir) => f.includes(`/${dir}/`)), ); const pieceFiles = copiedFiles.filter((f) => f.includes('/pieces/')); const personaFiles = copiedFiles.filter((f) => f.includes('/personas/')); + const stanceFiles = copiedFiles.filter((f) => f.includes('/stances/')); + const instructionFiles = copiedFiles.filter((f) => f.includes('/instructions/')); + const knowledgeFiles = copiedFiles.filter((f) => f.includes('/knowledge/')); + const reportFormatFiles = copiedFiles.filter((f) => f.includes('/report-formats/')); + const templateFiles = copiedFiles.filter((f) => f.includes('/templates/')); if (commandFiles.length > 0) { - info(` コマンド: ${commandFiles.length} ファイル`); + info(` コマンド: ${commandFiles.length} ファイル`); for (const f of commandFiles) { info(` ${relative(skillBase, f)}`); } } if (skillFiles.length > 0) { - info(` スキル: ${skillFiles.length} ファイル`); + info(` スキル: ${skillFiles.length} ファイル`); for (const f of skillFiles) { info(` ${relative(skillBase, f)}`); } } if (pieceFiles.length > 0) { - info(` ピース: ${pieceFiles.length} ファイル`); + info(` ピース: ${pieceFiles.length} ファイル`); } if (personaFiles.length > 0) { - info(` ペルソナ: ${personaFiles.length} ファイル`); + info(` ペルソナ: ${personaFiles.length} ファイル`); + } + if (stanceFiles.length > 0) { + info(` スタンス: ${stanceFiles.length} ファイル`); + } + if (instructionFiles.length > 0) { + info(` インストラクション: ${instructionFiles.length} ファイル`); + } + if (knowledgeFiles.length > 0) { + info(` ナレッジ: ${knowledgeFiles.length} ファイル`); + } + if (reportFormatFiles.length > 0) { + info(` レポート形式: ${reportFormatFiles.length} ファイル`); + } + if (templateFiles.length > 0) { + info(` テンプレート: ${templateFiles.length} ファイル`); } blankLine(); diff --git a/src/infra/config/global/initialization.ts b/src/infra/config/global/initialization.ts index deccc53..1caf1c5 100644 --- a/src/infra/config/global/initialization.ts +++ b/src/infra/config/global/initialization.ts @@ -2,7 +2,7 @@ * Initialization module for first-time setup * * Handles language selection and initial config.yaml creation. - * Builtin agents/pieces are loaded via fallback from resources/ + * Builtin agents/pieces are loaded via fallback from builtins/ * and no longer copied to ~/.takt/ on setup. */ diff --git a/src/infra/config/loaders/agentLoader.ts b/src/infra/config/loaders/agentLoader.ts index 0dabd8f..483d690 100644 --- a/src/infra/config/loaders/agentLoader.ts +++ b/src/infra/config/loaders/agentLoader.ts @@ -3,7 +3,7 @@ * * Loads persona prompts with user → builtin fallback: * 1. User personas: ~/.takt/personas/*.md - * 2. Builtin personas: resources/global/{lang}/personas/*.md + * 2. Builtin personas: builtins/{lang}/personas/*.md */ import { readFileSync, existsSync, readdirSync } from 'node:fs'; diff --git a/src/infra/config/loaders/pieceResolver.ts b/src/infra/config/loaders/pieceResolver.ts index 7f00434..a089069 100644 --- a/src/infra/config/loaders/pieceResolver.ts +++ b/src/infra/config/loaders/pieceResolver.ts @@ -97,7 +97,7 @@ function resolvePieceFile(piecesDir: string, name: string): string | null { * Priority: * 1. Project-local pieces → .takt/pieces/{name}.yaml * 2. User pieces → ~/.takt/pieces/{name}.yaml - * 3. Builtin pieces → resources/global/{lang}/pieces/{name}.yaml + * 3. Builtin pieces → builtins/{lang}/pieces/{name}.yaml */ export function loadPiece( name: string, diff --git a/src/infra/config/paths.ts b/src/infra/config/paths.ts index e78c602..dba4f9f 100644 --- a/src/infra/config/paths.ts +++ b/src/infra/config/paths.ts @@ -36,12 +36,12 @@ export function getGlobalConfigPath(): string { return join(getGlobalConfigDir(), 'config.yaml'); } -/** Get builtin pieces directory (resources/global/{lang}/pieces) */ +/** Get builtin pieces directory (builtins/{lang}/pieces) */ export function getBuiltinPiecesDir(lang: Language): string { return join(getLanguageResourcesDir(lang), 'pieces'); } -/** Get builtin personas directory (resources/global/{lang}/personas) */ +/** Get builtin personas directory (builtins/{lang}/personas) */ export function getBuiltinPersonasDir(lang: Language): string { return join(getLanguageResourcesDir(lang), 'personas'); } diff --git a/src/infra/resources/index.ts b/src/infra/resources/index.ts index 2815f6d..fb3aadd 100644 --- a/src/infra/resources/index.ts +++ b/src/infra/resources/index.ts @@ -3,10 +3,15 @@ * * Contains default piece definitions and resource paths. * Resources are organized into: - * - resources/global/{lang}/pieces/ - Builtin pieces (loaded via fallback) - * - resources/global/{lang}/agents/ - Builtin agents (loaded via fallback) - * - resources/global/{lang}/prompts/ - Builtin prompt templates - * - resources/project/ - Project-level template files (.gitignore) + * - builtins/{lang}/pieces/ - Builtin pieces (loaded via fallback) + * - builtins/{lang}/personas/ - Builtin personas (loaded via fallback) + * - builtins/{lang}/stances/ - Builtin stances + * - builtins/{lang}/instructions/ - Builtin instructions + * - builtins/{lang}/knowledge/ - Builtin knowledge files + * - builtins/{lang}/report-formats/ - Builtin report formats + * - builtins/{lang}/templates/ - Builtin templates + * - builtins/project/ - Project-level template files (.gitignore) + * - builtins/skill/ - Claude Code skill files */ import { readFileSync, readdirSync, existsSync, statSync, mkdirSync, writeFileSync } from 'fs'; @@ -20,29 +25,22 @@ import type { Language } from '../../core/models/index.js'; */ export function getResourcesDir(): string { const currentDir = dirname(fileURLToPath(import.meta.url)); - // From src/infra/resources or dist/infra/resources, go up to project root then into resources/ - return join(currentDir, '..', '..', '..', 'resources'); + // From src/infra/resources or dist/infra/resources, go up to project root then into builtins/ + return join(currentDir, '..', '..', '..', 'builtins'); } /** - * Get the global resources directory path (resources/global/) - */ -export function getGlobalResourcesDir(): string { - return join(getResourcesDir(), 'global'); -} - -/** - * Get the project resources directory path (resources/project/) + * Get the project resources directory path (builtins/project/) */ export function getProjectResourcesDir(): string { return join(getResourcesDir(), 'project'); } /** - * Get the language-specific global resources directory path (resources/global/{lang}/) + * Get the language-specific resources directory path (builtins/{lang}/) */ export function getLanguageResourcesDir(lang: Language): string { - return join(getGlobalResourcesDir(), lang); + return join(getResourcesDir(), lang); } /** diff --git a/src/infra/task/summarize.ts b/src/infra/task/summarize.ts index ce69c11..185bd13 100644 --- a/src/infra/task/summarize.ts +++ b/src/infra/task/summarize.ts @@ -34,8 +34,7 @@ function sanitizeSlug(input: string, maxLength = 30): string { * Convert Japanese text to romaji slug. */ function toRomajiSlug(text: string): string { - const truncated = text.slice(0, 100); - const romaji = wanakana.toRomaji(truncated, { customRomajiMapping: {} }); + const romaji = wanakana.toRomaji(text, { customRomajiMapping: {} }); return sanitizeSlug(romaji); }