@ryuenn3123/agentic-senior-core 2.0.19 → 2.0.21
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/state/benchmark-comparison-schema.json +181 -0
- package/.cursorrules +1 -1
- package/.gemini/instructions.md +1 -1
- package/.github/copilot-instructions.md +1 -1
- package/.windsurfrules +1 -1
- package/AGENTS.md +1 -1
- package/lib/cli/commands/init.mjs +123 -0
- package/lib/cli/commands/upgrade.mjs +16 -0
- package/lib/cli/compiler.mjs +31 -0
- package/lib/cli/project-scaffolder.mjs +465 -0
- package/lib/cli/templates/api-contract.md.id.tmpl +143 -0
- package/lib/cli/templates/api-contract.md.tmpl +143 -0
- package/lib/cli/templates/architecture-decision-record.md.id.tmpl +106 -0
- package/lib/cli/templates/architecture-decision-record.md.tmpl +106 -0
- package/lib/cli/templates/database-schema.md.id.tmpl +74 -0
- package/lib/cli/templates/database-schema.md.tmpl +74 -0
- package/lib/cli/templates/flow-overview.md.id.tmpl +118 -0
- package/lib/cli/templates/flow-overview.md.tmpl +119 -0
- package/lib/cli/templates/project-brief.md.id.tmpl +53 -0
- package/lib/cli/templates/project-brief.md.tmpl +53 -0
- package/lib/cli/utils.mjs +5 -1
- package/package.json +2 -2
- package/scripts/bump-version.mjs +101 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Flow Overview: {{projectName}}
|
|
2
|
+
|
|
3
|
+
Generated by Agentic-Senior-Core CLI v{{cliVersion}}
|
|
4
|
+
Generated at: {{generatedAt}}
|
|
5
|
+
Template version: {{templateVersion}}
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## System Overview
|
|
10
|
+
|
|
11
|
+
**Project**: {{projectName}}
|
|
12
|
+
**Domain**: {{primaryDomain}}
|
|
13
|
+
**Stack**: {{stackDisplayName}}
|
|
14
|
+
**Blueprint**: {{blueprintDisplayName}}
|
|
15
|
+
|
|
16
|
+
## High-Level Architecture
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
┌─────────────┐ ┌──────────────┐ ┌──────────────┐
|
|
20
|
+
│ Client │────>│ Transport │────>│ Service │
|
|
21
|
+
│ (Browser/ │<────│ Layer │<────│ Layer │
|
|
22
|
+
│ Mobile/ │ │ (Routes/ │ │ (Business │
|
|
23
|
+
│ CLI) │ │ Handlers) │ │ Logic) │
|
|
24
|
+
└─────────────┘ └──────────────┘ └──────┬───────┘
|
|
25
|
+
│
|
|
26
|
+
┌──────▼───────┐
|
|
27
|
+
│ Repository │
|
|
28
|
+
│ Layer │
|
|
29
|
+
│ (Data │
|
|
30
|
+
│ Access) │
|
|
31
|
+
└──────┬───────┘
|
|
32
|
+
│
|
|
33
|
+
┌──────▼───────┐
|
|
34
|
+
│ Database │
|
|
35
|
+
│ {{databaseChoice}}
|
|
36
|
+
└──────────────┘
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Request Flow
|
|
40
|
+
|
|
41
|
+
### Standard Request Lifecycle
|
|
42
|
+
|
|
43
|
+
1. **Client** sends HTTP request (or CLI input, or event trigger).
|
|
44
|
+
2. **Transport layer** receives the request, validates input format, and routes to the correct handler.
|
|
45
|
+
3. **Service layer** applies business logic, orchestrates domain operations, and enforces rules.
|
|
46
|
+
4. **Repository layer** performs data access (read/write to database or external service).
|
|
47
|
+
5. **Response** flows back through Service to Transport to Client.
|
|
48
|
+
|
|
49
|
+
### Layer Responsibilities
|
|
50
|
+
|
|
51
|
+
| Layer | Does | Does NOT |
|
|
52
|
+
|-------|------|----------|
|
|
53
|
+
| Transport | Parse input, validate shape, route, format response | Contain business logic, access database |
|
|
54
|
+
| Service | Business rules, orchestration, domain validation | Parse HTTP, format responses, run SQL |
|
|
55
|
+
| Repository | Data access, query construction, caching | Business logic, input validation |
|
|
56
|
+
|
|
57
|
+
{{#if hasAuth}}
|
|
58
|
+
## Authentication Flow
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
┌────────┐ ┌───────────┐ ┌──────────┐ ┌──────────┐
|
|
62
|
+
│ Client │────>│ Auth │────>│ Token │────>│ Protected│
|
|
63
|
+
│ │ │ Endpoint │ │ Verify │ │ Resource │
|
|
64
|
+
│ │<────│ │<────│ ({{authStrategy}}) │<────│ │
|
|
65
|
+
└────────┘ └───────────┘ └──────────┘ └──────────┘
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
1. Client sends credentials to auth endpoint.
|
|
69
|
+
2. Service validates credentials against stored data.
|
|
70
|
+
3. On success, service issues a {{authStrategy}} token.
|
|
71
|
+
4. Client includes token in subsequent requests.
|
|
72
|
+
5. Middleware verifies token before forwarding to protected handlers.
|
|
73
|
+
|
|
74
|
+
{{/if}}
|
|
75
|
+
## Feature Flows
|
|
76
|
+
|
|
77
|
+
For each key feature, define the data and control flow:
|
|
78
|
+
|
|
79
|
+
{{#each features}}
|
|
80
|
+
### {{this}}
|
|
81
|
+
|
|
82
|
+
**Actors**: [define who initiates this flow]
|
|
83
|
+
**Trigger**: [define what starts this flow]
|
|
84
|
+
**Steps**:
|
|
85
|
+
1. [Step 1]
|
|
86
|
+
2. [Step 2]
|
|
87
|
+
3. [Step 3]
|
|
88
|
+
|
|
89
|
+
**Success outcome**: [what happens when the flow completes]
|
|
90
|
+
**Error handling**: [what happens on failure]
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
{{/each}}
|
|
95
|
+
|
|
96
|
+
## Data Flow Diagram
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
Input Data Processing Output
|
|
100
|
+
────────── ────────── ──────────
|
|
101
|
+
┌───────────────────┐
|
|
102
|
+
User Input ──────>│ Validation │
|
|
103
|
+
│ (Transport) │
|
|
104
|
+
└────────┬──────────┘
|
|
105
|
+
│
|
|
106
|
+
┌────────▼──────────┐
|
|
107
|
+
│ Business Logic │
|
|
108
|
+
│ (Service) │
|
|
109
|
+
└────────┬──────────┘
|
|
110
|
+
│
|
|
111
|
+
┌────────▼──────────┐
|
|
112
|
+
│ Data Persist │───────> Stored Data
|
|
113
|
+
│ (Repository) │
|
|
114
|
+
└───────────────────┘
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
This document is a living reference. Update flows as features are implemented and refined.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Ringkasan Proyek: {{projectName}}
|
|
2
|
+
|
|
3
|
+
Dibuat oleh Agentic-Senior-Core CLI v{{cliVersion}}
|
|
4
|
+
Dibuat pada: {{generatedAt}}
|
|
5
|
+
Versi template: {{templateVersion}}
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Ikhtisar
|
|
10
|
+
|
|
11
|
+
**Nama proyek**: {{projectName}}
|
|
12
|
+
**Deskripsi**: {{projectDescription}}
|
|
13
|
+
**Domain utama**: {{primaryDomain}}
|
|
14
|
+
|
|
15
|
+
## Keputusan Teknologi
|
|
16
|
+
|
|
17
|
+
**Stack**: {{stackDisplayName}}
|
|
18
|
+
**Blueprint**: {{blueprintDisplayName}}
|
|
19
|
+
**Database**: {{databaseChoice}}
|
|
20
|
+
**Strategi autentikasi**: {{authStrategy}}
|
|
21
|
+
|
|
22
|
+
## Fitur Kunci
|
|
23
|
+
|
|
24
|
+
{{#each features}}
|
|
25
|
+
- {{this}}
|
|
26
|
+
{{/each}}
|
|
27
|
+
|
|
28
|
+
## Konteks Tambahan
|
|
29
|
+
|
|
30
|
+
{{additionalContext}}
|
|
31
|
+
|
|
32
|
+
## Batasan dan Asumsi
|
|
33
|
+
|
|
34
|
+
- Proyek ini mengikuti aturan governance di `.agent-context/rules/`.
|
|
35
|
+
- Konvensi stack mengacu ke `.agent-context/stacks/{{stackFileName}}`.
|
|
36
|
+
- Pola arsitektur mengacu ke `.agent-context/blueprints/{{blueprintFileName}}`.
|
|
37
|
+
- Semua kode harus lolos checklist di `.agent-context/review-checklists/pr-checklist.md`.
|
|
38
|
+
|
|
39
|
+
## Tujuan
|
|
40
|
+
|
|
41
|
+
1. Mengirimkan {{primaryDomain}} yang berjalan dengan stack {{stackDisplayName}}.
|
|
42
|
+
2. Menjaga standar engineering production-grade sejak awal.
|
|
43
|
+
3. Menjaga keputusan arsitektur tetap terdokumentasi dan bisa ditelusuri.
|
|
44
|
+
|
|
45
|
+
## Non-Tujuan (Ruang Lingkup Awal)
|
|
46
|
+
|
|
47
|
+
- Optimasi performa di luar baseline yang wajar.
|
|
48
|
+
- Deployment multi-region.
|
|
49
|
+
- Analitik atau pelaporan tingkat lanjut.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
Dokumen ini adalah referensi hidup. Perbarui saat ruang lingkup proyek berkembang.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Project Brief: {{projectName}}
|
|
2
|
+
|
|
3
|
+
Generated by Agentic-Senior-Core CLI v{{cliVersion}}
|
|
4
|
+
Generated at: {{generatedAt}}
|
|
5
|
+
Template version: {{templateVersion}}
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
**Project name**: {{projectName}}
|
|
12
|
+
**Description**: {{projectDescription}}
|
|
13
|
+
**Primary domain**: {{primaryDomain}}
|
|
14
|
+
|
|
15
|
+
## Technology Decisions
|
|
16
|
+
|
|
17
|
+
**Stack**: {{stackDisplayName}}
|
|
18
|
+
**Blueprint**: {{blueprintDisplayName}}
|
|
19
|
+
**Database**: {{databaseChoice}}
|
|
20
|
+
**Auth strategy**: {{authStrategy}}
|
|
21
|
+
|
|
22
|
+
## Key Features
|
|
23
|
+
|
|
24
|
+
{{#each features}}
|
|
25
|
+
- {{this}}
|
|
26
|
+
{{/each}}
|
|
27
|
+
|
|
28
|
+
## Additional Context
|
|
29
|
+
|
|
30
|
+
{{additionalContext}}
|
|
31
|
+
|
|
32
|
+
## Constraints and Assumptions
|
|
33
|
+
|
|
34
|
+
- This project follows the governance rules defined in `.agent-context/rules/`.
|
|
35
|
+
- Stack conventions are defined in `.agent-context/stacks/{{stackFileName}}`.
|
|
36
|
+
- Architecture patterns follow `.agent-context/blueprints/{{blueprintFileName}}`.
|
|
37
|
+
- All code must pass the review checklist at `.agent-context/review-checklists/pr-checklist.md`.
|
|
38
|
+
|
|
39
|
+
## Goals
|
|
40
|
+
|
|
41
|
+
1. Deliver a working {{primaryDomain}} using the {{stackDisplayName}} stack.
|
|
42
|
+
2. Follow production-grade engineering standards from day one.
|
|
43
|
+
3. Keep architecture decisions documented and traceable.
|
|
44
|
+
|
|
45
|
+
## Non-Goals (Initial Scope)
|
|
46
|
+
|
|
47
|
+
- Performance optimization beyond sensible defaults.
|
|
48
|
+
- Multi-region deployment.
|
|
49
|
+
- Advanced analytics or reporting.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
This document is a living reference. Update it as the project scope evolves.
|
package/lib/cli/utils.mjs
CHANGED
|
@@ -28,7 +28,7 @@ export function printUsage() {
|
|
|
28
28
|
console.log('');
|
|
29
29
|
console.log('Usage:');
|
|
30
30
|
console.log(' agentic-senior-core launch');
|
|
31
|
-
console.log(' agentic-senior-core init [target-directory] [--preset <name>] [--profile <beginner|balanced|strict>] [--profile-pack <name>] [--stack <name>] [--blueprint <name>] [--ci <true|false>] [--newbie] [--token-optimize] [--no-token-optimize] [--token-agent <name>]');
|
|
31
|
+
console.log(' agentic-senior-core init [target-directory] [--preset <name>] [--profile <beginner|balanced|strict>] [--profile-pack <name>] [--stack <name>] [--blueprint <name>] [--ci <true|false>] [--newbie] [--token-optimize] [--no-token-optimize] [--token-agent <name>] [--scaffold-docs] [--no-scaffold-docs] [--docs-lang <en|id>] [--project-config <path>]');
|
|
32
32
|
console.log(' agentic-senior-core upgrade [target-directory] [--dry-run] [--yes] [--mcp-template]');
|
|
33
33
|
console.log(' agentic-senior-core optimize [target-directory] [--agent <copilot|claude|cursor|windsurf|gemini|codex|cline>] [--enable|--disable] [--show]');
|
|
34
34
|
console.log(' agentic-senior-core mcp');
|
|
@@ -50,6 +50,10 @@ export function printUsage() {
|
|
|
50
50
|
console.log(' --token-agent Set token optimization agent target (copilot, claude, cursor, windsurf, gemini, codex, cline)');
|
|
51
51
|
console.log(' --no-token-optimize Disable token optimization policy during init');
|
|
52
52
|
console.log(' --mcp-template Create .vscode/mcp.json workspace template (MCP trust/start remains manual in IDE)');
|
|
53
|
+
console.log(' --scaffold-docs Force project documentation scaffolding (architecture, database, API, flow)');
|
|
54
|
+
console.log(' --no-scaffold-docs Skip project documentation scaffolding');
|
|
55
|
+
console.log(' --docs-lang Language for generated project docs (en, id; default: en)');
|
|
56
|
+
console.log(' --project-config Path to a project config file for non-interactive doc scaffolding');
|
|
53
57
|
console.log(' --dry-run Preview upgrade without writing files');
|
|
54
58
|
console.log(' --yes Skip confirmation prompts for upgrade');
|
|
55
59
|
console.log(' --agent Target agent integration for token optimization mode');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryuenn3123/agentic-senior-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Force your AI Agent to code like a Staff Engineer, not a Junior.",
|
|
6
6
|
"bin": {
|
|
@@ -57,4 +57,4 @@
|
|
|
57
57
|
"validate": "node ./scripts/validate.mjs",
|
|
58
58
|
"test": "node --test ./tests/cli-smoke.test.mjs ./tests/mcp-server.test.mjs ./tests/llm-judge.test.mjs ./tests/enterprise-ops.test.mjs ./tests/skill-tier-gate.test.mjs"
|
|
59
59
|
}
|
|
60
|
-
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
const ROOT_DIR = path.resolve(__dirname, '..');
|
|
8
|
+
|
|
9
|
+
async function fileExists(filePath) {
|
|
10
|
+
try {
|
|
11
|
+
await fs.stat(filePath);
|
|
12
|
+
return true;
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function readTextFile(filePath) {
|
|
19
|
+
return fs.readFile(filePath, 'utf8');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async function writeTextFile(filePath, content) {
|
|
23
|
+
return fs.writeFile(filePath, content, 'utf8');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function bumpVersion() {
|
|
27
|
+
const newVersion = process.argv[2];
|
|
28
|
+
if (!newVersion || !/^\d+\.\d+\.\d+$/.test(newVersion)) {
|
|
29
|
+
console.error('Usage: node scripts/bump-version.mjs <new-version>');
|
|
30
|
+
console.error('Example: node scripts/bump-version.mjs 2.1.0');
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
console.log(`Starting version bump to ${newVersion}...`);
|
|
35
|
+
|
|
36
|
+
// 1. Update package.json
|
|
37
|
+
const packageJsonPath = path.join(ROOT_DIR, 'package.json');
|
|
38
|
+
const packageJsonContent = await readTextFile(packageJsonPath);
|
|
39
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
40
|
+
const oldVersion = packageJson.version;
|
|
41
|
+
|
|
42
|
+
if (oldVersion === newVersion) {
|
|
43
|
+
console.log(`Version is already ${newVersion}. Exiting.`);
|
|
44
|
+
process.exit(0);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
packageJson.version = newVersion;
|
|
48
|
+
await writeTextFile(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
|
|
49
|
+
console.log(`Updated package.json (was ${oldVersion})`);
|
|
50
|
+
|
|
51
|
+
// 2. Update docs/deep_analysis_and_roadmap_backlog.md
|
|
52
|
+
const roadmapPath = path.join(ROOT_DIR, 'docs', 'deep_analysis_and_roadmap_backlog.md');
|
|
53
|
+
if (await fileExists(roadmapPath)) {
|
|
54
|
+
let roadmapContent = await readTextFile(roadmapPath);
|
|
55
|
+
roadmapContent = roadmapContent.replace(`Current Version: ${oldVersion}`, `Current Version: ${newVersion}`);
|
|
56
|
+
await writeTextFile(roadmapPath, roadmapContent);
|
|
57
|
+
console.log('Updated docs/deep_analysis_and_roadmap_backlog.md');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// 3. Update Rule files (.cursorrules, .windsurfrules)
|
|
61
|
+
const ruleFiles = ['.cursorrules', '.windsurfrules'];
|
|
62
|
+
for (const ruleFile of ruleFiles) {
|
|
63
|
+
const fullPath = path.join(ROOT_DIR, ruleFile);
|
|
64
|
+
if (await fileExists(fullPath)) {
|
|
65
|
+
let content = await readTextFile(fullPath);
|
|
66
|
+
content = content.replace(`Generated by Agentic-Senior-Core CLI v${oldVersion}`, `Generated by Agentic-Senior-Core CLI v${newVersion}`);
|
|
67
|
+
await writeTextFile(fullPath, content);
|
|
68
|
+
console.log(`Updated ${ruleFile}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// 4. Update CHANGELOG.md
|
|
73
|
+
const changelogPath = path.join(ROOT_DIR, 'CHANGELOG.md');
|
|
74
|
+
if (await fileExists(changelogPath)) {
|
|
75
|
+
let changelogContent = await readTextFile(changelogPath);
|
|
76
|
+
|
|
77
|
+
// Check if new version already has an entry
|
|
78
|
+
if (!changelogContent.includes(`## ${newVersion}`)) {
|
|
79
|
+
const today = new Date().toISOString().split('T')[0];
|
|
80
|
+
const newEntry = `## ${newVersion} - ${today}\n### Added\n- \n\n### Changed\n- \n\n### Fixed\n- \n\n`;
|
|
81
|
+
|
|
82
|
+
// Find the first version heading "## x.x.x"
|
|
83
|
+
const firstHeadingIndex = changelogContent.search(/^## \d+\.\d+\.\d+/m);
|
|
84
|
+
if (firstHeadingIndex !== -1) {
|
|
85
|
+
changelogContent = changelogContent.slice(0, firstHeadingIndex) + newEntry + changelogContent.slice(firstHeadingIndex);
|
|
86
|
+
await writeTextFile(changelogPath, changelogContent);
|
|
87
|
+
console.log('Prepended new entry to CHANGELOG.md');
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
console.log(`CHANGELOG.md already has an entry for ${newVersion}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
console.log(`\nVersion successfully bumped from ${oldVersion} to ${newVersion}!`);
|
|
95
|
+
console.log('Remember to fill out your CHANGELOG.md before pushing.');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
bumpVersion().catch(e => {
|
|
99
|
+
console.error('Fatal error:', e);
|
|
100
|
+
process.exit(1);
|
|
101
|
+
});
|