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 +11 -10
- package/{obsidian-dev-themes → obsidian-theme-dev}/SKILL.md +1 -1
- package/package.json +4 -4
- package/scripts/init.mjs +61 -8
- /package/{obsidian-dev-plugins → obsidian-dev}/SKILL.md +0 -0
- /package/{obsidian-dev-plugins → obsidian-dev}/references/agent-dos-donts.md +0 -0
- /package/{obsidian-dev-plugins → obsidian-dev}/references/code-patterns.md +0 -0
- /package/{obsidian-dev-plugins → obsidian-dev}/references/coding-conventions.md +0 -0
- /package/{obsidian-dev-plugins → obsidian-dev}/references/commands-settings.md +0 -0
- /package/{obsidian-dev-plugins → obsidian-dev}/references/common-tasks.md +0 -0
- /package/{obsidian-dev-themes → obsidian-theme-dev}/references/theme-best-practices.md +0 -0
- /package/{obsidian-dev-themes → obsidian-theme-dev}/references/theme-coding-conventions.md +0 -0
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
|
|
10
|
-
├── obsidian-dev
|
|
11
|
-
├── obsidian-ops/
|
|
12
|
-
└── obsidian-ref/
|
|
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
|
|
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
|
|
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
|
-
- **
|
|
76
|
-
- **
|
|
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
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "obsidian-dev-skills",
|
|
3
|
-
"version": "1.0.
|
|
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
|
|
23
|
-
"obsidian-dev
|
|
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
|
|
49
|
-
'obsidian-theme-dev': 'obsidian-dev
|
|
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
|
|
74
|
-
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|