doctor

package
v0.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const MaxSkillCatalogMetadataTokens = 4000

MaxSkillCatalogMetadataTokens is the recommended token budget for combined skill names and descriptions (the catalog metadata loaded into the agent on every run). Tokens are estimated with warnings.EstimateTokens for parity with the other doctor size metrics (instructions, MCP tool schemas).

Variables

This section is empty.

Functions

func HasFailResultForCheck added in v0.12.0

func HasFailResultForCheck(results []Result, checkName string) bool

HasFailResultForCheck reports whether results contains a StatusFail result for checkName. It is used to detect when CheckConfig's lenient fallback already emitted a blocking result for a check (Secrets/Skills) so the orchestrator can skip the corresponding standalone check and avoid a contradictory cascade. Only StatusFail results suppress the standalone check; an OK or WARN result for the same check name does not, so non-blocking diagnostics never silence a check that could still report meaningful results.

func SkillCatalogMetadata added in v0.11.0

func SkillCatalogMetadata(cfg *config.ProjectConfig) (text string, chars int)

SkillCatalogMetadata returns the concatenated skill names and descriptions and their combined Unicode rune count. The returned text is the canonical input for estimating catalog-metadata tokens; the rune count is retained for callers and tests that need the raw size.

Types

type Result

type Result struct {
	Status         Status
	CheckName      string
	Message        string
	Recommendation string
}

Result holds the outcome of a single diagnostic check.

func CheckAgents

func CheckAgents(cfg *config.ProjectConfig) []Result

CheckAgents reports which agents are enabled or disabled.

func CheckAntigravityBinary added in v0.11.0

func CheckAntigravityBinary() []Result

CheckAntigravityBinary verifies that agy exists and is at least v1.0.0.

func CheckCLISkills added in v0.11.0

func CheckCLISkills(cfg *config.ProjectConfig) []Result

CheckCLISkills verifies that each catalog skill present on disk has its required CLI binary on PATH. Per memory feedback_doctor_nonblocking.md, this check never gates agent execution; failures are surfaced as Result entries only.

Behavior summary:

  • If the catalog file is missing or malformed, emit a single FAIL result.
  • For each catalog entry with a declared binary, check `.agent-layer/skills/<id>/`: present + binary on PATH → no result present + binary missing → FAIL result absent → no result (user opted out)
  • Catalog entries without a declared binary (e.g. agent-dispatch) are skipped.

func CheckConfig

func CheckConfig(root string) ([]Result, *config.ProjectConfig)

CheckConfig validates that the configuration file can be loaded and parsed. When strict loading fails but lenient loading succeeds (e.g., missing required fields from a newer version), CheckConfig returns a FAIL result with the validation error AND the leniently-loaded config so downstream checks still run.

On the lenient-fallback path CheckConfig may also emit blocking results owned by later checks: a DoctorCheckNameSecrets FAIL when .env is malformed (so CheckSecrets is not run on top of an unreadable .env) and a DoctorCheckNameSkills FAIL when skills loading fails (so CheckSkills does not add a contradictory "No skills configured" line). The doctor orchestrator uses HasFailResultForCheck to skip the corresponding standalone check when one of these results is present.

func CheckFlatFormatSkills added in v0.9.0

func CheckFlatFormatSkills(root string) []Result

CheckFlatFormatSkills scans .agent-layer/skills/ for stale flat-format .md files at the root level. Returns a FAIL result for each, recommending `al upgrade`.

func CheckSecrets

func CheckSecrets(cfg *config.ProjectConfig) []Result

CheckSecrets scans the configuration for missing environment variables. Only enabled MCP servers are considered; disabled servers are skipped.

func CheckSkills added in v0.9.0

func CheckSkills(cfg *config.ProjectConfig) []Result

CheckSkills validates configured skills against agentskills-aligned conventions.

func CheckStructure

func CheckStructure(root string) []Result

CheckStructure verifies that required and optional project directories are sane.

type Status

type Status string

Status represents the health status of a check (OK, WARN, FAIL).

const (
	// StatusOK indicates the check passed.
	StatusOK Status = "OK"
	// StatusWarn indicates a potential issue that doesn't block functionality.
	StatusWarn Status = "WARN"
	// StatusFail indicates a critical issue that must be resolved.
	StatusFail Status = "FAIL"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL