Plugin System
Relevant source files
The following files were used as context for generating this wiki page:
- skills/create-steering-documents/SKILL.md
- commands/create-steering-documents-standalone.md
- spec-process-guide/prompting/best-practices.md
- spec-process-guide/resources/standards.md
- spec-process-guide/templates/design-template.md
- skills/design-documentation/SKILL.md
- skills/spec-driven-development/SKILL.md
The "Plugin System" in this project is implemented as Steering Documents. These are contextual guidelines that act as plugins to influence and direct how AI assistants approach development tasks. They contain project-specific standards, conventions, and best practices to ensure the AI provides more relevant and consistent assistance. These documents are stored in the .kiro/steering/ directory of a project.
The system is designed to be flexible, allowing different documents to be included in the AI's context based on explicit triggers or the files currently being discussed. This ensures that the guidance provided to the AI is always relevant to the task at hand.
Sources: skills/create-steering-documents/SKILL.md:14-16, commands/create-steering-documents-standalone.md:15-17, 208-210
Architecture and Structure
Steering documents are Markdown files located in the .kiro/steering/ directory. Each document consists of two main parts: YAML front-matter for configuration and Markdown content for the guidelines themselves.
Sources: skills/create-steering-documents/SKILL.md:210-216, commands/create-steering-documents-standalone.md:301-307
The diagram below illustrates the basic structure of a single steering document file.
Document Configuration (Front-matter)
The behavior of each steering document is controlled by its YAML front-matter, specifically the inclusion and fileMatchPattern properties.
---
inclusion: always|fileMatch|manual
fileMatchPattern: 'glob-pattern' # for fileMatch only
---
Sources: skills/create-steering-documents/SKILL.md:218-222, commands/create-steering-documents-standalone.md:309-312
| Option | Type | Description |
|---|---|---|
inclusion | string | Determines when the document is included. Must be one of always, fileMatch, or manual. |
fileMatchPattern | string | A glob pattern used only when inclusion is set to fileMatch. The document is included if a file in the context matches this pattern. |
Sources: skills/create-steering-documents/SKILL.md:18-22, 219-221, commands/create-steering-documents-standalone.md:212-216, 310-311
Inclusion Logic
The system uses a prioritized logic to determine which steering documents to inject into the AI's context for any given interaction. There are three primary mechanisms for inclusion.
| Inclusion Type | Description |
|---|---|
always | The document is included in every interaction. This is the default if no front-matter is present. |
fileMatch | The document is included only when specific files that match the fileMatchPattern are part of the interaction's context. |
manual | The document is only included when explicitly referenced by the user (e.g., using #steering-name). |
Sources: skills/create-steering-documents/SKILL.md:18-22, commands/create-steering-documents-standalone.md:212-216
The following diagram shows the decision flow for including a steering document in the AI's context.
Standard Document Types
The system is designed around a set of standard document types that cover different aspects of the development lifecycle. These serve as templates that can be customized for specific projects.
| Document Name | Purpose | Typical Inclusion |
|---|---|---|
project-standards.md | General code quality, testing, documentation, and security rules. | always |
git-workflow.md | Branching strategy, commit message format, and PR guidelines. | always |
frontend-standards.md | Component architecture, state management, and styling for frontend code. | fileMatch (*.tsx, *.jsx, etc.) |
api-design.md | Guidelines for RESTful APIs, request/response formats, and authentication. | manual |
development-environment.md | Instructions for local setup, environment variables, and database management. | fileMatch (package.json, Dockerfile, etc.) |
Sources: skills/create-steering-documents/SKILL.md:28-208, commands/create-steering-documents-standalone.md:39-199
Creation Process
New steering documents are generated through a systematic process that analyzes project needs and customizes standard templates.
This process is outlined in the diagram below.
Step-by-Step Creation
- Project Analysis: The type of project (e.g., React, Python Django API) is analyzed to determine which steering documents are necessary.
- Document Selection: Based on the analysis, a set of standard documents is selected. For example, a frontend project would get
frontend-standards.md, while a backend project would getapi-design.md. - Content Customization: The content of each document is adapted to the specific languages, frameworks, and scale of the project. For instance, JavaScript standards will mention ESLint, while Python standards will mention Black and flake8.
- File Generation: The final customized Markdown files are created and placed in the
.kiro/steering/directory, ready to be used by the AI assistant.
Sources: skills/create-steering-documents/SKILL.md:25-238, commands/create-steering-documents-standalone.md:20-100
Conclusion
The Steering Documents system serves as a highly configurable plugin architecture for tailoring AI-assisted development. By defining project-specific standards and making them contextually available, this system ensures that AI contributions are consistent, high-quality, and aligned with the unique requirements of each software project. The combination of rule-based inclusion logic and standardized templates provides a powerful yet manageable way to steer AI behavior effectively.
Sources: skills/create-steering-documents/SKILL.md:14-16, spec-process-guide/prompting/best-practices.md:10-13