-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
๐ Summary
Redesign task tracking system to generate technical journals automatically. Key changes:
- Rename
raw_contextโjournal - Move from event-level to session-level
- Client-side journal generation (zero server cost)
- User-customizable templates
- Daily aggregation of completed tasks
๐ฏ Architecture: Client-Side Journal Generation
Core Principle
The MCP client's LLM fills the journal parameter when calling complete_task
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ User: "Complete the task" โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MCP Client (Claude Code) โ
โ - LLM knows what was done in this session โ
โ - Generates journal Markdown automatically โ
โ - Uses user's API key โ Zero server cost โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ complete_task({ journal: "..." })
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Ava MCP Server โ
โ - Receives pre-generated journal โ
โ - Saves to DB โ
โ - Groups by date โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Benefits
- โ Zero server LLM cost (client uses user's API key)
- โ No special tracking needed (LLM already knows the session)
- โ Simple implementation (just fill MCP parameters)
- โ User control (can edit before sending)
๐ How It Works
User completes a task
User: "Complete this task"
MCP client's LLM generates journal
// Claude Code (MCP client) automatically calls:
await mcp.complete_task({
task_session_id: "xxx",
summary: "PR #123 merged", // For Slack (abstract)
journal: `
## Log: Fix authentication bug
- **Prompt**: ่ช่จผใใผใฏใณใฎๆ้ๅใใไฟฎๆญฃ
- **Issue**: JWTๆค่จผใๆฉ่ฝใใฆใใชใ
### What I did:
- auth/login.ts ใฎใใผใฏใณๆค่จผใญใธใใฏใไฟฎๆญฃ
- ๆ้ๅใใฎใในใใฑใผในใ่ฟฝๅ
- PR #123 ใไฝๆใใฆใใผใธ
### How I did it:
- jwt.verify() ใซ clockTolerance ใชใใทใงใณใ่ฟฝๅ
- ใขใใฏใฟใคใใผใงใในใๅฎ่ฃ
### What were challenging:
- ใในใ็ฐๅขใฎ่จญๅฎใงๅฐใ่ฉฐใพใฃใ
- ่งฃๆฑบ: .env.test ใซ JWT_SECRET ใ่ฟฝๅ
**Files**: src/auth/login.ts, src/auth/token.test.ts
**PR**: https://github.com/org/repo/pull/123
` // โ LLM generates this based on session context
});Key points:
- No special tracking class needed
- LLM already knows what happened in this session
- Just generates Markdown and fills the
journalparameter - Uses user's own API key (not server's)
Server saves and aggregates
// Ava MCP Server
async function completeTask(params) {
// 1. Post to Slack
await slack.post(params.summary);
// 2. Save journal (no LLM needed)
await db.update(task_sessions)
.set({
status: 'completed',
journal: params.journal, // Already generated
updatedAt: new Date()
});
// Zero LLM cost on server
}Daily aggregation
// Get all journals for a date and concatenate
async function getDailyJournal(userId: string, date: string) {
const tasks = await db.query.taskSessions.findMany({
where: and(
eq(taskSessions.userId, userId),
eq(taskSessions.status, 'completed'),
sql`DATE(${taskSessions.updatedAt}) = ${date}`
)
});
return `# Journal: ${date}
${tasks.map(t => t.journal).join('\n---\n')}
`;
}๐ Journal Format
Default Template (used by LLM)
## Log: {{task_title}}
- **Prompt**: {{user_request}}
- **Issue**: {{problem_description}}
### What I did:
{{list_of_actions}}
### How I did it:
{{technical_approach}}
### What were challenging:
{{blockers_and_solutions}}
### Future work:
{{next_steps}}
**Files**: {{changed_files}}
**PR**: {{pr_url}}User Customization
Users can customize the template via ~/.claude/journal-template.json:
{
"template": "default",
"language": "ja",
"sections": {
"include": ["prompt", "what_i_did", "how", "challenges"],
"exclude": ["future_work"]
}
}The MCP client's LLM reads this config and generates journal accordingly.
๐๏ธ Database Schema
// Simplified schema
export const taskSessions = pgTable("task_sessions", {
id: text("id").primaryKey(),
userId: text("user_id").notNull(),
issueTitle: text("issue_title").notNull(),
status: taskStatusEnum("status").notNull(),
// Journal: Client-generated Markdown string
journal: text("journal"),
createdAt: timestamp("created_at").notNull(),
updatedAt: timestamp("updated_at").notNull(),
});
// task_events: Keep for Slack history
export const taskEvents = pgTable("task_events", {
id: text("id").primaryKey(),
taskSessionId: text("task_session_id").notNull(),
eventType: taskEventTypeEnum("event_type").notNull(),
summary: text("summary"),
createdAt: timestamp("created_at").notNull(),
});Changes:
- Add
journalcolumn (text type) totask_sessions - Remove
raw_contextfromtask_events
๐ MCP Tools
complete_task (updated)
{
name: "complete_task",
inputSchema: {
type: "object",
properties: {
task_session_id: { type: "string" },
summary: {
type: "string",
description: "Abstract summary for Slack"
},
journal: {
type: "string",
description: "Technical journal in Markdown format (optional)"
}
},
required: ["task_session_id", "summary"]
}
}get_daily_journal (new)
{
name: "get_daily_journal",
description: "Get aggregated journal for a specific date",
inputSchema: {
type: "object",
properties: {
date: {
type: "string",
description: "Date in YYYY-MM-DD format (defaults to today)"
}
}
}
}๐ Daily Journal Format
# Journal: 2025-12-04
## Summary
Completed 3 tasks today.
---
## Log: Fix authentication bug
- **Prompt**: ่ช่จผใใผใฏใณใฎๆ้ๅใใไฟฎๆญฃ
...
---
## Log: Implement rate limiting
- **Prompt**: API ใซใฌใผใๅถ้ใ่ฟฝๅ
...
---
## Log: Database migration
- **Prompt**: ใฆใผใถใผใใญใใฃใผใซใใฃใผใซใใ่ฟฝๅ
...๐ Implementation Plan
Phase 1: Core (1 week)
- Add
journalcolumn totask_sessionstable - Remove
raw_contextfromtask_eventstable - Update
complete_taskMCP tool to acceptjournalparameter - Implement
get_daily_journalMCP tool - Update MCP client to generate journal when completing tasks
Phase 2: Customization (2 weeks)
- Template configuration file support
- Multiple template options (simple/detailed)
- Language customization (ja/en)
- Preview before sending
Phase 3: Export (future)
-
export_daily_journaltool (Google Drive/Notion) - Search functionality
- Weekly/monthly aggregation
๐ Privacy
Data separation:
- Slack: Abstract summaries only (no code, no secrets)
- Journal: Detailed technical notes (stored in DB only)
User control:
- Client-side generation = user decides what to include
- Optional parameter = can skip journal if desired
- Can review/edit before completing task
๐ Benefits
| Aspect | Current | With Journal |
|---|---|---|
| Server LLM cost | N/A | $0 (client pays) |
| Knowledge retention | Lost after Slack | Permanent in journal |
| Daily review | Manual | Automatic aggregation |
| Customization | Fixed format | User templates |
| Privacy | Slack only | DB-only option |
โ Success Criteria
- Engineers can review what they learned each day
- Zero additional cost for server operator
- Natural integration with existing workflow
- No special tracking code needed
- Works with existing
/daily-reportcommand
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels