Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion skills/worklog/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ ingest ingest calendar-end \
業務時間外の活動の中で仕事に関連する着想が生まれたときは `--personal` フラグをつけて記録する。

```bash
ingest note "〇〇の設計方針のヒントが浮かんだ" --personal --topic <topic-id>
ingest note "〇〇の設計方針のヒントが浮かんだ" --personal --topic <topic-name>
ingest note "〇〇という概念が今の課題に使えるかも" --personal
```

Expand Down
6 changes: 4 additions & 2 deletions src/cli/commands/blocker.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import { Command } from 'commander';
import { createEvent } from '../../core/eventService.js';
import { updateTaskStatus } from '../../core/taskService.js';
import { findOrCreateTopic } from '../../core/topicService.js';

export function registerBlocker(program: Command): void {
program
.command('blocker')
.description('Record a blocker')
.requiredOption('--summary <text>', 'Blocker summary (required)')
.option('--task <id>', 'Task ID')
.option('--topic <id>', 'Topic ID')
.option('--topic <name>', 'Topic name')
.option('--details <text>', 'Additional details')
.option('--block-task', 'Update task status to blocked')
.action(async (options) => {
try {
const topicId = options.topic ? findOrCreateTopic(options.topic).id : undefined;
const event = createEvent({
event_type: 'blocker_found',
task_id: options.task,
topic_id: options.topic,
topic_id: topicId,
actor: 'human',
origin: 'manual',
summary: options.summary,
Expand Down
6 changes: 4 additions & 2 deletions src/cli/commands/decision.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Command } from 'commander';
import { createEvent } from '../../core/eventService.js';
import { findOrCreateTopic } from '../../core/topicService.js';

export function registerDecision(program: Command): void {
program
Expand All @@ -8,14 +9,15 @@ export function registerDecision(program: Command): void {
.requiredOption('--summary <text>', 'Decision summary (required)')
.option('--importance <number>', 'Importance score (1-10)', parseFloat)
.option('--task <id>', 'Task ID')
.option('--topic <id>', 'Topic ID')
.option('--topic <name>', 'Topic name')
.option('--details <text>', 'Additional details')
.action(async (options) => {
try {
const topicId = options.topic ? findOrCreateTopic(options.topic).id : undefined;
const event = createEvent({
event_type: 'decision_made',
task_id: options.task,
topic_id: options.topic,
topic_id: topicId,
actor: 'human',
origin: 'manual',
summary: options.summary,
Expand Down
6 changes: 4 additions & 2 deletions src/cli/commands/ingestArtifactUpdated.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Command } from 'commander';
import { createEvent } from '../../core/eventService.js';
import { findOrCreateTopic } from '../../core/topicService.js';

export function registerIngestArtifactUpdated(program: Command): void {
const ingest = program.commands.find(c => c.name() === 'ingest') ?? program.command('ingest').description('Ingest events from external sources');
Expand All @@ -10,15 +11,16 @@ export function registerIngestArtifactUpdated(program: Command): void {
.requiredOption('--summary <text>', 'Summary of the artifact update (required)')
.option('--file <path>', 'Path to the updated file/artifact')
.option('--task <id>', 'Associated task ID')
.option('--topic <id>', 'Associated topic ID')
.option('--topic <name>', 'Associated topic name')
.option('--project <id>', 'Associated project ID')
.option('--occurred-at <datetime>', 'Update time (ISO 8601)')
.action(async (options) => {
try {
const topicId = options.topic ? findOrCreateTopic(options.topic).id : undefined;
const event = createEvent({
event_type: 'artifact_updated',
task_id: options.task,
topic_id: options.topic,
topic_id: topicId,
project_id: options.project,
actor: 'system',
origin: 'watcher',
Expand Down
6 changes: 4 additions & 2 deletions src/cli/commands/ingestCalendarEnd.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Command } from 'commander';
import { createEvent } from '../../core/eventService.js';
import { findOrCreateTopic } from '../../core/topicService.js';

export function registerIngestCalendarEnd(program: Command): void {
const ingest = program.commands.find(c => c.name() === 'ingest') ?? program.command('ingest').description('Ingest events from external sources');
Expand All @@ -10,15 +11,16 @@ export function registerIngestCalendarEnd(program: Command): void {
.requiredOption('--summary <text>', 'Calendar event title/summary (required)')
.option('--occurred-at <datetime>', 'Event end time (ISO 8601)')
.option('--task <id>', 'Associated task ID')
.option('--topic <id>', 'Associated topic ID')
.option('--topic <name>', 'Associated topic name')
.option('--project <id>', 'Associated project ID')
.option('--source-ref <ref>', 'Calendar event ID or reference')
.action(async (options) => {
try {
const topicId = options.topic ? findOrCreateTopic(options.topic).id : undefined;
const event = createEvent({
event_type: 'calendar_event_ended',
task_id: options.task,
topic_id: options.topic,
topic_id: topicId,
project_id: options.project,
actor: 'ai',
origin: 'gcal',
Expand Down
6 changes: 4 additions & 2 deletions src/cli/commands/ingestCalendarStart.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Command } from 'commander';
import { createEvent } from '../../core/eventService.js';
import { findOrCreateTopic } from '../../core/topicService.js';

export function registerIngestCalendarStart(program: Command): void {
const ingest = program.commands.find(c => c.name() === 'ingest') ?? program.command('ingest').description('Ingest events from external sources');
Expand All @@ -10,15 +11,16 @@ export function registerIngestCalendarStart(program: Command): void {
.requiredOption('--summary <text>', 'Calendar event title/summary (required)')
.option('--occurred-at <datetime>', 'Event start time (ISO 8601)')
.option('--task <id>', 'Associated task ID')
.option('--topic <id>', 'Associated topic ID')
.option('--topic <name>', 'Associated topic name')
.option('--project <id>', 'Associated project ID')
.option('--source-ref <ref>', 'Calendar event ID or reference')
.action(async (options) => {
try {
const topicId = options.topic ? findOrCreateTopic(options.topic).id : undefined;
const event = createEvent({
event_type: 'calendar_event_started',
task_id: options.task,
topic_id: options.topic,
topic_id: topicId,
project_id: options.project,
actor: 'ai',
origin: 'gcal',
Expand Down
6 changes: 4 additions & 2 deletions src/cli/commands/ingestGitCommit.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Command } from 'commander';
import { createEvent } from '../../core/eventService.js';
import { findOrCreateTopic } from '../../core/topicService.js';

export function registerIngestGitCommit(program: Command): void {
const ingest = program.commands.find(c => c.name() === 'ingest') ?? program.command('ingest').description('Ingest events from external sources');
Expand All @@ -11,17 +12,18 @@ export function registerIngestGitCommit(program: Command): void {
.requiredOption('--message <text>', 'Commit message (required)')
.option('--files <files>', 'Comma-separated list of changed files')
.option('--task <id>', 'Associated task ID')
.option('--topic <id>', 'Associated topic ID')
.option('--topic <name>', 'Associated topic name')
.option('--project <id>', 'Associated project ID')
.option('--occurred-at <datetime>', 'Commit time (ISO 8601)')
.action(async (options) => {
try {
const topicId = options.topic ? findOrCreateTopic(options.topic).id : undefined;
const details = options.files ? `Changed files: ${options.files}` : undefined;

const event = createEvent({
event_type: 'git_commit',
task_id: options.task,
topic_id: options.topic,
topic_id: topicId,
project_id: options.project,
actor: 'system',
origin: 'git',
Expand Down
6 changes: 4 additions & 2 deletions src/cli/commands/next.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import { Command } from 'commander';
import { createEvent } from '../../core/eventService.js';
import { findOrCreateTopic } from '../../core/topicService.js';

export function registerNext(program: Command): void {
program
.command('next')
.description('Define the next action')
.requiredOption('--summary <text>', 'Next action summary (required)')
.option('--task <id>', 'Task ID')
.option('--topic <id>', 'Topic ID')
.option('--topic <name>', 'Topic name')
.option('--details <text>', 'Additional details')
.action(async (options) => {
try {
const topicId = options.topic ? findOrCreateTopic(options.topic).id : undefined;
const event = createEvent({
event_type: 'next_action_defined',
task_id: options.task,
topic_id: options.topic,
topic_id: topicId,
actor: 'human',
origin: 'manual',
summary: options.summary,
Expand Down
6 changes: 4 additions & 2 deletions src/cli/commands/note.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import { Command } from 'commander';
import { createEvent } from '../../core/eventService.js';
import { findOrCreateTopic } from '../../core/topicService.js';

export function registerNote(program: Command): void {
program
.command('note')
.description('Add a note')
.requiredOption('--summary <text>', 'Note summary (required)')
.option('--task <id>', 'Task ID')
.option('--topic <id>', 'Topic ID')
.option('--topic <name>', 'Topic name')
.option('--details <text>', 'Additional details')
.option('--personal', 'Mark as a personal note (e.g. from a walk, reading, etc.)')
.action(async (options) => {
try {
const topicId = options.topic ? findOrCreateTopic(options.topic).id : undefined;
const origin = options.personal ? 'personal' : 'manual';
const event = createEvent({
event_type: 'note_added',
task_id: options.task,
topic_id: options.topic,
topic_id: topicId,
actor: 'human',
origin,
summary: options.summary,
Expand Down
Loading