obsidian-dev-skills 1.0.4 → 1.0.6

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
@@ -12,19 +12,42 @@ obsidian-dev-skills/
12
12
  └── obsidian-ref/ # Technical references
13
13
  ```
14
14
 
15
- ## Getting Started
15
+ ## Installation & Usage
16
16
 
17
- ### For Developers
17
+ This package can be used as a development dependency in your Obsidian project.
18
18
 
19
- This repository is automatically set up by the `setup-ref-links` script in the template projects.
19
+ ### 1. Install to your project
20
+ ```bash
21
+ # Using pnpm (Recommended)
22
+ pnpm add -D obsidian-dev-skills
20
23
 
21
- ### For Users
24
+ # Using npm
25
+ npm install --save-dev obsidian-dev-skills
22
26
 
23
- This repository is automatically managed by the template projects. Simply run the `setup-ref-links` script in your template project to get started.
27
+ # Using yarn
28
+ yarn add -D obsidian-dev-skills
29
+ ```
30
+
31
+ ### 2. Initialize localized skills
32
+ Run the initialization script to seed the `.agent/skills/` folder. This also creates a project-specific skill template if one is missing.
24
33
 
25
- ### For Developers
34
+ ```bash
35
+ # Using pnpm (Standard entry point)
36
+ pnpm obsidian-dev-skills
26
37
 
27
- The `setup-ref-links` script clones this repository to your `.ref` folder and creates the necessary symlinks.
38
+ # Using npx (Universal entry point)
39
+ npx obsidian-dev-skills
40
+
41
+ # Manual execution
42
+ node node_modules/obsidian-dev-skills/scripts/init.mjs
43
+ ```
44
+
45
+ ### 3. Sync AI Agents
46
+ Ensure `AGENTS.md` is aligned with the localized skills.
47
+
48
+ ```bash
49
+ npx openskills sync
50
+ ```
28
51
 
29
52
  ## Skills Overview
30
53
 
@@ -61,9 +61,15 @@ if ($item.LinkType -eq "Junction" -or $item.LinkType -eq "SymbolicLink") {
61
61
  ```bash
62
62
  # Check if a specific repo is a symlink
63
63
  if [ -L .ref/obsidian-api ]; then
64
- echo "Symlink detected - target: $(readlink .ref/obsidian-api)"
64
+ # Portable approach for macOS/BSD and Linux
65
+ if command -v realpath >/dev/null 2>&1; then
66
+ TARGET=$(realpath .ref/obsidian-api)
67
+ else
68
+ TARGET=$(readlink .ref/obsidian-api)
69
+ fi
70
+ echo "Symlink detected - target: $TARGET"
65
71
  # Navigate to the actual target location
66
- cd "$(readlink -f .ref/obsidian-api)"
72
+ cd "$TARGET"
67
73
  else
68
74
  echo "Regular directory - can use .ref/obsidian-api directly"
69
75
  cd .ref/obsidian-api
@@ -97,7 +103,12 @@ cd eslint-plugin; git pull; cd ..
97
103
  **macOS/Linux**:
