@woopsy/ai-agent-skills 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/.claude-plugin/marketplace.json +14 -0
- package/.claude-plugin/plugin.json +23 -0
- package/README.md +60 -0
- package/SKILL.md +87 -0
- package/bin/ai-agent-skills.js +59 -0
- package/install.ps1 +463 -0
- package/install.sh +224 -0
- package/package.json +41 -0
- package/scripts/install.js +51 -0
- package/scripts/push.js +193 -0
- package/skills/cicd/SKILL.md +134 -0
- package/skills/secondary-brain/SKILL.md +257 -0
- package/skills/secondary-brain/reference/deep-mode.md +90 -0
- package/skills/secondary-brain/reference/mermaid-cheatsheet.md +81 -0
- package/skills/secondary-brain/reference/platform-adapters.md +74 -0
- package/skills/secondary-brain/reference/scoring-guide.md +63 -0
- package/skills/secondary-brain/templates/00-project-node.md +41 -0
- package/skills/secondary-brain/templates/01-feature-node.md +39 -0
- package/skills/secondary-brain/templates/handoff.md +47 -0
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@woopsy/ai-agent-skills",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Multi-function AI agent skills — SecondaryBrain vault protocol, CI/CD pipeline, auto-installer for all agents",
|
|
5
|
+
"bin": {
|
|
6
|
+
"ai-agent-skills": "bin/ai-agent-skills.js"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"push": "node scripts/push.js",
|
|
10
|
+
"lint": "echo 'no linter configured yet' && exit 0",
|
|
11
|
+
"typecheck": "echo 'no typecheck configured yet' && exit 0",
|
|
12
|
+
"test": "echo 'no tests configured yet' && exit 0",
|
|
13
|
+
"setup": "node scripts/install.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"skills/",
|
|
17
|
+
"scripts/",
|
|
18
|
+
"bin/",
|
|
19
|
+
"SKILL.md",
|
|
20
|
+
"install.ps1",
|
|
21
|
+
"install.sh",
|
|
22
|
+
".claude-plugin/"
|
|
23
|
+
],
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"keywords": [
|
|
29
|
+
"secondary-brain",
|
|
30
|
+
"obsidian",
|
|
31
|
+
"vault",
|
|
32
|
+
"cicd",
|
|
33
|
+
"agents",
|
|
34
|
+
"skills",
|
|
35
|
+
"claude-code",
|
|
36
|
+
"opencode",
|
|
37
|
+
"cursor",
|
|
38
|
+
"codex",
|
|
39
|
+
"gemini"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
|
|
5
|
+
const ROOT = path.resolve(__dirname, '..');
|
|
6
|
+
|
|
7
|
+
function run(cmd) {
|
|
8
|
+
try {
|
|
9
|
+
return execSync(cmd, { encoding: 'utf-8', cwd: ROOT }).trim();
|
|
10
|
+
} catch { return ''; }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async function main() {
|
|
14
|
+
console.log('============================================');
|
|
15
|
+
console.log(' AI Agent Skills — Installer');
|
|
16
|
+
console.log('============================================\n');
|
|
17
|
+
|
|
18
|
+
// Detect platform
|
|
19
|
+
const isWin = process.platform === 'win32';
|
|
20
|
+
const isWSL = run('uname -r').toLowerCase().includes('microsoft');
|
|
21
|
+
|
|
22
|
+
if (isWSL && isWin) {
|
|
23
|
+
// Running on Windows but WSL detected — use PowerShell
|
|
24
|
+
console.log('→ WSL detected. Using PowerShell installer...\n');
|
|
25
|
+
const psScript = path.resolve(ROOT, 'install.ps1');
|
|
26
|
+
if (fs.existsSync(psScript)) {
|
|
27
|
+
run(`powershell.exe -ExecutionPolicy Bypass -File "${psScript}"`);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (isWin) {
|
|
33
|
+
const psScript = path.resolve(ROOT, 'install.ps1');
|
|
34
|
+
if (fs.existsSync(psScript)) {
|
|
35
|
+
run(`powershell.exe -ExecutionPolicy Bypass -File "${psScript}"`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const shScript = path.resolve(ROOT, 'install.sh');
|
|
41
|
+
if (fs.existsSync(shScript)) {
|
|
42
|
+
run(`chmod +x "${shScript}"`);
|
|
43
|
+
run(`bash "${shScript}"`);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
console.log('No installer found for this platform.');
|
|
48
|
+
console.log('See reference/platform-adapters.md for manual install.');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
main().catch(console.error);
|
package/scripts/push.js
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const readline = require('readline');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
6
|
+
|
|
7
|
+
const ask = (q) => new Promise((r) => rl.question(q, r));
|
|
8
|
+
const run = (cmd, opts = {}) => {
|
|
9
|
+
try {
|
|
10
|
+
const out = execSync(cmd, { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], ...opts });
|
|
11
|
+
return { ok: true, out: out.trim() };
|
|
12
|
+
} catch (e) {
|
|
13
|
+
return { ok: false, out: (e.stderr || e.message || '').trim() };
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const npmScriptExists = (name) => {
|
|
17
|
+
const { ok, out } = run(`npm run ${name} --dry-run 2>&1 || true`);
|
|
18
|
+
return ok && !out.includes('missing script');
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
async function main() {
|
|
22
|
+
// --- 1. OS detection ---
|
|
23
|
+
const isWSL = run('uname -r').out.toLowerCase().includes('microsoft') ||
|
|
24
|
+
process.env.WSLENV !== undefined;
|
|
25
|
+
console.log(isWSL ? '🌐 Environment: WSL' : '🖥 Environment: Windows');
|
|
26
|
+
|
|
27
|
+
// --- 2. Check dev branch exists ---
|
|
28
|
+
console.log('\n📋 Checking branches...');
|
|
29
|
+
const branches = run('git branch -a').out;
|
|
30
|
+
const hasDev = /\bdev\b/.test(branches);
|
|
31
|
+
if (!hasDev) {
|
|
32
|
+
console.log(' ✗ No "dev" branch found. Create it: git checkout -b dev');
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
console.log(' ✓ dev branch exists');
|
|
36
|
+
|
|
37
|
+
// --- 3. Check current branch ---
|
|
38
|
+
const { ok: brOk, out: branch } = run('git rev-parse --abbrev-ref HEAD');
|
|
39
|
+
if (!brOk) { console.log(' ✗ Not a git repository'); process.exit(1); }
|
|
40
|
+
console.log(` Current branch: ${branch}`);
|
|
41
|
+
|
|
42
|
+
if (branch === 'prod' || branch === 'main') {
|
|
43
|
+
const ans = await ask(' ⛔ PUSHING TO PROD IS BLOCKED. Switch to dev? [Y/n] ');
|
|
44
|
+
if (ans.toLowerCase() === 'n' || ans.toLowerCase() === 'no') {
|
|
45
|
+
console.log(' Aborted.');
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
// Stash if dirty then switch
|
|
49
|
+
const status = run('git status --porcelain');
|
|
50
|
+
if (status.out) {
|
|
51
|
+
run('git stash push -m "auto-stash before dev switch"');
|
|
52
|
+
run('git switch dev');
|
|
53
|
+
console.log(' ✓ Stashed changes, switched to dev');
|
|
54
|
+
} else {
|
|
55
|
+
run('git switch dev');
|
|
56
|
+
console.log(' ✓ Switched to dev');
|
|
57
|
+
}
|
|
58
|
+
} else if (branch !== 'dev') {
|
|
59
|
+
const ans = await ask(` ⚠️ On "${branch}", not dev. Switch to dev? [Y/n] `);
|
|
60
|
+
if (ans.toLowerCase() !== 'n' && ans.toLowerCase() !== 'no') {
|
|
61
|
+
const st = run('git status --porcelain');
|
|
62
|
+
if (st.out) {
|
|
63
|
+
run('git stash push -m "auto-stash before dev switch"');
|
|
64
|
+
run('git switch dev');
|
|
65
|
+
console.log(' ✓ Stashed changes, switched to dev');
|
|
66
|
+
} else {
|
|
67
|
+
run('git switch dev');
|
|
68
|
+
console.log(' ✓ Switched to dev');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
console.log(' ✓ On dev branch');
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Re-read branch after potential switch
|
|
76
|
+
const finalBranch = run('git rev-parse --abbrev-ref HEAD').out;
|
|
77
|
+
|
|
78
|
+
// --- 4. Check remote ---
|
|
79
|
+
console.log('\n📡 Checking remote...');
|
|
80
|
+
const { ok: hasRemote, out: remoteUrl } = run('git remote get-url origin');
|
|
81
|
+
if (!hasRemote) {
|
|
82
|
+
console.log(' ⚠️ No remote repository configured.');
|
|
83
|
+
console.log(' Set one up: git remote add origin <url>');
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
const displayUrl = remoteUrl.replace(/^git@(.+):(.+)$/, 'https://$1/$2');
|
|
87
|
+
console.log(` → Push target: ${displayUrl}`);
|
|
88
|
+
|
|
89
|
+
// --- 5. CI Checks ---
|
|
90
|
+
console.log('\n🔬 Running pre-push checks...');
|
|
91
|
+
let allPassed = true;
|
|
92
|
+
|
|
93
|
+
const checks = [
|
|
94
|
+
{ name: 'Lint', script: 'lint' },
|
|
95
|
+
{ name: 'Type Check', script: 'typecheck' },
|
|
96
|
+
{ name: 'Test', script: 'test' },
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
for (const check of checks) {
|
|
100
|
+
if (npmScriptExists(check.script)) {
|
|
101
|
+
process.stdout.write(` ${check.name}...`);
|
|
102
|
+
const result = run(`npm run ${check.script}`);
|
|
103
|
+
if (result.ok) {
|
|
104
|
+
console.log(' ✓');
|
|
105
|
+
} else {
|
|
106
|
+
console.log(' ✗');
|
|
107
|
+
console.log(` ${result.out.split('\n').slice(0, 5).join('\n ')}`);
|
|
108
|
+
allPassed = false;
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
console.log(` ${check.name}... ⏭ (not configured)`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (!allPassed) {
|
|
116
|
+
console.log('\n ✗ Pre-push checks failed. Fix errors before pushing.');
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
console.log(' ✓ All checks passed');
|
|
120
|
+
|
|
121
|
+
// --- 6. Check for changes ---
|
|
122
|
+
console.log('\n📝 Checking working tree...');
|
|
123
|
+
const statusOut = run('git status --porcelain').out;
|
|
124
|
+
let forceEmpty = false;
|
|
125
|
+
|
|
126
|
+
if (!statusOut) {
|
|
127
|
+
const ans = await ask(' ℹ️ No changes to commit. Force empty commit? [y/N] ');
|
|
128
|
+
if (ans.toLowerCase() !== 'y' && ans.toLowerCase() !== 'yes') {
|
|
129
|
+
console.log(' Aborted.');
|
|
130
|
+
process.exit(1);
|
|
131
|
+
}
|
|
132
|
+
forceEmpty = true;
|
|
133
|
+
} else {
|
|
134
|
+
console.log(` ${statusOut.split('\n').length} file(s) changed`);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// --- 7. Changelog prompt ---
|
|
138
|
+
console.log('\n📖 SecondaryBrain changelog check...');
|
|
139
|
+
const vaultHint = process.env.VAULT_PATH || '';
|
|
140
|
+
if (vaultHint) {
|
|
141
|
+
console.log(` Vault: ${vaultHint}`);
|
|
142
|
+
}
|
|
143
|
+
const changelogAns = await ask(' Did you update the changelog (_Changelog/YYYY-MM-DD.md)? [y/N] ');
|
|
144
|
+
if (changelogAns.toLowerCase() !== 'y' && changelogAns.toLowerCase() !== 'yes') {
|
|
145
|
+
console.log(' ✗ Please update the changelog first.');
|
|
146
|
+
console.log(' Document what changed and why in _Changelog/YYYY-MM-DD.md');
|
|
147
|
+
process.exit(1);
|
|
148
|
+
}
|
|
149
|
+
console.log(' ✓ Changelog confirmed');
|
|
150
|
+
|
|
151
|
+
// --- 8. Commit message ---
|
|
152
|
+
const msg = await ask('\n✏️ Commit message: ');
|
|
153
|
+
if (!msg.trim()) {
|
|
154
|
+
console.log(' ✗ Commit message required');
|
|
155
|
+
process.exit(1);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// --- 9. Commit and push ---
|
|
159
|
+
console.log('\n🚀 Pushing...');
|
|
160
|
+
run('git add -A');
|
|
161
|
+
|
|
162
|
+
const commitCmd = forceEmpty
|
|
163
|
+
? `git commit --allow-empty -m "${msg.replace(/"/g, '\\"')}"`
|
|
164
|
+
: `git commit -m "${msg.replace(/"/g, '\\"')}"`;
|
|
165
|
+
const commitResult = run(commitCmd);
|
|
166
|
+
|
|
167
|
+
if (!commitResult.ok) {
|
|
168
|
+
console.log(` ✗ Commit failed:\n ${commitResult.out}`);
|
|
169
|
+
process.exit(1);
|
|
170
|
+
}
|
|
171
|
+
console.log(' ✓ Committed');
|
|
172
|
+
|
|
173
|
+
const pushResult = run(`git push origin ${finalBranch}`);
|
|
174
|
+
if (pushResult.ok) {
|
|
175
|
+
console.log(` ✓ Pushed to ${finalBranch}`);
|
|
176
|
+
console.log(` → ${displayUrl}`);
|
|
177
|
+
} else {
|
|
178
|
+
console.log(` ✗ Push failed:\n ${pushResult.out}`);
|
|
179
|
+
console.log(' Check:');
|
|
180
|
+
console.log(' - Remote URL correct?');
|
|
181
|
+
console.log(' - You have push access?');
|
|
182
|
+
console.log(' - Branch protection rules?');
|
|
183
|
+
process.exit(1);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
rl.close();
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
main().catch((e) => {
|
|
190
|
+
console.error('Unexpected error:', e.message);
|
|
191
|
+
process.exit(1);
|
|
192
|
+
rl.close();
|
|
193
|
+
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cicd
|
|
3
|
+
description: "CI/CD pipeline: ensures vault + skills installed, runs quality gates, enforces branch rules, offers push flow with changelog gate."
|
|
4
|
+
argument-hint: "[pipeline|setup|push|workflows]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# CI/CD Pipeline — `/woopsy cdci`
|
|
8
|
+
|
|
9
|
+
Full automation pipeline. Ensures infrastructure is in place before any code goes out.
|
|
10
|
+
|
|
11
|
+
## `pipeline` — Full Pipeline (default for /woopsy cdci)
|
|
12
|
+
|
|
13
|
+
Execute in order:
|
|
14
|
+
|
|
15
|
+
### Step 1: Update Dependencies
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
cd skills/obsidian && git pull --ff-only 2>/dev/null
|
|
19
|
+
cd skills/graphify && git pull --ff-only 2>/dev/null
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
If either is missing, clone:
|
|
23
|
+
```bash
|
|
24
|
+
git clone --depth 1 https://github.com/kepano/obsidian-skills.git skills/obsidian
|
|
25
|
+
git clone --depth 1 https://github.com/Graphify-Labs/graphify.git skills/graphify
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Step 2: Ensure Vault Connected
|
|
29
|
+
|
|
30
|
+
Check `brain-config.json` exists at `skills/secondary-brain/brain-config.json`.
|
|
31
|
+
|
|
32
|
+
If missing → run `install.ps1` (Windows) or `install.sh` (WSL/Linux) to:
|
|
33
|
+
- Detect or scaffold SecondaryBrain vault
|
|
34
|
+
- Install all skills to current agent
|
|
35
|
+
|
|
36
|
+
Report vault status.
|
|
37
|
+
|
|
38
|
+
### Step 3: Install Skills to Current Agent
|
|
39
|
+
|
|
40
|
+
Ensure the following are registered with the current agent:
|
|
41
|
+
- `secondary-brain` (this skill set)
|
|
42
|
+
- `obsidian-skills` (obsidian-markdown, obsidian-bases, json-canvas, obsidian-cli, defuddle)
|
|
43
|
+
- `graphify` (knowledge graph)
|
|
44
|
+
|
|
45
|
+
For each missing skill, copy the SKILL.md directory into the agent's skill directory and register it.
|
|
46
|
+
|
|
47
|
+
### Step 4: Branch Check
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
git branch -a | grep dev
|
|
51
|
+
→ if missing: "Create dev branch first: git checkout -b dev" → abort
|
|
52
|
+
|
|
53
|
+
git rev-parse --abbrev-ref HEAD
|
|
54
|
+
→ if "prod"/"main": BLOCK → "Switch to dev? [Y/n]"
|
|
55
|
+
→ if "dev": continue
|
|
56
|
+
→ if other: warn → "Continue on current branch? [Y/n]"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Step 5: Remote Check
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
git remote get-url origin
|
|
63
|
+
→ if missing: "No remote configured. Set one up." → abort
|
|
64
|
+
→ show target URL
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Step 6: Quality Gates
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
npm run lint (skip if not configured)
|
|
71
|
+
npm run typecheck (skip if not configured)
|
|
72
|
+
npm test (skip if not configured)
|
|
73
|
+
→ any failure: block → "Fix errors before pushing"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Step 7: Changelog Gate
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
Ask: "Did you update _Changelog/YYYY-MM-DD.md?"
|
|
80
|
+
→ No: "Update it first. Document what changed and why." → abort
|
|
81
|
+
→ Yes: continue
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Step 8: Push Flow
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
Check git status --porcelain
|
|
88
|
+
→ clean: "Force empty commit? [y/N]"
|
|
89
|
+
→ dirty: show changed file count
|
|
90
|
+
|
|
91
|
+
Prompt: "Commit message: "
|
|
92
|
+
→ empty: abort
|
|
93
|
+
→ filled: git add -A && git commit -m "<msg>" && git push origin <branch>
|
|
94
|
+
|
|
95
|
+
On success: "✓ Pushed to <branch> → <remote-url>"
|
|
96
|
+
On fail: show error with troubleshooting steps
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## `setup` — Configure CI/CD
|
|
100
|
+
|
|
101
|
+
To enable the full pipeline:
|
|
102
|
+
|
|
103
|
+
1. Set up GitHub repository with `dev` as default branch
|
|
104
|
+
2. Add repository secrets in GitHub
|
|
105
|
+
3. Push the `.github/workflows/` files
|
|
106
|
+
4. Create branch protection rules on `prod`
|
|
107
|
+
|
|
108
|
+
## `push` — Manual Push
|
|
109
|
+
|
|
110
|
+
Same as steps 4-8 of the pipeline above. Skips dependency check, vault check, and skill install. Use when you already know everything is set up.
|
|
111
|
+
|
|
112
|
+
## `workflows` — GitHub Actions Anatomy
|
|
113
|
+
|
|
114
|
+
**dev.yml** (runs on push to `dev`):
|
|
115
|
+
- Lint
|
|
116
|
+
- Type check
|
|
117
|
+
- Test
|
|
118
|
+
|
|
119
|
+
**prod.yml** (runs on push/PR to `prod`/`main`):
|
|
120
|
+
- All dev checks
|
|
121
|
+
- Build
|
|
122
|
+
- Release
|
|
123
|
+
|
|
124
|
+
## Branch Strategy
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
dev ← active development (push here)
|
|
128
|
+
↓
|
|
129
|
+
prod ← production releases (merge from dev only)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
- NEVER push directly to `prod` or `main`
|
|
133
|
+
- The pipeline blocks this and offers to switch to `dev`
|
|
134
|
+
- Merges to `prod` happen through PRs
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: secondary-brain
|
|
3
|
+
description: "Persistent project memory framework. Orchestrates obsidian-skills (Obsidian syntax) + graphify (knowledge graph) to document everything in the vault. Template layer — actual read/write is delegated to those skills."
|
|
4
|
+
argument-hint: "[/woopsy vault|connect|deep|handoff|status]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# SecondaryBrain — Project Memory Framework — `/woopsy vault`
|
|
8
|
+
|
|
9
|
+
This skill handles `/woopsy vault` — vault-only operations (project memory, changelog, documentation).
|
|
10
|
+
Also responds to `/woopsy` (part of the full pipeline — see root SKILL.md).
|
|
11
|
+
|
|
12
|
+
This is the **template/orchestration layer**. We use other skills to **improve our own output quality**:
|
|
13
|
+
|
|
14
|
+
- **`obsidian-skills`** → teaches us how Obsidian works so we write correct wikilinks, callouts, embeds, properties, Mermaid diagrams. Without it we'd write broken markdown.
|
|
15
|
+
- **`graphify`** → teaches us knowledge graph extraction and entity resolution so we build connected, queryable documentation instead of flat notes.
|
|
16
|
+
|
|
17
|
+
We don't reinvent markdown or graph logic — we stand on the shoulders of these skills. Every vault file we write goes through their knowledge.
|
|
18
|
+
|
|
19
|
+
## Dependency Check (Run on First Load)
|
|
20
|
+
|
|
21
|
+
Before any command, ensure dependencies are installed AND up to date:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
required:
|
|
25
|
+
- https://github.com/kepano/obsidian-skills
|
|
26
|
+
→ skills: obsidian-markdown, obsidian-bases, json-canvas, obsidian-cli, defuddle
|
|
27
|
+
→ purpose: read/write vault with correct Obsidian syntax
|
|
28
|
+
- https://github.com/Graphify-Labs/graphify
|
|
29
|
+
→ purpose: knowledge graph extraction, entity resolution, graph queries, documentation
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Update step (always run)
|
|
33
|
+
|
|
34
|
+
For each dependency that exists, pull the latest:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
cd skills/obsidian && git pull --ff-only
|
|
38
|
+
cd skills/graphify && git pull --ff-only
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
For each dependency that is missing, clone:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
git clone --depth 1 https://github.com/kepano/obsidian-skills.git skills/obsidian
|
|
45
|
+
git clone --depth 1 https://github.com/Graphify-Labs/graphify.git skills/graphify
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Then install to the current agent by copying SKILL.md files into the agent's skill directory.
|
|
49
|
+
|
|
50
|
+
Report: `Dependencies: obsidian-skills v<commit> ✓, graphify v<commit> ✓`
|
|
51
|
+
|
|
52
|
+
## How the Three Skills Work Together
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
┌─────────────────────────────────────────────────────┐
|
|
56
|
+
│ secondary-brain (this skill) │
|
|
57
|
+
│ ├── Template/framework layer │
|
|
58
|
+
│ ├── Defines: what to document, when, where │
|
|
59
|
+
│ ├── Defines: changelog rules, node structure │
|
|
60
|
+
│ └── Reads/writes: brain-config.json, GLOBAL headers │
|
|
61
|
+
│ │
|
|
62
|
+
│ delegates TO: │
|
|
63
|
+
│ ┌──────────────┐ ┌──────────────────────────────┐ │
|
|
64
|
+
│ │ obsidian- │ │ graphify │ │
|
|
65
|
+
│ │ skills │ │ └─ Extract entities │ │
|
|
66
|
+
│ ├─ wikilinks │ │ └─ Build knowledge graphs │ │
|
|
67
|
+
│ ├─ callouts │ │ └─ Query relationships │ │
|
|
68
|
+
│ ├─ embeds │ │ └─ Generate graph docs │ │
|
|
69
|
+
│ ├─ properties │ │ │ │
|
|
70
|
+
│ └─ Mermaid │ └──────────────────────────────┘ │
|
|
71
|
+
│ │ │
|
|
72
|
+
│ produces: │ │
|
|
73
|
+
│ _Changelog/ │ SecondaryBrain/<Project>/ nodes │
|
|
74
|
+
│ GLOBAL-PROJECT- │ Ai - skills/ patterns │
|
|
75
|
+
│ MEMORY.md │ │
|
|
76
|
+
└─────────────────────────────────────────────────────┘
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Vault Locations (configured in brain-config.json)
|
|
80
|
+
|
|
81
|
+
| Location | Path |
|
|
82
|
+
|---|---|
|
|
83
|
+
| Project nodes | `{{VAULT_PATH}}/SecondaryBrain/` |
|
|
84
|
+
| Global memory | `{{VAULT_PATH}}/SecondaryBrain/GLOBAL-PROJECT-MEMORY.md` |
|
|
85
|
+
| Reusable patterns | `{{VAULT_PATH}}/Ai - skills/` |
|
|
86
|
+
| Handoff prompts | `{{VAULT_PATH}}/SecondaryBrain/_ManualPrompting/` |
|
|
87
|
+
| Deep mode rules | `{{VAULT_PATH}}/SecondaryBrain/_System/reference-architecture-protocol.md` |
|
|
88
|
+
| Change log | `{{VAULT_PATH}}/SecondaryBrain/_Changelog/` |
|
|
89
|
+
|
|
90
|
+
GLOBAL-PROJECT-MEMORY.md is the single source of truth. It MUST always be updated after any change.
|
|
91
|
+
|
|
92
|
+
## Document Everything — The Change Log Protocol
|
|
93
|
+
|
|
94
|
+
ALL changes MUST be documented — no exceptions. Every modification, fix, or update goes in TWO places:
|
|
95
|
+
|
|
96
|
+
### 1. `_Changelog/` — Chronological record
|
|
97
|
+
|
|
98
|
+
Every interaction creates a dated entry at `_Changelog/YYYY-MM-DD.md`:
|
|
99
|
+
|
|
100
|
+
```markdown
|
|
101
|
+
# YYYY-MM-DD — Change Log
|
|
102
|
+
|
|
103
|
+
## Summary
|
|
104
|
+
<one-line summary of what happened this session>
|
|
105
|
+
|
|
106
|
+
## Changes
|
|
107
|
+
- <file/module> — <what> — <why>
|
|
108
|
+
|
|
109
|
+
## Decisions
|
|
110
|
+
- <decision made> — <rationale>
|
|
111
|
+
|
|
112
|
+
## Next
|
|
113
|
+
- <next planned action>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Append to today's file if it exists, create it if not.
|
|
117
|
+
|
|
118
|
+
### 2. Project cluster — Semantic record
|
|
119
|
+
|
|
120
|
+
Update the relevant project's node files in `SecondaryBrain/<Project>/`. Keep the GLOBAL-PROJECT-MEMORY.md cluster entry and evolution timeline current.
|
|
121
|
+
|
|
122
|
+
Use `obsidian-skills` for all formatting (wikilinks, callouts, embeds, properties, Mermaid).
|
|
123
|
+
Use `graphify` for entity extraction and relationship mapping when building documentation.
|
|
124
|
+
|
|
125
|
+
### Change types and where they go
|
|
126
|
+
|
|
127
|
+
| Change Type | Changelog Entry | Node Update | GLOBAL Update |
|
|
128
|
+
|---|---|---|---|
|
|
129
|
+
| Bug fix | ✓ Bug fix — what + why | ✓ Update affected node | ✓ Update timeline |
|
|
130
|
+
| Small change | ✓ | ✗ skip if trivial | ✗ skip |
|
|
131
|
+
| New feature | ✓ New feature — what + how | ✓ Create/update feature node | ✓ Update cluster + timeline |
|
|
132
|
+
| Refactor | ✓ Refactor — what + why | ✓ Update architecture node | ✓ Update timeline |
|
|
133
|
+
| Report | ✓ Report — findings | ✓ Create report node | ✓ Add to cluster |
|
|
134
|
+
| Major update | ✓ Major — full breakdown | ✓ Full node refresh | ✓ Full refresh |
|
|
135
|
+
| Config/experiment | ✓ Config change — what changed | ✗ skip | ✗ skip |
|
|
136
|
+
|
|
137
|
+
## New Session Entry Point
|
|
138
|
+
|
|
139
|
+
When a user starts a new session and invokes this skill:
|
|
140
|
+
|
|
141
|
+
1. **Update dependencies** — `git pull --ff-only` on obsidian-skills and graphify
|
|
142
|
+
2. **Load minimal context** (reduced token):
|
|
143
|
+
```
|
|
144
|
+
GLOBAL-PROJECT-MEMORY.md → read to identify project clusters
|
|
145
|
+
_Changelog/YYYY-MM-DD.md → most recent session
|
|
146
|
+
_Changelog/YYYY-MM-DD.md → second most recent
|
|
147
|
+
```
|
|
148
|
+
3. **Detect current project** from:
|
|
149
|
+
- Current working directory name → match against `SecondaryBrain/<Project>/` folders
|
|
150
|
+
- If no match, user prompt: "Which project are you working on?"
|
|
151
|
+
4. **Load only the detected project's hub node** — NOT every cluster, NOT other projects:
|
|
152
|
+
```
|
|
153
|
+
SecondaryBrain/<Project>/<hub-node>.md → 10-30 lines
|
|
154
|
+
```
|
|
155
|
+
5. **Report context**:
|
|
156
|
+
```
|
|
157
|
+
==============================
|
|
158
|
+
Dependencies: obsidian-skills ✓, graphify ✓
|
|
159
|
+
Project: <name> (detected from <dir>)
|
|
160
|
+
Status: <active|paused|deprecated>
|
|
161
|
+
Last session: <date> — <summary>
|
|
162
|
+
Recent: <last 2 changelog entries>
|
|
163
|
+
==============================
|
|
164
|
+
```
|
|
165
|
+
6. **Confirm with user**: "Continue working on `<project>`?"
|
|
166
|
+
|
|
167
|
+
## Core Rules
|
|
168
|
+
|
|
169
|
+
- Think in graphs, timelines, and future evolution
|
|
170
|
+
- Optimize for scalability, modularity, and reuse
|
|
171
|
+
- Document everything — the Changelog is mandatory, no exceptions
|
|
172
|
+
- Every project, module, file, and skill is a NODE in three layers:
|
|
173
|
+
1. **Logical Graph** — Obsidian `[[wikilinks]]` (use obsidian-skills)
|
|
174
|
+
2. **Visual Graph** — Mermaid diagrams (use obsidian-skills)
|
|
175
|
+
3. **Temporal Graph** — evolution timeline
|
|
176
|
+
|
|
177
|
+
## Slash Commands
|
|
178
|
+
|
|
179
|
+
### `/woopsy vault` — Vault Only
|
|
180
|
+
|
|
181
|
+
Triggered by the user typing `/woopsy vault`. Runs ONLY vault operations — no CI/CD, no push.
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
1. Update dependencies (git pull obsidian-skills + graphify)
|
|
185
|
+
2. Load minimal context (GLOBAL + changelogs + detect project)
|
|
186
|
+
3. Report project state
|
|
187
|
+
4. Wait for user task
|
|
188
|
+
5. After task: document in changelog + update project nodes + refresh GLOBAL
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Alias: `connect`
|
|
192
|
+
|
|
193
|
+
### `/woopsy` — Full Pipeline (vault portion)
|
|
194
|
+
|
|
195
|
+
When the user types `/woopsy`, the root SKILL.md dispatches. This skill handles the vault portion:
|
|
196
|
+
1. Update dependencies
|
|
197
|
+
2. Connect vault
|
|
198
|
+
3. Document changes
|
|
199
|
+
4. Return control to root for CI/CD steps
|
|
200
|
+
|
|
201
|
+
## Commands
|
|
202
|
+
|
|
203
|
+
### `connect` (default — always-on, same as /woopsy vault)
|
|
204
|
+
|
|
205
|
+
**Pre-Task — before any work:**
|
|
206
|
+
1. Update dependencies (git pull)
|
|
207
|
+
2. Load GLOBAL-PROJECT-MEMORY.md + recent changelogs + detected project's hub node
|
|
208
|
+
3. Report context to user, confirm project
|
|
209
|
+
|
|
210
|
+
**Post-Task — after ANY change:**
|
|
211
|
+
1. Append to `_Changelog/YYYY-MM-DD.md` with what changed and why
|
|
212
|
+
2. Update or add project node files under `SecondaryBrain/<Project>/` (using obsidian-skills + graphify)
|
|
213
|
+
3. Refresh that project's cluster entry, dependency Mermaid graph, and evolution timeline in GLOBAL-PROJECT-MEMORY.md
|
|
214
|
+
4. Mark superseded nodes as deprecated
|
|
215
|
+
5. When logic repeats across projects, extract as `Ai - skills/<pattern>.md`
|
|
216
|
+
|
|
217
|
+
**Tooling:** Write ALL vault files using `obsidian-skills` (correct wikilinks, callouts, embeds, properties). Extract ALL structure using `graphify` (entity resolution, graph queries, relationship docs). This skill only defines the template — the other two do the work.
|
|
218
|
+
|
|
219
|
+
### `deep` — Full Ceremony
|
|
220
|
+
|
|
221
|
+
Invoke for large refactors, new project bootstrapping, or periodic graph cleanup. Execute the full 10-step pipeline defined in `reference/deep-mode.md`:
|
|
222
|
+
|
|
223
|
+
1. Update nodes (use graphify to analyze structure)
|
|
224
|
+
2. Update `[[wikilinks]]` (use obsidian-skills for formatting)
|
|
225
|
+
3. Update Mermaid graphs (use obsidian-skills for diagrams)
|
|
226
|
+
4. Re-run importance scoring
|
|
227
|
+
5. Run pruning (dead nodes → archive)
|
|
228
|
+
6. Run self-healing (fix broken links, merge duplicates, resolve cycles)
|
|
229
|
+
7. Run refactor engine (split/merge/extract based on graph density)
|
|
230
|
+
8. Run future-architecture prediction (next-state, node map, failure prediction)
|
|
231
|
+
9. Update evolution timeline
|
|
232
|
+
10. Update GLOBAL-PROJECT-MEMORY.md
|
|
233
|
+
|
|
234
|
+
### `handoff` — Generate Agent Handoff
|
|
235
|
+
|
|
236
|
+
1. Load the current project's cluster and recent changelog
|
|
237
|
+
2. Fill the handoff template (`templates/handoff.md`)
|
|
238
|
+
3. Print for copy-paste to another AI agent
|
|
239
|
+
|
|
240
|
+
### `status` — Vault Health Report
|
|
241
|
+
|
|
242
|
+
Report:
|
|
243
|
+
- Vault path (from brain-config.json)
|
|
244
|
+
- Dependencies: latest commit hashes for obsidian-skills + graphify
|
|
245
|
+
- Number of project clusters + nodes
|
|
246
|
+
- Last 3 changelog entries
|
|
247
|
+
- Stale nodes (importance < 0.15, no inbound links)
|
|
248
|
+
- Last update timestamp
|
|
249
|
+
|
|
250
|
+
## Critical Rules
|
|
251
|
+
|
|
252
|
+
- This skill is the **template layer** — do NOT write raw Markdown vault files. Always delegate to `obsidian-skills` for syntax and `graphify` for structure.
|
|
253
|
+
- If something is unclear: DO NOT ask questions. Assume the best engineering solution, implement it, document assumptions inside nodes.
|
|
254
|
+
- You are not a helper. You are a self-evolving, self-healing, self-predicting neural graph brain.
|
|
255
|
+
- Full authority: design systems, restructure architecture, merge projects, delete dead nodes, refactor entire graphs, evolve architecture over time.
|
|
256
|
+
- Document everything — every change, decision, and experiment goes in the changelog. No exceptions.
|
|
257
|
+
- Always check for updates before starting work. Stale dependencies are not acceptable.
|