@abarcenas/ai-workflow-template 1.41.0 β†’ 1.44.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.
Files changed (30) hide show
  1. package/.agents/instructions/knowledge-retrieval.instructions.md +69 -0
  2. package/.agents/instructions/knowledgebase.instructions.md +43 -22
  3. package/.agents/instructions/learned-knowledge.instructions.md +180 -0
  4. package/.agents/instructions/memory-schema.instructions.md +22 -0
  5. package/.husky/pre-commit +1 -0
  6. package/.opencode/agents/architect.agent.md +1 -0
  7. package/.opencode/agents/coder.agent.md +1 -1
  8. package/.opencode/agents/deployer.agent.md +3 -2
  9. package/.opencode/agents/designer.agent.md +4 -3
  10. package/.opencode/agents/e2e-tester.agent.md +5 -4
  11. package/.opencode/agents/implementer.agent.md +1 -0
  12. package/.opencode/agents/orchestrator/feature-pipeline.agent.md +6 -2
  13. package/.opencode/agents/orchestrator/orchestrator.agent.md +5 -1
  14. package/.opencode/agents/orchestrator/tdd-orchestrator.agent.md +7 -1
  15. package/.opencode/agents/researcher.agent.md +9 -1
  16. package/.opencode/agents/reviewer.agent.md +2 -0
  17. package/.opencode/agents/tracker.agent.md +8 -6
  18. package/.opencode/agents/unit-tester.agent.md +6 -5
  19. package/README.md +124 -304
  20. package/memory-bank/.vocabulary.json +125 -31
  21. package/package.json +1 -1
  22. package/scripts/mcp-knowledgebase-server.js +85 -19
  23. package/scripts/mcp-knowledgebase-server.test.js +745 -0
  24. package/scripts/setup/constants.js +2 -1
  25. package/scripts/sync.js +1 -0
  26. package/scripts/sync.test.js +4 -3
  27. package/scripts/validate-memory-schema.js +28 -3
  28. package/scripts/validate-memory-schema.test.js +328 -0
  29. package/scripts/vocab-sync.js +216 -0
  30. package/scripts/vocab-sync.test.js +814 -0
package/README.md CHANGED
@@ -1,47 +1,16 @@
1
- # πŸ€– AI Workflow Template
1
+ # AI Workflow Template
2
2
 
3
- **Publishable AI workflow starter pack for OpenCode** β€” Auto-syncing, version-managed, npm-distributed agent configuration suite with vector search memory.
3
+ Publishable AI workflow starter pack for OpenCode β€” auto-syncing, version-managed, npm-distributed agent configuration suite with vector search memory.
4
4
 
5
- ---
6
-
7
- ## ✨ What This Package Does
8
-
9
- This isn't a one-off template to cloneβ€”it's a **live npm package** that distributes AI workflow configurations to consumer projects. When installed, it automatically syncs its intelligent agent setup into your project and keeps everything updated over time.
10
-
11
- ### 🎯 Included Capabilities
12
-
13
- - βš™οΈ **27+ Specialized AI Skills** - Reusable, task-based workflows (`.agents/skills/`)
14
- - 🧠 **Smart Agent Frameworks** - Plan Mode, Implementation Plans, Research Spikes (`.agents/agents/`)
15
- - πŸ”„ **Multi-Agent Orchestrator** β€” Dynamic pipeline builder with 10+ specialized sub-agents
16
- - πŸ§ͺ **TDD Orchestrator** β€” Strict REDβ†’GREENβ†’REFACTOR/VERIFY test-driven pipeline (90% coverage gate)
17
- - πŸ“ **Framework Instructions** - Technology-specific guidance (`.agents/instructions/`)
18
- - πŸ’¬ **Prompt Templates** - Ready-to-use prompt blueprints (`.agents/prompts/`)
19
- - 🧠 **Memory Bank** β€” Persistent project context across AI sessions with semantic search
20
- - πŸ” **Vector Memory Search** β€” sqlite-vec powered semantic search (token-efficient, zero deps)
21
- - πŸƒβ€β™‚οΈ **Caveman Mode** - Ultra-compressed communication for token efficiency
22
- - 🎭 **Playwright Testing** - Automated E2E testing with MCP integration
23
- - ⚑ **Vitest Unit Testing** β€” Fast unit tests with v8 coverage (β‰₯90% threshold)
24
- - πŸ“¦ **Version Auto-Bumping** - Husky-managed semantic versioning
25
- - πŸš€ **Auto-Publishing** - npm publish on merge to `main`
26
- - πŸ—ΊοΈ **graphify Knowledge Graph** β€” Queryable code-level relationship mapping
27
-
28
- ---
29
-
30
- ## πŸš€ Install
31
-
32
- Install directly into the project that needs AI workflow configuration:
5
+ ## Install
33
6
 
