@valentia-ai-skills/framework 2.0.1 → 2.0.3

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
@@ -1,7 +1,6 @@
1
1
  # AI Skills Framework
2
2
 
3
- Centralized coding standards, security patterns, and SOPs for AI-assisted development.
4
- Welcome to Version 1.0.2 Dated 20th March 2026
3
+ Centralized coding standards, security patterns, agents, commands, hooks, rules, and MCP server configs for AI-assisted development — distributed as a single npm package.
5
4
 
6
5
  **One install. All AI tools. Every team follows the same rules.**
7
6
 
@@ -11,30 +10,93 @@ Welcome to Version 1.0.2 Dated 20th March 2026
11
10
  # Install
12
11
  npm install --save-dev @valentia-ai-skills/framework
13
12
 
14
- # Setup (auto-detects your AI tools)
13
+ # Setup (auto-detects your AI tools + project languages)
15
14
  npx ai-skills setup
16
15
 
17
16
  # Done. Your AI tools now follow your org's standards.
18
17
  ```
19
18
 
20
- ## What It Does
19
+ Setup will ask for your work email, send a verification code, then fetch and install your team's full toolkit.
21
20
 
22
- This package installs your organization's coding standards into whatever AI coding tool your team uses:
21
+ ---
23
22
 
23
+ ## What Gets Installed
24
24
 
25
- | AI Tool | What Gets Created |
26
- |---------|------------------|
27
- | **Claude Code** | Individual skill folders in `.claude/skills/` |
28
- | **Cursor** | Merged rules file at `.cursor/rules/ai-skills.mdc` |
29
- | **GitHub Copilot** | Merged rules at `.github/copilot-instructions.md` |
30
- | **Windsurf** | Merged rules at `.windsurfrules` |
31
- | **Any other tool** | Generic `.ai-rules` file |
25
+ The framework delivers **6 entity types** to your project, managed centrally through the Skills Console:
32
26
 
33
- The CLI auto-detects which tools you're using and installs the right format.
27
+ | Entity | What It Is | Claude Code Location | Other Tools |
28
+ |--------|-----------|---------------------|-------------|
29
+ | **Skills** | Coding standards & patterns (markdown instructions) | `.claude/skills/{name}/SKILL.md` | Merged into rules file |
30
+ | **Agents** | Pre-configured AI agent definitions with model, tools, instructions | `.claude/agents/{name}.md` | `ai-agents.mdc` |
31
+ | **Commands** | Slash commands (`/command-name`) for common workflows | `.claude/commands/{name}.md` | `ai-commands.mdc` |
32
+ | **Hooks** | Event-driven scripts that run on tool actions (pre/post) | `.claude/settings.local.json` + `.ai-skills/hooks/` | Claude Code only |
33
+ | **Rules** | Language-specific coding rules (auto-detected by project) | `.claude/rules/{name}.md` | `ai-rules.mdc` |
34
+ | **MCP Configs** | MCP server configurations (npx, docker, uvx) | `.claude/mcp-servers.json` | `ai-mcp-configs.md` |
34
35
 
35
- ## Included Skills
36
+ ---
36
37
 
37
- ### Global (all teams)
38
+ ## Supported AI Tools
39
+
40
+ The CLI auto-detects which tools you're using and writes the correct format:
41
+
42
+ | AI Tool | Format | Output Path |
43
+ |---------|--------|-------------|
44
+ | **Claude Code** | Individual files per entity | `.claude/skills/`, `.claude/agents/`, `.claude/commands/`, `.claude/rules/`, `.claude/settings.local.json`, `.claude/mcp-servers.json` |
45
+ | **Cursor** | Merged rules files | `.cursor/rules/ai-skills.mdc`, `.cursor/rules/ai-agents.mdc`, etc. |
46
+ | **GitHub Copilot** | Merged rules files | `.github/copilot-instructions.md` + related files |
47
+ | **Windsurf** | Merged rules file | `.windsurfrules` |
48
+ | **Any other tool** | Generic fallback | `.ai-rules` |
49
+
50
+ ---
51
+
52
+ ## CLI Commands
53
+
54
+ ```bash
55
+ npx ai-skills setup # First-time setup — email verification → install toolkit
56
+ npx ai-skills update # Re-fetch and reinstall latest toolkit from your team
57
+ npx ai-skills status # Show installed entities, team info, detected tools
58
+ npx ai-skills list # List locally bundled skills
59
+ npx ai-skills analyze # Analyze staged/last commit against active skills
60
+ npx ai-skills analyze --last # Analyze the most recent commit
61
+ npx ai-skills doctor # Health check (config, API, tools, entity counts)
62
+ npx ai-skills help # Show help
63
+ ```
64
+
65
+ #### Legacy Codebase Intelligence Scanner
66
+
67
+ ```bash
68
+ # Upload a legacy codebase intelligence package to your team's Skills Console
69
+ npx ai-skills upload-legacy-scan --path ./my-project-intelligence/
70
+
71
+ # Validate the package payload without uploading (dry run)
72
+ npx ai-skills upload-legacy-scan --path ./my-project-intelligence/ --dry-run
73
+
74
+ # Supply an explicit auth token instead of going through OTP
75
+ npx ai-skills upload-legacy-scan --path ./my-project-intelligence/ --token <your-token>
76
+ ```
77
+
78
+ The `--path` directory must contain a `manifest.json` file. See the [Legacy Scanner](#legacy-codebase-intelligence-scanner) section below for the required format.
79
+
80
+ ### Environment Variables
81
+
82
+ | Variable | Purpose |
83
+ |----------|---------|
84
+ | `AI_SKILLS_API_URL` | Override the Supabase Edge Function URL |
85
+ | `AI_SKILLS_ANALYZE_URL` | Override the analyze commit function URL |
86
+ | `AI_SKILLS_SCAN_URL` | Override the scan results function URL |
87
+ | `AI_SKILLS_UPLOAD_LEGACY_URL` | Override the upload-legacy-scan Edge Function URL |
88
+
89
+ ---
90
+
91
+ ## Entity Types in Detail
92
+
93
+ ### Skills
94
+
95
+ Markdown-based coding standards that tell AI tools what conventions to follow. They never touch your application code.
96
+
97
+ **Scopes:** `global` (all teams), `stack` (tech-specific), `project` (single project)
98
+
99
+ **Bundled global skills:**
38
100
  - **code-standards** — Naming, file structure, formatting, error handling
39
101
  - **git-workflow** — Branching, commits, PRs, releases
40
102
  - **security-baseline** — Auth, validation, secrets, XSS, SQL injection
@@ -43,50 +105,115 @@ The CLI auto-detects which tools you're using and installs the right format.
43
105
  - **documentation** — READMEs, API docs, ADRs, changelogs, runbooks
44
106
  - **deployment** — CI/CD, Docker, environments, rollback, feature flags
45
107
 
46
- ### Stack-specific
108
+ **Bundled stack skills:**
47
109
  - **react** — Components, hooks, state management, performance
48
110
  - **react-native** — Navigation, FlatList, offline-first, platform code
49
111
  - **node-backend** — Layered architecture, DI, error handling, health checks
50
112
  - **python-backend** — FastAPI, Pydantic, async patterns, pytest
51
113
  - **devops** — Terraform, Kubernetes, monitoring, SLOs, alerting
52
114
 
53
- ## Commands
115
+ ### Agents
54
116
 
55
- ```bash
56
- npx ai-skills setup # First-time setup
57
- npx ai-skills update # Update to latest skills
58
- npx ai-skills status # Check what's installed
59
- npx ai-skills list # Show all available skills
60
- npx ai-skills doctor # Health check
117
+ Pre-configured AI agent definitions with model preferences, allowed tools, max turns, and detailed instructions.
118
+
119
+ ```
120
+ # Example: installed to .claude/agents/code-reviewer.md
121
+ ---
122
+ name: code-reviewer
123
+ description: Senior code reviewer agent
124
+ model: opus
125
+ tools: ["Read", "Grep", "Glob"]
126
+ max_turns: 10
127
+ ---
128
+
129
+ Review the code for security vulnerabilities, performance issues...
61
130
  ```
