haraps 1.0.8 → 1.0.10
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/index.js +30 -5
- package/package.json +1 -1
- package/SKILL.md +0 -46
package/bin/index.js
CHANGED
|
@@ -13,8 +13,12 @@ function ensureDir(dir) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
function writeFile(filePath, content) {
|
|
16
|
+
function writeFile(filePath, content, skipIfExists = false) {
|
|
17
17
|
const fullPath = path.resolve(process.cwd(), filePath);
|
|
18
|
+
if (skipIfExists && fs.existsSync(fullPath)) {
|
|
19
|
+
console.log(`⏭️ Skipped: ${filePath} (already exists)`);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
18
22
|
ensureDir(path.dirname(fullPath));
|
|
19
23
|
fs.writeFileSync(fullPath, content.trim() + '\n', 'utf8');
|
|
20
24
|
console.log(`✅ Created: ${filePath}`);
|
|
@@ -382,7 +386,7 @@ EOF
|
|
|
382
386
|
|
|
383
387
|
node "$runnerPath"
|
|
384
388
|
|
|
385
|
-
|
|
389
|
+
`, true);
|
|
386
390
|
fs.chmodSync(path.resolve(process.cwd(), 'dev.sh'), '755');
|
|
387
391
|
|
|
388
392
|
writeFile('dev.ps1', `
|
|
@@ -796,7 +800,7 @@ if ($null -ne (Get-Variable -Name watcherJob -ErrorAction SilentlyContinue)) {
|
|
|
796
800
|
}
|
|
797
801
|
}
|
|
798
802
|
|
|
799
|
-
|
|
803
|
+
`, true);
|
|
800
804
|
|
|
801
805
|
// 2. Deploy Scripts
|
|
802
806
|
writeFile('deploy.sh', `
|
|
@@ -811,7 +815,7 @@ cd /mnt/c/Users/shivg/Desktop/Hara-XY/mediqueue-main/mediqueue/frontend
|
|
|
811
815
|
$env:WRANGLER_SEND_METRICS="false"
|
|
812
816
|
npx wrangler pages deploy .vercel/output/static
|
|
813
817
|
|
|
814
|
-
|
|
818
|
+
`, true);
|
|
815
819
|
fs.chmodSync(path.resolve(process.cwd(), 'deploy.sh'), '755');
|
|
816
820
|
|
|
817
821
|
writeFile('deploy.ps1', `
|
|
@@ -1230,7 +1234,7 @@ Write-Host "[CLIPBOARD] Full report copied to your clipboard!" -ForegroundColor
|
|
|
1230
1234
|
Write-Host ""
|
|
1231
1235
|
Write-Host ">>> Deployment localized and verified." -ForegroundColor Cyan
|
|
1232
1236
|
|
|
1233
|
-
|
|
1237
|
+
`, true);
|
|
1234
1238
|
|
|
1235
1239
|
// 3. Agent Rules
|
|
1236
1240
|
writeFile('AGENTS.md', `
|
|
@@ -1255,6 +1259,12 @@ writeFile('AGENTS.md', `
|
|
|
1255
1259
|
18. **Environment Variable Validation**: Fail fast at startup if required \`.env\` variables are missing.
|
|
1256
1260
|
19. **Kill AI Slop**: Remove aesthetic clichés (indigo gradients, glowing cards, excessive emojis) that serve no functional purpose.
|
|
1257
1261
|
20. **Security First Principle**: Treat all external input as malicious; leverage the Security Review skill for all external-facing endpoints.
|
|
1262
|
+
21. **Standardized Work Delivery**: When completing a task, always provide:
|
|
1263
|
+
- Links or Routes for the work done (clickable URLs/paths).
|
|
1264
|
+
- Manual steps for the user to verify the work.
|
|
1265
|
+
- 3 Things to improve (technical debt, minor issues, or polish).
|
|
1266
|
+
- Future roadmap (what can be done next for the work currently completed).
|
|
1267
|
+
22. **Scratch Files**: Any temporary, one-off, or scratch scripts (like \`fix_css.js\`, testing scripts, or data dumps) MUST be placed in a dedicated \`scratch/\` folder at the root. Never clutter the project root directory with these files.
|
|
1258
1268
|
|
|
1259
1269
|
# Start Project Protocol
|
|
1260
1270
|
When the user says "start project", you MUST immediately:
|
|
@@ -1267,6 +1277,21 @@ When the user says "start project", you MUST immediately:
|
|
|
1267
1277
|
d. **Rust Instructions**: Ensure dev and deploy scripts are surgically modified to correctly support the required Rust compilation/cargo instructions for the backend. **Never** overwrite the entire scripts with generic versions; preserve their robust functionality.
|
|
1268
1278
|
4. Initialize a new git repository in the root directory (\`git init\`) and create an initial commit.
|
|
1269
1279
|
5. Notify the user that the project has been contextualized, customized, and scaffolded. Remind them to run \`./dev.ps1\` or \`./dev.sh\`.
|
|
1280
|
+
|
|
1281
|
+
# Continuous Documentation Protocol
|
|
1282
|
+
As we develop the project, you MUST maintain living user and developer documentation.
|
|
1283
|
+
1. **Always Document**: Every new feature, API route, or major change must be documented immediately.
|
|
1284
|
+
2. **Types of Docs**: Include API specifications, how-to guides, architectural overviews, and user instructions.
|
|
1285
|
+
3. **Index Everything**: Maintain a well-organized and updated index of all documentation files in the section below.
|
|
1286
|
+
|
|
1287
|
+
# Project Documentation Index
|
|
1288
|
+
*Keep this section constantly updated as new documentation is written.*
|
|
1289
|
+
|
|
1290
|
+
### Frontend Documentation
|
|
1291
|
+
- [Developer & User Guide](file:///frontend/src/app/docs/page.tsx) - The primary documentation route for users.
|
|
1292
|
+
|
|
1293
|
+
### Backend Documentation
|
|
1294
|
+
*(No backend documentation yet. Add API guides and architecture notes here.)*
|
|
1270
1295
|
`);
|
|
1271
1296
|
|
|
1272
1297
|
// 4. Workflows
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "haraps",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "NPM package to scaffold standard development environment, deployment scripts, AGENTS.md guidelines, and core workflows for a Next.js frontend + Rust Cloudflare Worker backend.",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"bin": {
|
package/SKILL.md
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: scaffold-project-env
|
|
3
|
-
description: Scaffolds the standard development environment, deployment scripts, AGENTS.md guidelines, and core workflows for a Next.js frontend + Rust Cloudflare Worker backend.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Scaffold Project Environment Skill (Rust + Next.js)
|
|
7
|
-
|
|
8
|
-
This skill automatically sets up a new repository with standard `dev` and `deploy` scripts tailored for a Rust backend (Cloudflare Workers) and a standard Next.js frontend (Vercel/Node deployment, not Pages), along with preferred agent guidelines and workflows.
|
|
9
|
-
|
|
10
|
-
## Instructions for the Agent
|
|
11
|
-
|
|
12
|
-
When the user runs this skill, execute the following steps precisely:
|
|
13
|
-
|
|
14
|
-
### Step 1: Run the Scaffolder CLI
|
|
15
|
-
|
|
16
|
-
Execute the following command in the terminal to automatically generate the project scaffolding (dev scripts, deploy scripts, AGENTS.md, workflows, and skills):
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npx --yes haraps
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Step 2: Verification
|
|
23
|
-
|
|
24
|
-
Verify that the following files were successfully created in the root directory:
|
|
25
|
-
- `dev.sh` / `dev.ps1`
|
|
26
|
-
- `deploy.sh` / `deploy.ps1`
|
|
27
|
-
- `AGENTS.md`
|
|
28
|
-
- `.agents/workflows/git-it.md`
|
|
29
|
-
- `.agents/workflows/deploy-and-talk.md`
|
|
30
|
-
- `.agents/skills/ponytail/SKILL.md`
|
|
31
|
-
- `.agents/skills/ui-sniper-telegram/SKILL.md`
|
|
32
|
-
- `.agents/skills/kill-ai-slop/SKILL.md`
|
|
33
|
-
- `.agents/skills/security-review/SKILL.md`
|
|
34
|
-
|
|
35
|
-
### Step 3: Project Skeleton Initialization (First Run)
|
|
36
|
-
|
|
37
|
-
It is your strict responsibility as the agent to carefully initialize the standard project skeleton if this is the first run (i.e. if the project is empty). You must:
|
|
38
|
-
1. Generate the Next.js frontend and Rust Cloudflare Worker backend in their respective directories (`frontend/` and `backend/`).
|
|
39
|
-
2. **Contextualize Files**: Open the scaffolded `dev.ps1`, `dev.sh`, `deploy.ps1`, `deploy.sh`, and the UI Sniper Telegram configuration (including the webhook route), and **modify them** to precisely match the project name and description.
|
|
40
|
-
3. **Telegram Feedback Customization**: Ensure the Telegram message for UI feedback exactly matches the project context (updating names, tags, or message format as needed).
|
|
41
|
-
4. **Rust Instructions**: Ensure dev and deploy scripts are surgically modified to correctly support the required Rust compilation/cargo instructions for the backend. **Never** overwrite the entire scripts with generic versions; preserve their robust functionality.
|
|
42
|
-
5. Initialize the Git repository (`git init`) and create the initial commit.
|
|
43
|
-
|
|
44
|
-
### Step 4: Inform the User
|
|
45
|
-
|
|
46
|
-
Notify the user that the project has been contextualized, customized, and scaffolded. Remind them to run `./dev.ps1` or `./dev.sh`.
|