34
7
  ```bash
35
8
  npm install @abarcenas/ai-workflow-template
36
9
  ```
37
10
 
38
- The package runs `postinstall` automatically to sync files. For full setup including git hooks, run the one-step setup command below.
39
-
40
- ---
41
-
42
- ## πŸͺ Git Hook Setup
11
+ The package runs `postinstall` to sync files; for full setup including git hooks, use the setup command below.
43
12
 
44
- After installing the package, configure husky git hooks with one command:
13
+ ## Git Hook Setup
45
14
 
46
15
  ```bash
47
16
  # One-step setup (fetches from npm registry automatically):
@@ -53,92 +22,83 @@ npx ai-workflow-setup
53
22
 
54
23
  ### What It Does
55
24
 
56
- The setup command automatically:
57
-
58
25
  | Phase | Action |
59
- |-------|--------|
60
- | πŸ” **Discover** | Detects git repo, existing hooks, CI mode |
61
- | πŸͺ **Hooks** | Installs `pre-commit` (version bump + validation) and `post-merge` (memory index update) |
62
- | πŸ“¦ **Prepare** | Merges `"husky"` into your `package.json` prepare script |
63
- | βš™οΈ **Husky Init** | Initializes husky and sets `core.hooksPath` |
64
- | πŸ”„ **Sync** | Copies agent configurations, skills, and memory bank scaffolding |
26
+ | --- | --- |
27
+ | Discover | Detects git repo, existing hooks, CI mode |
28
+ | Hooks | Installs `pre-commit` (version bump + validation) and `post-merge` (memory index update) |
29
+ | Prepare | Merges `"husky"` into your `package.json` prepare script |
30
+ | Husky Init | Initializes husky and sets `core.hooksPath` |
31
+ | Sync | Copies agent configurations, skills, and memory bank scaffolding |
65
32
 
66
33
  ### Options
67
34
 
68
35
  ```bash
69
- npx ai-workflow-setup --dry-run # Preview without changes
70
- npx ai-workflow-setup --force # Overwrite existing hooks
71
- npx ai-workflow-setup --skip-hooks # Skip hook installation
72
- npx ai-workflow-setup --skip-sync # Skip file sync
73
- npx ai-workflow-setup --help # Show all options
36
+ npx ai-workflow-setup --dry-run # Preview without changes
37
+ npx ai-workflow-setup --force # Overwrite existing hooks
38
+ npx ai-workflow-setup --skip-hooks # Skip hook installation
39
+ npx ai-workflow-setup --skip-sync # Skip file sync
40
+ npx ai-workflow-setup --knowledgebase # Run only the knowledgebase phase
41
+ npx ai-workflow-setup --help # Show all options
74
42
  ```
75
43
 
76
44
  ### Hook Merging
77
45
 
78
- If you already have existing husky hooks, the setup command intelligently merges:
79
46
  - **Your hooks are never overwritten** β€” new content is appended after a separator
80
47
  - **Managed hooks are detected** via marker comments and updated idempotently
81
48
  - **Complex hooks** trigger a warning with manual merge instructions
82
49
  - **CI environments** auto-skip hook configuration
83
50
 
84
- > **ℹ️ npm v12 note:** Future npm versions block automatic `postinstall` scripts. The explicit `npx setup` command is the recommended, future-proof approach.
85
-
86
- ---
51
+ > **npm v12 note:** Future npm versions block automatic `postinstall` scripts. The explicit `npx setup` command is the recommended, future-proof approach.
87
52
 
88
- ## πŸ”„ Sync Behavior
53
+ ## What This Package Does
89
54
 
90
- The sync script runs automatically but offers flexible control:
55
+ - **29 specialized AI skills**, framework instructions, and prompt templates (`.agents/`)
56
+ - **Smart agent frameworks** β€” Plan Mode, Implementation Plans, Research Spikes
57
+ - **Multi-agent orchestrator** β€” dynamic pipelines with 10+ specialized sub-agents
58
+ - **TDD orchestrator** — strict RED→GREEN→REFACTOR/VERIFY pipeline (90% coverage gate)
59
+ - **Memory bank** β€” persistent project context with sqlite-vec semantic search
60
+ - **Caveman mode** β€” ultra-compressed communication for token efficiency
61
+ - **Playwright + Vitest testing** β€” E2E browser tests, unit tests with v8 coverage (β‰₯90%)
62
+ - **Version auto-bumping + auto-publishing** β€” Husky-managed, npm publish on merge to `main`
63
+ - **graphify knowledge graph** β€” queryable code-level relationship mapping
91
64
 
92
- ### πŸ”§ Manual Sync Options
65
+ ## Sync Behavior
93
66
 
94
67
  ```bash
