@ryuenn3123/agentic-senior-core 1.8.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 (78) hide show
  1. package/.agent-context/blueprints/api-nextjs.md +184 -0
  2. package/.agent-context/blueprints/aspnet-api.md +247 -0
  3. package/.agent-context/blueprints/ci-github-actions.md +226 -0
  4. package/.agent-context/blueprints/ci-gitlab.md +200 -0
  5. package/.agent-context/blueprints/fastapi-service.md +210 -0
  6. package/.agent-context/blueprints/go-service.md +217 -0
  7. package/.agent-context/blueprints/graphql-grpc-api.md +51 -0
  8. package/.agent-context/blueprints/infrastructure-as-code.md +62 -0
  9. package/.agent-context/blueprints/kubernetes-manifests.md +76 -0
  10. package/.agent-context/blueprints/laravel-api.md +223 -0
  11. package/.agent-context/blueprints/nestjs-logic.md +247 -0
  12. package/.agent-context/blueprints/observability.md +227 -0
  13. package/.agent-context/blueprints/spring-boot-api.md +218 -0
  14. package/.agent-context/policies/llm-judge-threshold.json +20 -0
  15. package/.agent-context/profiles/platform.md +13 -0
  16. package/.agent-context/profiles/regulated.md +13 -0
  17. package/.agent-context/profiles/startup.md +13 -0
  18. package/.agent-context/prompts/init-project.md +86 -0
  19. package/.agent-context/prompts/refactor.md +45 -0
  20. package/.agent-context/prompts/review-code.md +47 -0
  21. package/.agent-context/review-checklists/architecture-review.md +70 -0
  22. package/.agent-context/review-checklists/frontend-usability.md +33 -0
  23. package/.agent-context/review-checklists/performance-audit.md +65 -0
  24. package/.agent-context/review-checklists/pr-checklist.md +97 -0
  25. package/.agent-context/review-checklists/release-operations.md +29 -0
  26. package/.agent-context/review-checklists/security-audit.md +113 -0
  27. package/.agent-context/rules/api-docs.md +186 -0
  28. package/.agent-context/rules/architecture.md +198 -0
  29. package/.agent-context/rules/database-design.md +202 -0
  30. package/.agent-context/rules/efficiency-vs-hype.md +143 -0
  31. package/.agent-context/rules/error-handling.md +234 -0
  32. package/.agent-context/rules/event-driven.md +226 -0
  33. package/.agent-context/rules/frontend-architecture.md +66 -0
  34. package/.agent-context/rules/git-workflow.md +200 -0
  35. package/.agent-context/rules/microservices.md +174 -0
  36. package/.agent-context/rules/naming-conv.md +141 -0
  37. package/.agent-context/rules/performance.md +168 -0
  38. package/.agent-context/rules/realtime.md +47 -0
  39. package/.agent-context/rules/security.md +195 -0
  40. package/.agent-context/rules/testing.md +178 -0
  41. package/.agent-context/stacks/csharp.md +149 -0
  42. package/.agent-context/stacks/go.md +181 -0
  43. package/.agent-context/stacks/java.md +135 -0
  44. package/.agent-context/stacks/php.md +178 -0
  45. package/.agent-context/stacks/python.md +153 -0
  46. package/.agent-context/stacks/ruby.md +80 -0
  47. package/.agent-context/stacks/rust.md +86 -0
  48. package/.agent-context/stacks/typescript.md +317 -0
  49. package/.agent-context/state/architecture-map.md +25 -0
  50. package/.agent-context/state/dependency-map.md +32 -0
  51. package/.agent-override.md +36 -0
  52. package/.agents/workflows/init-project.md +29 -0
  53. package/.agents/workflows/refactor.md +29 -0
  54. package/.agents/workflows/review-code.md +29 -0
  55. package/.cursorrules +140 -0
  56. package/.gemini/instructions.md +97 -0
  57. package/.github/ISSUE_TEMPLATE/v1.7-frontend-work-item.yml +54 -0
  58. package/.github/copilot-instructions.md +104 -0
  59. package/.github/workflows/benchmark-detection.yml +38 -0
  60. package/.github/workflows/frontend-usability-gate.yml +36 -0
  61. package/.github/workflows/release-gate.yml +32 -0
  62. package/.github/workflows/sbom-compliance.yml +32 -0
  63. package/.windsurfrules +106 -0
  64. package/AGENTS.md +131 -0
  65. package/CONTRIBUTING.md +136 -0
  66. package/LICENSE +21 -0
  67. package/README.md +239 -0
  68. package/bin/agentic-senior-core.js +1147 -0
  69. package/mcp.json +29 -0
  70. package/package.json +50 -0
  71. package/scripts/detection-benchmark.mjs +138 -0
  72. package/scripts/frontend-usability-audit.mjs +87 -0
  73. package/scripts/generate-sbom.mjs +61 -0
  74. package/scripts/init-project.ps1 +105 -0
  75. package/scripts/init-project.sh +131 -0
  76. package/scripts/llm-judge.mjs +664 -0
  77. package/scripts/release-gate.mjs +116 -0
  78. package/scripts/validate.mjs +554 -0
