read-style-guide.mjs
42 lines 1.3 KB
Raw
sha256:c2dbf04d56308f3bbf2d06e6d2eb022b8948b1e827195fe525a44e5e18d5f9c0 feat(auth): Phase B Connect cloud agent (RFC 8628) + Hermes… Human minor ⚠ breaking 12 days ago
1 /**
2 * Skill: read-style-guide
3 *
4 * Returns the canonical voice + boundaries note for one of the three projects.
5 * Every conveyor-belt agent calls this FIRST, before generating any content,
6 * so the output stays grounded in the project's documented voice.
7 *
8 * Vault path convention:
9 * vault/projects/<project>/style-guide/voice-and-boundaries.md
10 *
11 * @param {ReturnType<import('./hub-client.mjs').createHubClient>} hub
12 * @param {{ project: 'born-free' | 'store-free' | 'knowtation' }} args
13 * @returns {Promise<{ path: string, frontmatter: object, body: string }>}
14 */
15 import { assertProject } from './hub-client.mjs';
16
17 export async function readStyleGuide(hub, args) {
18 const project = assertProject(args.project);
19 const path = `projects/${project}/style-guide/voice-and-boundaries.md`;
20
21 let note;
22 try {
23 note = await hub.getNote(path);
24 } catch (e) {
25 if (e.status === 404) {
26 throw Object.assign(
27 new Error(
28 `style_guide_missing: vault/${path} does not exist on the Hub. ` +
29 `Create it with the project's voice rules before running agents for ${project}.`
30 ),
31 { code: 'STYLE_GUIDE_MISSING', project, path, cause: e }
32 );
33 }
34 throw e;
35 }
36
37 return {
38 path: note.path ?? path,
39 frontmatter: note.frontmatter ?? {},
40 body: typeof note.body === 'string' ? note.body : '',
41 };
42 }
File History 1 commit
sha256:93bcf8f9bd56d8c5b9339f4ec73b9ebd66571398d56262d38eedc2cfa9db9882 fix(test): align Band B landing assertion with desktop MCP … Human 12 days ago