95
- # Preview changes without applying
96
- npm run sync -- --dry-run
97
-
98
- # Force overwrite local changes
99
- npm run sync -- --force
100
-
101
- # Normal sync
102
- npm run sync
68
+ npm run sync -- --dry-run # Preview changes without applying
69
+ npm run sync -- --force # Force overwrite local changes
70
+ npm run sync # Normal sync
103
71
  ```
104
72
 
105
73
  **Smart Sync Rules:**
106
- - βœ… New files are copied automatically
107
- - βœ… Unmodified files are refreshed from the package
108
- - βœ… Locally edited files are preserved (skipped by default)
109
- - βœ… GitHub Actions workflows are excluded from consumer sync (`.github/workflows/`)
110
74
 
111
- ---
75
+ - New files are copied automatically
76
+ - Unmodified files are refreshed from the package
77
+ - Locally edited files are preserved (skipped by default)
78
+ - GitHub Actions workflows are excluded from consumer sync (`.github/workflows/`)
112
79
 
113
- ## πŸ“š Core Structure
80
+ ## Core Structure
114
81
 
115
- Post-install, your project receives this organized structure:
82
+ Post-install, your project receives this structure:
116
83
 
117
- ```
84
+ ```text
118
85
  .agents/
119
- β”œβ”€β”€ πŸ“– instructions/ # 17 instruction sets (frameworks, workflows, security)
120
- β”œβ”€β”€ πŸ› οΈ skills/ # 27+ specialized AI skills with tools
121
- β”œβ”€β”€ πŸ€– agents/ # 3 agent workflow patterns
122
- β”œβ”€β”€ πŸ’¬ prompts/ # Reusable prompt templates
123
- └── πŸ“¦ compress/ # Token optimization tools
124
-
125
- .github/
126
- └── workflows/ # CI/CD automation (excluded from sync)
127
-
128
- docs/
129
- └── playwright-mcp-configuration.md # Testing integration guide
130
-
131
- AGENTS.md # Master instruction file with agent guidance
132
-
133
- ## 🎯 Multi-Agent Orchestrator
86
+ β”œβ”€β”€ instructions/ # Framework, workflow, and security guidance
87
+ β”œβ”€β”€ skills/ # 29 specialized AI skills
88
+ └── prompts/ # Reusable prompt templates
89
+ .opencode/agents/ # Orchestrator + specialized sub-agents
90
+ .github/workflows/ # CI/CD automation (excluded from sync)
91
+ docs/ # Guides (e.g. playwright-mcp-configuration.md)
92
+ AGENTS.md # Master instruction file with agent guidance
93
+ ```
134
94
 
135
- The project includes a **multi-agent orchestrator** that dynamically builds and runs development pipelines using specialized sub-agents.
95
+ ## Multi-Agent Orchestrator
136
96
 
137
97
  ### Agents
138
98
 
139
99
  | Agent | File | Role |
140
- |---|---|---|
141
- | **Orchestrator** | `.opencode/agents/orchestrator.agent.md` | Master β€” analyzes requests, builds pipelines, delegates |
100
+ | --- | --- | --- |
101
+ | Orchestrator | `.opencode/agents/orchestrator/orchestrator.agent.md` | Master β€” analyzes requests, builds pipelines, delegates |
142
102
  | Researcher | `.opencode/agents/researcher.agent.md` | Technical investigation, library evaluation |
