@aion0/forge 0.3.4 → 0.3.6
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/CLAUDE.md +15 -0
- package/app/api/favorites/route.ts +26 -0
- package/app/api/git/route.ts +40 -35
- package/app/api/help/route.ts +78 -0
- package/app/api/skills/route.ts +0 -2
- package/app/api/tabs/route.ts +25 -0
- package/bin/forge-server.mjs +1 -1
- package/components/Dashboard.tsx +16 -0
- package/components/DocsViewer.tsx +160 -3
- package/components/HelpDialog.tsx +169 -0
- package/components/HelpTerminal.tsx +130 -0
- package/components/ProjectDetail.tsx +1115 -0
- package/components/ProjectManager.tsx +189 -1105
- package/components/TabBar.tsx +46 -0
- package/lib/help-docs/00-overview.md +34 -0
- package/lib/help-docs/01-settings.md +37 -0
- package/lib/help-docs/02-telegram.md +41 -0
- package/lib/help-docs/03-tunnel.md +31 -0
- package/lib/help-docs/04-tasks.md +52 -0
- package/lib/help-docs/05-pipelines.md +73 -0
- package/lib/help-docs/06-skills.md +43 -0
- package/lib/help-docs/07-projects.md +39 -0
- package/lib/help-docs/08-rules.md +53 -0
- package/lib/help-docs/09-issue-autofix.md +51 -0
- package/lib/help-docs/10-troubleshooting.md +82 -0
- package/lib/settings.ts +2 -0
- package/next-env.d.ts +1 -1
- package/package.json +1 -1
- package/src/core/db/database.ts +12 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
export interface Tab {
|
|
6
|
+
id: number;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface TabBarProps {
|
|
11
|
+
tabs: Tab[];
|
|
12
|
+
activeId: number;
|
|
13
|
+
onActivate: (id: number) => void;
|
|
14
|
+
onClose: (id: number) => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default function TabBar({ tabs, activeId, onActivate, onClose }: TabBarProps) {
|
|
18
|
+
if (tabs.length === 0) return null;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div className="flex items-center border-b border-[var(--border)] bg-[var(--bg-tertiary)] overflow-x-auto shrink-0">
|
|
22
|
+
{tabs.map(tab => (
|
|
23
|
+
<div
|
|
24
|
+
key={tab.id}
|
|
25
|
+
className={`flex items-center gap-1 px-3 py-1.5 text-[11px] cursor-pointer border-r border-[var(--border)]/30 shrink-0 group ${
|
|
26
|
+
tab.id === activeId
|
|
27
|
+
? 'bg-[var(--bg-primary)] text-[var(--text-primary)] border-b-2 border-b-[var(--accent)]'
|
|
28
|
+
: 'text-[var(--text-secondary)] hover:bg-[var(--bg-secondary)] hover:text-[var(--text-primary)]'
|
|
29
|
+
}`}
|
|
30
|
+
onClick={() => onActivate(tab.id)}
|
|
31
|
+
>
|
|
32
|
+
<span className="truncate max-w-[120px]">{tab.label}</span>
|
|
33
|
+
<button
|
|
34
|
+
onClick={(e) => {
|
|
35
|
+
e.stopPropagation();
|
|
36
|
+
onClose(tab.id);
|
|
37
|
+
}}
|
|
38
|
+
className="text-[9px] w-4 h-4 flex items-center justify-center rounded hover:bg-[var(--bg-tertiary)] text-[var(--text-secondary)] hover:text-[var(--text-primary)] opacity-0 group-hover:opacity-100 shrink-0"
|
|
39
|
+
>
|
|
40
|
+
x
|
|
41
|
+
</button>
|
|
42
|
+
</div>
|
|
43
|
+
))}
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Forge Overview
|
|
2
|
+
|
|
3
|
+
Forge is a self-hosted Vibe Coding platform for Claude Code. It provides a browser-based terminal, AI task orchestration, remote access, and mobile control via Telegram.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @aion0/forge
|
|
9
|
+
forge server start
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Open `http://localhost:3000`. First launch prompts you to set an admin password.
|
|
13
|
+
|
|
14
|
+
## Requirements
|
|
15
|
+
- Node.js >= 20
|
|
16
|
+
- tmux (`brew install tmux` on macOS)
|
|
17
|
+
- Claude Code CLI (`npm install -g @anthropic-ai/claude-code`)
|
|
18
|
+
|
|
19
|
+
## Data Location
|
|
20
|
+
- Config: `~/.forge/` (binaries)
|
|
21
|
+
- Data: `~/.forge/data/` (settings, database, state)
|
|
22
|
+
- Claude: `~/.claude/` (skills, commands, sessions)
|
|
23
|
+
|
|
24
|
+
## Server Commands
|
|
25
|
+
```bash
|
|
26
|
+
forge server start # background (default)
|
|
27
|
+
forge server start --foreground # foreground
|
|
28
|
+
forge server start --dev # dev mode with hot-reload
|
|
29
|
+
forge server stop # stop
|
|
30
|
+
forge server restart # restart
|
|
31
|
+
forge server start --port 4000 # custom port
|
|
32
|
+
forge server start --dir ~/.forge-test # custom data dir
|
|
33
|
+
forge --reset-password # reset admin password
|
|
34
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Settings Configuration
|
|
2
|
+
|
|
3
|
+
Settings are stored in `~/.forge/data/settings.yaml`. Configure via the web UI (Settings button in top-right menu) or edit YAML directly.
|
|
4
|
+
|
|
5
|
+
## All Settings Fields
|
|
6
|
+
|
|
7
|
+
| Field | Type | Default | Description |
|
|
8
|
+
|-------|------|---------|-------------|
|
|
9
|
+
| `projectRoots` | string[] | `[]` | Directories containing your projects (e.g. `~/Projects`) |
|
|
10
|
+
| `docRoots` | string[] | `[]` | Markdown/Obsidian vault directories |
|
|
11
|
+
| `claudePath` | string | `""` | Path to claude binary (auto-detected if empty) |
|
|
12
|
+
| `claudeHome` | string | `""` | Claude Code home directory (default: `~/.claude`) |
|
|
13
|
+
| `telegramBotToken` | string | `""` | Telegram Bot API token (encrypted) |
|
|
14
|
+
| `telegramChatId` | string | `""` | Telegram chat ID (comma-separated for multiple users) |
|
|
15
|
+
| `notifyOnComplete` | boolean | `true` | Telegram notification on task completion |
|
|
16
|
+
| `notifyOnFailure` | boolean | `true` | Telegram notification on task failure |
|
|
17
|
+
| `tunnelAutoStart` | boolean | `false` | Auto-start Cloudflare Tunnel on server startup |
|
|
18
|
+
| `telegramTunnelPassword` | string | `""` | Admin password for login + tunnel + secrets (encrypted) |
|
|
19
|
+
| `taskModel` | string | `"default"` | Model for background tasks |
|
|
20
|
+
| `pipelineModel` | string | `"default"` | Model for pipeline workflows |
|
|
21
|
+
| `telegramModel` | string | `"sonnet"` | Model for Telegram AI features |
|
|
22
|
+
| `skipPermissions` | boolean | `false` | Add `--dangerously-skip-permissions` to claude invocations |
|
|
23
|
+
| `notificationRetentionDays` | number | `30` | Auto-cleanup notifications older than N days |
|
|
24
|
+
| `skillsRepoUrl` | string | forge-skills URL | GitHub raw URL for skills registry |
|
|
25
|
+
| `displayName` | string | `"Forge"` | Display name shown in header |
|
|
26
|
+
| `displayEmail` | string | `""` | User email |
|
|
27
|
+
|
|
28
|
+
## Admin Password
|
|
29
|
+
|
|
30
|
+
- Set on first launch (CLI prompt)
|
|
31
|
+
- Required for: login, tunnel start, secret changes, Telegram commands
|
|
32
|
+
- Reset: `forge --reset-password`
|
|
33
|
+
- Forgot? Run `forge --reset-password` in terminal
|
|
34
|
+
|
|
35
|
+
## Encrypted Fields
|
|
36
|
+
|
|
37
|
+
`telegramBotToken` and `telegramTunnelPassword` are encrypted with AES-256-GCM. The encryption key is stored at `~/.forge/data/.encrypt-key`.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Telegram Bot Setup
|
|
2
|
+
|
|
3
|
+
## Setup Steps
|
|
4
|
+
|
|
5
|
+
1. Open Telegram, search for [@BotFather](https://t.me/botfather)
|
|
6
|
+
2. Send `/newbot`, follow prompts to create a bot
|
|
7
|
+
3. Copy the bot token (looks like `6234567890:ABCDefGHIJKLMNOPQRSTUVWXYZ`)
|
|
8
|
+
4. In Forge Settings, paste the token into **Telegram Bot Token**
|
|
9
|
+
5. To get your Chat ID: send any message to your bot, then visit `https://api.telegram.org/bot<TOKEN>/getUpdates` — find `chat.id` in the response
|
|
10
|
+
6. Paste the Chat ID into **Telegram Chat ID** in Settings
|
|
11
|
+
7. The bot starts automatically after saving
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
| Command | Description |
|
|
16
|
+
|---------|-------------|
|
|
17
|
+
| `/task <project> <prompt>` | Create a background task |
|
|
18
|
+
| `/tasks [status]` | List tasks (running/queued/done/failed) |
|
|
19
|
+
| `/sessions [project]` | AI summary of Claude Code sessions |
|
|
20
|
+
| `/watch <id>` | Live stream task output |
|
|
21
|
+
| `/unwatch <id>` | Stop streaming |
|
|
22
|
+
| `/docs <query>` | Search Obsidian vault |
|
|
23
|
+
| `/note <text>` | Quick note to vault |
|
|
24
|
+
| `/peek <project>` | Preview running session |
|
|
25
|
+
| `/cancel <id>` | Cancel a task |
|
|
26
|
+
| `/retry <id>` | Retry a failed task |
|
|
27
|
+
| `/tunnel_start <password>` | Start Cloudflare Tunnel (returns URL + code) |
|
|
28
|
+
| `/tunnel_stop` | Stop tunnel |
|
|
29
|
+
| `/tunnel_code <password>` | Get session code for remote login |
|
|
30
|
+
| `/projects` | List configured projects |
|
|
31
|
+
|
|
32
|
+
## Shortcuts
|
|
33
|
+
- Reply to a task message to interact with it
|
|
34
|
+
- Send `"project: instructions"` to quick-create a task
|
|
35
|
+
- Numbered lists — reply with a number to select
|
|
36
|
+
|
|
37
|
+
## Troubleshooting
|
|
38
|
+
|
|
39
|
+
- **Bot not responding**: Check token is correct, restart server
|
|
40
|
+
- **"Unauthorized"**: Chat ID doesn't match configured value
|
|
41
|
+
- **Multiple users**: Set comma-separated Chat IDs (e.g. `123456,789012`)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Remote Access (Cloudflare Tunnel)
|
|
2
|
+
|
|
3
|
+
## How It Works
|
|
4
|
+
|
|
5
|
+
Forge creates a temporary Cloudflare Tunnel — a secure public URL that routes to your local Forge server. No Cloudflare account needed.
|
|
6
|
+
|
|
7
|
+
## Start Tunnel
|
|
8
|
+
|
|
9
|
+
**From UI**: Click the "Tunnel" button in the top-right header.
|
|
10
|
+
|
|
11
|
+
**From Telegram**: `/tunnel_start <admin_password>`
|
|
12
|
+
|
|
13
|
+
**Auto-start**: Set `tunnelAutoStart: true` in Settings.
|
|
14
|
+
|
|
15
|
+
## Login Flow
|
|
16
|
+
|
|
17
|
+
- **Local access** (localhost, LAN): Admin password only
|
|
18
|
+
- **Remote access** (via tunnel, `.trycloudflare.com`): Admin password + Session Code (2FA)
|
|
19
|
+
|
|
20
|
+
Session code is generated when tunnel starts. Get it via:
|
|
21
|
+
- Telegram: `/tunnel_code <password>`
|
|
22
|
+
- CLI: `forge tcode`
|
|
23
|
+
|
|
24
|
+
## Troubleshooting
|
|
25
|
+
|
|
26
|
+
- **Tunnel stuck at "starting"**: Kill old cloudflared processes: `pkill -f cloudflared`
|
|
27
|
+
- **URL not reachable**: Tunnel may have timed out, restart it
|
|
28
|
+
- **Session cookie invalid after restart**: Set `AUTH_SECRET` in `~/.forge/data/.env.local`:
|
|
29
|
+
```bash
|
|
30
|
+
echo "AUTH_SECRET=$(openssl rand -hex 32)" >> ~/.forge/data/.env.local
|
|
31
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Background Tasks
|
|
2
|
+
|
|
3
|
+
## What Are Tasks?
|
|
4
|
+
|
|
5
|
+
Tasks run Claude Code prompts in the background. They use `claude -p` (print mode) — execute and exit, no persistent session. Your code runs on your machine using your Claude subscription.
|
|
6
|
+
|
|
7
|
+
## Create a Task
|
|
8
|
+
|
|
9
|
+
**From UI**: Click "+ New Task" in the Tasks tab.
|
|
10
|
+
|
|
11
|
+
**From CLI**:
|
|
12
|
+
```bash
|
|
13
|
+
forge task my-project "fix the login bug"
|
|
14
|
+
forge task my-project "add unit tests for utils.ts" --new # fresh session
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**From Telegram**: `/task my-project fix the login bug`
|
|
18
|
+
|
|
19
|
+
## Task Modes
|
|
20
|
+
|
|
21
|
+
| Mode | Description |
|
|
22
|
+
|------|-------------|
|
|
23
|
+
| `prompt` | Run Claude Code with a prompt (default) |
|
|
24
|
+
| `shell` | Execute raw shell command |
|
|
25
|
+
| `monitor` | Watch a session and trigger actions |
|
|
26
|
+
|
|
27
|
+
## Watch Task Output
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
forge watch <task-id> # live stream in terminal
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or from Telegram: `/watch <task-id>`
|
|
34
|
+
|
|
35
|
+
## CLI Commands
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
forge tasks # list all tasks
|
|
39
|
+
forge tasks running # filter by status
|
|
40
|
+
forge status <id> # task details
|
|
41
|
+
forge cancel <id> # cancel
|
|
42
|
+
forge retry <id> # retry failed task
|
|
43
|
+
forge log <id> # execution log
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Features
|
|
47
|
+
|
|
48
|
+
- **Per-project concurrency**: One prompt task per project at a time, others queue
|
|
49
|
+
- **Session continuity**: All tasks in the same project share one Claude conversation
|
|
50
|
+
- **Cost tracking**: Token usage and USD cost per task
|
|
51
|
+
- **Git tracking**: Captures branch name and git diff after execution
|
|
52
|
+
- **Scheduled execution**: Set `scheduledAt` for deferred tasks
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Pipelines (Workflows)
|
|
2
|
+
|
|
3
|
+
## What Are Pipelines?
|
|
4
|
+
|
|
5
|
+
Pipelines chain multiple tasks into a DAG (directed acyclic graph). Each step can depend on previous steps, pass outputs forward, and run in parallel.
|
|
6
|
+
|
|
7
|
+
## YAML Workflow Format
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
name: my-workflow
|
|
11
|
+
description: "What this workflow does"
|
|
12
|
+
input:
|
|
13
|
+
feature: "Feature description"
|
|
14
|
+
vars:
|
|
15
|
+
project: my-app
|
|
16
|
+
nodes:
|
|
17
|
+
design:
|
|
18
|
+
project: "{{vars.project}}"
|
|
19
|
+
prompt: "Design: {{input.feature}}"
|
|
20
|
+
outputs:
|
|
21
|
+
- name: spec
|
|
22
|
+
extract: result
|
|
23
|
+
implement:
|
|
24
|
+
project: "{{vars.project}}"
|
|
25
|
+
depends_on: [design]
|
|
26
|
+
prompt: "Implement: {{nodes.design.outputs.spec}}"
|
|
27
|
+
review:
|
|
28
|
+
project: "{{vars.project}}"
|
|
29
|
+
depends_on: [implement]
|
|
30
|
+
prompt: "Review the changes"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Node Options
|
|
34
|
+
|
|
35
|
+
| Field | Description |
|
|
36
|
+
|-------|-------------|
|
|
37
|
+
| `project` | Project name (supports `{{vars.xxx}}` templates) |
|
|
38
|
+
| `prompt` | Claude Code prompt or shell command |
|
|
39
|
+
| `mode` | `claude` (default) or `shell` |
|
|
40
|
+
| `branch` | Auto-checkout branch before running |
|
|
41
|
+
| `depends_on` | List of node IDs that must complete first |
|
|
42
|
+
| `outputs` | Extract results: `result`, `git_diff`, or `stdout` |
|
|
43
|
+
| `routes` | Conditional routing to next nodes |
|
|
44
|
+
|
|
45
|
+
## Template Variables
|
|
46
|
+
|
|
47
|
+
- `{{input.xxx}}` — pipeline input values
|
|
48
|
+
- `{{vars.xxx}}` — workflow variables
|
|
49
|
+
- `{{nodes.xxx.outputs.yyy}}` — outputs from previous nodes
|
|
50
|
+
|
|
51
|
+
## Built-in Workflows
|
|
52
|
+
|
|
53
|
+
### issue-auto-fix
|
|
54
|
+
Fetches a GitHub issue → fixes code on new branch → creates PR.
|
|
55
|
+
|
|
56
|
+
Input: `issue_id`, `project`, `base_branch` (optional)
|
|
57
|
+
|
|
58
|
+
### pr-review
|
|
59
|
+
Fetches PR diff → AI code review → posts result.
|
|
60
|
+
|
|
61
|
+
Input: `pr_number`, `project`
|
|
62
|
+
|
|
63
|
+
## CLI
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
forge flows # list available workflows
|
|
67
|
+
forge run my-workflow # execute a workflow
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Storage
|
|
71
|
+
|
|
72
|
+
- Workflow YAML: `~/.forge/data/flows/`
|
|
73
|
+
- Execution state: `~/.forge/data/pipelines/`
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Skills Marketplace
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Browse, install, and manage Claude Code skills and commands from the Forge Skills registry.
|
|
6
|
+
|
|
7
|
+
## Types
|
|
8
|
+
|
|
9
|
+
| | Skills | Commands |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Location | `~/.claude/skills/<name>/` | `~/.claude/commands/<name>.md` |
|
|
12
|
+
| Entry file | `SKILL.md` | Single `.md` file |
|
|
13
|
+
| Complexity | Multi-file with templates | Simple slash command |
|
|
14
|
+
|
|
15
|
+
Both register as `/slash-command` in Claude Code.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
1. Go to **Skills** tab in Forge
|
|
20
|
+
2. Click **Sync** to fetch latest registry
|
|
21
|
+
3. Click **Install** on any skill → choose Global or specific project
|
|
22
|
+
4. Use in Claude Code with `/<skill-name>`
|
|
23
|
+
|
|
24
|
+
## Update
|
|
25
|
+
|
|
26
|
+
Skills with newer versions show a yellow "update" indicator. Click to update (checks for local modifications first).
|
|
27
|
+
|
|
28
|
+
## Local Skills
|
|
29
|
+
|
|
30
|
+
The **Local** tab shows skills/commands installed on your machine (both from marketplace and manually created). You can:
|
|
31
|
+
- **Install to...** — Copy a local skill to another project or global
|
|
32
|
+
- **Delete** — Remove from project or global
|
|
33
|
+
- **Edit** — View and modify installed files
|
|
34
|
+
|
|
35
|
+
## Registry
|
|
36
|
+
|
|
37
|
+
Default: `https://raw.githubusercontent.com/aiwatching/forge-skills/main`
|
|
38
|
+
|
|
39
|
+
Change in Settings → Skills Repo URL.
|
|
40
|
+
|
|
41
|
+
## Custom Skills
|
|
42
|
+
|
|
43
|
+
Create your own: put a `.md` file in `<project>/.claude/commands/` or a directory in `<project>/.claude/skills/<name>/`.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Projects
|
|
2
|
+
|
|
3
|
+
## Setup
|
|
4
|
+
|
|
5
|
+
Add project directories in Settings → **Project Roots** (e.g. `~/Projects`). Forge scans subdirectories automatically.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
### Code Tab
|
|
10
|
+
- File tree browser
|
|
11
|
+
- Syntax-highlighted code viewer
|
|
12
|
+
- Git diff view (click changed files)
|
|
13
|
+
- Git operations: commit, push, pull
|
|
14
|
+
- Commit history
|
|
15
|
+
|
|
16
|
+
### Skills & Commands Tab
|
|
17
|
+
- View installed skills/commands for this project
|
|
18
|
+
- Scope indicator: G (global), P (project), G+P (both)
|
|
19
|
+
- Edit files, update from marketplace, uninstall
|
|
20
|
+
|
|
21
|
+
### CLAUDE.md Tab
|
|
22
|
+
- View and edit project's CLAUDE.md
|
|
23
|
+
- Apply rule templates (built-in or custom)
|
|
24
|
+
- Templates auto-injected with dedup markers
|
|
25
|
+
|
|
26
|
+
### Issues Tab
|
|
27
|
+
- Enable GitHub Issue Auto-fix per project
|
|
28
|
+
- Configure scan interval and label filters
|
|
29
|
+
- Manual trigger: enter issue # and click Fix Issue
|
|
30
|
+
- Processed issues history with retry/delete
|
|
31
|
+
- Auto-chains: fix → create PR → review
|
|
32
|
+
|
|
33
|
+
## Favorites
|
|
34
|
+
|
|
35
|
+
Click ★ next to a project to favorite it. Favorites appear at the top of the sidebar.
|
|
36
|
+
|
|
37
|
+
## Terminal
|
|
38
|
+
|
|
39
|
+
Click "Terminal" button in project header to open a Vibe Coding terminal for that project. Uses `claude -c` to continue last session.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Rules (CLAUDE.md Templates)
|
|
2
|
+
|
|
3
|
+
## What Are Rules?
|
|
4
|
+
|
|
5
|
+
Reusable markdown snippets that get appended to project CLAUDE.md files. They define coding conventions, security rules, workflow guidelines, etc.
|
|
6
|
+
|
|
7
|
+
## Built-in Templates
|
|
8
|
+
|
|
9
|
+
| Template | Description |
|
|
10
|
+
|----------|-------------|
|
|
11
|
+
| TypeScript Rules | Coding conventions (const, types, early returns) |
|
|
12
|
+
| Git Workflow | Commit messages, branch naming |
|
|
13
|
+
| Obsidian Vault | Vault integration instructions |
|
|
14
|
+
| Security Rules | OWASP guidelines, no hardcoded secrets |
|
|
15
|
+
|
|
16
|
+
## Manage Rules
|
|
17
|
+
|
|
18
|
+
**Skills tab → Rules sub-tab**:
|
|
19
|
+
- View all templates (built-in + custom)
|
|
20
|
+
- Create new: click "+ New"
|
|
21
|
+
- Edit any template (including built-in)
|
|
22
|
+
- Delete custom templates
|
|
23
|
+
- Set as "default" — auto-applied to new projects
|
|
24
|
+
- Batch apply: select template → check projects → click "Apply"
|
|
25
|
+
|
|
26
|
+
## Apply to Project
|
|
27
|
+
|
|
28
|
+
**Project → CLAUDE.md tab**:
|
|
29
|
+
- Left sidebar shows CLAUDE.md content + template list
|
|
30
|
+
- Click "+ add" to inject a template
|
|
31
|
+
- Click "added" to remove
|
|
32
|
+
- Templates wrapped in `<!-- forge:template:id -->` markers (prevents duplicate injection)
|
|
33
|
+
|
|
34
|
+
## Default Templates
|
|
35
|
+
|
|
36
|
+
Templates marked as "default" are automatically injected into new projects when they first appear in the project list.
|
|
37
|
+
|
|
38
|
+
## Custom Templates
|
|
39
|
+
|
|
40
|
+
Stored in `~/.forge/data/claude-templates/`. Each is a `.md` file with YAML frontmatter:
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
---
|
|
44
|
+
name: My Rule
|
|
45
|
+
description: What this rule does
|
|
46
|
+
tags: [category]
|
|
47
|
+
builtin: false
|
|
48
|
+
isDefault: false
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## My Custom Rule
|
|
52
|
+
Your content here...
|
|
53
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Issue Auto-fix
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Automatically scan GitHub Issues, fix code, create PRs, and review — all hands-free.
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
- `gh` CLI installed and authenticated: `gh auth login`
|
|
10
|
+
- Project has a GitHub remote
|
|
11
|
+
|
|
12
|
+
## Setup
|
|
13
|
+
|
|
14
|
+
1. Go to **Projects → select project → Issues tab**
|
|
15
|
+
2. Enable **Issue Auto-fix**
|
|
16
|
+
3. Configure:
|
|
17
|
+
- **Scan Interval**: minutes between scans (0 = manual only)
|
|
18
|
+
- **Base Branch**: leave empty for auto-detect (main/master)
|
|
19
|
+
- **Labels Filter**: comma-separated labels (empty = all issues)
|
|
20
|
+
4. Click **Scan Now** to test
|
|
21
|
+
|
|
22
|
+
## Flow
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Scan → Fetch Issue → Fix Code (new branch) → Push → Create PR → Auto Review → Notify
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
1. **Scan**: `gh issue list` finds open issues matching labels
|
|
29
|
+
2. **Fix**: Claude Code analyzes issue and fixes code on `fix/<id>-<description>` branch
|
|
30
|
+
3. **PR**: Pushes branch and creates Pull Request
|
|
31
|
+
4. **Review**: Automatically triggers `pr-review` pipeline
|
|
32
|
+
5. **Notify**: Results sent via Telegram (if configured)
|
|
33
|
+
|
|
34
|
+
## Manual Trigger
|
|
35
|
+
|
|
36
|
+
Enter an issue number in "Manual Trigger" section and click "Fix Issue".
|
|
37
|
+
|
|
38
|
+
## Retry
|
|
39
|
+
|
|
40
|
+
Failed fixes show a "Retry" button. Click to provide additional context (e.g. "rebase from main first") and re-run.
|
|
41
|
+
|
|
42
|
+
## Safety
|
|
43
|
+
|
|
44
|
+
- Checks for uncommitted changes before starting (aborts if dirty)
|
|
45
|
+
- Always works on new branches (never modifies main)
|
|
46
|
+
- Switches back to original branch after completion
|
|
47
|
+
- Existing PRs are updated, not duplicated
|
|
48
|
+
|
|
49
|
+
## Processed Issues
|
|
50
|
+
|
|
51
|
+
History shows all processed issues with status (processing/done/failed), PR number, and pipeline ID. Click pipeline ID to view details.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Troubleshooting
|
|
2
|
+
|
|
3
|
+
## Common Issues
|
|
4
|
+
|
|
5
|
+
### "fork failed: Device not configured" (macOS)
|
|
6
|
+
PTY device limit exhausted:
|
|
7
|
+
```bash
|
|
8
|
+
sudo sysctl kern.tty.ptmx_max=2048
|
|
9
|
+
echo 'kern.tty.ptmx_max=2048' | sudo tee -a /etc/sysctl.conf
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Session cookie invalid after restart
|
|
13
|
+
Fix AUTH_SECRET so it persists:
|
|
14
|
+
```bash
|
|
15
|
+
echo "AUTH_SECRET=$(openssl rand -hex 32)" >> ~/.forge/data/.env.local
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Orphan processes after Ctrl+C
|
|
19
|
+
Use `forge server stop` or:
|
|
20
|
+
```bash
|
|
21
|
+
pkill -f 'telegram-standalone|terminal-standalone|next-server|cloudflared'
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Tunnel stuck at "starting"
|
|
25
|
+
```bash
|
|
26
|
+
pkill -f cloudflared
|
|
27
|
+
# Then restart tunnel from UI or Telegram
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Forgot admin password
|
|
31
|
+
```bash
|
|
32
|
+
forge --reset-password
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Terminal tabs lost after restart
|
|
36
|
+
Terminal state is saved in `~/.forge/data/terminal-state.json`. If corrupted:
|
|
37
|
+
```bash
|
|
38
|
+
rm ~/.forge/data/terminal-state.json
|
|
39
|
+
# Restart server — tabs will be empty but tmux sessions survive
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### gh CLI not authenticated (Issue Scanner)
|
|
43
|
+
```bash
|
|
44
|
+
gh auth login
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Skills not syncing
|
|
48
|
+
Click "Sync" in Skills tab. Check `skillsRepoUrl` in Settings points to valid registry.
|
|
49
|
+
|
|
50
|
+
### Multiple instances conflict
|
|
51
|
+
Use different ports and data directories:
|
|
52
|
+
```bash
|
|
53
|
+
forge server start --port 4000 --dir ~/.forge/data_demo
|
|
54
|
+
forge server stop --port 4000 --dir ~/.forge/data_demo
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Page shows "Failed to load chunk"
|
|
58
|
+
Clear build cache:
|
|
59
|
+
```bash
|
|
60
|
+
rm -rf .next
|
|
61
|
+
pnpm build # or forge server rebuild
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Logs
|
|
65
|
+
|
|
66
|
+
- Background server: `~/.forge/data/forge.log`
|
|
67
|
+
- Dev mode: terminal output
|
|
68
|
+
- View with: `tail -f ~/.forge/data/forge.log`
|
|
69
|
+
|
|
70
|
+
## Reset Everything
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Stop server
|
|
74
|
+
forge server stop
|
|
75
|
+
|
|
76
|
+
# Reset password
|
|
77
|
+
forge --reset-password
|
|
78
|
+
|
|
79
|
+
# Clear all data (nuclear option)
|
|
80
|
+
rm -rf ~/.forge/data
|
|
81
|
+
# Restart — will create fresh data directory
|
|
82
|
+
```
|
package/lib/settings.ts
CHANGED
|
@@ -26,6 +26,7 @@ export interface Settings {
|
|
|
26
26
|
skillsRepoUrl: string; // GitHub raw URL for skills registry
|
|
27
27
|
displayName: string; // User display name (shown in header)
|
|
28
28
|
displayEmail: string; // User email (for session/future integrations)
|
|
29
|
+
favoriteProjects: string[]; // Favorite project paths (shown at top of sidebar)
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
const defaults: Settings = {
|
|
@@ -47,6 +48,7 @@ const defaults: Settings = {
|
|
|
47
48
|
skillsRepoUrl: 'https://raw.githubusercontent.com/aiwatching/forge-skills/main',
|
|
48
49
|
displayName: 'Forge',
|
|
49
50
|
displayEmail: '',
|
|
51
|
+
favoriteProjects: [],
|
|
50
52
|
};
|
|
51
53
|
|
|
52
54
|
/** Load settings with secrets decrypted (for internal use) */
|
package/next-env.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="next" />
|
|
2
2
|
/// <reference types="next/image-types/global" />
|
|
3
|
-
import "./.next/
|
|
3
|
+
import "./.next/types/routes.d.ts";
|
|
4
4
|
|
|
5
5
|
// NOTE: This file should not be edited
|
|
6
6
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
package/package.json
CHANGED
package/src/core/db/database.ts
CHANGED
|
@@ -149,6 +149,18 @@ function initSchema(db: Database.Database) {
|
|
|
149
149
|
synced_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
150
150
|
);
|
|
151
151
|
|
|
152
|
+
-- Tab state (projects, docs, etc)
|
|
153
|
+
CREATE TABLE IF NOT EXISTS tab_state (
|
|
154
|
+
type TEXT PRIMARY KEY,
|
|
155
|
+
data TEXT NOT NULL DEFAULT '{}'
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
-- Project favorites
|
|
159
|
+
CREATE TABLE IF NOT EXISTS project_favorites (
|
|
160
|
+
project_path TEXT PRIMARY KEY,
|
|
161
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
162
|
+
);
|
|
163
|
+
|
|
152
164
|
-- Session watchers — monitor sessions and notify via Telegram
|
|
153
165
|
CREATE TABLE IF NOT EXISTS session_watchers (
|
|
154
166
|
id TEXT PRIMARY KEY,
|