package/mcp.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://modelcontextprotocol.io/schemas/mcp.json",
3
+ "version": "1.0",
4
+ "name": "agentic-senior-core",
5
+ "description": "MCP configuration for governance-aware diagnostics and self-healing workflows.",
6
+ "servers": {
7
+ "lint": {
8
+ "command": "node",
9
+ "args": ["./scripts/validate.mjs"],
10
+ "transport": "stdio"
11
+ },
12
+ "test": {
13
+ "command": "node",
14
+ "args": ["--test", "./tests/cli-smoke.test.mjs", "./tests/llm-judge.test.mjs"],
15
+ "transport": "stdio"
16
+ }
17
+ },
18
+ "workflows": {
19
+ "self-heal-on-failure": {
20
+ "trigger": ["ci.failure", "lint.failure"],
21
+ "steps": [
22
+ "collect_logs",
23
+ "map_violation_to_rule",
24
+ "propose_patch",
25
+ "run_checklist_review"
26
+ ]
27
+ }
28
+ }
29
+ }
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@ryuenn3123/agentic-senior-core",
3
+ "version": "1.8.0",
4
+ "description": "Force your AI Agent to code like a Staff Engineer, not a Junior.",
5
+ "bin": {
6
+ "agentic-senior-core": "bin/agentic-senior-core.js"
7
+ },
8
+ "files": [
9
+ "bin/",
10
+ "scripts/",
11
+ ".agent-context/",
12
+ ".agents/",
13
+ ".github/",
14
+ ".gemini/",
15
+ ".cursorrules",
16
+ ".windsurfrules",
17
+ "AGENTS.md",
18
+ ".agent-override.md",
19
+ "mcp.json",
20
+ "README.md",
21
+ "LICENSE",
22
+ "CONTRIBUTING.md"
23
+ ],
24
+ "author": "fatidaprilian",
25
+ "license": "MIT",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/fatidaprilian/Agentic-Senior-Core.git"
29
+ },
30
+ "keywords": [
31
+ "ai",
32
+ "coding-standards",
33
+ "cursorrules",
34
+ "windsurf",
35
+ "copilot",
36
+ "antigravity",
37
+ "clean-code",
38
+ "engineering-standards",
39
+ "agentic"
40
+ ],
41
+ "scripts": {
42
+ "init": "node ./bin/agentic-senior-core.js init",
43
+ "audit:frontend-usability": "node ./scripts/frontend-usability-audit.mjs",
44
+ "gate:release": "node ./scripts/release-gate.mjs",
45
+ "sbom:generate": "node ./scripts/generate-sbom.mjs",
46
+ "benchmark:detection": "node ./scripts/detection-benchmark.mjs",
47
+ "validate": "node ./scripts/validate.mjs",
48
+ "test": "node --test ./tests/cli-smoke.test.mjs ./tests/llm-judge.test.mjs ./tests/enterprise-ops.test.mjs"
49
+ }
50
+ }
@@ -0,0 +1,138 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * detection-benchmark.mjs
5
+ *
6
+ * Lightweight benchmark for stack detection heuristics used by the CLI.
7
+ * Publishes top-1 accuracy and manual-correction-rate proxy.
8
+ */
9
+
10
+ const BLUEPRINT_RECOMMENDATIONS = {
11
+ 'typescript.md': 'api-nextjs.md',
12
+ 'python.md': 'fastapi-service.md',
13
+ 'java.md': 'spring-boot-api.md',
14
+ 'php.md': 'laravel-api.md',
15
+ 'go.md': 'go-service.md',
16
+ 'csharp.md': 'aspnet-api.md',
17
+ };
18
+
19
+ const AMBIGUITY_THRESHOLD = 0.08;
20
+
21
+ const BENCHMARK_FIXTURES = [
22
+ { fixtureName: 'typescript-basic', markers: ['package.json', 'tsconfig.json'], expectedStack: 'typescript.md' },
23
+ { fixtureName: 'typescript-next', markers: ['package.json', 'tsconfig.json', 'next.config.js'], expectedStack: 'typescript.md' },
24
+ { fixtureName: 'python-poetry', markers: ['pyproject.toml'], expectedStack: 'python.md' },
25
+ { fixtureName: 'python-requirements', markers: ['requirements.txt'], expectedStack: 'python.md' },
26
+ { fixtureName: 'java-maven', markers: ['pom.xml'], expectedStack: 'java.md' },
27
+ { fixtureName: 'java-gradle', markers: ['build.gradle'], expectedStack: 'java.md' },
28
+ { fixtureName: 'php-composer', markers: ['composer.json'], expectedStack: 'php.md' },
29
+ { fixtureName: 'go-module', markers: ['go.mod'], expectedStack: 'go.md' },
30
+ { fixtureName: 'dotnet-solution', markers: ['app.sln'], expectedStack: 'csharp.md' },
31
+ { fixtureName: 'rust-cargo', markers: ['Cargo.toml'], expectedStack: 'rust.md' },
32
+ { fixtureName: 'ruby-gemfile', markers: ['Gemfile'], expectedStack: 'ruby.md' },
33
+ { fixtureName: 'mixed-ts-python', markers: ['package.json', 'tsconfig.json', 'pyproject.toml'], expectedStack: 'typescript.md' },
34
+ ];
35
+
36
+ function detectProjectFromMarkers(markers) {
37
+ const markerNames = new Set(markers);
38
+ const candidates = [];
39
+
40
+ if (markerNames.has('package.json') || markerNames.has('tsconfig.json') || markerNames.has('next.config.js') || markerNames.has('next.config.mjs')) {
41
+ let confidenceScore = 0.7;
42
+ if (markerNames.has('package.json')) confidenceScore += 0.12;
43
+ if (markerNames.has('tsconfig.json')) confidenceScore += 0.12;
44
+ if (markerNames.has('next.config.js') || markerNames.has('next.config.mjs')) confidenceScore += 0.05;
45
+ candidates.push({ stackFileName: 'typescript.md', confidenceScore: Math.min(confidenceScore, 0.97) });
46
+ }
47
+
48
+ if (markerNames.has('pyproject.toml') || markerNames.has('requirements.txt')) {
49
+ candidates.push({
50
+ stackFileName: 'python.md',
51
+ confidenceScore: markerNames.has('pyproject.toml') ? 0.96 : 0.78,
52
+ });
53
+ }
54
+
55
+ if (markerNames.has('pom.xml') || markerNames.has('build.gradle') || markerNames.has('build.gradle.kts')) {
56
+ candidates.push({
57
+ stackFileName: 'java.md',
58
+ confidenceScore: markerNames.has('pom.xml') ? 0.95 : 0.84,
59
+ });
60
+ }
61
+
62
+ if (markerNames.has('composer.json')) candidates.push({ stackFileName: 'php.md', confidenceScore: 0.95 });
63
+ if (markerNames.has('go.mod')) candidates.push({ stackFileName: 'go.md', confidenceScore: 0.96 });
64
+ if (markerNames.has('Cargo.toml')) candidates.push({ stackFileName: 'rust.md', confidenceScore: 0.96 });
65
+ if (markerNames.has('Gemfile')) candidates.push({ stackFileName: 'ruby.md', confidenceScore: 0.95 });
66
+
67
+ const hasDotNetMarker = Array.from(markerNames).some((markerName) => markerName.endsWith('.sln') || markerName.endsWith('.csproj'));
68
+ if (hasDotNetMarker) {
69
+ candidates.push({ stackFileName: 'csharp.md', confidenceScore: 0.95 });
70
+ }
71
+
72
+ if (candidates.length === 0) {
73
+ return {
74
+ recommendedStack: null,
75
+ recommendedBlueprint: null,
76
+ confidenceScore: 0,
77
+ confidenceGap: 0,
78
+ needsManualCorrection: true,
79
+ };
80
+ }
81
+
82
+ candidates.sort((leftCandidate, rightCandidate) => rightCandidate.confidenceScore - leftCandidate.confidenceScore);
83
+ const strongestCandidate = candidates[0];
84
+ const secondStrongestCandidate = candidates[1];
85
+ const confidenceGap = secondStrongestCandidate
86
+ ? Number((strongestCandidate.confidenceScore - secondStrongestCandidate.confidenceScore).toFixed(2))
87
+ : Number(strongestCandidate.confidenceScore.toFixed(2));
88
+
89
+ return {
90
+ recommendedStack: strongestCandidate.stackFileName,
91
+ recommendedBlueprint: BLUEPRINT_RECOMMENDATIONS[strongestCandidate.stackFileName] || null,
92
+ confidenceScore: strongestCandidate.confidenceScore,
93
+ confidenceGap,
94
+ needsManualCorrection: confidenceGap < AMBIGUITY_THRESHOLD,
95
+ };
96
+ }
97
+
98
+ function runBenchmark() {
99
+ let passingFixtureCount = 0;
100
+ let manualCorrectionCount = 0;
101
+
102
+ const fixtureResults = BENCHMARK_FIXTURES.map((benchmarkFixture) => {
103
+ const detectionResult = detectProjectFromMarkers(benchmarkFixture.markers);
104
+ const isCorrect = detectionResult.recommendedStack === benchmarkFixture.expectedStack;
105
+
106
+ if (isCorrect) {
107
+ passingFixtureCount += 1;
108
+ }
109
+
110
+ if (detectionResult.needsManualCorrection) {
111
+ manualCorrectionCount += 1;
112
+ }
113
+
114
+ return {
115
+ fixtureName: benchmarkFixture.fixtureName,
116
+ expectedStack: benchmarkFixture.expectedStack,
117
+ detectedStack: detectionResult.recommendedStack,
118
+ confidenceGap: detectionResult.confidenceGap,
119
+ needsManualCorrection: detectionResult.needsManualCorrection,
120
+ isCorrect,
121
+ };
122
+ });
123
+
124
+ const totalFixtureCount = BENCHMARK_FIXTURES.length;
125
+ const top1Accuracy = Number((passingFixtureCount / totalFixtureCount).toFixed(4));
126
+ const manualCorrectionRate = Number((manualCorrectionCount / totalFixtureCount).toFixed(4));
127
+
128
+ return {
129
+ generatedAt: new Date().toISOString(),
130
+ fixtureCount: totalFixtureCount,
131
+ top1Accuracy,
132
+ manualCorrectionRate,
133
+ fixtures: fixtureResults,
134
+ };
135
+ }
136
+
137
+ const benchmarkResult = runBenchmark();
138
+ console.log(JSON.stringify(benchmarkResult, null, 2));
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * frontend-usability-audit.mjs
5
+ *
6
+ * Governance-level audit for V1.7 frontend execution assets.
7
+ * This repository does not host a frontend runtime app, so the audit validates
8
+ * required execution artifacts and quality gates documentation.
9
+ */
10
+
11
+ import { existsSync, readFileSync } from 'node:fs';
12
+ import { resolve, dirname } from 'node:path';
13
+ import { fileURLToPath } from 'node:url';
14
+
15
+ const __filename = fileURLToPath(import.meta.url);
16
+ const __dirname = dirname(__filename);
17
+ const REPOSITORY_ROOT = resolve(__dirname, '..');
18
+
19
+ const REQUIRED_FILES = [
20
+ 'docs/roadmap.md',
21
+ 'docs/v1.7-issue-breakdown.md',
22
+ 'docs/v1.7-execution-playbook.md',
23
+ '.agent-context/review-checklists/frontend-usability.md',
24
+ ];
25
+
26
+ const REQUIRED_ROADMAP_SNIPPETS = [
27
+ 'V1.7',
28
+ 'Frontend Product Experience',
29
+ 'Release status: Completed',
30
+ 'Delivered Scope',
31
+ ];
32
+
33
+ const REQUIRED_CHECKLIST_SNIPPETS = [
34
+ 'Responsiveness',
35
+ 'Accessibility',
36
+ 'Performance',
37
+ 'Documentation and Release Evidence',
38
+ ];
39
+
40
+ function assertFileExists(relativeFilePath, failures) {
41
+ const absoluteFilePath = resolve(REPOSITORY_ROOT, relativeFilePath);
42
+ if (!existsSync(absoluteFilePath)) {
43
+ failures.push(`Missing required file: ${relativeFilePath}`);
44
+ }
45
+ }
46
+
47
+ function assertContains(contentLabel, filePath, fileContent, snippets, failures) {
48
+ for (const snippetText of snippets) {
49
+ if (!fileContent.includes(snippetText)) {
50
+ failures.push(`${contentLabel} missing snippet "${snippetText}" in ${filePath}`);
51
+ }
52
+ }
53
+ }
54
+
55
+ function runAudit() {
56
+ const failures = [];
57
+
58
+ for (const requiredFilePath of REQUIRED_FILES) {
59
+ assertFileExists(requiredFilePath, failures);
60
+ }
61
+
62
+ const roadmapPath = 'docs/roadmap.md';
63
+ const checklistPath = '.agent-context/review-checklists/frontend-usability.md';
64
+
65
+ if (existsSync(resolve(REPOSITORY_ROOT, roadmapPath))) {
66
+ const roadmapContent = readFileSync(resolve(REPOSITORY_ROOT, roadmapPath), 'utf8');
67
+ assertContains('Roadmap', roadmapPath, roadmapContent, REQUIRED_ROADMAP_SNIPPETS, failures);
68
+ }
69
+
70
+ if (existsSync(resolve(REPOSITORY_ROOT, checklistPath))) {
71
+ const checklistContent = readFileSync(resolve(REPOSITORY_ROOT, checklistPath), 'utf8');
72
+ assertContains('Checklist', checklistPath, checklistContent, REQUIRED_CHECKLIST_SNIPPETS, failures);
73
+ }
74
+
75
+ const reportPayload = {
76
+ generatedAt: new Date().toISOString(),
77
+ auditName: 'frontend-usability-audit',
78
+ passed: failures.length === 0,
79
+ failureCount: failures.length,
80
+ failures,
81
+ };
82
+
83
+ console.log(JSON.stringify(reportPayload, null, 2));
84
+ process.exit(reportPayload.passed ? 0 : 1);
85
+ }
86
+
87
+ runAudit();
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * generate-sbom.mjs
5
+ *
6
+ * Minimal CycloneDX-compatible SBOM for governance CI evidence.
7
+ */
8
+
9
+ import { readFileSync } from 'node:fs';
10
+ import { resolve, dirname } from 'node:path';
11
+ import { fileURLToPath } from 'node:url';
12
+ import { randomUUID } from 'node:crypto';
13
+
14
+ const __filename = fileURLToPath(import.meta.url);
15
+ const __dirname = dirname(__filename);
16
+ const REPOSITORY_ROOT = resolve(__dirname, '..');
17
+ const PACKAGE_JSON_PATH = resolve(REPOSITORY_ROOT, 'package.json');
18
+
19
+ function buildComponents(dependencyGroup, dependencies) {
20
+ return Object.entries(dependencies || {}).map(([dependencyName, dependencyVersion]) => ({
21
+ type: 'library',
22
+ name: dependencyName,
23
+ version: String(dependencyVersion).replace(/^[^\d]*/, ''),
24
+ scope: dependencyGroup,
25
+ purl: `pkg:npm/${dependencyName}@${String(dependencyVersion).replace(/^[^\d]*/, '')}`,
26
+ }));
27
+ }
28
+
29
+ function generateSbom() {
30
+ const packageManifest = JSON.parse(readFileSync(PACKAGE_JSON_PATH, 'utf8'));
31
+ const runtimeComponents = buildComponents('required', packageManifest.dependencies);
32
+ const developmentComponents = buildComponents('optional', packageManifest.devDependencies);
33
+ const allComponents = [...runtimeComponents, ...developmentComponents];
34
+
35
+ const sbomPayload = {
36
+ bomFormat: 'CycloneDX',
37
+ specVersion: '1.5',
38
+ serialNumber: `urn:uuid:${randomUUID()}`,
39
+ version: 1,
40
+ metadata: {
41
+ timestamp: new Date().toISOString(),
42
+ component: {
43
+ type: 'application',
44
+ name: packageManifest.name,
45
+ version: packageManifest.version,
46
+ },
47
+ tools: [
48
+ {
49
+ vendor: 'Agentic-Senior-Core',
50
+ name: 'generate-sbom.mjs',
51
+ version: packageManifest.version,
52
+ },
53
+ ],
54
+ },
55
+ components: allComponents,
56
+ };
57
+
58
+ console.log(JSON.stringify(sbomPayload, null, 2));
59
+ }
60
+
61
+ generateSbom();
@@ -0,0 +1,105 @@
1
+ #!/usr/bin/env pwsh
2
+
3
+ [CmdletBinding()]
4
+ param(
5
+ [string]$TargetDirectory = ".",
6
+ [ValidateSet("beginner", "balanced", "strict")]
7
+ [string]$Profile,
8
+ [string]$Stack,
9
+ [string]$Blueprint,
10
+ [ValidateSet("true", "false")]
11
+ [string]$Ci,
12
+ [switch]$Newbie,
13
+ [string]$RepositoryUrl = "https://github.com/fatidaprilian/Agentic-Senior-Core.git",
14
+ [string[]]$AdditionalArguments
15
+ )
16
+
17
+ $ErrorActionPreference = "Stop"
18
+
19
+ function Resolve-AbsolutePath {
20
+ param([string]$PathValue)
21
+
22
+ if ([string]::IsNullOrWhiteSpace($PathValue)) {
23
+ throw "TargetDirectory cannot be empty."
24
+ }
25
+
26
+ if ([System.IO.Path]::IsPathRooted($PathValue)) {
27
+ return [System.IO.Path]::GetFullPath($PathValue)
28
+ }
29
+
30
+ $combinedPath = Join-Path -Path (Get-Location) -ChildPath $PathValue
31
+ return [System.IO.Path]::GetFullPath($combinedPath)
32
+ }
33
+
34
+ function New-TemporaryDirectory {
35
+ $temporaryDirectoryName = "agentic-senior-core-bootstrap-$(Get-Date -Format 'yyyyMMddHHmmssfff')"
36
+ $temporaryDirectoryPath = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath $temporaryDirectoryName
37
+ New-Item -ItemType Directory -Path $temporaryDirectoryPath | Out-Null
38
+ return $temporaryDirectoryPath
39
+ }
40
+
41
+ $targetDirectoryPath = Resolve-AbsolutePath -PathValue $TargetDirectory
42
+ if (-not (Test-Path -Path $targetDirectoryPath -PathType Container)) {
43
+ throw "Target directory does not exist: $targetDirectoryPath"
44
+ }
45
+
46
+ $temporaryRootDirectoryPath = New-TemporaryDirectory
47
+ $bootstrapRepositoryPath = Join-Path -Path $temporaryRootDirectoryPath -ChildPath "Agentic-Senior-Core"
48
+
49
+ try {
50
+ if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
51
+ throw "Git is required but was not found in PATH."
52
+ }
53
+
54
+ if (-not (Get-Command node -ErrorAction SilentlyContinue)) {
55
+ throw "Node.js is required but was not found in PATH."
56
+ }
57
+
58
+ Write-Host "[Agentic-Senior-Core] Cloning bootstrap repository into temporary directory..."
59
+ & git clone --depth 1 $RepositoryUrl $bootstrapRepositoryPath | Out-Null
60
+ if ($LASTEXITCODE -ne 0) {
61
+ throw "Failed to clone repository from $RepositoryUrl"
62
+ }
63
+
64
+ $cliScriptPath = Join-Path -Path $bootstrapRepositoryPath -ChildPath "bin\agentic-senior-core.js"
65
+ if (-not (Test-Path -Path $cliScriptPath -PathType Leaf)) {
66
+ throw "CLI entry file not found: $cliScriptPath"
67
+ }
68
+
69
+ $cliArguments = @($cliScriptPath, "init", $targetDirectoryPath)
70
+
71
+ if ($Profile) {
72
+ $cliArguments += @("--profile", $Profile)
73
+ }
74
+
75
+ if ($Stack) {
76
+ $cliArguments += @("--stack", $Stack)
77
+ }
78
+
79
+ if ($Blueprint) {
80
+ $cliArguments += @("--blueprint", $Blueprint)
81
+ }
82
+
83
+ if ($Ci) {
84
+ $cliArguments += @("--ci", $Ci)
85
+ }
86
+
87
+ if ($Newbie.IsPresent) {
88
+ $cliArguments += "--newbie"
89
+ }
90
+
91
+ if ($AdditionalArguments) {
92
+ $cliArguments += $AdditionalArguments
93
+ }
94
+
95
+ Write-Host "[Agentic-Senior-Core] Running CLI against target directory: $targetDirectoryPath"
96
+ & node @cliArguments
97
+ if ($LASTEXITCODE -ne 0) {
98
+ throw "CLI exited with a non-zero status code: $LASTEXITCODE"
99
+ }
100
+ }
101
+ finally {
102
+ if (Test-Path -Path $temporaryRootDirectoryPath) {
103
+ Remove-Item -Path $temporaryRootDirectoryPath -Recurse -Force
104
+ }
105
+ }
@@ -0,0 +1,131 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ TARGET_DIRECTORY="."
6
+ PROFILE=""
7
+ STACK=""
8
+ BLUEPRINT=""
9
+ CI_VALUE=""
10
+ ENABLE_NEWBIE_MODE="false"
11
+ REPOSITORY_URL="https://github.com/fatidaprilian/Agentic-Senior-Core.git"
12
+ ADDITIONAL_ARGUMENTS=()
13
+
14
+ while (($# > 0)); do
15
+ case "$1" in
16
+ --profile)
17
+ PROFILE="${2:-}"
18
+ shift 2
19
+ ;;
20
+ --profile=*)
21
+ PROFILE="${1#*=}"
22
+ shift
23
+ ;;
24
+ --stack)
25
+ STACK="${2:-}"
26
+ shift 2
27
+ ;;
28
+ --stack=*)
29
+ STACK="${1#*=}"
30
+ shift
31
+ ;;
32
+ --blueprint)
33
+ BLUEPRINT="${2:-}"
34
+ shift 2
35
+ ;;
36
+ --blueprint=*)
37
+ BLUEPRINT="${1#*=}"
38
+ shift
39
+ ;;
40
+ --ci)
41
+ CI_VALUE="${2:-}"
42
+ shift 2
43
+ ;;
44
+ --ci=*)
45
+ CI_VALUE="${1#*=}"
46
+ shift
47
+ ;;
48
+ --newbie)
49
+ ENABLE_NEWBIE_MODE="true"
50
+ shift
51
+ ;;
52
+ --repository-url)
53
+ REPOSITORY_URL="${2:-}"
54
+ shift 2
55
+ ;;
56
+ --repository-url=*)
57
+ REPOSITORY_URL="${1#*=}"
58
+ shift
59
+ ;;
60
+ --)
61
+ shift
62
+ ADDITIONAL_ARGUMENTS+=("$@")
63
+ break
64
+ ;;
65
+ -* )
66
+ echo "Unknown option: $1" >&2
67
+ exit 1
68
+ ;;
69
+ *)
70
+ TARGET_DIRECTORY="$1"
71
+ shift
72
+ ;;
73
+ esac
74
+ done
75
+
76
+ if ! command -v git >/dev/null 2>&1; then
77
+ echo "Git is required but was not found in PATH." >&2
78
+ exit 1
79
+ fi
80
+
81
+ if ! command -v node >/dev/null 2>&1; then
82
+ echo "Node.js is required but was not found in PATH." >&2
83
+ exit 1
84
+ fi
85
+
86
+ RESOLVED_TARGET_DIRECTORY="$(cd "$TARGET_DIRECTORY" && pwd)"
87
+ TEMPORARY_ROOT_DIRECTORY="$(mktemp -d 2>/dev/null || mktemp -d -t agentic-senior-core-bootstrap)"
88
+ BOOTSTRAP_REPOSITORY_PATH="$TEMPORARY_ROOT_DIRECTORY/Agentic-Senior-Core"
89
+
90
+ cleanup_temporary_directory() {
91
+ rm -rf "$TEMPORARY_ROOT_DIRECTORY"
92
+ }
93
+ trap cleanup_temporary_directory EXIT
94
+
95
+ echo "[Agentic-Senior-Core] Cloning bootstrap repository into temporary directory..."
96
+ git clone --depth 1 "$REPOSITORY_URL" "$BOOTSTRAP_REPOSITORY_PATH" >/dev/null
97
+
98
+ CLI_SCRIPT_PATH="$BOOTSTRAP_REPOSITORY_PATH/bin/agentic-senior-core.js"
99
+ if [[ ! -f "$CLI_SCRIPT_PATH" ]]; then
100
+ echo "CLI entry file not found: $CLI_SCRIPT_PATH" >&2
101
+ exit 1
102
+ fi
103
+
104
+ CLI_ARGUMENTS=("$CLI_SCRIPT_PATH" init "$RESOLVED_TARGET_DIRECTORY")
105
+
106
+ if [[ -n "$PROFILE" ]]; then
107
+ CLI_ARGUMENTS+=(--profile "$PROFILE")
108
+ fi
109
+
110
+ if [[ -n "$STACK" ]]; then
111
+ CLI_ARGUMENTS+=(--stack "$STACK")
112
+ fi
113
+
114
+ if [[ -n "$BLUEPRINT" ]]; then
115
+ CLI_ARGUMENTS+=(--blueprint "$BLUEPRINT")
116
+ fi
117
+
118
+ if [[ -n "$CI_VALUE" ]]; then
119
+ CLI_ARGUMENTS+=(--ci "$CI_VALUE")
120
+ fi
121
+
122
+ if [[ "$ENABLE_NEWBIE_MODE" == "true" ]]; then
123
+ CLI_ARGUMENTS+=(--newbie)
124
+ fi
125
+
126
+ if ((${#ADDITIONAL_ARGUMENTS[@]} > 0)); then
127
+ CLI_ARGUMENTS+=("${ADDITIONAL_ARGUMENTS[@]}")
128
+ fi
129
+
130
+ echo "[Agentic-Senior-Core] Running CLI against target directory: $RESOLVED_TARGET_DIRECTORY"
131
+ node "${CLI_ARGUMENTS[@]}"