@forloop-cc/forloop-opencode-plugin-planner 2.2.1

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +225 -0
  2. package/CODE_OF_CONDUCT.md +77 -0
  3. package/CONTRIBUTING.md +176 -0
  4. package/LICENSE +21 -0
  5. package/README.md +211 -0
  6. package/SECURITY.md +69 -0
  7. package/docs/CONFIGURATION.md +283 -0
  8. package/docs/DEVELOPER-VS-USER.md +129 -0
  9. package/docs/IMPROVED-AUTHENTICATION.md +317 -0
  10. package/docs/INSTALLATION-SCRIPTS.md +304 -0
  11. package/docs/PLANNER-AGENT-IMPROVEMENTS.md +88 -0
  12. package/docs/PLUGIN-ARCHITECTURE.md +308 -0
  13. package/docs/QUICKSTART-NON-DEV.md +94 -0
  14. package/docs/README-FOR-HUMANS-AND-AI.md +109 -0
  15. package/docs/README.md +70 -0
  16. package/docs/SKILLS-GAP-ANALYSIS.md +157 -0
  17. package/docs/USER-INTERACTION-MODEL.md +106 -0
  18. package/docs/file-management/2026-04-12-forloop-aivy-documents-sync.md +395 -0
  19. package/docs/file-management/FILE_UPLOAD_ENHANCEMENT.md +431 -0
  20. package/docs/file-management/FILE_UPLOAD_FLOW.md +300 -0
  21. package/docs/images/forloop-opencode-flow.png +0 -0
  22. package/docs/images/forloop-opencode-header.png +0 -0
  23. package/docs/superpowers/plans/2026-05-03-sprint-isolated-directory-structure.md +1450 -0
  24. package/docs/superpowers/plans/2026-05-29-install-system.md +850 -0
  25. package/docs/superpowers/specs/2026-05-03-sprint-isolated-directory-structure-design.md +149 -0
  26. package/docs/superpowers/specs/2026-05-19-opencode-message-recording-design.md +468 -0
  27. package/docs/superpowers/specs/2026-05-29-install-system-design.md +135 -0
  28. package/install.sh +317 -0
  29. package/package.json +87 -0
  30. package/plugins/capabilities/api-client.ts +556 -0
  31. package/plugins/capabilities/auth.ts +120 -0
  32. package/plugins/capabilities/config.ts +195 -0
  33. package/plugins/capabilities/context-resolver.ts +106 -0
  34. package/plugins/capabilities/token-storage.ts +98 -0
  35. package/plugins/forloop-plugin.ts +186 -0
  36. package/plugins/hooks/message-recorder.ts +258 -0
  37. package/plugins/hooks/shell-env.ts +62 -0
  38. package/plugins/tools/agent-sprint-tools.ts +100 -0
  39. package/plugins/tools/agent-suggestion-tools.ts +275 -0
  40. package/plugins/tools/agent-tools.ts +114 -0
  41. package/plugins/tools/ai-trigger-tools.ts +79 -0
  42. package/plugins/tools/developer-status-tool.ts +97 -0
  43. package/plugins/tools/file-tools.ts +240 -0
  44. package/plugins/tools/folder-tools.ts +75 -0
  45. package/plugins/tools/organization-tools.ts +213 -0
  46. package/plugins/tools/schedule-tools.ts +173 -0
  47. package/plugins/tools/sprint-tools.ts +287 -0
  48. package/plugins/tools/story-tools.ts +320 -0
  49. package/plugins/tools/sync-tools.ts +509 -0
  50. package/plugins/tools/template-tools.ts +170 -0
  51. package/plugins/tools/user-tools.ts +146 -0
  52. package/scripts/migrate-tokens.js +90 -0
  53. package/scripts/use-prod.sh +11 -0
  54. package/tsconfig.json +17 -0
  55. package/update.sh +172 -0
