claudiao 1.0.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 (68) hide show
  1. package/README.md +387 -0
  2. package/dist/commands/create.d.ts +2 -0
  3. package/dist/commands/create.js +260 -0
  4. package/dist/commands/doctor.d.ts +1 -0
  5. package/dist/commands/doctor.js +138 -0
  6. package/dist/commands/init.d.ts +3 -0
  7. package/dist/commands/init.js +252 -0
  8. package/dist/commands/install-plugin.d.ts +1 -0
  9. package/dist/commands/install-plugin.js +35 -0
  10. package/dist/commands/list.d.ts +3 -0
  11. package/dist/commands/list.js +123 -0
  12. package/dist/commands/remove.d.ts +6 -0
  13. package/dist/commands/remove.js +121 -0
  14. package/dist/commands/update.d.ts +4 -0
  15. package/dist/commands/update.js +141 -0
  16. package/dist/index.d.ts +2 -0
  17. package/dist/index.js +156 -0
  18. package/dist/lib/__tests__/frontmatter.test.d.ts +1 -0
  19. package/dist/lib/__tests__/frontmatter.test.js +180 -0
  20. package/dist/lib/__tests__/paths.test.d.ts +1 -0
  21. package/dist/lib/__tests__/paths.test.js +29 -0
  22. package/dist/lib/__tests__/symlinks.test.d.ts +1 -0
  23. package/dist/lib/__tests__/symlinks.test.js +142 -0
  24. package/dist/lib/format.d.ts +13 -0
  25. package/dist/lib/format.js +47 -0
  26. package/dist/lib/frontmatter.d.ts +9 -0
  27. package/dist/lib/frontmatter.js +45 -0
  28. package/dist/lib/paths.d.ts +33 -0
  29. package/dist/lib/paths.js +111 -0
  30. package/dist/lib/plugins.d.ts +3 -0
  31. package/dist/lib/plugins.js +24 -0
  32. package/dist/lib/symlinks.d.ts +8 -0
  33. package/dist/lib/symlinks.js +56 -0
  34. package/dist/lib/templates.d.ts +26 -0
  35. package/dist/lib/templates.js +75 -0
  36. package/dist/types.d.ts +25 -0
  37. package/dist/types.js +1 -0
  38. package/package.json +47 -0
  39. package/templates/CLAUDE-CODE-BEST-PRACTICES.md +508 -0
  40. package/templates/CLOUD-CLI-GUIDE.md +405 -0
  41. package/templates/agents/architect.md +128 -0
  42. package/templates/agents/aws-specialist.md +104 -0
  43. package/templates/agents/azure-specialist.md +117 -0
  44. package/templates/agents/database-specialist.md +104 -0
  45. package/templates/agents/dod-specialist.md +101 -0
  46. package/templates/agents/gcp-specialist.md +124 -0
  47. package/templates/agents/idea-refiner.md +146 -0
  48. package/templates/agents/implementation-planner.md +149 -0
  49. package/templates/agents/nodejs-specialist.md +105 -0
  50. package/templates/agents/pr-reviewer.md +132 -0
  51. package/templates/agents/product-owner.md +88 -0
  52. package/templates/agents/project-manager.md +95 -0
  53. package/templates/agents/prompt-engineer.md +115 -0
  54. package/templates/agents/python-specialist.md +103 -0
  55. package/templates/agents/react-specialist.md +94 -0
  56. package/templates/agents/security-specialist.md +145 -0
  57. package/templates/agents/test-specialist.md +157 -0
  58. package/templates/agents/uxui-specialist.md +102 -0
  59. package/templates/global-CLAUDE.md +100 -0
  60. package/templates/skills/architecture-decision/SKILL.md +102 -0
  61. package/templates/skills/meet-dod/SKILL.md +124 -0
  62. package/templates/skills/pm-templates/SKILL.md +125 -0
  63. package/templates/skills/pr-template/SKILL.md +87 -0
  64. package/templates/skills/product-templates/SKILL.md +97 -0
  65. package/templates/skills/python-patterns/SKILL.md +123 -0
  66. package/templates/skills/security-checklist/SKILL.md +80 -0
  67. package/templates/skills/sql-templates/SKILL.md +93 -0
  68. package/templates/skills/ui-review-checklist/SKILL.md +73 -0
