Documentation
¶
Overview ¶
Package agentguide owns Grafo's canonical agent guidance: the embedded structural tool-routing and repository-setup playbooks, their independent format versions, and the exact markers that make installed copies provably Grafo-owned.
The package renders the same canonical text into the two surfaces installers need — an isolated Grafo-owned skill file and a delimited managed block inside a user-authored instruction file — and never parses or rewrites anything outside its own markers.
Index ¶
Constants ¶
const ( BeginMarker = "<!-- BEGIN grafo-guidance -->" EndMarker = "<!-- END grafo-guidance -->" )
BeginMarker and EndMarker delimit the managed block. They are matched exactly; ownership is never inferred from a substring of the guidance body itself.
const Description = "Route structural code questions through Grafo's semantic graph: " +
"confirm the branch is indexed, resolve symbols before searching text, find reusable " +
"code before adding code, and run bidirectional impact before a behaviour-changing edit."
Description is the one-line summary clients show when listing skills.
const Name = "grafo"
Name is the stable identity Grafo installs guidance under.
const SetupDescription = "Set up or improve Grafo for a repository: inspect project boundaries, " +
"transports, serialization, semantic application wrappers, SQL, and test conventions; update only supported " +
"grafo.yaml settings; index the project; and verify graph coverage without inventing configuration."
SetupDescription tells skill-capable clients when to invoke the repository onboarding workflow.
const SetupMarker = "<!-- grafo-setup version "
SetupMarker is recorded in install receipts for the repository-setup skill.
const SetupName = "grafo-setup"
SetupName is the stable identity of the installed repository onboarding skill.
const SetupVersion = "2"
SetupVersion is the repository-setup skill format version. It is independent from Version because either installed skill may evolve without making the other stale.
const Version = "4"
Version is the guidance format version. Bumping it makes every installed copy stale, so `grafo install` replaces older Grafo-owned content exactly.
Variables ¶
This section is empty.
Functions ¶
func Block ¶
func Block() string
Block renders the managed block that may be embedded in a user-authored instruction file.
func Digest ¶
Digest labels the SHA-256 of installed content so a receipt can prove that an artifact is still exactly what Grafo wrote.
func Owns ¶
Owns reports whether a document carries Grafo's ownership marker, for any guidance version. Ownership is never inferred from the guidance prose.
func OwnsSetup ¶
OwnsSetup reports whether a document carries the setup skill's ownership marker, for any setup format version.
func SetupSkill ¶
func SetupSkill() string
SetupSkill renders the isolated Grafo-owned repository-setup skill file.
func Skill ¶
func Skill() string
Skill renders the isolated Grafo-owned skill file: the whole file belongs to Grafo, so it carries frontmatter and nothing of the user's.
The description contains ": ", which is not a legal YAML plain scalar, so it is emitted as a double-quoted scalar. An unquoted value makes the frontmatter unparseable and the skill undiscoverable.
Types ¶
type Change ¶
type Change int
Change reports what an upsert or removal did to a document.
func RemoveBlock ¶
RemoveBlock deletes a Grafo-owned block and restores the surrounding text, leaving unrelated content byte-equivalent. It is idempotent.
func UpsertBlock ¶
UpsertBlock returns the document with exactly one current managed block, leaving every byte outside the markers untouched.
type ConflictError ¶
type ConflictError struct{ Reason string }
ConflictError reports that a document's Grafo markers are partial, duplicated, or out of order. Callers must leave the document byte-identical.
func (*ConflictError) Error ¶
func (e *ConflictError) Error() string