62
131
 
63
- ## Updating
132
+ ### Commands
64
133
 
65
- ```bash
66
- # Update the package
67
- npm update @valentia-ai-skills/framework
134
+ Slash commands that developers can invoke (e.g., `/review-pr`, `/generate-tests`). Each command has instructions and can optionally reference an agent.
135
+
136
+ ```
137
+ # Example: installed to .claude/commands/review-pr.md
138
+ ---
139
+ name: review-pr
140
+ description: Review the current pull request
141
+ agent: code-reviewer
142
+ ---
143
+
144
+ Analyze the current PR diff and provide feedback on...
145
+ ```
146
+
147
+ ### Hooks
148
+
149
+ Event-driven scripts for Claude Code that run before or after specific tool actions. Supports all Claude Code hook events:
150
+
151
+ | Event | When It Fires |
152
+ |-------|--------------|
153
+ | `PreToolUse` | Before a tool is executed |
154
+ | `PostToolUse` | After a tool completes |
155
+ | `Notification` | When a notification is sent |
156
+ | `Stop` | When the agent stops |
157
+ | `SubagentStop` | When a subagent stops |
158
+ | `PreCompact` | Before context compaction |
159
+ | `PostCompact` | After context compaction |
160
+
161
+ Hooks are installed to `.claude/settings.local.json` with scripts saved to `.ai-skills/hooks/`.
162
+
163
+ ### Rules
164
+
165
+ Language-specific coding rules that are **auto-detected** based on your project. The CLI scans for language markers (e.g., `tsconfig.json` for TypeScript, `go.mod` for Go) and only installs rules matching your detected languages.
166
+
167
+ **Supported languages for auto-detection:** TypeScript, JavaScript, Python, Go, Rust, Java, Kotlin, Swift, PHP, C#, C++
68
168
 
69
- # Refresh the installed skills
70
- npx ai-skills update
71
169
  ```
