refactor: restructure workspace file organization (#121) (#122)

## Path Changes
- audit.log: memory/audit.log → log/audit.log
- projects.json: memory/projects.json → projects/projects.json
- prompts: roles/<project>/<role>.md → projects/prompts/<project>/<role>.md

## Files Updated
- lib/audit.ts - new audit log path
- lib/projects.ts - new projects.json path
- lib/dispatch.ts - new prompt instructions path
- lib/tools/project-register.ts - prompt scaffolding path
- lib/setup/workspace.ts - workspace scaffolding paths
- lib/context-guard.ts - projects.json path
- lib/tools/setup.ts - tool description
- lib/templates.ts - AGENTS.md template path references

## Documentation Updated
- README.md
- docs/ARCHITECTURE.md
- docs/ONBOARDING.md
- docs/QA_WORKFLOW.md
- docs/ROADMAP.md
- docs/TESTING.md

Addresses issue #121
This commit is contained in:
Lauren ten Hoor
2026-02-11 01:55:26 +08:00
committed by GitHub
parent 2450181482
commit 862813e6d3
14 changed files with 58 additions and 96 deletions

View File

@@ -53,8 +53,7 @@ export type DispatchResult = {
/**
* Build the task message sent to a worker session.
* Reads role-specific instructions from workspace/roles/<project>/<role>.md
* with fallback to workspace/roles/default/<role>.md.
* Reads role-specific instructions from workspace/projects/prompts/<project>/<role>.md.
*/
export async function buildTaskMessage(opts: {
workspaceDir: string;
@@ -196,10 +195,8 @@ export async function dispatchTask(
async function loadRoleInstructions(
workspaceDir: string, projectName: string, role: "dev" | "qa",
): Promise<string> {
const projectFile = path.join(workspaceDir, "roles", projectName, `${role}.md`);
const defaultFile = path.join(workspaceDir, "roles", "default", `${role}.md`);
try { return await fs.readFile(projectFile, "utf-8"); } catch { /* fallback */ }
try { return await fs.readFile(defaultFile, "utf-8"); } catch { /* none */ }
const projectFile = path.join(workspaceDir, "projects", "prompts", projectName, `${role}.md`);
try { return await fs.readFile(projectFile, "utf-8"); } catch { /* none */ }
return "";
}