@@ -0,0 +1,47 @@
1
+ import chalk from 'chalk';
2
+ export function banner() {
3
+ console.log('');
4
+ console.log(chalk.blue('╔═══════════════════════════════════════════╗'));
5
+ console.log(chalk.blue('║ ║'));
6
+ console.log(chalk.blue('║ ') + chalk.bold('claudiao') + chalk.dim(' — Claude no próximo nível') + chalk.blue(' ║'));
7
+ console.log(chalk.blue('║ ║'));
8
+ console.log(chalk.blue('╚═══════════════════════════════════════════╝'));
9
+ console.log('');
10
+ }
11
+ export function success(msg) {
12
+ console.log(chalk.green(' ✓ ') + msg);
13
+ }
14
+ export function warn(msg) {
15
+ console.log(chalk.yellow(' ⚠ ') + msg);
16
+ }
17
+ export function error(msg) {
18
+ console.log(chalk.red(' ✗ ') + msg);
19
+ }
20
+ export function info(msg) {
21
+ console.log(chalk.cyan(' ℹ ') + msg);
22
+ }
23
+ export function dim(msg) {
24
+ console.log(chalk.dim(' ' + msg));
25
+ }
26
+ export function heading(msg) {
27
+ console.log('');
28
+ console.log(chalk.bold(msg));
29
+ console.log('');
30
+ }
31
+ export function separator() {
32
+ console.log('');
33
+ console.log(chalk.blue('═══════════════════════════════════════════'));
34
+ console.log('');
35
+ }
36
+ export function table(rows) {
37
+ const maxName = Math.max(...rows.map(r => r.name.length), 4);
38
+ for (const row of rows) {
39
+ const name = row.name.padEnd(maxName + 2);
40
+ const status = row.status
41
+ ? row.status === 'installed'
42
+ ? chalk.green(' [instalado]')
43
+ : chalk.dim(' [não instalado]')
44
+ : '';
45
+ console.log(` ${chalk.cyan(name)}${chalk.dim(row.description)}${status}`);
46
+ }
47
+ }
@@ -0,0 +1,9 @@
1
+ import type { AgentMeta, SkillMeta } from '../types.js';
2
+ export declare function parseAgentFile(filePath: string): AgentMeta & {
3
+ content: string;
4
+ };
5
+ export declare function parseSkillFile(filePath: string): SkillMeta & {
6
+ content: string;
7
+ };
8
+ export declare function serializeAgent(meta: AgentMeta, content: string): string;
9
+ export declare function serializeSkill(meta: SkillMeta, content: string): string;
@@ -0,0 +1,45 @@
1
+ import matter from 'gray-matter';
2
+ import { readFileSync } from 'node:fs';
3
+ export function parseAgentFile(filePath) {
4
+ const raw = readFileSync(filePath, 'utf-8');
5
+ const { data, content } = matter(raw);
6
+ return {
7
+ name: data.name || '',
8
+ description: data.description || '',
9
+ tools: (data.tools || '').split(',').map((t) => t.trim()),
10
+ model: data.model || 'opus',
11
+ category: data.category || 'other',
12
+ content,
13
+ };
14
+ }
15
+ export function parseSkillFile(filePath) {
16
+ const raw = readFileSync(filePath, 'utf-8');
17
+ const { data, content } = matter(raw);
18
+ return {
19
+ name: data.name || '',
20
+ description: data.description || '',
21
+ allowedTools: (data['allowed-tools'] || '').split(',').map((t) => t.trim()),
22
+ model: data.model || 'sonnet',
23
+ content,
24
+ };
25
+ }
26
+ export function serializeAgent(meta, content) {
27
+ const frontmatterData = {
28
+ name: meta.name,
29
+ description: meta.description,
30
+ tools: meta.tools.join(', '),
31
+ model: meta.model,
32
+ };
33
+ if (meta.category) {
34
+ frontmatterData.category = meta.category;
35
+ }
36
+ return matter.stringify(content, frontmatterData);
37
+ }
38
+ export function serializeSkill(meta, content) {
39
+ return matter.stringify(content, {
40
+ name: meta.name,
41
+ description: meta.description,
42
+ 'allowed-tools': meta.allowedTools.join(', '),
43
+ model: meta.model,
44
+ });
45
+ }
@@ -0,0 +1,33 @@
1
+ export declare const CLAUDE_DIR: string;
2
+ export declare const CLAUDE_AGENTS_DIR: string;
3
+ export declare const CLAUDE_SKILLS_DIR: string;
4
+ export declare const CLAUDE_MD: string;
5
+ export declare const CONFIG_FILE: string;
6
+ /**
7
+ * Returns the path to the templates/ directory that ships with the package.
8
+ * Works both in dev (src/) and prod (dist/).
9
+ */
10
+ export declare function getTemplatesPath(): string;
11
+ /**
12
+ * Returns the external repo path if configured (for users who also have
13
+ * a private repo of agents/skills linked via config).
14
+ */
15
+ export declare function getExternalRepoPath(): string | null;
16
+ /**
17
+ * Returns the best source for agents: external repo > bundled templates.
18
+ */
19
+ export declare function getAgentsSource(): string | null;
20
+ /**
21
+ * Returns the best source for skills: external repo > bundled templates.
22
+ */
23
+ export declare function getSkillsSource(): string | null;
24
+ /**
25
+ * Returns the global CLAUDE.md source file.
26
+ */
27
+ export declare function getGlobalMdSource(): string | null;
28
+ /**
29
+ * Returns the path where new agents/skills should be saved.
30
+ * Prefers external repo if configured, otherwise saves to templates/.
31
+ */
32
+ export declare function getAgentsSavePath(): string;
33
+ export declare function getSkillsSavePath(): string;
@@ -0,0 +1,111 @@
1
+ import { homedir } from 'node:os';
2
+ import { join, resolve, dirname } from 'node:path';
3
+ import { existsSync, readFileSync } from 'node:fs';
4
+ import { fileURLToPath } from 'node:url';
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
7
+ // Package root: from dist/lib/ or src/lib/ go up to project root
8
+ function findPackageRoot() {
9
+ let dir = resolve(__dirname, '..', '..');
10
+ for (let i = 0; i < 5; i++) {
11
+ if (existsSync(join(dir, 'package.json')))
12
+ return dir;
13
+ dir = resolve(dir, '..');
14
+ }
15
+ return resolve(__dirname, '..', '..');
16
+ }
17
+ const PACKAGE_ROOT = findPackageRoot();
18
+ export const CLAUDE_DIR = join(homedir(), '.claude');
19
+ export const CLAUDE_AGENTS_DIR = join(CLAUDE_DIR, 'agents');
20
+ export const CLAUDE_SKILLS_DIR = join(CLAUDE_DIR, 'skills');
21
+ export const CLAUDE_MD = join(CLAUDE_DIR, 'CLAUDE.md');
22
+ export const CONFIG_FILE = join(CLAUDE_DIR, '.claudiao.json');
23
+ /**
24
+ * Returns the path to the templates/ directory that ships with the package.
25
+ * Works both in dev (src/) and prod (dist/).
26
+ */
27
+ export function getTemplatesPath() {
28
+ const templatesDir = join(PACKAGE_ROOT, 'templates');
29
+ if (existsSync(templatesDir))
30
+ return templatesDir;
31
+ return join(process.cwd(), 'templates');
32
+ }
33
+ /**
34
+ * Returns the external repo path if configured (for users who also have
35
+ * a private repo of agents/skills linked via config).
36
+ */
37
+ export function getExternalRepoPath() {
38
+ if (existsSync(CONFIG_FILE)) {
39
+ try {
40
+ const config = JSON.parse(readFileSync(CONFIG_FILE, 'utf-8'));
41
+ if (config.repoPath && existsSync(join(config.repoPath, 'agents'))) {
42
+ return config.repoPath;
43
+ }
44
+ }
45
+ catch {
46
+ // ignore
47
+ }
48
+ }
49
+ return null;
50
+ }
51
+ /**
52
+ * Returns the best source for agents: external repo > bundled templates.
53
+ */
54
+ export function getAgentsSource() {
55
+ const external = getExternalRepoPath();
56
+ if (external) {
57
+ const agentsDir = join(external, 'agents');
58
+ if (existsSync(agentsDir))
59
+ return agentsDir;
60
+ }
61
+ const bundled = join(getTemplatesPath(), 'agents');
62
+ if (existsSync(bundled))
63
+ return bundled;
64
+ return null;
65
+ }
66
+ /**
67
+ * Returns the best source for skills: external repo > bundled templates.
68
+ */
69
+ export function getSkillsSource() {
70
+ const external = getExternalRepoPath();
71
+ if (external) {
72
+ const skillsDir = join(external, 'skills');
73
+ if (existsSync(skillsDir))
74
+ return skillsDir;
75
+ }
76
+ const bundled = join(getTemplatesPath(), 'skills');
77
+ if (existsSync(bundled))
78
+ return bundled;
79
+ return null;
80
+ }
81
+ /**
82
+ * Returns the global CLAUDE.md source file.
83
+ */
84
+ export function getGlobalMdSource() {
85
+ const external = getExternalRepoPath();
86
+ if (external) {
87
+ const md = join(external, 'global-CLAUDE.md');
88
+ if (existsSync(md))
89
+ return md;
90
+ }
91
+ const bundled = join(getTemplatesPath(), 'global-CLAUDE.md');
92
+ if (existsSync(bundled))
93
+ return bundled;
94
+ return null;
95
+ }
96
+ /**
97
+ * Returns the path where new agents/skills should be saved.
98
+ * Prefers external repo if configured, otherwise saves to templates/.
99
+ */
100
+ export function getAgentsSavePath() {
101
+ const external = getExternalRepoPath();
102
+ if (external)
103
+ return join(external, 'agents');
104
+ return join(getTemplatesPath(), 'agents');
105
+ }
106
+ export function getSkillsSavePath() {
107
+ const external = getExternalRepoPath();
108
+ if (external)
109
+ return join(external, 'skills');
110
+ return join(getTemplatesPath(), 'skills');
111
+ }
@@ -0,0 +1,3 @@
1
+ import type { PluginInfo } from '../types.js';
2
+ export declare const PLUGINS: PluginInfo[];
3
+ export declare function getPlugin(name: string): PluginInfo | undefined;
@@ -0,0 +1,24 @@
1
+ export const PLUGINS = [
2
+ {
3
+ name: 'superpowers',
4
+ description: 'TDD enforced (red-green-refactor), debugging sistematico em 4 fases, code review por severidade, git worktrees isolados, parallel agents',
5
+ installCommand: 'claude /plugin install superpowers',
6
+ repo: 'https://github.com/obra/superpowers',
7
+ stars: '42k+',
8
+ },
9
+ {
10
+ name: 'get-shit-done',
11
+ description: 'Planejamento spec-driven com fases (discuss, plan, execute, verify), commits atomicos, milestones, e mapeamento de codebase existente',
12
+ installCommand: 'npx get-shit-done-cc@latest',
13
+ repo: 'https://github.com/gsd-build/get-shit-done',
14
+ },
15
+ {
16
+ name: 'claude-mem',
17
+ description: 'Memoria persistente entre sessoes. Captura decisoes, bugs resolvidos e contexto automaticamente via hooks. Armazena em SQLite + busca vetorial',
18
+ installCommand: 'claude /plugin install claude-mem',
19
+ repo: 'https://github.com/thedotmack/claude-mem',
20
+ },
21
+ ];
22
+ export function getPlugin(name) {
23
+ return PLUGINS.find(p => p.name === name);
24
+ }
@@ -0,0 +1,8 @@
1
+ export declare function ensureDir(dir: string): void;
2
+ export declare function isSymlink(path: string): boolean;
3
+ export declare function getSymlinkTarget(path: string): string | null;
4
+ export interface LinkResult {
5
+ status: 'created' | 'updated' | 'skipped' | 'backup';
6
+ }
7
+ export declare function createSymlink(source: string, target: string): LinkResult;
8
+ export declare function removeSymlink(path: string): boolean;
@@ -0,0 +1,56 @@
1
+ import { existsSync, lstatSync, mkdirSync, readlinkSync, rmSync, symlinkSync, renameSync } from 'node:fs';
2
+ import { dirname, resolve } from 'node:path';
3
+ export function ensureDir(dir) {
4
+ if (!existsSync(dir)) {
5
+ mkdirSync(dir, { recursive: true });
6
+ }
7
+ }
8
+ export function isSymlink(path) {
9
+ try {
10
+ return lstatSync(path).isSymbolicLink();
11
+ }
12
+ catch {
13
+ return false;
14
+ }
15
+ }
16
+ export function getSymlinkTarget(path) {
17
+ try {
18
+ return readlinkSync(path);
19
+ }
20
+ catch {
21
+ return null;
22
+ }
23
+ }
24
+ export function createSymlink(source, target) {
25
+ ensureDir(dirname(target));
26
+ if (isSymlink(target)) {
27
+ const currentTarget = getSymlinkTarget(target);
28
+ // Resolve both to absolute paths to handle relative symlinks
29
+ const resolvedCurrent = currentTarget ? resolve(dirname(target), currentTarget) : null;
30
+ const resolvedSource = resolve(source);
31
+ if (resolvedCurrent === resolvedSource) {
32
+ return { status: 'skipped' };
33
+ }
34
+ rmSync(target);
35
+ symlinkSync(source, target);
36
+ return { status: 'updated' };
37
+ }
38
+ if (existsSync(target)) {
39
+ renameSync(target, target + '.bak');
40
+ symlinkSync(source, target);
41
+ return { status: 'backup' };
42
+ }
43
+ symlinkSync(source, target);
44
+ return { status: 'created' };
45
+ }
46
+ export function removeSymlink(path) {
47
+ if (isSymlink(path)) {
48
+ rmSync(path);
49
+ // Restore backup if exists
50
+ if (existsSync(path + '.bak')) {
51
+ renameSync(path + '.bak', path);
52
+ }
53
+ return true;
54
+ }
55
+ return false;
56
+ }
@@ -0,0 +1,26 @@
1
+ export interface AgentTemplateInput {
2
+ name: string;
3
+ description: string;
4
+ title: string;
5
+ intro: string;
6
+ scope: string;
7
+ tools: string[];
8
+ model: string;
9
+ category: string;
10
+ whenToUse: string[];
11
+ principles: string[];
12
+ antiPatterns: string[];
13
+ }
14
+ export interface SkillTemplateInput {
15
+ name: string;
16
+ description: string;
17
+ title: string;
18
+ tools: string[];
19
+ model: string;
20
+ whenToActivate: string[];
21
+ templateContent: string;
22
+ }
23
+ export declare function renderAgentTemplate(input: AgentTemplateInput): string;
24
+ export declare function renderSkillTemplate(input: SkillTemplateInput): string;
25
+ export declare const DEFAULT_AGENT_TOOLS: string[];
26
+ export declare const DEFAULT_SKILL_TOOLS: string[];
@@ -0,0 +1,75 @@
1
+ export function renderAgentTemplate(input) {
2
+ const toolsStr = input.tools.join(', ');
3
+ const whenToUse = input.whenToUse.map(w => `- ${w}`).join('\n');
4
+ const principles = input.principles.map((p, i) => `${i + 1}. ${p}`).join('\n');
5
+ const antiPatterns = input.antiPatterns.map(a => `- ${a}`).join('\n');
6
+ return `---
7
+ name: ${input.name}
8
+ description: ${input.description}
9
+ tools: ${toolsStr}
10
+ model: ${input.model}
11
+ category: ${input.category}
12
+ ---
13
+
14
+ # ${input.title}
15
+
16
+ ${input.intro}
17
+
18
+ ## Antes de comecar
19
+
20
+ - Leia \`CLAUDE.md\` do projeto se existir
21
+ - Mapeie a arquitetura atual com Glob/Grep
22
+ - Identifique padroes e convencoes ja em uso
23
+
24
+ ## Escopo
25
+
26
+ ${input.scope}
27
+
28
+ ## Quando usar
29
+
30
+ ${whenToUse}
31
+
32
+ ## Ferramentas preferidas
33
+
34
+ - **Glob/Grep** para mapear arquitetura e padroes do projeto
35
+ - **Read** para analisar configs e modulos
36
+ - **Bash** para rodar comandos
37
+ - **Edit** para modificar codigo
38
+
39
+ ## Principios
40
+
41
+ ${principles}
42
+
43
+ ## Anti-Patterns que sempre flagra
44
+
45
+ ${antiPatterns}
46
+ `;
47
+ }
48
+ export function renderSkillTemplate(input) {
49
+ const toolsStr = input.tools.join(', ');
50
+ const whenToActivate = input.whenToActivate.map(w => `- ${w}`).join('\n');
51
+ return `---
52
+ name: ${input.name}
53
+ description: ${input.description}
54
+ allowed-tools: ${toolsStr}
55
+ model: ${input.model}
56
+ ---
57
+
58
+ # ${input.title}
59
+
60
+ ## Quando ativar
61
+
62
+ Ative quando o usuario estiver:
63
+ ${whenToActivate}
64
+
65
+ ## Template
66
+
67
+ ${input.templateContent}
68
+ `;
69
+ }
70
+ export const DEFAULT_AGENT_TOOLS = [
71
+ 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'Bash', 'WebFetch',
72
+ ];
73
+ export const DEFAULT_SKILL_TOOLS = [
74
+ 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'Bash',
75
+ ];
@@ -0,0 +1,25 @@
1
+ export interface AgentMeta {
2
+ name: string;
3
+ description: string;
4
+ tools: string[];
5
+ model: string;
6
+ category?: string;
7
+ }
8
+ export interface SkillMeta {
9
+ name: string;
10
+ description: string;
11
+ allowedTools: string[];
12
+ model: string;
13
+ }
14
+ export interface PluginInfo {
15
+ name: string;
16
+ description: string;
17
+ installCommand: string;
18
+ repo: string;
19
+ stars?: string;
20
+ }
21
+ export interface ClaudiaoConfig {
22
+ repoPath?: string;
23
+ installedAt: string;
24
+ version: string;
25
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "claudiao",
3
+ "version": "1.0.0",
4
+ "description": "Seu Claude Code no próximo nível. Agentes, skills e plugins em um comando.",
5
+ "type": "module",
6
+ "bin": {
7
+ "claudiao": "dist/index.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "dev": "tsx src/index.ts",
12
+ "prepublishOnly": "npm run build",
13
+ "typecheck": "tsc --noEmit",
14
+ "test": "vitest run"
15
+ },
16
+ "keywords": [
17
+ "claude",
18
+ "claude-code",
19
+ "ai",
20
+ "agents",
21
+ "skills",
22
+ "cli",
23
+ "developer-tools"
24
+ ],
25
+ "author": "Igor Fanticheli",
26
+ "license": "MIT",
27
+ "engines": {
28
+ "node": ">=18.0.0"
29
+ },
30
+ "files": [
31
+ "dist",
32
+ "templates"
33
+ ],
34
+ "dependencies": {
35
+ "@sindresorhus/slugify": "^3.0.0",
36
+ "chalk": "^5.3.0",
37
+ "commander": "^13.1.0",
38
+ "gray-matter": "^4.0.3",
39
+ "inquirer": "^12.6.0"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^22.15.0",
43
+ "tsx": "^4.19.0",
44
+ "typescript": "^5.8.0",
45
+ "vitest": "^4.1.0"
46
+ }
47
+ }