@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.
- package/.agents/instructions/knowledge-retrieval.instructions.md +69 -0
- package/.agents/instructions/knowledgebase.instructions.md +43 -22
- package/.agents/instructions/learned-knowledge.instructions.md +180 -0
- package/.agents/instructions/memory-schema.instructions.md +22 -0
- package/.husky/pre-commit +1 -0
- package/.opencode/agents/architect.agent.md +1 -0
- package/.opencode/agents/coder.agent.md +1 -1
- package/.opencode/agents/deployer.agent.md +3 -2
- package/.opencode/agents/designer.agent.md +4 -3
- package/.opencode/agents/e2e-tester.agent.md +5 -4
- package/.opencode/agents/implementer.agent.md +1 -0
- package/.opencode/agents/orchestrator/feature-pipeline.agent.md +6 -2
- package/.opencode/agents/orchestrator/orchestrator.agent.md +5 -1
- package/.opencode/agents/orchestrator/tdd-orchestrator.agent.md +7 -1
- package/.opencode/agents/researcher.agent.md +9 -1
- package/.opencode/agents/reviewer.agent.md +2 -0
- package/.opencode/agents/tracker.agent.md +8 -6
- package/.opencode/agents/unit-tester.agent.md +6 -5
- package/README.md +124 -304
- package/memory-bank/.vocabulary.json +125 -31
- package/package.json +1 -1
- package/scripts/mcp-knowledgebase-server.js +85 -19
- package/scripts/mcp-knowledgebase-server.test.js +745 -0
- package/scripts/setup/constants.js +2 -1
- package/scripts/sync.js +1 -0
- package/scripts/sync.test.js +4 -3
- package/scripts/validate-memory-schema.js +28 -3
- package/scripts/validate-memory-schema.test.js +328 -0
- package/scripts/vocab-sync.js +216 -0
- package/scripts/vocab-sync.test.js +814 -0
package/README.md
CHANGED
|
@@ -1,47 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AI Workflow Template
|
|
2
2
|
|
|
3
|
-
|
|
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`
|
|
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
|
-
|
|
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
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
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
|
|
70
|
-
npx ai-workflow-setup --force
|
|
71
|
-
npx ai-workflow-setup --skip-hooks
|
|
72
|
-
npx ai-workflow-setup --skip-sync
|
|
73
|
-
npx ai-workflow-setup --
|
|
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
|
-
>
|
|
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
|
-
##
|
|
53
|
+
## What This Package Does
|
|
89
54
|
|
|
90
|
-
|
|
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
|
-
|
|
65
|
+
## Sync Behavior
|
|
93
66
|
|
|
94
67
|
```bash
|
|
95
|
-
# Preview changes without applying
|
|
96
|
-
npm run sync -- --
|
|
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
|
-
##
|
|
80
|
+
## Core Structure
|
|
114
81
|
|
|
115
|
-
Post-install, your project receives this
|
|
82
|
+
Post-install, your project receives this structure:
|
|
116
83
|
|
|
117
|
-
```
|
|
84
|
+
```text
|
|
118
85
|
.agents/
|
|
119
|
-
βββ
|
|
120
|
-
βββ
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
.
|
|
126
|
-
|
|
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
|
-
|
|
95
|
+
## Multi-Agent Orchestrator
|
|
136
96
|
|
|
137
97
|
### Agents
|
|
138
98
|
|
|
139
99
|
| Agent | File | Role |
|
|
140
|
-
|
|
141
|
-
|
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
244
|
-
/graphify <path>
|
|
137
|
+
## TDD Orchestrator
|
|
245
138
|
|
|
246
|
-
|
|
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
|
-
|
|
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
|
|
272
|
-
| 3 | Coder | GREEN | Writes
|
|
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
|
|
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
|
|
162
|
+
The TDD orchestrator uses `subagent_type "tdd-orchestrator"` and auto-selects the strict pipeline when testable code changes are requested.
|
|
290
163
|
|
|
291
|
-
|
|
164
|
+
## Memory Bank
|
|
292
165
|
|
|
293
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
215
|
+
### Prerequisites
|
|
372
216
|
|
|
373
|
-
-
|
|
374
|
-
-
|
|
375
|
-
-
|
|
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
|
-
|
|
221
|
+
> [GitHub: safishamsi/graphify](https://github.com/safishamsi/graphify) β full docs, examples, and source
|
|
378
222
|
|
|
379
|
-
|
|
223
|
+
## Featured Skills
|
|
380
224
|
|
|
381
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
#
|
|
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
|
-
#
|
|
416
|
-
npm run
|
|
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
|
-
-
|
|
444
|
-
-
|
|
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
|
-
##
|
|
274
|
+
## Updating the Template
|
|
459
275
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
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
|
-
|
|
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)
|