huaweicloud-devkit 1.0.2-next.7 → 1.0.2-next.8
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/.agents/plugins/marketplace.json +18 -18
- package/LICENSE +201 -201
- package/README.md +16 -1
- package/README.zh-CN.md +16 -1
- package/bin/setup.cjs +5 -3
- package/integrations/opencode/opencode.json +1 -4
- package/package.json +15 -3
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +3 -16
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +3 -16
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +3 -16
- package/plugins/huaweicloud-core/.mcp.json +1 -3
- package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +3 -16
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +136 -136
- package/plugins/huaweicloud-core/safety/policy.json +75 -100
- package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +41 -13
- package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +34 -34
- package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +18 -18
- package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +32 -32
- package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +30 -30
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +12 -11
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +64 -17
- package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +31 -31
- package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +39 -30
- package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +8 -1
- package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +6 -0
- package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +39 -36
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +15 -4
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +11 -9
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +13 -13
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +40 -39
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +12 -10
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +27 -23
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +27 -27
- package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +65 -39
- package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +9 -9
- package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +25 -25
- package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +44 -44
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +12 -7
- package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +13 -12
- package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +4 -4
- package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +63 -58
- package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +39 -39
- package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +26 -26
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +39 -39
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +13 -12
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +20 -19
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +15 -15
- package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +18 -18
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +13 -13
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +6 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +11 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +53 -53
- package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +6 -6
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +3 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +0 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +33 -33
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +39 -4
- package/plugins/huaweicloud-core/src/auth/credentials.mjs +12 -4
- package/plugins/huaweicloud-core/src/auth/service.mjs +1 -1
- package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +16 -7
- package/plugins/huaweicloud-core/src/icon-library.mjs +171 -0
- package/plugins/huaweicloud-core/src/mcp-server.mjs +0 -1
- package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +1 -2
- package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +4 -1
- package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +4 -1
- package/plugins/huaweicloud-core/src/safety-policy.mjs +122 -68
- package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +2 -7
- package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +10 -22
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +30 -9
- package/plugins/huaweicloud-core/src/search-market.mjs +46 -12
- package/plugins/huaweicloud-core/src/setup-cli.mjs +743 -168
- package/plugins/huaweicloud-core/src/tools.mjs +427 -114
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +54 -34
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +1 -5
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +3 -15
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +3 -16
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +37 -31
|
@@ -1,17 +1,47 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
import { Buffer } from 'node:buffer';
|
|
3
2
|
|
|
4
|
-
const INDEX_URL =
|
|
5
|
-
|
|
3
|
+
const INDEX_URL =
|
|
4
|
+
'https://gitcode.com/api/v5/repos/2501_91318609/skills-for-index/contents/skills-index/index.json?ref=main';
|
|
5
|
+
const CN_EN_MAP_URL =
|
|
6
|
+
'https://gitcode.com/api/v5/repos/2501_91318609/skills-for-index/contents/skills-index/cn-en-map.json?ref=main';
|
|
6
7
|
|
|
7
8
|
const GENERIC_KEYWORDS = new Set([
|
|
8
|
-
'华为云',
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
9
|
+
'华为云',
|
|
10
|
+
'huawei',
|
|
11
|
+
'huawei cloud',
|
|
12
|
+
'云',
|
|
13
|
+
'cloud',
|
|
14
|
+
'技能',
|
|
15
|
+
'skill',
|
|
16
|
+
'skills',
|
|
17
|
+
'所有',
|
|
18
|
+
'all',
|
|
19
|
+
'全部',
|
|
20
|
+
'有什么',
|
|
21
|
+
'有哪些',
|
|
22
|
+
'相关',
|
|
23
|
+
'列表',
|
|
24
|
+
'list',
|
|
25
|
+
'查找',
|
|
26
|
+
'搜索',
|
|
27
|
+
'发现',
|
|
28
|
+
'浏览',
|
|
29
|
+
'find',
|
|
30
|
+
'search',
|
|
31
|
+
'discover',
|
|
32
|
+
'browse',
|
|
33
|
+
'show',
|
|
34
|
+
'explore',
|
|
35
|
+
'agent',
|
|
36
|
+
'市场',
|
|
37
|
+
'market',
|
|
38
|
+
'类目',
|
|
39
|
+
'category',
|
|
40
|
+
'安装',
|
|
41
|
+
'install',
|
|
12
42
|
]);
|
|
13
43
|
|
|
14
|
-
async function fetchJson(url,
|
|
44
|
+
async function fetchJson(url, _label) {
|
|
15
45
|
const resp = await fetch(url, { headers: { 'User-Agent': 'huaweicloud-devkit/1.0' } });
|
|
16
46
|
const data = await resp.json();
|
|
17
47
|
if (data?.encoding === 'base64' && data.content) {
|
|
@@ -56,7 +86,10 @@ function scoreSkill(skill, specificKws, genericKws) {
|
|
|
56
86
|
else if (tl.some((t) => t.includes(k))) s += 8;
|
|
57
87
|
else if (dl.includes(k)) s += 5;
|
|
58
88
|
else if (sl.includes(k)) s += 3;
|
|
59
|
-
if (s > 0) {
|
|
89
|
+
if (s > 0) {
|
|
90
|
+
total += s;
|
|
91
|
+
matched.push(kw);
|
|
92
|
+
}
|
|
60
93
|
}
|
|
61
94
|
for (const kw of genericKws) {
|
|
62
95
|
const k = kw.toLowerCase();
|
|
@@ -65,7 +98,10 @@ function scoreSkill(skill, specificKws, genericKws) {
|
|
|
65
98
|
else if (tl.some((t) => t.includes(k))) s += 4;
|
|
66
99
|
else if (dl.includes(k)) s += 2;
|
|
67
100
|
else if (sl.includes(k)) s += 1;
|
|
68
|
-
if (s > 0) {
|
|
101
|
+
if (s > 0) {
|
|
102
|
+
total += s;
|
|
103
|
+
matched.push(kw);
|
|
104
|
+
}
|
|
69
105
|
}
|
|
70
106
|
if (!specificKws.length && total === 0) {
|
|
71
107
|
total = 1;
|
|
@@ -76,15 +112,16 @@ function scoreSkill(skill, specificKws, genericKws) {
|
|
|
76
112
|
}
|
|
77
113
|
|
|
78
114
|
async function main() {
|
|
79
|
-
const keyword =
|
|
115
|
+
const keyword =
|
|
116
|
+
process.argv
|
|
117
|
+
.slice(2)
|
|
118
|
+
.filter((a) => !a.startsWith('-'))
|
|
119
|
+
.join(' ') || '';
|
|
80
120
|
const catIdx = process.argv.indexOf('-c');
|
|
81
121
|
const category = catIdx >= 0 ? process.argv[catIdx + 1] || '' : '';
|
|
82
122
|
|
|
83
123
|
try {
|
|
84
|
-
const [idx, cnEnMap] = await Promise.all([
|
|
85
|
-
fetchJson(INDEX_URL, 'index'),
|
|
86
|
-
fetchJson(CN_EN_MAP_URL, 'cn-en-map'),
|
|
87
|
-
]);
|
|
124
|
+
const [idx, cnEnMap] = await Promise.all([fetchJson(INDEX_URL, 'index'), fetchJson(CN_EN_MAP_URL, 'cn-en-map')]);
|
|
88
125
|
|
|
89
126
|
if (!keyword && !category) {
|
|
90
127
|
console.log(`Categories: ${(idx.categories || []).join(', ')}`);
|
|
@@ -101,7 +138,15 @@ async function main() {
|
|
|
101
138
|
const [score, matched] = scoreSkill(skill, specificKws, genericKws);
|
|
102
139
|
if (hasSpecific && score === 0) continue;
|
|
103
140
|
const desc = (skill.description || '').slice(0, 150);
|
|
104
|
-
results.push({
|
|
141
|
+
results.push({
|
|
142
|
+
score,
|
|
143
|
+
name: skill.name,
|
|
144
|
+
category: skill.category,
|
|
145
|
+
service: skill.service,
|
|
146
|
+
description: desc + (skill.description?.length > 150 ? '...' : ''),
|
|
147
|
+
triggers: (skill.triggers || []).slice(0, 5),
|
|
148
|
+
matched,
|
|
149
|
+
});
|
|
105
150
|
}
|
|
106
151
|
results.sort((a, b) => b.score - a.score);
|
|
107
152
|
|
|
@@ -112,7 +157,9 @@ async function main() {
|
|
|
112
157
|
|
|
113
158
|
console.log(`Found ${results.length} skill(s):`);
|
|
114
159
|
for (const r of results) {
|
|
115
|
-
console.log(
|
|
160
|
+
console.log(
|
|
161
|
+
` [${r.score}pts] ${r.name} (${r.category}/${r.service})${r.matched.length ? ' matched: ' + r.matched.join(',') : ''}`,
|
|
162
|
+
);
|
|
116
163
|
console.log(` ${r.description}`);
|
|
117
164
|
}
|
|
118
165
|
} catch (e) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-cts
|
|
3
|
-
description:
|
|
3
|
+
description: 'Use when managing Cloud Trace Service (CTS) audit logs, trackers, and traces on Huawei Cloud. Triggers: CTS, Cloud Trace, audit log, tracker, trace, operation record. NOT for: CES monitoring alarms (use huawei-cloud-eye), log analysis (use LTS).'
|
|
4
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -16,34 +16,34 @@ Domain expertise for Cloud Trace Service. Covers trackers, traces, notifications
|
|
|
16
16
|
|
|
17
17
|
## Critical Warnings
|
|
18
18
|
|
|
19
|
-
| Trap
|
|
20
|
-
|
|
21
|
-
| Tracker required for traces | Must create a tracker before traces are recorded
|
|
22
|
-
| OBS bucket prerequisite
|
|
23
|
-
| 7-day retention default
|
|
24
|
-
| Organization tracker
|
|
19
|
+
| Trap | Why |
|
|
20
|
+
| --------------------------- | ------------------------------------------------------------------------------ |
|
|
21
|
+
| Tracker required for traces | Must create a tracker before traces are recorded |
|
|
22
|
+
| OBS bucket prerequisite | Tracker needs an OBS bucket for log delivery |
|
|
23
|
+
| 7-day retention default | Trace data retained 7 days by default. Create LTS tracker for longer retention |
|
|
24
|
+
| Organization tracker | Cross-account auditing requires organization tracker |
|
|
25
25
|
|
|
26
26
|
## Common Workflows
|
|
27
27
|
|
|
28
|
-
| Task
|
|
29
|
-
|
|
30
|
-
| List operations
|
|
31
|
-
| List traces
|
|
32
|
-
| Create tracker
|
|
33
|
-
| List trackers
|
|
34
|
-
| Delete tracker
|
|
35
|
-
| Create notification
|
|
36
|
-
| List notifications
|
|
28
|
+
| Task | Operation |
|
|
29
|
+
| -------------------- | ------------------------------------------------------ |
|
|
30
|
+
| List operations | `ListOperations --cli-region=<r> --project_id=<p>` |
|
|
31
|
+
| List traces | `ListTraces --cli-region=<r> --project_id=<p>` |
|
|
32
|
+
| Create tracker | `CreateTracker --cli-region=<r> --project_id=<p>` |
|
|
33
|
+
| List trackers | `ListTrackers --cli-region=<r> --project_id=<p>` |
|
|
34
|
+
| Delete tracker | `DeleteTracker --cli-region=<r> --project_id=<p>` |
|
|
35
|
+
| Create notification | `CreateNotification --cli-region=<r> --project_id=<p>` |
|
|
36
|
+
| List notifications | `ListNotifications --cli-region=<r> --project_id=<p>` |
|
|
37
37
|
| List trace resources | `ListTraceResources --cli-region=<r> --project_id=<p>` |
|
|
38
38
|
|
|
39
39
|
Discover exact parameters with `--help` before executing any command.
|
|
40
40
|
|
|
41
41
|
## Troubleshooting
|
|
42
42
|
|
|
43
|
-
| Error
|
|
44
|
-
|
|
45
|
-
| No traces found
|
|
46
|
-
| Tracker creation fails | Ensure OBS bucket exists and has correct permissions
|
|
43
|
+
| Error | Fix |
|
|
44
|
+
| ---------------------- | ---------------------------------------------------------- |
|
|
45
|
+
| No traces found | Check tracker is created and enabled. Filter by time range |
|
|
46
|
+
| Tracker creation fails | Ensure OBS bucket exists and has correct permissions |
|
|
47
47
|
|
|
48
48
|
## Security
|
|
49
49
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-dds-dcs
|
|
3
|
-
description:
|
|
3
|
+
description: 'Use when creating or managing Document Database Service (DDS/MongoDB-compatible) or Distributed Cache Service (DCS/Redis/Memcached) on Huawei Cloud. Triggers: DDS, DCS, MongoDB, Redis, Memcached, document DB, cache, replica set, sharding. NOT for: RDS (use huawei-rds), GaussDB (use huawei-gaussdb).'
|
|
4
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -14,22 +14,22 @@ Always run `hcloud DDS <Operation> --help` or `hcloud DCS <Operation> --help` be
|
|
|
14
14
|
|
|
15
15
|
## DDS Critical Warnings
|
|
16
16
|
|
|
17
|
-
| Trap
|
|
18
|
-
|
|
19
|
-
| Requires 3-node replica
|
|
20
|
-
| Shard key permanent
|
|
21
|
-
| Storage auto-scaling off | Enable before storage fills
|
|
17
|
+
| Trap | Why |
|
|
18
|
+
| ------------------------ | ------------------------------------------- |
|
|
19
|
+
| Requires 3-node replica | Minimum production deployment needs 3 nodes |
|
|
20
|
+
| Shard key permanent | Once selected, shard key cannot be changed |
|
|
21
|
+
| Storage auto-scaling off | Enable before storage fills |
|
|
22
22
|
|
|
23
23
|
### Common Workflows
|
|
24
24
|
|
|
25
|
-
| Task
|
|
26
|
-
|
|
27
|
-
| List instances
|
|
28
|
-
| Create instance
|
|
29
|
-
| Delete instance
|
|
25
|
+
| Task | Operation |
|
|
26
|
+
| ----------------- | --------------------------------------------------- |
|
|
27
|
+
| List instances | `ListInstances --cli-region=<r> --project_id=<p>` |
|
|
28
|
+
| Create instance | `CreateInstance --cli-region=<r> --project_id=<p>` |
|
|
29
|
+
| Delete instance | `DeleteInstance --cli-region=<r> --project_id=<p>` |
|
|
30
30
|
| Add readonly node | `AddReadonlyNode --cli-region=<r> --project_id=<p>` |
|
|
31
|
-
| Add shard
|
|
32
|
-
| Create backup
|
|
31
|
+
| Add shard | `AddShardingNode --cli-region=<r> --project_id=<p>` |
|
|
32
|
+
| Create backup | `CreateBackup --cli-region=<r> --project_id=<p>` |
|
|
33
33
|
|
|
34
34
|
Discover exact parameters with `--help` before executing any command.
|
|
35
35
|
|
|
@@ -37,32 +37,32 @@ Discover exact parameters with `--help` before executing any command.
|
|
|
37
37
|
|
|
38
38
|
## DCS Critical Warnings
|
|
39
39
|
|
|
40
|
-
| Trap
|
|
41
|
-
|
|
42
|
-
| Redis password required | Cannot create Redis instance without password
|
|
43
|
-
| Memcached no password
|
|
44
|
-
| Cache persistence costs | AOF/RDB persistence uses additional storage
|
|
40
|
+
| Trap | Why |
|
|
41
|
+
| ----------------------- | -------------------------------------------------- |
|
|
42
|
+
| Redis password required | Cannot create Redis instance without password |
|
|
43
|
+
| Memcached no password | Memcached has no auth — only accessible within VPC |
|
|
44
|
+
| Cache persistence costs | AOF/RDB persistence uses additional storage |
|
|
45
45
|
|
|
46
46
|
### Common Workflows
|
|
47
47
|
|
|
48
|
-
| Task
|
|
49
|
-
|
|
50
|
-
| List instances
|
|
51
|
-
| Create Redis instance
|
|
52
|
-
| Delete instance
|
|
53
|
-
| Restart instance
|
|
54
|
-
| Show node information
|
|
55
|
-
| Create custom template | `CreateCustomTemplate --cli-region=<r> --project_id=<p>`
|
|
48
|
+
| Task | Operation |
|
|
49
|
+
| ---------------------- | ------------------------------------------------------------- |
|
|
50
|
+
| List instances | `ListInstances --cli-region=<r> --project_id=<p>` |
|
|
51
|
+
| Create Redis instance | `CreateInstance --cli-region=<r> --project_id=<p>` |
|
|
52
|
+
| Delete instance | `DeleteInstances --cli-region=<r> --project_id=<p>` |
|
|
53
|
+
| Restart instance | `RestartInstance --cli-region=<r> --project_id=<p>` |
|
|
54
|
+
| Show node information | `BatchShowNodesInformation --cli-region=<r> --project_id=<p>` |
|
|
55
|
+
| Create custom template | `CreateCustomTemplate --cli-region=<r> --project_id=<p>` |
|
|
56
56
|
|
|
57
57
|
Discover exact parameters with `--help` before executing any command.
|
|
58
58
|
|
|
59
59
|
## Troubleshooting
|
|
60
60
|
|
|
61
|
-
| Error
|
|
62
|
-
|
|
63
|
-
| DDS instance creation fails | Check 3-node minimum, VPC/subnet availability
|
|
64
|
-
| DCS connection refused
|
|
65
|
-
| DCS auto-expire not working | Enable auto-expire scan task for Redis
|
|
61
|
+
| Error | Fix |
|
|
62
|
+
| --------------------------- | ------------------------------------------------------------------- |
|
|
63
|
+
| DDS instance creation fails | Check 3-node minimum, VPC/subnet availability |
|
|
64
|
+
| DCS connection refused | Redis instances need password. Memcached only accessible within VPC |
|
|
65
|
+
| DCS auto-expire not working | Enable auto-expire scan task for Redis |
|
|
66
66
|
|
|
67
67
|
## Cross-Skill References
|
|
68
68
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-deployment
|
|
3
|
-
description:
|
|
3
|
+
description: 'Use when creating, managing, or running deployment tasks and pipelines on Huawei Cloud CloudDeploy. Triggers: CloudDeploy, deployment, CI/CD, pipeline, release, artifact deployment, deploy task. NOT for: CodeArts Build (build pipeline), SWR container registry.'
|
|
4
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -16,33 +16,33 @@ Domain expertise for Huawei Cloud CloudDeploy. Covers application creation, depl
|
|
|
16
16
|
|
|
17
17
|
## Critical Warnings
|
|
18
18
|
|
|
19
|
-
| Trap
|
|
20
|
-
|
|
19
|
+
| Trap | Why |
|
|
20
|
+
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
21
|
| **Flyway SQL dialect mismatch (H2 dev → MySQL prod)** | Spring Boot apps commonly develop with H2 in-memory DB, then deploy to RDS MySQL. Flyway migrations using H2-specific syntax (e.g. `DATEADD`, `CHARACTER_LENGTH`, `BOOLEAN`) silently succeed on H2 but fail on MySQL. Before deploying, audit `V*__*.sql` migration files: replace `DATEADD` with `DATE_ADD`, `BOOLEAN` with `TINYINT(1)`, remove `characterEncoding=utf8mb4` from Spring Boot datasource URL (KooCLI RDS CreateInstance sets charset at the instance level). Use `Flyway.validate-on-migrate=true` in CI to catch dialect issues early. |
|
|
22
|
-
| Service name may be `CodeArtsDeploy`
|
|
23
|
-
| Deployment hosts need agent
|
|
24
|
-
| Task must reference application first
|
|
25
|
-
| Artifact source defaults to OBS
|
|
26
|
-
| Parallel deployments may conflict
|
|
22
|
+
| Service name may be `CodeArtsDeploy` | hcloud service name for deployment may be `CodeArtsDeploy` instead of `CloudDeploy`. Run `hcloud --help` to verify |
|
|
23
|
+
| Deployment hosts need agent | Install CloudDeploy agent on target hosts first |
|
|
24
|
+
| Task must reference application first | Create application before task |
|
|
25
|
+
| Artifact source defaults to OBS | Most deployment tasks pull artifacts from OBS. Ensure bucket and object exist |
|
|
26
|
+
| Parallel deployments may conflict | Lock resources or use deployment groups |
|
|
27
27
|
|
|
28
28
|
## Common Workflows
|
|
29
29
|
|
|
30
|
-
| Task
|
|
31
|
-
|
|
32
|
-
| Create application
|
|
30
|
+
| Task | Operation |
|
|
31
|
+
| ---------------------- | ---------------------------------------------------------------- |
|
|
32
|
+
| Create application | `CreateApp --name=<n> --platform=<p> --cli-region=<r>` |
|
|
33
33
|
| Create deployment task | `CreateTask --name=<n> --app_id=<id> --artifact_source_type=OBS` |
|
|
34
|
-
| Start deployment
|
|
35
|
-
| List tasks
|
|
36
|
-
| Delete task
|
|
34
|
+
| Start deployment | `StartTask --task_id=<id>` |
|
|
35
|
+
| List tasks | `ListTasks --app_id=<id>` |
|
|
36
|
+
| Delete task | `DeleteTask --task_id=<id>` |
|
|
37
37
|
|
|
38
38
|
## Troubleshooting
|
|
39
39
|
|
|
40
|
-
| Error
|
|
41
|
-
|
|
42
|
-
| Agent offline
|
|
43
|
-
| Deployment timeout | Check artifact size, increase task timeout, verify target host resources
|
|
44
|
-
| Artifact not found | Verify OBS bucket and object path, check artifact permissions
|
|
45
|
-
| Permission denied
|
|
40
|
+
| Error | Fix |
|
|
41
|
+
| ------------------ | ----------------------------------------------------------------------------- |
|
|
42
|
+
| Agent offline | Check agent service on target host, network connectivity, firewall rules |
|
|
43
|
+
| Deployment timeout | Check artifact size, increase task timeout, verify target host resources |
|
|
44
|
+
| Artifact not found | Verify OBS bucket and object path, check artifact permissions |
|
|
45
|
+
| Permission denied | Verify IAM roles for deployment: `CodeArtsDeploy FullAccess` or custom policy |
|
|
46
46
|
|
|
47
47
|
## Security
|
|
48
48
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-dew
|
|
3
|
-
description:
|
|
3
|
+
description: 'Use when managing secrets, credentials, encryption keys, certificates, or any sensitive data on Huawei Cloud. Covers CSMS (Cloud Secret Management Service) for secrets, KMS for encryption keys, and credential rotation. Triggers on: secret, credential, API key, token, password, encrypt, decrypt, KMS, CSMS, DEW, certificate, CSR, rotation. Activates for ANY task involving secrets or credentials — load this skill first before touching secrets.'
|
|
4
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -16,64 +16,73 @@ Domain expertise for Huawei Cloud Data Encryption Workshop (DEW). Covers CSMS fo
|
|
|
16
16
|
|
|
17
17
|
## Critical Warnings
|
|
18
18
|
|
|
19
|
-
| Trap
|
|
20
|
-
|
|
21
|
-
| NEVER fetch secret values into agent context | Use {{resolve:csms:secret-id:SecretString:key}} runtime injection
|
|
22
|
-
| NEVER echo credentials in conversation
|
|
23
|
-
| KMS key deletion is irreversible
|
|
24
|
-
| Secret rotation requires automation
|
|
25
|
-
| Cross-account KMS needs grants
|
|
19
|
+
| Trap | Why |
|
|
20
|
+
| -------------------------------------------- | ------------------------------------------------------------------ |
|
|
21
|
+
| NEVER fetch secret values into agent context | Use {{resolve:csms:secret-id:SecretString:key}} runtime injection |
|
|
22
|
+
| NEVER echo credentials in conversation | AK/SK, passwords, tokens must never appear in chat |
|
|
23
|
+
| KMS key deletion is irreversible | 7-30 day pending deletion window. Once gone, data is unrecoverable |
|
|
24
|
+
| Secret rotation requires automation | Manual rotation risks stale credentials |
|
|
25
|
+
| Cross-account KMS needs grants | KMS keys are regional. Cross-region data needs grant setup |
|
|
26
26
|
|
|
27
27
|
## CSMS Operations
|
|
28
28
|
|
|
29
29
|
### Read-only (safe — metadata only)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
30
|
+
|
|
31
|
+
| Operation | Description |
|
|
32
|
+
| ------------------ | ------------------------------------------------------ |
|
|
33
|
+
| ListSecrets | List all secrets (names only, no values) |
|
|
34
|
+
| DescribeSecret | Get secret metadata (rotation config, KMS key, status) |
|
|
35
|
+
| ListSecretVersions | List version IDs and stages (no values) |
|
|
35
36
|
|
|
36
37
|
### Secret Value (blocked by policy — use runtime injection)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
|
38
|
+
|
|
39
|
+
| Operation | Safe Alternative |
|
|
40
|
+
| ----------------- | --------------------------------------------- |
|
|
41
|
+
| DownloadSecret | Use {{resolve:csms:secret-id}} in IaC or SDK |
|
|
40
42
|
| ShowSecretVersion | Use runtime injection, never in agent context |
|
|
41
|
-
| GetSecretValue
|
|
43
|
+
| GetSecretValue | Blocked. Use MCP proxy resolve pattern |
|
|
42
44
|
|
|
43
45
|
## KMS Operations
|
|
44
46
|
|
|
45
|
-
| Task
|
|
46
|
-
|
|
47
|
-
| List keys
|
|
48
|
-
| Create key | hcloud KMS CreateKey --key_alias=<name>
|
|
49
|
-
| Encrypt
|
|
50
|
-
| Decrypt
|
|
47
|
+
| Task | Command | Notes |
|
|
48
|
+
| ---------- | ------------------------------------------------------ | -------------------------- |
|
|
49
|
+
| List keys | hcloud KMS ListKeys | Read-only |
|
|
50
|
+
| Create key | hcloud KMS CreateKey --key_alias=<name> | Requires write approval |
|
|
51
|
+
| Encrypt | hcloud KMS EncryptData --key_id=<id> --plaintext=<b64> | Prefer SDK offline encrypt |
|
|
52
|
+
| Decrypt | hcloud KMS DecryptData (**BLOCKED**) | Use runtime injection |
|
|
51
53
|
|
|
52
54
|
## Runtime Injection Pattern
|
|
53
55
|
|
|
54
56
|
`ash
|
|
57
|
+
|
|
55
58
|
# Terraform / IaC
|
|
59
|
+
|
|
56
60
|
resource "huaweicloud_csms_secret" "db_password" {
|
|
57
|
-
|
|
61
|
+
secret_string = var.db_password # NEVER hardcode
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
# SDK
|
|
65
|
+
|
|
61
66
|
secret_value = client.get_secret(secret_id="my-secret")
|
|
67
|
+
|
|
62
68
|
# Use immediately, never print or store in context
|
|
63
69
|
|
|
64
70
|
# hcloud (for approved automation only)
|
|
71
|
+
|
|
65
72
|
hcloud CSMS DownloadSecret --secret_name=<name>
|
|
73
|
+
|
|
66
74
|
# WARNING: Output goes to stdout. Pipe directly, never capture in agent.
|
|
75
|
+
|
|
67
76
|
`
|
|
68
77
|
|
|
69
78
|
## Troubleshooting
|
|
70
79
|
|
|
71
|
-
| Error
|
|
72
|
-
|
|
73
|
-
| Secret not found
|
|
74
|
-
| AccessDenied on CSMS | Missing IAM CSMS policy -> Add csms:DescribeSecret + kms:Decrypt
|
|
75
|
-
| KMS key disabled
|
|
76
|
-
| Rotation stuck
|
|
80
|
+
| Error | Root Cause -> Fix |
|
|
81
|
+
| -------------------- | --------------------------------------------------------------------------- |
|
|
82
|
+
| Secret not found | Wrong region or project -> Verify secret ARN includes region/project |
|
|
83
|
+
| AccessDenied on CSMS | Missing IAM CSMS policy -> Add csms:DescribeSecret + kms:Decrypt |
|
|
84
|
+
| KMS key disabled | Key scheduled for deletion or manually disabled -> Enable or create new key |
|
|
85
|
+
| Rotation stuck | Lambda/Python function error -> Check rotation function logs |
|
|
77
86
|
|
|
78
87
|
## Security Considerations
|
|
79
88
|
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
# CSMS Usage Guide
|
|
2
2
|
|
|
3
3
|
## Create Secret
|
|
4
|
+
|
|
4
5
|
hcloud CSMS CreateSecret --secret_name=prod-db-password --secret_string='{"password":"CHANGE_ME"}'
|
|
5
6
|
|
|
6
7
|
## List Secrets (metadata only)
|
|
8
|
+
|
|
7
9
|
hcloud CSMS ListSecrets
|
|
8
10
|
|
|
9
11
|
## Describe Secret
|
|
12
|
+
|
|
10
13
|
hcloud CSMS DescribeSecret --secret_name=prod-db-password
|
|
11
14
|
|
|
12
15
|
## List Versions
|
|
16
|
+
|
|
13
17
|
hcloud CSMS ListSecretVersions --secret_name=prod-db-password
|
|
14
18
|
|
|
15
19
|
## Runtime Injection (Terraform)
|
|
20
|
+
|
|
16
21
|
data "huaweicloud_csms_secret" "db" {
|
|
17
|
-
|
|
22
|
+
secret_name = "prod-db-password"
|
|
18
23
|
}
|
|
19
24
|
Use: data.huaweicloud_csms_secret.db.secret_string
|
|
20
25
|
|
|
21
26
|
## Rotation
|
|
27
|
+
|
|
22
28
|
- Enable auto-rotation: hcloud CSMS EnableSecretRotation --secret_name=<name> --rotation_interval=30
|
|
23
29
|
- Rotation function ARN: provide Lambda to generate new secret value
|
|
24
30
|
|
|
25
31
|
## Policy Rules
|
|
32
|
+
|
|
26
33
|
- hcloud CSMS DownloadSecret -> BLOCKED (use runtime injection)
|
|
27
34
|
- hcloud CSMS ShowSecretVersion -> BLOCKED
|
|
28
35
|
- hcloud CSMS ListSecrets -> ALLOWED (metadata only)
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
# KMS Usage Guide
|
|
2
2
|
|
|
3
3
|
## Create Key
|
|
4
|
+
|
|
4
5
|
hcloud KMS CreateKey --key_alias=app-encryption-key --key_description="Application data encryption"
|
|
5
6
|
|
|
6
7
|
## List Keys (metadata only)
|
|
8
|
+
|
|
7
9
|
hcloud KMS ListKeys
|
|
8
10
|
|
|
9
11
|
## Encrypt (offline preferred)
|
|
12
|
+
|
|
10
13
|
hcloud KMS EncryptData --key_id=<key-id> --plaintext=<base64-data>
|
|
11
14
|
|
|
12
15
|
## Decrypt (BLOCKED - use runtime)
|
|
16
|
+
|
|
13
17
|
DO NOT use hcloud KMS DecryptData directly.
|
|
14
18
|
Use SDK with KMS client in application runtime.
|
|
15
19
|
|
|
16
20
|
## Key Rotation
|
|
21
|
+
|
|
17
22
|
- Enable: hcloud KMS EnableKeyRotation --key_id=<key-id>
|
|
18
23
|
- Rotation period: 365 days (default)
|
|
19
24
|
|
|
20
25
|
## Key Deletion
|
|
26
|
+
|
|
21
27
|
- Schedule: hcloud KMS ScheduleKeyDeletion --key_id=<key-id> --pending_days=7
|
|
22
28
|
- Cancel during pending window: hcloud KMS CancelKeyDeletion --key_id=<key-id>
|
|
23
29
|
- WARNING: After deletion window passes, data encrypted with this key is UNRECOVERABLE
|