@harshitj183/ai-skills 2.2.5 → 2.2.8
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 +29 -157
- package/SKILL.md +162 -104
- package/history/CONTEXT.md +15 -0
- package/index.js +8 -0
- package/package.json +38 -56
- package/registry/skill_bank.json +1039 -0
- package/roles/backend_expert.md +23 -20
- package/roles/code_reviewer.md +28 -0
- package/roles/frontend_expert.md +30 -27
- package/roles/gpt5_core.md +34 -31
- package/roles/hinglish_native.md +30 -0
- package/roles/product_manager.md +24 -21
- package/roles/security_auditor.md +31 -19
- package/roles/subagent_orchestrator.md +26 -0
- package/roles/technical_writer.md +25 -22
- package/roles/ui_ux_designer.md +22 -19
- package/roles/wisdom_extractor.md +29 -26
- package/skills/ai_history_maintenance.md +46 -36
- package/skills/anthropic_documents.md +16 -13
- package/skills/antigravity_mastery.md +15 -12
- package/skills/azure_graph_integrator.md +12 -9
- package/skills/coderabbit_review.md +36 -0
- package/skills/composio_integrator.md +16 -13
- package/skills/github_automation.md +17 -14
- package/skills/hashicorp_terraform.md +16 -13
- package/skills/letta_agent_memory.md +15 -12
- package/skills/lifecycle/brainstorming.md +58 -0
- package/skills/lifecycle/review_protocol.md +36 -0
- package/skills/mcp_master.md +17 -14
- package/skills/memory_cycle.md +45 -0
- package/skills/openai_structured_outputs.md +12 -9
- package/skills/orchestration/external_skill_retrieval.md +46 -0
- package/skills/orchestration/parallel_agent_dispatcher.md +38 -0
- package/skills/orchestration/plan_architect.md +32 -0
- package/skills/orchestration/plan_executor.md +34 -0
- package/skills/playwright_testing.md +15 -12
- package/skills/progressive_disclosure.md +26 -0
- package/skills/prompt_reasoning_trees.md +12 -9
- package/skills/react_best_practices.md +16 -13
- package/skills/react_native_performance.md +16 -13
- package/skills/sanity_architecture.md +16 -13
- package/skills/stripe_integration.md +17 -14
- package/skills/supabase_architect.md +17 -14
- package/skills/systematic_debugging.md +34 -0
- package/skills/tdd_mastery.md +32 -0
- package/skills/vercel_cloudflare_deploy.md +17 -14
- package/skills/writing_skills.md +26 -0
- package/LICENSE +0 -21
- package/bin/cli.js +0 -294
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "React & Next.js Best Practices Master"
|
|
3
|
-
description: "Vercel's official guidelines for React Server Components, Suspense, and Composition."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# React Server Components (RSC)
|
|
7
|
-
1. **Default to Server:** Every component without `useState`, `useEffect`, or DOM events should remain a Server Component.
|
|
8
|
-
2. **Client Boundaries:** Push `"use client"` as low down the component tree as possible. Only wrap interactive islands, never the entire page layout.
|
|
9
|
-
3. **Data Fetching:** Fetch data on the Server Component level and pass it down as props. Do not use `useEffect` for data fetching unless absolutely necessary for infinite polling.
|
|
10
|
-
|
|
11
|
-
# Composition Patterns
|
|
12
|
-
- **Do not drill props excessively:** If passing props more than 3 levels deep, use React Context or Composition (passing `children` or JSX slots).
|
|
13
|
-
- **Suspense Wrappers:** Always wrap async Server Components with `<Suspense fallback={<Skeleton />}>` to prevent blocking the entire UI stream.
|
|
1
|
+
---
|
|
2
|
+
name: "React & Next.js Best Practices Master"
|
|
3
|
+
description: "Vercel's official guidelines for React Server Components, Suspense, and Composition."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# React Server Components (RSC)
|
|
7
|
+
1. **Default to Server:** Every component without `useState`, `useEffect`, or DOM events should remain a Server Component.
|
|
8
|
+
2. **Client Boundaries:** Push `"use client"` as low down the component tree as possible. Only wrap interactive islands, never the entire page layout.
|
|
9
|
+
3. **Data Fetching:** Fetch data on the Server Component level and pass it down as props. Do not use `useEffect` for data fetching unless absolutely necessary for infinite polling.
|
|
10
|
+
|
|
11
|
+
# Composition Patterns
|
|
12
|
+
- **Do not drill props excessively:** If passing props more than 3 levels deep, use React Context or Composition (passing `children` or JSX slots).
|
|
13
|
+
- **Suspense Wrappers:** Always wrap async Server Components with `<Suspense fallback={<Skeleton />}>` to prevent blocking the entire UI stream.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
⚡ Smart AI Skills Library | v2.2.8 | Active
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "React Native Performance"
|
|
3
|
-
description: "Rules for Expo, React Native upgrades, and mobile UI rendering."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Rendering Optimization
|
|
7
|
-
1. **Avoid Anonymous Functions in Renders:** Pass memoized functions down to child components to prevent excessive re-rendering.
|
|
8
|
-
2. **Lists:** Use `@shopify/flash-list` over standard `FlatList` for massive performance gains in large lists.
|
|
9
|
-
3. **Images:** Pre-fetch and cache images robustly using `expo-image` over native Image.
|
|
10
|
-
|
|
11
|
-
# Upgrading Guidelines
|
|
12
|
-
- Never upgrade React Native manually by directly editing `package.json` blindly. Always consult the official React Native Upgrade Helper for native iOS/Android code changes.
|
|
13
|
-
- In Expo, strictly follow `npx expo install --fix` policies.
|
|
1
|
+
---
|
|
2
|
+
name: "React Native Performance"
|
|
3
|
+
description: "Rules for Expo, React Native upgrades, and mobile UI rendering."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Rendering Optimization
|
|
7
|
+
1. **Avoid Anonymous Functions in Renders:** Pass memoized functions down to child components to prevent excessive re-rendering.
|
|
8
|
+
2. **Lists:** Use `@shopify/flash-list` over standard `FlatList` for massive performance gains in large lists.
|
|
9
|
+
3. **Images:** Pre-fetch and cache images robustly using `expo-image` over native Image.
|
|
10
|
+
|
|
11
|
+
# Upgrading Guidelines
|
|
12
|
+
- Never upgrade React Native manually by directly editing `package.json` blindly. Always consult the official React Native Upgrade Helper for native iOS/Android code changes.
|
|
13
|
+
- In Expo, strictly follow `npx expo install --fix` policies.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
⚡ Smart AI Skills Library | v2.2.8 | Active
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "Sanity CMS Architect"
|
|
3
|
-
description: "Guidelines for scalable content modeling, GROQ, and Answer Engine Optimization (AEO)."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Content Modeling
|
|
7
|
-
1. **Never use deep nesting for core content:** Break massive documents down into discrete `document` types and link them with `reference` types to maximize query flexibility.
|
|
8
|
-
2. **GROQ Projections:** Never use raw `*[_type == "post"]` without projections. Always map out specifically what the frontend needs: `*[_type == "post"] { title, slug, "authorName": author->name }`.
|
|
9
|
-
3. **Draft States:** Account for draft filtering. By default, ensure `!(_id in path("drafts.**"))` is applied to production API endpoint fetchers unless explicit Preview modes are active.
|
|
10
|
-
|
|
11
|
-
# SEO & AEO Patterns
|
|
12
|
-
- Embed rich schemas (JSON-LD) dynamically based on structured portable text arrays.
|
|
13
|
-
- Precompute image dimensions and `.lqip` blur hashes directly in GROQ so the UI never experiences Cumulative Layout Shift (CLS).
|
|
1
|
+
---
|
|
2
|
+
name: "Sanity CMS Architect"
|
|
3
|
+
description: "Guidelines for scalable content modeling, GROQ, and Answer Engine Optimization (AEO)."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Content Modeling
|
|
7
|
+
1. **Never use deep nesting for core content:** Break massive documents down into discrete `document` types and link them with `reference` types to maximize query flexibility.
|
|
8
|
+
2. **GROQ Projections:** Never use raw `*[_type == "post"]` without projections. Always map out specifically what the frontend needs: `*[_type == "post"] { title, slug, "authorName": author->name }`.
|
|
9
|
+
3. **Draft States:** Account for draft filtering. By default, ensure `!(_id in path("drafts.**"))` is applied to production API endpoint fetchers unless explicit Preview modes are active.
|
|
10
|
+
|
|
11
|
+
# SEO & AEO Patterns
|
|
12
|
+
- Embed rich schemas (JSON-LD) dynamically based on structured portable text arrays.
|
|
13
|
+
- Precompute image dimensions and `.lqip` blur hashes directly in GROQ so the UI never experiences Cumulative Layout Shift (CLS).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
⚡ Smart AI Skills Library | v2.2.8 | Active
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "Stripe Integrator"
|
|
3
|
-
description: "Stripe payments and webhook best practices."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Webhook Handling
|
|
7
|
-
1. **Verification:** Always verify webhook signatures using `stripe.webhooks.constructEvent(RawBody, Signature, Secret)`. Never trust unverified payloads.
|
|
8
|
-
2. **Idempotency:** Implement idempotency keys for all charge or subscription mutations.
|
|
9
|
-
3. **Status Checks:** Assume webhooks can arrive out of order. Validate timestamps.
|
|
10
|
-
|
|
11
|
-
# Integration Rules
|
|
12
|
-
- Use Stripe Checkout instead of custom card elements unless highly specific UI is needed.
|
|
13
|
-
- Listen for `checkout.session.completed` for fulfillment.
|
|
14
|
-
- Manage subscriptions via `customer.subscription.updated` / `deleted`. Do not rely solely on the success return URL.
|
|
1
|
+
---
|
|
2
|
+
name: "Stripe Integrator"
|
|
3
|
+
description: "Stripe payments and webhook best practices."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Webhook Handling
|
|
7
|
+
1. **Verification:** Always verify webhook signatures using `stripe.webhooks.constructEvent(RawBody, Signature, Secret)`. Never trust unverified payloads.
|
|
8
|
+
2. **Idempotency:** Implement idempotency keys for all charge or subscription mutations.
|
|
9
|
+
3. **Status Checks:** Assume webhooks can arrive out of order. Validate timestamps.
|
|
10
|
+
|
|
11
|
+
# Integration Rules
|
|
12
|
+
- Use Stripe Checkout instead of custom card elements unless highly specific UI is needed.
|
|
13
|
+
- Listen for `checkout.session.completed` for fulfillment.
|
|
14
|
+
- Manage subscriptions via `customer.subscription.updated` / `deleted`. Do not rely solely on the success return URL.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
⚡ Smart AI Skills Library | v2.2.8 | Active
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "Supabase Architect"
|
|
3
|
-
description: "Supabase & PostgreSQL security, migrations, and best practices."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Database Guidelines
|
|
7
|
-
1. **Migrations First:** Never execute destructive raw SQL via editors. Always use `supabase migration new` and apply via `supabase db push`.
|
|
8
|
-
2. **Row Level Security (RLS):** Every table MUST have `ENABLE ROW LEVEL SECURITY`. Default to denying all access, then specify explicit `CREATE POLICY` for `SELECT`, `INSERT`, `UPDATE`, `DELETE`.
|
|
9
|
-
3. **Indexing:** Add indices for any column used frequently in `WHERE` clauses, foreign keys, or `ORDER BY`.
|
|
10
|
-
|
|
11
|
-
# Edge Functions
|
|
12
|
-
- Always use standard Deno environments for Edge Functions.
|
|
13
|
-
- Validate JWTs heavily (use `verify_jwt: true` default).
|
|
14
|
-
- Don't deploy bloated dependencies; prefer standard libraries.
|
|
1
|
+
---
|
|
2
|
+
name: "Supabase Architect"
|
|
3
|
+
description: "Supabase & PostgreSQL security, migrations, and best practices."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Database Guidelines
|
|
7
|
+
1. **Migrations First:** Never execute destructive raw SQL via editors. Always use `supabase migration new` and apply via `supabase db push`.
|
|
8
|
+
2. **Row Level Security (RLS):** Every table MUST have `ENABLE ROW LEVEL SECURITY`. Default to denying all access, then specify explicit `CREATE POLICY` for `SELECT`, `INSERT`, `UPDATE`, `DELETE`.
|
|
9
|
+
3. **Indexing:** Add indices for any column used frequently in `WHERE` clauses, foreign keys, or `ORDER BY`.
|
|
10
|
+
|
|
11
|
+
# Edge Functions
|
|
12
|
+
- Always use standard Deno environments for Edge Functions.
|
|
13
|
+
- Validate JWTs heavily (use `verify_jwt: true` default).
|
|
14
|
+
- Don't deploy bloated dependencies; prefer standard libraries.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
⚡ Smart AI Skills Library | v2.2.8 | Active
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Systematic Debugging"
|
|
3
|
+
description: "Expert-level problem isolation and precision debugging methodologies."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 1. The Wolf-Fence Algorithm
|
|
7
|
+
Search for bugs by bisecting the system:
|
|
8
|
+
|
|
9
|
+
```mermaid
|
|
10
|
+
graph TD;
|
|
11
|
+
A[Identify Symptom] --> B[Draw Boundary];
|
|
12
|
+
B --> C{Bug Is Here?};
|
|
13
|
+
C -- Yes --> D[Divide and Conquer (Repeat)];
|
|
14
|
+
C -- No --> E[Widen Scope];
|
|
15
|
+
D --> F[Identify Root Cause];
|
|
16
|
+
F --> G[Verify Fix];
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
# 2. Precision Mapping
|
|
20
|
+
- **Log Mining**: Capture and analyze application and environment logs.
|
|
21
|
+
- **Trace Analysis**: Trace data flow step-by-step from input to error.
|
|
22
|
+
- **Isolated Testing**: Create a minimal reproduction environment (MRE) that exists outside the main project context.
|
|
23
|
+
|
|
24
|
+
# 3. Delta Debugging
|
|
25
|
+
1. **Identify**: Find a "good" state and a "bad" state.
|
|
26
|
+
2. **Minimize**: Find the smallest set of changes (code, data, config) that transformed "good" into "bad".
|
|
27
|
+
3. **Isolate**: Correct the specific delta without affecting unrelated logic.
|
|
28
|
+
|
|
29
|
+
# 4. Anti-Regression Protocol
|
|
30
|
+
- Every bug fix **MUST** be accompanied by a regression test that would have caught it.
|
|
31
|
+
- Re-run the entire test suite before proposing the final fix.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
⚡ Smart AI Skills Library | v2.2.8 | Active
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "TDD Mastery"
|
|
3
|
+
description: "Rigorous Test-Driven Development workflow for high-reliability code."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 1. The Red-Green-Refactor Cycle
|
|
7
|
+
Every code change MUST follow this exact sequence:
|
|
8
|
+
|
|
9
|
+
```mermaid
|
|
10
|
+
graph LR;
|
|
11
|
+
A[Red: Write failing test] --> B[Green: Make it pass];
|
|
12
|
+
B --> C[Refactor: Clean & Optimize];
|
|
13
|
+
C --> A;
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
# 2. Strict Standards
|
|
17
|
+
- **Isolation**: Each test should verify a single unit of logic.
|
|
18
|
+
- **Mocking**: Use standard mocking for external dependencies (DBs, APIs).
|
|
19
|
+
- **Naming**: Tests should read like documentation (e.g., `test_should_reject_invalid_email`).
|
|
20
|
+
|
|
21
|
+
# 3. Execution Protocol
|
|
22
|
+
1. **Red**: Run the test suite first; it must fail with a specific, expected error.
|
|
23
|
+
2. **Green**: Implement the *minimal* code to make that exact test pass. Avoid "future-proofing".
|
|
24
|
+
3. **Refactor**: Only after passing can you clean up the code. Ensure the test remains green.
|
|
25
|
+
|
|
26
|
+
# 4. Success Criteria
|
|
27
|
+
- Test coverage for all logical branches.
|
|
28
|
+
- No "side-effects" in tests.
|
|
29
|
+
- Clear, readable assertions.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
⚡ Smart AI Skills Library | v2.2.8 | Active
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "Vercel & Cloudflare Deployment Master"
|
|
3
|
-
description: "Rules for Next.js, Edge Functions, Vercel configs, and Cloudflare Workers."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Vercel Next.js Rules
|
|
7
|
-
1. **Edge Runtime:** Prefer edge runtime for middleware and lightweight route handlers. Understand Edge limits (1MB code size, 50ms startup).
|
|
8
|
-
2. **Caching:** Strategically use Incremental Static Regeneration (ISR) with `revalidate` over pure SSR or Client-side fetching for speed.
|
|
9
|
-
3. **Environment Variables:** Map to `production`, `preview`, and `development` safely. Never leak `NEXT_PUBLIC_` secrets.
|
|
10
|
-
|
|
11
|
-
# Cloudflare Workers
|
|
12
|
-
- Do not use Node.js specific standard libraries (like `fs`, `path`) in Cloudflare workers without compatibility flags.
|
|
13
|
-
- Rely on Workers KV for high-read low-write data, and Durable Objects for state orchestration.
|
|
14
|
-
- Respond rapidly. Execution limits exist. Keep it minimal and fetch externally optimally asynchronously.
|
|
1
|
+
---
|
|
2
|
+
name: "Vercel & Cloudflare Deployment Master"
|
|
3
|
+
description: "Rules for Next.js, Edge Functions, Vercel configs, and Cloudflare Workers."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Vercel Next.js Rules
|
|
7
|
+
1. **Edge Runtime:** Prefer edge runtime for middleware and lightweight route handlers. Understand Edge limits (1MB code size, 50ms startup).
|
|
8
|
+
2. **Caching:** Strategically use Incremental Static Regeneration (ISR) with `revalidate` over pure SSR or Client-side fetching for speed.
|
|
9
|
+
3. **Environment Variables:** Map to `production`, `preview`, and `development` safely. Never leak `NEXT_PUBLIC_` secrets.
|
|
10
|
+
|
|
11
|
+
# Cloudflare Workers
|
|
12
|
+
- Do not use Node.js specific standard libraries (like `fs`, `path`) in Cloudflare workers without compatibility flags.
|
|
13
|
+
- Rely on Workers KV for high-read low-write data, and Durable Objects for state orchestration.
|
|
14
|
+
- Respond rapidly. Execution limits exist. Keep it minimal and fetch externally optimally asynchronously.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
⚡ Smart AI Skills Library | v2.2.8 | Active
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Meta-Skill Architect"
|
|
3
|
+
description: "Authoring and refining high-fidelity agentic superpowers for this library."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 1. Authoring Protocol
|
|
7
|
+
When requested to create/modify a "Mega-Skill":
|
|
8
|
+
- **Constraint-First Design**: Define what the AI *cannot* do first.
|
|
9
|
+
- **Hierarchical Instruction**: Use `---` for metadata headers and `⚡ Smart AI Skills Library` for signatures.
|
|
10
|
+
- **Workflow Visualization**: Every complex skill MUST have a Mermaid flow charting its logic.
|
|
11
|
+
|
|
12
|
+
# 2. Design Thinking
|
|
13
|
+
- **Compression**: Minimize instruction token count without losing fidelity. Use bullet points and headers strategically.
|
|
14
|
+
- **Trigger Logic**: Use the `description` in the Metadata header as the primary trigger for LLM automatic skill adoption.
|
|
15
|
+
- **Best Practices Integration**: Refer to `anthropic_best_practices.md` and `google_standard_logic.md` (if available) for every new skill.
|
|
16
|
+
|
|
17
|
+
# 3. Validation
|
|
18
|
+
- Run `tests/validate_skills.py` after creating any new skill.
|
|
19
|
+
- Check for duplication or overlap with existing skills in the library.
|
|
20
|
+
|
|
21
|
+
# 4. Success Metrics
|
|
22
|
+
- 100% adherence to instructions in first-pass generation.
|
|
23
|
+
- No "hallucination" during skill-based workflows.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
⚡ Smart AI Skills Library | v2.2.8 | Active
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Harshit Jaiswal
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/bin/cli.js
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require('fs-extra');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const { program } = require('commander');
|
|
6
|
-
const inquirer = require('inquirer');
|
|
7
|
-
|
|
8
|
-
// ANSI Terminal Colors
|
|
9
|
-
const colors = {
|
|
10
|
-
reset: "\x1b[0m",
|
|
11
|
-
bright: "\x1b[1m",
|
|
12
|
-
green: "\x1b[32m",
|
|
13
|
-
blue: "\x1b[34m",
|
|
14
|
-
cyan: "\x1b[36m",
|
|
15
|
-
yellow: "\x1b[33m",
|
|
16
|
-
red: "\x1b[31m"
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const targetDir = process.cwd();
|
|
20
|
-
const sourceDir = path.join(__dirname, '..');
|
|
21
|
-
const targetDirBase = path.join(targetDir, 'smart-instructions');
|
|
22
|
-
|
|
23
|
-
program
|
|
24
|
-
.name('ai-skills')
|
|
25
|
-
.description('The Ultimate AI Skill Library CLI')
|
|
26
|
-
.version('2.2.5');
|
|
27
|
-
|
|
28
|
-
program
|
|
29
|
-
.command('init')
|
|
30
|
-
.description('Installs the Smart AI Skills Library')
|
|
31
|
-
.option('-i, --interactive', 'Run interactively to select specific roles/skills')
|
|
32
|
-
.option('-r, --roles <roles>', 'Comma-separated list of roles to install')
|
|
33
|
-
.option('-s, --skills <skills>', 'Comma-separated list of skills to install')
|
|
34
|
-
.action(async (options) => {
|
|
35
|
-
console.log(`${colors.bright}${colors.cyan}Initializing Smart AI Skills Library...${colors.reset}\n`);
|
|
36
|
-
|
|
37
|
-
const availableRoles = fs.existsSync(path.join(sourceDir, 'roles')) ? fs.readdirSync(path.join(sourceDir, 'roles')) : [];
|
|
38
|
-
const availableSkills = fs.existsSync(path.join(sourceDir, 'skills')) ? fs.readdirSync(path.join(sourceDir, 'skills')) : [];
|
|
39
|
-
|
|
40
|
-
let selectedRoles = availableRoles;
|
|
41
|
-
let selectedSkills = availableSkills;
|
|
42
|
-
|
|
43
|
-
if (options.interactive) {
|
|
44
|
-
const { installType } = await inquirer.prompt([
|
|
45
|
-
{
|
|
46
|
-
type: 'list',
|
|
47
|
-
name: 'installType',
|
|
48
|
-
message: 'How would you like to install the skills?',
|
|
49
|
-
choices: [
|
|
50
|
-
'Install Everything (All 8 Roles, 17 Mega-Skills)',
|
|
51
|
-
'Custom Pick (Select specific roles and skills)'
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
]);
|
|
55
|
-
|
|
56
|
-
if (installType.startsWith('Custom')) {
|
|
57
|
-
const answers = await inquirer.prompt([
|
|
58
|
-
{
|
|
59
|
-
type: 'checkbox',
|
|
60
|
-
name: 'roles',
|
|
61
|
-
message: 'Select the Master Roles you need:',
|
|
62
|
-
choices: availableRoles.filter(f => f.endsWith('.md'))
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
type: 'checkbox',
|
|
66
|
-
name: 'skills',
|
|
67
|
-
message: 'Select the Mega-Skills you need:',
|
|
68
|
-
choices: availableSkills.filter(f => f.endsWith('.md'))
|
|
69
|
-
}
|
|
70
|
-
]);
|
|
71
|
-
selectedRoles = answers.roles;
|
|
72
|
-
selectedSkills = answers.skills;
|
|
73
|
-
}
|
|
74
|
-
} else {
|
|
75
|
-
if (options.roles) {
|
|
76
|
-
const rList = options.roles.split(',').map(r => r.trim());
|
|
77
|
-
selectedRoles = availableRoles.filter(r => rList.includes(r) || rList.includes(r.replace('.md', '')));
|
|
78
|
-
}
|
|
79
|
-
if (options.skills) {
|
|
80
|
-
const sList = options.skills.split(',').map(s => s.trim());
|
|
81
|
-
selectedSkills = availableSkills.filter(s => sList.includes(s) || sList.includes(s.replace('.md', '')));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (!fs.existsSync(targetDirBase)) {
|
|
86
|
-
fs.mkdirSync(targetDirBase, { recursive: true });
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
console.log(`\n${colors.blue}[+] Securing source control (.gitignore)...${colors.reset}`);
|
|
90
|
-
const ignoreRules = "\n\n# Smart AI Skills Library (Context Only)\nsmart-instructions/\n";
|
|
91
|
-
const gitignorePath = path.join(targetDir, '.gitignore');
|
|
92
|
-
if (fs.existsSync(gitignorePath)) {
|
|
93
|
-
const currentIgnore = fs.readFileSync(gitignorePath, 'utf8');
|
|
94
|
-
if (!currentIgnore.includes('# Smart AI Skills Library')) {
|
|
95
|
-
fs.appendFileSync(gitignorePath, ignoreRules);
|
|
96
|
-
}
|
|
97
|
-
} else {
|
|
98
|
-
fs.writeFileSync(gitignorePath, ignoreRules.trim() + "\n");
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
console.log(`${colors.blue}[+] Copying SKILL.md Master Rulebook...${colors.reset}`);
|
|
102
|
-
const targetSkillMd = path.join(targetDirBase, 'SKILL.md');
|
|
103
|
-
if (fs.existsSync(path.join(sourceDir, 'SKILL.md'))) {
|
|
104
|
-
fs.copyFileSync(path.join(sourceDir, 'SKILL.md'), targetSkillMd);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (selectedRoles.length > 0) {
|
|
108
|
-
console.log(`${colors.blue}[+] Extracting ${selectedRoles.length} Master Roles...${colors.reset}`);
|
|
109
|
-
fs.ensureDirSync(path.join(targetDirBase, 'roles'));
|
|
110
|
-
selectedRoles.forEach(role => {
|
|
111
|
-
fs.copyFileSync(path.join(sourceDir, 'roles', role), path.join(targetDirBase, 'roles', role));
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (selectedSkills.length > 0) {
|
|
116
|
-
console.log(`${colors.blue}[+] Extracting ${selectedSkills.length} Mega-Skills...${colors.reset}`);
|
|
117
|
-
fs.ensureDirSync(path.join(targetDirBase, 'skills'));
|
|
118
|
-
selectedSkills.forEach(skill => {
|
|
119
|
-
fs.copyFileSync(path.join(sourceDir, 'skills', skill), path.join(targetDirBase, 'skills', skill));
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Add History tracking for consumer context (Fresh Templates)
|
|
124
|
-
console.log(`${colors.blue}[+] Initializing History tracking logs (Fresh Templates)...${colors.reset}`);
|
|
125
|
-
const targetHistoryDir = path.join(targetDirBase, 'history');
|
|
126
|
-
fs.ensureDirSync(targetHistoryDir);
|
|
127
|
-
|
|
128
|
-
const historyTemplates = {
|
|
129
|
-
'history.md': `# 📖 Project History & Context\n\nWelcome to your project's AI history hub. This system is designed to provide context for AI agents working on this project.\n\n### 📂 Modules\n| Module | Description | Link |\n| :--- | :--- | :--- |\n| **[AI Activity Log](ai_activity_log.md)** | Record of AI agent contributions. | [View Log](ai_activity_log.md) |\n| **[Project Timeline](project_timeline.md)** | Roadmap and milestones. | [View Timeline](project_timeline.md) |\n| **[Version History](version_history.md)** | Detailed release logs. | [View Versions](version_history.md) |\n\n---\n*Maintained by: AI Skills History System*`,
|
|
130
|
-
'ai_activity_log.md': `# 🤖 AI Activity Log\n\nThis log tracks specific contributions and tasks performed by AI agents in this project.\n\n---\n\n## 🏃 Active Session (Initial Setup)\n- **Task**: Initialized Smart AI Skills Library (v${program.version()}).\n- **Objective**: Established base AI context and roles library.\n\n---\n*Last updated by: AI Assistant (init)*`,
|
|
131
|
-
'project_timeline.md': `# 📅 Project Timeline\n\nMajor milestones and timeline of this project.\n\n---\n\n### ${new Date().toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' })}\n- **Initialized**: AI Skills Library integrated into the project.\n\n---\n*Last updated by: AI Assistant (init)*`,
|
|
132
|
-
'version_history.md': `# 📦 Version History\n\nVersion tracking for this specific project.\n\n---\n- **v0.1.0** (${new Date().toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' })}): Initial setup with Smart AI Skills Library.\n\n---\n*Last updated by: AI Assistant (init)*`,
|
|
133
|
-
'milestones.md': `# 🏆 Project Milestones\n\nTracking the breakthrough moments of this project.\n\n---\n- **Initialization**: Integrated AI Skills Library (v${program.version()}).\n\n---\n*Last updated by: AI Assistant (init)*`
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
Object.entries(historyTemplates).forEach(([filename, content]) => {
|
|
137
|
-
fs.writeFileSync(path.join(targetHistoryDir, filename), content);
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
console.log(`\n${colors.bright}${colors.green}[Success] The 'smart-instructions' folder has been added to your project!${colors.reset}`);
|
|
141
|
-
console.log(`${colors.yellow}Tip: Let your AI Agent pick skills natively, or run 'npx ai-skills configure' to setup your IDE!${colors.reset}\n`);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
program
|
|
145
|
-
.command('configure')
|
|
146
|
-
.description('Auto-configures your IDE to use the skills')
|
|
147
|
-
.action(async () => {
|
|
148
|
-
console.log(`${colors.bright}${colors.cyan}IDE Auto-Configuration${colors.reset}\n`);
|
|
149
|
-
|
|
150
|
-
const targetSkillMd = path.join(targetDir, 'smart-instructions', 'SKILL.md');
|
|
151
|
-
if (!fs.existsSync(targetSkillMd)) {
|
|
152
|
-
console.error(`${colors.red}[Error] 'smart-instructions/SKILL.md' not found. Please run 'npx ai-skills init' first.${colors.reset}`);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
const { ideSelection } = await inquirer.prompt([
|
|
157
|
-
{
|
|
158
|
-
type: 'list',
|
|
159
|
-
name: 'ideSelection',
|
|
160
|
-
message: 'Which AI IDE or tool are you using?',
|
|
161
|
-
choices: [
|
|
162
|
-
'Cursor (.cursorrules)',
|
|
163
|
-
'Windsurf (.windsurfrules)',
|
|
164
|
-
'Claude Code (CLAUDE.md)',
|
|
165
|
-
'GitHub Copilot (.github/copilot-instructions.md)',
|
|
166
|
-
'Cline (.clinerules)',
|
|
167
|
-
'Cancel'
|
|
168
|
-
]
|
|
169
|
-
}
|
|
170
|
-
]);
|
|
171
|
-
|
|
172
|
-
let destPath = '';
|
|
173
|
-
if (ideSelection.startsWith('Cursor')) destPath = '.cursorrules';
|
|
174
|
-
else if (ideSelection.startsWith('Windsurf')) destPath = '.windsurfrules';
|
|
175
|
-
else if (ideSelection.startsWith('Claude')) destPath = 'CLAUDE.md';
|
|
176
|
-
else if (ideSelection.startsWith('GitHub')) destPath = '.github/copilot-instructions.md';
|
|
177
|
-
else if (ideSelection.startsWith('Cline')) destPath = '.clinerules';
|
|
178
|
-
else {
|
|
179
|
-
console.log(`${colors.yellow}Configuration cancelled.${colors.reset}`);
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
const fullDestPath = path.join(targetDir, destPath);
|
|
184
|
-
if (destPath.includes('/')) {
|
|
185
|
-
fs.ensureDirSync(path.dirname(fullDestPath));
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
const ruleContent = fs.readFileSync(targetSkillMd, 'utf8');
|
|
189
|
-
|
|
190
|
-
if (fs.existsSync(fullDestPath)) {
|
|
191
|
-
const { overwrite } = await inquirer.prompt([
|
|
192
|
-
{
|
|
193
|
-
type: 'confirm',
|
|
194
|
-
name: 'overwrite',
|
|
195
|
-
message: `${destPath} already exists. Do you want to overwrite it?`,
|
|
196
|
-
default: false
|
|
197
|
-
}
|
|
198
|
-
]);
|
|
199
|
-
if (!overwrite) {
|
|
200
|
-
console.log(`${colors.yellow}Configuration skipped.${colors.reset}`);
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
fs.writeFileSync(fullDestPath, ruleContent);
|
|
206
|
-
console.log(`\n${colors.bright}${colors.green}[Success] ${destPath} has been successfully configured!${colors.reset}\n`);
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
program
|
|
210
|
-
.command('create <skill_name>')
|
|
211
|
-
.description('Scaffolds a new custom Mega-Skill')
|
|
212
|
-
.action(async (skillName) => {
|
|
213
|
-
console.log(`${colors.bright}${colors.cyan}Custom Skill Scaffolding${colors.reset}\n`);
|
|
214
|
-
|
|
215
|
-
const { audience, format } = await inquirer.prompt([
|
|
216
|
-
{
|
|
217
|
-
type: 'input',
|
|
218
|
-
name: 'audience',
|
|
219
|
-
message: 'Who is this skill for? (e.g., Frontend React Devs, Backend Node Devs):',
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
type: 'confirm',
|
|
223
|
-
name: 'format',
|
|
224
|
-
message: 'Include strict JSON formatting rules?',
|
|
225
|
-
default: true
|
|
226
|
-
}
|
|
227
|
-
]);
|
|
228
|
-
|
|
229
|
-
const customDir = path.join(targetDir, 'smart-instructions', 'custom');
|
|
230
|
-
fs.ensureDirSync(customDir);
|
|
231
|
-
|
|
232
|
-
const destFile = path.join(customDir, `${skillName.replace('.md', '')}.md`);
|
|
233
|
-
|
|
234
|
-
const template = `# ${skillName} Mega-Skill\n\n## Objective\nProvide expert-level instructions for ${audience}.\n\n## Rules\n- Always prioritize clarity and performance.\n- Write modern, maintainable code.\n${format ? '- ALWAYS output responses in strict JSON format when requested.\n' : ''}\n## Architecture Guidelines\n1. Keep functions small and focused.\n2. Ensure rigorous error handling.\n`;
|
|
235
|
-
|
|
236
|
-
fs.writeFileSync(destFile, template);
|
|
237
|
-
console.log(`\n${colors.bright}${colors.green}[Success] Scaffolded new custom skill at ${destFile}!${colors.reset}\n`);
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
program
|
|
241
|
-
.command('update')
|
|
242
|
-
.description('Updates the official skills without overwriting custom ones in /custom/')
|
|
243
|
-
.action(async () => {
|
|
244
|
-
console.log(`${colors.bright}${colors.cyan}Updating Official Skills${colors.reset}\n`);
|
|
245
|
-
const { proceed } = await inquirer.prompt([
|
|
246
|
-
{
|
|
247
|
-
type: 'confirm',
|
|
248
|
-
name: 'proceed',
|
|
249
|
-
message: 'This will safely copy the latest official skills into smart-instructions/ overriding existing ones. Custom folders will be preserved. Proceed?',
|
|
250
|
-
default: true
|
|
251
|
-
}
|
|
252
|
-
]);
|
|
253
|
-
|
|
254
|
-
if (!proceed) {
|
|
255
|
-
console.log(`${colors.yellow}Update cancelled.${colors.reset}`);
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
try {
|
|
260
|
-
fs.ensureDirSync(path.join(targetDir, 'smart-instructions', 'roles'));
|
|
261
|
-
fs.ensureDirSync(path.join(targetDir, 'smart-instructions', 'skills'));
|
|
262
|
-
|
|
263
|
-
const rDir = path.join(sourceDir, 'roles');
|
|
264
|
-
if (fs.existsSync(rDir)) fs.copySync(rDir, path.join(targetDir, 'smart-instructions', 'roles'));
|
|
265
|
-
|
|
266
|
-
const sDir = path.join(sourceDir, 'skills');
|
|
267
|
-
if (fs.existsSync(sDir)) fs.copySync(sDir, path.join(targetDir, 'smart-instructions', 'skills'));
|
|
268
|
-
|
|
269
|
-
const hDir = path.join(sourceDir, 'history');
|
|
270
|
-
const targetHistoryDir = path.join(targetDir, 'smart-instructions', 'history');
|
|
271
|
-
if (fs.existsSync(hDir)) {
|
|
272
|
-
// Only update the guide, preserving consumer logs
|
|
273
|
-
const guide = 'history.md';
|
|
274
|
-
fs.ensureDirSync(targetHistoryDir);
|
|
275
|
-
if (fs.existsSync(path.join(hDir, guide))) fs.copyFileSync(path.join(hDir, guide), path.join(targetHistoryDir, guide));
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
const targetSkillMd = path.join(targetDir, 'smart-instructions', 'SKILL.md');
|
|
279
|
-
if (fs.existsSync(path.join(sourceDir, 'SKILL.md'))) {
|
|
280
|
-
fs.copyFileSync(path.join(sourceDir, 'SKILL.md'), targetSkillMd);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
console.log(`\n${colors.bright}${colors.green}[Success] Official library updated!${colors.reset}\n`);
|
|
284
|
-
} catch (e) {
|
|
285
|
-
console.error(`${colors.red}[Error] Update failed: ${e.message}${colors.reset}`);
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
// Handle no arguments gracefully
|
|
290
|
-
if (process.argv.length === 2) {
|
|
291
|
-
process.argv.push('--help');
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
program.parse(process.argv);
|