@fiale-plus/repo-arch 0.1.0 → 0.3.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.
@@ -0,0 +1,53 @@
1
+ import * as fs from 'node:fs';
2
+ import * as path from 'node:path';
3
+ import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
4
+
5
+ const COMMANDS = [
6
+ { label: 'Initialize config', command: 'repo-arch init', hint: 'write repo-arch.config.json' },
7
+ { label: 'Run prepare flow', command: 'repo-arch flow run --repo .', hint: 'history → cards → dataset → train plan' },
8
+ { label: 'Run full flow', command: 'repo-arch flow run full --repo .', hint: 'includes embeddings and eval' },
9
+ { label: 'Inspect run', command: 'repo-arch flow inspect --repo .', hint: 'show artifacts and next steps' },
10
+ { label: 'Review cards', command: 'repo-arch review list', hint: 'accept/reject before training' },
11
+ { label: 'Train plan', command: 'repo-arch train prepare --repo .', hint: 'prepare LoRA training' },
12
+ { label: 'Train cycle', command: 'repo-arch train cycle --repo .', hint: 'continue the persistent loop' },
13
+ { label: 'Train resume', command: 'repo-arch train resume --repo .', hint: 'resume from latest checkpoint' },
14
+ { label: 'Train status', command: 'repo-arch train status --repo .', hint: 'inspect the current session' },
15
+ { label: 'Train list', command: 'repo-arch train list --repo .', hint: 'show all training sessions' },
16
+ { label: 'Train adapter', command: 'repo-arch train run --repo .', hint: 'execute one-shot LoRA training' },
17
+ { label: 'Explain a file', command: 'repo-arch why src/core.ts --json', hint: 'history for one file' },
18
+ { label: 'Find similar history', command: 'repo-arch similar "why auth middleware token-only?" --json', hint: 'semantic search over cards' },
19
+ ];
20
+
21
+ function findConfigFile(cwd: string): string | null {
22
+ const candidates = [
23
+ path.join(cwd, 'repo-arch.config.json'),
24
+ path.join(cwd, '.repo-arch', 'config.json'),
25
+ ];
26
+ for (const candidate of candidates) {
27
+ if (fs.existsSync(candidate)) return candidate;
28
+ }
29
+ return null;
30
+ }
31
+
32
+ export default function repoArchExtension(pi: ExtensionAPI) {
33
+ pi.registerCommand('repo-arch', {
34
+ description: 'Show the self-contained repo-arch CLI workflow',
35
+ getArgumentCompletions: (prefix) => {
36
+ const options = ['init', 'flow', 'review', 'train', 'eval', 'why', 'similar'];
37
+ const filtered = options.filter((option) => option.startsWith(prefix));
38
+ return filtered.length > 0 ? filtered.map((value) => ({ value, label: value })) : null;
39
+ },
40
+ handler: async (_args, ctx) => {
41
+ const cwd = process.cwd();
42
+ const configFile = findConfigFile(cwd);
43
+ const withConfig = (cmd: string) => (configFile ? cmd.replace(' --repo .', ` --repo . --config ${path.relative(cwd, configFile)}`) : cmd);
44
+ const choices = COMMANDS.map((entry) => `${entry.label} — ${withConfig(entry.command)} — ${entry.hint}`);
45
+
46
+ const selected = await ctx.ui.select('repo-arch workflow', choices);
47
+ if (!selected) return;
48
+
49
+ const command = selected.split(' — ')[1] ?? selected;
50
+ ctx.ui.notify(command, 'info');
51
+ },
52
+ });
53
+ }
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: repo-arch
3
+ description: Self-contained repo-arch workflow for turning git history into cards, embeddings, datasets, and training runs. Use when you want the CLI flow, run inspection, or guided repo-memory setup.
4
+ ---
5
+
6
+ # Repo-Arch
7
+
8
+ ## Quick start
9
+
10
+ ```bash
11
+ repo-arch init
12
+ repo-arch flow run --repo .
13
+ repo-arch flow run full --repo .
14
+ repo-arch flow inspect --repo .
15
+ ```
16
+
17
+ ## Core workflow
18
+
19
+ 1. `repo-arch init` — write a starter `repo-arch.config.json`
20
+ 2. `repo-arch flow run` — build history, cards, dataset, and train plan
21
+ 3. `repo-arch flow run full` — also build embeddings and evaluation
22
+ 4. `repo-arch flow inspect` — see run status, artifacts, and next steps
23
+ 5. `repo-arch review list` — curate accepted/rejected cards
24
+ 6. `repo-arch eval` — compare retrieval strategies
25
+ 7. `repo-arch train prepare` — export training plan
26
+ 8. `repo-arch train cycle` — continue the persistent training loop
27
+ 9. `repo-arch train resume` — resume from the latest checkpoint
28
+ 10. `repo-arch train run` — execute training directly
29
+
30
+ ## Investigation commands
31
+
32
+ ```bash
33
+ repo-arch why src/core.ts --json
34
+ repo-arch check-diff --base main --json
35
+ repo-arch check-stale --json
36
+ repo-arch similar "why auth middleware token-only?" --json
37
+ ```
38
+
39
+ ## What to suggest next
40
+
41
+ - First-time user: `repo-arch init`
42
+ - Want the happy path: `repo-arch flow run full`
43
+ - Need run details: `repo-arch flow inspect`
44
+ - Need curation: `repo-arch review list`
45
+ - Need training: `repo-arch train cycle`
46
+ - Need to resume: `repo-arch train resume`
47
+ - Need status: `repo-arch train status`
48
+ - Need the history: `repo-arch train list`
49
+
50
+ Keep the CLI as the source of truth; use this skill only as a guide to the flow.