locus-product-planning 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/.opencode/skills/locus/SKILL.md +299 -0
- package/LICENSE +21 -0
- package/README.md +124 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +114 -0
- package/opencode.json +17 -0
- package/package.json +68 -0
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: locus
|
|
3
|
+
description: Plan and build projects through a simple 4-step process (Vision → Features → Design → Build)
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: "2.0.0"
|
|
7
|
+
author: locus
|
|
8
|
+
category: workflow
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Locus - Simple Project Planning
|
|
12
|
+
|
|
13
|
+
Help users go from idea to implementation through 4 simple steps. No jargon, no complexity - just guided progress.
|
|
14
|
+
|
|
15
|
+
## How It Works
|
|
16
|
+
|
|
17
|
+
When a user describes something they want to build, guide them through:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Step 1: Vision → What and why?
|
|
21
|
+
Step 2: Features → What will it do?
|
|
22
|
+
Step 3: Design → How will it work?
|
|
23
|
+
Step 4: Build → Make it happen
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## User Experience
|
|
27
|
+
|
|
28
|
+
### Starting (User describes their idea)
|
|
29
|
+
|
|
30
|
+
When user says something like:
|
|
31
|
+
- "I want to build an AI trading simulator"
|
|
32
|
+
- "/locus a mobile app for..."
|
|
33
|
+
- "Help me create a..."
|
|
34
|
+
|
|
35
|
+
Respond with:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
I'll help you plan and build this step by step.
|
|
39
|
+
|
|
40
|
+
📋 [Project Name]
|
|
41
|
+
━━━━━━━━━━━━━━━━━━
|
|
42
|
+
→ Step 1: Vision ◄ you are here
|
|
43
|
+
Step 2: Features
|
|
44
|
+
Step 3: Design
|
|
45
|
+
Step 4: Build
|
|
46
|
+
|
|
47
|
+
Let's start with the vision. [Ask 1-2 clarifying questions]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Progressing (User says "continue", "next", "yes", etc.)
|
|
51
|
+
|
|
52
|
+
Move to the next step automatically. Show progress:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
✓ Step 1: Vision — complete
|
|
56
|
+
|
|
57
|
+
📋 [Project Name]
|
|
58
|
+
━━━━━━━━━━━━━━━━━━
|
|
59
|
+
✓ Step 1: Vision
|
|
60
|
+
→ Step 2: Features ◄ you are here
|
|
61
|
+
Step 3: Design
|
|
62
|
+
Step 4: Build
|
|
63
|
+
|
|
64
|
+
Now let's define the features...
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Checking Status (User asks "where are we?", "status", "progress")
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
📋 [Project Name]
|
|
71
|
+
━━━━━━━━━━━━━━━━━━
|
|
72
|
+
✓ Step 1: Vision
|
|
73
|
+
✓ Step 2: Features
|
|
74
|
+
→ Step 3: Design ◄ you are here
|
|
75
|
+
Step 4: Build
|
|
76
|
+
|
|
77
|
+
Progress: 50% complete
|
|
78
|
+
Say "continue" to keep going.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## The Four Steps
|
|
82
|
+
|
|
83
|
+
### Step 1: Vision
|
|
84
|
+
**Purpose**: Understand what they're building and why
|
|
85
|
+
|
|
86
|
+
Ask about:
|
|
87
|
+
- What problem does this solve?
|
|
88
|
+
- Who is it for?
|
|
89
|
+
- What does success look like?
|
|
90
|
+
|
|
91
|
+
**Output**: Clear vision statement (create behind the scenes)
|
|
92
|
+
|
|
93
|
+
### Step 2: Features
|
|
94
|
+
**Purpose**: Define what the product will do
|
|
95
|
+
|
|
96
|
+
Ask about:
|
|
97
|
+
- Core features (must have)
|
|
98
|
+
- Nice-to-have features
|
|
99
|
+
- What's NOT included
|
|
100
|
+
|
|
101
|
+
**Output**: Feature list with priorities (create behind the scenes)
|
|
102
|
+
|
|
103
|
+
### Step 3: Design
|
|
104
|
+
**Purpose**: Figure out how it will work
|
|
105
|
+
|
|
106
|
+
Cover:
|
|
107
|
+
- Key technical decisions
|
|
108
|
+
- Architecture overview
|
|
109
|
+
- Main components
|
|
110
|
+
|
|
111
|
+
**Output**: Technical approach (create behind the scenes)
|
|
112
|
+
|
|
113
|
+
### Step 4: Build
|
|
114
|
+
**Purpose**: Actually create it
|
|
115
|
+
|
|
116
|
+
Do:
|
|
117
|
+
- Break into tasks
|
|
118
|
+
- Start implementing
|
|
119
|
+
- Track progress
|
|
120
|
+
|
|
121
|
+
**Output**: Working code/product
|
|
122
|
+
|
|
123
|
+
## Response Patterns
|
|
124
|
+
|
|
125
|
+
### Keep It Conversational
|
|
126
|
+
|
|
127
|
+
**Good:**
|
|
128
|
+
> "Great! So we're building a trading simulator that helps people learn without risking real money. What's the most important feature it needs?"
|
|
129
|
+
|
|
130
|
+
**Bad:**
|
|
131
|
+
> "I have created the strategic mandate artifact for Tier 1. The gate criteria require vision_aligned=true. Proceeding to Tier 2 Product Planning phase."
|
|
132
|
+
|
|
133
|
+
### Show Progress Visually
|
|
134
|
+
|
|
135
|
+
Always show the simple progress bar:
|
|
136
|
+
```
|
|
137
|
+
📋 Project Name
|
|
138
|
+
━━━━━━━━━━━━━━
|
|
139
|
+
✓ Step 1: Vision
|
|
140
|
+
→ Step 2: Features ◄
|
|
141
|
+
Step 3: Design
|
|
142
|
+
Step 4: Build
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Handle "continue" Naturally
|
|
146
|
+
|
|
147
|
+
When user says: continue, next, yes, keep going, proceed, go ahead, let's do it
|
|
148
|
+
|
|
149
|
+
→ Move to next step or continue current step
|
|
150
|
+
|
|
151
|
+
### Handle Questions
|
|
152
|
+
|
|
153
|
+
If user asks about the process:
|
|
154
|
+
> "We're working through 4 steps: Vision → Features → Design → Build. You're on step 2. Just say 'continue' when you're ready to move forward."
|
|
155
|
+
|
|
156
|
+
## Behind the Scenes
|
|
157
|
+
|
|
158
|
+
The skill uses the Initiative Flow Framework internally but **never exposes this to the user**.
|
|
159
|
+
|
|
160
|
+
| User Sees | Framework Does |
|
|
161
|
+
|-----------|----------------|
|
|
162
|
+
| Step 1: Vision | Creates strategic-mandate.md, passes strategic gate |
|
|
163
|
+
| Step 2: Features | Creates prd.md and epics, passes product gate |
|
|
164
|
+
| Step 3: Design | Creates ADRs, stories, tasks, passes design gate |
|
|
165
|
+
| Step 4: Build | Creates implementation files, tracks progress |
|
|
166
|
+
|
|
167
|
+
### File Management
|
|
168
|
+
|
|
169
|
+
Create files silently in: `projects/{project-slug}/`
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
projects/ai-trading-simulator/
|
|
173
|
+
├── locus.md # Combined readable plan
|
|
174
|
+
├── vision.md # Step 1 output
|
|
175
|
+
├── features.md # Step 2 output
|
|
176
|
+
├── design.md # Step 3 output
|
|
177
|
+
└── tasks/ # Step 4 breakdown
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### State Tracking
|
|
181
|
+
|
|
182
|
+
Track state in a simple format:
|
|
183
|
+
```yaml
|
|
184
|
+
# projects/{slug}/.locus-state.yaml
|
|
185
|
+
project: AI Trading Simulator
|
|
186
|
+
current_step: 2
|
|
187
|
+
steps:
|
|
188
|
+
1: complete
|
|
189
|
+
2: in_progress
|
|
190
|
+
3: pending
|
|
191
|
+
4: pending
|
|
192
|
+
created: 2025-01-20
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Example Conversation
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
User: I want to build an AI trading simulator
|
|
199
|
+
|
|
200
|
+
AI: I'll help you plan and build this step by step.
|
|
201
|
+
|
|
202
|
+
📋 AI Trading Simulator
|
|
203
|
+
━━━━━━━━━━━━━━━━━━━━━━━
|
|
204
|
+
→ Step 1: Vision ◄ you are here
|
|
205
|
+
Step 2: Features
|
|
206
|
+
Step 3: Design
|
|
207
|
+
Step 4: Build
|
|
208
|
+
|
|
209
|
+
Let's start with the vision.
|
|
210
|
+
|
|
211
|
+
What problem does this solve? Who would use it?
|
|
212
|
+
|
|
213
|
+
User: People who want to learn trading without risking real money.
|
|
214
|
+
It should use AI to help them learn faster.
|
|
215
|
+
|
|
216
|
+
AI: Got it — a risk-free trading simulator with AI-powered learning.
|
|
217
|
+
|
|
218
|
+
A few quick questions:
|
|
219
|
+
1. Should it simulate real market data or simplified scenarios?
|
|
220
|
+
2. Web app, mobile, or both?
|
|
221
|
+
|
|
222
|
+
User: Real market data, web app first
|
|
223
|
+
|
|
224
|
+
AI: Perfect. Here's the vision:
|
|
225
|
+
|
|
226
|
+
**AI Trading Simulator**
|
|
227
|
+
A web-based trading simulator using real market data where users
|
|
228
|
+
can practice trading strategies risk-free, with AI providing
|
|
229
|
+
personalized feedback to accelerate learning.
|
|
230
|
+
|
|
231
|
+
✓ Step 1: Vision — complete
|
|
232
|
+
|
|
233
|
+
📋 AI Trading Simulator
|
|
234
|
+
━━━━━━━━━━━━━━━━━━━━━━━
|
|
235
|
+
✓ Step 1: Vision
|
|
236
|
+
→ Step 2: Features ◄ you are here
|
|
237
|
+
Step 3: Design
|
|
238
|
+
Step 4: Build
|
|
239
|
+
|
|
240
|
+
Ready to define features?
|
|
241
|
+
|
|
242
|
+
User: yes
|
|
243
|
+
|
|
244
|
+
AI: Let's figure out what it needs to do.
|
|
245
|
+
|
|
246
|
+
**Must-have features** (what's essential?):
|
|
247
|
+
- Virtual portfolio with fake money
|
|
248
|
+
- Real market data
|
|
249
|
+
- Basic buy/sell trades
|
|
250
|
+
- AI feedback on trades
|
|
251
|
+
|
|
252
|
+
**Nice-to-have** (if time permits?):
|
|
253
|
+
- Leaderboards
|
|
254
|
+
- Strategy backtesting
|
|
255
|
+
- Social features
|
|
256
|
+
|
|
257
|
+
Does this capture it, or should we add/remove anything?
|
|
258
|
+
|
|
259
|
+
User: Add paper trading competitions as nice-to-have. Otherwise good.
|
|
260
|
+
|
|
261
|
+
AI: Added. Here's the feature plan:
|
|
262
|
+
|
|
263
|
+
**Must Have**
|
|
264
|
+
• Virtual portfolio ($100k starting balance)
|
|
265
|
+
• Real-time market data (stocks)
|
|
266
|
+
• Buy/sell/short trades
|
|
267
|
+
• AI coach (analyzes trades, suggests improvements)
|
|
268
|
+
• Performance dashboard
|
|
269
|
+
|
|
270
|
+
**Nice to Have**
|
|
271
|
+
• Leaderboards & competitions
|
|
272
|
+
• Strategy backtesting
|
|
273
|
+
• Paper trading competitions
|
|
274
|
+
• Social sharing
|
|
275
|
+
|
|
276
|
+
✓ Step 2: Features — complete
|
|
277
|
+
|
|
278
|
+
📋 AI Trading Simulator
|
|
279
|
+
━━━━━━━━━━━━━━━━━━━━━━━
|
|
280
|
+
✓ Step 1: Vision
|
|
281
|
+
✓ Step 2: Features
|
|
282
|
+
→ Step 3: Design ◄ you are here
|
|
283
|
+
Step 4: Build
|
|
284
|
+
|
|
285
|
+
Continue to design?
|
|
286
|
+
|
|
287
|
+
User: continue
|
|
288
|
+
|
|
289
|
+
AI: Now let's figure out how to build this...
|
|
290
|
+
[Continues to design step]
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## Constraints
|
|
294
|
+
|
|
295
|
+
- **Never use jargon**: No "tiers", "gates", "artifacts", "epics", "ADRs"
|
|
296
|
+
- **Never show file paths**: User doesn't need to know where files are
|
|
297
|
+
- **Always show progress**: The 4-step visual keeps users oriented
|
|
298
|
+
- **Keep it conversational**: Like talking to a helpful colleague
|
|
299
|
+
- **One thing at a time**: Don't overwhelm with options
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 SwiggitySwerve
|
|
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,124 @@
|
|
|
1
|
+
# Locus Product Planning
|
|
2
|
+
|
|
3
|
+
**Your center point for planning and building products with AI.**
|
|
4
|
+
|
|
5
|
+
Locus guides you from idea to implementation through a simple 4-step process. No complicated commands to learn - just describe what you want to build.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
You: I want to build an AI trading simulator
|
|
11
|
+
|
|
12
|
+
Locus: I'll help you plan and build this step by step.
|
|
13
|
+
|
|
14
|
+
📋 AI Trading Simulator
|
|
15
|
+
━━━━━━━━━━━━━━━━━━━━━━━
|
|
16
|
+
→ Step 1: Vision ◄
|
|
17
|
+
Step 2: Features
|
|
18
|
+
Step 3: Design
|
|
19
|
+
Step 4: Build
|
|
20
|
+
|
|
21
|
+
What problem does this solve?
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Say **"continue"** to move forward. That's it.
|
|
25
|
+
|
|
26
|
+
## How It Works
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
Step 1: Vision → What are we building and why?
|
|
30
|
+
Step 2: Features → What will it do?
|
|
31
|
+
Step 3: Design → How will it work?
|
|
32
|
+
Step 4: Build → Let's make it
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Commands
|
|
36
|
+
|
|
37
|
+
| Command | Description |
|
|
38
|
+
|---------|-------------|
|
|
39
|
+
| `/locus` | Start or resume a project |
|
|
40
|
+
| `/locus-status` | Show current project progress |
|
|
41
|
+
| `/locus-list` | List all projects |
|
|
42
|
+
|
|
43
|
+
Or just describe what you want: "I want to build..."
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
### npm (Recommended)
|
|
48
|
+
|
|
49
|
+
Add to your `opencode.json`:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"plugin": ["opencode-locus-product-planning"]
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
That's it! OpenCode will automatically install the plugin on startup.
|
|
58
|
+
|
|
59
|
+
### Manual Installation
|
|
60
|
+
|
|
61
|
+
Clone the repo and copy the skill:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
git clone https://github.com/SwiggitySwerve/locus-product-planning.git
|
|
65
|
+
cp -r locus-product-planning/.opencode/skills/locus ~/.config/opencode/skills/
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Or reference it directly in `opencode.json`:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"instructions": ["~/.config/opencode/skills/locus/SKILL.md"]
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Development Setup
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
git clone https://github.com/SwiggitySwerve/locus-product-planning.git
|
|
80
|
+
cd locus-product-planning
|
|
81
|
+
npm install
|
|
82
|
+
npm test # 79 tests
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## For Power Users
|
|
86
|
+
|
|
87
|
+
Under the hood, Locus uses a full organizational workflow framework with:
|
|
88
|
+
|
|
89
|
+
- **Machine-checkable gates** ensuring quality at each stage
|
|
90
|
+
- **State machine** managing project transitions
|
|
91
|
+
- **79 tests** ensuring reliability
|
|
92
|
+
|
|
93
|
+
### CLI Access
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npm run cli -- status INI-EXAMPLE-001
|
|
97
|
+
npm run cli -- gate INI-EXAMPLE-001 product
|
|
98
|
+
npm run cli -- next INI-EXAMPLE-001
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Project Structure
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
.opencode/
|
|
105
|
+
└── skills/
|
|
106
|
+
└── locus/
|
|
107
|
+
└── SKILL.md # Main planning skill
|
|
108
|
+
|
|
109
|
+
openspec/
|
|
110
|
+
├── lib/ # TypeScript framework
|
|
111
|
+
└── initiatives/ # Project artifacts
|
|
112
|
+
|
|
113
|
+
opencode.json # Command definitions
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Why "Locus"?
|
|
117
|
+
|
|
118
|
+
**Locus** (noun): A center point; a place where something is situated or occurs.
|
|
119
|
+
|
|
120
|
+
Your projects need a center point - a place where vision, planning, and execution converge. That's Locus.
|
|
121
|
+
|
|
122
|
+
## License
|
|
123
|
+
|
|
124
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locus - OpenCode Plugin
|
|
3
|
+
*
|
|
4
|
+
* AI-powered project planning: Vision → Features → Design → Build
|
|
5
|
+
*
|
|
6
|
+
* This plugin provides the /locus commands for project planning.
|
|
7
|
+
* The main skill is auto-discovered from .opencode/skills/locus/SKILL.md
|
|
8
|
+
*/
|
|
9
|
+
import type { Plugin } from "@opencode-ai/plugin";
|
|
10
|
+
/**
|
|
11
|
+
* Read the Locus skill content
|
|
12
|
+
*/
|
|
13
|
+
declare function getSkillContent(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Get project state from .locus-state.yaml
|
|
16
|
+
*/
|
|
17
|
+
declare function getProjectState(projectPath: string): Record<string, unknown> | null;
|
|
18
|
+
/**
|
|
19
|
+
* List all projects in the projects/ directory
|
|
20
|
+
*/
|
|
21
|
+
declare function listProjects(directory: string): Array<{
|
|
22
|
+
name: string;
|
|
23
|
+
path: string;
|
|
24
|
+
state: Record<string, unknown> | null;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Format project status for display
|
|
28
|
+
*/
|
|
29
|
+
declare function formatProjectStatus(state: Record<string, unknown> | null, projectName: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Locus Plugin for OpenCode
|
|
32
|
+
*/
|
|
33
|
+
export declare const LocusPlugin: Plugin;
|
|
34
|
+
export default LocusPlugin;
|
|
35
|
+
export { getSkillContent, getProjectState, listProjects, formatProjectStatus };
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAWlD;;GAEG;AACH,iBAAS,eAAe,IAAI,MAAM,CAMjC;AAED;;GAEG;AACH,iBAAS,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAmB5E;AAED;;GAEG;AACH,iBAAS,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAAE,CAAC,CAwBrH;AAED;;GAEG;AACH,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAqB/F;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MASzB,CAAC;AAGF,eAAe,WAAW,CAAC;AAG3B,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locus - OpenCode Plugin
|
|
3
|
+
*
|
|
4
|
+
* AI-powered project planning: Vision → Features → Design → Build
|
|
5
|
+
*
|
|
6
|
+
* This plugin provides the /locus commands for project planning.
|
|
7
|
+
* The main skill is auto-discovered from .opencode/skills/locus/SKILL.md
|
|
8
|
+
*/
|
|
9
|
+
import { readFileSync, existsSync, readdirSync, statSync } from "fs";
|
|
10
|
+
import { join, dirname } from "path";
|
|
11
|
+
import { fileURLToPath } from "url";
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = dirname(__filename);
|
|
14
|
+
// Path to skill file (relative to dist/)
|
|
15
|
+
const SKILL_PATH = join(__dirname, "..", ".opencode", "skills", "locus", "SKILL.md");
|
|
16
|
+
/**
|
|
17
|
+
* Read the Locus skill content
|
|
18
|
+
*/
|
|
19
|
+
function getSkillContent() {
|
|
20
|
+
try {
|
|
21
|
+
return readFileSync(SKILL_PATH, "utf-8");
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return "Locus skill not found. Please reinstall opencode-locus.";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get project state from .locus-state.yaml
|
|
29
|
+
*/
|
|
30
|
+
function getProjectState(projectPath) {
|
|
31
|
+
const statePath = join(projectPath, ".locus-state.yaml");
|
|
32
|
+
if (!existsSync(statePath))
|
|
33
|
+
return null;
|
|
34
|
+
try {
|
|
35
|
+
const content = readFileSync(statePath, "utf-8");
|
|
36
|
+
// Simple YAML parsing for our state format
|
|
37
|
+
const state = {};
|
|
38
|
+
const lines = content.split("\n");
|
|
39
|
+
for (const line of lines) {
|
|
40
|
+
const match = line.match(/^(\w+):\s*(.+)$/);
|
|
41
|
+
if (match) {
|
|
42
|
+
state[match[1]] = match[2];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return state;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* List all projects in the projects/ directory
|
|
53
|
+
*/
|
|
54
|
+
function listProjects(directory) {
|
|
55
|
+
const projectsDir = join(directory, "projects");
|
|
56
|
+
if (!existsSync(projectsDir))
|
|
57
|
+
return [];
|
|
58
|
+
const projects = [];
|
|
59
|
+
try {
|
|
60
|
+
const entries = readdirSync(projectsDir);
|
|
61
|
+
for (const entry of entries) {
|
|
62
|
+
const entryPath = join(projectsDir, entry);
|
|
63
|
+
const stat = statSync(entryPath);
|
|
64
|
+
if (stat.isDirectory() && !entry.startsWith(".")) {
|
|
65
|
+
projects.push({
|
|
66
|
+
name: entry,
|
|
67
|
+
path: entryPath,
|
|
68
|
+
state: getProjectState(entryPath),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
// Ignore errors
|
|
75
|
+
}
|
|
76
|
+
return projects;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Format project status for display
|
|
80
|
+
*/
|
|
81
|
+
function formatProjectStatus(state, projectName) {
|
|
82
|
+
const steps = ["Vision", "Features", "Design", "Build"];
|
|
83
|
+
if (!state) {
|
|
84
|
+
return `📋 ${projectName}\n━━━━━━━━━━━━━━━━━━\nNo state found. Start with /locus.`;
|
|
85
|
+
}
|
|
86
|
+
const currentStep = Number(state.current_step) || 1;
|
|
87
|
+
let output = `📋 ${state.project || projectName}\n━━━━━━━━━━━━━━━━━━\n`;
|
|
88
|
+
for (let i = 0; i < steps.length; i++) {
|
|
89
|
+
const stepNum = i + 1;
|
|
90
|
+
const prefix = stepNum < currentStep ? "✓" : stepNum === currentStep ? "→" : " ";
|
|
91
|
+
const suffix = stepNum === currentStep ? " ◄ you are here" : "";
|
|
92
|
+
output += `${prefix} Step ${stepNum}: ${steps[i]}${suffix}\n`;
|
|
93
|
+
}
|
|
94
|
+
const progress = Math.round(((currentStep - 1) / 4) * 100);
|
|
95
|
+
output += `\nProgress: ${progress}% complete`;
|
|
96
|
+
return output;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Locus Plugin for OpenCode
|
|
100
|
+
*/
|
|
101
|
+
export const LocusPlugin = async ({ directory }) => {
|
|
102
|
+
return {
|
|
103
|
+
// Log when plugin loads
|
|
104
|
+
event: async ({ event }) => {
|
|
105
|
+
if (event.type === "session.created") {
|
|
106
|
+
// Plugin is ready
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
// Default export for OpenCode plugin loading
|
|
112
|
+
export default LocusPlugin;
|
|
113
|
+
// Named exports for programmatic use
|
|
114
|
+
export { getSkillContent, getProjectState, listProjects, formatProjectStatus };
|
package/opencode.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opencode.ai/config.json",
|
|
3
|
+
"command": {
|
|
4
|
+
"locus": {
|
|
5
|
+
"template": "Load the 'locus' skill and help the user plan their project.\n\nIf they provided a project idea: $ARGUMENTS\nStart with Step 1: Vision.\n\nIf no idea provided, ask what they want to build.",
|
|
6
|
+
"description": "Start or resume a project (Vision → Features → Design → Build)"
|
|
7
|
+
},
|
|
8
|
+
"locus-status": {
|
|
9
|
+
"template": "Show the current Locus project status.\n\nLook in projects/ for the most recent project.\nRead .locus-state.yaml and display progress visually.\nKeep it simple - no file paths or technical jargon.",
|
|
10
|
+
"description": "Show current project progress"
|
|
11
|
+
},
|
|
12
|
+
"locus-list": {
|
|
13
|
+
"template": "List all Locus projects in the projects/ directory.\n\nFor each, show: name, current step, last updated.\nDisplay as a clean list. If none exist, suggest starting one with /locus.",
|
|
14
|
+
"description": "List all projects"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "locus-product-planning",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "AI-powered product planning for OpenCode - Vision → Features → Design → Build",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./skill": "./.opencode/skills/locus/SKILL.md"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
".opencode/skills/locus",
|
|
18
|
+
"opencode.json"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.plugin.json",
|
|
22
|
+
"prepublishOnly": "npm run build",
|
|
23
|
+
"test": "vitest run",
|
|
24
|
+
"test:watch": "vitest",
|
|
25
|
+
"test:coverage": "vitest run --coverage",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"cli": "npx tsx openspec/bin/cli.ts"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"opencode",
|
|
31
|
+
"opencode-plugin",
|
|
32
|
+
"ai",
|
|
33
|
+
"planning",
|
|
34
|
+
"project-management",
|
|
35
|
+
"workflow"
|
|
36
|
+
],
|
|
37
|
+
"author": "swiggityswerve",
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/SwiggitySwerve/locus-product-planning.git"
|
|
42
|
+
},
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/SwiggitySwerve/locus-product-planning/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/SwiggitySwerve/locus-product-planning#readme",
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@opencode-ai/plugin": ">=1.0.0"
|
|
49
|
+
},
|
|
50
|
+
"peerDependenciesMeta": {
|
|
51
|
+
"@opencode-ai/plugin": {
|
|
52
|
+
"optional": true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@opencode-ai/plugin": "^1.1.28",
|
|
57
|
+
"@types/node": "^20.10.0",
|
|
58
|
+
"glob": "^10.3.10",
|
|
59
|
+
"ts-node": "^10.9.2",
|
|
60
|
+
"tsx": "^4.21.0",
|
|
61
|
+
"typescript": "^5.3.0",
|
|
62
|
+
"vitest": "^1.2.0",
|
|
63
|
+
"yaml": "^2.3.4"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=18.0.0"
|
|
67
|
+
}
|
|
68
|
+
}
|