Pi skill integration, CLI polish, --fix flag, config file support
- SKILL.md: Proper Agent Skills frontmatter with name/description - pi-extension.ts: Pi extension registering 4 custom tools (project_map_init/patch/validate/reinit) with prompt snippets/guidelines - pi-extension.ts: Auto-detects .pi-map.md files on session start, warns about dirty markers, injects maintenance hints before agent start - package.json: Added pi.extensions and pi.skills entries - CLI: Added picocolors, clean help screen, progress indicators, summary output with timing, colored check/warning icons - validate.ts: Added --fix flag that regenerates directories with discrepancies - config.ts: Reads .pi-project-map.json from project root with merge over defaults - init.ts: Added optional verbose parameter for programmatic use All 16 tests pass. TypeScript compiles clean. Build succeeds.
This commit is contained in:
+12
-4
@@ -10,14 +10,19 @@ import { mergeFileData } from "./merge.js";
|
||||
import { writeFileSync } from "fs";
|
||||
import { join } from "path";
|
||||
|
||||
export async function initProject(rootPath: string): Promise<void> {
|
||||
export async function initProject(
|
||||
rootPath: string,
|
||||
options?: { verbose?: boolean },
|
||||
): Promise<void> {
|
||||
const entries = discoverProject(rootPath);
|
||||
|
||||
for (const entry of entries) {
|
||||
await generateDirectoryMap(entry);
|
||||
}
|
||||
|
||||
console.log(`Generated ${entries.length} .pi-map.md files`);
|
||||
if (options?.verbose !== false) {
|
||||
console.log(`Generated ${entries.length} .pi-map.md files`);
|
||||
}
|
||||
}
|
||||
|
||||
export async function generateDirectoryMap(
|
||||
@@ -46,7 +51,10 @@ export async function generateDirectoryMap(
|
||||
return fileData;
|
||||
}
|
||||
|
||||
export async function reinitPath(path: string): Promise<void> {
|
||||
export async function reinitPath(
|
||||
path: string,
|
||||
options?: { verbose?: boolean },
|
||||
): Promise<void> {
|
||||
// Full regeneration clears all dirty markers by overwriting every .pi-map.md
|
||||
await initProject(path);
|
||||
await initProject(path, options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user