obsidian-dev-skills 1.0.3 → 1.0.4
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/package.json +1 -1
- package/scripts/init.mjs +47 -0
package/package.json
CHANGED
package/scripts/init.mjs
CHANGED
|
@@ -109,6 +109,50 @@ function detectProjectType(root) {
|
|
|
109
109
|
return isPlugin ? 'plugin' : 'theme';
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Ensures a project-specific skill exists, creating a template if it doesn't.
|
|
114
|
+
*/
|
|
115
|
+
function initializeProjectSkill(targetSkillsDir) {
|
|
116
|
+
const projectSkillDir = path.join(targetSkillsDir, 'project');
|
|
117
|
+
const projectSkillFile = path.join(projectSkillDir, 'SKILL.md');
|
|
118
|
+
|
|
119
|
+
if (!fs.existsSync(projectSkillFile)) {
|
|
120
|
+
console.log('📝 Initializing project-specific skill template...');
|
|
121
|
+
if (!fs.existsSync(projectSkillDir)) {
|
|
122
|
+
fs.mkdirSync(projectSkillDir, { recursive: true });
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const template = `---
|
|
126
|
+
name: project
|
|
127
|
+
description: Project-specific architecture, maintenance tasks, and unique conventions. Load when performing project-wide maintenance or working with the core architecture.
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
# Project Skill
|
|
131
|
+
|
|
132
|
+
Provide a high-level overview of this project's specific goals and architecture here.
|
|
133
|
+
|
|
134
|
+
## Core Architecture
|
|
135
|
+
|
|
136
|
+
- Detail the primary technical stack and how components interact.
|
|
137
|
+
|
|
138
|
+
## Project-Specific Conventions
|
|
139
|
+
|
|
140
|
+
- **Naming**: Describe any specific naming patterns used in this repo.
|
|
141
|
+
- **Patterns**: Document unique implementation patterns (e.g., custom hooks, specific state management).
|
|
142
|
+
|
|
143
|
+
## Key Files
|
|
144
|
+
|
|
145
|
+
- \`src/main.ts\`: [Description]
|
|
146
|
+
- \`manifest.json\`: [Description]
|
|
147
|
+
|
|
148
|
+
## Maintenance Tasks
|
|
149
|
+
|
|
150
|
+
- List recurring tasks like version bumping, CSS testing, or dependency updates.
|
|
151
|
+
`;
|
|
152
|
+
fs.writeFileSync(projectSkillFile, template, 'utf8');
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
112
156
|
async function init() {
|
|
113
157
|
// Determine if we are running in the package's own directory (development)
|
|
114
158
|
const isDevelopment = projectRoot === packageRoot ||
|
|
@@ -155,6 +199,9 @@ async function init() {
|
|
|
155
199
|
}
|
|
156
200
|
}
|
|
157
201
|
|
|
202
|
+
// Ensure project-specific skill exists
|
|
203
|
+
initializeProjectSkill(skillsDir);
|
|
204
|
+
|
|
158
205
|
// Update or create sync-status.json
|
|
159
206
|
const syncStatusPath = path.join(agentDir, 'sync-status.json');
|
|
160
207
|
const today = new Date().toISOString().split('T')[0];
|