170
+ # Example: installed to .claude/rules/typescript-strict.md
171
+ Use strict TypeScript — avoid `any`, prefer explicit return types...
172
+ ```
173
+
174
+ ### MCP Configs
175
+
176
+ MCP (Model Context Protocol) server configurations. Templates are merged into `.claude/mcp-servers.json` without overwriting existing user configs.
177
+
178
+ **Server types:** `npx`, `node`, `uvx`, `docker`, `command`
179
+
180
+ ```json
181
+ // Example: merged into .claude/mcp-servers.json
182
+ {
183
+ "mcpServers": {
184
+ "github": {
185
+ "command": "npx",
186
+ "args": ["-y", "@modelcontextprotocol/server-github"],
187
+ "env": { "GITHUB_TOKEN": "{{GITHUB_TOKEN}}" }
188
+ }
189
+ }
190
+ }
191
+ ```
192
+
193
+ Required environment variables are flagged during installation — you must fill in `{{PLACEHOLDER}}` values.
194
+
195
+ ---
72
196
 
73
197
  ## How It Works
74
198
 
75
199
  1. **Install** — `npm install` adds the package to your project
76
- 2. **Setup** — `npx ai-skills setup` detects your AI tools and writes config files
77
- 3. **Code** — When you use any AI coding tool, it reads those config files and follows the rules
78
- 4. **Update** — `npm update` + `npx ai-skills update` refreshes everything
200
+ 2. **Setup** — `npx ai-skills setup` asks for your email, verifies via OTP, fetches your team's toolkit
201
+ 3. **Install** — The CLI detects your AI tools and project languages, then writes config files in the correct format
202
+ 4. **Code** — When you use any AI coding tool, it reads those config files and follows the rules
203
+ 5. **Update** — `npm update` + `npx ai-skills update` re-verifies and refreshes everything
79
204
 
80
- The skills never touch your application code. They only tell AI tools what conventions to follow.
205
+ The toolkit is managed centrally through the **Skills Console** (admin dashboard). Team leads assign which entities each team gets.
206
+
207
+ ---
81
208
 
82
209
  ## For Team Leads
83
210
 
84
- Add this to your project's `package.json` so every developer gets the skills on `npm install`:
211
+ Add this to your project's `package.json` so every developer gets the toolkit on `npm install`:
85
212
 
86
213
  ```json
