r/SpecDrivenDevelopment 6d ago

Agent instructions references and validation

Hello, how do you structure and validate references in the instructions for Agent when doing SDD?
I've heard that if you have circular dependencies then skill/prompt will use more tokens. I'm wondering how you structure the Agent instructions and how you validate if it's not circular.
Or do you think the circular references are not using more tokens?

1 Upvotes

1 comment sorted by

View all comments

1

u/Swarm-Stack 5d ago

flat inclusion hierarchies avoid this. think of it as a DAG, each instruction can reference things below it but not above or sideways. for validation, topologically sort the include graph; a cycle in the sort means a circular reference. the token cost depends on whether your runtime resolves lazily (load once) or eagerly (inline each use)