From c904531f44311a8774cd383b3903b14e6b86e5d8 Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Tue, 16 Jun 2026 17:58:30 +0800 Subject: [PATCH] chore: expose repository discovery metadata --- llms.txt | 53 ++++++++++++++ package.json | 20 +++++- .../__tests__/repository-discovery.test.ts | 72 +++++++++++++++++++ 3 files changed, 142 insertions(+), 3 deletions(-) create mode 100644 llms.txt create mode 100644 src/core/__tests__/repository-discovery.test.ts diff --git a/llms.txt b/llms.txt new file mode 100644 index 0000000..a25d20f --- /dev/null +++ b/llms.txt @@ -0,0 +1,53 @@ +# DevLog + +DevLog is a searchable AI coding-agent work journal. It reads Claude Code +conversation history and turns raw JSONL sessions into a CLI, web dashboard, +task board, worktree manager, reports, cost summaries, and session monitoring +surface. + +## Canonical Links + +- GitHub repository: https://github.com/moose-lab/DevLog +- DeepWiki project wiki: https://deepwiki.com/moose-lab/DevLog +- Zread discovery/search entry: https://zread.ai +- npm package: https://www.npmjs.com/package/@moose-lab/devlog + +## What To Read First + +- `README.md`: install commands, feature list, tech stack, and development flow. +- `.devin/wiki.json`: optional DeepWiki steering when automatic wiki generation + misses important source areas. +- `package.json`: repository metadata, homepage, issue URL, and public discovery + keywords. + +## Source Map + +- `src/cli/`: Commander.js CLI entry point and commands. +- `src/core/`: shared parsing, discovery, database, session runtime, process, + task, reporting, cost, cache, and worktree logic. +- `src/app/`: Next.js App Router pages and API routes. +- `src/components/`: dashboard UI components. +- `src/hooks/`: browser data-fetching hooks. +- `docs/adr/`: architectural decisions. + +## Key Concepts + +- Session discovery: scans local coding-agent history and maps work by project. +- Parser: turns JSONL transcript events into structured sessions and messages. +- Dashboard database: stores sessions, tasks, reports, locks, settings, and costs. +- Process manager: launches and monitors local coding-agent sessions. +- Control plane: stage and gate markers let running agents expose progress and + ask for human input. +- Reports: daily, weekly, and monthly human-readable summaries with HTML export. +- Cost and usage: aggregates model/provider usage by project and calendar window. + +## Indexing Notes + +- This repository is public at `moose-lab/DevLog`. +- DeepWiki can be opened at `https://deepwiki.com/moose-lab/DevLog`. +- DeepWiki public indexing does not require `.devin/wiki.json`; that file is + optional steering, not a baseline discovery requirement. +- Zread can be prompted from `https://zread.ai` by pasting the GitHub URL. +- Keep the GitHub About description and topics aligned with package keywords: + `ai-coding-agents`, `claude-code`, `developer-tools`, `dashboard`, + `agent-observability`, `work-journal`. diff --git a/package.json b/package.json index 315733b..85254a5 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,17 @@ { "name": "@moose-lab/devlog", "version": "0.5.0", - "description": "Dev logs and dashboard for your Claude Code sessions", + "description": "Searchable AI coding-agent work journal CLI and dashboard for Claude Code sessions", "type": "module", "packageManager": "bun@1.3.14", + "repository": { + "type": "git", + "url": "https://github.com/moose-lab/DevLog.git" + }, + "homepage": "https://github.com/moose-lab/DevLog#readme", + "bugs": { + "url": "https://github.com/moose-lab/DevLog/issues" + }, "bin": { "devlog": "./dist/cli.js" }, @@ -31,13 +39,19 @@ "quality": "bun run quality:ci" }, "keywords": [ + "ai-coding-agents", + "agent-observability", + "agent-workflows", "claude", + "claude-code", + "coding-agent", "devlog", "cli", "developer-tools", - "dashboard" + "dashboard", + "work-journal" ], - "author": "", + "author": "Moose Lab", "license": "MIT", "engines": { "node": ">=20.11" diff --git a/src/core/__tests__/repository-discovery.test.ts b/src/core/__tests__/repository-discovery.test.ts new file mode 100644 index 0000000..699349e --- /dev/null +++ b/src/core/__tests__/repository-discovery.test.ts @@ -0,0 +1,72 @@ +import { test } from "node:test"; +import assert from "node:assert/strict"; +import { existsSync, readFileSync } from "node:fs"; +import { join } from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = fileURLToPath(new URL("../../..", import.meta.url)); + +function readText(path: string): string { + return readFileSync(join(root, path), "utf8"); +} + +function readJson(path: string): T { + return JSON.parse(readText(path)) as T; +} + +function readBulletValue(text: string, label: string): string | undefined { + const prefix = `- ${label}: `; + return text + .split(/\r?\n/) + .find((line) => line.startsWith(prefix)) + ?.slice(prefix.length); +} + +test("repository exposes public analysis and coding-agent discovery metadata", () => { + const pkg = readJson<{ + repository?: { type?: string; url?: string }; + homepage?: string; + bugs?: { url?: string }; + keywords?: string[]; + }>("package.json"); + + assert.deepEqual(pkg.repository, { + type: "git", + url: "https://github.com/moose-lab/DevLog.git", + }); + assert.equal(pkg.homepage, "https://github.com/moose-lab/DevLog#readme"); + assert.equal(pkg.bugs?.url, "https://github.com/moose-lab/DevLog/issues"); + + for (const keyword of ["ai-coding-agents", "claude-code", "agent-observability"]) { + assert.ok(pkg.keywords?.includes(keyword), `missing package keyword ${keyword}`); + } +}); + +test("repository includes crawler-readable entry points without requiring DeepWiki steering", () => { + assert.equal(existsSync(join(root, "llms.txt")), true, "llms.txt should exist"); + + const llms = readText("llms.txt"); + assert.equal(readBulletValue(llms, "GitHub repository"), "https://github.com/moose-lab/DevLog"); + assert.equal(readBulletValue(llms, "DeepWiki project wiki"), "https://deepwiki.com/moose-lab/DevLog"); + assert.match(llms, /Zread/); + assert.match(llms, /\.devin\/wiki\.json.*optional|optional.*\.devin\/wiki\.json/is); + assert.match(llms, /steering/i); +}); + +test("DeepWiki steering config is optional and valid when present", () => { + const llms = readText("llms.txt"); + assert.match(llms, /DeepWiki public indexing does not require `.devin\/wiki\.json`/i); + assert.match(llms, /\.devin\/wiki\.json.*optional|optional.*\.devin\/wiki\.json/is); + + const wikiPath = ".devin/wiki.json"; + if (!existsSync(join(root, wikiPath))) { + return; + } + + const wiki = readJson<{ + repo_notes?: unknown; + pages?: unknown; + }>(wikiPath); + assert.equal(Array.isArray(wiki.repo_notes), true); + assert.equal(Array.isArray(wiki.pages), true); +});