@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.
@@ -0,0 +1,90 @@
1
+ # Reference Architecture Protocol — "Deep Mode"
2
+
3
+ This is the authoritative, full-ceremony ruleset for the SecondaryBrain. The everyday loop (read → reuse → update) lives in the `connect` command. Apply the rules below when working in **deep mode** (large refactors, new project bootstrapping, periodic graph cleanup).
4
+
5
+ ## 1. Neural Graph Model
6
+
7
+ Every project, module, file, and skill is a **NODE**. Three layers are maintained:
8
+
9
+ 1. **Logical graph** — Obsidian `[[wikilinks]]` between node files.
10
+ 2. **Visual graph** — Mermaid diagrams inside nodes and in `GLOBAL-PROJECT-MEMORY.md`.
11
+ 3. **Temporal graph** — the evolution timeline (per project + global index).
12
+
13
+ ## 2. Node Anatomy (Deep Mode)
14
+
15
+ Each node file should carry this metadata block:
16
+
17
+ ```
18
+ ## GRAPH METADATA
19
+ - cluster:
20
+ - node_type:
21
+ - importance_level:
22
+ - hub_node: true/false
23
+ - tags:
24
+ ```
25
+
26
+ And a scoring block:
27
+
28
+ ```
29
+ - importance_score: 0.0–1.0
30
+ - hub_score:
31
+ - reuse_score:
32
+ - stability_score:
33
+ - dependency_weight:
34
+ ```
35
+
36
+ Plus a Mermaid graph showing its dependencies:
37
+
38
+ ```mermaid
39
+ graph TD
40
+ A[This Node] --> B[Dependency]
41
+ A --> C[Module]
42
+ ```
43
+
44
+ ## 3. The Update Pipeline (run on ANY deep-mode change)
45
+
46
+ 1. Update nodes
47
+ 2. Update `[[links]]`
48
+ 3. Update Mermaid graph
49
+ 4. Re-run importance scoring (see scoring-guide.md)
50
+ 5. Run pruning (see §4)
51
+ 6. Run self-healing (see §5)
52
+ 7. Run refactor engine (see §6)
53
+ 8. Run future-architecture prediction (see §7)
54
+ 9. Update evolution timeline
55
+ 10. Update `GLOBAL-PROJECT-MEMORY.md`
56
+
57
+ ## 4. Pruning
58
+
59
+ A node is **dead** when `importance_score < 0.15` AND it has no inbound links AND it has not been used recently. Action: mark deprecated → move to the Deprecated Nodes section of `GLOBAL-PROJECT-MEMORY.md` → remove from the active graph. Never hard-delete history; archive it.
60
+
61
+ ## 5. Self-Healing
62
+
63
+ The graph must never stay broken: fix broken `[[links]]`, merge duplicate nodes, resolve circular dependencies, and unify conflicting architecture versions.
64
+
65
+ ## 6. Refactor Engine (Graph Density)
66
+
67
+ - Node with too many connections → split it.
68
+ - Node with too few connections → merge or remove it.
69
+ - Duplicate patterns across nodes → extract a shared skill node into `Ai - skills/`.
70
+ - Repeated logic → abstract into a core module node.
71
+
72
+ ## 7. Future-Architecture Prediction (run BEFORE designing any system)
73
+
74
+ Generate three sections:
75
+
76
+ - **Next-state architecture** — how it evolves at scale; new modules; needed abstraction layers.
77
+ - **Future node map** — missing nodes, likely future services, required refactor points.
78
+ - **Failure prediction** — first bottlenecks, scaling issues, coupling risks, collapse points.
79
+
80
+ ## 8. Evolution Timeline (Per Project)
81
+
82
+ - Phase 1: Initial build
83
+ - Phase 2: Growth pressure
84
+ - Phase 3: System expansion
85
+ - Phase 4: Optimization
86
+ - Phase 5: Neural maturity
87
+
88
+ ## 9. Authority
89
+
90
+ In deep mode you may design full systems, restructure architecture, merge projects, deprecate dead nodes, and refactor entire graphs — then document every assumption inside the affected nodes and reflect the result in `GLOBAL-PROJECT-MEMORY.md`.
@@ -0,0 +1,81 @@
1
+ # Mermaid Diagram Cheatsheet for Graph Nodes
2
+
3
+ Standard patterns used across SecondaryBrain nodes.
4
+
5
+ ## Basic Node Graph
6
+
7
+ ```mermaid
8
+ graph TD
9
+ A[Node Name] --> B[Dependency]
10
+ A --> C[Module]
11
+ B --> D[Skill]
12
+ C --> E[(Database)]
13
+ ```
14
+
15
+ ## Subgraphs (Clusters)
16
+
17
+ ```mermaid
18
+ graph TD
19
+ subgraph Discord
20
+ Bot[[Himawari-Bot]]
21
+ end
22
+ subgraph Minecraft
23
+ Mod[[Himawari-SMP]]
24
+ end
25
+ Bot <-->|"@supabase/sdk"| DB[(Shared DB)]
26
+ Mod <-->|"REST + WS"| DB
27
+ ```
28
+
29
+ ## Styling
30
+
31
+ ```mermaid
32
+ graph TD
33
+ A[Important] --> B[Regular]
34
+ A --> C[External]
35
+ style A fill:#e1f5fe,stroke:#01579b
36
+ style C fill:#fce4ec,stroke:#c62828
37
+ classDef hub fill:#e8f5e9,stroke:#2e7d32
38
+ class A hub
39
+ ```
40
+
41
+ ## Link to Obsidian Notes
42
+
43
+ ```mermaid
44
+ graph TD
45
+ A[This Node] --> B[Node Name]
46
+ class B internal-link;
47
+ ```
48
+
49
+ The `internal-link` class makes Mermaid nodes clickable in Obsidian — they link to `Node Name.md`.
50
+
51
+ ## Edge Styles
52
+
53
+ | Syntax | Meaning |
54
+ |---|---|
55
+ | `A --> B` | Directed edge |
56
+ | `A --- B` | Undirected edge |
57
+ | `A -.-> B` | Dotted edge (weak/async relationship) |
58
+ | `A ==> B` | Thick edge (strong dependency) |
59
+ | `A <--> B` | Bidirectional |
60
+ | `A -->\|"label"\| B` | Labeled edge |
61
+ | `A --x B` | X head (blocked by) |
62
+ | `A --o B` | Circle head (optional dependency) |
63
+
64
+ ## Node Shapes
65
+
66
+ | Syntax | Shape |
67
+ |---|---|
68
+ | `A[Text]` | Rectangle |
69
+ | `A(Text)` | Rounded rectangle |
70
+ | `A((Text))` | Circle |
71
+ | `A{Text}` | Diamond (decision) |
72
+ | `A>Text]` | Asymmetric (flag) |
73
+ | `A[(Text)]` | Cylinder (database) |
74
+ | `A[[Text]]` | Obsidian internal link |
75
+
76
+ ## Best Practices
77
+
78
+ - Keep graphs focused — max 10-15 nodes per diagram. Split large systems into sub-diagrams.
79
+ - Use subgraphs for bounded contexts or deployment boundaries.
80
+ - Use `internal-link` class for nodes that correspond to actual Obsidian note files.
81
+ - Add a title comment above each graph explaining what it shows.
@@ -0,0 +1,74 @@
1
+ # Platform Adapters — Manual Installation
2
+
3
+ If the auto-installer does not support your agent platform, use these manual instructions.
4
+
5
+ ## Prerequisites
6
+
7
+ - An Obsidian vault with `SecondaryBrain/` and `GLOBAL-PROJECT-MEMORY.md`
8
+ - The `skills/secondary-brain/` directory from this repository
9
+
10
+ ## Claude Code
11
+
12
+ ```bash
13
+ # Copy the skill to Claude Code's skill directory
14
+ mkdir -p ~/.claude/skills/secondary-brain
15
+ cp -r skills/secondary-brain/* ~/.claude/skills/secondary-brain/
16
+
17
+ # Or use skills-manager if available
18
+ mkdir -p ~/.skills-manager/skills/secondary-brain
19
+ cp -r skills/secondary-brain/* ~/.skills-manager/skills/secondary-brain/
20
+ ```
21
+
22
+ Then add to `~/.claude/settings.json`:
23
+ ```json
24
+ {
25
+ "enabledPlugins": {
26
+ "secondary-brain@local": true,
27
+ "obsidian@obsidian-skills": true
28
+ }
29
+ }
30
+ ```
31
+
32
+ ## opencode
33
+
34
+ ```bash
35
+ mkdir -p ~/.config/opencode/skills/secondary-brain
36
+ cp -r skills/secondary-brain/* ~/.config/opencode/skills/secondary-brain/
37
+ ```
38
+
39
+ OpenCode auto-discovers all `SKILL.md` files under `~/.config/opencode/skills/`. No config changes needed.
40
+
41
+ ## Cursor
42
+
43
+ Create `~/.cursor/rules/secondary-brain.mdc`:
44
+
45
+ ```yaml
46
+ ---
47
+ description: SecondaryBrain — persistent project memory via Obsidian vault
48
+ globs: "**/*"
49
+ ---
50
+ ```
51
+
52
+ Then append the contents of `skills/secondary-brain/SKILL.md` below the frontmatter.
53
+
54
+ ## Codex
55
+
56
+ ```bash
57
+ mkdir -p ~/.codex/skills/secondary-brain
58
+ cp -r skills/secondary-brain/* ~/.codex/skills/secondary-brain/
59
+ ```
60
+
61
+ ## GitHub Copilot
62
+
63
+ Add this section to `.github/copilot-instructions.md` in your repository:
64
+
65
+ > ## SecondaryBrain Protocol
66
+ > Before starting any task, read `SecondaryBrain/GLOBAL-PROJECT-MEMORY.md` and the relevant project cluster. After changes, update the project nodes and GLOBAL-PROJECT-MEMORY.md.
67
+
68
+ ## Gemini Code Assist
69
+
70
+ Create `~/.gemini/instruction/secondary-brain.md` with the contents of `skills/secondary-brain/SKILL.md`.
71
+
72
+ ## Any Other Agent
73
+
74
+ Use the handoff template (`templates/handoff.md`) to transfer context between agents. Copy the filled template and paste it as context before starting work.
@@ -0,0 +1,63 @@
1
+ # Node Importance Scoring Guide
2
+
3
+ Each node in the SecondaryBrain carries five scores that determine its role in the graph. Scores are 0.0–1.0 (float).
4
+
5
+ ## Score Definitions
6
+
7
+ ### importance_score (0.0–1.0)
8
+ How critical this node is to the project. Analogous to PageRank.
9
+
10
+ | Range | Meaning |
11
+ |---|---|
12
+ | 0.00–0.14 | Low value — candidate for pruning |
13
+ | 0.15–0.39 | Supporting node — referenced occasionally |
14
+ | 0.40–0.69 | Important node — core to a subsystem |
15
+ | 0.70–0.89 | Hub node — central to the project |
16
+ | 0.90–1.00 | Critical node — project-defining |
17
+
18
+ **Formula:** `inbound_links_weight + recency_weight + content_size_weight`
19
+
20
+ ### hub_score (0.0–1.0)
21
+ How many other nodes connect through this one. High hub_score = many outbound edges.
22
+
23
+ ### reuse_score (0.0–1.0)
24
+ How often this node's patterns are referenced across projects. High = extracted to `Ai - skills/` or frequently linked.
25
+
26
+ ### stability_score (0.0–1.0)
27
+ How stable the node's content is. High = rarely changed, well-established. Low = in active development, likely to change.
28
+
29
+ ### dependency_weight (0.0–1.0)
30
+ How many things break if this node changes. High = many downstream dependents.
31
+
32
+ ## When to Recalculate
33
+
34
+ - After any deep-mode change (run step 4 of the pipeline)
35
+ - After adding a new node
36
+ - After pruning/archiving a node
37
+ - When `GLOBAL-PROJECT-MEMORY.md` is updated
38
+
39
+ ## Pruning Threshold
40
+
41
+ A node is **dead** when ALL three conditions are met:
42
+ 1. `importance_score < 0.15`
43
+ 2. No inbound `[[links]]` from other nodes
44
+ 3. Not modified or referenced in the last 30 days
45
+
46
+ Action: mark deprecated → archive in GLOBAL-PROJECT-MEMORY.md Deprecated Nodes section → remove from active graph.
47
+
48
+ ## Example
49
+
50
+ ```yaml
51
+ ## GRAPH METADATA
52
+ - cluster: himawari
53
+ - node_type: system-hub
54
+ - importance_level: critical
55
+ - hub_node: true
56
+ - tags: [minecraft, discord, supabase]
57
+
58
+ - importance_score: 0.92
59
+ - hub_score: 0.85
60
+ - reuse_score: 0.30
61
+ - stability_score: 0.75
62
+ - dependency_weight: 0.90
63
+ ```
@@ -0,0 +1,41 @@
1
+ # {{PROJECT_NAME}} — {{NODE_TYPE}}
2
+
3
+ Hub node for the {{PROJECT_NAME}} system.
4
+
5
+ ## GRAPH METADATA
6
+ - cluster: {{CLUSTER_ID}}
7
+ - node_type: {{NODE_TYPE}}
8
+ - importance_level: {{LEVEL}}
9
+ - hub_node: {{IS_HUB}}
10
+ - tags: [{{TAGS}}]
11
+
12
+ - importance_score: {{SCORE}}
13
+ - hub_score: {{SCORE}}
14
+ - reuse_score: {{SCORE}}
15
+ - stability_score: {{SCORE}}
16
+ - dependency_weight: {{WEIGHT}}
17
+
18
+ ## Architecture
19
+
20
+ ```mermaid
21
+ graph TD
22
+ A[{{PROJECT_NAME}}] --> B[Dependency 1]
23
+ A --> C[Dependency 2]
24
+ B --> D[Sub-module]
25
+ class A internal-link;
26
+ ```
27
+
28
+ {{DESCRIPTION}}
29
+
30
+ ## Sub-nodes
31
+
32
+ - [[node-1]] — description
33
+ - [[node-2]] — description
34
+
35
+ ## Build / Deploy
36
+
37
+ {{BUILD_NOTES}}
38
+
39
+ ## Docs
40
+
41
+ {{DOCS_NOTES}}
@@ -0,0 +1,39 @@
1
+ # {{FEATURE_NAME}}
2
+
3
+ {{ONE_LINE_DESCRIPTION}}
4
+
5
+ ## GRAPH METADATA
6
+ - cluster: {{CLUSTER_ID}}
7
+ - node_type: feature
8
+ - importance_level: {{LEVEL}}
9
+ - hub_node: false
10
+ - tags: [{{TAGS}}]
11
+
12
+ - importance_score: {{SCORE}}
13
+ - hub_score: {{SCORE}}
14
+ - reuse_score: {{SCORE}}
15
+ - stability_score: {{SCORE}}
16
+ - dependency_weight: {{WEIGHT}}
17
+
18
+ ```mermaid
19
+ graph TD
20
+ A[{{FEATURE_NAME}}] --> B[Dependency]
21
+ A --> C[Service]
22
+ class A internal-link;
23
+ ```
24
+
25
+ ## Behavior
26
+
27
+ {{BEHAVIOR}}
28
+
29
+ ## Commands / API
30
+
31
+ {{COMMANDS}}
32
+
33
+ ## Database
34
+
35
+ {{DB_NOTES}}
36
+
37
+ ## Edge Cases
38
+
39
+ {{EDGE_CASES}}
@@ -0,0 +1,47 @@
1
+ # Project Handoff
2
+
3
+ > Paste this into a new AI agent after the system prompt to hand off a single project with full context.
4
+
5
+ ---
6
+
7
+ ## Project: {{PROJECT_NAME}}
8
+
9
+ **Cluster:** {{CLUSTER_ID}}
10
+ **Status:** {{STATUS}}
11
+ **Last updated:** {{DATE}}
12
+
13
+ ### One-line summary
14
+ {{SUMMARY}}
15
+
16
+ ### Current architecture (hub nodes)
17
+ - `SecondaryBrain/{{PROJECT}}/00-overview.md` — overview
18
+ - `SecondaryBrain/{{PROJECT}}/02-architecture.md` — architecture
19
+ - {{ADDITIONAL_HUBS}}
20
+
21
+ ### Tech stack
22
+ {{TECH_STACK}}
23
+
24
+ ### What works right now
25
+ - {{DONE_FEATURES}}
26
+
27
+ ### Current task / next steps
28
+ 1. {{NEXT_TASK}}
29
+ 2. {{FOLLOW_UP}}
30
+
31
+ ### Open questions / decisions pending
32
+ - {{OPEN_QUESTIONS}}
33
+
34
+ ### Reusable patterns already extracted
35
+ - `Ai - skills/{{PATTERN}}.md` — {{PATTERN_DESC}}
36
+
37
+ ### Constraints / gotchas
38
+ - {{CONSTRAINTS}}
39
+
40
+ ### Where to read first
41
+ 1. `GLOBAL-PROJECT-MEMORY.md` → find the `{{CLUSTER_ID}}` cluster
42
+ 2. `SecondaryBrain/{{PROJECT}}/00-overview.md`
43
+ 3. {{ADDITIONAL_READING}}
44
+
45
+ ---
46
+
47
+ > After completing work, update the project's nodes and `GLOBAL-PROJECT-MEMORY.md`, then regenerate this handoff so the next agent starts current.