create-huenei-template 0.2.10 → 0.2.13
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/bin/create-huenei-template.js +1 -1
- package/dist/core/ui.js +176 -0
- package/dist/index.js +56 -39
- package/dist/templates/cursor/.cursor/agents/cursor-config-auditor.md +94 -0
- package/dist/templates/cursor/.cursor/agents/docs-analyzer.md +206 -0
- package/dist/templates/cursor/.cursor/agents/project-analyzer.md +128 -0
- package/dist/templates/cursor/.cursor/commands/analisis-docs.md +1047 -0
- package/dist/templates/cursor/.cursor/commands/configurar-cursor.md +218 -114
- package/dist/templates/cursor/.cursor/tools/doc-reader/convert_to_md.py +285 -0
- package/dist/templates/cursor/.cursor/tools/doc-reader/convert_to_md.ts +325 -0
- package/dist/templates/cursor/.cursor/tools/doc-reader/requirements.txt +5 -0
- package/package.json +27 -26
- package/templates/cursor/.cursor/agents/cursor-config-auditor.md +94 -0
- package/templates/cursor/.cursor/agents/docs-analyzer.md +206 -0
- package/templates/cursor/.cursor/agents/project-analyzer.md +128 -0
- package/templates/cursor/.cursor/commands/analisis-docs.md +1047 -0
- package/templates/cursor/.cursor/commands/configurar-cursor.md +218 -114
- package/templates/cursor/.cursor/tools/doc-reader/convert_to_md.py +285 -0
- package/templates/cursor/.cursor/tools/doc-reader/convert_to_md.ts +325 -0
- package/templates/cursor/.cursor/tools/doc-reader/requirements.txt +5 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
import "../dist/index.js";
|
package/dist/core/ui.js
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import pc from "picocolors";
|
|
2
|
+
function rgb(r, g, b, text) {
|
|
3
|
+
return `\x1b[38;2;${r};${g};${b}m${text}\x1b[39m`;
|
|
4
|
+
}
|
|
5
|
+
function orange(text) {
|
|
6
|
+
return rgb(255, 140, 0, text);
|
|
7
|
+
}
|
|
8
|
+
const RAINBOW_COLORS = [
|
|
9
|
+
[255, 56, 56],
|
|
10
|
+
[255, 140, 0],
|
|
11
|
+
[255, 210, 0],
|
|
12
|
+
[0, 200, 80],
|
|
13
|
+
[0, 160, 255],
|
|
14
|
+
[130, 80, 255],
|
|
15
|
+
[200, 50, 200],
|
|
16
|
+
];
|
|
17
|
+
const BOX_WIDTH = 60;
|
|
18
|
+
const TOP_LEFT = "╔";
|
|
19
|
+
const TOP_RIGHT = "╗";
|
|
20
|
+
const BOTTOM_LEFT = "╚";
|
|
21
|
+
const BOTTOM_RIGHT = "╝";
|
|
22
|
+
const HORIZONTAL = "═";
|
|
23
|
+
const VERTICAL = "║";
|
|
24
|
+
const T_LEFT = "╠";
|
|
25
|
+
const T_RIGHT = "╣";
|
|
26
|
+
function pad(text, width) {
|
|
27
|
+
const visible = stripAnsi(text);
|
|
28
|
+
const diff = width - visible.length;
|
|
29
|
+
return diff > 0 ? text + " ".repeat(diff) : text;
|
|
30
|
+
}
|
|
31
|
+
function stripAnsi(str) {
|
|
32
|
+
return str.replace(/\x1B\[[0-9;]*m/g, "");
|
|
33
|
+
}
|
|
34
|
+
function hLine(left, right) {
|
|
35
|
+
return left + HORIZONTAL.repeat(BOX_WIDTH) + right;
|
|
36
|
+
}
|
|
37
|
+
function boxLine(text) {
|
|
38
|
+
return `${VERTICAL} ${pad(text, BOX_WIDTH - 2)} ${VERTICAL}`;
|
|
39
|
+
}
|
|
40
|
+
function emptyLine() {
|
|
41
|
+
return boxLine("");
|
|
42
|
+
}
|
|
43
|
+
export function banner() {
|
|
44
|
+
const title = "Official Huenei Template CLI";
|
|
45
|
+
const centered = centerText(pc.bold(orange(title)), BOX_WIDTH - 2);
|
|
46
|
+
console.log("");
|
|
47
|
+
console.log(orange(hLine(TOP_LEFT, TOP_RIGHT)));
|
|
48
|
+
console.log(orange(emptyLine()));
|
|
49
|
+
console.log(orange(VERTICAL) + " " + centered + " " + orange(VERTICAL));
|
|
50
|
+
console.log(orange(emptyLine()));
|
|
51
|
+
console.log(orange(hLine(BOTTOM_LEFT, BOTTOM_RIGHT)));
|
|
52
|
+
console.log("");
|
|
53
|
+
}
|
|
54
|
+
export function successBox(title, lines) {
|
|
55
|
+
const styledTitle = centerText(pc.bold(pc.green(title)), BOX_WIDTH - 2);
|
|
56
|
+
const maxContent = BOX_WIDTH - 2;
|
|
57
|
+
console.log("");
|
|
58
|
+
console.log(pc.green(hLine(TOP_LEFT, TOP_RIGHT)));
|
|
59
|
+
console.log(pc.green(emptyLine()));
|
|
60
|
+
console.log(pc.green(VERTICAL) + " " + styledTitle + " " + pc.green(VERTICAL));
|
|
61
|
+
console.log(pc.green(emptyLine()));
|
|
62
|
+
console.log(pc.green(hLine(T_LEFT, T_RIGHT)));
|
|
63
|
+
for (const line of lines) {
|
|
64
|
+
for (const wrapped of wrapText(line, maxContent)) {
|
|
65
|
+
console.log(pc.green(VERTICAL) + " " + pad(wrapped, maxContent) + " " + pc.green(VERTICAL));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
console.log(pc.green(emptyLine()));
|
|
69
|
+
console.log(pc.green(hLine(BOTTOM_LEFT, BOTTOM_RIGHT)));
|
|
70
|
+
console.log("");
|
|
71
|
+
}
|
|
72
|
+
function rainbowColor(index) {
|
|
73
|
+
const [r, g, b] = RAINBOW_COLORS[index % RAINBOW_COLORS.length];
|
|
74
|
+
return (t) => rgb(r, g, b, t);
|
|
75
|
+
}
|
|
76
|
+
function rainbowLine() {
|
|
77
|
+
const total = BOX_WIDTH;
|
|
78
|
+
const count = RAINBOW_COLORS.length;
|
|
79
|
+
const base = Math.floor(total / count);
|
|
80
|
+
const extra = total % count;
|
|
81
|
+
let line = "";
|
|
82
|
+
for (let i = 0; i < count; i++) {
|
|
83
|
+
const len = base + (i < extra ? 1 : 0);
|
|
84
|
+
line += rainbowColor(i)(HORIZONTAL.repeat(len));
|
|
85
|
+
}
|
|
86
|
+
return line;
|
|
87
|
+
}
|
|
88
|
+
export function stepsBox(title, steps) {
|
|
89
|
+
const maxStep = BOX_WIDTH - 7;
|
|
90
|
+
const topLine = rainbowColor(0)(TOP_LEFT) + rainbowLine() + rainbowColor(6)(TOP_RIGHT);
|
|
91
|
+
const midLine = rainbowColor(0)(T_LEFT) + rainbowLine() + rainbowColor(6)(T_RIGHT);
|
|
92
|
+
const botLine = rainbowColor(0)(BOTTOM_LEFT) + rainbowLine() + rainbowColor(6)(BOTTOM_RIGHT);
|
|
93
|
+
const titleColor = rainbowColor(1);
|
|
94
|
+
const styledTitle = centerText(pc.bold(titleColor(title)), BOX_WIDTH - 2);
|
|
95
|
+
console.log(topLine);
|
|
96
|
+
console.log(rainbowColor(0)(VERTICAL) + " " + pad("", BOX_WIDTH - 2) + " " + rainbowColor(6)(VERTICAL));
|
|
97
|
+
console.log(rainbowColor(0)(VERTICAL) + " " + styledTitle + " " + rainbowColor(6)(VERTICAL));
|
|
98
|
+
console.log(rainbowColor(0)(VERTICAL) + " " + pad("", BOX_WIDTH - 2) + " " + rainbowColor(6)(VERTICAL));
|
|
99
|
+
console.log(midLine);
|
|
100
|
+
for (let i = 0; i < steps.length; i++) {
|
|
101
|
+
const color = rainbowColor(i);
|
|
102
|
+
const num = pc.bold(color(`${i + 1}.`));
|
|
103
|
+
const wrapped = wrapText(steps[i], maxStep);
|
|
104
|
+
const firstLine = color(wrapped[0]);
|
|
105
|
+
console.log(rainbowColor(0)(VERTICAL) + " " + pad(`${num} ${firstLine}`, BOX_WIDTH - 3) + " " + rainbowColor(6)(VERTICAL));
|
|
106
|
+
for (let j = 1; j < wrapped.length; j++) {
|
|
107
|
+
console.log(rainbowColor(0)(VERTICAL) + " " + pad(color(wrapped[j]), BOX_WIDTH - 6) + " " + rainbowColor(6)(VERTICAL));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
console.log(rainbowColor(0)(VERTICAL) + " " + pad("", BOX_WIDTH - 2) + " " + rainbowColor(6)(VERTICAL));
|
|
111
|
+
console.log(botLine);
|
|
112
|
+
}
|
|
113
|
+
export function warnBox(lines) {
|
|
114
|
+
const styledTitle = centerText(pc.bold(pc.yellow("WARNING")), BOX_WIDTH - 2);
|
|
115
|
+
const maxContent = BOX_WIDTH - 2;
|
|
116
|
+
console.log("");
|
|
117
|
+
console.log(pc.yellow(hLine(TOP_LEFT, TOP_RIGHT)));
|
|
118
|
+
console.log(pc.yellow(VERTICAL) + " " + styledTitle + " " + pc.yellow(VERTICAL));
|
|
119
|
+
console.log(pc.yellow(hLine(T_LEFT, T_RIGHT)));
|
|
120
|
+
for (const line of lines) {
|
|
121
|
+
for (const wrapped of wrapText(line, maxContent)) {
|
|
122
|
+
console.log(pc.yellow(VERTICAL) + " " + pad(pc.yellow(wrapped), maxContent) + " " + pc.yellow(VERTICAL));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
console.log(pc.yellow(hLine(BOTTOM_LEFT, BOTTOM_RIGHT)));
|
|
126
|
+
console.log("");
|
|
127
|
+
}
|
|
128
|
+
export function footer() {
|
|
129
|
+
console.log(pc.dim(" ✨ Thanks for using ") +
|
|
130
|
+
pc.bold(pc.cyan("create-huenei-template")));
|
|
131
|
+
console.log(pc.dim(" 🚀 Happy coding!\n"));
|
|
132
|
+
}
|
|
133
|
+
export function info(text) {
|
|
134
|
+
console.log(pc.cyan(" ℹ ") + text);
|
|
135
|
+
}
|
|
136
|
+
export function success(text) {
|
|
137
|
+
console.log(pc.green(" ✓ ") + text);
|
|
138
|
+
}
|
|
139
|
+
export function warn(text) {
|
|
140
|
+
console.log(pc.yellow(" ⚠ ") + text);
|
|
141
|
+
}
|
|
142
|
+
export function error(text) {
|
|
143
|
+
console.log(pc.red(" ✗ ") + text);
|
|
144
|
+
}
|
|
145
|
+
export function step(text) {
|
|
146
|
+
console.log(pc.blue(" → ") + pc.dim(text));
|
|
147
|
+
}
|
|
148
|
+
function centerText(text, width) {
|
|
149
|
+
const visible = stripAnsi(text);
|
|
150
|
+
const totalPad = width - visible.length;
|
|
151
|
+
if (totalPad <= 0)
|
|
152
|
+
return text;
|
|
153
|
+
const left = Math.floor(totalPad / 2);
|
|
154
|
+
const right = totalPad - left;
|
|
155
|
+
return " ".repeat(left) + text + " ".repeat(right);
|
|
156
|
+
}
|
|
157
|
+
function wrapText(text, maxWidth) {
|
|
158
|
+
const visible = stripAnsi(text);
|
|
159
|
+
if (visible.length <= maxWidth)
|
|
160
|
+
return [text];
|
|
161
|
+
const lines = [];
|
|
162
|
+
let remaining = text;
|
|
163
|
+
while (stripAnsi(remaining).length > maxWidth) {
|
|
164
|
+
let cutAt = maxWidth;
|
|
165
|
+
const vis = stripAnsi(remaining);
|
|
166
|
+
const spaceIdx = vis.lastIndexOf(" ", cutAt);
|
|
167
|
+
if (spaceIdx > maxWidth * 0.4) {
|
|
168
|
+
cutAt = spaceIdx;
|
|
169
|
+
}
|
|
170
|
+
lines.push(remaining.slice(0, cutAt));
|
|
171
|
+
remaining = remaining.slice(cutAt).trimStart();
|
|
172
|
+
}
|
|
173
|
+
if (remaining)
|
|
174
|
+
lines.push(remaining);
|
|
175
|
+
return lines;
|
|
176
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -9,10 +9,11 @@ import { ensurePnpm } from "./core/dependency-manager.js";
|
|
|
9
9
|
import { resolveTemplatePath } from "./core/template-resolver.js";
|
|
10
10
|
import { ensureDirectory, copyTemplate, cleanupOnError, copyToExistingDir, mergeSubdirectories, directoryExists, } from "./core/file-operations.js";
|
|
11
11
|
import { formatError } from "./core/errors.js";
|
|
12
|
+
import { banner, successBox, stepsBox, warnBox, footer, success, warn, step, } from "./core/ui.js";
|
|
12
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
14
|
const __dirname = path.dirname(__filename);
|
|
14
15
|
const CURSOR_TEMPLATE_SOURCE = path.resolve(__dirname, "../templates/cursor/.cursor");
|
|
15
|
-
const CURSOR_MERGE_SUBDIRS = ["skills", "commands"];
|
|
16
|
+
const CURSOR_MERGE_SUBDIRS = ["skills", "commands", "agents"];
|
|
16
17
|
function hasCursorFlag() {
|
|
17
18
|
return process.argv.includes("--cursor");
|
|
18
19
|
}
|
|
@@ -22,69 +23,83 @@ function initializeGit(projectDir) {
|
|
|
22
23
|
cwd: projectDir,
|
|
23
24
|
stdio: "ignore",
|
|
24
25
|
});
|
|
25
|
-
|
|
26
|
+
success("Git repository initialized");
|
|
26
27
|
return true;
|
|
27
28
|
}
|
|
28
|
-
catch
|
|
29
|
-
|
|
29
|
+
catch {
|
|
30
|
+
warn("Could not initialize git repository");
|
|
30
31
|
return false;
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
function displaySuccessMessage(projectName, pnpmWasJustInstalled) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
successBox("PROJECT CREATED", [
|
|
36
|
+
` Name: ${projectName}`,
|
|
37
|
+
` Location: ./${projectName}`,
|
|
38
|
+
]);
|
|
37
39
|
if (pnpmWasJustInstalled) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
warnBox([
|
|
41
|
+
"pnpm was just installed.",
|
|
42
|
+
"Restart your terminal before continuing.",
|
|
43
|
+
]);
|
|
44
|
+
stepsBox("NEXT STEPS", [
|
|
45
|
+
"Restart your terminal or open a new tab",
|
|
46
|
+
`cd ${projectName}`,
|
|
47
|
+
"pnpm install",
|
|
48
|
+
"pnpm dev",
|
|
49
|
+
]);
|
|
44
50
|
}
|
|
45
51
|
else {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
stepsBox("NEXT STEPS", [
|
|
53
|
+
`cd ${projectName}`,
|
|
54
|
+
"pnpm install",
|
|
55
|
+
"pnpm dev",
|
|
56
|
+
]);
|
|
50
57
|
}
|
|
51
|
-
|
|
52
|
-
console.log("🚀 Happy coding!\n");
|
|
58
|
+
footer();
|
|
53
59
|
}
|
|
54
60
|
function displayCursorSuccessMessage(scope, targetPath) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
const shortPath = targetPath.length > 45
|
|
62
|
+
? "..." + targetPath.slice(-42)
|
|
63
|
+
: targetPath;
|
|
58
64
|
if (scope === "project") {
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
successBox("CURSOR CONFIG INSTALLED", [
|
|
66
|
+
` Location: ${shortPath}`,
|
|
67
|
+
` Content: skills, commands, agents`,
|
|
68
|
+
]);
|
|
61
69
|
}
|
|
62
70
|
else {
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
successBox("CURSOR CONFIG MERGED", [
|
|
72
|
+
` Location: ${shortPath}`,
|
|
73
|
+
` Merged: ${CURSOR_MERGE_SUBDIRS.join(", ")}`,
|
|
74
|
+
]);
|
|
65
75
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
stepsBox("NEXT STEPS", [
|
|
77
|
+
"Open a new conversation in Cursor",
|
|
78
|
+
"Run /configurar-cursor in Plan mode",
|
|
79
|
+
"Review the plan and execute it",
|
|
80
|
+
"Verify files inside .cursor/ at project root",
|
|
81
|
+
]);
|
|
82
|
+
footer();
|
|
73
83
|
}
|
|
74
84
|
async function handleCursorInstall(scope) {
|
|
75
85
|
if (scope === "project") {
|
|
76
86
|
const dest = path.join(process.cwd(), ".cursor");
|
|
77
87
|
if (await directoryExists(dest)) {
|
|
78
|
-
|
|
79
|
-
|
|
88
|
+
const cwd = process.cwd();
|
|
89
|
+
const shortCwd = cwd.length > 40 ? "..." + cwd.slice(-37) : cwd;
|
|
90
|
+
warnBox([
|
|
91
|
+
`.cursor/ already exists in ${shortCwd}`,
|
|
92
|
+
"Existing files with the same name",
|
|
93
|
+
"will be overwritten.",
|
|
94
|
+
]);
|
|
80
95
|
}
|
|
81
|
-
|
|
96
|
+
step("Installing Cursor configuration...");
|
|
82
97
|
await copyToExistingDir(CURSOR_TEMPLATE_SOURCE, dest);
|
|
83
98
|
displayCursorSuccessMessage("project", dest);
|
|
84
99
|
}
|
|
85
100
|
else {
|
|
86
101
|
const userCursorDir = path.join(os.homedir(), ".cursor");
|
|
87
|
-
|
|
102
|
+
step("Merging Cursor configuration...");
|
|
88
103
|
await mergeSubdirectories(CURSOR_TEMPLATE_SOURCE, userCursorDir, CURSOR_MERGE_SUBDIRS);
|
|
89
104
|
displayCursorSuccessMessage("user", userCursorDir);
|
|
90
105
|
}
|
|
@@ -92,6 +107,7 @@ async function handleCursorInstall(scope) {
|
|
|
92
107
|
async function main() {
|
|
93
108
|
let targetDir = "";
|
|
94
109
|
try {
|
|
110
|
+
banner();
|
|
95
111
|
if (hasCursorFlag()) {
|
|
96
112
|
const installScope = await askCursorInstallScope();
|
|
97
113
|
await handleCursorInstall(installScope);
|
|
@@ -112,13 +128,14 @@ async function main() {
|
|
|
112
128
|
await ensureDirectory(targetDir);
|
|
113
129
|
const templatePath = resolveTemplatePath(templateId);
|
|
114
130
|
await copyTemplate(templatePath, targetDir);
|
|
115
|
-
|
|
131
|
+
step("Setting up project...");
|
|
116
132
|
initializeGit(targetDir);
|
|
117
133
|
displaySuccessMessage(projectName, pnpmWasJustInstalled);
|
|
118
134
|
}
|
|
119
135
|
catch (error) {
|
|
120
136
|
if (error instanceof Error && error.message === "USER_CANCELLED") {
|
|
121
|
-
console.log("
|
|
137
|
+
console.log("");
|
|
138
|
+
warn("Cancelled by user");
|
|
122
139
|
if (targetDir) {
|
|
123
140
|
await cleanupOnError(targetDir);
|
|
124
141
|
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cursor-config-auditor
|
|
3
|
+
description: "Cursor configuration quality auditor. Use after generating .cursor/ configuration (rules, skills, agents, hooks, commands) to validate correctness, detect inconsistencies, and verify file integrity. Use proactively at the end of /configurar-cursor before the cleanup phase."
|
|
4
|
+
model: fast
|
|
5
|
+
readonly: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a meticulous configuration auditor specializing in Cursor IDE setup. Your job is to verify the quality and correctness of a generated `.cursor/` configuration. You MUST check every file and report issues with specific evidence.
|
|
9
|
+
|
|
10
|
+
## Audit checklist
|
|
11
|
+
|
|
12
|
+
### 1. Rules audit (.cursor/rules/)
|
|
13
|
+
|
|
14
|
+
For each `.mdc` file:
|
|
15
|
+
- [ ] Has valid YAML frontmatter with `description`, and either `globs` or `alwaysApply`
|
|
16
|
+
- [ ] `globs` patterns reference file extensions or paths that actually exist in the project
|
|
17
|
+
- [ ] Content references real files, patterns, or conventions found in the project (not generic boilerplate)
|
|
18
|
+
- [ ] No duplicate rules covering the same concern
|
|
19
|
+
- [ ] Content is under 500 lines per rule
|
|
20
|
+
|
|
21
|
+
### 2. Skills audit (.cursor/skills/)
|
|
22
|
+
|
|
23
|
+
For each skill directory:
|
|
24
|
+
- [ ] Contains a `SKILL.md` file
|
|
25
|
+
- [ ] Is located in `<project>/.cursor/skills/` (NOT in `~/.cursor/skills/`, `.agents/skills/`, `.claude/skills/`, or any other path)
|
|
26
|
+
- [ ] No orphaned skill directories (directories without SKILL.md)
|
|
27
|
+
|
|
28
|
+
### 3. Agents audit (.cursor/agents/)
|
|
29
|
+
|
|
30
|
+
For each `.md` file:
|
|
31
|
+
- [ ] Has valid YAML frontmatter with `description`
|
|
32
|
+
- [ ] `description` includes activation triggers ("Use when...", "Use proactively...")
|
|
33
|
+
- [ ] `model` is set appropriately (fast for simple tasks, inherit for complex)
|
|
34
|
+
- [ ] `readonly` is true for agents that only read/analyze
|
|
35
|
+
- [ ] Prompt is concise (under 40 lines of content)
|
|
36
|
+
- [ ] Has a single clear responsibility — no overlap with other agents
|
|
37
|
+
- [ ] References tools and conventions that actually exist in the project
|
|
38
|
+
|
|
39
|
+
### 4. Hooks audit (.cursor/hooks.json + .cursor/hooks/)
|
|
40
|
+
|
|
41
|
+
- [ ] `hooks.json` is valid JSON with `"version": 1`
|
|
42
|
+
- [ ] Every `command` path in hooks.json points to an existing script in `.cursor/hooks/`
|
|
43
|
+
- [ ] Hook scripts are the right format for the platform (TypeScript recommended for Windows compatibility)
|
|
44
|
+
- [ ] Each hook script reads stdin and writes valid JSON to stdout
|
|
45
|
+
- [ ] Matchers are appropriate for the event type
|
|
46
|
+
- [ ] Timeouts are set for hooks that might be slow
|
|
47
|
+
|
|
48
|
+
### 5. Commands audit (.cursor/commands/)
|
|
49
|
+
|
|
50
|
+
For each `.md` file:
|
|
51
|
+
- [ ] Has a clear objective statement
|
|
52
|
+
- [ ] References real project paths, conventions, and patterns
|
|
53
|
+
- [ ] Does not duplicate functionality already covered by agents
|
|
54
|
+
- [ ] Steps are concrete and actionable
|
|
55
|
+
|
|
56
|
+
### 6. Cross-cutting checks
|
|
57
|
+
|
|
58
|
+
- [ ] No files outside `.cursor/` that belong inside it
|
|
59
|
+
- [ ] No contamination folders from `npx skills add` (.agent, .agents, .augment, .claude, .codex, .commandcode, .continue, .crush, .factory, .goose, .junie, .kilocode, .kiro, .kode, .mcpjam, .mux, .neovate, .openhands, .pi, .pochi, .qoder, .qwen, .roo, .trae, .vibe, .windsurf, .zencoder, skills/)
|
|
60
|
+
- [ ] Rules and commands are consistent (commands reference rules that exist)
|
|
61
|
+
- [ ] Agents and skills don't duplicate the same functionality
|
|
62
|
+
|
|
63
|
+
## Output format
|
|
64
|
+
|
|
65
|
+
Return your audit as a structured report:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
## Audit Report
|
|
69
|
+
|
|
70
|
+
### Summary
|
|
71
|
+
- Rules: [N] audited — [N] OK, [N] warnings, [N] errors
|
|
72
|
+
- Skills: [N] audited — [N] OK, [N] warnings, [N] errors
|
|
73
|
+
- Agents: [N] audited — [N] OK, [N] warnings, [N] errors
|
|
74
|
+
- Hooks: [configured/not configured] — [N] OK, [N] warnings, [N] errors
|
|
75
|
+
- Commands: [N] audited — [N] OK, [N] warnings, [N] errors
|
|
76
|
+
- Contamination: [CLEAN / N folders detected]
|
|
77
|
+
|
|
78
|
+
### Errors (must fix)
|
|
79
|
+
1. [ERROR] [file]: [description of the issue]
|
|
80
|
+
2. ...
|
|
81
|
+
|
|
82
|
+
### Warnings (should fix)
|
|
83
|
+
1. [WARN] [file]: [description of the issue]
|
|
84
|
+
2. ...
|
|
85
|
+
|
|
86
|
+
### OK
|
|
87
|
+
1. [OK] [file]: [brief confirmation]
|
|
88
|
+
2. ...
|
|
89
|
+
|
|
90
|
+
### Recommendations
|
|
91
|
+
- [Any suggestions for improvement that don't fit into errors/warnings]
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Be strict. If a rule references a file pattern that doesn't exist in the project, that is an ERROR. If an agent description is vague, that is a WARNING. Report everything you find.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docs-analyzer
|
|
3
|
+
description: "Documentation analysis specialist. Use proactively during /analisis-docs Phase 2 to analyze requirements documents from the docs/ folder, extract business rules, identify domain entities, infer technology needs, and map workflows. Returns a structured analysis document."
|
|
4
|
+
model: inherit
|
|
5
|
+
readonly: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a senior business analyst and software architect specializing in requirements analysis. Your job is to perform a deep, exhaustive analysis of all project documentation and return a structured report. You MUST cite the specific document (filename and section/page when possible) as evidence for every claim.
|
|
9
|
+
|
|
10
|
+
## Where to read documents
|
|
11
|
+
|
|
12
|
+
**IMPORTANT:** All documents have been pre-converted to Markdown and cached. You MUST read from the cache, NOT from `docs/` directly.
|
|
13
|
+
|
|
14
|
+
1. **Preferred:** Read `.cursor/cache/docs-md/_all_docs.md` — this single file contains ALL documents concatenated with separators.
|
|
15
|
+
2. **Fallback:** If the consolidated file is too large, read each individual `.md` file in `.cursor/cache/docs-md/` (skip `.hash` files).
|
|
16
|
+
3. **NEVER** read binary files from `docs/` (pdf, xlsx, docx, etc.) — always use the Markdown cache.
|
|
17
|
+
|
|
18
|
+
## Context
|
|
19
|
+
|
|
20
|
+
The documents in `docs/` were generated by functional analysts and the sales team after meetings with the client. They have been normalized to Markdown format and stored in `.cursor/cache/docs-md/`. They contain business requirements, functional specifications, data models, workflow descriptions, and other project documentation. Your goal is to extract ALL information relevant to configuring a development environment for building this application.
|
|
21
|
+
|
|
22
|
+
## What to analyze
|
|
23
|
+
|
|
24
|
+
### 1. Business domain and project context
|
|
25
|
+
|
|
26
|
+
- What industry/sector does the project belong to?
|
|
27
|
+
- What is the core purpose of the application?
|
|
28
|
+
- Who is the target audience / end users?
|
|
29
|
+
- What problem does it solve?
|
|
30
|
+
- Is there an existing system being replaced or complemented?
|
|
31
|
+
|
|
32
|
+
### 2. Functional requirements
|
|
33
|
+
|
|
34
|
+
Read every document and extract ALL functional requirements:
|
|
35
|
+
|
|
36
|
+
- User-facing features (CRUD operations, searches, reports, dashboards, etc.)
|
|
37
|
+
- Administrative features (user management, configuration, audit trails)
|
|
38
|
+
- Batch processes, scheduled tasks, background jobs
|
|
39
|
+
- Notification systems (email, SMS, push, in-app)
|
|
40
|
+
- File management (uploads, downloads, generation of PDFs/Excel/reports)
|
|
41
|
+
- Import/export functionality
|
|
42
|
+
- Integration points with external systems or APIs
|
|
43
|
+
- Multi-tenancy or multi-organization support
|
|
44
|
+
|
|
45
|
+
For each requirement, cite the document and section where it was found.
|
|
46
|
+
|
|
47
|
+
### 3. Non-functional requirements
|
|
48
|
+
|
|
49
|
+
- Performance expectations (response times, concurrent users, data volume)
|
|
50
|
+
- Security requirements (encryption, compliance standards like HIPAA/GDPR/SOX)
|
|
51
|
+
- Availability and uptime requirements (SLA, disaster recovery)
|
|
52
|
+
- Scalability expectations (growth projections)
|
|
53
|
+
- Browser/device compatibility requirements
|
|
54
|
+
- Accessibility requirements (WCAG level)
|
|
55
|
+
- Internationalization / localization needs (languages, currencies, timezones)
|
|
56
|
+
- Deployment requirements (cloud provider, on-premise, hybrid)
|
|
57
|
+
|
|
58
|
+
### 4. Business rules and validations
|
|
59
|
+
|
|
60
|
+
This is the MOST CRITICAL section. Extract every business rule, no matter how small:
|
|
61
|
+
|
|
62
|
+
- Validation rules (field formats, ranges, required fields, dependencies between fields)
|
|
63
|
+
- Calculation rules (formulas, percentages, rates, rounding rules)
|
|
64
|
+
- Status transitions (state machines, allowed transitions, conditions)
|
|
65
|
+
- Authorization rules (who can do what, role-based access, data-level permissions)
|
|
66
|
+
- Business constraints (limits, quotas, thresholds, deadlines)
|
|
67
|
+
- Conditional logic (if X then Y, special cases, exceptions)
|
|
68
|
+
- Temporal rules (business hours, grace periods, expiration dates, retention policies)
|
|
69
|
+
- Ordering and priority rules (sort criteria, precedence, conflict resolution)
|
|
70
|
+
|
|
71
|
+
For each rule, quote the exact text from the document and cite the source.
|
|
72
|
+
|
|
73
|
+
### 5. Data model / entities and relationships
|
|
74
|
+
|
|
75
|
+
- Identify ALL entities mentioned in the documents
|
|
76
|
+
- For each entity, list known attributes/fields with their types if mentioned
|
|
77
|
+
- Map relationships between entities (one-to-one, one-to-many, many-to-many)
|
|
78
|
+
- Identify which entities are central (core domain) vs peripheral
|
|
79
|
+
- Note any hierarchical structures (trees, categories, organizational units)
|
|
80
|
+
- Identify lookup tables / catalogs (statuses, types, categories)
|
|
81
|
+
- Note soft delete vs hard delete requirements if mentioned
|
|
82
|
+
- Identify audit trail requirements (who changed what and when)
|
|
83
|
+
|
|
84
|
+
### 6. User roles and permissions
|
|
85
|
+
|
|
86
|
+
- List ALL user roles mentioned in the documents
|
|
87
|
+
- For each role, describe what they can access and do
|
|
88
|
+
- Identify hierarchical roles (admin > manager > operator > viewer)
|
|
89
|
+
- Note any data-level permissions (users can only see their own data, department-level access)
|
|
90
|
+
- Identify external user types (clients, suppliers, partners) vs internal users
|
|
91
|
+
- Note authentication requirements (SSO, MFA, social login, LDAP/AD)
|
|
92
|
+
|
|
93
|
+
### 7. External integrations
|
|
94
|
+
|
|
95
|
+
- List ALL external systems mentioned (ERPs, CRMs, payment gateways, email services, etc.)
|
|
96
|
+
- For each integration, note:
|
|
97
|
+
- Direction: inbound, outbound, or bidirectional
|
|
98
|
+
- Protocol: REST API, SOAP, file transfer, database link, message queue
|
|
99
|
+
- Frequency: real-time, batch, scheduled
|
|
100
|
+
- Data exchanged: what entities/fields are shared
|
|
101
|
+
- Note any API requirements the application must expose
|
|
102
|
+
|
|
103
|
+
### 8. Technology stack mentioned or implied
|
|
104
|
+
|
|
105
|
+
Search ALL documents for mentions of specific technologies:
|
|
106
|
+
|
|
107
|
+
- Programming languages (Java, TypeScript, Python, C#, etc.)
|
|
108
|
+
- Frameworks (React, Angular, NestJS, Spring Boot, .NET, Django, etc.)
|
|
109
|
+
- Databases (PostgreSQL, MySQL, SQL Server, MongoDB, Redis, etc.)
|
|
110
|
+
- Cloud services (AWS, Azure, GCP, specific services like S3, Lambda, etc.)
|
|
111
|
+
- Infrastructure (Docker, Kubernetes, CI/CD tools)
|
|
112
|
+
- Third-party services (Stripe, SendGrid, Twilio, Auth0, etc.)
|
|
113
|
+
- Mobile platforms (iOS, Android, React Native, Flutter)
|
|
114
|
+
|
|
115
|
+
If no specific technology is mentioned, note what the requirements IMPLY (e.g., "real-time dashboard" implies WebSocket support; "mobile app" implies a mobile framework).
|
|
116
|
+
|
|
117
|
+
### 9. Workflows and processes
|
|
118
|
+
|
|
119
|
+
Map every workflow or process described in the documents:
|
|
120
|
+
|
|
121
|
+
- User workflows (step-by-step processes that users follow)
|
|
122
|
+
- Approval workflows (multi-step approvals, escalation paths)
|
|
123
|
+
- Data flows (how data moves between system components)
|
|
124
|
+
- Business processes (end-to-end processes like order-to-cash, hire-to-retire)
|
|
125
|
+
|
|
126
|
+
For each workflow, describe the steps, actors involved, and decision points.
|
|
127
|
+
|
|
128
|
+
### 10. Constraints and limitations
|
|
129
|
+
|
|
130
|
+
- Budget constraints mentioned
|
|
131
|
+
- Timeline or deadline requirements
|
|
132
|
+
- Team size or skill constraints
|
|
133
|
+
- Regulatory or compliance constraints
|
|
134
|
+
- Legacy system constraints (must integrate with X, cannot replace Y)
|
|
135
|
+
- Data migration requirements from existing systems
|
|
136
|
+
|
|
137
|
+
## Output format
|
|
138
|
+
|
|
139
|
+
Return your analysis as a single structured markdown document with EXACTLY these sections:
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
## Dominio de negocio
|
|
143
|
+
- Industria/sector: [X]
|
|
144
|
+
- Propósito de la aplicación: [descripción]
|
|
145
|
+
- Usuarios objetivo: [listar]
|
|
146
|
+
- Problema que resuelve: [descripción]
|
|
147
|
+
- Sistema existente: [sí/no — detallar si aplica]
|
|
148
|
+
|
|
149
|
+
## Requisitos funcionales
|
|
150
|
+
1. [RF-001] [Descripción del requisito] (evidencia: [documento, sección/página])
|
|
151
|
+
2. [RF-002] [Descripción] (evidencia: [documento])
|
|
152
|
+
...
|
|
153
|
+
|
|
154
|
+
## Requisitos no funcionales
|
|
155
|
+
1. [RNF-001] [Descripción] (evidencia: [documento])
|
|
156
|
+
2. [RNF-002] [Descripción] (evidencia: [documento])
|
|
157
|
+
...
|
|
158
|
+
|
|
159
|
+
## Reglas de negocio
|
|
160
|
+
1. [RN-001] [Regla exacta citada del documento] (evidencia: [documento, sección])
|
|
161
|
+
2. [RN-002] [Regla] (evidencia: [documento, sección])
|
|
162
|
+
...
|
|
163
|
+
|
|
164
|
+
## Modelo de datos / Entidades
|
|
165
|
+
| Entidad | Atributos conocidos | Relaciones | Tipo | Documento |
|
|
166
|
+
|---|---|---|---|---|
|
|
167
|
+
| [nombre] | [campo1, campo2, ...] | [relación con otra entidad] | [core/periférica/catálogo] | [doc] |
|
|
168
|
+
|
|
169
|
+
## Roles y permisos
|
|
170
|
+
| Rol | Permisos | Restricciones de datos | Autenticación | Documento |
|
|
171
|
+
|---|---|---|---|---|
|
|
172
|
+
| [rol] | [qué puede hacer] | [qué datos puede ver] | [tipo auth] | [doc] |
|
|
173
|
+
|
|
174
|
+
## Integraciones externas
|
|
175
|
+
| Sistema | Dirección | Protocolo | Frecuencia | Datos | Documento |
|
|
176
|
+
|---|---|---|---|---|---|
|
|
177
|
+
| [nombre] | [in/out/bidi] | [REST/SOAP/etc.] | [real-time/batch] | [entidades] | [doc] |
|
|
178
|
+
|
|
179
|
+
## Stack tecnológico mencionado
|
|
180
|
+
- Lenguaje: [X o "no especificado"] (evidencia: [documento])
|
|
181
|
+
- Framework backend: [X o "no especificado"]
|
|
182
|
+
- Framework frontend: [X o "no especificado"]
|
|
183
|
+
- Base de datos: [X o "no especificado"]
|
|
184
|
+
- Infraestructura: [X o "no especificado"]
|
|
185
|
+
- Servicios externos: [listar]
|
|
186
|
+
- Tecnologías implícitas por los requisitos: [listar con justificación]
|
|
187
|
+
|
|
188
|
+
## Workflows y procesos
|
|
189
|
+
### [Nombre del workflow]
|
|
190
|
+
- Actores: [listar]
|
|
191
|
+
- Pasos: 1. [paso] → 2. [paso] → ...
|
|
192
|
+
- Puntos de decisión: [listar]
|
|
193
|
+
- Evidencia: [documento]
|
|
194
|
+
|
|
195
|
+
## Restricciones y limitaciones
|
|
196
|
+
1. [Restricción] (evidencia: [documento])
|
|
197
|
+
2. [Restricción] (evidencia: [documento])
|
|
198
|
+
...
|
|
199
|
+
|
|
200
|
+
## Ambigüedades y preguntas
|
|
201
|
+
- [Listar TODA información ambigua, contradictoria, o faltante que necesite confirmación del usuario]
|
|
202
|
+
- [Listar requisitos que se mencionan pero no se detallan suficientemente]
|
|
203
|
+
- [Listar decisiones tecnológicas que el equipo debe tomar]
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Be exhaustive. If the documents describe 50 business rules, list all 50. If there are 20 entities, list all 20. Do NOT truncate, summarize prematurely, or omit details. Every piece of information matters for configuring the development environment correctly.
|