@@ -0,0 +1,308 @@
1
+ # ForLoop Plugin Architecture
2
+
3
+ ## Understanding opencode Plugin Storage
4
+
5
+ This document clarifies where plugin files are stored and how opencode manages plugins.
6
+
7
+ ---
8
+
9
+ ## Plugin Storage Locations
10
+
11
+ ### 🤔 Why Don't You See Files in `./.opencode/` or `~/.config/opencode/`?
12
+
13
+ **Short answer:** opencode caches plugins elsewhere!
14
+
15
+ ### ✅ Actual Storage Locations
16
+
17
+ | Location | Purpose | Example Path |
18
+ |----------|---------|--------------|
19
+ | **Plugin Cache** | Where installed plugins live | `~/.cache/opencode/node_modules/` |
20
+ | **Global Config** | Plugin configuration | `~/.config/opencode/opencode.json` |
21
+ | **Project Config** | Project-specific settings | `./opencode.json` |
22
+ | **Plugin State** | Runtime state, tokens | `~/.local/state/opencode/` |
23
+ | **Plugin Data** | Persistent data | `~/.local/share/opencode/` |
24
+
25
+ ---
26
+
27
+ ## How It Works
28
+
29
+ ### 1. Configuration (You Specify)
30
+
31
+ ```json
32
+ {
33
+ "plugin": ["superpowers@git+https://github.com/obra/superpowers.git"]
34
+ }
35
+ ```
36
+
37
+ This tells opencode: "Install and use the superpowers plugin from this git repo"
38
+
39
+ ### 2. Installation (opencode Handles)
40
+
41
+ When opencode starts:
42
+ 1. Reads `opencode.json` (global or project)
43
+ 2. Downloads plugin to cache: `~/.cache/opencode/node_modules/superpowers/`
44
+ 3. Loads plugin from cache (not from your project)
45
+
46
+ ### 3. Runtime (Auto-managed)
47
+
48
+ Plugin loads from cache location automatically. You don't need to know where it is!
49
+
50
+ ---
51
+
52
+ ## Directory Structure
53
+
54
+ ### For Users (What You See)
55
+
56
+ ```
57
+ your-project/
58
+ ├── opencode.json # Plugin configuration
59
+ └── .opencode/ # Your custom skills/hooks (optional)
60
+ └── skills/ # Your personal skills
61
+ ```
62
+
63
+ ### Actually Stored (Hidden from You)
64
+
65
+ ```
66
+ ~/.cache/opencode/
67
+ └── node_modules/
68
+ ├── superpowers/ # Superpowers plugin cached here
69
+ │ ├── .opencode/
70
+ │ │ └── plugins/
71
+ │ │ └── superpowers.js
72
+ │ ├── skills/
73
+ │ └── package.json
74
+ └── @forloop/
75
+ └── opencode-plugin/ # ForLoop plugin would be here
76
+
77
+ ~/.config/opencode/
78
+ ├── opencode.json # Global configuration
79
+ └── tokens.json # API tokens
80
+
81
+ ~/.local/state/opencode/ # Runtime state
82
+ ~/.local/share/opencode/ # Persistent data
83
+ ```
84
+
85
+ ---
86
+
87
+ ## Why This Architecture?
88
+
89
+ ### Benefits
90
+
91
+ 1. **Clean Projects** - No plugin clutter in your codebase
92
+ 2. **Global Caching** - Plugins shared across projects
93
+ 3. **Auto Updates** - opencode manages plugin versions
94
+ 4. **No Symlinks** - No manual file management needed
95
+ 5. **Secure** - Tokens stored in user directory, not project
96
+
97
+ ### How It Differs from Traditional npm
98
+
99
+ **Traditional npm:**
100
+ ```
101
+ project/
102
+ ├── node_modules/ # Dependencies in project
103
+ │ └── package-name/
104
+ └── package.json
105
+ ```
106
+
107
+ **opencode plugins:**
108
+ ```
109
+ ~/.cache/opencode/node_modules/ # Shared cache
110
+ └── plugin-name/
111
+
112
+ project/
113
+ └── opencode.json # Just configuration
114
+ ```
115
+
116
+ ---
117
+
118
+ ## ForLoop Plugin Structure
119
+
120
+ ### Distribution Package
121
+
122
+ When you install ForLoop plugin via npm or git:
123
+
124
+ ```json
125
+ {
126
+ "plugin": ["forloop@git+https://github.com/forloop-cc/forloop-opencode-plugin.git"]
127
+ }
128
+ ```
129
+
130
+ **What happens:**
131
+ 1. opencode clones to cache: `~/.cache/opencode/node_modules/@forloop/opencode-plugin/`
132
+ 2. Loads plugin from cache
133
+ 3. Makes tools available in your session
134
+
135
+ **Package contents:**
136
+ ```
137
+ @forloop/opencode-plugin/
138
+ ├── plugins/
139
+ │ ├── forloop-plugin.ts # Main entry
140
+ │ ├── capabilities/
141
+ │ │ ├── config.ts
142
+ │ │ ├── token-storage.ts
143
+ │ │ └── api-client.ts
144
+ │ ├── tools/
145
+ │ │ ├── sprint-tools.ts
146
+ │ │ ├── story-tools.ts
147
+ │ │ └── agent-suggestion-tools.ts
148
+ │ └── hooks/
149
+ │ └── shell-env.ts
150
+ ├── skills/
151
+ │ └── forloop-skill.md
152
+ └── package.json
153
+ ```
154
+
155
+ **But you don't need to manage this!** opencode handles it.
156
+
157
+ ---
158
+
159
+ ## Development vs Production
160
+
161
+ ### Development (Your Current Setup)
162
+
163
+ You have symlinks in your project:
164
+ ```
165
+ ~/projects/forloop/
166
+ ├── .opencode/plugins -> ../forloop-opencode/plugins
167
+ ├── forloop-opencode/ # Source code
168
+ └── opencode.json
169
+ ```
170
+
171
+ This is **only for development** - you're manually linking to test changes.
172
+
173
+ ### Production (npm/git installation)
174
+
175
+ Users just specify in `opencode.json`:
176
+ ```json
177
+ {
178
+ "plugin": ["forloop@git+https://github.com/forloop-cc/forloop-opencode-plugin.git"]
179
+ }
180
+ ```
181
+
182
+ And opencode:
183
+ 1. Downloads to cache
184
+ 2. Manages updates
185
+ 3. Loads automatically
186
+
187
+ Users **never see the plugin files** - they just use the tools!
188
+
189
+ ---
190
+
191
+ ## Common Questions
192
+
193
+ ### Q: Where are my plugin files?
194
+
195
+ **A:** In `~/.cache/opencode/node_modules/@forloop/opencode-plugin/`
196
+
197
+ To check:
198
+ ```bash
199
+ ls -la ~/.cache/opencode/node_modules/@forloop/opencode-plugin/
200
+ ```
201
+
202
+ ### Q: Do I need to copy plugin files to my project?
203
+
204
+ **A:** No! Just configure in `opencode.json`:
205
+ ```json
206
+ {
207
+ "plugin": ["forloop@git+https://github.com/forloop-cc/forloop-opencode-plugin.git"]
208
+ }
209
+ ```
210
+
211
+ ### Q: How do I update plugins?
212
+
213
+ **A:** opencode auto-updates git plugins on restart. For npm:
214
+ ```bash
215
+ npm update @forloop/opencode-plugin
216
+ ```
217
+
218
+ ### Q: Where are tokens stored?
219
+
220
+ **A:** `~/.config/forloop/tokens.json` (global, not in project)
221
+
222
+ ### Q: Can I have project-specific plugins?
223
+
224
+ **A:** Yes! Project `opencode.json` overrides global config.
225
+
226
+ ---
227
+
228
+ ## Comparison: Superpowers vs ForLoop
229
+
230
+ ### Superpowers Installation
231
+
232
+ ```json
233
+ {
234
+ "plugin": ["superpowers@git+https://github.com/obra/superpowers.git"]
235
+ }
236
+ ```
237
+
238
+ **Stored in:** `~/.cache/opencode/node_modules/superpowers/`
239
+
240
+ **Visible to user:** Only the tools (`skill` tool for using superpowers skills)
241
+
242
+ ### ForLoop Installation
243
+
244
+ ```json
245
+ {
246
+ "plugin": ["forloop@git+https://github.com/forloop-cc/forloop-opencode-plugin.git"]
247
+ }
248
+ ```
249
+
250
+ **Stored in:** `~/.cache/opencode/node_modules/@forloop/opencode-plugin/`
251
+
252
+ **Visible to user:** Only the tools (`forloopSprintList`, etc.)
253
+
254
+ ### What You See as a User
255
+
256
+ Both plugins:
257
+ - ✅ Appear in opencode tool list
258
+ - ✅ Can be used naturally ("List my sprints")
259
+ - ✅ Automatically loaded on startup
260
+ - ❌ **No files in your project folder** (by design!)
261
+
262
+ ---
263
+
264
+ ## For Plugin Developers
265
+
266
+ ### What to Distribute
267
+
268
+ Your plugin package should include:
269
+
270
+ ```
271
+ your-plugin/
272
+ ├── plugins/
273
+ │ └── your-plugin.ts # Main entry point
274
+ ├── package.json # npm package config
275
+ └── README.md # Documentation
276
+ ```
277
+
278
+ ### What Users See
279
+
280
+ Users only need to add one line to their `opencode.json`:
281
+
282
+ ```json
283
+ {
284
+ "plugin": ["your-plugin@git+https://github.com/you/your-plugin.git"]
285
+ }
286
+ ```
287
+
288
+ Everything else is automatic!
289
+
290
+ ---
291
+
292
+ ## Summary
293
+
294
+ | Aspect | Location | Managed By |
295
+ |--------|----------|------------|
296
+ | Plugin Code | `~/.cache/opencode/node_modules/` | opencode |
297
+ | Configuration | `opencode.json` (project or global) | You |
298
+ | Tokens | `~/.config/forloop/tokens.json` | Plugin |
299
+ | State | `~/.local/state/opencode/` | opencode |
300
+ | Your Skills | `./.opencode/skills/` (optional) | You |
301
+
302
+ **Key Takeaway:** opencode plugins are **hidden by design** - you configure them in `opencode.json` and use their tools, but don't manage files directly.
303
+
304
+ ---
305
+
306
+ **Updated:** 2026-03-23
307
+ **Version:** 2.0.0
308
+
@@ -0,0 +1,94 @@
1
+ # Quick Start for Non-Developers
2
+
3
+ **No coding required!** This guide is for users who just want to use the plugin, not develop it.
4
+
5
+ ## Prerequisites (5 minutes)
6
+
7
+ 1. **Install opencode** (free, open-source)
8
+ ```bash
9
+ curl -fsSL https://opencode.ai/install.sh | bash
10
+ ```
11
+
12
+ 2. **Create ForLoop account**
13
+ - Go to [forloop.cc](https://forloop.cc)
14
+ - Sign up for free
15
+
16
+ 3. **Create API token**
17
+ - Go to [forloop.cc/profile?tab=api-tokens](https://forloop.cc/profile?tab=api-tokens)
18
+ - Click "Create New Token"
19
+ - Select scopes: `sprint:read`, `sprint:write`, `story:read`, `story:write`, `agent:query`, `profile:read`
20
+ - Copy the token (starts with `floop_`)
21
+
22
+ ## Install Plugin (2 options)
23
+
24
+ ### Option 1: One-Line Install (Easiest)
25
+ ```bash
26
+ curl -fsSL https://raw.githubusercontent.com/forloop-cc/forloop-opencode-plugin/main/install.sh | bash
27
+ ```
28
+
29
+ ### Option 2: npm Install
30
+ ```bash
31
+ npm install @forloop/opencode-plugin
32
+ ```
33
+
34
+ ## Set Your Token
35
+
36
+ In opencode chat, run:
37
+ ```
38
+ forloopTokenSet --token floop_YOUR_TOKEN_HERE
39
+ ```
40
+
41
+ ## You're Ready! 🎉
42
+
43
+ Just use commands in opencode chat:
44
+
45
+ ### List Sprints
46
+ ```
47
+ forloopSprintList
48
+ ```
49
+
50
+ ### Create a Story
51
+ ```
52
+ forloopStoryCreate --title "As a user, I want to login" --sprintId 14 --priority high
53
+ ```
54
+
55
+ ### Get AI Help
56
+ ```
57
+ forloopAgentBreakdown --storyId 78
58
+ ```
59
+
60
+ ## Common Commands Cheat Sheet
61
+
62
+ | What You Want to Do | Command |
63
+ |---------------------|---------|
64
+ | See all sprints | `forloopSprintList` |
65
+ | See sprint details | `forloopSprintGet --sprintId 14` |
66
+ | Create story | `forloopStoryCreate --title "..." --sprintId 14` |
67
+ | Update story | `forloopStoryUpdate --storyId 78 --status done` |
68
+ | Get AI breakdown | `forloopAgentBreakdown --storyId 78` |
69
+ | Get AI estimate | `forloopAgentEstimate --storyId 78` |
70
+ | Check your token | `forloopTokenGet` |
71
+
72
+ ## That's It!
73
+
74
+ **You don't need to:**
75
+ - ❌ Know TypeScript
76
+ - ❌ Run npm commands
77
+ - ❌ Edit code
78
+ - ❌ Understand plugin architecture
79
+
80
+ **Just:**
81
+ - ✅ Install opencode
82
+ - ✅ Install plugin
83
+ - ✅ Set token
84
+ - ✅ Use commands in chat
85
+
86
+ ## Need Help?
87
+
88
+ - **FAQ**: See [README.md](../README.md#faq)
89
+ - **Full Documentation**: [docs/](../docs/)
90
+ - **Issues**: [GitHub Issues](https://github.com/forloop-cc/forloop-opencode-plugin/issues)
91
+
92
+ ---
93
+
94
+ **For Developers:** If you want to modify or extend the plugin, see [Developer vs User](DEVELOPER-VS-USER.md).
@@ -0,0 +1,109 @@
1
+ # Documentation for Both Humans and AI
2
+
3
+ ## Understanding This Plugin's Documentation
4
+
5
+ The ForLoop opencode plugin documentation is designed to be read by **both humans and AI agents**.
6
+
7
+ ### Usage Examples Section - Who Is It For?
8
+
9
+ **Both! Here's how each uses it:**
10
+
11
+ #### For AI Agents 🤖
12
+
13
+ The Usage Examples section helps AI understand:
14
+ - **Tool invocation syntax**: How to properly call each tool
15
+ - **Parameter patterns**: Which arguments are required vs optional
16
+ - **Context matching**: When to suggest which tool based on user requests
17
+
18
+ **Example AI behavior:**
19
+ ```
20
+ User: "How do I break down this story?"
21
+ AI reads docs → Finds forloopAgentBreakdown → Suggests:
22
+ "Use: forloopAgentBreakdown --storyId 456"
23
+ ```
24
+
25
+ #### For Humans 👤
26
+
27
+ The same section helps humans:
28
+ - **Quick reference**: Copy-paste ready commands
29
+ - **Parameter guide**: See what options are available
30
+ - **Learning pattern**: Understand tool capabilities
31
+
32
+ **Example human use:**
33
+ ```bash
34
+ # Copy from docs, modify for your needs
35
+ forloopAgentBreakdown --storyId 456
36
+ ```
37
+
38
+ ---
39
+
40
+ ## Documentation Layers
41
+
42
+ ### Layer 1: Quick Installation (Human-focused)
43
+
44
+ ```json
45
+ {
46
+ "plugin": ["forloop@git+https://github.com/forloop-cc/forloop-opencode-plugin.git"]
47
+ }
48
+ ```
49
+
50
+ **Purpose**: Get started in 10 seconds
51
+
52
+ ### Layer 2: Tool Tables (AI-parseable)
53
+
54
+ ```markdown
55
+ | Tool | Description |
56
+ |------|-------------|
57
+ | `forloopStoryCreate` | Create a new story |
58
+ ```
59
+
60
+ **Purpose**: Easy lookup for both humans and AI
61
+
62
+ ### Layer 3: Usage Examples (Dual-purpose)
63
+
64
+ ```bash
65
+ forloopStoryCreate --title "Feature" --sprintId 123
66
+ ```
67
+
68
+ **Purpose**:
69
+ - AI learns invocation patterns
70
+ - Humans get copy-paste templates
71
+
72
+ ### Layer 4: Context Notes (AI decision-making)
73
+
74
+ ```markdown
75
+ **When to use:**
76
+ - User wants to create a story
77
+ - User has sprint context
78
+ ```
79
+
80
+ **Purpose**: Helps AI decide when to suggest tools
81
+
82
+ ---
83
+
84
+ ## For Plugin Authors
85
+
86
+ When writing documentation for opencode plugins:
87
+
88
+ 1. **Structure consistently** - Headers, tables, code blocks
89
+ 2. **Be explicit** - Clear parameter descriptions
90
+ 3. **Include examples** - For both AI learning and human reference
91
+ 4. **Add usage context** - "When to use" sections help AI
92
+
93
+ ---
94
+
95
+ ## For Users
96
+
97
+ Don't worry about AI reading the docs! The documentation is:
98
+ - ✅ **Human-readable** first
99
+ - ✅ **AI-parseable** to enhance help
100
+ - ✅ **Search-friendly** for both
101
+
102
+ When you ask "How do I use ForLoop?", opencode reads this to:
103
+ 1. Find relevant tools
104
+ 2. Show correct syntax
105
+ 3. Guide you through the process
106
+
107
+ ---
108
+
109
+ **Summary**: Usage Examples are for **both** - AI learns how to invoke tools, humans get ready-to-use commands! 🎯
package/docs/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # ForLoop Plugin Documentation
2
+
3
+ Welcome to the ForLoop Plugin documentation. This folder contains comprehensive guides for using and contributing to the plugin.
4
+
5
+ ## 🚀 Quick Links
6
+
7
+ **Just want to use the plugin?**
8
+ - 👉 [Quick Start for Non-Developers](QUICKSTART-NON-DEV.md) - Start here!
9
+ - 📖 [How Users Interact](USER-INTERACTION-MODEL.md) - Understand the architecture
10
+ - 👥 [Developer vs User](DEVELOPER-VS-USER.md) - Which are you?
11
+
12
+ ## 📖 Documentation Structure
13
+
14
+ ### Getting Started
15
+ - [Installation Guide](installation/) - Install the plugin
16
+ - [Quick Start](../README.md#quick-start) - Get up and running fast
17
+ - [Configuration](CONFIGURATION.md) - Configure the plugin
18
+
19
+ ### Tool Reference
20
+ - [Sprint Tools](tools/sprints.md) - Sprint management operations
21
+ - [Story Tools](tools/stories.md) - Story CRUD operations
22
+ - [Agent Tools](tools/agents.md) - AI agent interactions
23
+ - [File Tools](tools/files.md) - File upload and management
24
+
25
+ ### Skills
26
+ - [Skills Overview](skills/overview.md) - Understanding skills
27
+ - [Creating Skills](skills/creating-skills.md) - Build your own skills
28
+ - [Skill Reference](skills/skill-reference.md) - All available skills
29
+
30
+ ### Agents
31
+ - [Agents Overview](agents/overview.md) - Understanding agents
32
+ - [Creating Agents](agents/creating-agents.md) - Build custom agents
33
+
34
+ ### Contributing
35
+ - [Contributing Guide](contributing/guide.md) - How to contribute
36
+ - [Code Style](contributing/code-style.md) - Coding standards
37
+ - [Testing Guide](contributing/testing.md) - Writing tests
38
+
39
+ ### API Reference
40
+ - [API Specification](API_SPECIFICATION.md) - API endpoints
41
+ - [Error Codes](api/error-codes.md) - Error reference
42
+
43
+ ## 📚 Key Documents
44
+
45
+ | Document | Description |
46
+ |----------|-------------|
47
+ | [README](../README.md) | User documentation and quick start |
48
+ | [CONTRIBUTING](../CONTRIBUTING.md) | Contribution guidelines |
49
+ | [CHANGELOG](../CHANGELOG.md) | Version history and changes |
50
+ | [STRUCTURE](../STRUCTURE.md) | Project structure overview |
51
+ | [SECURITY](../SECURITY.md) | Security policy |
52
+
53
+ ## 🆘 Need Help?
54
+
55
+ - **Issues**: [GitHub Issues](https://github.com/forloop-cc/forloop-opencode-plugin/issues)
56
+ - **Discussions**: [GitHub Discussions](https://github.com/forloop-cc/forloop-opencode-plugin/discussions)
57
+ - **Website**: [forloop.cc](https://forloop.cc)
58
+
59
+ ## 📝 Documentation Guidelines
60
+
61
+ When adding documentation:
62
+ - Use clear, concise language
63
+ - Include code examples where relevant
64
+ - Link to related documents
65
+ - Keep formatting consistent
66
+ - Update the table of contents
67
+
68
+ ---
69
+
70
+ *Last updated: 2026-04-17*