@hasankemaldemirci/aro 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.
- package/.agent_context_pro.json +57 -0
- package/.env.example +3 -0
- package/.github/workflows/aro.yml +41 -0
- package/.husky/pre-commit +19 -0
- package/CONTRIBUTING.md +34 -0
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/bin/aro.ts +86 -0
- package/dist/bin/aro.d.ts +7 -0
- package/dist/bin/aro.js +118 -0
- package/dist/src/badge.d.ts +6 -0
- package/dist/src/badge.js +64 -0
- package/dist/src/constants.d.ts +20 -0
- package/dist/src/constants.js +68 -0
- package/dist/src/core.d.ts +12 -0
- package/dist/src/core.js +107 -0
- package/dist/src/enterprise.d.ts +8 -0
- package/dist/src/enterprise.js +125 -0
- package/dist/src/init.d.ts +1 -0
- package/dist/src/init.js +64 -0
- package/dist/src/mcp.d.ts +5 -0
- package/dist/src/mcp.js +138 -0
- package/dist/src/refactor.d.ts +6 -0
- package/dist/src/refactor.js +91 -0
- package/dist/src/rules.d.ts +6 -0
- package/dist/src/rules.js +67 -0
- package/dist/src/types.d.ts +39 -0
- package/dist/src/types.js +6 -0
- package/dist/src/utils.d.ts +14 -0
- package/dist/src/utils.js +194 -0
- package/dist/tests/cli.test.d.ts +1 -0
- package/dist/tests/cli.test.js +56 -0
- package/dist/tests/core.test.d.ts +5 -0
- package/dist/tests/core.test.js +129 -0
- package/dist/tests/enterprise.test.d.ts +1 -0
- package/dist/tests/enterprise.test.js +74 -0
- package/dist/tests/mcp.test.d.ts +1 -0
- package/dist/tests/mcp.test.js +81 -0
- package/eslint.config.mjs +9 -0
- package/package.json +66 -0
- package/src/badge.ts +77 -0
- package/src/constants.ts +68 -0
- package/src/core.ts +141 -0
- package/src/enterprise.ts +159 -0
- package/src/init.ts +75 -0
- package/src/mcp.ts +158 -0
- package/src/refactor.ts +122 -0
- package/src/rules.ts +78 -0
- package/src/types.ts +43 -0
- package/src/utils.ts +199 -0
- package/tests/cli.test.ts +71 -0
- package/tests/core.test.ts +146 -0
- package/tests/enterprise.test.ts +78 -0
- package/tests/mcp.test.ts +89 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"projectName": "@hasankemaldemirci/aro",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"framework": "Vanilla Node.js",
|
|
5
|
+
"techStack": [
|
|
6
|
+
"@types/jest",
|
|
7
|
+
"jest",
|
|
8
|
+
"ts-jest",
|
|
9
|
+
"typescript"
|
|
10
|
+
],
|
|
11
|
+
"entryPoints": [
|
|
12
|
+
"bin/aro.ts"
|
|
13
|
+
],
|
|
14
|
+
"analyzedAt": "2026-02-14T18:21:56.428Z",
|
|
15
|
+
"metrics": {
|
|
16
|
+
"hasReadme": true,
|
|
17
|
+
"readmeSize": 1886,
|
|
18
|
+
"hasSrc": true,
|
|
19
|
+
"hasConfig": 4,
|
|
20
|
+
"largeFiles": 0,
|
|
21
|
+
"securityIssues": 0,
|
|
22
|
+
"blindSpots": []
|
|
23
|
+
},
|
|
24
|
+
"score": 100,
|
|
25
|
+
"blindSpots": [],
|
|
26
|
+
"structure": {
|
|
27
|
+
".env.example": "file",
|
|
28
|
+
".github": {
|
|
29
|
+
"workflows": {
|
|
30
|
+
"aro.yml": "file"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
".gitignore": "file",
|
|
34
|
+
"CONTRIBUTING.md": "file",
|
|
35
|
+
"LICENSE": "file",
|
|
36
|
+
"README.md": "file",
|
|
37
|
+
"bin": {
|
|
38
|
+
"aro.ts": "file"
|
|
39
|
+
},
|
|
40
|
+
"eslint.config.mjs": "file",
|
|
41
|
+
"package-lock.json": "file",
|
|
42
|
+
"package.json": "file",
|
|
43
|
+
"src": {
|
|
44
|
+
"badge.ts": "file",
|
|
45
|
+
"constants.ts": "file",
|
|
46
|
+
"core.ts": "file",
|
|
47
|
+
"enterprise.ts": "file",
|
|
48
|
+
"init.ts": "file",
|
|
49
|
+
"mcp.ts": "file",
|
|
50
|
+
"refactor.ts": "file",
|
|
51
|
+
"rules.ts": "file",
|
|
52
|
+
"types.ts": "file",
|
|
53
|
+
"utils.ts": "file"
|
|
54
|
+
},
|
|
55
|
+
"tsconfig.json": "file"
|
|
56
|
+
}
|
|
57
|
+
}
|
package/.env.example
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: CI/CD
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, master]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
audit:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- name: Use Node.js
|
|
17
|
+
uses: actions/setup-node@v4
|
|
18
|
+
with:
|
|
19
|
+
node-version: "20"
|
|
20
|
+
cache: "npm"
|
|
21
|
+
|
|
22
|
+
- run: npm install
|
|
23
|
+
- run: npm run build
|
|
24
|
+
- run: npm test
|
|
25
|
+
|
|
26
|
+
- name: Run ARO Audit & Update Badge
|
|
27
|
+
run: |
|
|
28
|
+
node dist/bin/aro.js audit --threshold=100
|
|
29
|
+
node dist/bin/aro.js badge --update
|
|
30
|
+
|
|
31
|
+
- name: Commit and Push if README changed
|
|
32
|
+
run: |
|
|
33
|
+
git config --global user.name "github-actions[bot]"
|
|
34
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
35
|
+
git add README.md
|
|
36
|
+
if ! git diff --cached --quiet; then
|
|
37
|
+
git commit -m "docs: auto-update ARO Score badge"
|
|
38
|
+
git push
|
|
39
|
+
else
|
|
40
|
+
echo "No changes to README.md, skipping commit."
|
|
41
|
+
fi
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
echo "🛰️ ARO Pre-commit Health Check..."
|
|
2
|
+
|
|
3
|
+
# 1. Build the project
|
|
4
|
+
npm run build || exit 1
|
|
5
|
+
|
|
6
|
+
# 2. Run Unit Tests
|
|
7
|
+
npm test || exit 1
|
|
8
|
+
|
|
9
|
+
# 3. Enforce AI-Readiness (PRACTICE WHAT WE PREACH)
|
|
10
|
+
# If score < 100, the commit will fail.
|
|
11
|
+
node dist/bin/aro.js audit --threshold=100 || exit 1
|
|
12
|
+
|
|
13
|
+
# 4. Sync metadata and badge
|
|
14
|
+
node dist/bin/aro.js badge --update
|
|
15
|
+
|
|
16
|
+
# 5. Staging the auto-updated metadata
|
|
17
|
+
git add .agent_context_pro.json README.md
|
|
18
|
+
|
|
19
|
+
echo "✅ ARO: Code is Elite and AI-Ready. Proceeding with commit..."
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Contributing to ARO 🛰️
|
|
2
|
+
|
|
3
|
+
First off, thank you for considering contributing to ARO! It's people like you that make ARO a better tool for the entire AI-native development community.
|
|
4
|
+
|
|
5
|
+
## How Can I Contribute?
|
|
6
|
+
|
|
7
|
+
### Reporting Bugs
|
|
8
|
+
|
|
9
|
+
- Use the GitHub Issue Tracker.
|
|
10
|
+
- Describe the bug and include steps to reproduce.
|
|
11
|
+
|
|
12
|
+
### Suggesting Enhancements
|
|
13
|
+
|
|
14
|
+
- Open a new issue with a clear title and description.
|
|
15
|
+
- Explain why this enhancement would be useful for AI Readability.
|
|
16
|
+
|
|
17
|
+
### Pull Requests
|
|
18
|
+
|
|
19
|
+
1. Fork the repo and create your branch from `main`.
|
|
20
|
+
2. If you've added code that should be tested, add tests.
|
|
21
|
+
3. Ensure the test suite passes (`npm test`).
|
|
22
|
+
4. Run `aro audit` on your changes to ensure the AI-Readiness score remains at 100/100.
|
|
23
|
+
5. Make sure your code lints.
|
|
24
|
+
6. A **Husky pre-commit hook** is installed to automatically verify tests and ARO score before every commit.
|
|
25
|
+
|
|
26
|
+
## Style Guide
|
|
27
|
+
|
|
28
|
+
- Follow the 300-line file limit (The ARO Standard).
|
|
29
|
+
- Use TypeScript for all new features.
|
|
30
|
+
- Keep components modular and focused.
|
|
31
|
+
|
|
32
|
+
## License
|
|
33
|
+
|
|
34
|
+
By contributing, you agree that your contributions will be licensed under its MIT License.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hasan Kemal Demirci
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# ARO: Agent Readability Optimizer
|
|
2
|
+
|
|
3
|
+
> "SEO for your code, optimized for AI Agents."
|
|
4
|
+
|
|
5
|
+
[![ARO Score][aro-badge]][aro-url]
|
|
6
|
+
[![CI/CD Status][audit-badge]][audit-url]
|
|
7
|
+
[![MCP Status][mcp-badge]][mcp-url]
|
|
8
|
+
|
|
9
|
+
ARO is a professional ecosystem designed to optimize your codebase for
|
|
10
|
+
AI agents (Cursor, Windsurf, Devin). It minimizes the Hallucination Tax
|
|
11
|
+
and ensures your code is understood by AI "instantly".
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Install and link
|
|
17
|
+
npm install && npm run build && npm link
|
|
18
|
+
|
|
19
|
+
# Usage
|
|
20
|
+
aro audit # Deep analysis & financial report
|
|
21
|
+
aro fix # Auto-apply AI-SEO markers
|
|
22
|
+
aro rules # Generate rules for multi-agent support
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Key Features
|
|
26
|
+
|
|
27
|
+
- **Deep Context Mapping:** Maps tech-stack and entry points for AI traversal.
|
|
28
|
+
- **AI Financial Analysis:** Measures cost of documentation debt ($/hour).
|
|
29
|
+
- **Multi-Agent Support:** Generates rules for Cursor, Windsurf, and Devin.
|
|
30
|
+
- **Self-Healing:** Injects advisory markers into high-complexity files.
|
|
31
|
+
- **MCP Server:** Live integration for AI Agents to query your structure.
|
|
32
|
+
|
|
33
|
+
## Scoring Calculation
|
|
34
|
+
|
|
35
|
+
The score (0-100) is based on AI-Agent understanding efficiency:
|
|
36
|
+
|
|
37
|
+
1. README Quality (30%): Documentation depth and clarity.
|
|
38
|
+
2. Directory Structure (20%): Adherence to standard patterns.
|
|
39
|
+
3. Configuration (20%): Presence of essential rule files.
|
|
40
|
+
4. Modularity (30%): 300-line file limit enforcement.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Contributing
|
|
45
|
+
|
|
46
|
+
We welcome all PRs! Check our [CONTRIBUTING.md](./CONTRIBUTING.md) to get started.
|
|
47
|
+
|
|
48
|
+
MIT (c) Hasan Kemal Demirci
|
|
49
|
+
|
|
50
|
+
[aro-badge]: https://img.shields.io/badge/ARO_Score-100%2F100-brightgreen
|
|
51
|
+
[aro-url]: https://github.com/hasankemaldemirci/aro
|
|
52
|
+
[audit-badge]: https://github.com/hasankemaldemirci/aro/actions/workflows/aro.yml/badge.svg
|
|
53
|
+
[audit-url]: https://github.com/hasankemaldemirci/aro/actions
|
|
54
|
+
[mcp-badge]: https://img.shields.io/badge/MCP-Compatible-orange
|
|
55
|
+
[mcp-url]: https://modelcontextprotocol.io/
|
package/bin/aro.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @aro-context-marker
|
|
5
|
+
* AI READABILITY NOTE: Optimized CLI Entry point.
|
|
6
|
+
* Performance: Using direct imports to skip process spawn overhead.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import path from "path";
|
|
10
|
+
import chalk from "chalk";
|
|
11
|
+
|
|
12
|
+
const BASE_PATH = path.join(__dirname, "../src");
|
|
13
|
+
|
|
14
|
+
async function main() {
|
|
15
|
+
const command = process.argv[2];
|
|
16
|
+
const helpText = `
|
|
17
|
+
${chalk.bold.cyan("ARO - Agent Readability Optimizer")} (v2.1.0-TS)
|
|
18
|
+
${chalk.gray("Professional AI-Readiness Ecosystem")}
|
|
19
|
+
|
|
20
|
+
${chalk.bold("Usage:")}
|
|
21
|
+
aro <command> [options]
|
|
22
|
+
|
|
23
|
+
${chalk.bold("Commands:")}
|
|
24
|
+
${chalk.cyan("audit")} Full analysis. Options: --rate=X --interactions=Y --threshold=Z --output=file.md
|
|
25
|
+
${chalk.cyan("fix")} Automated AI-Readiness optimizations
|
|
26
|
+
${chalk.cyan("badge")} Generate a GitHub badge for your README. Use --update to patch README.md
|
|
27
|
+
${chalk.cyan("rules")} Generate .cursorrules for AI agents
|
|
28
|
+
${chalk.cyan("init-ci")} Set up GitHub Actions for automated quality gate
|
|
29
|
+
${chalk.cyan("mcp")} Start ARO MCP Server
|
|
30
|
+
${chalk.cyan("help")} Show this help message
|
|
31
|
+
|
|
32
|
+
${chalk.bold("Example:")}
|
|
33
|
+
aro audit --threshold=80
|
|
34
|
+
aro badge --update
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
if (!command || command === "help") {
|
|
38
|
+
console.log(helpText);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
switch (command) {
|
|
44
|
+
case "audit": {
|
|
45
|
+
const core = await import(path.join(BASE_PATH, "core"));
|
|
46
|
+
const enterprise = await import(path.join(BASE_PATH, "enterprise"));
|
|
47
|
+
await core.run();
|
|
48
|
+
await enterprise.run();
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
case "fix": {
|
|
52
|
+
const refactor = await import(path.join(BASE_PATH, "refactor"));
|
|
53
|
+
await refactor.run();
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
case "badge": {
|
|
57
|
+
const badge = await import(path.join(BASE_PATH, "badge"));
|
|
58
|
+
await badge.run();
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
case "rules": {
|
|
62
|
+
const rules = await import(path.join(BASE_PATH, "rules"));
|
|
63
|
+
await rules.run();
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
case "init-ci": {
|
|
67
|
+
const init = await import(path.join(BASE_PATH, "init"));
|
|
68
|
+
await init.run();
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
case "mcp": {
|
|
72
|
+
await import(path.join(BASE_PATH, "mcp"));
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
default:
|
|
76
|
+
console.log(chalk.red(`\n❌ Unknown command: ${command}`));
|
|
77
|
+
console.log(helpText);
|
|
78
|
+
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
} catch (err: any) {
|
|
81
|
+
console.error(chalk.red(`\n💥 Fatal Error: ${err.message}`));
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
main();
|
package/dist/bin/aro.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* @aro-context-marker
|
|
5
|
+
* AI READABILITY NOTE: Optimized CLI Entry point.
|
|
6
|
+
* Performance: Using direct imports to skip process spawn overhead.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
42
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
const path_1 = __importDefault(require("path"));
|
|
46
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
47
|
+
const BASE_PATH = path_1.default.join(__dirname, "../src");
|
|
48
|
+
async function main() {
|
|
49
|
+
const command = process.argv[2];
|
|
50
|
+
const helpText = `
|
|
51
|
+
${chalk_1.default.bold.cyan("ARO - Agent Readability Optimizer")} (v2.1.0-TS)
|
|
52
|
+
${chalk_1.default.gray("Professional AI-Readiness Ecosystem")}
|
|
53
|
+
|
|
54
|
+
${chalk_1.default.bold("Usage:")}
|
|
55
|
+
aro <command> [options]
|
|
56
|
+
|
|
57
|
+
${chalk_1.default.bold("Commands:")}
|
|
58
|
+
${chalk_1.default.cyan("audit")} Full analysis. Options: --rate=X --interactions=Y --threshold=Z --output=file.md
|
|
59
|
+
${chalk_1.default.cyan("fix")} Automated AI-Readiness optimizations
|
|
60
|
+
${chalk_1.default.cyan("badge")} Generate a GitHub badge for your README. Use --update to patch README.md
|
|
61
|
+
${chalk_1.default.cyan("rules")} Generate .cursorrules for AI agents
|
|
62
|
+
${chalk_1.default.cyan("init-ci")} Set up GitHub Actions for automated quality gate
|
|
63
|
+
${chalk_1.default.cyan("mcp")} Start ARO MCP Server
|
|
64
|
+
${chalk_1.default.cyan("help")} Show this help message
|
|
65
|
+
|
|
66
|
+
${chalk_1.default.bold("Example:")}
|
|
67
|
+
aro audit --threshold=80
|
|
68
|
+
aro badge --update
|
|
69
|
+
`;
|
|
70
|
+
if (!command || command === "help") {
|
|
71
|
+
console.log(helpText);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
switch (command) {
|
|
76
|
+
case "audit": {
|
|
77
|
+
const core = await Promise.resolve(`${path_1.default.join(BASE_PATH, "core")}`).then(s => __importStar(require(s)));
|
|
78
|
+
const enterprise = await Promise.resolve(`${path_1.default.join(BASE_PATH, "enterprise")}`).then(s => __importStar(require(s)));
|
|
79
|
+
await core.run();
|
|
80
|
+
await enterprise.run();
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case "fix": {
|
|
84
|
+
const refactor = await Promise.resolve(`${path_1.default.join(BASE_PATH, "refactor")}`).then(s => __importStar(require(s)));
|
|
85
|
+
await refactor.run();
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
case "badge": {
|
|
89
|
+
const badge = await Promise.resolve(`${path_1.default.join(BASE_PATH, "badge")}`).then(s => __importStar(require(s)));
|
|
90
|
+
await badge.run();
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
case "rules": {
|
|
94
|
+
const rules = await Promise.resolve(`${path_1.default.join(BASE_PATH, "rules")}`).then(s => __importStar(require(s)));
|
|
95
|
+
await rules.run();
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
case "init-ci": {
|
|
99
|
+
const init = await Promise.resolve(`${path_1.default.join(BASE_PATH, "init")}`).then(s => __importStar(require(s)));
|
|
100
|
+
await init.run();
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
case "mcp": {
|
|
104
|
+
await Promise.resolve(`${path_1.default.join(BASE_PATH, "mcp")}`).then(s => __importStar(require(s)));
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
default:
|
|
108
|
+
console.log(chalk_1.default.red(`\n❌ Unknown command: ${command}`));
|
|
109
|
+
console.log(helpText);
|
|
110
|
+
process.exit(1);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
console.error(chalk_1.default.red(`\n💥 Fatal Error: ${err.message}`));
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
main();
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.run = run;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
/**
|
|
11
|
+
* @aro-context-marker
|
|
12
|
+
* AI READABILITY NOTE: Badge generator for GitHub integration.
|
|
13
|
+
* Supports --update flag to automatically patch README.md.
|
|
14
|
+
*/
|
|
15
|
+
function run() {
|
|
16
|
+
const args = process.argv.slice(2);
|
|
17
|
+
const shouldUpdate = args.includes("--update");
|
|
18
|
+
const projectPath = process.cwd();
|
|
19
|
+
const contextPath = path_1.default.join(projectPath, ".agent_context_pro.json");
|
|
20
|
+
if (!fs_1.default.existsSync(contextPath)) {
|
|
21
|
+
console.log(constants_1.Branding.error("❌ Knowledge Map not found. Run 'aro audit' first."));
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
const data = JSON.parse(fs_1.default.readFileSync(contextPath, "utf8"));
|
|
25
|
+
const score = data.score;
|
|
26
|
+
let color = "brightgreen";
|
|
27
|
+
if (score < 60)
|
|
28
|
+
color = "red";
|
|
29
|
+
else if (score < 85)
|
|
30
|
+
color = "yellow";
|
|
31
|
+
// Using standard 'flat' style to match GitHub native badges exactly
|
|
32
|
+
const badgeUrl = `https://img.shields.io/badge/ARO_Score-${score}%2F100-${color}`;
|
|
33
|
+
const markdown = `[](https://github.com/hasankemaldemirci/aro)`;
|
|
34
|
+
if (shouldUpdate) {
|
|
35
|
+
const readmePath = path_1.default.join(projectPath, "README.md");
|
|
36
|
+
if (fs_1.default.existsSync(readmePath)) {
|
|
37
|
+
let content = fs_1.default.readFileSync(readmePath, "utf8");
|
|
38
|
+
const inlineRegex = /\[\!\[ARO Score\]\(https:\/\/img\.shields\.io\/badge\/ARO_Score-[^)]+\)\]\([^)]+\)/;
|
|
39
|
+
const refRegex = /^\[aro-badge\]: https:\/\/img\.shields\.io\/badge\/ARO_Score-[^\n]+/m;
|
|
40
|
+
if (inlineRegex.test(content)) {
|
|
41
|
+
content = content.replace(inlineRegex, markdown);
|
|
42
|
+
fs_1.default.writeFileSync(readmePath, content);
|
|
43
|
+
console.log(constants_1.Branding.success("✅ README.md updated (Inline Badge)."));
|
|
44
|
+
}
|
|
45
|
+
else if (refRegex.test(content)) {
|
|
46
|
+
content = content.replace(refRegex, `[aro-badge]: ${badgeUrl}`);
|
|
47
|
+
fs_1.default.writeFileSync(readmePath, content);
|
|
48
|
+
console.log(constants_1.Branding.success("✅ README.md updated (Reference Badge)."));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
console.log(constants_1.Branding.warning("⚠️ ARO Score badge not found in README.md. Skipping auto-update."));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
console.log(constants_1.Branding.border(""));
|
|
56
|
+
console.log(constants_1.Branding.cyan.bold("🛡️ ARO Badge Generator"));
|
|
57
|
+
console.log(constants_1.Branding.border(""));
|
|
58
|
+
console.log(constants_1.Branding.white("\nUse the following snippet in your README.md:\n"));
|
|
59
|
+
console.log(constants_1.Branding.magenta(markdown));
|
|
60
|
+
console.log(constants_1.Branding.border(""));
|
|
61
|
+
}
|
|
62
|
+
if (require.main === module) {
|
|
63
|
+
run();
|
|
64
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
/**
|
|
3
|
+
* @aro-context-marker
|
|
4
|
+
* AI READABILITY NOTE: Centralized branding and constants.
|
|
5
|
+
*/
|
|
6
|
+
export declare const Branding: {
|
|
7
|
+
cyan: chalk.Chalk;
|
|
8
|
+
magenta: chalk.Chalk;
|
|
9
|
+
success: chalk.Chalk;
|
|
10
|
+
warning: chalk.Chalk;
|
|
11
|
+
error: chalk.Chalk;
|
|
12
|
+
gray: chalk.Chalk;
|
|
13
|
+
white: chalk.Chalk;
|
|
14
|
+
border: (text: string) => string;
|
|
15
|
+
};
|
|
16
|
+
export declare const DEFAULT_IGNORES: string[];
|
|
17
|
+
export declare const CONFIG_FILES: string[];
|
|
18
|
+
export declare const SECURITY_KEYWORDS: string[];
|
|
19
|
+
export declare const DANGEROUS_FUNCS: string[];
|
|
20
|
+
export declare const TECH_KEYWORDS: string[];
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TECH_KEYWORDS = exports.DANGEROUS_FUNCS = exports.SECURITY_KEYWORDS = exports.CONFIG_FILES = exports.DEFAULT_IGNORES = exports.Branding = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
/**
|
|
9
|
+
* @aro-context-marker
|
|
10
|
+
* AI READABILITY NOTE: Centralized branding and constants.
|
|
11
|
+
*/
|
|
12
|
+
exports.Branding = {
|
|
13
|
+
cyan: chalk_1.default.hex("#00f2ff"),
|
|
14
|
+
magenta: chalk_1.default.hex("#ff00ff"),
|
|
15
|
+
success: chalk_1.default.hex("#00ff88"),
|
|
16
|
+
warning: chalk_1.default.hex("#ffbb00"),
|
|
17
|
+
error: chalk_1.default.hex("#ff0044"),
|
|
18
|
+
gray: chalk_1.default.hex("#666666"),
|
|
19
|
+
white: chalk_1.default.hex("#ffffff"),
|
|
20
|
+
border: (text) => chalk_1.default.hex("#333333")("─".repeat(text.length || 40)),
|
|
21
|
+
};
|
|
22
|
+
exports.DEFAULT_IGNORES = [
|
|
23
|
+
"node_modules",
|
|
24
|
+
".git",
|
|
25
|
+
".next",
|
|
26
|
+
"dist",
|
|
27
|
+
"temp_repos",
|
|
28
|
+
".agent_context_pro.json",
|
|
29
|
+
"tests",
|
|
30
|
+
"__tests__",
|
|
31
|
+
".husky",
|
|
32
|
+
];
|
|
33
|
+
exports.CONFIG_FILES = [
|
|
34
|
+
"tsconfig.json",
|
|
35
|
+
"next.config.ts",
|
|
36
|
+
".env.example",
|
|
37
|
+
"package.json",
|
|
38
|
+
"eslint.config.mjs",
|
|
39
|
+
];
|
|
40
|
+
exports.SECURITY_KEYWORDS = [
|
|
41
|
+
"API_" + "KEY",
|
|
42
|
+
"SEC" + "RET",
|
|
43
|
+
"PASS" + "WORD",
|
|
44
|
+
"TO" + "KEN",
|
|
45
|
+
"PRIVATE_" + "KEY",
|
|
46
|
+
];
|
|
47
|
+
exports.DANGEROUS_FUNCS = [
|
|
48
|
+
"ev" + "al(",
|
|
49
|
+
"ex" + "ec(",
|
|
50
|
+
"child_process.ex" + "ec(",
|
|
51
|
+
];
|
|
52
|
+
exports.TECH_KEYWORDS = [
|
|
53
|
+
"typescript",
|
|
54
|
+
"tailwind",
|
|
55
|
+
"prisma",
|
|
56
|
+
"mongoose",
|
|
57
|
+
"jest",
|
|
58
|
+
"vitest",
|
|
59
|
+
"express",
|
|
60
|
+
"fastify",
|
|
61
|
+
"redux",
|
|
62
|
+
"axios",
|
|
63
|
+
"firebase",
|
|
64
|
+
"supabase",
|
|
65
|
+
"react",
|
|
66
|
+
"next",
|
|
67
|
+
"vue",
|
|
68
|
+
];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @aro-context-marker
|
|
3
|
+
* AI READABILITY NOTE: This file is monitored for AI-Readability.
|
|
4
|
+
*/
|
|
5
|
+
import { AROContext } from "./types";
|
|
6
|
+
/**
|
|
7
|
+
* @aro-context-marker
|
|
8
|
+
* AI READABILITY NOTE: Orchestration layer for ARO analysis.
|
|
9
|
+
*/
|
|
10
|
+
export declare function run(): Promise<AROContext | void>;
|
|
11
|
+
export declare function handleError(message: string): never;
|
|
12
|
+
export declare function displayScore(score: number): void;
|