@laxture/vibe-pm 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.
Files changed (63) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +120 -0
  3. package/README.zh-CN.md +119 -0
  4. package/dist/core/commands.d.ts +17 -0
  5. package/dist/core/config.d.ts +12 -0
  6. package/dist/core/index.d.ts +8 -0
  7. package/dist/core/logger.d.ts +23 -0
  8. package/dist/core/plugin.d.ts +2 -0
  9. package/dist/core/types.d.ts +42 -0
  10. package/dist/docs/template/_coding_style/general.md +114 -0
  11. package/dist/docs/template/_coding_style/go.md +158 -0
  12. package/dist/docs/template/_coding_style/java.md +154 -0
  13. package/dist/docs/template/_coding_style/python.md +195 -0
  14. package/dist/docs/template/_coding_style/rust.md +161 -0
  15. package/dist/docs/template/_coding_style/sql.md +321 -0
  16. package/dist/docs/template/_coding_style/typescript.md +237 -0
  17. package/dist/docs/template/agents-template.md +38 -0
  18. package/dist/docs/template/bug-fix/flow.md +189 -0
  19. package/dist/docs/template/constitution-template.md +119 -0
  20. package/dist/docs/template/design-spec/flow.md +194 -0
  21. package/dist/docs/template/dictionary-template.md +40 -0
  22. package/dist/docs/template/large-refactor/flow.md +242 -0
  23. package/dist/docs/template/large-refactor/regulations/migration-checklist.md +28 -0
  24. package/dist/docs/template/research/flow.md +161 -0
  25. package/dist/docs/template/side-job/flow.md +147 -0
  26. package/dist/docs/template/spec-driven-dev/flow.md +420 -0
  27. package/dist/docs/template/spec-template.md +190 -0
  28. package/dist/engine/errors.d.ts +28 -0
  29. package/dist/engine/flow-engine.d.ts +32 -0
  30. package/dist/engine/index.d.ts +3 -0
  31. package/dist/i18n/index.d.ts +2 -0
  32. package/dist/i18n/loader.d.ts +23 -0
  33. package/dist/i18n/prompts-en-US.d.ts +47 -0
  34. package/dist/i18n/prompts-zh-CN.d.ts +50 -0
  35. package/dist/i18n/types.d.ts +51 -0
  36. package/dist/index.d.ts +5 -0
  37. package/dist/index.js +4886 -0
  38. package/dist/integration/dcp.d.ts +7 -0
  39. package/dist/integration/index.d.ts +1 -0
  40. package/dist/memory/errors.d.ts +11 -0
  41. package/dist/memory/index.d.ts +3 -0
  42. package/dist/memory/memory-system.d.ts +80 -0
  43. package/dist/memory/types.d.ts +157 -0
  44. package/dist/template/index.d.ts +3 -0
  45. package/dist/template/template-manager.d.ts +26 -0
  46. package/dist/template/types.d.ts +16 -0
  47. package/dist/token/backends/anthropic.d.ts +5 -0
  48. package/dist/token/backends/llama.d.ts +7 -0
  49. package/dist/token/backends/tiktoken.d.ts +7 -0
  50. package/dist/token/index.d.ts +3 -0
  51. package/dist/token/model-registry.d.ts +9 -0
  52. package/dist/token/token-counter.d.ts +17 -0
  53. package/dist/token/types.d.ts +39 -0
  54. package/dist/tui/components/collapsible.d.ts +9 -0
  55. package/dist/tui/components/empty-state.d.ts +7 -0
  56. package/dist/tui/data/task-status.d.ts +16 -0
  57. package/dist/tui/data/token-data.d.ts +16 -0
  58. package/dist/tui/index.d.ts +13 -0
  59. package/dist/tui/index.js +3293 -0
  60. package/dist/tui/slots/sidebar-content.d.ts +10 -0
  61. package/dist/tui/tui-plugin.d.ts +9 -0
  62. package/dist/tui/types.d.ts +63 -0
  63. package/package.json +63 -0