98
104
  ```bash
99
105
  # First, check where symlinks point (usually ../.ref/obsidian-dev)
100
- TARGET=$(readlink -f .ref/obsidian-api | sed 's|/obsidian-api$||')
106
+ if command -v realpath >/dev/null 2>&1; then
107
+ TARGET_REPO=$(realpath .ref/obsidian-api)
108
+ else
109
+ TARGET_REPO=$(readlink .ref/obsidian-api)
110
+ fi
111
+ TARGET=$(echo "$TARGET_REPO" | sed 's|/obsidian-api$||')
101
112
  echo "Symlinks point to: $TARGET"
102
113
 
103
114
  # Navigate to central location and update all repos
@@ -25,7 +25,7 @@ Update frequency: Update as common issues are identified
25
25
  - Use `list_dir` with the project root to see hidden directories
26
26
  - Use `glob_file_search` with pattern `.ref/**` to search recursively
27
27
  - Try direct paths like `.ref/obsidian-api/README.md`
28
- - See [ref-instructions.md](ref-instructions.md) for detailed search strategies
28
+ - See [sync-procedure.md](sync-procedure.md) for detailed search strategies
29
29
 
30
30
  **For AI agents**: When user asks about `.ref`, actively search using multiple methods. Don't assume it doesn't exist if first search fails.
31
31
 
@@ -6,11 +6,19 @@ Update frequency: Check Obsidian Sample Theme repo for updates
6
6
 
7
7
  # Versioning & releases
8
8
 
9
- **Before releasing**: Use the comprehensive [release-readiness.md](release-readiness.md) checklist to verify your theme is ready for release.
9
+ **Before releasing**: Use the comprehensive [release-readiness.md](release-readiness.md) checklist to verify your project is ready for release.
10
10
 
11
11
  - Bump `version` in `manifest.json` (SemVer).
12
12
  - Create a GitHub release whose tag exactly matches `manifest.json`'s `version`. Do not use a leading `v`.
13
+ ### Theme Releases
13
14
  - Attach `manifest.json` and `theme.css` to the release as individual assets.
14
15
  - After the initial release, follow the process to add/update your theme in the community catalog as required.
15
16
 
17
+ ### Plugin Releases
18
+ - Attach `main.js`, `manifest.json`, and `styles.css` to the release as individual assets.
19
+ - Follow the plugin submission process to add/update your plugin in the community catalog.
20
+
21
+ > [!NOTE]
22
+ > Themes and plugins have different asset requirements and submission paths. Ensure you follow the correct flow for your project type.
23
+
16
24
 
@@ -12,7 +12,7 @@ Update frequency: Check Obsidian Sample Theme repo for updates
12
12
  - **Complex theme with build tools** (for themes using SCSS, Grunt, etc.): `src/scss/` directory with SCSS source files that compile to `theme.css`
13
13
  - **CRITICAL**: Never have both `theme.css` as source AND `src/scss/` - choose one pattern
14
14
 
15
- ### Simple CSS Theme Structure
15
+ ## Simple CSS Theme Structure
16
16
 
17
17
  **Recommended for simple themes** (like the sample theme template):
18
18
  ```
@@ -25,7 +25,7 @@ package.json
25
25
  - Changes take effect when Obsidian reloads the theme
26
26
  - Perfect for learning and simple themes
27
27
 
28
- ### Complex Theme Structure (SCSS + Build Tools)
28
+ ## Complex Theme Structure (SCSS + Build Tools)
29
29
 
30
30
  **For themes using SCSS, Grunt, npm scripts, or other build tools**:
31
31
  ```
@@ -47,7 +47,7 @@ package.json
47
47
  - Run build command after making changes (see [build-workflow.md](build-workflow.md))
48
48
  - **Example**: The `obsidian-oxygen` theme uses this pattern with Grunt
49
49
 
50
- ### Wrong Structure (Common Mistakes)
50
+ ## Wrong Structure (Common Mistakes)
51
51
 
52
52
  ```
53
53
  theme.css # ❌ DON'T have both
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-dev-skills",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Agent skills for Obsidian plugin and theme development",
5
5
  "keywords": [
6
6
  "obsidian",
package/scripts/init.mjs CHANGED
@@ -109,6 +109,88 @@ function detectProjectType(root) {
109
109
  return isPlugin ? 'plugin' : 'theme';
110
110
  }
111
111
 
112
+ /**
113
+ * Updates AGENTS.md in the project root to include the installed skills in the openskills format.
114
+ */
115
+ function updateAgentsMarkdown(root, installedSkills) {
116
+ const agentsPath = path.join(root, 'AGENTS.md');
117
+ const agentDirName = path.basename(agentDir); // .agent or .agents
118
+
119
+ const skillDetails = {
120
+ 'obsidian-dev': 'Core development patterns for Obsidian plugins. Load when editing src/main.ts, implementing features, handling API calls, or managing plugin lifecycle.',
121
+ 'obsidian-theme-dev': 'CSS/SCSS development patterns for Obsidian themes. Load when working with theme.css, SCSS variables, or CSS selectors.',
122
+ 'obsidian-ops': 'Operations, syncing, versioning, and release management for Obsidian projects. Load when running builds, syncing references, bumping versions, or preparing for release.',
123
+ 'obsidian-ref': 'Technical references, manifest rules, file formats, and UX guidelines for Obsidian. Load when checking API details, manifest requirements, or UI/UX standards.',
124
+ 'project': 'Project-specific architecture, maintenance tasks, and unique conventions for this repository. Load when performing project-wide maintenance or working with the core architecture.'
125
+ };
126
+
127
+ const skillTags = installedSkills
128
+ .map(skill => {
129
+ const description = skillDetails[skill] || 'Specialized skill for this project.';
130
+ return `<skill>
131
+ <name>${skill}</name>
132
+ <description>${description}</description>
133
+ <location>project</location>
134
+ </skill>`;
135
+ })
136
+ .join('\n\n');
137
+
138
+ const xmlSection = `<skills_system priority="1">
139
+
140
+ ## Available Skills
141
+
142
+ <!-- SKILLS_TABLE_START -->
143
+ <usage>
144
+ When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.
145
+
146
+ How to use skills:
147
+ - Read skill: \`cat ./${agentDirName}/skills/<skill-name>/SKILL.md\`
148
+ - The skill content will load with detailed instructions on how to complete the task
149
+ - Skills are stored locally in ./${agentDirName}/skills/ directory
150
+
151
+ Usage notes:
152
+ - Only use skills listed in <available_skills> below
153
+ - Do not invoke a skill that is already loaded in your context
154
+ - Each skill invocation is stateless
155
+ </usage>
156
+
157
+ <available_skills>
158
+
159
+ ${skillTags}
160
+
161
+ </available_skills>
162
+ <!-- SKILLS_TABLE_END -->
163
+
164
+ </skills_system>`;
165
+
166
+ let content = '';
167
+ if (fs.existsSync(agentsPath)) {
168
+ content = fs.readFileSync(agentsPath, 'utf8');
169
+
170
+ const startMarker = '<skills_system';
171
+ const endMarker = '</skills_system>';
172
+ const htmlStartMarker = '<!-- SKILLS_TABLE_START -->';
173
+ const htmlEndMarker = '<!-- SKILLS_TABLE_END -->';
174
+
175
+ if (content.includes(startMarker)) {
176
+ const regex = /<skills_system[^>]*>[\s\S]*?<\/skills_system>/;
177
+ content = content.replace(regex, xmlSection);
178
+ } else if (content.includes(htmlStartMarker)) {
179
+ // Logic parity with openskills: replace content between HTML markers if XML tag is missing
180
+ const innerContent = xmlSection.replace(/<skills_system[^>]*>|<\/skills_system>/g, '').trim();
181
+ const regex = new RegExp(`${htmlStartMarker}[\\s\\S]*?${htmlEndMarker}`, 'g');
182
+ content = content.replace(regex, `${htmlStartMarker}\n${innerContent}\n${htmlEndMarker}`);
183
+ } else {
184
+ content = content.trimEnd() + '\n\n' + xmlSection + '\n';
185
+ }
186
+ } else {
187
+ content = '# AGENTS\n\nThis project uses specialized AI agent skills for development.\n\n' + xmlSection + '\n';
188
+ }
189
+
190
+ fs.writeFileSync(agentsPath, content, 'utf8');
191
+ console.log('📝 Updated AGENTS.md (openskills format)');
192
+ }
193
+
112
194
  /**
113
195
  * Ensures a project-specific skill exists, creating a template if it doesn't.
114
196
  */
