ecc_infisense 0.0.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.
@@ -0,0 +1,306 @@
1
+ ---
2
+ name: component-templates
3
+ description: Templates and guidelines for creating ECC InfiSense components (agent, skill, command, rule).
4
+ category: plugin
5
+ ---
6
+
7
+ # Component Templates
8
+
9
+ 创建 ECC InfiSense 组件的模板和界定规范。
10
+
11
+ ## 四类组件的界定
12
+
13
+ | 组件 | 一句话 | 职责 | 建议行数 |
14
+ |------|--------|------|----------|
15
+ | rule | 红线 | 策略/约束:"什么能做、什么不能做" | ~30-50 |
16
+ | command | 入口 | 调度/交互:"做什么事",分派给 agent | ~80-200 |
17
+ | agent | 干活的 | 执行者:"怎么做",分步执行,引用 skill | ~200-400 |
18
+ | skill | 字典 | 知识库:"知道什么",被 agent 引用 | ~100-600 |
19
+
20
+ ### 判断流程
21
+
22
+ ```
23
+ 约束/策略/禁止项? → rule
24
+ 用户触发的入口? → command
25
+ 分步执行流程? → agent
26
+ 参考知识/模式/清单? → skill
27
+ ```
28
+
29
+ ### 组件间引用关系
30
+
31
+ ```
32
+ command ──(调度)──→ agent ──(引用知识)──→ skill
33
+
34
+ └──(遵守)──→ rule(始终加载)
35
+ ```
36
+
37
+ ---
38
+
39
+ ## Rule 模板
40
+
41
+ 文件:`rules/{common,cpp}/<TOPIC>.md`
42
+
43
+ ```markdown
44
+ # <RULE_TITLE>
45
+
46
+ For detailed patterns and examples, use `/<RELATED_COMMAND>`.
47
+
48
+ ## <SECTION_1_TITLE>
49
+
50
+ | <COL_1> | <COL_2> |
51
+ |---------|---------|
52
+ | <ITEM> | <GUIDELINE> |
53
+ | <ITEM> | <GUIDELINE> |
54
+
55
+ ## <SECTION_2_TITLE>
56
+
57
+ - <CONSTRAINT_1>
58
+ - <CONSTRAINT_2>
59
+ - <CONSTRAINT_3>
60
+ ```
61
+
62
+ 规范:
63
+ - 可选 frontmatter:仅 `paths`(文件匹配 glob)
64
+ - 建议 30-50 行,纯表格 + 条目,无代码
65
+ - 语气命令式("必须"、"禁止"、"优先")
66
+ - 超过 60 行建议拆到 skill
67
+
68
+ 反模式:含代码示例、含执行步骤
69
+
70
+ 参考:`rules/common/testing.md`、`rules/cpp/security.md`
71
+
72
+ ---
73
+
74
+ ## Command 模板
75
+
76
+ 文件:`commands/infi-<NAME>.md`
77
+
78
+ ```markdown
79
+ ---
80
+ description: <ONE_LINE_DESCRIPTION>
81
+ category: <plugin|cpp>
82
+ ---
83
+
84
+ # <COMMAND_TITLE>
85
+
86
+ <PURPOSE_STATEMENT>
87
+
88
+ ## Usage
89
+
90
+ <INVOCATION_AND_ARGUMENTS>
91
+
92
+ ## Workflow
93
+
94
+ ### Step 1: <PHASE_NAME>
95
+
96
+ <WHAT_HAPPENS> (2-3 sentences).
97
+ Delegate to `<AGENT_NAME>` agent.
98
+
99
+ ### Step 2: <PHASE_NAME>
100
+
101
+ <WHAT_HAPPENS>.
102
+
103
+ ## Cross-References
104
+
105
+ - Agent: `<AGENT_NAME>` — <RESPONSIBILITY>
106
+ - Skill: `<SKILL_NAME>` — <KNOWLEDGE_PROVIDED>
107
+ - Related: `/infi-<OTHER>` — <WHEN_TO_USE_INSTEAD>
108
+ ```
109
+
110
+ 规范:
111
+ - Frontmatter 必填 `description`(一句话)、`category`(`plugin` 或 `cpp`)
112
+ - 建议 80-200 行,只做调度和用户交互
113
+ - 不含具体执行代码,只描述"做什么"和"委派给谁"
114
+ - 必须有 Cross-References
115
+
116
+ 反模式:含 50+ 行执行逻辑、含 API 参考表、无 Cross-References
117
+
118
+ 参考:`commands/infi-component-creator.md`、`commands/infi-release.md`
119
+
120
+ ---
121
+
122
+ ## Agent 模板
123
+
124
+ 文件:`agents/<NAME>.md`
125
+
126
+ ```markdown
127
+ ---
128
+ name: <AGENT_NAME>
129
+ description: <ONE_LINE_EXPERTISE>
130
+ tools:
131
+ - Read
132
+ - Grep
133
+ - Glob
134
+ - Bash
135
+ - Edit
136
+ - Write
137
+ model: <opus|sonnet|haiku>
138
+ category: <plugin|cpp>
139
+ ---
140
+
141
+ # <AGENT_TITLE>
142
+
143
+ <PHILOSOPHY_STATEMENT> (2-3 lines).
144
+
145
+ ## Step 1: <PHASE>
146
+
147
+ <DETAILED_INSTRUCTIONS>.
148
+ Reference `<SKILL_NAME>` for <KNOWLEDGE_AREA>.
149
+
150
+ ## Step 2: <PHASE>
151
+
152
+ <DETAILED_INSTRUCTIONS>.
153
+
154
+ ## Step N: <FINAL_PHASE>
155
+
156
+ <DETAILED_INSTRUCTIONS>.
157
+
158
+ ## Output Format
159
+
160
+ <OUTPUT_STRUCTURE_DESCRIPTION>
161
+
162
+ ## Checklist
163
+
164
+ - [ ] <VERIFICATION_ITEM_1>
165
+ - [ ] <VERIFICATION_ITEM_2>
166
+
167
+ ## Anti-Patterns
168
+
169
+ - Don't <BAD_PRACTICE> because <REASON>
170
+ ```
171
+
172
+ 规范:
173
+ - Frontmatter 必填 `name`、`description`、`tools`、`model`、`category`(`plugin` 或 `cpp`)
174
+ - `model`:`opus`(复杂推理)、`sonnet`(通用)、`haiku`(快速)
175
+ - 建议 200-400 行,分步执行 + 决策逻辑
176
+ - 代码示例仅用于说明步骤,不做 API 参考
177
+ - 必须有 Output Format 和 Checklist
178
+
179
+ 反模式:含 100+ 行 API 参考表、无 Step 结构、不引用任何 skill
180
+
181
+ 参考:`agents/component-designer.md`、`agents/release-executor.md`
182
+
183
+ ---
184
+
185
+ ## Skill 模板
186
+
187
+ 文件:`skills/<NAME>/SKILL.md`
188
+
189
+ ```markdown
190
+ ---
191
+ name: <SKILL_NAME>
192
+ description: <ONE_LINE_KNOWLEDGE_DOMAIN>
193
+ category: <plugin|cpp>
194
+ ---
195
+
196
+ # <SKILL_TITLE>
197
+
198
+ <OVERVIEW> (2-3 lines).
199
+
200
+ ## <KNOWLEDGE_SECTION_1>
201
+
202
+ | <COL_1> | <COL_2> | <COL_3> |
203
+ |---------|---------|---------|
204
+ | <API> | <DESC> | `<CODE_EXAMPLE>` |
205
+
206
+ ## <KNOWLEDGE_SECTION_2>
207
+
208
+ ```cpp
209
+ // <CODE_EXAMPLE_DEMONSTRATING_PATTERN>
210
+ ```
211
+
212
+ ## Quick Reference
213
+
214
+ - <KEY_POINT_1>
215
+ - <KEY_POINT_2>
216
+
217
+ ## When to Use
218
+
219
+ - <SCENARIO_A>
220
+ - <SCENARIO_B>
221
+
222
+ ## When NOT to Use
223
+
224
+ - <SCENARIO_X> → use `<OTHER_SKILL>` instead
225
+ - <SCENARIO_Y> → use `<OTHER_SKILL>` instead
226
+ ```
227
+
228
+ 规范:
229
+ - Frontmatter 必填 `name`、`description`、`category`(`plugin` 或 `cpp`),可选 `argument-hint`
230
+ - 建议 100-600 行,API 参考 + 模式库 + 代码示例 + 清单
231
+ - 不含 "Step 1 → Step 2 → Step 3" 执行流程
232
+ - 可有 `references/` 子目录存放详细参考
233
+ - 建议有 When to Use / When NOT to Use
234
+
235
+ 反模式:含执行流程步骤、少于 50 行、无代码示例或参考表
236
+
237
+ 参考:`skills/component-templates/SKILL.md`(本文件)、`skills/release-workflow/SKILL.md`
238
+
239
+ ---
240
+
241
+ ## 命名约定
242
+
243
+ ### 文件路径与格式
244
+
245
+ | 组件 | 文件路径 | 示例 |
246
+ |------|---------|------|
247
+ | rule | `rules/{common,cpp}/<topic>.md` | `rules/cpp/security.md` |
248
+ | command | `commands/infi-<name>.md` | `commands/infi-release.md` |
249
+ | agent | `agents/<name>.md` | `agents/component-designer.md` |
250
+ | skill | `skills/<name>/SKILL.md` | `skills/release-workflow/SKILL.md` |
251
+
252
+ 所有文件名小写,用连字符分隔。
253
+
254
+ ### 命名规则
255
+
256
+ | 规则 | 说明 | 正例 | 反例 |
257
+ |------|------|------|------|
258
+ | 全小写 + 连字符 | 禁止下划线、大写、空格 | `build-fix` | `build_fix`、`BuildFix` |
259
+ | command 前缀 | 必须以 `infi-` 开头 | `infi-release` | `release`、`my-release` |
260
+ | agent 无前缀 | 不加 `infi-`,直接描述角色 | `component-designer` | `infi-component-designer` |
261
+ | skill 无前缀 | 不加 `infi-`,直接描述知识域 | `release-workflow` | `infi-release` |
262
+ | rule 无前缀 | 按主题命名 | `security` | `infi-security` |
263
+ | 长度限制 | `<name>` 部分 2-30 字符 | `release-workflow` (16)、`component-designer` (18) | `a` (1)、超长名称 |
264
+ | 无功能词冗余 | 避免含 `manager`、`handler`、`helper` | `build-fix` | `build-fix-handler` |
265
+
266
+ ### 命名推导
267
+
268
+ 从 feature description 推导名称的建议步骤:
269
+
270
+ 1. **提取关键词** — 从描述中取 1-3 个核心词(英文)
271
+ 2. **组合** — 用连字符拼接:`<领域>-<动作>` 或 `<领域>-<细分>`
272
+ 3. **去重** — 检查现有组件,避免与已有名称冲突或语义重叠
273
+ 4. **一致性** — 参考同领域已有组件的命名风格(如 `*-cc` 系列、`cpp-*` 系列)
274
+
275
+ 示例推导:
276
+
277
+ | 功能描述 | 推导过程 | 最终名称 |
278
+ |---------|---------|---------|
279
+ | "管理插件组件生命周期" | 关键词:component, templates | command: `infi-component-creator`,skill: `component-templates` |
280
+ | "版本发布和变更日志管理" | 关键词:release, workflow | command: `infi-release`,skill: `release-workflow` |
281
+ | "动态扫描生成插件索引" | 关键词:plugin, inspector | command: `infi-ecc-helper`,agent: `plugin-inspector` |
282
+
283
+ ### 名称验证清单
284
+
285
+ 验证一个组件名称是否合规:
286
+
287
+ - [ ] 仅包含小写字母、数字、连字符
288
+ - [ ] 连字符不在首尾,无连续连字符
289
+ - [ ] `<name>` 部分长度在 2-30 字符之间
290
+ - [ ] command 以 `infi-` 开头,其他组件类型不以 `infi-` 开头
291
+ - [ ] 不与现有组件名称冲突(同类型内唯一)
292
+ - [ ] 不与其他类型组件产生歧义(如 skill 和 agent 不重名)
293
+ - [ ] 无冗余功能词(`manager`、`handler`、`helper`、`util`)
294
+
295
+ ---
296
+
297
+ ## When to Use
298
+
299
+ - 创建新的 agent、skill、command 或 rule 时
300
+ - 不确定一段内容该归入哪类组件时(参考判断流程)
301
+ - 审查现有组件是否符合规范时
302
+
303
+ ## When NOT to Use
304
+
305
+ - 修改已有组件的业务逻辑 → 直接编辑对应文件
306
+ - 组件精简/删除决策 → 人工判断哪些经过实战验证
@@ -0,0 +1,180 @@
1
+ ---
2
+ name: release-workflow
3
+ description: Conventions and reference data for ECC InfiSense release management — commits, changelog, versioning, and safety.
4
+ category: plugin
5
+ ---
6
+
7
+ # Release Workflow
8
+
9
+ 发布管理的约定和参考数据,涵盖提交规范、变更日志格式、版本管理和安全检查。
10
+
11
+ ## Conventional Commits 格式
12
+
13
+ Format: `<type>(<scope>): <subject>`
14
+
15
+ | Type | Description | Changelog Category |
16
+ |------|-------------|--------------------|
17
+ | `feat` | New feature | Added |
18
+ | `fix` | Bug fix | Fixed |
19
+ | `docs` | Documentation only | Documentation |
20
+ | `refactor` | No behavior change | Changed |
21
+ | `test` | Tests | (omit) |
22
+ | `chore` | Build, CI, tooling | Changed |
23
+ | `perf` | Performance | Performance |
24
+
25
+ ### Subject Rules
26
+
27
+ - Lowercase first character
28
+ - Imperative mood ("add", not "added" or "adds")
29
+ - Max 72 characters
30
+ - No trailing period
31
+ - One logical change per commit
32
+
33
+ ### Breaking Changes
34
+
35
+ - Add `!` after type: `feat!: remove deprecated API`
36
+ - Add `BREAKING CHANGE:` footer in commit body
37
+
38
+ ## Path → Scope Mapping
39
+
40
+ Map changed file paths to commit scope:
41
+
42
+ | Path Pattern | Scope | Type Inference |
43
+ |-------------|-------|----------------|
44
+ | `commands/` | `commands` | New file → `feat`, modify → `fix` or `docs` |
45
+ | `skills/` | `skills` | New file → `feat`, modify → `fix` or `docs` |
46
+ | `agents/` | `agents` | New file → `feat`, modify → `fix` or `docs` |
47
+ | `rules/` | `rules` | `docs` or `refactor` |
48
+ | `scripts/` | `scripts` | `fix` or `refactor` |
49
+ | `hooks/` | `hooks` | New → `feat`, modify → `fix` |
50
+ | `tests/` | `tests` | `test` |
51
+ | `*.md` (root-level) | omit scope | `docs` |
52
+ | `package.json`, `plugin.json` | `release` | `chore` |
53
+ | Other | infer from content | `chore` |
54
+
55
+ ### Multi-scope Grouping
56
+
57
+ When changes span multiple scopes:
58
+ - Same logical change → ONE commit, use the primary scope
59
+ - Unrelated changes → separate atomic commits
60
+ - Documentation updates (CHANGELOG, README, GUIDE) → bundle with the last commit
61
+
62
+ ## Keep a Changelog Format
63
+
64
+ Reference: [keepachangelog.com](https://keepachangelog.com/)
65
+
66
+ ```markdown
67
+ # Changelog
68
+
69
+ All notable changes to this project will be documented in this file.
70
+
71
+ ## [Unreleased]
72
+
73
+ ### Added
74
+ - feat(scope): description of new feature
75
+
76
+ ### Changed
77
+ - refactor(scope): description of change
78
+
79
+ ### Fixed
80
+ - fix(scope): description of bug fix
81
+
82
+ ### Performance
83
+ - perf(scope): description of optimization
84
+
85
+ ### Documentation
86
+ - docs(scope): description of doc change
87
+
88
+ ## [X.Y.Z] - YYYY-MM-DD
89
+
90
+ ### Added
91
+ - ...
92
+ ```
93
+
94
+ ### Rules
95
+
96
+ - Always maintain an `[Unreleased]` section at the top
97
+ - On version release, move entries to `## [X.Y.Z] - YYYY-MM-DD`
98
+ - Leave `[Unreleased]` empty after moving
99
+ - Entries use format: `- type(scope): description`
100
+ - Omit `test` type entries from changelog
101
+ - Category order: Added → Changed → Deprecated → Removed → Fixed → Security → Performance → Documentation
102
+
103
+ ## Semantic Versioning
104
+
105
+ Reference: [semver.org](https://semver.org/)
106
+
107
+ | Bump | When | Example |
108
+ |------|------|---------|
109
+ | `patch` | Bug fixes, doc updates, minor tweaks | `0.1.1 → 0.1.2` |
110
+ | `minor` | New features, new commands/skills/agents | `0.1.2 → 0.2.0` |
111
+ | `major` | Breaking changes, removed features | `0.2.0 → 1.0.0` |
112
+
113
+ ### Version Sync Locations
114
+
115
+ When bumping version, update ALL of these:
116
+ 1. `package.json` — `version` field
117
+ 2. `.claude-plugin/plugin.json` — `version` field
118
+ 3. `CHANGELOG.md` — move Unreleased to versioned section
119
+
120
+ ## Safety Check Patterns
121
+
122
+ ### Dangerous Files (Never Commit)
123
+
124
+ | Pattern | Risk |
125
+ |---------|------|
126
+ | `.env*` | Environment variables with secrets |
127
+ | `credentials*` | Credential files |
128
+ | `*secret*` | Files containing secrets |
129
+ | `*token*` | API token files |
130
+ | `*.key` | Private key files |
131
+ | `*.pem` | Certificate/key files |
132
+ | `node_modules/` | Dependencies (use .gitignore) |
133
+ | Binary > 1MB | Large binary files |
134
+
135
+ ### Debug Code Patterns
136
+
137
+ | Pattern | Language | Description |
138
+ |---------|----------|-------------|
139
+ | `console.log` | JavaScript | Debug logging |
140
+ | `debugger` | JavaScript | Debugger breakpoint |
141
+ | `printf.*debug` | C/C++ | Debug printing |
142
+ | `#if 0` | C/C++ | Disabled code block |
143
+ | `// TODO` (no ticket) | Any | Untracked work item |
144
+ | `>>>>>>>` | Any | Merge conflict marker |
145
+
146
+ ### Commit Message Validation
147
+
148
+ A valid commit message must:
149
+ - [ ] Match format: `<type>(<scope>): <subject>` or `<type>: <subject>`
150
+ - [ ] Use a recognized type (feat, fix, docs, refactor, test, chore, perf)
151
+ - [ ] Have lowercase subject
152
+ - [ ] Be max 72 characters on first line
153
+ - [ ] Not end with a period
154
+ - [ ] Use imperative mood
155
+
156
+ ## npm Publish Checklist
157
+
158
+ Before publishing:
159
+ - [ ] All tests pass (`npm test`)
160
+ - [ ] Working tree is clean
161
+ - [ ] CHANGELOG.md updated
162
+ - [ ] Version bumped in package.json
163
+ - [ ] Version synced to plugin.json
164
+ - [ ] README.md and GUIDE.md counts updated
165
+ - [ ] Git tagged with `v<version>`
166
+ - [ ] Pushed to remote with tags
167
+
168
+ ## When to Use
169
+
170
+ - Committing changes to the ECC InfiSense plugin
171
+ - Publishing a new version to npm
172
+ - Checking release status
173
+ - Deciding on version bump level
174
+ - Formatting changelog entries
175
+
176
+ ## When NOT to Use
177
+
178
+ - C++ project releases → use project-specific release tooling
179
+ - Generic git operations → use standard git commands
180
+ - npm package development → use npm documentation directly