Initial commit: pi-project-map skill scaffolding
- Design doc with full spec (dense markdown format, hybrid AST+LLM pipeline, consumption model, stale data mitigation) - Implementation plan with 6 milestones and rollout strategy - TypeScript package structure with all source stubs - CLI entry point, formatter, discover, init, patch, validate, extract, merge - Pi SKILL.md with tool definitions and format documentation
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
export interface PackageMapData {
|
||||
path: string;
|
||||
role: string;
|
||||
files: FileEntry[];
|
||||
arch: string;
|
||||
dirty?: string;
|
||||
}
|
||||
|
||||
export interface FileEntry {
|
||||
name: string;
|
||||
purpose: string;
|
||||
exports: string[];
|
||||
deps: string[];
|
||||
}
|
||||
|
||||
export function renderPackageMap(data: PackageMapData): string {
|
||||
const lines: string[] = [];
|
||||
lines.push(`# ${data.path}`);
|
||||
lines.push(`## role`);
|
||||
lines.push(data.role);
|
||||
lines.push(`## files`);
|
||||
for (const file of data.files) {
|
||||
const exp = file.exports.length > 0 ? `exp: ${file.exports.join(', ')}` : '';
|
||||
const dep = file.deps.length > 0 ? `dep: ${file.deps.join(', ')}` : '';
|
||||
const parts = [`- ${file.name} | ${file.purpose}`];
|
||||
if (exp) parts.push(exp);
|
||||
if (dep) parts.push(dep);
|
||||
lines.push(parts.join(' | '));
|
||||
}
|
||||
lines.push(`## arch`);
|
||||
lines.push(data.arch);
|
||||
lines.push(`## dirty`);
|
||||
lines.push(data.dirty || '-');
|
||||
return `${lines.join('\n')}\n`;
|
||||
}
|
||||
|
||||
export function parsePackageMap(_markdown: string): PackageMapData {
|
||||
// TODO: implement robust parser
|
||||
throw new Error('parsePackageMap not yet implemented');
|
||||
}
|
||||
Reference in New Issue
Block a user