@@ -127,27 +209,51 @@ name: project
127
209
  description: Project-specific architecture, maintenance tasks, and unique conventions. Load when performing project-wide maintenance or working with the core architecture.
128
210
  ---
129
211
 
130
- # Project Skill
212
+ # Project Context
213
+
214
+ This skill provides the unique context and architectural details for this repository.
131
215
 
132
- Provide a high-level overview of this project's specific goals and architecture here.
216
+ ## Purpose
217
+
218
+ To provide guidance on project-specific structures and tasks that differ from general Obsidian development patterns.
219
+
220
+ ## When to Use
221
+
222
+ Load this skill when:
223
+ - Understanding the repository's unique architecture.
224
+ - Performing recurring maintenance tasks.
225
+ - Following project-specific coding conventions.
226
+
227
+ ## Project Overview
228
+
229
+ <!--
230
+ TIP: Update this section with your project's high-level architecture.
231
+ Example:
232
+ - **Architecture**: Organized structure with main code in \`src/main.ts\` and settings in \`src/settings.ts\`.
233
+ - **Reference Management**: Uses a \`.ref\` folder with symlinks to centralized Obsidian repositories.
234
+ -->
235
+
236
+ - **Primary Stack**: [e.g., TypeScript, Svelte, Lucide icons]
237
+ - **Key Directories**: [e.g., src/, styles/, scripts/]
133
238
 
134
239
  ## Core Architecture
135
240
 
136
- - Detail the primary technical stack and how components interact.
241
+ - [Detail how primary components interact here]
137
242
 
138
243
  ## Project-Specific Conventions
139
244
 
140
- - **Naming**: Describe any specific naming patterns used in this repo.
141
- - **Patterns**: Document unique implementation patterns (e.g., custom hooks, specific state management).
245
+ - **Naming**: [e.g., class names use PascalCase, private methods prefixed with _]
246
+ - **Patterns**: [e.g., use of custom stores, specific state management]
142
247
 
143
248
  ## Key Files
144
249
 
145
- - \`src/main.ts\`: [Description]
146
- - \`manifest.json\`: [Description]
250
+ - \`manifest.json\`: Plugin/theme manifest
251
+ - \`package.json\`: Build scripts and dependencies
147
252
 
148
253
  ## Maintenance Tasks
149
254
 
150
- - List recurring tasks like version bumping, CSS testing, or dependency updates.
255
+ - [e.g., npm run dev to start development server]
256
+ - [e.g., npm run version-bump to release new version]
151
257
  `;
152
258
  fs.writeFileSync(projectSkillFile, template, 'utf8');
153
259
  }
@@ -202,6 +308,15 @@ async function init() {
202
308
  // Ensure project-specific skill exists
203
309
  initializeProjectSkill(skillsDir);
204
310
 
311
+ // Update AGENTS.md
312
+ const installedSkills = Object.keys(skillMappings).filter(name => {
313
+ if (projectType === 'plugin' && name === 'obsidian-theme-dev') return false;
314
+ if (projectType === 'theme' && name === 'obsidian-dev') return false;
315
+ return true;
316
+ });
317
+ installedSkills.push('project'); // Always include project skill
318
+ updateAgentsMarkdown(projectRoot, installedSkills);
319
+
205
320
  // Update or create sync-status.json
206
321
  const syncStatusPath = path.join(agentDir, 'sync-status.json');
207
322
  const today = new Date().toISOString().split('T')[0];
@@ -1,4 +1,4 @@
1
- # Setup skills symlinks for Obsidian Sample Plugin Plus
1
+ # Setup skills symlinks for this repository
2
2
  # This script creates symlinks to the obsidian-dev-skills repository
3
3
 
4
4
  param(