legendai 0.1.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/LICENSE +21 -0
- package/README.md +169 -0
- package/dist/bin/legend.d.ts +3 -0
- package/dist/bin/legend.d.ts.map +1 -0
- package/dist/bin/legend.js +161 -0
- package/dist/bin/legend.js.map +1 -0
- package/dist/bin/postinstall.d.ts +8 -0
- package/dist/bin/postinstall.d.ts.map +1 -0
- package/dist/bin/postinstall.js +24 -0
- package/dist/bin/postinstall.js.map +1 -0
- package/dist/src/agents/prompts/analyzer.md +54 -0
- package/dist/src/agents/prompts/code-reviewer.md +72 -0
- package/dist/src/agents/prompts/developer.md +67 -0
- package/dist/src/agents/prompts/plan-reviewer.md +43 -0
- package/dist/src/agents/prompts/planner.md +58 -0
- package/dist/src/agents/prompts/revision.md +56 -0
- package/dist/src/agents/runner.d.ts +11 -0
- package/dist/src/agents/runner.d.ts.map +1 -0
- package/dist/src/agents/runner.js +229 -0
- package/dist/src/agents/runner.js.map +1 -0
- package/dist/src/cli/commands.d.ts +5 -0
- package/dist/src/cli/commands.d.ts.map +1 -0
- package/dist/src/cli/commands.js +78 -0
- package/dist/src/cli/commands.js.map +1 -0
- package/dist/src/cli/dashboard.d.ts +27 -0
- package/dist/src/cli/dashboard.d.ts.map +1 -0
- package/dist/src/cli/dashboard.js +114 -0
- package/dist/src/cli/dashboard.js.map +1 -0
- package/dist/src/cli/setup.d.ts +2 -0
- package/dist/src/cli/setup.d.ts.map +1 -0
- package/dist/src/cli/setup.js +406 -0
- package/dist/src/cli/setup.js.map +1 -0
- package/dist/src/config/schema.d.ts +73 -0
- package/dist/src/config/schema.d.ts.map +1 -0
- package/dist/src/config/schema.js +50 -0
- package/dist/src/config/schema.js.map +1 -0
- package/dist/src/config/store.d.ts +5 -0
- package/dist/src/config/store.d.ts.map +1 -0
- package/dist/src/config/store.js +28 -0
- package/dist/src/config/store.js.map +1 -0
- package/dist/src/integrations/gemini.d.ts +23 -0
- package/dist/src/integrations/gemini.d.ts.map +1 -0
- package/dist/src/integrations/gemini.js +127 -0
- package/dist/src/integrations/gemini.js.map +1 -0
- package/dist/src/integrations/github.d.ts +21 -0
- package/dist/src/integrations/github.d.ts.map +1 -0
- package/dist/src/integrations/github.js +109 -0
- package/dist/src/integrations/github.js.map +1 -0
- package/dist/src/integrations/linear.d.ts +28 -0
- package/dist/src/integrations/linear.d.ts.map +1 -0
- package/dist/src/integrations/linear.js +107 -0
- package/dist/src/integrations/linear.js.map +1 -0
- package/dist/src/integrations/slack.d.ts +28 -0
- package/dist/src/integrations/slack.d.ts.map +1 -0
- package/dist/src/integrations/slack.js +115 -0
- package/dist/src/integrations/slack.js.map +1 -0
- package/dist/src/pipeline/orchestrator.d.ts +3 -0
- package/dist/src/pipeline/orchestrator.d.ts.map +1 -0
- package/dist/src/pipeline/orchestrator.js +634 -0
- package/dist/src/pipeline/orchestrator.js.map +1 -0
- package/dist/src/pipeline/plan-parser.d.ts +16 -0
- package/dist/src/pipeline/plan-parser.d.ts.map +1 -0
- package/dist/src/pipeline/plan-parser.js +62 -0
- package/dist/src/pipeline/plan-parser.js.map +1 -0
- package/dist/src/pipeline/queue.d.ts +13 -0
- package/dist/src/pipeline/queue.d.ts.map +1 -0
- package/dist/src/pipeline/queue.js +36 -0
- package/dist/src/pipeline/queue.js.map +1 -0
- package/dist/src/pipeline/thread-map.d.ts +20 -0
- package/dist/src/pipeline/thread-map.d.ts.map +1 -0
- package/dist/src/pipeline/thread-map.js +63 -0
- package/dist/src/pipeline/thread-map.js.map +1 -0
- package/dist/src/pipeline/worktree.d.ts +10 -0
- package/dist/src/pipeline/worktree.d.ts.map +1 -0
- package/dist/src/pipeline/worktree.js +122 -0
- package/dist/src/pipeline/worktree.js.map +1 -0
- package/dist/src/utils/attachments.d.ts +24 -0
- package/dist/src/utils/attachments.d.ts.map +1 -0
- package/dist/src/utils/attachments.js +65 -0
- package/dist/src/utils/attachments.js.map +1 -0
- package/dist/src/utils/checks.d.ts +12 -0
- package/dist/src/utils/checks.d.ts.map +1 -0
- package/dist/src/utils/checks.js +83 -0
- package/dist/src/utils/checks.js.map +1 -0
- package/dist/src/utils/logger.d.ts +15 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/logger.js +67 -0
- package/dist/src/utils/logger.js.map +1 -0
- package/dist/src/utils/theme.d.ts +23 -0
- package/dist/src/utils/theme.d.ts.map +1 -0
- package/dist/src/utils/theme.js +41 -0
- package/dist/src/utils/theme.js.map +1 -0
- package/dist/src/workspace/discovery.d.ts +23 -0
- package/dist/src/workspace/discovery.d.ts.map +1 -0
- package/dist/src/workspace/discovery.js +126 -0
- package/dist/src/workspace/discovery.js.map +1 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Akash Munshi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# Legend
|
|
2
|
+
|
|
3
|
+
> Autonomous agent pipeline — type `legend` in any repo.
|
|
4
|
+
|
|
5
|
+
Legend watches a Slack channel for Linear issue links, then runs a 6-stage AI agent pipeline to analyze, plan, implement, review, and ship code — fully autonomously.
|
|
6
|
+
|
|
7
|
+
## How It Works
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
Slack message with Linear issue URL
|
|
11
|
+
↓
|
|
12
|
+
┌─────────┐
|
|
13
|
+
│ Analyze │ Read-only codebase scan
|
|
14
|
+
└────┬─────┘
|
|
15
|
+
↓
|
|
16
|
+
┌─────────┐
|
|
17
|
+
│ Plan │ Write implementation plan
|
|
18
|
+
└────┬─────┘
|
|
19
|
+
↓
|
|
20
|
+
┌──────────────┐
|
|
21
|
+
│ Review Plan │ Approve or revise (loops)
|
|
22
|
+
└────┬──────────┘
|
|
23
|
+
↓
|
|
24
|
+
┌─────────┐
|
|
25
|
+
│ Develop │ Implement in worktree, push PR
|
|
26
|
+
└────┬─────┘
|
|
27
|
+
↓
|
|
28
|
+
┌──────────────┐
|
|
29
|
+
│ Code Review │ Test + lint + review (loops)
|
|
30
|
+
└────┬──────────┘
|
|
31
|
+
↓
|
|
32
|
+
┌───────────┐
|
|
33
|
+
│ Close Out │ Reply in Slack, comment on Linear
|
|
34
|
+
└────────────┘
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Prerequisites
|
|
38
|
+
|
|
39
|
+
Legend requires the following tools installed and authenticated on your system:
|
|
40
|
+
|
|
41
|
+
| Tool | Install | Purpose |
|
|
42
|
+
|------|---------|---------|
|
|
43
|
+
| **Node.js ≥ 18** | [nodejs.org](https://nodejs.org/) | Runtime |
|
|
44
|
+
| **Claude Code CLI** | `npm install -g @anthropic-ai/claude-code` | AI agent engine |
|
|
45
|
+
| **GitHub CLI (`gh`)** | [cli.github.com](https://cli.github.com/) | PR creation & reviews |
|
|
46
|
+
| **Git** | Comes with most systems | Version control |
|
|
47
|
+
|
|
48
|
+
You also need:
|
|
49
|
+
- A **Slack workspace** with a bot token (Socket Mode)
|
|
50
|
+
- A **Linear** API key
|
|
51
|
+
- A **Gemini** API key (for plan review)
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm install -g legend-cli
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Or try it without installing:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npx legend-cli
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Quick Start
|
|
66
|
+
|
|
67
|
+
### 1. Set up in your project
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
cd your-project
|
|
71
|
+
legend setup
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The interactive wizard will walk you through connecting Slack, Linear, GitHub, and configuring your repos.
|
|
75
|
+
|
|
76
|
+
### 2. Start watching
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
legend
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Legend will watch your configured Slack channel. When someone posts a Linear issue link, the pipeline starts automatically.
|
|
83
|
+
|
|
84
|
+
### 3. That's it
|
|
85
|
+
|
|
86
|
+
Legend will:
|
|
87
|
+
- Analyze the codebase to understand context
|
|
88
|
+
- Write an implementation plan
|
|
89
|
+
- Self-review the plan (with configurable review cycles)
|
|
90
|
+
- Implement the changes in a separate git worktree
|
|
91
|
+
- Create a pull request
|
|
92
|
+
- Run tests, lint, and build — fixing issues automatically
|
|
93
|
+
- Submit a GitHub PR review
|
|
94
|
+
- Reply in Slack and comment on the Linear issue
|
|
95
|
+
|
|
96
|
+
## Commands
|
|
97
|
+
|
|
98
|
+
| Command | Description |
|
|
99
|
+
|---------|-------------|
|
|
100
|
+
| `legend` | Start the pipeline (watches Slack) |
|
|
101
|
+
| `legend setup` | Run the interactive setup wizard |
|
|
102
|
+
| `legend status` | Show current pipeline status |
|
|
103
|
+
| `legend runs` | List past pipeline runs |
|
|
104
|
+
| `legend config` | Display current configuration |
|
|
105
|
+
| `legend reset` | Clear config and re-setup |
|
|
106
|
+
|
|
107
|
+
### Flags
|
|
108
|
+
|
|
109
|
+
| Flag | Description |
|
|
110
|
+
|------|-------------|
|
|
111
|
+
| `--verbose` | Show full Claude Code turn-by-turn output |
|
|
112
|
+
| `--quiet` | Suppress all logs except errors and the dashboard |
|
|
113
|
+
|
|
114
|
+
## Configuration
|
|
115
|
+
|
|
116
|
+
Config is stored in `.legend/config.json` (gitignored) in your project root. It includes:
|
|
117
|
+
|
|
118
|
+
- **Workspace** — project name
|
|
119
|
+
- **Repos** — one or more repos with base branch, test/build/lint commands
|
|
120
|
+
- **Linear** — API key, team ID
|
|
121
|
+
- **Slack** — bot token, app token, channel
|
|
122
|
+
- **GitHub** — authenticated user
|
|
123
|
+
- **Gemini** — API key for plan review
|
|
124
|
+
- **Claude** — model selection
|
|
125
|
+
- **Pipeline** — max review cycles, concurrency
|
|
126
|
+
|
|
127
|
+
## Multi-Repo Support
|
|
128
|
+
|
|
129
|
+
Legend supports mono-repos and multi-repo workspaces. During setup, it auto-discovers git repos in your working directory and lets you configure each one independently.
|
|
130
|
+
|
|
131
|
+
## Architecture
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
bin/legend.ts — CLI entry point (Commander)
|
|
135
|
+
src/cli/ — Setup wizard, dashboard, sub-commands
|
|
136
|
+
src/config/ — Config schema and store
|
|
137
|
+
src/agents/runner.ts — Claude Code subprocess invocation
|
|
138
|
+
src/agents/prompts/*.md — Per-stage prompt templates
|
|
139
|
+
src/pipeline/ — Orchestrator state machine, worktree, queue
|
|
140
|
+
src/integrations/ — Slack, Linear, GitHub API clients
|
|
141
|
+
src/utils/ — Logger, pre-flight checks, theme
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Pipeline Artifacts
|
|
145
|
+
|
|
146
|
+
Each run persists artifacts to `.legend/runs/<ISSUE-ID>/`:
|
|
147
|
+
- `analysis.md` — codebase analysis
|
|
148
|
+
- `plan.md` — implementation plan
|
|
149
|
+
- `review.md` — plan review feedback
|
|
150
|
+
- `code-review.md` — code review feedback
|
|
151
|
+
|
|
152
|
+
## Development
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
git clone https://github.com/akashmunshi/legend-cli.git
|
|
156
|
+
cd legend-cli
|
|
157
|
+
npm install
|
|
158
|
+
npm run dev # Run with tsx (no compile step)
|
|
159
|
+
npm run build # Compile to dist/
|
|
160
|
+
npm link # Make `legend` available globally for testing
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## License
|
|
164
|
+
|
|
165
|
+
MIT — see [LICENSE](LICENSE).
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
Built by [Akash Munshi](mailto:akash@trysudosu.com)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../bin/legend.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import ora from "ora";
|
|
7
|
+
import { runPreflightChecks } from "../src/utils/checks.js";
|
|
8
|
+
import { configExists, loadConfig } from "../src/config/store.js";
|
|
9
|
+
import { runSetupWizard } from "../src/cli/setup.js";
|
|
10
|
+
import { startPipeline } from "../src/pipeline/orchestrator.js";
|
|
11
|
+
import { log } from "../src/utils/logger.js";
|
|
12
|
+
import { t } from "../src/utils/theme.js";
|
|
13
|
+
import { showStatus, listRuns, showConfig, resetConfig } from "../src/cli/commands.js";
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = path.dirname(__filename);
|
|
16
|
+
// Works from both bin/ (dev) and dist/bin/ (compiled)
|
|
17
|
+
function findPkg() {
|
|
18
|
+
for (const rel of ["..", "../.."]) {
|
|
19
|
+
try {
|
|
20
|
+
return JSON.parse(readFileSync(path.join(__dirname, rel, "package.json"), "utf-8"));
|
|
21
|
+
}
|
|
22
|
+
catch { }
|
|
23
|
+
}
|
|
24
|
+
throw new Error("package.json not found");
|
|
25
|
+
}
|
|
26
|
+
const pkg = findPkg();
|
|
27
|
+
const BANNER = `
|
|
28
|
+
█████ ██████████ █████████ ██████████ ██████ █████ ██████████
|
|
29
|
+
░░███ ░░███░░░░░█ ███░░░░░███░░███░░░░░█░░██████ ░░███ ░░███░░░░███
|
|
30
|
+
░███ ░███ █ ░ ███ ░░░ ░███ █ ░ ░███░███ ░███ ░███ ░░███
|
|
31
|
+
░███ ░██████ ░███ ░██████ ░███░░███░███ ░███ ░███
|
|
32
|
+
░███ ░███░░█ ░███ █████ ░███░░█ ░███ ░░██████ ░███ ░███
|
|
33
|
+
░███ █ ░███ ░ █░░███ ░░███ ░███ ░ █ ░███ ░░█████ ░███ ███
|
|
34
|
+
███████████ ██████████ ░░█████████ ██████████ █████ ░░█████ ██████████
|
|
35
|
+
░░░░░░░░░░░ ░░░░░░░░░░ ░░░░░░░░░ ░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░░░░░░
|
|
36
|
+
`;
|
|
37
|
+
function printBanner(config) {
|
|
38
|
+
// ASCII art in brand yellow
|
|
39
|
+
for (const line of BANNER.split("\n")) {
|
|
40
|
+
if (line.trim())
|
|
41
|
+
console.log(t.brand(line));
|
|
42
|
+
}
|
|
43
|
+
console.log(t.dim(`${" ".repeat(72)}v${pkg.version}`));
|
|
44
|
+
console.log();
|
|
45
|
+
console.log(t.fg(" Autonomous Agent Pipeline"));
|
|
46
|
+
console.log(t.dim(" Built by Akash · akash@trysudosu.com"));
|
|
47
|
+
console.log();
|
|
48
|
+
if (config) {
|
|
49
|
+
const repoNames = config.repos.map(r => r.name).join(", ");
|
|
50
|
+
const rows = [
|
|
51
|
+
["Project", config.workspace.name],
|
|
52
|
+
["Repos", repoNames],
|
|
53
|
+
["Channel", `#${config.slack.channelName}`],
|
|
54
|
+
["Model", config.claude.model],
|
|
55
|
+
];
|
|
56
|
+
for (const [key, value] of rows) {
|
|
57
|
+
console.log(` ${t.dim(key.padEnd(10))}${t.green(value)}`);
|
|
58
|
+
}
|
|
59
|
+
console.log();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function printPreflightResults(checks) {
|
|
63
|
+
if (!checks.passed) {
|
|
64
|
+
console.log(` ${t.error("✖ Preflight failed")}`);
|
|
65
|
+
console.log();
|
|
66
|
+
// Show failures
|
|
67
|
+
const failures = Object.entries(checks.details).filter(([, v]) => !v.found);
|
|
68
|
+
if (failures.length > 0) {
|
|
69
|
+
console.log(t.dim(" Missing:"));
|
|
70
|
+
for (const msg of checks.missing) {
|
|
71
|
+
// Split "X not found. Install via: Y" into name and instruction
|
|
72
|
+
const dotIdx = msg.indexOf(".");
|
|
73
|
+
const name = dotIdx >= 0 ? msg.slice(0, dotIdx) : msg;
|
|
74
|
+
const instruction = dotIdx >= 0 ? msg.slice(dotIdx + 1).trim() : "";
|
|
75
|
+
console.log(` ${t.red("•")} ${name}${instruction ? t.dim(` — ${instruction}`) : ""}`);
|
|
76
|
+
}
|
|
77
|
+
console.log();
|
|
78
|
+
}
|
|
79
|
+
// Show successes
|
|
80
|
+
const successes = Object.entries(checks.details).filter(([, v]) => v.found);
|
|
81
|
+
if (successes.length > 0) {
|
|
82
|
+
console.log(t.dim(" Found:"));
|
|
83
|
+
for (const [name, detail] of successes) {
|
|
84
|
+
const version = detail.version ? ` ${detail.version}` : "";
|
|
85
|
+
console.log(` ${t.success("✓")} ${name}${t.dim(version)}`);
|
|
86
|
+
}
|
|
87
|
+
console.log();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const program = new Command();
|
|
92
|
+
program
|
|
93
|
+
.name("legend")
|
|
94
|
+
.description("Autonomous agent pipeline for your codebase")
|
|
95
|
+
.version(pkg.version);
|
|
96
|
+
// Default command — just `legend`
|
|
97
|
+
program
|
|
98
|
+
.option("--verbose", "Show full Claude Code turn-by-turn output")
|
|
99
|
+
.option("--quiet", "Suppress all logs except errors and the dashboard")
|
|
100
|
+
.action(async (options) => {
|
|
101
|
+
const checks = await runPreflightChecks();
|
|
102
|
+
const repoRoot = process.cwd();
|
|
103
|
+
const hasConfig = configExists(repoRoot);
|
|
104
|
+
// Print banner (with config info if available)
|
|
105
|
+
if (hasConfig) {
|
|
106
|
+
const config = loadConfig(repoRoot);
|
|
107
|
+
printBanner(config);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
printBanner();
|
|
111
|
+
}
|
|
112
|
+
if (!checks.passed) {
|
|
113
|
+
printPreflightResults(checks);
|
|
114
|
+
process.exit(1);
|
|
115
|
+
}
|
|
116
|
+
if (!hasConfig) {
|
|
117
|
+
console.log(t.dim(" First time here? Let's set you up.\n"));
|
|
118
|
+
await runSetupWizard(repoRoot);
|
|
119
|
+
}
|
|
120
|
+
const config = loadConfig(repoRoot);
|
|
121
|
+
log.init(repoRoot);
|
|
122
|
+
log.verbose = !!options.verbose;
|
|
123
|
+
log.quiet = !!options.quiet;
|
|
124
|
+
// Show idle spinner while watching
|
|
125
|
+
const spinner = ora({
|
|
126
|
+
text: t.dim(`Watching #${config.slack.channelName} for Linear issues...`),
|
|
127
|
+
prefixText: " ",
|
|
128
|
+
color: "yellow",
|
|
129
|
+
}).start();
|
|
130
|
+
try {
|
|
131
|
+
await startPipeline(config, repoRoot, !!options.verbose);
|
|
132
|
+
}
|
|
133
|
+
finally {
|
|
134
|
+
spinner.stop();
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
program
|
|
138
|
+
.command("setup")
|
|
139
|
+
.description("Re-run the setup wizard")
|
|
140
|
+
.action(async () => {
|
|
141
|
+
printBanner();
|
|
142
|
+
await runSetupWizard(process.cwd());
|
|
143
|
+
});
|
|
144
|
+
program
|
|
145
|
+
.command("status")
|
|
146
|
+
.description("Show current pipeline status")
|
|
147
|
+
.action(() => showStatus(process.cwd()));
|
|
148
|
+
program
|
|
149
|
+
.command("runs")
|
|
150
|
+
.description("List past pipeline runs")
|
|
151
|
+
.action(() => listRuns(process.cwd()));
|
|
152
|
+
program
|
|
153
|
+
.command("config")
|
|
154
|
+
.description("Show current config")
|
|
155
|
+
.action(() => showConfig(process.cwd()));
|
|
156
|
+
program
|
|
157
|
+
.command("reset")
|
|
158
|
+
.description("Clear config and re-setup")
|
|
159
|
+
.action(async () => resetConfig(process.cwd()));
|
|
160
|
+
program.parse();
|
|
161
|
+
//# sourceMappingURL=legend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legend.js","sourceRoot":"","sources":["../../bin/legend.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,uBAAuB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,QAAQ,EA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MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAEzC,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,qBAAqB,CAAC;KAClC,MAAM,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAE3C,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,2BAA2B,CAAC;KACxC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAElD,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Post-install message — printed after `npm install -g legend-cli`.
|
|
4
|
+
* This is a courtesy message, not a hard gate. The real preflight
|
|
5
|
+
* check happens when the user runs `legend` or `legend setup`.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=postinstall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../../bin/postinstall.ts"],"names":[],"mappings":";AAEA;;;;GAIG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Post-install message — printed after `npm install -g legend-cli`.
|
|
4
|
+
* This is a courtesy message, not a hard gate. The real preflight
|
|
5
|
+
* check happens when the user runs `legend` or `legend setup`.
|
|
6
|
+
*/
|
|
7
|
+
const RESET = "\x1b[0m";
|
|
8
|
+
const BOLD = "\x1b[1m";
|
|
9
|
+
const DIM = "\x1b[2m";
|
|
10
|
+
const YELLOW = "\x1b[33m";
|
|
11
|
+
const GREEN = "\x1b[32m";
|
|
12
|
+
const CYAN = "\x1b[36m";
|
|
13
|
+
console.log();
|
|
14
|
+
console.log(` ${YELLOW}${BOLD}Legend${RESET} installed successfully.`);
|
|
15
|
+
console.log();
|
|
16
|
+
console.log(` ${DIM}Before running, make sure you have:${RESET}`);
|
|
17
|
+
console.log(` ${GREEN}•${RESET} Claude Code CLI ${DIM}— npm i -g @anthropic-ai/claude-code${RESET}`);
|
|
18
|
+
console.log(` ${GREEN}•${RESET} GitHub CLI (gh) ${DIM}— https://cli.github.com/${RESET}`);
|
|
19
|
+
console.log(` ${GREEN}•${RESET} Node.js ≥ 18 ${DIM}— https://nodejs.org/${RESET}`);
|
|
20
|
+
console.log();
|
|
21
|
+
console.log(` ${CYAN}Get started:${RESET} cd your-project && legend setup`);
|
|
22
|
+
console.log();
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=postinstall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../../bin/postinstall.ts"],"names":[],"mappings":";AAEA;;;;GAIG;AAEH,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,IAAI,GAAG,SAAS,CAAC;AACvB,MAAM,GAAG,GAAG,SAAS,CAAC;AACtB,MAAM,MAAM,GAAG,UAAU,CAAC;AAC1B,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB,OAAO,CAAC,GAAG,EAAE,CAAC;AACd,OAAO,CAAC,GAAG,CAAC,KAAK,MAAM,GAAG,IAAI,SAAS,KAAK,0BAA0B,CAAC,CAAC;AACxE,OAAO,CAAC,GAAG,EAAE,CAAC;AACd,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,sCAAsC,KAAK,EAAE,CAAC,CAAC;AACnE,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,IAAI,KAAK,qBAAqB,GAAG,uCAAuC,KAAK,EAAE,CAAC,CAAC;AACzG,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,IAAI,KAAK,sBAAsB,GAAG,4BAA4B,KAAK,EAAE,CAAC,CAAC;AAC/F,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,IAAI,KAAK,sBAAsB,GAAG,wBAAwB,KAAK,EAAE,CAAC,CAAC;AAC3F,OAAO,CAAC,GAAG,EAAE,CAAC;AACd,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,eAAe,KAAK,mCAAmC,CAAC,CAAC;AAC9E,OAAO,CAAC,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Codebase Analyzer
|
|
2
|
+
|
|
3
|
+
You are a codebase analyst. Your job is to analyze the repository to understand how to implement the given Linear issue.
|
|
4
|
+
|
|
5
|
+
## Issue
|
|
6
|
+
- **ID**: {{issueId}}
|
|
7
|
+
- **Title**: {{issueTitle}}
|
|
8
|
+
- **Description**: {{issueDescription}}
|
|
9
|
+
- **Labels**: {{issueLabels}}
|
|
10
|
+
|
|
11
|
+
## Workspace Repositories
|
|
12
|
+
|
|
13
|
+
{{repoList}}
|
|
14
|
+
|
|
15
|
+
## Image Descriptions
|
|
16
|
+
|
|
17
|
+
The following images were found in the issue and analyzed:
|
|
18
|
+
|
|
19
|
+
{{imageDescriptions}}
|
|
20
|
+
|
|
21
|
+
## File Attachments
|
|
22
|
+
|
|
23
|
+
{{attachmentPaths}}
|
|
24
|
+
|
|
25
|
+
## Instructions
|
|
26
|
+
|
|
27
|
+
1. Explore the codebase structure to understand the project layout, tech stack, and patterns
|
|
28
|
+
2. If multiple repositories are listed above, explore each to understand how they relate to the issue
|
|
29
|
+
3. Identify the files and modules most relevant to this issue
|
|
30
|
+
4. Understand existing patterns, naming conventions, and architectural decisions
|
|
31
|
+
5. Identify dependencies and potential risks for implementing this issue
|
|
32
|
+
6. Determine the issue type (UI, API, infrastructure, refactoring, bug fix, etc.)
|
|
33
|
+
|
|
34
|
+
## Output
|
|
35
|
+
|
|
36
|
+
Respond with your analysis containing these sections:
|
|
37
|
+
|
|
38
|
+
- **Summary**: One-paragraph overview of what needs to be done
|
|
39
|
+
- **Issue Type**: UI / API / Infrastructure / Refactoring / Bug Fix
|
|
40
|
+
- **Target Repos**: Which repository/repositories need changes and why (list each by name)
|
|
41
|
+
- **Relevant Files**: List of files that will need to be read or modified, with brief explanation of each
|
|
42
|
+
- **Existing Patterns**: Key patterns in the codebase that the implementation should follow
|
|
43
|
+
- **Dependencies**: External or internal dependencies that affect this work
|
|
44
|
+
- **Risks**: Potential issues or edge cases to watch for
|
|
45
|
+
- **Estimated Complexity**: Low / Medium / High with brief justification
|
|
46
|
+
|
|
47
|
+
Do NOT make any code changes. You are read-only.
|
|
48
|
+
|
|
49
|
+
## Constraints
|
|
50
|
+
|
|
51
|
+
- Your text response IS the output. The pipeline saves it automatically. Do NOT create or write files.
|
|
52
|
+
- Do NOT read, glob, or reference anything inside `.claude/`, `.legend/`, or `node_modules/` directories.
|
|
53
|
+
- Only analyze issue **{{issueId}}**. Ignore any other issue IDs you encounter in the codebase.
|
|
54
|
+
- Focus only on the project source code.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Code Reviewer & Tester
|
|
2
|
+
|
|
3
|
+
You are a code reviewer and test runner. Your job is to review the PR changes and run tests to verify correctness.
|
|
4
|
+
|
|
5
|
+
## Issue
|
|
6
|
+
- **ID**: {{issueId}}
|
|
7
|
+
- **Title**: {{issueTitle}}
|
|
8
|
+
|
|
9
|
+
## Repository
|
|
10
|
+
|
|
11
|
+
You are reviewing the **{{repoName}}** repository.
|
|
12
|
+
|
|
13
|
+
## Implementation Plan
|
|
14
|
+
|
|
15
|
+
{{planContent}}
|
|
16
|
+
|
|
17
|
+
## PR URL
|
|
18
|
+
|
|
19
|
+
{{prUrl}}
|
|
20
|
+
|
|
21
|
+
## Commands
|
|
22
|
+
- **Test**: `{{testCommand}}`
|
|
23
|
+
- **Build**: `{{buildCommand}}`
|
|
24
|
+
- **Lint**: `{{lintCommand}}`
|
|
25
|
+
|
|
26
|
+
## Instructions
|
|
27
|
+
|
|
28
|
+
### Step 1: Run Tests & Build
|
|
29
|
+
|
|
30
|
+
1. Run the test command: `{{testCommand}}`
|
|
31
|
+
2. Run the build command: `{{buildCommand}}`
|
|
32
|
+
3. Run the lint command (if configured): `{{lintCommand}}`
|
|
33
|
+
4. Capture all output — note any failures, warnings, or errors
|
|
34
|
+
|
|
35
|
+
### Step 2: Review the Code
|
|
36
|
+
|
|
37
|
+
1. Get the PR diff: `gh pr diff {{prUrl}}`
|
|
38
|
+
2. Review every changed file against the implementation plan
|
|
39
|
+
3. Check for:
|
|
40
|
+
- **Correctness**: Does the code do what the plan says?
|
|
41
|
+
- **Edge cases**: Are error conditions handled?
|
|
42
|
+
- **Code quality**: Is it consistent with existing patterns?
|
|
43
|
+
- **Test coverage**: Are the changes adequately tested?
|
|
44
|
+
- **Scope**: Are there any unrelated changes?
|
|
45
|
+
- **Security**: Are there any obvious security issues?
|
|
46
|
+
|
|
47
|
+
### Step 3: Submit Review
|
|
48
|
+
|
|
49
|
+
Based on your findings, submit a review on the PR:
|
|
50
|
+
|
|
51
|
+
- If tests pass AND code looks good:
|
|
52
|
+
`gh pr review {{prUrl}} --approve --body "<summary of review>"`
|
|
53
|
+
|
|
54
|
+
- If tests fail OR code needs changes:
|
|
55
|
+
`gh pr review {{prUrl}} --request-changes --body "<detailed feedback>"`
|
|
56
|
+
|
|
57
|
+
### Step 4: Save Review Locally
|
|
58
|
+
|
|
59
|
+
Respond with your full review containing:
|
|
60
|
+
|
|
61
|
+
- **Verdict**: `APPROVED` or `CHANGES_REQUESTED` (first line)
|
|
62
|
+
- **Test Results**: Pass/fail summary with relevant output
|
|
63
|
+
- **Build Results**: Pass/fail
|
|
64
|
+
- **Lint Results**: Pass/fail (if applicable)
|
|
65
|
+
- **Code Review**: Detailed feedback on the changes
|
|
66
|
+
- **Action Items** (if CHANGES_REQUESTED): Numbered list of specific things to fix
|
|
67
|
+
|
|
68
|
+
## Constraints
|
|
69
|
+
|
|
70
|
+
- Your text response IS the output. The pipeline saves it automatically.
|
|
71
|
+
- Do NOT read, glob, or reference anything inside `.claude/`, `.legend/`, or `node_modules/` directories.
|
|
72
|
+
- Only review changes for issue **{{issueId}}**. Ignore any other issue IDs you encounter in the codebase.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Developer
|
|
2
|
+
|
|
3
|
+
You are a developer agent. Your job is to implement code changes according to the plan.
|
|
4
|
+
|
|
5
|
+
## Issue
|
|
6
|
+
- **ID**: {{issueId}}
|
|
7
|
+
- **Title**: {{issueTitle}}
|
|
8
|
+
|
|
9
|
+
## Repository
|
|
10
|
+
|
|
11
|
+
You are working in the **{{repoName}}** repository.
|
|
12
|
+
|
|
13
|
+
## Implementation Plan
|
|
14
|
+
|
|
15
|
+
{{planContent}}
|
|
16
|
+
|
|
17
|
+
## Working Directory
|
|
18
|
+
|
|
19
|
+
You are working in a git worktree at: `{{worktreePath}}`
|
|
20
|
+
Branch: `{{branchName}}`
|
|
21
|
+
|
|
22
|
+
## Build & Lint Commands
|
|
23
|
+
- **Build**: `{{buildCommand}}`
|
|
24
|
+
- **Lint**: `{{lintCommand}}`
|
|
25
|
+
|
|
26
|
+
## Image Descriptions
|
|
27
|
+
|
|
28
|
+
The following images were found in the issue and analyzed:
|
|
29
|
+
|
|
30
|
+
{{imageDescriptions}}
|
|
31
|
+
|
|
32
|
+
## File Attachments
|
|
33
|
+
|
|
34
|
+
The following files were downloaded from the issue. You can read and process these files directly.
|
|
35
|
+
|
|
36
|
+
{{attachmentPaths}}
|
|
37
|
+
|
|
38
|
+
## Instructions
|
|
39
|
+
|
|
40
|
+
1. Follow the implementation plan step by step
|
|
41
|
+
2. Implement all changes as specified
|
|
42
|
+
3. Run the build command to verify compilation
|
|
43
|
+
4. Run the lint command (if configured) to verify code style
|
|
44
|
+
5. Commit your changes with a descriptive message: `feat({{issueId}}): <description>`
|
|
45
|
+
6. Push the branch: `git push origin {{branchName}}`
|
|
46
|
+
|
|
47
|
+
{{#if reviewFeedback}}
|
|
48
|
+
## Review Feedback to Address
|
|
49
|
+
|
|
50
|
+
{{reviewFeedback}}
|
|
51
|
+
|
|
52
|
+
Address each piece of feedback. Make the requested changes, then commit and push.
|
|
53
|
+
{{/if}}
|
|
54
|
+
|
|
55
|
+
## Rules
|
|
56
|
+
|
|
57
|
+
- Follow existing code patterns and conventions in the repository
|
|
58
|
+
- Do not make changes outside the scope of the plan
|
|
59
|
+
- Write clean, well-structured code
|
|
60
|
+
- If the build fails, fix the errors before committing
|
|
61
|
+
- Each commit should be atomic and well-described
|
|
62
|
+
|
|
63
|
+
## Constraints
|
|
64
|
+
|
|
65
|
+
- Do NOT read, glob, or reference anything inside `.claude/`, `.legend/`, or `node_modules/` directories.
|
|
66
|
+
- Only implement changes for issue **{{issueId}}**. Ignore any other issue IDs you encounter in the codebase.
|
|
67
|
+
- Do NOT create files in `.claude/` — all your work goes in the source code as specified by the plan.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Plan Reviewer
|
|
2
|
+
|
|
3
|
+
You are a plan reviewer. Your job is to critically evaluate the implementation plan against the issue requirements and the actual codebase.
|
|
4
|
+
|
|
5
|
+
## Issue
|
|
6
|
+
- **ID**: {{issueId}}
|
|
7
|
+
- **Title**: {{issueTitle}}
|
|
8
|
+
|
|
9
|
+
## Analysis
|
|
10
|
+
|
|
11
|
+
{{analysisContent}}
|
|
12
|
+
|
|
13
|
+
## Instructions
|
|
14
|
+
|
|
15
|
+
1. Read the implementation plan from `{{planPath}}`
|
|
16
|
+
2. Validate the plan against the codebase — verify that:
|
|
17
|
+
- Referenced files actually exist (or are correctly marked as new)
|
|
18
|
+
- Function signatures and APIs mentioned in the plan match reality
|
|
19
|
+
- The approach is consistent with existing codebase patterns
|
|
20
|
+
3. Check for completeness:
|
|
21
|
+
- All requirements from the issue are addressed
|
|
22
|
+
- Edge cases are considered
|
|
23
|
+
- Test strategy is adequate
|
|
24
|
+
4. Check for risks:
|
|
25
|
+
- Are there unnecessary changes that could break existing functionality?
|
|
26
|
+
- Is the scope appropriate (not too broad, not too narrow)?
|
|
27
|
+
|
|
28
|
+
## Output
|
|
29
|
+
|
|
30
|
+
Respond with your review containing:
|
|
31
|
+
|
|
32
|
+
- **Verdict**: `APPROVED` or `CHANGES_REQUESTED` (must be the first line)
|
|
33
|
+
- **Summary**: Overall assessment (2-3 sentences)
|
|
34
|
+
- **Issues Found** (if CHANGES_REQUESTED): Numbered list of specific problems
|
|
35
|
+
- **Suggestions**: Optional improvements that aren't blocking
|
|
36
|
+
|
|
37
|
+
If the plan is solid and addresses the requirements correctly, approve it. Only request changes for real problems — missing requirements, incorrect file references, or approaches that would break existing functionality.
|
|
38
|
+
|
|
39
|
+
## Constraints
|
|
40
|
+
|
|
41
|
+
- Your text response IS the output. The pipeline saves it automatically. Do NOT create or write files.
|
|
42
|
+
- Do NOT read, glob, or reference anything inside `.claude/`, `.legend/`, or `node_modules/` directories (except the plan file at `{{planPath}}`).
|
|
43
|
+
- Only review the plan for issue **{{issueId}}**. Ignore any other issue IDs you encounter in the codebase.
|