claude-project-manager 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,166 @@
1
+ # claude-project-manager
2
+
3
+ **Turn Claude Code into an autonomous project manager.**
4
+
5
+ One command. Claude plans, builds, documents, and tracks your entire project. You never write a line of code.
6
+
7
+ ```
8
+ npx claude-project-manager init
9
+ ```
10
+
11
+ ---
12
+
13
+ ## What It Does
14
+
15
+ `claude-project-manager` injects a structured memory system and agent rules into any project. When you open Claude Code, it behaves as a fully autonomous project manager that:
16
+
17
+ - **Plans tasks** — breaks features into a kanban board and works through them
18
+ - **Writes code** — implements everything, tests it, moves on
19
+ - **Documents everything** — architecture diagrams, file trees, component docs, API surface
20
+ - **Remembers across sessions** — picks up exactly where it left off
21
+ - **Caches external docs** — checks local cache before searching the web
22
+ - **Logs every decision** — architecture decision records with full rationale
23
+ - **Tracks every change** — timestamped changelog, always in sync
24
+
25
+ ## Quick Start
26
+
27
+ ```bash
28
+ # npm
29
+ npx claude-project-manager init
30
+
31
+ # pnpm
32
+ pnpm dlx claude-project-manager init
33
+
34
+ # yarn
35
+ yarn dlx claude-project-manager init
36
+ ```
37
+
38
+ Then just open Claude Code and tell it what to build:
39
+
40
+ ```
41
+ "Build me a REST API with user auth and a Postgres database"
42
+ ```
43
+
44
+ That's it. Claude reads the rules, scans your codebase, sets up the task board, and starts building.
45
+
46
+ ## What `init` Creates
47
+
48
+ ```
49
+ your-project/
50
+ ├── CLAUDE.md # Agent rules (your existing rules preserved)
51
+ └── .claude/
52
+ ├── codebase/
53
+ │ ├── overview.md # Architecture + ASCII diagrams
54
+ │ ├── tree.md # Auto-updated file tree
55
+ │ ├── stack.md # Tech stack & dependencies
56
+ │ ├── components/ # Per-component deep dives
57
+ │ ├── models.md # Data models & schemas
58
+ │ ├── apis.md # API endpoints & interfaces
59
+ │ └── patterns.md # Coding conventions
60
+
61
+ ├── docs/
62
+ │ ├── index.md # Doc lookup table
63
+ │ └── cached/ # Fetched external docs
64
+
65
+ ├── tasks/
66
+ │ ├── board.md # Kanban: TODO / IN PROGRESS / DONE
67
+ │ ├── backlog.md # Future ideas
68
+ │ └── changelog.md # Timestamped change log
69
+
70
+ ├── memory/
71
+ │ ├── decisions.md # Architecture Decision Records
72
+ │ ├── context.md # Persistent context & gotchas
73
+ │ └── sessions/ # Per-session summaries
74
+
75
+ └── config.md # PM settings
76
+ ```
77
+
78
+ ## How It Works
79
+
80
+ ### 1. Structured Memory
81
+
82
+ Claude Code reads `CLAUDE.md` at the start of every session. `claude-project-manager` injects rules that tell Claude to use the `.claude/` folder as persistent memory — reading state on startup, writing state after every action.
83
+
84
+ ### 2. Session Continuity
85
+
86
+ Every session ends with a summary written to `.claude/memory/sessions/`. The next session reads it and picks up where you left off. Close your terminal, come back in a week — Claude knows exactly what's happening.
87
+
88
+ ### 3. Auto-Updating Docs
89
+
90
+ After every code change, Claude updates the file tree, component docs, architecture overview, and changelog. Your documentation is always in sync with reality.
91
+
92
+ ### 4. Cache-First Docs
93
+
94
+ Before searching the web for library docs, Claude checks `.claude/docs/index.md`. If the docs are cached and fresh, it uses them instantly. No redundant web searches.
95
+
96
+ ### 5. Task Board
97
+
98
+ Claude maintains a kanban board in `.claude/tasks/board.md`. It moves tasks through TODO → IN PROGRESS → DONE as it works, so you always see project status at a glance.
99
+
100
+ ## Existing CLAUDE.md?
101
+
102
+ `claude-project-manager` never destroys your existing rules. It wraps them:
103
+
104
+ ```markdown
105
+ <!-- CLAUDE-PM:USER-RULES:START -->
106
+ (your original CLAUDE.md content — untouched)
107
+ <!-- CLAUDE-PM:USER-RULES:END -->
108
+
109
+ <!-- CLAUDE-PM:AGENT-RULES:START -->
110
+ (project manager rules — managed by claude-project-manager)
111
+ <!-- CLAUDE-PM:AGENT-RULES:END -->
112
+ ```
113
+
114
+ Your rules stay. The PM rules are added alongside them.
115
+
116
+ ## Commands
117
+
118
+ | Command | Description |
119
+ |---|---|
120
+ | `npx claude-project-manager init` | Set up project management in current directory |
121
+ | `npx claude-project-manager reset` | Re-scaffold missing files + update agent rules to latest |
122
+
123
+ ### Options
124
+
125
+ ```
126
+ -d, --dir <path> Target a different directory (default: cwd)
127
+ ```
128
+
129
+ ### Using Other Package Managers
130
+
131
+ ```bash
132
+ # pnpm
133
+ pnpm dlx claude-project-manager init
134
+ pnpm dlx claude-project-manager reset
135
+
136
+ # yarn
137
+ yarn dlx claude-project-manager init
138
+ yarn dlx claude-project-manager reset
139
+ ```
140
+
141
+ ## Updating
142
+
143
+ When a new version of `claude-project-manager` ships with improved agent rules:
144
+
145
+ ```bash
146
+ # npm
147
+ npx claude-project-manager@latest reset
148
+
149
+ # pnpm
150
+ pnpm dlx claude-project-manager@latest reset
151
+
152
+ # yarn
153
+ yarn dlx claude-project-manager@latest reset
154
+ ```
155
+
156
+ This updates the agent rules to the latest version while preserving all your tasks, memory, docs, and custom rules.
157
+
158
+ ## Philosophy
159
+
160
+ The best project management is invisible. You describe what you want in plain English. Claude plans it, builds it, documents it, and tracks it. You review the output.
161
+
162
+ No tickets. No sprints. No standups. Just describe and ship.
163
+
164
+ ## License
165
+
166
+ MIT
@@ -0,0 +1,13 @@
1
+ export interface MergeResult {
2
+ hadExisting: boolean;
3
+ userRulesPreserved: boolean;
4
+ }
5
+ /**
6
+ * Reads existing CLAUDE.md, wraps user content in markers,
7
+ * and injects (or updates) the PM agent rules section.
8
+ */
9
+ export declare function mergeCLAUDEmd(projectRoot: string): MergeResult;
10
+ /**
11
+ * Extracts the user rules section from a managed CLAUDE.md.
12
+ */
13
+ export declare function extractUserRules(projectRoot: string): string | null;
@@ -0,0 +1,68 @@
1
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { pmRules } from "./templates/rules.js";
4
+ const USER_START = "<!-- CLAUDE-PM:USER-RULES:START -->";
5
+ const USER_END = "<!-- CLAUDE-PM:USER-RULES:END -->";
6
+ const AGENT_START = "<!-- CLAUDE-PM:AGENT-RULES:START -->";
7
+ const AGENT_END = "<!-- CLAUDE-PM:AGENT-RULES:END -->";
8
+ /**
9
+ * Reads existing CLAUDE.md, wraps user content in markers,
10
+ * and injects (or updates) the PM agent rules section.
11
+ */
12
+ export function mergeCLAUDEmd(projectRoot) {
13
+ const claudePath = join(projectRoot, "CLAUDE.md");
14
+ const rules = pmRules();
15
+ // No existing file — create fresh
16
+ if (!existsSync(claudePath)) {
17
+ const content = [
18
+ USER_START,
19
+ "",
20
+ USER_END,
21
+ "",
22
+ AGENT_START,
23
+ rules,
24
+ AGENT_END,
25
+ "",
26
+ ].join("\n");
27
+ writeFileSync(claudePath, content, "utf-8");
28
+ return { hadExisting: false, userRulesPreserved: false };
29
+ }
30
+ // Existing file — read and merge
31
+ const existing = readFileSync(claudePath, "utf-8");
32
+ // Already managed by claude-pm — update agent rules only
33
+ if (existing.includes(AGENT_START)) {
34
+ const before = existing.substring(0, existing.indexOf(AGENT_START) + AGENT_START.length);
35
+ const after = existing.substring(existing.indexOf(AGENT_END));
36
+ const updated = before + "\n" + rules + "\n" + after;
37
+ writeFileSync(claudePath, updated, "utf-8");
38
+ return { hadExisting: true, userRulesPreserved: true };
39
+ }
40
+ // Existing file not yet managed — wrap user content, append agent rules
41
+ const content = [
42
+ USER_START,
43
+ existing.trim(),
44
+ USER_END,
45
+ "",
46
+ AGENT_START,
47
+ rules,
48
+ AGENT_END,
49
+ "",
50
+ ].join("\n");
51
+ writeFileSync(claudePath, content, "utf-8");
52
+ return { hadExisting: true, userRulesPreserved: true };
53
+ }
54
+ /**
55
+ * Extracts the user rules section from a managed CLAUDE.md.
56
+ */
57
+ export function extractUserRules(projectRoot) {
58
+ const claudePath = join(projectRoot, "CLAUDE.md");
59
+ if (!existsSync(claudePath))
60
+ return null;
61
+ const content = readFileSync(claudePath, "utf-8");
62
+ if (!content.includes(USER_START) || !content.includes(USER_END)) {
63
+ return null;
64
+ }
65
+ const start = content.indexOf(USER_START) + USER_START.length;
66
+ const end = content.indexOf(USER_END);
67
+ return content.substring(start, end).trim();
68
+ }
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from "commander";
3
+ import { resolve } from "node:path";
4
+ import { runInit } from "./commands/init.js";
5
+ import { runReset } from "./commands/reset.js";
6
+ import { bold, dim } from "./utils.js";
7
+ const program = new Command();
8
+ program
9
+ .name("claude-project-manager")
10
+ .description("Turn Claude Code into an autonomous project manager")
11
+ .version("1.0.0");
12
+ program
13
+ .command("init")
14
+ .description("Initialize project management in the current directory")
15
+ .option("-d, --dir <path>", "Target directory (default: current directory)")
16
+ .action((opts) => {
17
+ const targetDir = resolve(opts.dir ?? process.cwd());
18
+ runInit(targetDir);
19
+ });
20
+ program
21
+ .command("reset")
22
+ .description("Re-scaffold missing files and update agent rules to latest version")
23
+ .option("-d, --dir <path>", "Target directory (default: current directory)")
24
+ .action((opts) => {
25
+ const targetDir = resolve(opts.dir ?? process.cwd());
26
+ runReset(targetDir);
27
+ });
28
+ // Default: show help with branding
29
+ program.addHelpText("beforeAll", () => {
30
+ return [
31
+ "",
32
+ bold(" claude-project-manager") + dim(" — autonomous project management for Claude Code"),
33
+ "",
34
+ ].join("\n");
35
+ });
36
+ program.parse();
@@ -0,0 +1 @@
1
+ export declare function runInit(targetDir: string): void;
@@ -0,0 +1,55 @@
1
+ import { existsSync } from "node:fs";
2
+ import { join, basename } from "node:path";
3
+ import { scaffoldDotClaude } from "../scaffold.js";
4
+ import { mergeCLAUDEmd } from "../claude-md.js";
5
+ import { bold, green, cyan, yellow, dim } from "../utils.js";
6
+ export function runInit(targetDir) {
7
+ const projectName = basename(targetDir);
8
+ console.log("");
9
+ console.log(bold(" claude-project-manager init"));
10
+ console.log(dim(` Project: ${projectName}`));
11
+ console.log(dim(` Path: ${targetDir}`));
12
+ console.log("");
13
+ // Step 1: Scaffold .claude/ directory
14
+ const dotClaudeExists = existsSync(join(targetDir, ".claude"));
15
+ console.log(dotClaudeExists
16
+ ? yellow(" .claude/ directory exists — preserving existing files")
17
+ : green(" Creating .claude/ directory structure..."));
18
+ const { created, skipped } = scaffoldDotClaude(targetDir);
19
+ for (const file of created) {
20
+ console.log(green(` + ${file}`));
21
+ }
22
+ for (const file of skipped) {
23
+ console.log(dim(` ~ ${file} (already exists, skipped)`));
24
+ }
25
+ console.log("");
26
+ // Step 2: Merge CLAUDE.md
27
+ const claudeExists = existsSync(join(targetDir, "CLAUDE.md"));
28
+ if (claudeExists) {
29
+ console.log(yellow(" CLAUDE.md exists — preserving your rules, injecting PM agent rules"));
30
+ }
31
+ else {
32
+ console.log(green(" Creating CLAUDE.md with PM agent rules..."));
33
+ }
34
+ const mergeResult = mergeCLAUDEmd(targetDir);
35
+ if (mergeResult.hadExisting && mergeResult.userRulesPreserved) {
36
+ console.log(green(" Your existing rules are preserved in the USER-RULES section"));
37
+ }
38
+ console.log(green(" PM agent rules injected into AGENT-RULES section"));
39
+ // Done
40
+ console.log("");
41
+ console.log(bold(green(" Done! Claude is now your project manager.")));
42
+ console.log("");
43
+ console.log(" What happened:");
44
+ console.log(cyan(" .claude/codebase/") + " — Architecture docs, file tree, component maps");
45
+ console.log(cyan(" .claude/docs/") + " — Cached external documentation");
46
+ console.log(cyan(" .claude/tasks/") + " — Task board, backlog, changelog");
47
+ console.log(cyan(" .claude/memory/") + " — Decisions, context, session history");
48
+ console.log(cyan(" CLAUDE.md") + " — Agent rules (your rules preserved)");
49
+ console.log("");
50
+ console.log(" Next steps:");
51
+ console.log(dim(" 1. Open Claude Code in this project"));
52
+ console.log(dim(' 2. Tell it what to build: "Build me a REST API with auth"'));
53
+ console.log(dim(" 3. Watch it plan, build, and track everything autonomously"));
54
+ console.log("");
55
+ }
@@ -0,0 +1 @@
1
+ export declare function runReset(targetDir: string): void;
@@ -0,0 +1,38 @@
1
+ import { basename } from "node:path";
2
+ import { scaffoldDotClaude } from "../scaffold.js";
3
+ import { mergeCLAUDEmd, extractUserRules } from "../claude-md.js";
4
+ import { bold, green, yellow, dim } from "../utils.js";
5
+ export function runReset(targetDir) {
6
+ const projectName = basename(targetDir);
7
+ console.log("");
8
+ console.log(bold(" claude-project-manager reset"));
9
+ console.log(dim(` Project: ${projectName}`));
10
+ console.log("");
11
+ // Preserve user rules
12
+ const userRules = extractUserRules(targetDir);
13
+ if (userRules) {
14
+ console.log(green(" User rules found and preserved"));
15
+ }
16
+ // Re-scaffold (writeIfMissing means existing files won't be overwritten)
17
+ console.log(yellow(" Re-scaffolding .claude/ structure..."));
18
+ const { created, skipped } = scaffoldDotClaude(targetDir);
19
+ for (const file of created) {
20
+ console.log(green(` + ${file}`));
21
+ }
22
+ for (const file of skipped) {
23
+ console.log(dim(` ~ ${file} (preserved)`));
24
+ }
25
+ console.log("");
26
+ // Re-inject latest rules
27
+ console.log(yellow(" Updating PM agent rules in CLAUDE.md..."));
28
+ mergeCLAUDEmd(targetDir);
29
+ console.log(green(" Agent rules updated to latest version"));
30
+ if (userRules) {
31
+ console.log(green(" Your custom rules are untouched"));
32
+ }
33
+ console.log("");
34
+ console.log(bold(green(" Reset complete.")));
35
+ console.log(dim(" Existing task data, memory, and docs were preserved."));
36
+ console.log(dim(" Only missing scaffold files were recreated and agent rules updated."));
37
+ console.log("");
38
+ }
@@ -0,0 +1,5 @@
1
+ export interface ScaffoldResult {
2
+ created: string[];
3
+ skipped: string[];
4
+ }
5
+ export declare function scaffoldDotClaude(projectRoot: string): ScaffoldResult;
@@ -0,0 +1,50 @@
1
+ import { join } from "node:path";
2
+ import { ensureDir, writeIfMissing } from "./utils.js";
3
+ import { defaultBoard, defaultBacklog, defaultChangelog, defaultConfig, defaultOverview, defaultTree, defaultStack, defaultModels, defaultApis, defaultPatterns, defaultDocsIndex, defaultDecisions, defaultContext, } from "./templates/defaults.js";
4
+ export function scaffoldDotClaude(projectRoot) {
5
+ const base = join(projectRoot, ".claude");
6
+ const created = [];
7
+ const skipped = [];
8
+ // Create all directories
9
+ const dirs = [
10
+ join(base, "codebase", "components"),
11
+ join(base, "docs", "cached"),
12
+ join(base, "tasks"),
13
+ join(base, "memory", "sessions"),
14
+ ];
15
+ for (const dir of dirs) {
16
+ ensureDir(dir);
17
+ }
18
+ // Write template files (skip if they already exist to preserve user data)
19
+ const files = [
20
+ // Codebase
21
+ [join(base, "codebase", "overview.md"), defaultOverview],
22
+ [join(base, "codebase", "tree.md"), defaultTree],
23
+ [join(base, "codebase", "stack.md"), defaultStack],
24
+ [join(base, "codebase", "models.md"), defaultModels],
25
+ [join(base, "codebase", "apis.md"), defaultApis],
26
+ [join(base, "codebase", "patterns.md"), defaultPatterns],
27
+ // Docs
28
+ [join(base, "docs", "index.md"), defaultDocsIndex],
29
+ // Tasks
30
+ [join(base, "tasks", "board.md"), defaultBoard],
31
+ [join(base, "tasks", "backlog.md"), defaultBacklog],
32
+ [join(base, "tasks", "changelog.md"), defaultChangelog],
33
+ // Memory
34
+ [join(base, "memory", "decisions.md"), defaultDecisions],
35
+ [join(base, "memory", "context.md"), defaultContext],
36
+ // Config
37
+ [join(base, "config.md"), defaultConfig],
38
+ ];
39
+ for (const [filePath, content] of files) {
40
+ const wasCreated = writeIfMissing(filePath, content);
41
+ const relative = filePath.replace(projectRoot + "/", "");
42
+ if (wasCreated) {
43
+ created.push(relative);
44
+ }
45
+ else {
46
+ skipped.push(relative);
47
+ }
48
+ }
49
+ return { created, skipped };
50
+ }
@@ -0,0 +1,13 @@
1
+ export declare const defaultBoard = "# Task Board\n\n## TODO\n<!-- Add tasks here as: - [ ] #N \u2014 Task description -->\n\n## IN PROGRESS\n\n## DONE\n";
2
+ export declare const defaultBacklog = "# Backlog\n\nIdeas, future features, and low-priority items.\n\n<!-- Add items here as bullet points -->\n";
3
+ export declare const defaultChangelog = "# Changelog\n\nTimestamped log of all changes made to the project.\n\n<!-- Entries are added automatically by the project manager -->\n";
4
+ export declare const defaultOverview = "# Architecture Overview\n\n<!-- This file is auto-maintained by the project manager. -->\n<!-- It contains the high-level system design and ASCII diagrams. -->\n\n## System Architecture\n\n> Pending initial codebase analysis.\n\n## Data Flow\n\n> Pending initial codebase analysis.\n";
5
+ export declare const defaultTree = "# Project File Tree\n\n<!-- This file is auto-maintained by the project manager. -->\n<!-- Regenerated whenever files are added, removed, or moved. -->\n\n> Pending initial codebase scan.\n";
6
+ export declare const defaultStack = "# Tech Stack\n\n<!-- This file is auto-maintained by the project manager. -->\n\n## Frameworks & Libraries\n\n> Pending initial codebase analysis.\n\n## Dev Dependencies\n\n> Pending initial codebase analysis.\n\n## Infrastructure\n\n> Pending initial codebase analysis.\n";
7
+ export declare const defaultModels = "# Data Models\n\n<!-- This file is auto-maintained by the project manager. -->\n<!-- All database schemas, types, and data structures. -->\n\n> Pending initial codebase analysis.\n";
8
+ export declare const defaultApis = "# API Surface\n\n<!-- This file is auto-maintained by the project manager. -->\n<!-- All endpoints, routes, and interfaces. -->\n\n> Pending initial codebase analysis.\n";
9
+ export declare const defaultPatterns = "# Patterns & Conventions\n\n<!-- This file is auto-maintained by the project manager. -->\n<!-- Coding conventions, naming rules, and established patterns. -->\n\n> Pending initial codebase analysis.\n";
10
+ export declare const defaultDocsIndex = "# Documentation Index\n\nCached external documentation for this project.\n\n| Name | Source URL | Date Cached | File |\n|------|-----------|-------------|------|\n<!-- Entries are added automatically when docs are fetched -->\n";
11
+ export declare const defaultDecisions = "# Architecture Decision Records\n\nSignificant technical decisions and their rationale.\n\n<!-- Entries are added automatically by the project manager -->\n";
12
+ export declare const defaultContext = "# Persistent Context\n\nKey facts, preferences, and gotchas that should persist across sessions.\n\n## User Preferences\n\n<!-- e.g., preferred frameworks, coding style, etc. -->\n\n## Environment\n\n<!-- e.g., OS, Node version, special setup requirements -->\n\n## Known Gotchas\n\n<!-- Things that broke before and how they were fixed -->\n";
13
+ export declare const defaultConfig = "# Project Manager Configuration\n\n## Project\n- **Name:** (auto-detected)\n- **Type:** (auto-detected)\n\n## Settings\n- **Auto-update docs:** true\n- **Doc cache max age (days):** 30\n- **Session summaries:** true\n";
@@ -0,0 +1,124 @@
1
+ // ─── Tasks ───────────────────────────────────────────────────────────
2
+ export const defaultBoard = `# Task Board
3
+
4
+ ## TODO
5
+ <!-- Add tasks here as: - [ ] #N — Task description -->
6
+
7
+ ## IN PROGRESS
8
+
9
+ ## DONE
10
+ `;
11
+ export const defaultBacklog = `# Backlog
12
+
13
+ Ideas, future features, and low-priority items.
14
+
15
+ <!-- Add items here as bullet points -->
16
+ `;
17
+ export const defaultChangelog = `# Changelog
18
+
19
+ Timestamped log of all changes made to the project.
20
+
21
+ <!-- Entries are added automatically by the project manager -->
22
+ `;
23
+ // ─── Codebase ────────────────────────────────────────────────────────
24
+ export const defaultOverview = `# Architecture Overview
25
+
26
+ <!-- This file is auto-maintained by the project manager. -->
27
+ <!-- It contains the high-level system design and ASCII diagrams. -->
28
+
29
+ ## System Architecture
30
+
31
+ > Pending initial codebase analysis.
32
+
33
+ ## Data Flow
34
+
35
+ > Pending initial codebase analysis.
36
+ `;
37
+ export const defaultTree = `# Project File Tree
38
+
39
+ <!-- This file is auto-maintained by the project manager. -->
40
+ <!-- Regenerated whenever files are added, removed, or moved. -->
41
+
42
+ > Pending initial codebase scan.
43
+ `;
44
+ export const defaultStack = `# Tech Stack
45
+
46
+ <!-- This file is auto-maintained by the project manager. -->
47
+
48
+ ## Frameworks & Libraries
49
+
50
+ > Pending initial codebase analysis.
51
+
52
+ ## Dev Dependencies
53
+
54
+ > Pending initial codebase analysis.
55
+
56
+ ## Infrastructure
57
+
58
+ > Pending initial codebase analysis.
59
+ `;
60
+ export const defaultModels = `# Data Models
61
+
62
+ <!-- This file is auto-maintained by the project manager. -->
63
+ <!-- All database schemas, types, and data structures. -->
64
+
65
+ > Pending initial codebase analysis.
66
+ `;
67
+ export const defaultApis = `# API Surface
68
+
69
+ <!-- This file is auto-maintained by the project manager. -->
70
+ <!-- All endpoints, routes, and interfaces. -->
71
+
72
+ > Pending initial codebase analysis.
73
+ `;
74
+ export const defaultPatterns = `# Patterns & Conventions
75
+
76
+ <!-- This file is auto-maintained by the project manager. -->
77
+ <!-- Coding conventions, naming rules, and established patterns. -->
78
+
79
+ > Pending initial codebase analysis.
80
+ `;
81
+ // ─── Docs ────────────────────────────────────────────────────────────
82
+ export const defaultDocsIndex = `# Documentation Index
83
+
84
+ Cached external documentation for this project.
85
+
86
+ | Name | Source URL | Date Cached | File |
87
+ |------|-----------|-------------|------|
88
+ <!-- Entries are added automatically when docs are fetched -->
89
+ `;
90
+ // ─── Memory ──────────────────────────────────────────────────────────
91
+ export const defaultDecisions = `# Architecture Decision Records
92
+
93
+ Significant technical decisions and their rationale.
94
+
95
+ <!-- Entries are added automatically by the project manager -->
96
+ `;
97
+ export const defaultContext = `# Persistent Context
98
+
99
+ Key facts, preferences, and gotchas that should persist across sessions.
100
+
101
+ ## User Preferences
102
+
103
+ <!-- e.g., preferred frameworks, coding style, etc. -->
104
+
105
+ ## Environment
106
+
107
+ <!-- e.g., OS, Node version, special setup requirements -->
108
+
109
+ ## Known Gotchas
110
+
111
+ <!-- Things that broke before and how they were fixed -->
112
+ `;
113
+ // ─── Config ──────────────────────────────────────────────────────────
114
+ export const defaultConfig = `# Project Manager Configuration
115
+
116
+ ## Project
117
+ - **Name:** (auto-detected)
118
+ - **Type:** (auto-detected)
119
+
120
+ ## Settings
121
+ - **Auto-update docs:** true
122
+ - **Doc cache max age (days):** 30
123
+ - **Session summaries:** true
124
+ `;
@@ -0,0 +1 @@
1
+ export declare function pmRules(): string;
@@ -0,0 +1,184 @@
1
+ export function pmRules() {
2
+ return `
3
+ # Claude Project Manager — Agent Rules
4
+
5
+ You are an **autonomous project manager**. You fully manage this project — planning, building, documenting, and tracking everything. The user should never need to write code themselves.
6
+
7
+ ---
8
+
9
+ ## Session Startup Protocol
10
+
11
+ On EVERY new conversation or session:
12
+
13
+ 1. Read \`.claude/tasks/board.md\` to understand current project state
14
+ 2. Read the latest file in \`.claude/memory/sessions/\` to restore context from the last session
15
+ 3. Read \`.claude/memory/context.md\` for persistent knowledge (preferences, gotchas, env quirks)
16
+ 4. Briefly summarize current state to the user:
17
+ - What was completed last session
18
+ - What's currently in progress
19
+ - What's next on the board
20
+ 5. Ask the user what they'd like to focus on, or propose continuing with the next TODO task
21
+
22
+ ---
23
+
24
+ ## Task Management
25
+
26
+ ### Task Board — \`.claude/tasks/board.md\`
27
+
28
+ Maintain a kanban board with three columns: **TODO**, **IN PROGRESS**, **DONE**.
29
+
30
+ Format:
31
+ \`\`\`markdown
32
+ ## TODO
33
+ - [ ] #4 — Add user authentication
34
+ - [ ] #5 — Set up CI/CD pipeline
35
+
36
+ ## IN PROGRESS
37
+ - [ ] #3 — Build REST API endpoints (started: 2025-01-15)
38
+
39
+ ## DONE
40
+ - [x] #1 — Initialize project structure (completed: 2025-01-14)
41
+ - [x] #2 — Set up database schema (completed: 2025-01-14)
42
+ \`\`\`
43
+
44
+ Rules:
45
+ - Every task gets a unique ID (#N, incrementing)
46
+ - BEFORE starting any coding work, move the relevant task to IN PROGRESS
47
+ - AFTER completing work, move the task to DONE with the completion date
48
+ - When the user describes a new feature or request, break it into small specific tasks and add to TODO
49
+ - One task = one logical unit of work (completable in a single session ideally)
50
+
51
+ ### Backlog — \`.claude/tasks/backlog.md\`
52
+ - Store future ideas, nice-to-haves, and low-priority items
53
+ - Periodically ask the user if any backlog items should be promoted to TODO
54
+
55
+ ### Changelog — \`.claude/tasks/changelog.md\`
56
+ - After EVERY code change, append an entry with the date, what changed, files affected, and which task it relates to
57
+ - This is **append-only** — never delete or modify past entries
58
+ - Format:
59
+ \`\`\`markdown
60
+ ## 2025-01-15
61
+ - Built REST API scaffolding — src/api/routes.ts, src/api/controllers/ (#3)
62
+ - Added Express + TypeScript base configuration (#3)
63
+ \`\`\`
64
+
65
+ ---
66
+
67
+ ## Codebase Documentation
68
+
69
+ ### Auto-Update Rule
70
+ After EVERY code change, check if any of the following need updating. If they do, update them immediately:
71
+
72
+ 1. **File Tree** — \`.claude/codebase/tree.md\`
73
+ - Regenerate when files/folders are added, removed, or moved
74
+ - Annotate key directories with their purpose
75
+ - Keep it accurate — this is the first thing you'll read to understand the project
76
+
77
+ 2. **Architecture Overview** — \`.claude/codebase/overview.md\`
78
+ - High-level system design with ASCII flow diagrams
79
+ - Show how major components connect and data flows between them
80
+ - Update when new systems, services, or major modules are added
81
+
82
+ 3. **Component Docs** — \`.claude/codebase/components/<name>.md\`
83
+ - One markdown file per major component, module, or service
84
+ - Each file includes: purpose, key files, dependencies, public interface, known edge cases
85
+ - Create a new component doc when introducing a new module
86
+ - Update when a component's behavior or interface changes
87
+
88
+ 4. **Tech Stack** — \`.claude/codebase/stack.md\`
89
+ - All frameworks, libraries, and tools with their versions
90
+ - Update when dependencies are added, removed, or upgraded
91
+
92
+ 5. **Data Models** — \`.claude/codebase/models.md\`
93
+ - All database schemas, TypeScript types/interfaces, data structures
94
+ - Update when models or schemas change
95
+
96
+ 6. **API Surface** — \`.claude/codebase/apis.md\`
97
+ - All API endpoints, routes, WebSocket events, or other interfaces
98
+ - Include: method, path, params, request/response shape
99
+ - Update when APIs are added or modified
100
+
101
+ 7. **Patterns & Conventions** — \`.claude/codebase/patterns.md\`
102
+ - Coding conventions, naming patterns, file organization rules, error handling approach
103
+ - Update when new conventions are established
104
+
105
+ ---
106
+
107
+ ## External Documentation
108
+
109
+ ### Cache-First Strategy
110
+
111
+ BEFORE searching the web for any library, framework, or API documentation:
112
+ 1. Check \`.claude/docs/index.md\` for a cached version
113
+ 2. If found and less than 30 days old → use the cached version
114
+ 3. If found but older than 30 days → re-fetch, update cache, update index
115
+ 4. If not found → fetch, save to \`.claude/docs/cached/<name>.md\`, add to index
116
+
117
+ ### Index Format — \`.claude/docs/index.md\`
118
+ \`\`\`markdown
119
+ | Name | Source URL | Date Cached | File |
120
+ |------|-----------|-------------|------|
121
+ | Next.js App Router | https://nextjs.org/docs/app | 2025-01-15 | nextjs-app-router.md |
122
+ \`\`\`
123
+
124
+ ### Caching Rules
125
+ - Only cache what's relevant to this project — summarize large docs
126
+ - Store in \`.claude/docs/cached/<library-name>.md\`
127
+ - Include the source URL and cache date at the top of each cached file
128
+
129
+ ---
130
+
131
+ ## Memory & Context
132
+
133
+ ### Persistent Context — \`.claude/memory/context.md\`
134
+ - Key facts the agent should always know: user preferences, environment details, recurring gotchas, things that broke before and how they were fixed
135
+ - Update whenever you discover something future sessions should know
136
+ - Format as categorized bullet points
137
+
138
+ ### Architecture Decisions — \`.claude/memory/decisions.md\`
139
+ Log every significant technical decision using this format:
140
+ \`\`\`markdown
141
+ ### Decision: [Title]
142
+ **Date:** YYYY-MM-DD
143
+ **Context:** Why this decision came up
144
+ **Decision:** What was chosen
145
+ **Alternatives:** What else was considered
146
+ **Rationale:** Why this option won
147
+ \`\`\`
148
+
149
+ Rules:
150
+ - NEVER re-debate a logged decision unless the user explicitly asks to revisit it
151
+ - Reference past decisions when they're relevant to current work
152
+
153
+ ### Session Summaries — \`.claude/memory/sessions/\`
154
+ At the end of each session or when the conversation is wrapping up:
155
+ - Create or append to \`.claude/memory/sessions/YYYY-MM-DD.md\`
156
+ - Include: tasks completed, tasks in progress, blockers encountered, what to do next
157
+ - This is how the next session picks up where you left off
158
+
159
+ ---
160
+
161
+ ## Autonomous Behavior
162
+
163
+ You are **fully autonomous**. Plan, build, test, and document without waiting for step-by-step approval.
164
+
165
+ **Only ask the user for input when:**
166
+ - A major architecture decision is needed (new framework, database choice, deployment strategy)
167
+ - Requirements are ambiguous (you genuinely don't know what the user wants)
168
+ - A destructive operation is proposed (deleting features, major breaking refactors)
169
+
170
+ **For everything else:** decide, execute, document, and report what you did after.
171
+
172
+ **After completing any task:**
173
+ 1. Update the task board (move to DONE)
174
+ 2. Update the changelog
175
+ 3. Update any affected codebase docs (tree, components, etc.)
176
+ 4. Briefly tell the user what was done and what's next
177
+
178
+ ---
179
+
180
+ ## Project Configuration
181
+
182
+ Settings are in \`.claude/config.md\`. Respect any user-defined overrides found there.
183
+ `.trim();
184
+ }
@@ -0,0 +1,9 @@
1
+ export declare const bold: (s: string) => string;
2
+ export declare const green: (s: string) => string;
3
+ export declare const cyan: (s: string) => string;
4
+ export declare const yellow: (s: string) => string;
5
+ export declare const dim: (s: string) => string;
6
+ export declare const red: (s: string) => string;
7
+ export declare function ensureDir(dirPath: string): void;
8
+ export declare function writeIfMissing(filePath: string, content: string): boolean;
9
+ export declare function writeAlways(filePath: string, content: string): void;
package/dist/utils.js ADDED
@@ -0,0 +1,26 @@
1
+ import { writeFileSync, mkdirSync, existsSync } from "node:fs";
2
+ import { dirname } from "node:path";
3
+ // ANSI color helpers — zero dependencies
4
+ export const bold = (s) => `\x1b[1m${s}\x1b[0m`;
5
+ export const green = (s) => `\x1b[32m${s}\x1b[0m`;
6
+ export const cyan = (s) => `\x1b[36m${s}\x1b[0m`;
7
+ export const yellow = (s) => `\x1b[33m${s}\x1b[0m`;
8
+ export const dim = (s) => `\x1b[2m${s}\x1b[0m`;
9
+ export const red = (s) => `\x1b[31m${s}\x1b[0m`;
10
+ export function ensureDir(dirPath) {
11
+ if (!existsSync(dirPath)) {
12
+ mkdirSync(dirPath, { recursive: true });
13
+ }
14
+ }
15
+ export function writeIfMissing(filePath, content) {
16
+ ensureDir(dirname(filePath));
17
+ if (existsSync(filePath)) {
18
+ return false;
19
+ }
20
+ writeFileSync(filePath, content, "utf-8");
21
+ return true;
22
+ }
23
+ export function writeAlways(filePath, content) {
24
+ ensureDir(dirname(filePath));
25
+ writeFileSync(filePath, content, "utf-8");
26
+ }
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "claude-project-manager",
3
+ "version": "1.0.0",
4
+ "description": "Turn Claude Code into an autonomous project manager. Zero-code project management with persistent memory, auto-updating docs, and full task tracking.",
5
+ "keywords": [
6
+ "claude",
7
+ "claude-code",
8
+ "project-manager",
9
+ "ai",
10
+ "agent",
11
+ "autonomous",
12
+ "coding-agent",
13
+ "claude-md",
14
+ "anthropic"
15
+ ],
16
+ "author": "Blox Labs",
17
+ "license": "MIT",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/mehrang0/claude-project-manager"
21
+ },
22
+ "type": "module",
23
+ "bin": {
24
+ "claude-project-manager": "./dist/cli.js"
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "scripts": {
30
+ "build": "tsc",
31
+ "dev": "tsc --watch",
32
+ "prepublishOnly": "npm run build"
33
+ },
34
+ "dependencies": {
35
+ "commander": "^13.1.0"
36
+ },
37
+ "devDependencies": {
38
+ "typescript": "^5.7.0",
39
+ "@types/node": "^22.0.0"
40
+ },
41
+ "engines": {
42
+ "node": ">=18.0.0"
43
+ }
44
+ }