obsidian-dev-skills 1.0.2 → 1.0.3

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 CHANGED
@@ -6,10 +6,10 @@ This repository contains centralized AI agent skills for Obsidian plugin and the
6
6
 
7
7
  ```
8
8
  obsidian-dev-skills/
9
- ├── obsidian-dev-plugins/ # Plugin development skills
10
- ├── obsidian-dev-themes/ # Theme development skills
11
- ├── obsidian-ops/ # Operations & workflows
12
- └── obsidian-ref/ # Technical references
9
+ ├── obsidian-dev/ # Plugin development skills
10
+ ├── obsidian-theme-dev/ # Theme development skills
11
+ ├── obsidian-ops/ # Operations & workflows
12
+ └── obsidian-ref/ # Technical references
13
13
  ```
14
14
 
15
15
  ## Getting Started
@@ -28,13 +28,13 @@ The `setup-ref-links` script clones this repository to your `.ref` folder and cr
28
28
 
29
29
  ## Skills Overview
30
30
 
31
- ### obsidian-dev-plugins
31
+ ### obsidian-dev
32
32
  - TypeScript/JavaScript development patterns
33
33
  - Obsidian API usage
34
34
  - Plugin lifecycle management
35
35
  - Command and settings implementation
36
36
 
37
- ### obsidian-dev-themes
37
+ ### obsidian-theme-dev
38
38
  - CSS/SCSS development patterns
39
39
  - Obsidian CSS variables
40
40
  - Responsive design
@@ -70,10 +70,11 @@ When skills are updated in this repository, all linked projects automatically ge
70
70
 
71
71
  Each project maintains its own `sync-status.json` file to track when reference materials were last updated.
72
72
 
73
- ## Compatibility
74
-
75
- - **Cursor**: Primary supported AI agent
76
- - **Open Cognitive Skills (OCS) Specification**: [https://github.com/AI-CAMEL/Skills-Specification](https://github.com/AI-CAMEL/Skills-Specification)
73
+ ## Compatibility
74
+
75
+ - **AI Agents**: Compatible with any AI agent supporting the Open Cognitive Skills (OCS) Specification
76
+ - **IDEs**: Works across all development environments (VS Code, Cursor, JetBrains IDEs, etc.)
77
+ - **Specification**: Open Cognitive Skills (OCS) - [https://github.com/AI-CAMEL/Skills-Specification](https://github.com/AI-CAMEL/Skills-Specification)
77
78
 
78
79
  ## Contributing
79
80
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: obsidian-dev-themes
2
+ name: obsidian-theme-dev
3
3
  description: CSS/SCSS development patterns for Obsidian themes. Load when working with theme.css, SCSS variables, or CSS selectors.
4
4
  ---
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-dev-skills",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Agent skills for Obsidian plugin and theme development",
5
5
  "keywords": [
6
6
  "obsidian",
@@ -19,8 +19,8 @@
19
19
  "license": "MIT",
20
20
  "author": "David V. Kimball",
21
21
  "files": [
22
- "obsidian-dev-plugins/",
23
- "obsidian-dev-themes/",
22
+ "obsidian-dev/",
23
+ "obsidian-theme-dev/",
24
24
  "obsidian-ops/",
25
25
  "obsidian-ref/",
26
26
  "scripts/"
@@ -34,4 +34,4 @@
34
34
  "engines": {
35
35
  "node": ">=16.0.0"
36
36
  }
37
- }
37
+ }
package/scripts/init.mjs CHANGED
@@ -28,7 +28,7 @@ function getProjectRoot() {
28
28
  if (pkg.name !== 'obsidian-dev-skills') {
29
29
  return current;
30
30
  }
31
- } catch (e) {}
31
+ } catch (e) { }
32
32
  }
33
33
  current = path.dirname(current);
34
34
  }
@@ -45,8 +45,8 @@ if (!fs.existsSync(agentDir) && fs.existsSync(path.join(projectRoot, '.agents'))
45
45
  const skillsDir = path.join(agentDir, 'skills');
46
46
 
47
47
  const skillMappings = {
48
- 'obsidian-dev': 'obsidian-dev-plugins',
49
- 'obsidian-theme-dev': 'obsidian-dev-themes',
48
+ 'obsidian-dev': 'obsidian-dev',
49
+ 'obsidian-theme-dev': 'obsidian-theme-dev',
50
50
  'obsidian-ops': 'obsidian-ops',
51
51
  'obsidian-ref': 'obsidian-ref'
52
52
  };
@@ -67,11 +67,53 @@ function copyRecursiveSync(src, dest) {
67
67
  }
68
68
  }
