read-style-guide.mjs
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd
feat(calendar): enforce agent context tiers in retrieval AP…
Human
minor
⚠ breaking
20 hours 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
2 commits
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd
feat(calendar): enforce agent context tiers in retrieval AP…
Human
minor
⚠
20 hours ago
sha256:9103f98c89257ed2b01c237cea895dabb3e85ea337dccb1161c175e4422355b6
docs: accept Calendar Events v0 spec with Phase 0 security …
Human
1 day ago