paqad-ai 0.1.8 → 0.2.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/README.md CHANGED
@@ -7,9 +7,9 @@
7
7
  ╚═╝ ╚═╝ ╚═╝ ╚══▀▀═╝ ╚═╝ ╚═╝╚═════╝
8
8
  ```
9
9
 
10
- **AI agents that think before they type.** paqad-ai reads your codebase, detects your stack, and generates everything your AI coding agents need to actually understand your project — docs, rules, security checks, MCP configs, and structured workflows. One command. No configuration.
10
+ **AI agents that think before they type.** paqad-ai reads your codebase, detects your stack, builds optional hybrid RAG context, and generates the docs, rules, MCP configs, security checks, and workflows your coding agents need to operate with real project context.
11
11
 
12
- [![npm version](https://img.shields.io/npm/v/paqad-ai)](https://npmjs.com/package/paqad-ai) [![license](https://img.shields.io/npm/l/paqad-ai)](./LICENSE) [![website](https://img.shields.io/badge/website-paqad.ai-0A7A5C)](https://paqad.ai)
12
+ [![npm version](https://img.shields.io/npm/v/paqad-ai)](https://npmjs.com/package/paqad-ai) [![license](https://img.shields.io/npm/l/paqad-ai)](./LICENSE) [![website](https://img.shields.io/badge/website-paqad.ai-0A7A5C)](https://paqad.ai) [![docs](https://img.shields.io/badge/docs-paqad.ai-1f6feb)](https://paqad.ai)
13
13
 
14
14
  ---
15
15
 
@@ -17,9 +17,11 @@
17
17
 
18
18
  You install an AI coding agent. You ask it to help with your Laravel + React project. It doesn't know your folder structure, conventions, test runner, or which version of anything you're running.
19
19
 
20
- So you spend an hour writing `CLAUDE.md` by hand. Then you do it again for Cursor. And again for Copilot. And again when your stack changes.
20
+ Then the context problem gets worse: the agent still cannot retrieve the right files when the repo is large, ambiguous, or spread across app code, docs, workflows, and generated artifacts. It guesses. It misses the right modules. It burns tokens on the wrong files.
21
21
 
22
- **paqad-ai does all of this automatically for 9 agents at once.**
22
+ So you spend an hour writing `CLAUDE.md` by hand. Then you do it again for Cursor. And again for Copilot. And again when your stack changes. Then you still have to solve retrieval, documentation drift, and workflow consistency yourself.
23
+
24
+ **paqad-ai solves both setup and retrieval: shared instructions for multiple external agent platforms, plus a built-in multi-agent runtime and optional hybrid RAG for real project context.**
23
25
 
24
26
  ---
25
27
 
@@ -35,11 +37,11 @@ paqad-ai reads your lockfiles, detects your stack, asks you to confirm, and gene
35
37
 
36
38
  ```
37
39
  ✓ Detected: laravel + react (inertia, tailwind, pest, docker)
38
- ✓ Generated: CLAUDE.md, AGENTS.md, GEMINI.md, .cursor/rules/paqad.mdc
40
+ ✓ Generated: CLAUDE.md, AGENTS.md, ANTIGRAVITY.md, GEMINI.md, .cursor/rules/paqad.mdc
39
41
  ✓ Generated: .github/copilot-instructions.md, .windsurfrules
