rrce-workflow 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 +80 -0
- package/agent-core/prompts/documentation.md +66 -0
- package/agent-core/prompts/executor.md +58 -0
- package/agent-core/prompts/init.md +164 -0
- package/agent-core/prompts/planning_orchestrator.md +57 -0
- package/agent-core/prompts/research_discussion.md +69 -0
- package/agent-core/prompts/sync.md +56 -0
- package/agent-core/templates/docs/.gitkeep +1 -0
- package/agent-core/templates/documentation_output.md +46 -0
- package/agent-core/templates/executor_output.md +41 -0
- package/agent-core/templates/init_output.md +263 -0
- package/agent-core/templates/meta.template.json +54 -0
- package/agent-core/templates/planning_output.md +44 -0
- package/agent-core/templates/research_output.md +44 -0
- package/bin/rrce-workflow.js +2 -0
- package/docs/architecture.md +346 -0
- package/package.json +57 -0
- package/src/App.tsx +110 -0
- package/src/components/AgentSelector.tsx +43 -0
- package/src/components/Wizard.tsx +135 -0
- package/src/index.tsx +9 -0
- package/src/lib/git.ts +37 -0
- package/src/lib/paths.ts +82 -0
- package/src/lib/prompts.ts +59 -0
- package/src/types/prompt.ts +53 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
# RRCE-Workflow Architecture
|
|
2
|
+
|
|
3
|
+
> RR Context Engineering Workflow - A selection-agnostic agentic workflow system
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
RRCE-Workflow is a TUI-based agentic code workflow generator designed to work seamlessly across:
|
|
8
|
+
- **GitHub Copilot CLI**
|
|
9
|
+
- **Antigravity IDE** (Google's agentic coding environment)
|
|
10
|
+
- **VS Code** (with Copilot and other AI extensions)
|
|
11
|
+
|
|
12
|
+
The system provides a structured multi-agent pipeline for software development tasks, with persistent knowledge caching and workspace-aware context management.
|
|
13
|
+
|
|
14
|
+
## Core Principles
|
|
15
|
+
|
|
16
|
+
1. **Selection Agnostic** - Identical prompts and behavior across all supported tools
|
|
17
|
+
2. **Workspace Aware** - Respects project boundaries and maintainer preferences
|
|
18
|
+
3. **Global Cache, Project Scoped** - Knowledge persists globally but is organized per-project
|
|
19
|
+
4. **Non-Intrusive** - Minimal footprint in workspace; state lives in user home directory
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Directory Structure
|
|
24
|
+
|
|
25
|
+
### Global Installation (`~/.rrce-workflow/`)
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
~/.rrce-workflow/
|
|
29
|
+
├── config.yaml # User global configuration
|
|
30
|
+
├── templates/ # Default template store
|
|
31
|
+
│ ├── meta.template.json # Task metadata template
|
|
32
|
+
│ ├── research_output.md # Research brief template
|
|
33
|
+
│ ├── planning_output.md # Execution plan template
|
|
34
|
+
│ ├── executor_output.md # Implementation log template
|
|
35
|
+
│ ├── documentation_output.md # Handover note template
|
|
36
|
+
│ └── docs/ # Doc-type specific templates
|
|
37
|
+
│ └── <doc-type>.md
|
|
38
|
+
└── workspaces/ # Project-scoped cache
|
|
39
|
+
└── <workspace-hash>/ # SHA256 of workspace path
|
|
40
|
+
├── workspace.json # Workspace metadata
|
|
41
|
+
├── knowledge/ # Project domain knowledge
|
|
42
|
+
│ └── <domain>.md
|
|
43
|
+
└── tasks/ # Task state and artifacts
|
|
44
|
+
└── <task-slug>/
|
|
45
|
+
├── meta.json # Task metadata and status
|
|
46
|
+
├── research/ # Research artifacts
|
|
47
|
+
├── planning/ # Planning artifacts
|
|
48
|
+
├── execution/ # Execution logs
|
|
49
|
+
└── docs/ # Generated documentation
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Workspace Configuration (Optional)
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
<workspace>/
|
|
56
|
+
└── .rrce-workflow.yaml # Project-specific config
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Path Resolution
|
|
62
|
+
|
|
63
|
+
### Storage Modes
|
|
64
|
+
|
|
65
|
+
| Mode | Location | Use Case |
|
|
66
|
+
|------|----------|----------|
|
|
67
|
+
| `global` (default) | `~/.rrce-workflow/workspaces/<workspace-name>/` | Non-intrusive, survives repo deletion |
|
|
68
|
+
| `workspace` | `<workspace>/.rrce-workflow/` | Portable, team-shareable |
|
|
69
|
+
| `both` | Both locations with sync | Redundancy, flexibility |
|
|
70
|
+
|
|
71
|
+
Configure via `.rrce-workflow.yaml`:
|
|
72
|
+
```yaml
|
|
73
|
+
storage:
|
|
74
|
+
mode: global # or: workspace, both
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Environment Variables
|
|
78
|
+
|
|
79
|
+
| Variable | Purpose | Default |
|
|
80
|
+
|----------|---------|---------|
|
|
81
|
+
| `RRCE_HOME` | Global installation path | `~/.rrce-workflow` |
|
|
82
|
+
| `RRCE_WORKSPACE` | Explicit workspace root | Auto-detected |
|
|
83
|
+
| `RRCE_AUTHOR` | Default author name | From `config.yaml` |
|
|
84
|
+
|
|
85
|
+
### Template Variables
|
|
86
|
+
|
|
87
|
+
| Variable | Resolves To |
|
|
88
|
+
|----------|-------------|
|
|
89
|
+
| `{{RRCE_HOME}}` | Global installation path |
|
|
90
|
+
| `{{RRCE_DATA}}` | Data path (based on storage mode) |
|
|
91
|
+
| `{{WORKSPACE_ROOT}}` | Workspace directory |
|
|
92
|
+
| `{{WORKSPACE_NAME}}` | Project name (from config or directory) |
|
|
93
|
+
|
|
94
|
+
### Workspace Detection Algorithm
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
1. If $RRCE_WORKSPACE is set → use it
|
|
98
|
+
2. Walk up from CWD, find first directory containing:
|
|
99
|
+
- .git/
|
|
100
|
+
- .rrce-workflow.yaml
|
|
101
|
+
3. Fall back to CWD
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Cross-Project References
|
|
105
|
+
|
|
106
|
+
Reference another project's context when needed:
|
|
107
|
+
```
|
|
108
|
+
{{RRCE_HOME}}/workspaces/<other-project-name>/knowledge/project-context.md
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Use cases:**
|
|
112
|
+
- FE project referencing BE API specs
|
|
113
|
+
- Microservice referencing shared library conventions
|
|
114
|
+
- Monorepo packages accessing root-level decisions
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Agent Pipeline
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
┌─────────────────┐
|
|
122
|
+
│ Init │ ← First run or re-sync
|
|
123
|
+
│ (Project Setup) │
|
|
124
|
+
└────────┬────────┘
|
|
125
|
+
│
|
|
126
|
+
▼
|
|
127
|
+
project-context.md
|
|
128
|
+
│
|
|
129
|
+
┌────────────────────────────────────┴────────────────────────────────────┐
|
|
130
|
+
▼ │
|
|
131
|
+
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
|
132
|
+
│ Research │────▶│ Planning │────▶│ Executor │────▶│ Documentation │
|
|
133
|
+
│ & Discussion │ │ Orchestrator │ │ │ │ │
|
|
134
|
+
└─────────────────┘ └─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
135
|
+
│ │ │ │
|
|
136
|
+
▼ ▼ ▼ ▼
|
|
137
|
+
research.md plan.md execution.md handover.md
|
|
138
|
+
│ │ │ │
|
|
139
|
+
└───────────────────────┴───────────────────────┴───────────────────────┘
|
|
140
|
+
│
|
|
141
|
+
▼
|
|
142
|
+
{{RRCE_CACHE}}/knowledge/
|
|
143
|
+
(Persistent Context)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Agent Responsibilities
|
|
147
|
+
|
|
148
|
+
| Agent | Role | Input | Output |
|
|
149
|
+
|-------|------|-------|--------|
|
|
150
|
+
| **Init** | Analyze codebase, establish project context | Workspace files | `project-context.md` |
|
|
151
|
+
| **Research & Discussion** | Clarify requirements, surface risks | User request + context | Requirements brief |
|
|
152
|
+
| **Planning Orchestrator** | Create actionable execution plan | Research brief | Prioritized task breakdown |
|
|
153
|
+
| **Executor** | Implement and verify | Plan + skill scope | Code + execution log |
|
|
154
|
+
| **Documentation** | Synthesize and handover | All artifacts | Release-ready docs |
|
|
155
|
+
| **Sync** | Reconcile knowledge | Codebase state | Updated knowledge files |
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Configuration
|
|
160
|
+
|
|
161
|
+
### Global Config (`~/.rrce-workflow/config.yaml`)
|
|
162
|
+
|
|
163
|
+
```yaml
|
|
164
|
+
version: 1
|
|
165
|
+
|
|
166
|
+
# User identity
|
|
167
|
+
author: "your-name"
|
|
168
|
+
email: "your@email.com"
|
|
169
|
+
|
|
170
|
+
# Default behaviors
|
|
171
|
+
defaults:
|
|
172
|
+
auto_create_workspace_cache: true
|
|
173
|
+
sync_after_execution: false
|
|
174
|
+
|
|
175
|
+
# Editor integration hints (informational)
|
|
176
|
+
editor:
|
|
177
|
+
preferred: "vscode" # vscode | antigravity | vim | etc.
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Project Config (`<workspace>/.rrce-workflow.yaml`)
|
|
181
|
+
|
|
182
|
+
```yaml
|
|
183
|
+
version: 1
|
|
184
|
+
|
|
185
|
+
# Cache control - repo maintainer can disable/customize
|
|
186
|
+
cache:
|
|
187
|
+
enabled: true # Set to false to disable global caching
|
|
188
|
+
knowledge: true # Cache knowledge globally
|
|
189
|
+
tasks: true # Cache task state globally
|
|
190
|
+
|
|
191
|
+
# Template overrides
|
|
192
|
+
templates:
|
|
193
|
+
dir: ./my-templates # Local template directory (optional)
|
|
194
|
+
|
|
195
|
+
# Project metadata
|
|
196
|
+
project:
|
|
197
|
+
name: "my-project" # Friendly name
|
|
198
|
+
|
|
199
|
+
# Author override
|
|
200
|
+
author: "maintainer-name" # Overrides global config for this project
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Prompt Frontmatter Schema
|
|
206
|
+
|
|
207
|
+
All agent prompts use YAML frontmatter for metadata and tool compatibility:
|
|
208
|
+
|
|
209
|
+
```yaml
|
|
210
|
+
---
|
|
211
|
+
description: Brief description of the agent's purpose
|
|
212
|
+
argument-hint: CLI-style argument hint for display
|
|
213
|
+
agent: agent | ask | edit # Copilot mode
|
|
214
|
+
tools: ['search/codebase', ...] # Available Copilot tools
|
|
215
|
+
required-args:
|
|
216
|
+
- name: ARG_NAME
|
|
217
|
+
prompt: "Interactive prompt if arg is missing"
|
|
218
|
+
optional-args:
|
|
219
|
+
- name: ARG_NAME
|
|
220
|
+
default: "default value"
|
|
221
|
+
auto-identity:
|
|
222
|
+
user: "$GIT_USER" # Auto-detect from `git config user.name`
|
|
223
|
+
model: "$AGENT_MODEL" # Auto-detect from runtime (gemini-2.0, claude-sonnet, etc.)
|
|
224
|
+
---
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Auto-Identity
|
|
228
|
+
|
|
229
|
+
Identity is automatically detected - no user input required:
|
|
230
|
+
|
|
231
|
+
| Variable | Source | Example |
|
|
232
|
+
|----------|--------|---------|
|
|
233
|
+
| `$GIT_USER` | `git config user.name` | "John Doe" |
|
|
234
|
+
| `$AGENT_MODEL` | Runtime environment | "gemini-2.0-flash", "claude-sonnet-4" |
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Multi-Tool Integration
|
|
239
|
+
|
|
240
|
+
RRCE-Workflow prompts are designed to work across multiple AI coding tools:
|
|
241
|
+
|
|
242
|
+
### Tool Support Matrix
|
|
243
|
+
|
|
244
|
+
| Tool | Prompt Location | Extension | Notes |
|
|
245
|
+
|------|----------------|-----------|-------|
|
|
246
|
+
| **Antigravity IDE** | `.agent/workflows/` | `.md` | Native workflow support |
|
|
247
|
+
| **GitHub Copilot (VSCode)** | `.github/agents/` | `.agent.md` | Custom agents format |
|
|
248
|
+
| **Copilot CLI** | Any location | `.md` | Reference via file path |
|
|
249
|
+
|
|
250
|
+
### Wizard Command
|
|
251
|
+
|
|
252
|
+
The TUI provides an interactive wizard to set up prompts for your preferred tools:
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
$ rrce-workflow wizard
|
|
256
|
+
|
|
257
|
+
┌─────────────────────────────────────────────────────────┐
|
|
258
|
+
│ RRCE-Workflow Project Setup │
|
|
259
|
+
├─────────────────────────────────────────────────────────┤
|
|
260
|
+
│ │
|
|
261
|
+
│ Which AI tools do you use? │
|
|
262
|
+
│ │
|
|
263
|
+
│ [x] GitHub Copilot (VSCode) │
|
|
264
|
+
│ [x] Antigravity IDE │
|
|
265
|
+
│ [ ] Copilot CLI only │
|
|
266
|
+
│ │
|
|
267
|
+
│ ───────────────────────────────────────────────────── │
|
|
268
|
+
│ │
|
|
269
|
+
│ ✓ Created .github/prompts/*.prompt.md │
|
|
270
|
+
│ ✓ Created .agent/workflows/*.md │
|
|
271
|
+
│ ✓ Initialized project context │
|
|
272
|
+
│ │
|
|
273
|
+
└─────────────────────────────────────────────────────────┘
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Generated Files
|
|
277
|
+
|
|
278
|
+
When you run `rrce-workflow wizard`, it creates:
|
|
279
|
+
|
|
280
|
+
**For GitHub Copilot (VSCode):**
|
|
281
|
+
```
|
|
282
|
+
.github/prompts/
|
|
283
|
+
├── init.prompt.md
|
|
284
|
+
├── research.prompt.md
|
|
285
|
+
├── planning.prompt.md
|
|
286
|
+
├── executor.prompt.md
|
|
287
|
+
├── documentation.prompt.md
|
|
288
|
+
└── sync.prompt.md
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**For Antigravity IDE:**
|
|
292
|
+
```
|
|
293
|
+
.agent/workflows/
|
|
294
|
+
├── init.md
|
|
295
|
+
├── research.md
|
|
296
|
+
├── planning.md
|
|
297
|
+
├── executor.md
|
|
298
|
+
├── documentation.md
|
|
299
|
+
└── sync.md
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Copilot-Specific Features
|
|
303
|
+
|
|
304
|
+
Our prompts include Copilot-compatible frontmatter:
|
|
305
|
+
|
|
306
|
+
| Field | Purpose | Values |
|
|
307
|
+
|-------|---------|--------|
|
|
308
|
+
| `agent` | Execution mode | `agent` (full), `ask` (read-only), `edit` (code changes) |
|
|
309
|
+
| `tools` | Available tools | `search/codebase`, `search/web`, `terminalLastCommand`, etc. |
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Installation Flow (TUI First Run)
|
|
314
|
+
|
|
315
|
+
```
|
|
316
|
+
$ npx rrce-workflow
|
|
317
|
+
|
|
318
|
+
┌─────────────────────────────────────────────────────────┐
|
|
319
|
+
│ RRCE-Workflow Setup Wizard │
|
|
320
|
+
├─────────────────────────────────────────────────────────┤
|
|
321
|
+
│ │
|
|
322
|
+
│ Welcome! Let's configure your workflow environment. │
|
|
323
|
+
│ │
|
|
324
|
+
│ Your name: [_________________] │
|
|
325
|
+
│ Email (optional): [_________________] │
|
|
326
|
+
│ │
|
|
327
|
+
│ ───────────────────────────────────────────────────── │
|
|
328
|
+
│ │
|
|
329
|
+
│ ✓ Created ~/.rrce-workflow/config.yaml │
|
|
330
|
+
│ ✓ Installed default templates │
|
|
331
|
+
│ ✓ Ready to use! │
|
|
332
|
+
│ │
|
|
333
|
+
│ Run `rrce-workflow help` for available commands. │
|
|
334
|
+
│ │
|
|
335
|
+
└─────────────────────────────────────────────────────────┘
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## Future Considerations
|
|
341
|
+
|
|
342
|
+
- [ ] Web UI for knowledge browsing
|
|
343
|
+
- [ ] Cross-project knowledge sharing (opt-in)
|
|
344
|
+
- [ ] Plugin system for custom agents
|
|
345
|
+
- [ ] LLM-agnostic (support OpenAI, Anthropic, Gemini, local models)
|
|
346
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rrce-workflow",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "RRCE-Workflow TUI - Agentic code workflow generator for AI-assisted development",
|
|
5
|
+
"author": "RRCE Team",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/rryando/rrce-workflow.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/rryando/rrce-workflow#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/rryando/rrce-workflow/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"ai",
|
|
17
|
+
"workflow",
|
|
18
|
+
"copilot",
|
|
19
|
+
"agent",
|
|
20
|
+
"tui",
|
|
21
|
+
"cli",
|
|
22
|
+
"code-generation",
|
|
23
|
+
"agentic",
|
|
24
|
+
"ink"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"module": "src/index.tsx",
|
|
28
|
+
"bin": {
|
|
29
|
+
"rrce-workflow": "bin/rrce-workflow.js"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"src",
|
|
33
|
+
"agent-core",
|
|
34
|
+
"docs",
|
|
35
|
+
"bin"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"dev": "bun run src/index.tsx",
|
|
39
|
+
"wizard": "bun run src/index.tsx wizard",
|
|
40
|
+
"start": "bun run src/index.tsx"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18",
|
|
44
|
+
"bun": ">=1.0"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"gray-matter": "^4.0.3",
|
|
48
|
+
"ink": "^6.6.0",
|
|
49
|
+
"ink-select-input": "^6.2.0",
|
|
50
|
+
"react": "^18",
|
|
51
|
+
"zod": "^4"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/bun": "latest",
|
|
55
|
+
"@types/react": "^18"
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/App.tsx
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { Wizard, type WizardConfig } from './components/Wizard';
|
|
4
|
+
import { AgentSelector } from './components/AgentSelector';
|
|
5
|
+
import { loadPromptsFromDir, getAgentCorePromptsDir } from './lib/prompts';
|
|
6
|
+
import { ensureDir, getAgentPromptPath, resolveDataPath, getRRCEHome } from './lib/paths';
|
|
7
|
+
import type { ParsedPrompt } from './types/prompt';
|
|
8
|
+
import * as fs from 'fs';
|
|
9
|
+
import * as path from 'path';
|
|
10
|
+
|
|
11
|
+
type AppMode = 'wizard' | 'select' | 'done';
|
|
12
|
+
|
|
13
|
+
interface AppProps {
|
|
14
|
+
command?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function App({ command }: AppProps) {
|
|
18
|
+
const [mode, setMode] = React.useState<AppMode>(command === 'wizard' ? 'wizard' : 'select');
|
|
19
|
+
const [selectedPrompt, setSelectedPrompt] = React.useState<ParsedPrompt | null>(null);
|
|
20
|
+
const [message, setMessage] = React.useState<string | null>(null);
|
|
21
|
+
|
|
22
|
+
// Load prompts from agent-core
|
|
23
|
+
const prompts = loadPromptsFromDir(getAgentCorePromptsDir());
|
|
24
|
+
|
|
25
|
+
const handleWizardComplete = (config: WizardConfig) => {
|
|
26
|
+
// Create config file
|
|
27
|
+
const dataPath = resolveDataPath(config.storageMode, config.workspaceName, config.workspacePath);
|
|
28
|
+
ensureDir(dataPath);
|
|
29
|
+
|
|
30
|
+
// Copy prompts to appropriate locations
|
|
31
|
+
if (config.tools.copilot) {
|
|
32
|
+
const copilotPath = getAgentPromptPath(config.workspacePath, 'copilot');
|
|
33
|
+
ensureDir(copilotPath);
|
|
34
|
+
copyPromptsToDir(prompts, copilotPath, '.agent.md');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (config.tools.antigravity) {
|
|
38
|
+
const antigravityPath = getAgentPromptPath(config.workspacePath, 'antigravity');
|
|
39
|
+
ensureDir(antigravityPath);
|
|
40
|
+
copyPromptsToDir(prompts, antigravityPath, '.md');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Create workspace config
|
|
44
|
+
const workspaceConfigPath = path.join(config.workspacePath, '.rrce-workflow.yaml');
|
|
45
|
+
const configContent = `# RRCE-Workflow Configuration
|
|
46
|
+
version: 1
|
|
47
|
+
|
|
48
|
+
storage:
|
|
49
|
+
mode: ${config.storageMode}
|
|
50
|
+
|
|
51
|
+
project:
|
|
52
|
+
name: "${config.workspaceName}"
|
|
53
|
+
`;
|
|
54
|
+
fs.writeFileSync(workspaceConfigPath, configContent);
|
|
55
|
+
|
|
56
|
+
setMessage(`✓ Setup complete! Created config and copied agents.`);
|
|
57
|
+
setMode('done');
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const handleAgentSelect = (prompt: ParsedPrompt) => {
|
|
61
|
+
setSelectedPrompt(prompt);
|
|
62
|
+
setMessage(`Selected: ${prompt.frontmatter.name}\n\nUse this agent in your IDE by invoking @${prompt.frontmatter.name}`);
|
|
63
|
+
setMode('done');
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
if (mode === 'wizard') {
|
|
67
|
+
return <Wizard onComplete={handleWizardComplete} />;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (mode === 'done') {
|
|
71
|
+
return (
|
|
72
|
+
<Box flexDirection="column" padding={1}>
|
|
73
|
+
<Box borderStyle="round" borderColor="green" paddingX={2}>
|
|
74
|
+
<Text bold color="green">RRCE-Workflow</Text>
|
|
75
|
+
</Box>
|
|
76
|
+
<Box marginTop={1}>
|
|
77
|
+
<Text>{message}</Text>
|
|
78
|
+
</Box>
|
|
79
|
+
</Box>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (prompts.length === 0) {
|
|
84
|
+
return (
|
|
85
|
+
<Box flexDirection="column" padding={1}>
|
|
86
|
+
<Text color="yellow">No prompts found. Run `rrce-workflow wizard` to set up.</Text>
|
|
87
|
+
</Box>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<AgentSelector
|
|
93
|
+
prompts={prompts}
|
|
94
|
+
workspaceName={path.basename(process.cwd())}
|
|
95
|
+
onSelect={handleAgentSelect}
|
|
96
|
+
/>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function copyPromptsToDir(prompts: ParsedPrompt[], targetDir: string, extension: string) {
|
|
101
|
+
for (const prompt of prompts) {
|
|
102
|
+
const baseName = path.basename(prompt.filePath, '.md');
|
|
103
|
+
const targetName = baseName + extension;
|
|
104
|
+
const targetPath = path.join(targetDir, targetName);
|
|
105
|
+
|
|
106
|
+
// Read the full content including frontmatter
|
|
107
|
+
const content = fs.readFileSync(prompt.filePath, 'utf-8');
|
|
108
|
+
fs.writeFileSync(targetPath, content);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import SelectInput from 'ink-select-input';
|
|
4
|
+
import type { ParsedPrompt } from '../types/prompt';
|
|
5
|
+
|
|
6
|
+
interface AgentSelectorProps {
|
|
7
|
+
prompts: ParsedPrompt[];
|
|
8
|
+
workspaceName: string;
|
|
9
|
+
onSelect: (prompt: ParsedPrompt) => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function AgentSelector({ prompts, workspaceName, onSelect }: AgentSelectorProps) {
|
|
13
|
+
const items = prompts.map((p, i) => ({
|
|
14
|
+
key: p.filePath,
|
|
15
|
+
label: `${p.frontmatter.name} - ${p.frontmatter.description}`,
|
|
16
|
+
value: p,
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
const handleSelect = (item: { value: ParsedPrompt }) => {
|
|
20
|
+
onSelect(item.value);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Box flexDirection="column" padding={1}>
|
|
25
|
+
<Box borderStyle="round" borderColor="cyan" paddingX={2}>
|
|
26
|
+
<Text bold color="cyan">RRCE-Workflow</Text>
|
|
27
|
+
<Text> </Text>
|
|
28
|
+
<Text dimColor>| {workspaceName}</Text>
|
|
29
|
+
</Box>
|
|
30
|
+
|
|
31
|
+
<Box marginTop={1} flexDirection="column">
|
|
32
|
+
<Text>Select an agent:</Text>
|
|
33
|
+
<Box marginTop={1}>
|
|
34
|
+
<SelectInput items={items} onSelect={handleSelect} />
|
|
35
|
+
</Box>
|
|
36
|
+
</Box>
|
|
37
|
+
|
|
38
|
+
<Box marginTop={1}>
|
|
39
|
+
<Text dimColor>↑↓ to navigate, Enter to select</Text>
|
|
40
|
+
</Box>
|
|
41
|
+
</Box>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Box, Text, useInput } from 'ink';
|
|
3
|
+
import SelectInput from 'ink-select-input';
|
|
4
|
+
import type { StorageMode } from '../types/prompt';
|
|
5
|
+
import { getGitUser } from '../lib/git';
|
|
6
|
+
import { detectWorkspaceRoot, getWorkspaceName } from '../lib/paths';
|
|
7
|
+
|
|
8
|
+
interface WizardProps {
|
|
9
|
+
onComplete: (config: WizardConfig) => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface WizardConfig {
|
|
13
|
+
workspaceName: string;
|
|
14
|
+
workspacePath: string;
|
|
15
|
+
storageMode: StorageMode;
|
|
16
|
+
tools: {
|
|
17
|
+
copilot: boolean;
|
|
18
|
+
antigravity: boolean;
|
|
19
|
+
};
|
|
20
|
+
gitUser: string | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type WizardStep = 'welcome' | 'storage' | 'tools' | 'confirm';
|
|
24
|
+
|
|
25
|
+
const storageModeItems = [
|
|
26
|
+
{ label: 'Global (~/.rrce-workflow/)', value: 'global' as StorageMode },
|
|
27
|
+
{ label: 'Workspace (.rrce-workflow/)', value: 'workspace' as StorageMode },
|
|
28
|
+
{ label: 'Both', value: 'both' as StorageMode },
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
export function Wizard({ onComplete }: WizardProps) {
|
|
32
|
+
const workspacePath = detectWorkspaceRoot();
|
|
33
|
+
const workspaceName = getWorkspaceName(workspacePath);
|
|
34
|
+
const gitUser = getGitUser();
|
|
35
|
+
|
|
36
|
+
const [step, setStep] = React.useState<WizardStep>('welcome');
|
|
37
|
+
const [storageMode, setStorageMode] = React.useState<StorageMode>('global');
|
|
38
|
+
const [tools, setTools] = React.useState({ copilot: true, antigravity: true });
|
|
39
|
+
|
|
40
|
+
useInput((input, key) => {
|
|
41
|
+
if (step === 'welcome' && key.return) {
|
|
42
|
+
setStep('storage');
|
|
43
|
+
} else if (step === 'confirm' && key.return) {
|
|
44
|
+
onComplete({
|
|
45
|
+
workspaceName,
|
|
46
|
+
workspacePath,
|
|
47
|
+
storageMode,
|
|
48
|
+
tools,
|
|
49
|
+
gitUser,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const handleStorageSelect = (item: { value: StorageMode }) => {
|
|
55
|
+
setStorageMode(item.value);
|
|
56
|
+
setStep('tools');
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const handleToolsSelect = (item: { value: string }) => {
|
|
60
|
+
if (item.value === 'done') {
|
|
61
|
+
setStep('confirm');
|
|
62
|
+
} else if (item.value === 'copilot') {
|
|
63
|
+
setTools((t: typeof tools) => ({ ...t, copilot: !t.copilot }));
|
|
64
|
+
} else if (item.value === 'antigravity') {
|
|
65
|
+
setTools((t: typeof tools) => ({ ...t, antigravity: !t.antigravity }));
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Box flexDirection="column" padding={1}>
|
|
71
|
+
<Box borderStyle="round" borderColor="cyan" paddingX={2}>
|
|
72
|
+
<Text bold color="cyan">RRCE-Workflow Setup</Text>
|
|
73
|
+
</Box>
|
|
74
|
+
|
|
75
|
+
<Box marginTop={1}>
|
|
76
|
+
{step === 'welcome' && (
|
|
77
|
+
<Box flexDirection="column">
|
|
78
|
+
<Text>Welcome! Detecting your environment...</Text>
|
|
79
|
+
<Box marginTop={1} flexDirection="column">
|
|
80
|
+
<Text>
|
|
81
|
+
<Text color="green">✓</Text> Git user: <Text bold>{gitUser || '(not found)'}</Text>
|
|
82
|
+
</Text>
|
|
83
|
+
<Text>
|
|
84
|
+
<Text color="green">✓</Text> Workspace: <Text bold>{workspaceName}</Text>
|
|
85
|
+
</Text>
|
|
86
|
+
</Box>
|
|
87
|
+
<Box marginTop={1}>
|
|
88
|
+
<Text dimColor>Press Enter to continue...</Text>
|
|
89
|
+
</Box>
|
|
90
|
+
</Box>
|
|
91
|
+
)}
|
|
92
|
+
|
|
93
|
+
{step === 'storage' && (
|
|
94
|
+
<Box flexDirection="column">
|
|
95
|
+
<Text>Where should workflow data be stored?</Text>
|
|
96
|
+
<Box marginTop={1}>
|
|
97
|
+
<SelectInput items={storageModeItems} onSelect={handleStorageSelect} />
|
|
98
|
+
</Box>
|
|
99
|
+
</Box>
|
|
100
|
+
)}
|
|
101
|
+
|
|
102
|
+
{step === 'tools' && (
|
|
103
|
+
<Box flexDirection="column">
|
|
104
|
+
<Text>Which AI tools do you use?</Text>
|
|
105
|
+
<Box marginTop={1}>
|
|
106
|
+
<SelectInput
|
|
107
|
+
items={[
|
|
108
|
+
{ label: `[${tools.copilot ? 'x' : ' '}] GitHub Copilot (VSCode)`, value: 'copilot' },
|
|
109
|
+
{ label: `[${tools.antigravity ? 'x' : ' '}] Antigravity IDE`, value: 'antigravity' },
|
|
110
|
+
{ label: '───────────────', value: 'sep' },
|
|
111
|
+
{ label: 'Done', value: 'done' },
|
|
112
|
+
]}
|
|
113
|
+
onSelect={handleToolsSelect}
|
|
114
|
+
/>
|
|
115
|
+
</Box>
|
|
116
|
+
</Box>
|
|
117
|
+
)}
|
|
118
|
+
|
|
119
|
+
{step === 'confirm' && (
|
|
120
|
+
<Box flexDirection="column">
|
|
121
|
+
<Text bold color="green">Configuration Summary</Text>
|
|
122
|
+
<Box marginTop={1} flexDirection="column">
|
|
123
|
+
<Text>• Storage: <Text bold>{storageMode}</Text></Text>
|
|
124
|
+
<Text>• Copilot: <Text bold>{tools.copilot ? 'Yes' : 'No'}</Text></Text>
|
|
125
|
+
<Text>• Antigravity: <Text bold>{tools.antigravity ? 'Yes' : 'No'}</Text></Text>
|
|
126
|
+
</Box>
|
|
127
|
+
<Box marginTop={1}>
|
|
128
|
+
<Text dimColor>Press Enter to create configuration...</Text>
|
|
129
|
+
</Box>
|
|
130
|
+
</Box>
|
|
131
|
+
)}
|
|
132
|
+
</Box>
|
|
133
|
+
</Box>
|
|
134
|
+
);
|
|
135
|
+
}
|