@devmunna/agent-skillkit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +147 -0
  3. package/bin/ai-skills.js +5 -0
  4. package/dist/cli/commands/add.d.ts +2 -0
  5. package/dist/cli/commands/add.d.ts.map +1 -0
  6. package/dist/cli/commands/add.js +66 -0
  7. package/dist/cli/commands/add.js.map +1 -0
  8. package/dist/cli/commands/doctor.d.ts +2 -0
  9. package/dist/cli/commands/doctor.d.ts.map +1 -0
  10. package/dist/cli/commands/doctor.js +33 -0
  11. package/dist/cli/commands/doctor.js.map +1 -0
  12. package/dist/cli/commands/init.d.ts +10 -0
  13. package/dist/cli/commands/init.d.ts.map +1 -0
  14. package/dist/cli/commands/init.js +145 -0
  15. package/dist/cli/commands/init.js.map +1 -0
  16. package/dist/cli/commands/list.d.ts +5 -0
  17. package/dist/cli/commands/list.d.ts.map +1 -0
  18. package/dist/cli/commands/list.js +55 -0
  19. package/dist/cli/commands/list.js.map +1 -0
  20. package/dist/cli/commands/update.d.ts +2 -0
  21. package/dist/cli/commands/update.d.ts.map +1 -0
  22. package/dist/cli/commands/update.js +49 -0
  23. package/dist/cli/commands/update.js.map +1 -0
  24. package/dist/cli/commands/validate.d.ts +2 -0
  25. package/dist/cli/commands/validate.d.ts.map +1 -0
  26. package/dist/cli/commands/validate.js +22 -0
  27. package/dist/cli/commands/validate.js.map +1 -0
  28. package/dist/cli/index.d.ts +2 -0
  29. package/dist/cli/index.d.ts.map +1 -0
  30. package/dist/cli/index.js +49 -0
  31. package/dist/cli/index.js.map +1 -0
  32. package/dist/cli/prompts/agent-selector.d.ts +3 -0
  33. package/dist/cli/prompts/agent-selector.d.ts.map +1 -0
  34. package/dist/cli/prompts/agent-selector.js +23 -0
  35. package/dist/cli/prompts/agent-selector.js.map +1 -0
  36. package/dist/cli/prompts/stack-selector.d.ts +3 -0
  37. package/dist/cli/prompts/stack-selector.d.ts.map +1 -0
  38. package/dist/cli/prompts/stack-selector.js +60 -0
  39. package/dist/cli/prompts/stack-selector.js.map +1 -0
  40. package/dist/core/config-manager.d.ts +20 -0
  41. package/dist/core/config-manager.d.ts.map +1 -0
  42. package/dist/core/config-manager.js +107 -0
  43. package/dist/core/config-manager.js.map +1 -0
  44. package/dist/core/detector.d.ts +3 -0
  45. package/dist/core/detector.d.ts.map +1 -0
  46. package/dist/core/detector.js +50 -0
  47. package/dist/core/detector.js.map +1 -0
  48. package/dist/core/doctor.d.ts +12 -0
  49. package/dist/core/doctor.d.ts.map +1 -0
  50. package/dist/core/doctor.js +102 -0
  51. package/dist/core/doctor.js.map +1 -0
  52. package/dist/core/skill-registry.d.ts +11 -0
  53. package/dist/core/skill-registry.d.ts.map +1 -0
  54. package/dist/core/skill-registry.js +174 -0
  55. package/dist/core/skill-registry.js.map +1 -0
  56. package/dist/core/skill-resolver.d.ts +3 -0
  57. package/dist/core/skill-resolver.d.ts.map +1 -0
  58. package/dist/core/skill-resolver.js +36 -0
  59. package/dist/core/skill-resolver.js.map +1 -0
  60. package/dist/core/validator.d.ts +13 -0
  61. package/dist/core/validator.d.ts.map +1 -0
  62. package/dist/core/validator.js +99 -0
  63. package/dist/core/validator.js.map +1 -0
  64. package/dist/generators/agent-installer.d.ts +5 -0
  65. package/dist/generators/agent-installer.d.ts.map +1 -0
  66. package/dist/generators/agent-installer.js +20 -0
  67. package/dist/generators/agent-installer.js.map +1 -0
  68. package/dist/generators/agents-md.d.ts +3 -0
  69. package/dist/generators/agents-md.d.ts.map +1 -0
  70. package/dist/generators/agents-md.js +70 -0
  71. package/dist/generators/agents-md.js.map +1 -0
  72. package/dist/generators/claude-md.d.ts +3 -0
  73. package/dist/generators/claude-md.d.ts.map +1 -0
  74. package/dist/generators/claude-md.js +47 -0
  75. package/dist/generators/claude-md.js.map +1 -0
  76. package/dist/generators/skill-generator.d.ts +5 -0
  77. package/dist/generators/skill-generator.d.ts.map +1 -0
  78. package/dist/generators/skill-generator.js +34 -0
  79. package/dist/generators/skill-generator.js.map +1 -0
  80. package/dist/generators/workflows.d.ts +3 -0
  81. package/dist/generators/workflows.d.ts.map +1 -0
  82. package/dist/generators/workflows.js +57 -0
  83. package/dist/generators/workflows.js.map +1 -0
  84. package/dist/index.d.ts +13 -0
  85. package/dist/index.d.ts.map +1 -0
  86. package/dist/index.js +13 -0
  87. package/dist/index.js.map +1 -0
  88. package/dist/types/index.d.ts +55 -0
  89. package/dist/types/index.d.ts.map +1 -0
  90. package/dist/types/index.js +2 -0
  91. package/dist/types/index.js.map +1 -0
  92. package/dist/utils/file-utils.d.ts +12 -0
  93. package/dist/utils/file-utils.d.ts.map +1 -0
  94. package/dist/utils/file-utils.js +39 -0
  95. package/dist/utils/file-utils.js.map +1 -0
  96. package/dist/utils/logger.d.ts +10 -0
  97. package/dist/utils/logger.d.ts.map +1 -0
  98. package/dist/utils/logger.js +11 -0
  99. package/dist/utils/logger.js.map +1 -0
  100. package/package.json +73 -0
  101. package/skills/clean-architecture/SKILL.md +324 -0
  102. package/skills/express-mvc-prisma/SKILL.md +168 -0
  103. package/skills/express-mvc-prisma/references/auth.md +190 -0
  104. package/skills/express-mvc-prisma/references/boilerplate.md +196 -0
  105. package/skills/express-mvc-prisma/references/error-handling.md +121 -0
  106. package/skills/express-mvc-prisma/references/module-scaffold.md +253 -0
  107. package/skills/express-mvc-prisma/references/prisma-setup.md +97 -0
  108. package/skills/express-mvc-prisma/references/response-helpers.md +157 -0
  109. package/skills/express-mvc-prisma/references/zod-validation.md +157 -0
  110. package/skills/fastify-rest/SKILL.md +287 -0
  111. package/skills/mongoose-odm/SKILL.md +281 -0
  112. package/skills/nextjs-fullstack/SKILL.md +328 -0
  113. package/skills/nextjs-fullstack/references/auth.md +270 -0
  114. package/skills/nextjs-fullstack/references/caching.md +157 -0
  115. package/skills/nextjs-fullstack/references/route-handlers.md +194 -0
  116. package/skills/nextjs-fullstack/references/server-actions.md +214 -0
  117. package/skills/nextjs-fullstack/references/server-components.md +190 -0
  118. package/skills/node-base/SKILL.md +139 -0
  119. package/skills/prisma-orm/SKILL.md +334 -0
  120. package/skills/react-feature-arch/SKILL.md +208 -0
  121. package/skills/react-feature-arch/references/api-layer.md +110 -0
  122. package/skills/react-feature-arch/references/components.md +192 -0
  123. package/skills/react-feature-arch/references/data-fetching.md +198 -0
  124. package/skills/react-feature-arch/references/forms.md +194 -0
  125. package/skills/react-feature-arch/references/routing.md +148 -0
  126. package/skills/react-feature-arch/references/state-management.md +107 -0
  127. package/skills/tailwind-css/SKILL.md +236 -0
  128. package/skills/tailwind-css/references/components.md +340 -0
  129. package/skills/tailwind-css/references/design-tokens.md +230 -0
  130. package/skills/tailwind-css/references/patterns.md +375 -0
  131. package/skills/tailwind-css/references/setup.md +165 -0
  132. package/skills/zod-validation/SKILL.md +267 -0
