Transform Kit into coding-context CLI for managing AI agent rules #103
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replaces the Kit workflow engine with a CLI tool to import/export coding rules across AI agents (Claude, Gemini, Cursor, GitHub Copilot, Windsurf, Goose, Augment, Codex). Rules are normalized to AGENTS.md as a single source of truth.
Core Changes
import,export <agent>,bootstrap,promptcommandsAgent Path Patterns
Usage
Implementation Notes
Original prompt
We going to add the ability to "import" and "export" rules between different coding agents.
We're starting with importing.
This will be a substantial re-write of the codebase.
Later on will be adding content based deduplication, so it is fine to append the same content to a file many times.
Persona
Remove support for personas. We're going to add this back later on.
Default Command
Remove the default command. We're going to change this into many commands
Rule Description
To do this, we need to be able to describe each agent and the rules files they use:
Project Rules (level 0 - most important)
A specific path in PWD containing rules. AGENTS.md, ./.gem ini/styleguide.md
A sub-directory of PWD that contain rules. .github/agents
Ancestor Rules (level 1 - next most important)
File with a specific name in the PWD folder hierarchy. E.g. AGENTS.md
User Rules (level 2)
A specific path in HOME containing rules. ~/.codex/AGENTS.md
A sub-directory of HOME that contain rules.
System Rules (level 3)
/usr/local/prompts-rules
Common Agents
ToolAlgorithm (Algo)Parameters for the AlgoClaude CodeHierarchical ConcatenationRules are merged top-down. The process involves searching for .md files in three main locations:Global: ~/.claude/CLAUDE.md (Universal base persona/instructions) [1]Ancestor: ./CLAUDE.md (Project-wide guidance, checked into Git) [2]Project/Local Override: ./CLAUDE.local.md (Highest precedence, personal instructions, typically .gitignore'd) [2]Gemini CLIHierarchical Concatenation (Strategic Layer)The CLI searches for the GEMINI.md file in ancestor directories to define the agent's persona ("Strategic Layer") and project context.Global: ~/.gemini/GEMINI.md (Universal persona definition) [[3]],Ancestor: Project/Ancestor ./GEMINI.md (Project-specific persona and mission) [3, 4]Simple System Prompt (Specialized)Injects context for specific workflows like code review.Project: ./.gemini/styleguide.md (Custom style guidelines for code review) [5, 6]Codex CLIHierarchical ConcatenationRules in AGENTS.md are loaded and merged top-down based on proximity to the CWD.User: ~/.codex/AGENTS.md (Global personal guidance) [7]Ancestor/Project: AGENTS.md at repository root and in the current working directory (CWD) (Merged for shared project notes and subfolder specifics) [7]CursorDeclarative Context Injection (Structured)Uses files with metadata to control application type, optimizing context limits.Project: Files within nested directories ./.cursor/rules/. Rules are written in .mdc format and controlled by metadata (e.g., alwaysApply, globs, Agent Requested) [8, 9]Simple System Prompt (Compatibility)Loads a flat file for general instructions as an alternative to structured rules.Project: Project Root AGENTS.md (Plain Markdown, simple alternative) [8]Augment CLIDeclarative Context Injection (Structured & Compatibility)Rules are evaluated top-to-bottom, with the first matching rule determining permission.Project: <workspace_root>/.augment/rules/ (Files support YAML frontmatter: always_apply, agent_requested) [10]Ancestor (Compatibility): Searches for standard files like CLAUDE.md and AGENTS.md in the PWD hierarchy. [10]Project (Legacy): <workspace_root>/.augment/guidelines.md (Legacy rule format) [10]GitHub CopilotSimple System Prompt (Repository)Loads specific file content and injects it as a system prompt, applied automatically to all chat requests in the workspace.Ancestor: ./.github/copilot-instructions.md (Requires setting github.copilot.chat.codeGeneration.useInstructionFiles to be enabled) [11, 12]Hierarchical Concatenation (Compatibility)Supports industry-standard instruction files.Ancestor/Project: Repository-wide ./AGENTS.md (Nearest file in the directory tree takes precedence) [13]Agent Definition/ConfigurationUses a dedicated folder structure to define entire custom agent personas.Project: .github/agents (Configuration files defining custom agent personas, tool selection, and workflows)Windsurf (Codeium)Declarative Context Injection (Structured)Rules are automatically discovered across the workspace hierarchy.Project/Ancestor: Nested directories ./.windsurf/rules/ (Rules are stored in .md files; searched from the current workspace up to the Git root) [14]GooseCompatibility (External Standard)Goose relies primarily on its dynamic Memory Extension. For static instructions, it uses industry standards.Project/Ancestor: Relies on standard mechanisms (e.g., AGENTS.md) found in related projects/extensions for static guidance., [[15]]
Agent Names
Use Golang symbols, e.g. Gemini, Cursor etc
Configuration
Let's have a single global variable that is a map from agent to a list of possible rules file paths.
This will need to be populated on start-up based on the cwd, for hierarchical rules, the number of entries will depend on the ...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.