@ecc-hgy/ae 0.2.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/LICENSE +21 -0
- package/README.md +108 -0
- package/bin/ae.js +2 -0
- package/package.json +43 -0
- package/skills/brainstorming/SKILL.md +133 -0
- package/skills/diagnose/SKILL.md +146 -0
- package/skills/diagnose/assets/issue-7-sections.md +35 -0
- package/skills/diagnose/scripts/hitl-loop.template.sh +41 -0
- package/skills/grill-me/SKILL.md +10 -0
- package/skills/handoff/SKILL.md +19 -0
- package/skills/improve-codebase-architecture/DEEPENING.md +37 -0
- package/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/skills/improve-codebase-architecture/INTERFACE-DESIGN.md +44 -0
- package/skills/improve-codebase-architecture/LANGUAGE.md +53 -0
- package/skills/improve-codebase-architecture/SKILL.md +101 -0
- package/skills/review/SKILL.md +119 -0
- package/skills/tdd/SKILL.md +157 -0
- package/skills/tdd/deep-modules.md +33 -0
- package/skills/tdd/interface-design.md +31 -0
- package/skills/tdd/mocking.md +59 -0
- package/skills/tdd/refactoring.md +10 -0
- package/skills/tdd/tests.md +61 -0
- package/skills/to-issues/SKILL.md +79 -0
- package/skills/to-issues/todo-template.md +25 -0
- package/skills/to-prd/SKILL.md +108 -0
- package/skills/verification-before-completion/SKILL.md +153 -0
- package/skills/writing-plans/SKILL.md +115 -0
- package/skills/zoom-out/SKILL.md +7 -0
- package/src/cli.js +62 -0
- package/src/commands/init.js +190 -0
- package/src/commands/setup.js +111 -0
- package/src/skeleton.js +209 -0
- package/src/utils/copy.js +100 -0
- package/src/utils/paths.js +60 -0
- package/src/utils/report.js +31 -0
- package/templates/ae-rules.md +17 -0
- package/templates/entries/AGENTS.md +21 -0
- package/templates/entries/CLAUDE.md +21 -0
- package/templates/entries/README.md +18 -0
- package/templates/entries/handoff.md +1 -0
- package/templates/entries/spec/INDEX.md +15 -0
- package/templates/entries/spec/README.md +19 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { access } from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
let cachedPackageRoot;
|
|
7
|
+
|
|
8
|
+
export async function packageRootAsync() {
|
|
9
|
+
if (cachedPackageRoot) {
|
|
10
|
+
return cachedPackageRoot;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let current = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
while (true) {
|
|
15
|
+
const candidate = path.join(current, 'package.json');
|
|
16
|
+
try {
|
|
17
|
+
await access(candidate);
|
|
18
|
+
cachedPackageRoot = current;
|
|
19
|
+
return cachedPackageRoot;
|
|
20
|
+
} catch {
|
|
21
|
+
const parent = path.dirname(current);
|
|
22
|
+
if (parent === current) {
|
|
23
|
+
throw new Error('Could not find package.json from current module path.');
|
|
24
|
+
}
|
|
25
|
+
current = parent;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function packageRoot() {
|
|
31
|
+
if (cachedPackageRoot) {
|
|
32
|
+
return cachedPackageRoot;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let current = path.dirname(fileURLToPath(import.meta.url));
|
|
36
|
+
while (true) {
|
|
37
|
+
if (existsSync(path.join(current, 'package.json'))) {
|
|
38
|
+
cachedPackageRoot = current;
|
|
39
|
+
return cachedPackageRoot;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const parent = path.dirname(current);
|
|
43
|
+
if (parent === current) {
|
|
44
|
+
throw new Error('Could not find package.json from current module path.');
|
|
45
|
+
}
|
|
46
|
+
current = parent;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function assetPath(name) {
|
|
51
|
+
return path.join(packageRoot(), name);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function skillsPath() {
|
|
55
|
+
return path.join(packageRoot(), 'skills');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function templatesPath(subdir = '') {
|
|
59
|
+
return path.join(packageRoot(), 'templates', subdir);
|
|
60
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function formatSetupReport({ created, skipped, target, dryRun }) {
|
|
2
|
+
const installedLabel = dryRun ? 'Would install' : 'Installed';
|
|
3
|
+
return [
|
|
4
|
+
dryRun ? 'AE setup dry run complete' : 'AE setup complete',
|
|
5
|
+
`- ${installedLabel}: ${created.length} (${summarize(created)})`,
|
|
6
|
+
`- Skipped: ${skipped.length} (${summarize(skipped)})`,
|
|
7
|
+
`- Target: ${target}`,
|
|
8
|
+
`- Next: edit config/ae-rules.md (optional), then run \`ae init "<goal>"\`.`,
|
|
9
|
+
].join('\n');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function formatInitReport({ created, skipped, target, rules, dryRun }) {
|
|
13
|
+
const createdLabel = dryRun ? 'Would create' : 'Created';
|
|
14
|
+
return [
|
|
15
|
+
dryRun ? 'AE init dry run complete' : 'AE init complete',
|
|
16
|
+
`- ${createdLabel}: ${created.length} (${summarize(created)})`,
|
|
17
|
+
`- Skipped: ${skipped.length} (${summarize(skipped)})`,
|
|
18
|
+
`- Rules: ${rules}`,
|
|
19
|
+
`- Target: ${target}`,
|
|
20
|
+
].join('\n');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function summarize(paths) {
|
|
24
|
+
if (paths.length === 0) {
|
|
25
|
+
return 'none';
|
|
26
|
+
}
|
|
27
|
+
if (paths.length <= 8) {
|
|
28
|
+
return paths.join(', ');
|
|
29
|
+
}
|
|
30
|
+
return `${paths.slice(0, 8).join(', ')}, ...`;
|
|
31
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Project-Specific Rules
|
|
2
|
+
|
|
3
|
+
<!-- 这个文件在 `ae init` 时会被读取,内容会注入到 AGENTS.md 与 CLAUDE.md 的
|
|
4
|
+
AE:RULES block 中。可以在 `ae setup` 之后、`ae init` 之前编辑。 -->
|
|
5
|
+
|
|
6
|
+
## 通用约束
|
|
7
|
+
|
|
8
|
+
- 例如:所有代码注释使用中文
|
|
9
|
+
- 例如:提交信息遵循 Conventional Commits
|
|
10
|
+
|
|
11
|
+
## 项目栈
|
|
12
|
+
|
|
13
|
+
- 例如:Node.js 18+,TypeScript strict mode
|
|
14
|
+
|
|
15
|
+
## 协作偏好
|
|
16
|
+
|
|
17
|
+
- 例如:小步提交,每个 commit 必须包含测试
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Project Goal
|
|
2
|
+
|
|
3
|
+
{{PROJECT_GOAL}}
|
|
4
|
+
|
|
5
|
+
## R1 Progressive Loading
|
|
6
|
+
|
|
7
|
+
Keep this file short because every agent session loads it. Do trivial work directly. For non-trivial product, architecture, implementation, or debug work, first load the relevant local guidance or skill, then proceed.
|
|
8
|
+
|
|
9
|
+
## Spec Landing Rules
|
|
10
|
+
|
|
11
|
+
- SDD owns what to build; TDD owns how to prove it works.
|
|
12
|
+
- After writing or changing anything under `spec/needs/<need-name>/`, update `spec/INDEX.md`.
|
|
13
|
+
- If `spec/INDEX.md` cannot be updated confidently, run the future `index-rebuild` command or leave an explicit handoff note.
|
|
14
|
+
- Do not write `prd.md` before requirement alignment.
|
|
15
|
+
- Do not fix a bug before expected behavior is aligned.
|
|
16
|
+
|
|
17
|
+
## Project Specific Rules
|
|
18
|
+
|
|
19
|
+
<!-- AE:PROJECT:BEGIN -->
|
|
20
|
+
<!-- Add project-specific rules here. `ae init` manages AE:RULES separately. -->
|
|
21
|
+
<!-- AE:PROJECT:END -->
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Project Goal
|
|
2
|
+
|
|
3
|
+
{{PROJECT_GOAL}}
|
|
4
|
+
|
|
5
|
+
## R1 Progressive Loading
|
|
6
|
+
|
|
7
|
+
Keep this file short because every agent session loads it. Do trivial work directly. For non-trivial product, architecture, implementation, or debug work, first load the relevant local guidance or skill, then proceed.
|
|
8
|
+
|
|
9
|
+
## Spec Landing Rules
|
|
10
|
+
|
|
11
|
+
- SDD owns what to build; TDD owns how to prove it works.
|
|
12
|
+
- After writing or changing anything under `spec/needs/<need-name>/`, update `spec/INDEX.md`.
|
|
13
|
+
- If `spec/INDEX.md` cannot be updated confidently, run the future `index-rebuild` command or leave an explicit handoff note.
|
|
14
|
+
- Do not write `prd.md` before requirement alignment.
|
|
15
|
+
- Do not fix a bug before expected behavior is aligned.
|
|
16
|
+
|
|
17
|
+
## Project Specific Rules
|
|
18
|
+
|
|
19
|
+
<!-- AE:PROJECT:BEGIN -->
|
|
20
|
+
<!-- Add project-specific rules here. `ae init` manages AE:RULES separately. -->
|
|
21
|
+
<!-- AE:PROJECT:END -->
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!-- 跨会话/跨项目进展交接,由 handoff skill 在会话结束时人工触发更新。 -->
|