package/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 vibe-pm contributors
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # vibe-pm
2
+
3
+ ![NPM Version](https://img.shields.io/npm/v/@laxture/vibe-pm)
4
+ ![Test](https://github.com/hank-cp/opencode-vibe-pm/workflows/CI%20Test/badge.svg)
5
+ ![GitHub](https://img.shields.io/github/license/hank-cp/opencode-vibe-pm)
6
+ ![GitHub last commit](https://img.shields.io/github/last-commit/hank-cp/opencode-vibe-pm.svg)
7
+
8
+ > **Structured development workflows for OpenCode.**
9
+ >
10
+ > vibe-pm is a OpenCode plugin. It keeps vibe-coding on rails.
11
+
12
+ ## Why vibe-pm?
13
+
14
+ The problem:
15
+
16
+ - `AGENTS.md` and `rules/*.md` are force-loaded into every message, **wasting context window**
17
+ - Existing auto-trimming tools are **opaque** — you never know what was dropped or why
18
+ - Forgetting gets worse, not better — important context vanishes silently
19
+
20
+ vibe-pm solves this by injecting **only what the current step needs** — no more, no less. Every task is driven by three artifacts:
21
+
22
+ | Artifact | Answers |
23
+ |----------|---------|
24
+ | **Spec** | What to build |
25
+ | **Task Plan** | How to build it |
26
+ | **Task State** | Where we are now |
27
+
28
+ Key checkpoints require human approval. No silent drift.
29
+
30
+ ## Features
31
+
32
+ 1. Inject workflow control into LLM context — the plugin ensures **stable, controlled** vibe-coding sessions
33
+ 2. Teams **customize their own workflows** and continuously refine them over time
34
+ 3. **Spec + Task-driven**: every session is anchored by Spec → Plan → State
35
+ 4. Key steps enforce **human approval** — your Coding Agent never drifts off-course
36
+ 5. **Native language support** — vibe-code in your own language with a unified dictionary to eliminate naming ambiguity
37
+ 6. Collect **real-time Token usage statistics**, and display in TUI sidebar
38
+
39
+ This project is built entirely with vibe-pm and Chinese as the development language.
40
+
41
+ ## Installation
42
+
43
+ ```bash
44
+ # Install globally
45
+ opencode plugin @laxture/vibe-pm@latest --global
46
+ ```
47
+
48
+ ## Quick Start
49
+
50
+ ```
51
+ # Initialize configuration
52
+ /pm-config init
53
+
54
+ # Install a workflow template
55
+ /pm-install-flow bug-fix
56
+
57
+ # Start a task
58
+ /pm-bug-fix "Login returns 500 after password reset"
59
+ ```
60
+
61
+ ## Use Cases
62
+
63
+ ```
64
+ # Research a topic
65
+ /pm-research Analyze migration from REST to GraphQL
66
+
67
+ # Write a Spec
68
+ /pm-design-spec Add bank card payment support
69
+
70
+ # New feature (full spec-driven workflow)
71
+ /pm-spec-driven-dev Implement feature per @docs/spec/spec-new-feature.md
72
+
73
+ # Modify existing feature
74
+ /pm-spec-driven-dev Check inventory before payment, block if stock insufficient
75
+
76
+ # Bug fix (with root cause analysis)
77
+ /pm-bug-fix Login returns 500 after password reset
78
+
79
+ # Large-scale refactor (with impact assessment)
80
+ /pm-large-refactor Extract payment module into microservice
81
+
82
+ # Refine a workflow
83
+ /pm-refine-flow Modify the bug-fix flow to require a bug ID if not provided
84
+ ```
85
+
86
+ ## Who's It For?
87
+
88
+ - **Detail-oriented control freaks** — you want precise control over every technical decision, not leaving everything to the LLM
89
+ - **Experienced software engineers and architects** — you likely need traditional project management experience to effectively project your management philosophy onto your Coding Agent (treat it as your loyal but dim-witted employee)
90
+
91
+ If you've been haunted by "did the AI skip a step?" or "where did that decision come from?" — vibe-pm is for you.
92
+
93
+ ## Built-in Flow Templates
94
+
95
+ | Template | Command | Use Case |
96
+ |----------|---------|----------|
97
+ | `design-spec` | `/pm-design-spec` | Progressive Spec design |
98
+ | `spec-driven-dev` | `/pm-spec-driven-dev` | New feature development & feature changes (sync Spec) |
99
+ | `bug-fix` | `/pm-bug-fix` | Bug fix with root cause analysis and fix plan review |
100
+ | `large-refactor` | `/pm-large-refactor` | Large-scale refactoring |
101
+ | `side-job` | `/pm-side-job` | Quick turnaround (must confirm plan before execution) |
102
+ | `research` | `/pm-research` | General research — output findings first, then decide next steps |
103
+
104
+ ## Commands
105
+
106
+ | Command | Purpose |
107
+ |---------|---------|
108
+ | `/pm-config` | View / edit plugin config; `init` to start setup wizard |
109
+ | `/pm-install-flow` | Install a workflow from the template library |
110
+ | `/pm-uninstall-flow` | Remove a workflow |
111
+ | `/pm-task-set-step` | Jump to a specific step |
112
+ | `/pm-task-close` | Close task → trigger analysis |
113
+ | `/pm-task-current-step` | Show current step |
114
+ | `/pm-task-refresh` | Re-inject context for the current step |
115
+
116
+ Workflow-specific commands (e.g. `/pm-research`, `/pm-bug-fix`) are auto-generated when you install a flow template.
117
+
118
+ ## License
119
+
120
+ Apache 2.0
@@ -0,0 +1,119 @@
1
+ # vibe-pm
2
+
3
+ ![NPM Version](https://img.shields.io/npm/v/@laxture/vibe-pm)
4
+ ![Test](https://github.com/hank-cp/opencode-vibe-pm/workflows/CI%20Test/badge.svg)
5
+ ![GitHub](https://img.shields.io/github/license/hank-cp/opencode-vibe-pm)
6
+ ![GitHub last commit](https://img.shields.io/github/last-commit/hank-cp/opencode-vibe-pm.svg)
7
+
8
+ > **OpenCode 的结构化开发工作流插件。**
9
+ >
10
+ > vibe-pm是一个OpenCode插件, 它能让 vibe-coding 不跑偏。
11
+
12
+ ## 为什么需要 vibe-pm?
13
+
14
+ 当前痛点:
15
+
16
+ - `AGENTS.md` 和 `rules/*.md` 强制全量加载,**浪费上下文窗口**
17
+ - 现有的自动裁剪工具**过程不透明** — 你不知道什么被丢弃了、为什么
18
+ - 遗忘越来越严重 — 重要上下文悄无声息地消失
19
+
20
+ vibe-pm 的解法:**只注入当前步骤所需的内容** — 不多不少。每个任务由三个要素驱动:
21
+
22
+ | 要素 | 回答 |
23
+ |------|------|
24
+ | **Spec** | 要做什么 |
25
+ | **Task Plan** | 怎么做 |
26
+ | **Task State** | 做到哪了 |
27
+
28
+ 关键节点需要人工确认,杜绝无声漂移。
29
+
30
+ ## 功能
31
+
32
+ 1. 将任务流程控制引入LLM上下文,通过插件保证 vibe-coding 过程**稳定受控**
33
+ 2. 团队可按需**定制任务流程**,并持续调整优化
34
+ 3. **Spec+任务驱动**:每次对话以 Spec → Plan → State 锚定
35
+ 4. 关键步骤强制人工审核, 确保Coding Agent每一步都不会偏离预期
36
+ 5. 支持使用**本地语言**进行vibe-coding, 通过一个统一的字典文档消除命名歧义
37
+ 6. 实时统计Token用量并在TUI侧边栏显示
38
+
39
+ 本项目完全使用vibe-pm插件和中文语言开发.
40
+
41
+ ## 适合哪些人
42
+
43
+ - **细节控和控制狂** — 希望准确把控每个技术细节和决策, 而不是任由LLM自由发挥
44
+ - **经验丰富的软件工程师和架构师** — 你可能需要经历过传统项目开发管理,有相当程度的项目管理理解, 才能更好地将你的项目管理理念投射到Coding Agent身上 (将其视为你忠诚而愚笨的员工),
45
+
46
+ 如果你曾被过"AI 是不是跳过了某一步"或"这个决策是怎么来的"这类问题困扰过 — vibe-pm 就是为你准备的。
47
+
48
+ ## 安装
49
+
50
+ ```bash
51
+ # 全局安装
52
+ opencode plugin @laxture/vibe-pm@latest --global
53
+ ```
54
+
55
+ ## 快速开始
56
+ ```
57
+ # 初始化配置
58
+ /pm-config init
59
+
60
+ # 安装流程模板
61
+ /pm-install-flow bug-fix
62
+
63
+ # 启动流程
64
+ /pm-bug-fix "重置密码后登录报 500 错误"
65
+ ```
66
+
67
+ ## 典型用例
68
+
69
+ ```
70
+ # 梳理需求、调研分析
71
+ /pm-research 分析从 REST 迁移到 GraphQL 的方案
72
+
73
+ # 撰写 Spec
74
+ /pm-design-spec 需要支持用户通过银行卡支付
75
+
76
+ # 新功能开发(全流程 Spec 驱动)
77
+ /pm-spec-driven-dev 根据 @docs/spec/spec-new-feature.md 执行开发
78
+
79
+ # 修改功能
80
+ /pm-spec-driven-dev 用户支付前, 检查可用库存量, 如果不足完成订单, 则阻止支付
81
+
82
+ # Bug 修复(含根因分析)
83
+ /pm-bug-fix 重置密码后登录报 500 错误
84
+
85
+ # 大规模重构(含影响评估)
86
+ /pm-large-refactor "将支付模块拆分为独立微服务"
87
+
88
+ # 流程优化
89
+ /pm-refine-flow 修改bug-fix流程, 如果我没有提供Bug编号, 要求我必须提供
90
+ ```
91
+
92
+ ## 内置流程模板
93
+
94
+ | 模板 | 命令 | 适用场景 |
95
+ |-------------------|-----------------------|-------------------------------------|
96
+ | `design-spec` | `/pm-design-spec` | 渐进式 Spec 设计 |
97
+ | `spec-driven-dev` | `/pm-spec-driven-dev` | 新功能开发 与 功能变更(同步更新Spec) |
98
+ | `bug-fix` | `/pm-bug-fix` | 与期望不符的 Bug 修复, 含根因分析和修复方案评审 |
99
+ | `large-refactor` | `/pm-large-refactor` | 大规模重构 |
100
+ | `side-job` | `/pm-side-job` | 快速任务(执行前需确认方案) |
101
+ | `research` | `/pm-research` | 通用调研任务, 可将分析报告输出到临时位置, 再根据分析报告进行下一步 |
102
+
103
+ ## 命令
104
+
105
+ | 命令 | 用途 |
106
+ |------|------|
107
+ | `/pm-config` | 查看/修改插件配置,`init` 启动初始化向导 |
108
+ | `/pm-install-flow` | 从模板库安装流程 |
109
+ | `/pm-uninstall-flow` | 移除流程 |
110
+ | `/pm-task-set-step` | 手动跳转到指定步骤 |
111
+ | `/pm-task-close` | 关闭任务,触发分析 |
112
+ | `/pm-task-current-step` | 查看当前步骤 |
113
+ | `/pm-task-refresh` | 为当前步骤重新注入上下文 |
114
+
115
+ 流程专用命令(如 `/pm-research`、`/pm-bug-fix`)会在安装对应流程模板后自动生成。
116
+
117
+ ## License
118
+
119
+ Apache 2.0
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Command Registration
3
+ *
4
+ * Registers all 8 /pm-* commands via the config hook (declarative) and
5
+ * tool hook (executable). Uses the @opencode-ai/plugin SDK tool() factory.
6
+ * Executable commands invoke FlowEngine and MemorySystem for real business logic.
7
+ */
8
+ import { Config, IPluginContext, ToolDefinition } from './types.js';
9
+ import type { FlowEngine } from '../engine';
10
+ import type { MemorySystem } from '../memory';
11
+ export declare function registerCommands(opencodeConfig: Config): void;
12
+ export declare function registerFlowCommands(opencodeConfig: Config, projectDir: string): void;
13
+ /**
14
+ * Create tool registry using the SDK tool() factory + Zod schemas.
15
+ */
16
+ export declare function registerTools(ctx: IPluginContext, engine: FlowEngine, memory: MemorySystem): Record<string, ToolDefinition>;
17
+ export declare function registerFlowTools(ctx: IPluginContext, engine: FlowEngine): Record<string, ToolDefinition>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Configuration Management
3
+ *
4
+ * Loads vibe-pm/config.json from the project directory. Supports defaults,
5
+ * merge override, and graceful fallback on parse errors.
6
+ * Auto-creates a default config file on startup.
7
+ */
8
+ import type { PluginConfig } from './types.js';
9
+ export declare const DEFAULT_CONFIG: PluginConfig;
10
+ export declare function loadConfig(projectDir: string): PluginConfig;
11
+ export declare function writeConfig(projectDir: string, config: PluginConfig): void;
12
+ export declare function ensureDefaultConfig(projectDir: string): boolean;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Plugin Core Unified Exports
3
+ */
4
+ export { VibePMPlugin } from './plugin.js';
5
+ export { loadConfig, DEFAULT_CONFIG, writeConfig, ensureDefaultConfig } from './config.js';
6
+ export { registerCommands, registerTools } from './commands.js';
7
+ export { logger } from './logger.js';
8
+ export type * from './types.js';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Logging Utility
3
+ *
4
+ * Writes to the host log system via the OpenCode SDK's app.log().
5
+ * Public interface unchanged: logger.debug / info / warn / error.
6
+ */
7
+ import type { ILogger } from './types.js';
8
+ interface LogClient {
9
+ app: {
10
+ log(options: {
11
+ body?: {
12
+ service: string;
13
+ level: 'debug' | 'info' | 'warn' | 'error';
14
+ message: string;
15
+ extra?: Record<string, unknown>;
16
+ };
17
+ }): Promise<unknown>;
18
+ };
19
+ }
20
+ export declare function initLogger(c: LogClient): void;
21
+ export declare function setLogEnabled(v: boolean): void;
22
+ export declare const logger: ILogger;
23
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { Plugin } from './types.js';
2
+ export declare const VibePMPlugin: Plugin;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Plugin Core Type Definitions
3
+ *
4
+ * OpenCode interaction types are imported via the @opencode-ai/plugin SDK.
5
+ * Project-specific domain types are defined here.
6
+ */
7
+ /** Subset of hooks a module can contribute, types from SDK */
8
+ import type { ToolDefinition } from '@opencode-ai/plugin';
9
+ import type { OpencodeClient } from '@opencode-ai/sdk';
10
+ export type { Plugin, PluginInput, Hooks, Config, ToolContext, ToolDefinition, } from '@opencode-ai/plugin';
11
+ export { tool } from '@opencode-ai/plugin';
12
+ export interface PluginConfig {
13
+ language: string;
14
+ dataDir: string;
15
+ autoAnalyze: boolean;
16
+ /** List of project programming languages analyzed by LLM, cached after first analysis. Prioritized during flow installation. */
17
+ programmingLanguages?: string[];
18
+ contextInjection: {
19
+ /** Max context injection tokens per step, 0 means no limit */
20
+ maxStepTokens: number;
21
+ pruneIrrelevant: boolean;
22
+ };
23
+ debug?: {
24
+ /** Output full request context at end of system.transform (default false) */
25
+ logFullRequest?: boolean;
26
+ };
27
+ }
28
+ export interface IPluginContext {
29
+ readonly config: PluginConfig;
30
+ readonly projectDir: string;
31
+ readonly dataDir: string;
32
+ readonly client: OpencodeClient;
33
+ }
34
+ export interface ILogger {
35
+ debug(...args: unknown[]): void;
36
+ info(...args: unknown[]): void;
37
+ warn(...args: unknown[]): void;
38
+ error(...args: unknown[]): void;
39
+ }
40
+ export type ToolDefinitionWithKey = ToolDefinition & {
41
+ toolKey: string;
42
+ };
@@ -0,0 +1,114 @@
1
+ # General Coding Style
2
+
3
+ > This file is the general coding standard for unsupported languages. When the project's language has no specific style guide, this file serves as the baseline.
4
+
5
+ ## General Format
6
+
7
+ - Use UTF-8 encoding, LF line endings
8
+ - Use the project's designated formatter
9
+ - Indentation follows project convention (recommended 2 or 4 spaces)
10
+ - Line length should not exceed 100 characters
11
+ - Keep one blank line at end of file
12
+
13
+ ## File Organization
14
+
15
+ ### Naming
16
+
17
+ - Source files use project convention (recommended `kebab-case` or `snake_case`)
18
+ - Directory names use project convention (recommended `kebab-case`)
19
+ - Test file naming follows project convention
20
+
21
+ ### Import / Dependency Resolution
22
+
23
+ 1. Standard library / built-in modules
24
+ 2. Third-party dependencies
25
+ 3. Project internal modules
26
+
27
+ ### File Structure
28
+
29
+ - Prefer one primary export per file
30
+ - Use named exports for helper types/functions
31
+ - Expose a clean public API from each module
32
+
33
+ ## Naming Conventions
34
+
35
+ ### Variables
36
+
37
+ - Use project convention (recommended `camelCase` or `snake_case`)
38
+ - Short scope → short names
39
+ - Long scope → descriptive names
40
+ - Boolean variables use question-word prefixes
41
+ - Do not use Hungarian notation
42
+
43
+ ### Constants
44
+
45
+ - Use project convention (recommended `UPPER_SNAKE_CASE`)
46
+
47
+ ### Functions
48
+
49
+ - Use project convention (recommended `camelCase` or `snake_case`)
50
+ - Start with a verb
51
+
52
+ ### Types / Interfaces / Classes
53
+
54
+ - Use project convention (recommended `PascalCase`)
55
+ - Do not prefix interface/type names
56
+
57
+ ### Enums / Union Types
58
+
59
+ - Follow project convention
60
+
61
+ ## Type Safety
62
+
63
+ - Avoid dynamic types / any-type
64
+ - Prefer type annotations / type hints
65
+ - Explicit error handling; never swallow exceptions
66
+
67
+ ## Function Design
68
+
69
+ ### Parameters
70
+
71
+ - Use object/struct parameters when exceeding 3 parameters
72
+
73
+ ### Return Values
74
+
75
+ - Prefer returning concrete types
76
+ - For nullable scenarios, use project convention (e.g., `Result<T, E>`, `Optional<T>`, `(T, error)`)
77
+
78
+ ## Control Flow
79
+
80
+ - Prefer early returns to reduce nesting depth
81
+
82
+ ## Async Handling
83
+
84
+ - Use the language/framework's recommended async pattern
85
+
86
+ ## Error Handling
87
+
88
+ - All errors must be handled explicitly
89
+ - Validate inputs at system boundaries
90
+ - Do not add "impossible" error handling in internal logic
91
+
92
+ ## Logging
93
+
94
+ - Use the project's unified logging module
95
+ - Log messages in English
96
+ - Record info/debug logs on critical paths
97
+
98
+ ## Comments & Documentation
99
+
100
+ - Code comments in English
101
+ - Add doc comments to public APIs
102
+ - Add explanatory comments for complex logic
103
+
104
+ ## Placeholder Code
105
+
106
+ ```
107
+ // TODO(username): needs API integration — expected v1.1
108
+ // FIXME(username): potential data race under concurrency — needs locking
109
+ // HACK(username): temporary workaround — replace after v1.0
110
+ ```
111
+
112
+ ## Export Conventions
113
+
114
+ Use the language/framework's recommended visibility control