40
- ✓ Generated: docs/instructions/stack/* (6 files)
41
- Generated: docs/instructions/rules/*
42
- ✓ Configured: MCP servers (figma, laravel-boost, tailwind-mcp)
42
+ ✓ Generated: docs/instructions/rules/* and stack-specific tool guides
43
+ Wrote: .paqad/project-profile.yaml, onboarding-manifest.json, detection-report.json
44
+ ✓ Configured: adapter entry files and MCP settings for selected platforms
43
45
 
44
46
  Ready. Your AI agents now understand your project.
45
47
  ```
@@ -52,29 +54,58 @@ npx paqad-ai onboard
52
54
 
53
55
  ---
54
56
 
55
- ## 9 supported agents
57
+ ## Core features
58
+
59
+ | Area | What you get |
60
+ | ------------------------ | ------------------------------------------------------------------------------------ |
61
+ | **Agent onboarding** | Shared instructions and MCP config for supported external agent platforms |
62
+ | **Stack detection** | Lockfile-driven framework, trait, and archetype detection across 9 ecosystems |
63
+ | **Documentation** | Stack, architecture, design-system, registry, and module documentation flows |
64
+ | **Hybrid RAG** | Optional vector indexing, hybrid retrieval, reranking, evals, and benchmarks |
65
+ | **Security** | OWASP-mapped pentest workflow with incremental retests |
66
+ | **Built-in agent roles** | 20 internal specialist roles for routing, review, design, verification, and security |
67
+ | **Context controls** | Chunking, scoring, dedup, summarization, and budget enforcement |
68
+ | **Pack system** | Built-in and custom stack packs for framework-specific behavior |
69
+ | **Operations** | `doctor`, `refresh`, `update`, `patterns`, and capability toggles |
70
+
71
+ ---
72
+
73
+ ## Supported adapters
74
+
75
+ One onboarding. Thin entry files that all point to the same shared instruction bundles:
76
+
77
+ | Platform | What it generates |
78
+ | ---------------------- | ------------------------------------------------------ |
79
+ | **Claude Code** | `CLAUDE.md` + MCP config |
80
+ | **Codex CLI** | `AGENTS.md` + MCP config |
81
+ | **Google Antigravity** | `ANTIGRAVITY.md` + MCP config |
82
+ | **Gemini CLI** | `GEMINI.md` + MCP config |
83
+ | **Junie** | `.junie/AGENTS.md` + `.junie/mcp/mcp.json` |
84
+ | **Cursor** | `.cursor/rules/paqad.mdc` + MCP, skills, agents |
85
+ | **GitHub Copilot** | `.github/copilot-instructions.md` + `.vscode/mcp.json` |
86
+ | **Windsurf** | `.windsurfrules` + MCP, skills, agents |
87
+ | **Continue** | `.continue/rules/paqad.md` + MCP, prompts |
88
+ | **Aider** | `CONVENTIONS.md` (config-only) |
89
+
90
+ Pick one or pick all. `paqad-ai onboard` lets you multi-select. If no `--providers` flag is passed, onboarding defaults to `claude-code`.
56
91
 
57
- One onboarding. Every major AI coding agent. Thin entry files that all point to the same shared instruction bundles:
92
+ ## 20 built-in specialist agents
58
93
 
59
- | Agent | What it generates |
60
- | ------------------ | ------------------------------------------------------ |
61
- | **Claude Code** | `CLAUDE.md` + MCP config |
62
- | **Codex CLI** | `AGENTS.md` + MCP config |
63
- | **Gemini CLI** | `GEMINI.md` + MCP config |
64
- | **Junie** | `.junie/AGENTS.md` + `.junie/mcp/mcp.json` |
65
- | **Cursor** | `.cursor/rules/paqad.mdc` + MCP, skills, agents |
66
- | **GitHub Copilot** | `.github/copilot-instructions.md` + `.vscode/mcp.json` |
67
- | **Windsurf** | `.windsurfrules` + MCP, skills, agents |
68
- | **Continue** | `.continue/rules/paqad.md` + MCP, prompts |
69
- | **Aider** | `CONVENTIONS.md` (config-only) |
94
+ Beyond adapter targets, paqad-ai also ships internal agent roles used by the framework's runtime content, reviews, workflows, and specialized guidance.
70
95
 
71
- Pick one or pick all — `paqad-ai onboard` lets you multi-select. If no `--providers` flag is passed, onboarding defaults to `claude-code`.
96
+ | Group | Count | Examples |
97
+ | ------------------------ | ----- | ---------------------------------------------------------------------------- |
98
+ | **Base workflow agents** | 11 | `router`, `verifier`, `story-designer`, `test-planner`, `product-owner` |
99
+ | **Coding specialists** | 8 | `solution-architect`, `database-expert`, `devops-engineer`, `doc-maintainer` |
100
+ | **Security specialists** | 1 | `security-auditor` |
101
+
102
+ That is **20 built-in agent roles** in the shipped runtime, in addition to the supported external adapters above.
72
103
 
73
104
  ---
74
105
 
75
106
  ## 17 built-in Stack Packs
76
107
 
77
- paqad-ai parses **26 manifest and lockfile formats** across 9 ecosystems. It doesn't ask what stack you use — it reads your lockfiles to figure it out.
108
+ paqad-ai parses manifests and lockfiles across 9 ecosystems. It doesn't ask what stack you use — it reads your repo to figure it out.
78
109
 
79
110
  **14 framework packs:**
80
111
 
@@ -84,7 +115,7 @@ paqad-ai parses **26 manifest and lockfile formats** across 9 ecosystems. It doe
84
115
 
85
116
  `node-cli` · `node-library` · `node-service`
86
117
 
87
- Each pack is a declarative `pack.yaml` that drives detection, documentation, MCP configuration, security mappings, and more. Don't see your framework? [Author your own pack](./docs/framework/authoring-stack-packs.md).
118
+ Each pack is a declarative `pack.yaml` that drives detection, documentation, MCP configuration, security mappings, and more. Don't see your framework? [Author your own pack](./docs/modules/packs/features/authoring/technical.md).
88
119
 
89
120
  **What it reads:**
90
121
 
@@ -128,6 +159,17 @@ Laravel also detects `pest`, `phpunit`, `sail`, `docker`, and `compose` automati
128
159
 
129
160
  paqad-ai isn't just a setup tool. Here's the full feature set:
130
161
 
162
+ ### Stack intelligence and pack resolution
163
+
164
+ Detection is lockfile-first and feeds the rest of the framework. Onboarding, refresh, docs, MCP config, and security workflows all consume the same resolved stack profile and effective pack set.
165
+
166
+ | System | What it does |
167
+ | ----------------------- | -------------------------------------------------------------------------------- |
168
+ | **Framework detection** | Detects frameworks, traits, and archetypes from manifests, lockfiles, and config |
169
+ | **Pack resolution** | Merges built-in, global, and project pack overrides by precedence |
170
+ | **Capability routing** | Activates `content`, `coding`, and `security` based on the effective stack |
171
+ | **Drift tracking** | Stores stack snapshots and reports when the live repo diverges from onboarding |
172
+
131
173
  ### Documentation as a first-class output
132
174
 
133
175
  Docs aren't an afterthought — they're a primary framework output. There's no standalone `document` command. Instead, ask any connected agent to `create documentation` and the workflow:
@@ -182,6 +224,24 @@ Your AI agent has a limited context window. paqad-ai makes every token count:
182
224
  | **Turn summarizer** | Old turns → structured extracts (decisions, files, blockers, next steps). No LLM, pure regex |
183
225
  | **Stream truncator** | Per-tier output limits (fast: 2K, medium: 5K, reasoning: 15K) with sentence-boundary cuts |
184
226
 
227
+ ### Optional hybrid RAG retrieval
228
+
229
+ RAG is optional, but when enabled it plugs directly into the semantic loader instead of living off to the side as a separate experiment.
230
+
231
+ | Feature | What it does |
232
+ | ----------------------- | ------------------------------------------------------------------------------------------- |
233
+ | **Vector index** | Builds an AST-aware code/document index under `.paqad/vectors/` from the chunk index |
234
+ | **Embedding providers** | Supports `local` (default), `openai`, and `voyageai` with provider-specific default models |
235
+ | **Hybrid scoring** | Fuses vector similarity, keyword overlap, symbol hits, and file-path proximity |
236
+ | **Adaptive depth** | Routes retrieval as `none`, `standard`, or `deep` based on task complexity, risk, and scope |
237
+ | **Metadata filtering** | Narrows candidates by extension, module path, framework, and recency with safe fallbacks |
238
+ | **Reranking** | Supports `passthrough`, local cross-encoder reranking, or Cohere reranking |
239
+ | **Pattern vectors** | Extends retrieval with vectorized cross-project patterns from `~/.paqad/patterns/` |
240
+ | **Audit + fallbacks** | Logs build/fallback/provider mismatch events to `.paqad/audit.log` |
241
+ | **Eval gates** | Benchmarks hit@5, task success, correction turns, and prompt-token deltas |
242
+
243
+ RAG configuration lives in `.paqad/project-profile.yaml`. Project-specific corpus exclusions can be tuned with `.paqad/rag.ignore.yaml`, and remote provider keys are stored in `.paqad/secrets.env`.
244
+
185
245
  ### Smart session handoff
186
246
 
187
247
  Structured v2 handoff captures active task, decisions, files, blockers, and next steps. **70–85% smaller** than raw dumps. Both JSON and Markdown.
@@ -216,6 +276,18 @@ Conditional steps, parallel execution, failure handling (`abort` / `skip` / `ret
216
276
 
217
277
  Verified solutions stored globally at `~/.paqad/patterns/`. Scored by framework overlap + keyword match, staleness penalty after 180 days.
218
278
 
279
+ ### Health, refresh, and update workflows
280
+
281
+ The operational side matters too: paqad-ai keeps generated artifacts and project state from quietly drifting.
282
+
283
+ | Workflow | What it does |
284
+ | ---------------- | ----------------------------------------------------------------------------------- |
285
+ | **Doctor** | Validates framework artifacts, copied instructions, MCP config, docs, and RAG state |
286
+ | **Refresh** | Re-detects stack and regenerates stack or design-system outputs |
287
+ | **Update** | Rewrites framework-managed artifacts against the current package version |
288
+ | **Capabilities** | Toggles active capability layers with dependency rules |
289
+ | **Patterns** | Lists, prunes, and exports the global pattern library |
290
+
219
291
  ---
220
292
 
221
293
  ## The capability model
@@ -249,7 +321,7 @@ Full project onboarding. The main command.
249
321
  paqad-ai onboard
250
322
 
251
323
  # Explicit stack and providers
252
- paqad-ai onboard --stack laravel --capability react tailwind --providers claude-code cursor
324
+ paqad-ai onboard --stack laravel --capability react tailwind --providers claude-code antigravity cursor
253
325
 
254
326
  # Flutter with all providers
255
327
  paqad-ai onboard --stack flutter
@@ -275,7 +347,7 @@ paqad-ai onboard --providers windsurf continue
275
347
 
276
348
  **Available `--stack` values:** `laravel`, `flutter`, `react`, `vue`, `django`, `fastapi`, `rails`, `spring-boot`, `express`, `angular`, `svelte`, `astro`, `go-web`, `rust-web`, `short-video`
277
349
 
278
- **Available `--providers`:** `claude-code`, `codex-cli`, `gemini-cli`, `junie`, `cursor`, `github-copilot`, `windsurf`, `continue`, `aider`
350
+ **Available `--providers`:** `claude-code`, `codex-cli`, `antigravity`, `gemini-cli`, `junie`, `cursor`, `github-copilot`, `windsurf`, `continue`, `aider`
279
351
 
280
352
  **Notes:**
281
353
 
@@ -337,67 +409,103 @@ paqad-ai packs validate <path> # Validate a pack before installing
337
409
  paqad-ai packs create <name> # Scaffold a new pack
338
410
  ```
339
411
 
340
- ### Security workflows
412
+ ### `paqad-ai rag`
413
+
414
+ Optional RAG management, indexing, and benchmark tooling.
341
415
 
342
416
  ```bash
343
- paqad-ai pentest # Full scan
344
- paqad-ai pentest --incremental # Only changed files
345
- paqad-ai pentest-retest --source <report> # Re-check prior findings
417
+ paqad-ai rag init # Enable RAG and build the initial vector index
418
+ paqad-ai rag init --provider local # Local embeddings via Xenova/all-MiniLM-L6-v2
419
+ paqad-ai rag init --provider openai # Remote embeddings via text-embedding-3-small
420
+ paqad-ai rag init --provider voyageai # Remote embeddings via voyage-code-3
421
+ paqad-ai rag rebuild # Force a full rebuild
422
+ paqad-ai rag status # Show provider, model, validity, size, chunk count
423
+ paqad-ai rag clear --yes # Delete the vector index and disable RAG
424
+ paqad-ai rag eval # Run deterministic evals on the current index
425
+ paqad-ai rag eval --mode lexical-vs-rag
426
+ paqad-ai rag eval --baseline ./baseline.json --mode rag-vs-candidate
427
+ paqad-ai rag eval --model-graded # Also run the optional model-graded lane
346
428
  ```
347
429
 
430
+ **What `rag init` configures:**
431
+
432
+ - Builds a vector index from the existing chunk index and enables `intelligence.rag_enabled`
433
+ - Persists provider/model selection in `.paqad/project-profile.yaml`
434
+ - Uses a free local model by default, or prompts for `OPENAI_API_KEY` / `VOYAGE_API_KEY` when needed
435
+ - Reuses cached local models under `~/.paqad/models` to avoid repeat downloads
436
+
437
+ **What `rag eval` measures:**
438
+
439
+ - `hit_at_5`
440
+ - `task_success_rate`
441
+ - `correction_turns`
442
+ - `prompt_tokens_sent`
443
+
444
+ Benchmark comparisons support `lexical-vs-rag`, `rag-vs-candidate`, and `feature-off-vs-on`.
445
+
446
+ ### Security workflows
447
+
448
+ Security and retest flows are part of the framework runtime and agent workflows in this package version. They are not exposed as standalone top-level CLI commands in `paqad-ai` today.
449
+
348
450
  ### Pattern library
349
451
 
350
452
  ```bash
351
- paqad-ai patterns list [--domain <d>] [--framework <f>] [--category <c>]
453
+ paqad-ai patterns list [--domain <d>] [--frameworks <f1,f2>] [--category <c>]
352
454
  paqad-ai patterns prune [--older-than <days>]
353
455
  paqad-ai patterns export <output> [--format json|markdown]
354
456
  ```
355
457
 
356
458
  ---
357
459
 
358
- ## What it generates
460
+ ## What paqad-ai manages
359
461
 
360
- ```
462
+ ```text
361
463
  your-project/
362
- ├── CLAUDE.md # docs/instructions/
363
- ├── AGENTS.md # docs/instructions/
364
- ├── GEMINI.md # docs/instructions/
365
- ├── CONVENTIONS.md # Aider
366
- ├── .junie/AGENTS.md # docs/instructions/
367
- ├── .cursor/rules/paqad.mdc # + MCP, skills, agents
368
- ├── .github/copilot-instructions.md # + .vscode/mcp.json
369
- ├── .windsurfrules # + MCP, skills, agents
370
- ├── .continue/rules/paqad.md # + MCP, prompts
464
+ ├── CLAUDE.md # onboarding, if Claude Code is selected
465
+ ├── AGENTS.md # onboarding, if Codex CLI is selected
466
+ ├── ANTIGRAVITY.md # onboarding, if Antigravity is selected
467
+ ├── GEMINI.md # onboarding, if Gemini CLI is selected
468
+ ├── CONVENTIONS.md # onboarding, if Aider is selected
469
+ ├── .junie/AGENTS.md # onboarding, if Junie is selected
470
+ ├── .cursor/rules/paqad.mdc # onboarding, if Cursor is selected
471
+ ├── .github/copilot-instructions.md # onboarding, if GitHub Copilot is selected
472
+ ├── .windsurfrules # onboarding, if Windsurf is selected
473
+ ├── .continue/rules/paqad.md # onboarding, if Continue is selected
371
474
 
372
475
  ├── docs/
373
476
  │ ├── instructions/
374
- │ │ ├── stack/ # Auto-generated stack docs
477
+ │ │ ├── stack/ # generated later by refresh/documentation workflows
375
478
  │ │ │ ├── overview.md
376
479
  │ │ │ ├── frameworks.md
377
480
  │ │ │ ├── dependencies.md
378
481
  │ │ │ ├── tooling.md
379
482
  │ │ │ ├── version-rules.md
483
+ │ │ │ ├── sources.md
380
484
  │ │ │ └── drift-report.md
381
- │ │ ├── rules/ # Conventions, writing style
382
- │ │ ├── tools/ # Stack-specific tool guides
383
- │ │ └── workflows/ # Your custom YAML templates
384
- │ ├── modules/ # Per-feature business + technical docs
385
- │ └── pentest/ # Security reports + retests
485
+ │ │ ├── rules/ # onboarding-generated conventions and writing rules
486
+ │ │ ├── tools/ # onboarding-generated stack tool guides
487
+ │ │ └── workflows/ # user-authored workflow templates
488
+ │ ├── modules/ # generated later by documentation workflows
489
+ │ └── pentest/ # generated later by security workflows
386
490
 
387
491
  └── .paqad/ # Framework metadata (machine-managed)
388
492
  ├── project-profile.yaml
389
493
  ├── stack-snapshot.json
390
494
  ├── stack-drift.json
391
495
  ├── onboarding-manifest.json
496
+ ├── rag.ignore.yaml # Optional RAG corpus include/exclude rules
497
+ ├── secrets.env # Optional API keys for remote RAG providers
498
+ ├── audit.log # Build, fallback, and provider mismatch events
392
499
  ├── doc-progress.json
393
- ├── pentest/runs/
500
+ ├── pentest/runs/ # generated when pentest workflows run
394
501
  ├── session/ # Handoff, budget, dedup stats
395
502
  ├── context/ # Chunk index, load stats
503
+ ├── vectors/ # Optional RAG vector index + metadata
396
504
  ├── cache/ # Transition log, metrics
397
505
  └── workflows/ # Custom workflow run state
398
506
  ```
399
507
 
400
- Entry files stay thin. Knowledge lives in shared instruction bundles that all 9 agents read.
508
+ Entry files stay thin. Knowledge lives in shared instruction bundles that external platforms and built-in runtime roles consume consistently.
401
509
 
402
510
  ---
403
511
 
@@ -409,11 +517,13 @@ Entry files stay thin. Knowledge lives in shared instruction bundles that all 9
409
517
  | **Health check** | `paqad-ai doctor` | Validate artifacts, config, docs |
410
518
  | **Refresh** | `paqad-ai refresh` | Re-detect stack, update derived docs |
411
519
  | **Update** | `paqad-ai update` | Regenerate framework files after version bump |
520
+ | **RAG** | `paqad-ai rag ...` | Build, inspect, clear, and benchmark hybrid retrieval |
412
521
  | **Documentation** | Ask agent: _"create documentation"_ | Stack → architecture → design system → modules |
413
522
  | **Pentest** | Ask agent: _"run pentest"_ | 5-step scan → findings → report |
414
523
  | **Retest** | Ask agent: _"retest pentest"_ | Replay findings → fixed / still-open / needs-verification |
415
524
  | **Capabilities** | `paqad-ai capabilities add/remove` | Toggle content / coding / security |
416
525
  | **Pack management** | `paqad-ai packs install/remove` | Install, validate, scaffold stack packs |
526
+ | **Pattern library** | `paqad-ai patterns ...` | Query, prune, and export reusable solutions |
417
527
  | **Custom workflows** | YAML at `docs/instructions/workflows/` | Your own resumable skill sequences |
418
528
 
419
529
  ---
@@ -431,16 +541,20 @@ Entry files stay thin. Knowledge lives in shared instruction bundles that all 9
431
541
 
432
542
  ```bash
433
543
  pnpm install
434
- pnpm run ci # typecheck lint → format → test (80%+ coverage) → build
544
+ npm run format # required before completion
545
+ npm run ci # required before completion
435
546
  ```
436
547
 
437
548
  ```bash
438
549
  pnpm run test # Tests only
550
+ pnpm run test:coverage # Coverage gate summary
439
551
  pnpm run typecheck # TypeScript checks
440
552
  pnpm run lint # ESLint
441
553
  pnpm run build # Production build
442
554
  ```
443
555
 
556
+ Every completed change in this repo is expected to keep 100% lines, 100% statements, 100% functions, and 100% branches coverage, add positive and negative E2E coverage for changed user flows, and update the owning `docs/modules/**` plus `website/` surfaces when their contract changes.
557
+
444
558
  ---
445
559
 
446
560
  ## Contributing
@@ -449,4 +563,4 @@ Coming soon
449
563
 
450
564
  ---
451
565
 
452
- MIT License · [npm](https://npmjs.com/package/paqad-ai) · [Docs](./docs/framework/specifications.md)
566
+ MIT License · [npm](https://npmjs.com/package/paqad-ai) · [Docs](https://paqad.ai) · [Maintainer Overview](./docs/maintainers/project-overview.md) · [Modules](./docs/modules/README.md)