143
103
  | Architect | `.opencode/agents/architect.agent.md` | System design, component architecture |
144
104
  | Implementer | `.opencode/agents/implementer.agent.md` | Translates designs into implementation plans |
@@ -155,130 +115,43 @@ The project includes a **multi-agent orchestrator** that dynamically builds and
155
115
  Invoke the orchestrator with `@orchestrator` followed by your task:
156
116
 
157
117
  ```bash
158
- # Full automated pipeline (auto-bootstraps architecture on first run)
159
118
  @orchestrator Add a user login feature with email verification
160
- ```
161
-
162
- ```bash
163
- # Quick execution without step-by-step confirmation
164
119
  @orchestrator full pipeline: refactor authentication to use JWT
165
- ```
166
-
167
- ```bash
168
- # Specific scope β€” only the relevant agents run
169
120
  @orchestrator fix the pagination bug in the search results component
170
121
  ```
171
122
 
172
- #### What Happens When You Run the Orchestrator
173
-
174
- 1. **Step 0** β€” On first run only: auto-detects your project's tech stack, architecture patterns, and layer structure (via the architecture-blueprint-generator skill). Subsequent runs skip this.
175
- 2. **Steps 1-2** β€” Analyzes your request and builds a pipeline of the relevant sub-agents.
176
- 3. **Steps 3-4** β€” Executes each agent sequentially; you can confirm or skip each step (or enable auto-confirm for hands-off execution).
177
- 4. **Step 5** β€” Tracker agent documents everything to `docs/tracker-log.md`.
178
- 5. **Steps 6-7** β€” Presents results and persists new knowledge so the system gets smarter over time.
179
-
180
- #### First-Run Behavior
123
+ - **Run flow:** auto-bootstraps architecture on first run β†’ builds a pipeline β†’ executes agents sequentially (confirm/skip each step, or enable auto-confirm) β†’ tracker documents to `docs/tracker-log.md` β†’ persists new knowledge.
124
+ - **First run only:** runs the architecture-blueprint-generator skill to detect tech stack/patterns, writing context to `docs/.architecture-context.md` and `.agents/instructions/learned-knowledge.instructions.md`; later runs skip this.
181
125
 
182
- The very first time you use `@orchestrator` in a project, it automatically runs the architecture-blueprint-generator skill to:
183
- - Detect your tech stack (frameworks, databases, infrastructure)
184
- - Identify architectural patterns (Clean Architecture, MVC, etc.)
185
- - Map layer structure and dependency rules
186
- - Write the context to `docs/.architecture-context.md` and `.agents/instructions/learned-knowledge.instructions.md`
187
-
188
- All subsequent runs skip this β€” agents get architecture context pre-filled.
189
-
190
- #### MCP Tooling
126
+ ### MCP Tooling
191
127
 
192
128
  Some agents require MCP servers configured in `opencode.mcp`:
193
129
 
194
130
  | Agent | Required MCP | Purpose |
195
- |---|---|---|
131
+ | --- | --- | --- |
196
132
  | Researcher | ddg-search, Context7 | Web search + documentation queries |
197
133
  | E2E Tester | Playwright | Browser automation |
198
134
  | Reviewer | GitHub | PR and issue management |
199
135
  | Deployer | GitHub | Releases, Actions |