@@ -0,0 +1,57 @@
1
+ import path from 'path';
2
+ import fs from 'fs-extra';
3
+ import { logger } from '../utils/logger.js';
4
+ const WORKFLOWS = {
5
+ 'implement-feature.md': [
6
+ '# Implement Feature Workflow',
7
+ '',
8
+ '1. Read the user request and identify the smallest useful change.',
9
+ '2. Inspect the existing files that own the behavior.',
10
+ '3. Load only the relevant installed skill files.',
11
+ '4. Follow existing project patterns before adding new ones.',
12
+ '5. Implement the feature with focused edits.',
13
+ '6. Run the cheapest relevant verification command.',
14
+ '7. Final response: summarize changed behavior and verification.',
15
+ ].join('\n'),
16
+ 'fix-bug.md': [
17
+ '# Fix Bug Workflow',
18
+ '',
19
+ '1. Reproduce the failure or inspect the failing path.',
20
+ '2. Identify the smallest responsible module.',
21
+ '3. Load the relevant installed skill and nearby code.',
22
+ '4. Patch the root cause, not a broad workaround.',
23
+ '5. Add or update a focused test when the risk justifies it.',
24
+ '6. Run focused verification.',
25
+ '7. Final response: explain cause, fix, and verification.',
26
+ ].join('\n'),
27
+ 'code-review.md': [
28
+ '# Code Review Workflow',
29
+ '',
30
+ '1. Prioritize bugs, regressions, security risks, and missing tests.',
31
+ '2. Cite exact files and lines where possible.',
32
+ '3. Keep summaries brief and after findings.',
33
+ '4. Avoid style-only comments unless they hide a real risk.',
34
+ '5. If no issues are found, say that clearly and mention residual risk.',
35
+ ].join('\n'),
36
+ 'refactor.md': [
37
+ '# Refactor Workflow',
38
+ '',
39
+ '1. Preserve behavior unless the user explicitly asks for behavior change.',
40
+ '2. Identify tests or commands that prove behavior stayed stable.',
41
+ '3. Keep edits within the owning module boundaries.',
42
+ '4. Avoid new abstractions unless they remove real complexity.',
43
+ '5. Run verification and report any skipped checks.',
44
+ ].join('\n'),
45
+ };
46
+ export async function generateWorkflows(projectRoot) {
47
+ const workflowsDir = path.join(projectRoot, '.ai-skills', 'workflows');
48
+ await fs.ensureDir(workflowsDir);
49
+ for (const [filename, content] of Object.entries(WORKFLOWS)) {
50
+ await fs.writeFile(path.join(workflowsDir, filename), `${content}\n`, 'utf-8');
51
+ }
52
+ logger.step(`Workflows updated (${Object.keys(WORKFLOWS).length} file(s))`);
53
+ }
54
+ export function workflowNames() {
55
+ return Object.keys(WORKFLOWS);
56
+ }
57
+ //# sourceMappingURL=workflows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../src/generators/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,SAAS,GAA2B;IACxC,sBAAsB,EAAE;QACtB,8BAA8B;QAC9B,EAAE;QACF,mEAAmE;QACnE,sDAAsD;QACtD,kDAAkD;QAClD,6DAA6D;QAC7D,8CAA8C;QAC9C,oDAAoD;QACpD,iEAAiE;KAClE,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,YAAY,EAAE;QACZ,oBAAoB;QACpB,EAAE;QACF,uDAAuD;QACvD,8CAA8C;QAC9C,uDAAuD;QACvD,kDAAkD;QAClD,6DAA6D;QAC7D,8BAA8B;QAC9B,0DAA0D;KAC3D,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,gBAAgB,EAAE;QAChB,wBAAwB;QACxB,EAAE;QACF,qEAAqE;QACrE,+CAA+C;QAC/C,6CAA6C;QAC7C,4DAA4D;QAC5D,wEAAwE;KACzE,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,aAAa,EAAE;QACb,qBAAqB;QACrB,EAAE;QACF,2EAA2E;QAC3E,kEAAkE;QAClE,oDAAoD;QACpD,+DAA+D;QAC/D,oDAAoD;KACrD,CAAC,IAAI,CAAC,IAAI,CAAC;CACb,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,WAAmB;IACzD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IACvE,MAAM,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAEjC,KAAK,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5D,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAE,GAAG,OAAO,IAAI,EAAE,OAAO,CAAC,CAAC;IACjF,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,uBAAuB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,WAAW,CAAC,CAAC;AAC/E,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,13 @@
1
+ export * from './types/index.js';
2
+ export * from './core/config-manager.js';
3
+ export * from './core/detector.js';
4
+ export * from './core/doctor.js';
5
+ export * from './core/skill-registry.js';
6
+ export * from './core/skill-resolver.js';
7
+ export * from './core/validator.js';
8
+ export * from './generators/agent-installer.js';
9
+ export * from './generators/agents-md.js';
10
+ export * from './generators/claude-md.js';
11
+ export * from './generators/skill-generator.js';
12
+ export * from './generators/workflows.js';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ export * from './types/index.js';
2
+ export * from './core/config-manager.js';
3
+ export * from './core/detector.js';
4
+ export * from './core/doctor.js';
5
+ export * from './core/skill-registry.js';
6
+ export * from './core/skill-resolver.js';
7
+ export * from './core/validator.js';
8
+ export * from './generators/agent-installer.js';
9
+ export * from './generators/agents-md.js';
10
+ export * from './generators/claude-md.js';
11
+ export * from './generators/skill-generator.js';
12
+ export * from './generators/workflows.js';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,55 @@
1
+ export type SkillCategory = 'backend' | 'frontend' | 'database' | 'architecture' | 'validation' | 'testing' | 'base';
2
+ export type AiAgent = 'claude' | 'codex';
3
+ export interface AgentInstallTarget {
4
+ agent: AiAgent;
5
+ skillsDir: string;
6
+ contextFile?: string;
7
+ }
8
+ export interface SkillMeta {
9
+ name: string;
10
+ version: string;
11
+ description: string;
12
+ category: SkillCategory;
13
+ stack: string[];
14
+ depends?: string[];
15
+ conflicts?: string[];
16
+ tags?: string[];
17
+ }
18
+ export interface SkillProfile {
19
+ name: string;
20
+ description: string;
21
+ skills: string[];
22
+ stacks: string[];
23
+ }
24
+ export interface ProjectConfig {
25
+ version: string;
26
+ installedSkills: InstalledSkill[];
27
+ outputDir: string;
28
+ claudeMd: boolean;
29
+ agents: AiAgent[];
30
+ createdAt: string;
31
+ updatedAt: string;
32
+ }
33
+ export interface InstalledSkill {
34
+ name: string;
35
+ version: string;
36
+ installedAt: string;
37
+ }
38
+ export interface StackSelection {
39
+ backend: string[];
40
+ frontend: string[];
41
+ database: string[];
42
+ architecture: string[];
43
+ validation: string[];
44
+ }
45
+ export interface DetectedStack {
46
+ packages: string[];
47
+ suggestedSkills: string[];
48
+ confidence: Record<string, number>;
49
+ }
50
+ export interface SkillResolution {
51
+ ordered: string[];
52
+ missing: string[];
53
+ conflicts: string[];
54
+ }
55
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,UAAU,GACV,UAAU,GACV,cAAc,GACd,YAAY,GACZ,SAAS,GACT,MAAM,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ export declare const getdirname: (importMetaUrl: string) => string;
2
+ export declare const packageRoot: () => string;
3
+ export declare const skillsSourceDir: () => string;
4
+ export declare const skillSourceDir: (skillName: string) => string;
5
+ export declare function pathExists(p: string): Promise<boolean>;
6
+ export declare function ensureDir(dir: string): Promise<void>;
7
+ export declare function readJson<T>(filePath: string): Promise<T>;
8
+ export declare function writeJson(filePath: string, data: unknown): Promise<void>;
9
+ export declare function copyDir(src: string, dest: string): Promise<void>;
10
+ export declare function readFileSafe(filePath: string): Promise<string | null>;
11
+ export declare function writeFile(filePath: string, content: string): Promise<void>;
12
+ //# sourceMappingURL=file-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-utils.d.ts","sourceRoot":"","sources":["../../src/utils/file-utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,GAAI,eAAe,MAAM,KAAG,MACP,CAAC;AAE7C,eAAO,MAAM,WAAW,QAAO,MAI9B,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,MACC,CAAC;AAErC,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,KAAG,MACV,CAAC;AAE1C,wBAAsB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE5D;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1D;AAED,wBAAsB,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAE9D;AAED,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9E;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtE;AAED,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAM3E;AAED,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhF"}
@@ -0,0 +1,39 @@
1
+ import { fileURLToPath } from 'url';
2
+ import path from 'path';
3
+ import fs from 'fs-extra';
4
+ export const getdirname = (importMetaUrl) => path.dirname(fileURLToPath(importMetaUrl));
5
+ export const packageRoot = () => {
6
+ // dist/utils/file-utils.js → up 3 levels to package root
7
+ const here = getdirname(import.meta.url);
8
+ return path.resolve(here, '../../');
9
+ };
10
+ export const skillsSourceDir = () => path.join(packageRoot(), 'skills');
11
+ export const skillSourceDir = (skillName) => path.join(skillsSourceDir(), skillName);
12
+ export async function pathExists(p) {
13
+ return fs.pathExists(p);
14
+ }
15
+ export async function ensureDir(dir) {
16
+ await fs.ensureDir(dir);
17
+ }
18
+ export async function readJson(filePath) {
19
+ return fs.readJson(filePath);
20
+ }
21
+ export async function writeJson(filePath, data) {
22
+ await fs.writeJson(filePath, data, { spaces: 2 });
23
+ }
24
+ export async function copyDir(src, dest) {
25
+ await fs.copy(src, dest, { overwrite: true });
26
+ }
27
+ export async function readFileSafe(filePath) {
28
+ try {
29
+ return await fs.readFile(filePath, 'utf-8');
30
+ }
31
+ catch {
32
+ return null;
33
+ }
34
+ }
35
+ export async function writeFile(filePath, content) {
36
+ await fs.ensureDir(path.dirname(filePath));
37
+ await fs.writeFile(filePath, content, 'utf-8');
38
+ }
39
+ //# sourceMappingURL=file-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-utils.js","sourceRoot":"","sources":["../../src/utils/file-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,aAAqB,EAAU,EAAE,CAC1D,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;AAE7C,MAAM,CAAC,MAAM,WAAW,GAAG,GAAW,EAAE;IACtC,yDAAyD;IACzD,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAW,EAAE,CAC1C,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,QAAQ,CAAC,CAAC;AAErC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAiB,EAAU,EAAE,CAC1D,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,SAAS,CAAC,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,CAAS;IACxC,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,GAAW;IACzC,MAAM,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAI,QAAgB;IAChD,OAAO,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAe,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,QAAgB,EAAE,IAAa;IAC7D,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,GAAW,EAAE,IAAY;IACrD,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAAgB;IACjD,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,QAAgB,EAAE,OAAe;IAC/D,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3C,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare const logger: {
2
+ info: (msg: string) => void;
3
+ success: (msg: string) => void;
4
+ warn: (msg: string) => void;
5
+ error: (msg: string) => void;
6
+ step: (msg: string) => void;
7
+ dim: (msg: string) => void;
8
+ blank: () => void;
9
+ };
10
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;gBACL,MAAM;mBACH,MAAM;gBACT,MAAM;iBACL,MAAM;gBACP,MAAM;eACP,MAAM;;CAElB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import chalk from 'chalk';
2
+ export const logger = {
3
+ info: (msg) => console.log(`${chalk.blue('ℹ')} ${msg}`),
4
+ success: (msg) => console.log(`${chalk.green('✓')} ${chalk.green(msg)}`),
5
+ warn: (msg) => console.warn(`${chalk.yellow('⚠')} ${chalk.yellow(msg)}`),
6
+ error: (msg) => console.error(`${chalk.red('✗')} ${chalk.red(msg)}`),
7
+ step: (msg) => console.log(`${chalk.cyan('→')} ${msg}`),
8
+ dim: (msg) => console.log(chalk.dim(msg)),
9
+ blank: () => console.log(),
10
+ };
11
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;IAC/D,OAAO,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;IAChF,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IAChF,KAAK,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;IAC5E,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;IAC/D,GAAG,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjD,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;CAC3B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@devmunna/agent-skillkit",
3
+ "version": "0.1.0",
4
+ "description": "Install production-grade AI agent development skills for your project stack",
5
+ "type": "module",
6
+ "bin": {
7
+ "ai-skills": "bin/ai-skills.js"
8
+ },
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "bin",
18
+ "skills"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc",
22
+ "dev": "tsx src/cli/index.ts",
23
+ "typecheck": "tsc --noEmit",
24
+ "test": "npm run build && node --test tests/*.test.mjs",
25
+ "prepublishOnly": "npm test",
26
+ "init": "tsx src/cli/index.ts init"
27
+ },
28
+ "engines": {
29
+ "node": ">=18.0.0"
30
+ },
31
+ "keywords": [
32
+ "ai",
33
+ "skills",
34
+ "claude",
35
+ "copilot",
36
+ "cursor",
37
+ "codex",
38
+ "express",
39
+ "react",
40
+ "nextjs",
41
+ "prisma",
42
+ "developer-experience",
43
+ "ai-agent",
44
+ "mcp"
45
+ ],
46
+ "author": "Monir Hasan Munna <dev.munna007@gmail.com>",
47
+ "homepage": "https://github.com/Monirhasanmunna/agent-skillkit#readme",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/Monirhasanmunna/agent-skillkit.git"
51
+ },
52
+ "bugs": {
53
+ "url": "https://github.com/Monirhasanmunna/agent-skillkit/issues"
54
+ },
55
+ "license": "MIT",
56
+ "publishConfig": {
57
+ "access": "public"
58
+ },
59
+ "dependencies": {
60
+ "@clack/prompts": "^0.9.0",
61
+ "chalk": "^5.3.0",
62
+ "commander": "^12.1.0",
63
+ "fs-extra": "^11.2.0",
64
+ "semver": "^7.6.3"
65
+ },
66
+ "devDependencies": {
67
+ "@types/fs-extra": "^11.0.4",
68
+ "@types/node": "^20.14.0",
69
+ "@types/semver": "^7.5.8",
70
+ "tsx": "^4.15.0",
71
+ "typescript": "^5.5.0"
72
+ }
73
+ }
@@ -0,0 +1,324 @@
1
+ ---
2
+ name: clean-architecture
3
+ version: 1.0.0
4
+ description: >
5
+ Apply this skill when implementing Clean Architecture, Domain-Driven Design, or SOLID principles in any Node.js/TypeScript project. Triggers: "clean architecture", "domain layer", "use case", "entity", "repository interface", "dependency injection", "SOLID", "decouple business logic", "inversion of control".
6
+ stack: []
7
+ depends: []
8
+ ---
9
+
10
+ # Clean Architecture Skill
11
+
12
+ Layered architecture that decouples business logic from frameworks, databases, and delivery mechanisms.
13
+
14
+ ---
15
+
16
+ ## Layer Hierarchy
17
+
18
+ ```
19
+ src/
20
+ ├── domain/ # Enterprise business rules (no dependencies)
21
+ │ ├── entities/ # Core business objects
22
+ │ ├── repositories/ # Repository interfaces (not implementations)
23
+ │ └── errors/ # Domain-specific error classes
24
+
25
+ ├── application/ # Application business rules
26
+ │ └── use-cases/ # One class per use case
27
+
28
+ ├── infrastructure/ # Framework + DB implementations
29
+ │ ├── repositories/ # Concrete repository implementations
30
+ │ ├── database/ # ORM config, migrations
31
+ │ └── services/ # External services (email, storage)
32
+
33
+ └── presentation/ # Delivery mechanism (HTTP, CLI, etc.)
34
+ ├── controllers/ # Map HTTP ↔ use case
35
+ ├── middlewares/
36
+ └── routes/
37
+ ```
38
+
39
+ **Dependency Rule**: dependencies always point inward. Domain knows nothing about infrastructure. Infrastructure implements domain interfaces.
40
+
41
+ ---
42
+
43
+ ## Domain Layer
44
+
45
+ ### Entities
46
+
47
+ ```ts
48
+ // src/domain/entities/User.ts
49
+ export class User {
50
+ constructor(
51
+ public readonly id: string,
52
+ public readonly email: string,
53
+ public readonly name: string,
54
+ private readonly passwordHash: string,
55
+ public readonly role: UserRole,
56
+ public readonly createdAt: Date,
57
+ ) {}
58
+
59
+ isAdmin(): boolean {
60
+ return this.role === UserRole.ADMIN;
61
+ }
62
+
63
+ canDelete(targetUserId: string): boolean {
64
+ return this.isAdmin() || this.id === targetUserId;
65
+ }
66
+ }
67
+
68
+ export enum UserRole {
69
+ USER = 'USER',
70
+ ADMIN = 'ADMIN',
71
+ }
72
+ ```
73
+
74
+ ### Repository Interfaces
75
+
76
+ ```ts
77
+ // src/domain/repositories/IUserRepository.ts
78
+ import type { User } from '../entities/User';
79
+
80
+ export interface FindAllParams {
81
+ page: number;
82
+ limit: number;
83
+ search?: string;
84
+ }
85
+
86
+ export interface PaginatedResult<T> {
87
+ data: T[];
88
+ total: number;
89
+ page: number;
90
+ limit: number;
91
+ }
92
+
93
+ export interface IUserRepository {
94
+ findAll(params: FindAllParams): Promise<PaginatedResult<User>>;
95
+ findById(id: string): Promise<User | null>;
96
+ findByEmail(email: string): Promise<User | null>;
97
+ save(user: User): Promise<User>;
98
+ delete(id: string): Promise<void>;
99
+ }
100
+ ```
101
+
102
+ ### Domain Errors
103
+
104
+ ```ts
105
+ // src/domain/errors/DomainError.ts
106
+ export class DomainError extends Error {
107
+ constructor(message: string, public readonly statusCode: number = 400) {
108
+ super(message);
109
+ this.name = 'DomainError';
110
+ }
111
+ }
112
+
113
+ export class NotFoundError extends DomainError {
114
+ constructor(resource: string, id: string) {
115
+ super(`${resource} with id "${id}" not found`, 404);
116
+ this.name = 'NotFoundError';
117
+ }
118
+ }
119
+
120
+ export class ConflictError extends DomainError {
121
+ constructor(message: string) {
122
+ super(message, 409);
123
+ this.name = 'ConflictError';
124
+ }
125
+ }
126
+
127
+ export class ForbiddenError extends DomainError {
128
+ constructor(message = 'Access denied') {
129
+ super(message, 403);
130
+ this.name = 'ForbiddenError';
131
+ }
132
+ }
133
+ ```
134
+
135
+ ---
136
+
137
+ ## Application Layer (Use Cases)
138
+
139
+ One class per use case. Takes repository interfaces via constructor injection.
140
+
141
+ ```ts
142
+ // src/application/use-cases/user/CreateUserUseCase.ts
143
+ import type { IUserRepository } from '@/domain/repositories/IUserRepository';
144
+ import type { IHashService } from '@/domain/services/IHashService';
145
+ import { User, UserRole } from '@/domain/entities/User';
146
+ import { ConflictError } from '@/domain/errors/DomainError';
147
+ import crypto from 'crypto';
148
+
149
+ interface CreateUserInput {
150
+ name: string;
151
+ email: string;
152
+ password: string;
153
+ }
154
+
155
+ export class CreateUserUseCase {
156
+ constructor(
157
+ private readonly userRepository: IUserRepository,
158
+ private readonly hashService: IHashService,
159
+ ) {}
160
+
161
+ async execute(input: CreateUserInput): Promise<User> {
162
+ const existing = await this.userRepository.findByEmail(input.email);
163
+ if (existing) throw new ConflictError('Email already registered');
164
+
165
+ const passwordHash = await this.hashService.hash(input.password);
166
+
167
+ const user = new User(
168
+ crypto.randomUUID(),
169
+ input.email,
170
+ input.name,
171
+ passwordHash,
172
+ UserRole.USER,
173
+ new Date(),
174
+ );
175
+
176
+ return this.userRepository.save(user);
177
+ }
178
+ }
179
+ ```
180
+
181
+ ---
182
+
183
+ ## Infrastructure Layer (Implementations)
184
+
185
+ ```ts
186
+ // src/infrastructure/repositories/PrismaUserRepository.ts
187
+ import type { IUserRepository, FindAllParams, PaginatedResult } from '@/domain/repositories/IUserRepository';
188
+ import type { User } from '@/domain/entities/User';
189
+ import { UserMapper } from './mappers/UserMapper';
190
+ import type { PrismaClient } from '@prisma/client';
191
+
192
+ export class PrismaUserRepository implements IUserRepository {
193
+ constructor(private readonly prisma: PrismaClient) {}
194
+
195
+ async findAll({ page, limit, search }: FindAllParams): Promise<PaginatedResult<User>> {
196
+ const skip = (page - 1) * limit;
197
+ const where = search ? { name: { contains: search, mode: 'insensitive' as const } } : {};
198
+
199
+ const [rows, total] = await this.prisma.$transaction([
200
+ this.prisma.user.findMany({ where, skip, take: limit }),
201
+ this.prisma.user.count({ where }),
202
+ ]);
203
+
204
+ return { data: rows.map(UserMapper.toDomain), total, page, limit };
205
+ }
206
+
207
+ async findById(id: string): Promise<User | null> {
208
+ const row = await this.prisma.user.findUnique({ where: { id } });
209
+ return row ? UserMapper.toDomain(row) : null;
210
+ }
211
+
212
+ async findByEmail(email: string): Promise<User | null> {
213
+ const row = await this.prisma.user.findUnique({ where: { email } });
214
+ return row ? UserMapper.toDomain(row) : null;
215
+ }
216
+
217
+ async save(user: User): Promise<User> {
218
+ const row = await this.prisma.user.upsert({
219
+ where: { id: user.id },
220
+ update: UserMapper.toPersistence(user),
221
+ create: UserMapper.toPersistence(user),
222
+ });
223
+ return UserMapper.toDomain(row);
224
+ }
225
+
226
+ async delete(id: string): Promise<void> {
227
+ await this.prisma.user.delete({ where: { id } });
228
+ }
229
+ }
230
+ ```
231
+
232
+ ---
233
+
234
+ ## Mapper (Domain ↔ Persistence)
235
+
236
+ ```ts
237
+ // src/infrastructure/repositories/mappers/UserMapper.ts
238
+ import type { User as PrismaUser } from '@prisma/client';
239
+ import { User, UserRole } from '@/domain/entities/User';
240
+
241
+ export class UserMapper {
242
+ static toDomain(raw: PrismaUser): User {
243
+ return new User(
244
+ raw.id,
245
+ raw.email,
246
+ raw.name,
247
+ raw.password,
248
+ raw.role as UserRole,
249
+ raw.createdAt,
250
+ );
251
+ }
252
+
253
+ static toPersistence(user: User): Omit<PrismaUser, 'updatedAt'> {
254
+ return {
255
+ id: user.id,
256
+ email: user.email,
257
+ name: user.name,
258
+ password: (user as unknown as { passwordHash: string }).passwordHash,
259
+ role: user.role,
260
+ createdAt: user.createdAt,
261
+ };
262
+ }
263
+ }
264
+ ```
265
+
266
+ ---
267
+
268
+ ## Presentation Layer (Controllers)
269
+
270
+ ```ts
271
+ // src/presentation/controllers/UserController.ts
272
+ import type { CreateUserUseCase } from '@/application/use-cases/user/CreateUserUseCase';
273
+ import type { Request, Response, NextFunction } from 'express';
274
+
275
+ export class UserController {
276
+ constructor(private readonly createUserUseCase: CreateUserUseCase) {}
277
+
278
+ create = async (req: Request, res: Response, next: NextFunction) => {
279
+ try {
280
+ const user = await this.createUserUseCase.execute(req.body);
281
+ res.status(201).json({ success: true, data: user });
282
+ } catch (err) {
283
+ next(err);
284
+ }
285
+ };
286
+ }
287
+ ```
288
+
289
+ ---
290
+
291
+ ## Dependency Injection (Manual)
292
+
293
+ ```ts
294
+ // src/infrastructure/container.ts
295
+ import { PrismaClient } from '@prisma/client';
296
+ import { PrismaUserRepository } from './repositories/PrismaUserRepository';
297
+ import { BcryptHashService } from './services/BcryptHashService';
298
+ import { CreateUserUseCase } from '@/application/use-cases/user/CreateUserUseCase';
299
+ import { UserController } from '@/presentation/controllers/UserController';
300
+
301
+ const prisma = new PrismaClient();
302
+
303
+ // Repositories
304
+ const userRepository = new PrismaUserRepository(prisma);
305
+
306
+ // Services
307
+ const hashService = new BcryptHashService();
308
+
309
+ // Use Cases
310
+ const createUserUseCase = new CreateUserUseCase(userRepository, hashService);
311
+
312
+ // Controllers
313
+ export const userController = new UserController(createUserUseCase);
314
+ ```
315
+
316
+ ---
317
+
318
+ ## Rules
319
+
320
+ - Domain layer has zero imports from express, prisma, mongoose, or any framework
321
+ - Use cases depend only on interfaces, never concrete implementations
322
+ - Mappers translate between domain objects and persistence models — keep this logic isolated
323
+ - If a use case grows beyond ~60 lines, extract domain services
324
+ - Test use cases by injecting mock repositories — no DB required for unit tests