Documentation
¶
Overview ¶
Package adapters installs aitk into AI coding tools (docs/spec/integrations.md): instructions, MCP registration, and session hooks. Project files are committed with the repository; global files change only with --global and are backed up first.
Index ¶
Constants ¶
const GlobalBegin, GlobalEnd = "<!-- aitk:global:begin -->", "<!-- aitk:global:end -->"
GlobalBegin and GlobalEnd delimit aitk's block in a tool's user-level instructions.
const GlobalText = `## aitk (applies in any repository that has aitk.toml at its root)
A repository with ` + "`aitk.toml`" + ` is managed by aitk. In such a repository, without being asked:
1. Start every session with ` + "`aitk brief`" + ` (or the aitk MCP tool ` + "`brief`" + `) and follow what it says.
2. Take work with ` + "`aitk task next --start`" + ` or continue the active task; run ` + "`aitk check`" + ` until it passes;
run ` + "`aitk impact`" + ` before finishing.
3. Finish the task yourself: mark each satisfied criterion with ` + "`aitk task update <id> --ac-done N`" + `, then run
` + "`aitk close --summary \"…\" --knowledge \"…|none\"`" + `. That is how work becomes done; you do not need to ask first.
If close refuses, do what its fix line says.
4. aitk's rules take precedence over older ai-toolkit instructions (ai-start, ai-close, editing docs/ai/*.md by hand).
5. Never edit task status or evidence by hand and never accept user acceptance (UAT) for the user; when stuck,
` + "`aitk close --status blocked`" + ` and stop.
In a repository without aitk.toml, ignore this section.
`
GlobalText tells an agent, in any repository on this machine, how to recognise an aitk project and what to do there. It is deliberately short: the repository's AGENTS.md has the details.
const Pointer = "This repository uses aitk. Follow the \"Working in this repository (aitk)\" section of AGENTS.md:\n" +
"run `aitk brief` first, take a task with `aitk task next --start` (or continue the active one), run `aitk check`\n" +
"until it passes, then `aitk close --summary \"…\" --knowledge \"…|none\"`. If the aitk MCP tools are available, they do the same.\n"
Pointer is the short instruction every tool-specific rule file carries: it sends the agent to AGENTS.md, where the full aitk block lives, so there is one source of truth.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply writes the changes. Global files are backed up to backupDir first. A command that fails (a tool's own CLI) does not stop the rest; its failures are returned together at the end.
func Configured ¶ added in v2.1.0
Configured lists tools whose project files already contain aitk entries.
Types ¶
type Change ¶
type Change struct {
Tool string `json:"tool"`
Path string `json:"path"` // absolute
Rel string `json:"file"` // display path (repo-relative or ~/...)
What string `json:"what"`
Global bool `json:"global"`
Delete bool `json:"delete,omitempty"` // remove the file (aitk-owned files only)
Run []string `json:"run,omitempty"` // a tool's own CLI to run instead of writing a file
// contains filtered or unexported fields
}
Change is one file write an adapter wants.
type SetupResult ¶ added in v2.5.0
type SetupResult struct {
Changes []Change `json:"changes"`
Skipped []string `json:"skipped,omitempty"` // targets that could not be edited safely, with why
}
SetupResult reports a setup run.
func Setup ¶ added in v2.5.0
func Setup(e Env, tools []string, remove bool) (*SetupResult, error)
Setup computes the user-level changes that make every AI tool on this machine recognise aitk projects without being told: a marked block in each tool's own user instructions, the Agent Skill for Claude Code, and the MCP server where the tool has a user-level MCP config. With remove, it computes the changes that take all of that out again. Tools that are not installed are left alone, unless named in tools.