200
- ```
201
-
202
- **Main Instructions:** `AGENTS.md` - Central guidance for using all features.
203
-
204
- ---
205
-
206
- ## 🎨 Featured Skills
207
-
208
- ### Workflow Automation
209
- - πŸ—οΈ `architecture-blueprint-generator` - Project analysis & documentation
210
- - πŸ“‹ `create-implementation-plan` - Structured task planning
211
- - ✍️ `create-readme` - Automated README generation
212
- - 🎯 `context-map` - File relevance mapping
213
- - 🧠 `graphify` - Codebase knowledge graph generation
214
-
215
- ### Development Tools
216
- - 🎭 `playwright-explore-website` / `playwright-generate-test` - Browser automation
217
- - πŸ™ `github-issues` / `gh-cli` - GitHub integration
218
- - πŸ§ͺ `polygot-test-agent` - Multi-language test generation
219
- - πŸ“š `microsoft-docs` - Microsoft documentation queries
220
-
221
- ### Token & Efficiency Tools
222
- - πŸ—£οΈ `caveman` - Ultra-compressed communication modes
223
- - πŸ“‰ `caveman-compress` / `compress` - Memory file compression
224
- - πŸ“ `caveman-commit` - Optimized commit messages
225
- - πŸ‘₯ `cavecrew` - Multi-agent coordination
226
- - πŸ“Š `caveman-stats` - Token usage tracking
227
-
228
- ### Quality & Safety
229
- - πŸ›‘οΈ `agent-governance` - AI safety controls
230
- - πŸ”’ `security-owasp` - OWASP security guidelines
231
- - 🀝 `conventional-commit` / `git-commit` - Git best practices
232
-
233
- ---
234
-
235
- ### 🧠 Knowledge Graph (graphify)
236
-
237
- Turns any folder of code, docs, papers, images, or videos into a **queryable knowledge graph** with community detection, interactive HTML visualization, and GraphRAG-ready JSON.
238
-
239
- ```bash
240
- # Build a knowledge graph for the current directory
241
- /graphify
242
136
 
243
- # Build for a specific path
244
- /graphify <path>
137
+ ## TDD Orchestrator
245
138
 
246
- # Query an existing graph
247
- /graphify query "How does authentication work?"
248
- ```
249
-
250
- #### Prerequisites
251
-
252
- - **Python 3.10+** β€” required runtime
253
- - **`graphifyy` Python package** β€” `pip install graphifyy` or `uv tool install graphifyy`
254
- - **Optional: Gemini API key** (`GEMINI_API_KEY` or `GOOGLE_API_KEY`) β€” enables faster semantic extraction; without it, graphify falls back to Claude subagents
255
-
256
- > πŸ“– [GitHub: safishamsi/graphify](https://github.com/safishamsi/graphify) β€” full docs, examples, and source
257
-
258
- ---
139
+ Strict Test-Driven Development through the RED β†’ GREEN β†’ REFACTOR/VERIFY cycle:
259
140
 
260
- ### πŸ§ͺ TDD Orchestrator β€” Test-Driven Development Pipeline
261
-
262
- The project enforces a strict **Test-Driven Development** methodology through a specialized orchestrator that runs the **RED β†’ GREEN β†’ REFACTOR/VERIFY** cycle:
263
-
264
- ```
141
+ ```text
265
142
  implementer (PLAN) β†’ unit-testerβˆ₯ (RED) β†’ coderβˆ₯ (GREEN) β†’ unit-tester (VERIFY) β†’ reviewer β†’ tracker
266
143
  ```
267
144
 
268
145
  | Step | Agent | Phase | Description |
269
- |------|-------|-------|-------------|
146
+ | --- | --- | --- | --- |
270
147
  | 1 | Implementer | PLAN | Creates implementation plan with parallel test/code batch tables |
271
- | 2 | Unit Tester | RED | Writes FAILING tests first β€” defines expected behavior before any code exists |
272
- | 3 | Coder | GREEN | Writes MINIMAL production code to pass all tests β€” no extra features |
148
+ | 2 | Unit Tester | RED | Writes failing tests first β€” defines expected behavior before any code exists |
149
+ | 3 | Coder | GREEN | Writes minimal production code to pass all tests β€” no extra features |
273
150
  | 4 | Unit Tester | VERIFY | Runs full suite, enforces β‰₯90% coverage threshold |
274
151
  | 5 | Reviewer | REFACTOR | Audits tests + implementation for quality, security, patterns |
275
152
  | 6 | Tracker | DOCUMENT | Records pipeline results to `docs/tracker-log.md` |
276
153
 
277
- **Key TDD rules enforced:**
278
- - Tests are ALWAYS written first (RED phase) β€” no implementation until tests exist
279
- - Coverage gate: if <90%, loop back to RED phase (up to 3 iterations)
280
- - Every test suite tracked in `memory-bank/tasks/`
281
- - Lessons learned persisted to `.agents/instructions/learned-knowledge.instructions.md`
154
+ **Key rules:** tests are always written first; if coverage is <90%, loop back to RED (up to 3 iterations); every suite is tracked in `memory-bank/tasks/`; lessons learned persist to `.agents/instructions/learned-knowledge.instructions.md`.
282
155
 