69
69
 
70
+ /**
71
+ * Detects if the project is an Obsidian plugin, theme, or both.
72
+ * @returns {'plugin' | 'theme' | 'both'}
73
+ */
74
+ function detectProjectType(root) {
75
+ const manifestPath = path.join(root, 'manifest.json');
76
+ const themeCssPath = path.join(root, 'theme.css');
77
+
78
+ let isPlugin = false;
79
+ let isTheme = false;
80
+
81
+ if (fs.existsSync(manifestPath)) {
82
+ try {
83
+ const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
84
+ if (manifest.id) {
85
+ isPlugin = true;
86
+ } else {
87
+ // Obsidian themes also have a manifest.json but typically no 'id' field
88
+ isTheme = true;
89
+ }
90
+ } catch (e) {
91
+ console.warn(`⚠️ Warning: Failed to parse manifest.json at ${manifestPath}`);
92
+ }
93
+ }
94
+
95
+ if (fs.existsSync(themeCssPath)) {
96
+ isTheme = true;
97
+ }
98
+
99
+ // If detected both, return 'both'
100
+ if (isPlugin && isTheme) {
101
+ return 'both';
102
+ }
103
+
104
+ // If detected neither, return 'both' (fallback)
105
+ if (!isPlugin && !isTheme) {
106
+ return 'both';
107
+ }
108
+
109
+ return isPlugin ? 'plugin' : 'theme';
110
+ }
111
+
70
112
  async function init() {
71
113
  // Determine if we are running in the package's own directory (development)
72
- const isDevelopment = projectRoot === packageRoot ||
73
- (fs.existsSync(path.join(packageRoot, 'obsidian-dev-plugins')) &&
74
- !fs.existsSync(path.join(projectRoot, 'node_modules', 'obsidian-dev-skills')));
114
+ const isDevelopment = projectRoot === packageRoot ||
115
+ (fs.existsSync(path.join(packageRoot, 'obsidian-dev')) &&
116
+ !fs.existsSync(path.join(projectRoot, 'node_modules', 'obsidian-dev-skills')));
75
117
 
76
118
  if (isDevelopment && !process.env.FORCE_INIT) {
77
119
  console.log('🛠️ Development mode detected (or forced skip), skipping initialization.');
@@ -80,6 +122,9 @@ async function init() {
80
122
 
81
123
  console.log(`🚀 Initializing Obsidian Dev Skills in: ${projectRoot}`);
82
124
  try {
125
+ const projectType = detectProjectType(projectRoot);
126
+ console.log(`🔍 Detected project type: ${projectType}`);
127
+
83
128
  // Create .agent/skills directory if it doesn't exist
84
129
  if (!fs.existsSync(skillsDir)) {
85
130
  console.log(`📁 Creating directory: ${skillsDir}`);
@@ -87,6 +132,14 @@ async function init() {
87
132
  }
88
133
 
89
134
  for (const [targetName, sourceName] of Object.entries(skillMappings)) {
135
+ // Filter based on project type
136
+ if (projectType === 'plugin' && targetName === 'obsidian-theme-dev') {
137
+ continue;
138
+ }
139
+ if (projectType === 'theme' && targetName === 'obsidian-dev') {
140
+ continue;
141
+ }
142
+
90
143
  const sourcePath = path.join(packageRoot, sourceName);
91
144
  const targetPath = path.join(skillsDir, targetName);
92
145
 
@@ -105,7 +158,7 @@ async function init() {
105
158
  // Update or create sync-status.json
106
159
  const syncStatusPath = path.join(agentDir, 'sync-status.json');
107
160
  const today = new Date().toISOString().split('T')[0];
108
-
161
+
109
162
  let syncStatus = {
110
163
  lastFullSync: today,
111
164
  lastSyncSource: 'obsidian-dev-skills initialization'
@@ -124,7 +177,7 @@ async function init() {
124
177
  console.log('✅ Updated .agent/sync-status.json');
125
178
 
126
179
  console.log('\n🎉 Successfully installed Obsidian Dev Skills!');
127
- console.log('Your Cursor agent now has access to specialized Obsidian development knowledge.');
180
+ console.log('Your AI agent now has access to specialized Obsidian development knowledge.');
128
181
  } catch (error) {
129
182
  console.error('❌ Error during initialization:', error.message);
130
183
  process.exit(1);
File without changes