87
214
  {
88
215
  "devDependencies": {
89
- "@valentia-ai-skills/framework": "^1.0.0"
216
+ "@valentia-ai-skills/framework": "^2.0.0"
90
217
  },
91
218
  "scripts": {
92
219
  "postinstall": "npx ai-skills setup"
@@ -94,12 +221,161 @@ Add this to your project's `package.json` so every developer gets the skills on
94
221
  }
95
222
  ```
96
223
 
97
- Now every `git clone` + `npm install` automatically configures AI skills.
224
+ Now every `git clone` + `npm install` automatically configures the full AI toolkit.
225
+
226
+ ---
227
+
228
+ ## Configuration
229
+
230
+ After setup, a `.ai-skills.json` config file tracks your preferences:
231
+
232
+ ```json
233
+ {
234
+ "version": "2.0.0",
235
+ "email": "dev@company.com",
236
+ "team": "frontend-team",
237
+ "project": "my-app",
238
+ "source": "supabase",
239
+ "detectedLanguages": ["typescript", "javascript"],
240
+ "tools": ["claude-code", "cursor"],
241
+ "skills": [{ "name": "code-standards", "scope": "global", "version": "1.0" }],
242
+ "agents": [{ "name": "code-reviewer", "scope": "global", "version": "1.0" }],
243
+ "commands": [{ "name": "review-pr", "scope": "global", "version": "1.0" }],
244
+ "hooks": [{ "name": "lint-check", "scope": "global", "version": "1.0" }],
245
+ "rules": [{ "name": "ts-strict", "scope": "stack", "version": "1.0", "language": "typescript" }],
246
+ "mcpConfigs": [{ "name": "github", "scope": "global", "version": "1.0" }]
247
+ }
248
+ ```
249
+
250
+ The generated config files can be committed to git so the whole team shares the same setup.
251
+
252
+ ---
253
+
254
+ ## Commit Analysis
255
+
256
+ The framework includes AI-powered commit analysis that scores your code against active skills:
257
+
258
+ ```bash
259
+ # Analyze staged changes or last commit
260
+ npx ai-skills analyze
261
+
262
+ # Analyze the most recent commit explicitly
263
+ npx ai-skills analyze --last
264
+ ```
265
+
266
+ Results include per-skill scores, passed/failed checks, and improvement suggestions.
267
+
268
+ A post-commit git hook is automatically installed during setup to run analysis after each commit.
269
+
270
+ ---
271
+
272
+ ## Legacy Codebase Intelligence Scanner
273
+
274
+ The framework supports ingesting intelligence packages generated by legacy codebase scanners. Once uploaded, the extracted skills, architecture diagrams, and reports become reviewable in the **Skills Console** under the **Legacy Scanners** section.
275
+
276
+ ### How It Works
277
+
278
+ 1. **Scan** — A compatible scanner tool analyses an existing codebase and produces an intelligence folder
279
+ 2. **Upload** — `npx ai-skills upload-legacy-scan --path <folder>` packages and ships the output to your team's console
280
+ 3. **Review** — Tech leads review auto-generated skills, approve or request revisions per skill, and publish approved skills into the active toolkit
281
+ 4. **Rescan** — Re-running the upload on the same project name appends a new version, preserving history
282
+
283
+ ### Intelligence Package Format
284
+
285
+ The folder passed to `--path` must follow this layout:
286
+
287
+ ```
288
+ my-project-intelligence/
289
+ ├── manifest.json # Required — project metadata + statistics
290
+ ├── skills/ # Required — one SKILL.md per extracted skill
291
+ │ ├── auth-patterns.md
292
+ │ ├── api-conventions.md
293
+ │ └── ...
294
+ ├── diagrams/ # Optional — Mermaid (.mmd) architecture diagrams
295
+ │ ├── system-overview.mmd
296
+ │ └── data-flow.mmd
297
+ └── reports/ # Optional — markdown reports
298
+ ├── api-registry.md
299
+ ├── business-rules.md
300
+ ├── risk-assessment.md
301
+ └── reproduction-guide.md
302
+ ```
303
+
304
+ **`manifest.json` schema:**
305
+
306
+ ```json
307
+ {
308
+ "project_name": "legacy-billing-service",
309
+ "tech_stack": ["Node.js", "PostgreSQL", "React"],
310
+ "statistics": {
311
+ "module_count": 24,
312
+ "total_endpoints": 68,
313
+ "total_business_rules": 142,
314
+ "completeness_score": 78
315
+ }
316
+ }
317
+ ```
318
+
319
+ ### Skills Console — Legacy Scanners View
320
+
321
+ After upload, each project appears in the **Legacy Scanners** section of the Skills Console with:
98
322
 
99
- ## Customization
323
+ - **Overview** — project stats, completeness score, tech stack
324
+ - **Modules** — per-skill approval workflow (approve / needs revision)
325
+ - **API Registry** — searchable endpoint documentation
326
+ - **Business Rules** — searchable rule catalogue
327
+ - **Architecture** — interactive Mermaid diagrams
328
+ - **Risk Report** — severity-categorised risk sections
329
+ - **Reproduction Guide** — interactive onboarding checklist
100
330
 
101
- After setup, a `.ai-skills.json` config file tracks your preferences. The generated rules files can be committed to git so the whole team shares the same setup.
331
+ Approved skills are promoted into the team's standard toolkit and distributed on the next `npx ai-skills update`.
332
+
333
+ ---
334
+
335
+ ## Architecture
336
+
337
+ ```
338
+ ┌──────────────────────────────────────────────────────────────┐
339
+ │ Skills Console │
340
+ │ Admin Dashboard — Skills, Agents, Commands, Hooks, │
341
+ │ Rules, MCP Configs, Legacy Scanners │
342
+ │ Teams → assign entities → per-team toolkit │
343
+ └────────────────┬────────────────────────┬────────────────────┘
344
+ │ lookup-team │ upload-legacy-scan
345
+ │ (Edge Function) │ (Edge Function)
346
+ ▼ ▼
347
+ ┌────────────────────────────┐ ┌────────────────────────────┐
348
+ │ CLI (npx ai-skills) │ │ Legacy Codebase Scanner │
349
+ │ Email OTP → fetch toolkit │ │ Scans codebase → produces │
350
+ │ → install to AI tools │ │ intelligence package │
351
+ └──────────────┬─────────────┘ └──────────────┬─────────────┘
352
+ │ │
353
+ │ npx ai-skills │
354
+ │ upload-legacy-scan │
355
+ ▼ ▼
356
+ ┌────────────────────────┐ Skills Console → Review → Approve
357
+ │ Claude Code │ → promoted into team toolkit
358
+ │ Cursor │
359
+ │ GitHub Copilot │
360
+ │ Windsurf │
361
+ └────────────────────────┘
362
+ ```
363
+
364
+ ---
365
+
366
+ ## Requirements
367
+
368
+ - Node.js >= 18
369
+ - Zero runtime dependencies — the CLI is pure Node.js
370
+
371
+ ---
102
372
 
103
373
  ## Contributing
104
374
 
105
- To add or modify skills, edit the SKILL.md files in the `skills/` directory and publish a new package version.
375
+ To add or modify skills, edit the `SKILL.md` files in the `skills/` directory and publish a new version. For full entity management (agents, commands, hooks, rules, MCP configs), use the Skills Console.
376
+
377
+ ---
378
+
379
+ ## License
380
+
381
+ MIT — Valentia AI