divergent-thinking-skill 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/bin/install.js +81 -0
- package/package.json +34 -0
- package/skill/SKILL.md +104 -0
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# divergent-thinking-skill
|
|
2
|
+
|
|
3
|
+
npm package that installs the **divergent-thinking** agent skill (`SKILL.md`) so users can run:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx divergent-thinking-skill
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
Default target: `~/.agents/skills/divergent-thinking/SKILL.md`.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Custom parent (folder that contains per-skill subdirs)
|
|
15
|
+
npx divergent-thinking-skill --dir ~/.codex/skills
|
|
16
|
+
npx divergent-thinking-skill --dir ~/.claude/skills
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or set environment (parent directory only):
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
DIVERGENT_THINKING_SKILL_DIR=~/.claude/skills npx divergent-thinking-skill
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Publish to npm (maintainers)
|
|
26
|
+
|
|
27
|
+
1. Edit `package.json` → set `"repository.url"` to your real Git URL.
|
|
28
|
+
2. Pick an available name on npm; if `divergent-thinking-skill` is taken, use a scoped name:
|
|
29
|
+
`@your-scope/divergent-thinking-skill` and update the `"name"` field.
|
|
30
|
+
3. From this directory:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm login
|
|
34
|
+
npm publish --access public
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`prepublishOnly` runs `scripts/sync-skill.js` and refreshes `skill/SKILL.md` from the repo root `skills/divergent-thinking/SKILL.md`.
|
|
38
|
+
|
|
39
|
+
## Local test without publishing
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
cd packages/divergent-thinking-skill
|
|
43
|
+
npm run sync
|
|
44
|
+
node bin/install.js --dir /tmp/skills-test
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
MIT
|
package/bin/install.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Installs packaged SKILL.md into the user's agent skills directory.
|
|
4
|
+
* Usage:
|
|
5
|
+
* npx divergent-thinking-skill
|
|
6
|
+
* npx divergent-thinking-skill --dir ~/.codex/skills
|
|
7
|
+
* DIVERGENT_THINKING_SKILL_DIR=~/.claude/skills npx divergent-thinking-skill
|
|
8
|
+
*/
|
|
9
|
+
const fs = require("fs");
|
|
10
|
+
const path = require("path");
|
|
11
|
+
const os = require("os");
|
|
12
|
+
|
|
13
|
+
function expandHome(p) {
|
|
14
|
+
if (!p || p[0] !== "~") return p;
|
|
15
|
+
return path.join(os.homedir(), p.slice(1).replace(/^\//, "") || "");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function parseArgs(argv) {
|
|
19
|
+
let outDir = null;
|
|
20
|
+
let help = false;
|
|
21
|
+
for (let i = 2; i < argv.length; i++) {
|
|
22
|
+
const a = argv[i];
|
|
23
|
+
if (a === "--help" || a === "-h") help = true;
|
|
24
|
+
else if (a === "--dir" && argv[i + 1]) {
|
|
25
|
+
outDir = expandHome(argv[++i]);
|
|
26
|
+
} else if (a.startsWith("--dir=")) {
|
|
27
|
+
outDir = expandHome(a.slice("--dir=".length));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return { outDir, help };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function defaultSkillsRoot() {
|
|
34
|
+
const env =
|
|
35
|
+
process.env.DIVERGENT_THINKING_SKILL_DIR ||
|
|
36
|
+
process.env.AGENT_SKILLS_DIR ||
|
|
37
|
+
"";
|
|
38
|
+
if (env) return expandHome(env.trim());
|
|
39
|
+
return path.join(os.homedir(), ".agents", "skills");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function main() {
|
|
43
|
+
const { outDir, help } = parseArgs(process.argv);
|
|
44
|
+
if (help) {
|
|
45
|
+
console.log(`
|
|
46
|
+
divergent-thinking-skill — install SKILL.md for agent runtimes (Cursor, Codex, Claude Code, etc.)
|
|
47
|
+
|
|
48
|
+
Usage:
|
|
49
|
+
npx divergent-thinking-skill
|
|
50
|
+
npx divergent-thinking-skill --dir ~/.agents/skills
|
|
51
|
+
npx divergent-thinking-skill --dir ./my-project/.cursor/skills
|
|
52
|
+
|
|
53
|
+
Environment:
|
|
54
|
+
DIVERGENT_THINKING_SKILL_DIR Parent directory for skill folders (default: ~/.agents/skills)
|
|
55
|
+
AGENT_SKILLS_DIR Same as above (fallback alias)
|
|
56
|
+
|
|
57
|
+
Install location:
|
|
58
|
+
<parent>/divergent-thinking/SKILL.md
|
|
59
|
+
|
|
60
|
+
Point your tool at the parent "skills" directory per its docs (e.g. ~/.codex/skills, ~/.claude/skills).
|
|
61
|
+
`);
|
|
62
|
+
process.exit(0);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const parent = outDir || defaultSkillsRoot();
|
|
66
|
+
const destDir = path.join(parent, "divergent-thinking");
|
|
67
|
+
const src = path.join(__dirname, "..", "skill", "SKILL.md");
|
|
68
|
+
const dest = path.join(destDir, "SKILL.md");
|
|
69
|
+
|
|
70
|
+
if (!fs.existsSync(src)) {
|
|
71
|
+
console.error("install: packaged SKILL.md missing at", src);
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
76
|
+
fs.copyFileSync(src, dest);
|
|
77
|
+
console.log("Installed:", dest);
|
|
78
|
+
console.log("Parent skills directory:", path.resolve(parent));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "divergent-thinking-skill",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Agent skill: diverge → compare → recommend (frontend-friendly). Install SKILL.md via npx.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/YOUR_ORG/mult-solutions.git",
|
|
9
|
+
"directory": "packages/divergent-thinking-skill"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"agent",
|
|
13
|
+
"skill",
|
|
14
|
+
"cursor",
|
|
15
|
+
"claude",
|
|
16
|
+
"divergent-thinking",
|
|
17
|
+
"frontend"
|
|
18
|
+
],
|
|
19
|
+
"bin": {
|
|
20
|
+
"divergent-thinking-skill": "bin/install.js"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"bin",
|
|
24
|
+
"skill",
|
|
25
|
+
"README.md"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"sync": "node scripts/sync-skill.js",
|
|
29
|
+
"prepublishOnly": "node scripts/sync-skill.js"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/skill/SKILL.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: divergent-thinking
|
|
3
|
+
description: >
|
|
4
|
+
Use when the user wants multiple approaches, option comparison, feasibility or “best” picks—
|
|
5
|
+
especially front-end/UI (组件方案、状态管理、样式、性能、无障碍、SSR/SSG、设计还原、工程化).
|
|
6
|
+
Also general open questions: 多个方案、对比一下、brainstorm、trade-offs、方案对比、可行性.
|
|
7
|
+
Produces distinct options, a shared-criteria matrix, and a labeled primary recommendation plus fallback.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Divergent thinking (multi-option → compare → recommend)
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
13
|
+
|
|
14
|
+
Apply this skill when:
|
|
15
|
+
|
|
16
|
+
- The user explicitly asks for several paths, comparison, or what is “most feasible / optimal,” **or**
|
|
17
|
+
- The question is open-ended (how to achieve X) and more than one credible approach exists,
|
|
18
|
+
|
|
19
|
+
unless the user clearly wants a **single short answer** only.
|
|
20
|
+
|
|
21
|
+
**Primary domain:** **Front-end engineering** (UI structure, styling systems, client performance, accessibility, framework/library choice, design handoff, delivery trade-offs). For non-UI questions, keep the same workflow with domain-appropriate criteria.
|
|
22
|
+
|
|
23
|
+
**With `brainstorming` skill:** For greenfield product/feature ideation, you may use the brainstorming skill first to clarify intent and constraints, then use **this** skill to produce comparable options and a recommendation.
|
|
24
|
+
|
|
25
|
+
**With UI skills:** When output must be visually or structurally strong, combine with **`frontend-design`** / **`ui-ux-pro-max`** (or similar) for layout/tokens before or while building the matrix.
|
|
26
|
+
|
|
27
|
+
## Workflow (follow in order)
|
|
28
|
+
|
|
29
|
+
1. **Restate** the goal, success criteria, and hard constraints in your own words.
|
|
30
|
+
2. **Clarify or assume:** If missing facts would change the ranking (budget, timeline, risk tolerance, metrics, platform limits), ask up to **three** targeted questions **or** proceed with a labeled **Assumptions** block.
|
|
31
|
+
3. **Diverge:** Produce **3–5** options for broad/strategic questions, or **2+** for narrow technical questions. Each option must differ in **mechanism or posture** (build vs. buy vs. partner), not wording alone.
|
|
32
|
+
4. **Compare:** Build a **matrix or table**—every option × the **same** criteria. For **front-end** topics, include engineering-relevant columns such as **runtime/bundle impact**, **accessibility**, **maintainability**, **fit to current stack**, **design-handoff friction**, **migration cost**, plus user goals (ship speed, quality). For non-UI topics, use domain-appropriate columns only. Do not compare on different axes per row.
|
|
33
|
+
5. **Recommend:** Give a **primary** pick and name what “best” means here (e.g. *best under stated priorities*, *most feasible now*, *lowest risk*). If criteria conflict, name a **runner-up** or **conditional** choice (“if speed matters more than cost, pick B”).
|
|
34
|
+
6. **Uncertainty:** If facts are thin, add **Unknowns** and **What would change the ranking** (specific evidence or experiments).
|
|
35
|
+
|
|
36
|
+
**Optional — tools first:** If the host has MCP or web access, prefer **fetching or searching** for missing facts *before* step 3, or mid-workflow when a claim is checkable. If tools are unavailable, keep **Unknowns** explicit. (See also **Optional integrations** below.)
|
|
37
|
+
|
|
38
|
+
## Quality gates (before you send)
|
|
39
|
+
|
|
40
|
+
- **Orthogonality check:** Can each option be summarized in one line without overlapping the others? If two collapse into the same approach, replace one.
|
|
41
|
+
- **No fake diversity:** Do not list the same idea with different adjectives.
|
|
42
|
+
- **Explicit trade-offs:** Where speed vs. cost vs. quality conflict, say which criterion drove the primary recommendation.
|
|
43
|
+
- **High-stakes caution:** For medical, legal, financial, or safety-critical decisions, add a **Risk note**: not a substitute for a qualified professional; do not imply a single “optimal” legal/medical/financial outcome without verification.
|
|
44
|
+
|
|
45
|
+
## Output skeleton
|
|
46
|
+
|
|
47
|
+
Use this structure (headings can be localized to the user’s language):
|
|
48
|
+
|
|
49
|
+
1. **Summary** — One short paragraph: problem, number of options, top pick + sense of “best.”
|
|
50
|
+
2. **Problem & constraints** — Restatement + **Assumptions** (if any).
|
|
51
|
+
3. **Options** — For each: name, one-line approach, expected outcome, main cost/risk.
|
|
52
|
+
4. **Comparison** — Table/matrix: rows = options, columns = shared criteria (use ✓/– or L/M/H if helpful).
|
|
53
|
+
5. **Recommendation** — Primary + **labeled “best” type**; runner-up or conditional branch; **Unknowns** + **what would change the ranking** when relevant.
|
|
54
|
+
6. **Risk note** (if high-stakes or irreversible) — Scope of caution and suggestion to verify with a human expert.
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
- **Repo-local (this project):** `skills/divergent-thinking/SKILL.md` — reference from project `AGENTS.md` or Cursor rules if you want it always considered.
|
|
59
|
+
- **User-wide:** Copy the folder to `~/.agents/skills/divergent-thinking/` (or your tool’s skills directory) so the agent loads it globally.
|
|
60
|
+
|
|
61
|
+
## Optional integrations (public MCPs & skills)
|
|
62
|
+
|
|
63
|
+
This skill does not require any server. To improve **grounded** comparisons, combine with tools your environment already exposes:
|
|
64
|
+
|
|
65
|
+
| Need | Role | Where to browse |
|
|
66
|
+
|------|------|-----------------|
|
|
67
|
+
| Grounding / fetch / search | Turn “feasible” into “checked against a source” | [MCP Registry](https://modelcontextprotocol.io/registry), [registry.modelcontextprotocol.io](https://registry.modelcontextprotocol.io/), [modelcontextprotocol/servers](https://github.com/modelcontextprotocol/servers), [MCP Directory](https://mcpserverdirectory.org/) |
|
|
68
|
+
| Browser automation | Validate flows that depend on live UI | Registry categories (browser / testing) |
|
|
69
|
+
| Git / GitHub | Scope and risk for **this** repo | Git/GitHub-class MCPs in the reference repo above |
|
|
70
|
+
| Memory / notes | Persist user constraints across sessions | Registry “knowledge / memory” style servers — mind privacy |
|
|
71
|
+
|
|
72
|
+
**Skill ecosystem (no single store):** [Agent Skills spec](https://agentskills.io), example gallery [anthropics/skills](https://github.com/anthropics/skills). Use **brainstorming**-style skills *before* this one for discovery; use domain skills *after* shortlisting.
|
|
73
|
+
|
|
74
|
+
### Front-end–oriented MCP patterns (when available)
|
|
75
|
+
|
|
76
|
+
| Need | Role | Typical MCP patterns |
|
|
77
|
+
|------|------|----------------------|
|
|
78
|
+
| Design source | Ground options in real components/layouts | **Figma**-class MCP (design → structure / tokens) |
|
|
79
|
+
| Browser truth | Layout, perf, network, a11y checks | **Chrome DevTools**-class MCP |
|
|
80
|
+
| E2E / UI flows | Scripted navigation, screenshots, regressions | **Playwright**-class MCP |
|
|
81
|
+
| Docs | API and version truth for frameworks | **Fetch** + official docs |
|
|
82
|
+
| Repo | Match existing stack and conventions | **Git** / **GitHub** MCP |
|
|
83
|
+
|
|
84
|
+
Use **stack → (optional) design/repo/docs via MCP → diverge → matrix → recommend.** If tools are missing, state **Unknowns**.
|
|
85
|
+
|
|
86
|
+
Full rationale: `openspec/changes/divergent-thinking-skill/proposal.md` (*Complementary public skills & MCPs*, *Front-end scenarios & complementary tools*).
|
|
87
|
+
|
|
88
|
+
## Verification walkthrough (spec coverage)
|
|
89
|
+
|
|
90
|
+
Use these as internal self-checks; outputs should satisfy the scenarios in `openspec/changes/divergent-thinking-skill/specs/divergent-thinking-skill/spec.md`.
|
|
91
|
+
|
|
92
|
+
| Type | Example prompt | You must |
|
|
93
|
+
|------|----------------|----------|
|
|
94
|
+
| Broad / strategic | “我们团队效率低,怎么系统性提升?” | ≥3 distinct mechanisms, 3–5 options, full matrix, recommendation with “best” type |
|
|
95
|
+
| Narrow technical | “Python 里用哪个 HTTP 客户端更合适?” | ≥2 real alternatives or justify single viable path; same comparison columns for each |
|
|
96
|
+
| Conflicting goals | “要快上线还要零技术债,怎么选架构?” | Call out trade-off; primary + fallback when priorities differ; optional Unknowns |
|
|
97
|
+
| Front-end open | “中后台表格页,数据量大,怎么设计前端架构?” | ≥3 distinct approaches; matrix includes perf, a11y, maintainability, stack fit |
|
|
98
|
+
| Front-end narrow | “Tailwind vs CSS Modules vs styled-components,选哪个?” | ≥2 options; include bundle/DX/a11y/migration criteria |
|
|
99
|
+
| Front-end + design | “Figma 还原 + 主题切换,给几种实现路线?” | Mention handoff/tokens; if Figma MCP available, read structure before options |
|
|
100
|
+
|
|
101
|
+
## Trigger phrases (non-exhaustive)
|
|
102
|
+
|
|
103
|
+
中文:多个方案、几种思路、对比一下、哪个更可行、优缺点、权衡、可行性、最优方案、发散;前端常用:组件方案、状态管理、样式方案、性能、无障碍、SSR、设计稿还原、工程化选型。
|
|
104
|
+
English: brainstorm options, compare approaches, trade-offs, pros and cons, most feasible, best path, alternatives; UI: styling strategy, state management, SSR vs SPA, a11y, bundle/perf, component architecture.
|