283
156
  **How to invoke:**
284
157
 
@@ -286,47 +159,32 @@ implementer (PLAN) β†’ unit-testerβˆ₯ (RED) β†’ coderβˆ₯ (GREEN) β†’ unit-tester
286
159
  @orchestrator Add user authentication with login/logout endpoints
287
160
  ```
288
161
 
289
- The TDD orchestrator uses `subagent_type "tdd-orchestrator"` and auto-selects the strict TDD pipeline when testable code changes are requested.
162
+ The TDD orchestrator uses `subagent_type "tdd-orchestrator"` and auto-selects the strict pipeline when testable code changes are requested.
290
163
 
291
- ### 🧠 Memory Bank β€” Persistent Project Context with Vector Search
164
+ ## Memory Bank
292
165
 
293
- The memory bank preserves project knowledge across AI sessions, preventing context loss after resets. **New: semantic vector search** lets agents query project memory without loading all files into context β€” saving thousands of tokens per session.
166
+ Persistent project context across AI sessions. Semantic vector search (`sqlite-vec`) lets agents query memory without loading all files into context.
294
167
 
295
- #### Architecture
296
-
297
- ```
298
- Markdown files (git-committed) Vector Index (.gitignore'd)
299
- ══════════════════════════════ ════════════════════════════
300
- memory-bank/ memory-bank/.index/
301
- β”œβ”€β”€ activeContext.md └── memory.db ← sqlite-vec + better-sqlite3
302
- β”œβ”€β”€ progress.md β”‚
303
- β”œβ”€β”€ systemPatterns.md β”‚ rebuilt from .md files
304
- β”œβ”€β”€ ... β–Ό on demand
305
- memory_search("tdd orchestrator")
306
- β†’ top 5 relevant chunks (~500 tokens)
307
- ```
308
-
309
- **Source of truth:** Markdown files (git-versioned, human-readable).
310
- **Search index:** `sqlite-vec` vector database (disposable, rebuildable, never committed).
311
-
312
- #### MCP Tools (OpenCode)
168
+ ### MCP Tools
313
169
 
314
170
  | Tool | Purpose |
315
- |---|---|
171
+ | --- | --- |
316
172
  | `memory_search` | Semantic search across memory-bank + docs (query + topK) |
317
173
  | `memory_update` | Incremental sync β€” only changed files (~2 seconds) |
318
174
  | `memory_rebuild` | Full rebuild from markdown files (rare β€” clone/corruption) |
319
175
  | `memory_get` | Read a specific memory file by name |
320
176
  | `memory_stats` | Index statistics (vector count, DB size) |
321
177
 
322
- #### File Structure
178
+ ### File Structure
323
179
 
324
- ```
180
+ Source of truth is the git-committed Markdown; the vector index (`memory-bank/.index/memory.db`) is disposable and rebuildable.
181
+
182
+ ```text
325
183
  projectbrief.md β†’ productContext.md / systemPatterns.md / techContext.md β†’ activeContext.md β†’ progress.md / tasks/
326
184
  ```
327
185
 
328
186
  | File | Purpose |
329
- |------|---------|
187
+ | --- | --- |
330
188
  | `memory-bank/projectbrief.md` | Core requirements, goals, and scope |
331
189
  | `memory-bank/productContext.md` | Problem solved, UX goals |
332
190
  | `memory-bank/systemPatterns.md` | Architecture, design patterns, component relationships |
@@ -335,54 +193,47 @@ projectbrief.md β†’ productContext.md / systemPatterns.md / techContext.md β†’ a
335
193
  | `memory-bank/progress.md` | What works, what's left, known issues |
336
194
  | `memory-bank/tasks/` | Per-task tracking with `_index.md` |
337
195
 
338
- #### Document Schema
339
-
340
- All memory-bank files use YAML frontmatter for search indexing:
341
-
342
- ```yaml
343
- ---
344
- id: activeContext
345
- title: "Active Context"
346
- updated: 2026-07-23
347
- tags: [orchestrator, bootstrap, tdd]
348
- entities: [vitest, graphify, memory-bank]
349
- category: context
350
- ---
351
- ```
352
-
353
- See `memory-bank/.vocabulary.json` for the controlled vocabulary (user-extensible).
354
-
355
- **Auto-normalization:** `npm install` runs `normalize-memory.js` to add frontmatter to existing files.
356
- **Pre-commit validation:** Husky hook rejects commits with invalid frontmatter.
196
+ ### Document Schema
357
197
 
358
- **Task commands:** `add task`, `update task [ID]`, `show tasks [filter]`
198
+ All memory-bank files use YAML frontmatter (`id`, `title`, `updated`, `tags`, `entities`, `category`) for search indexing; see `memory-bank/.vocabulary.json` for the controlled vocabulary. `npm install` runs `normalize-memory.js` to add frontmatter; the Husky pre-commit hook rejects invalid frontmatter. Task commands: `add task`, `update task [ID]`, `show tasks [filter]`.
359
199
 
360
- #### Token Efficiency
200
+ ### Token Efficiency
361
201
 
362
202
  | Approach | Tokens per session |
363
- |---|---|
203
+ | --- | --- |
364
204
  | Read all memory files | ~5,000–15,000+ |
365
205
  | Semantic search | ~500–2,000 (top 3–5 chunks) |
366
206
 
367
- ---
207
+ ## Knowledge Graph (graphify)
368
208
 
369
- ## πŸ“¦ Versioning
209
+ ```bash
210
+ /graphify # Build a graph for the current directory
211
+ /graphify <path> # Build for a specific path
212
+ /graphify query "How does authentication work?"
213
+ ```
370
214
 
371
- Husky automatically bumps versions on every commit:
215
+ ### Prerequisites
372
216
 
373
- - **Minor** version increments by default: `1.2.0 β†’ 1.3.0`
374
- - **Patch** resets to 0 on each bump
375
- - **Major** changes reset to `<major>.0.0`
217
+ - Python 3.10+ β€” required runtime
218
+ - `graphifyy` Python package β€” `pip install graphifyy` or `uv tool install graphifyy`
219
+ - Optional: Gemini API key (`GEMINI_API_KEY` or `GOOGLE_API_KEY`) β€” faster semantic extraction; without it graphify falls back to Claude subagents
376
220
 
377
- No manual version management required!
221
+ > [GitHub: safishamsi/graphify](https://github.com/safishamsi/graphify) β€” full docs, examples, and source
378
222
 
379
- ---
223
+ ## Featured Skills
380
224
 
381
- ## πŸš€ Publish Flow
225
+ - **Workflow automation:** `architecture-blueprint-generator`, `create-implementation-plan`, `create-readme`, `context-map`, `graphify` (global skill), `graphify-framework-aware`
226
+ - **Development tools:** `playwright-explore-website`, `playwright-generate-test`, `github-issues`, `gh-cli`, `polygot-test-agent`, `microsoft-docs`
227
+ - **Token & efficiency:** `caveman`, `caveman-compress`, `compress`, `caveman-commit`, `cavecrew`, `caveman-stats`
228
+ - **Quality & safety:** `agent-governance`, `conventional-commit`, `git-commit` (OWASP guidance in `.agents/instructions/security-owasp.instructions.md`)
382
229
 
383
- GitHub Actions automatically publishes to npm when merging to `main`.
230
+ ## Versioning
231
+
232
+ Husky auto-bumps versions on every commit: minor by default (`1.2.0 β†’ 1.3.0`), patch resets to 0 on each bump, and major changes reset to `<major>.0.0`. No manual version management required.
384
233
 
385
- ### πŸ”‘ Required Setup
234
+ ## Publish Flow
235
+
236
+ GitHub Actions automatically publishes to npm when merging to `main`.
386
237
 
387
238
  Add `NPM_TOKEN` to GitHub repository secrets:
388
239
 
@@ -392,78 +243,47 @@ Add `NPM_TOKEN` to GitHub repository secrets:
392
243
 
393
244
  **Note:** Publish workflow files (`.github/workflows/`) are excluded from consumer sync to prevent conflicts.
394
245
 
395
- ---
396
-
397
- ## πŸ’» Local Development
246
+ ## Local Development
398
247
 
399
248
  ```bash
400
- # Install dependencies & activate Husky hooks
401
- npm install
402
-
403
- # Verify sync behavior (dry run)
404
- npm run sync -- --dry-run
405
-
406
- # Test package creation
407
- npm pack --json
408
-
409
- # Run Playwright E2E tests
410
- npm test
249
+ npm install # Install dependencies & activate Husky hooks
250
+ npm run sync -- --dry-run # Verify sync behavior (dry run)
251
+ npm pack --json # Test package creation
411
252
 
412
- # Run unit tests (Vitest)
413
- npm run test:unit
253
+ npm test # Playwright E2E tests
254
+ npm run test:unit # Unit tests (Vitest)
255
+ npm run test:unit:coverage # Unit tests with coverage (90% threshold)
256
+ npm run test:unit:watch # Watch mode for unit tests
414
257
 
415
- # Run unit tests with coverage (90% threshold)
416
- npm run test:unit:coverage
417
-
418
- # Watch mode for unit tests
419
- npm run test:unit:watch
420
-
421
- # ─── Memory Bank (Vector Search) ───
422
-
423
- # Build the vector search index (one-time, ~8 min for 5K files)
424
- npm run memory:rebuild
425
-
426
- # Incremental update (seconds β€” only changed files)
427
- npm run memory:update
428
-
429
- # Search project memory
258
+ npm run memory:rebuild # Build the vector index (one-time, ~8 min)
259
+ npm run memory:update # Incremental index update (seconds)
430
260
  npm run memory:search "tdd orchestrator status"
431
-
432
- # Normalize document frontmatter (runs automatically on install)
433
- npm run memory:normalize
261
+ npm run memory:normalize # Normalize frontmatter (runs automatically on install)
434
262
  ```
435
263
 
436
264
  ### Testing
437
265
 
438
266
  | Type | Framework | Command | Coverage |
439
- |------|-----------|---------|----------|
267
+ | --- | --- | --- | --- |
440
268
  | E2E | Playwright | `npm test` | β€” |
441
269
  | Unit | Vitest | `npm run test:unit` | `npm run test:unit:coverage` (β‰₯90%) |
442
270
 
443
- - **E2E tests** live in `tests/*.spec.ts` β€” browser automation via Playwright
444
- - **Unit tests** live in `scripts/*.test.{js,ts}` β€” component tests via Vitest with v8 coverage
445
-
446
- ---
447
-
448
- ## πŸ”„ Updating the Shared Template
449
-
450
- 1. ✏️ Edit files in `.agents/`, `docs/`, or `scripts/`
451
- 2. 🎯 Test changes locally
452
- 3. πŸ’Ύ Commit (triggers auto-version bump)
453
- 4. πŸš€ Merge to `main` (triggers npm publish)
454
- 5. ♻️ Consumers run `npm install` to get updates
455
-
456
- ---
271
+ - E2E tests live in `tests/*.spec.ts` β€” browser automation via Playwright
272
+ - Unit tests live in `scripts/*.test.{js,ts}` β€” component tests via Vitest with v8 coverage
457
273
 
458
- ## πŸ”” Important Notes
274
+ ## Updating the Template
459
275
 
460
- - βš™οΈ Uses `INIT_CWD` to install against consuming project (not package dir)
461
- - πŸ’Ύ Local changes are always preserved unless `--force` is used
462
- - πŸ“– `AGENTS.md` is the main instruction file agents should read
463
- - 🎯 Package assumes public npm registry
464
- - 🎭 Playwright MCP integration documented in `docs/` folder
465
- - πŸͺ Run `npx ai-workflow-setup` after install to configure git hooks (npm v12+ compatible)
276
+ 1. Edit files in `.agents/`, `docs/`, or `scripts/`
277
+ 2. Test changes locally
278
+ 3. Commit (triggers auto-version bump)
279
+ 4. Merge to `main` (triggers npm publish)
280
+ 5. Consumers run `npm install` to get updates
466
281
 
467
- ---
282
+ ## Important Notes
468
283
 
469
- **Happy coding with AI-powered workflows!** πŸ€–βœ¨
284
+ - Uses `INIT_CWD` to install against the consuming project (not the package dir)
285
+ - Local changes are always preserved unless `--force` is used
286
+ - `AGENTS.md` is the main instruction file agents should read
287
+ - Package assumes the public npm registry
288
+ - Playwright MCP integration is documented in `docs/`
289
+ - Run `npx ai-workflow-setup` after install to configure git hooks (npm v12+ compatible)