thomas-agentkit 0.6.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  AgentKit CLI bootstraps AI-agent-ready repositories.
4
4
 
5
- It installs reusable instructions, planning templates, review docs, design system rules, and workflow guidance for developers using Codex, Cursor, GitHub Copilot, Claude Code, and similar coding agents.
5
+ It installs reusable agent instructions, workflow guides, quality checklists, design system rules, planning templates, and tool adapters for developers using Codex, Cursor, GitHub Copilot, Claude Code, and similar coding agents.
6
6
 
7
7
  AgentKit is not an AI agent. It is a small scaffolding tool for making repositories easier and safer to work on with AI-assisted development.
8
8
 
@@ -35,7 +35,7 @@ Accept defaults without prompts:
35
35
  npx thomas-agentkit init --yes
36
36
  ```
37
37
 
38
- `--yes` keeps installed templates generic and leaves placeholders for later editing.
38
+ `--yes` installs the `standard` template set, keeps templates generic, and leaves placeholders for later editing.
39
39
 
40
40
  Preview changes without writing files:
41
41
 
@@ -127,14 +127,17 @@ npx thomas-agentkit --list-design-systems
127
127
 
128
128
  ## Installed Files
129
129
 
130
- AgentKit copies these bundled files into the target project:
130
+ AgentKit can copy these bundled files into the target project:
131
131
 
132
132
  - `AGENTS.md`
133
+ - `CHANGE-EXPLANATION.md`
133
134
  - `CLAUDE.md`
134
135
  - `CODE-QUALITY.md`
135
136
  - `DESIGN-SYSTEM.md`
136
137
  - `IMPLEMENTATION-BRIEF-TEMPLATE.md`
137
138
  - `PRD-TEMPLATE.md`
139
+ - `SECURITY-CHECKLIST.md`
140
+ - `TESTING.md`
138
141
  - `WORKFLOWS.md`
139
142
  - `.cursor/rules/agentkit.md`
140
143
  - `.github/copilot-instructions.md`
@@ -163,8 +166,8 @@ Interactive personalization only applies during `agentkit init` when files are c
163
166
  Template set mappings:
164
167
 
165
168
  - `minimal`: `AGENTS.md`
166
- - `standard`: `AGENTS.md`, `CODE-QUALITY.md`, `DESIGN-SYSTEM.md`, `WORKFLOWS.md`
167
- - `full`: all bundled templates
169
+ - `standard`: `AGENTS.md`, `CHANGE-EXPLANATION.md`, `CODE-QUALITY.md`, `DESIGN-SYSTEM.md`, `.github/pull_request_template.md`
170
+ - `full`: all bundled templates, including AI tool adapters and planning/testing/security guides
168
171
 
169
172
  AI tool mappings:
170
173
 
@@ -173,6 +176,8 @@ AI tool mappings:
173
176
  - `claude`: `CLAUDE.md`
174
177
  - `copilot`: `.github/copilot-instructions.md`
175
178
 
179
+ AI tool adapters are thin compatibility files that point back to `AGENTS.md` as the source of truth. They are installed when selected through AI tools or when using the `full` template set.
180
+
176
181
  ## Presets
177
182
 
178
183
  Presets add stack-specific guidance without scaffolding framework app files.
@@ -263,3 +268,5 @@ AgentKit should stay:
263
268
  - safe by default
264
269
  - useful immediately
265
270
  - not overengineered
271
+
272
+ Installed guidance is **AGENTS-first**: `AGENTS.md` is enough for daily coding, including required change explanations after file edits. Companion files are loaded on explicit triggers (UI, review, security, stack, planning when requested), not on every task. The `full` template set adds optional guides such as `WORKFLOWS.md`, `TESTING.md`, and planning templates.
package/dist/cli.js CHANGED
@@ -47,7 +47,13 @@ const aiToolFiles = {
47
47
  };
48
48
  const templateSetFiles = {
49
49
  minimal: ["AGENTS.md"],
50
- standard: ["AGENTS.md", "CODE-QUALITY.md", "DESIGN-SYSTEM.md", "WORKFLOWS.md"],
50
+ standard: [
51
+ "AGENTS.md",
52
+ "CHANGE-EXPLANATION.md",
53
+ "CODE-QUALITY.md",
54
+ "DESIGN-SYSTEM.md",
55
+ ".github/pull_request_template.md",
56
+ ],
51
57
  full: [],
52
58
  };
53
59
  const stackGuidance = {
@@ -390,7 +396,7 @@ function cleanPersonalizationValue(value) {
390
396
  }
391
397
  function getResolvedConfig(options) {
392
398
  const config = {
393
- templateSet: options.templateSet ?? "full",
399
+ templateSet: options.templateSet ?? "standard",
394
400
  aiTools: options.aiTools ?? [],
395
401
  designSystem: effectiveDesignSystem(options.designSystem),
396
402
  };
@@ -565,10 +571,7 @@ async function resolveInitTemplateFiles(options) {
565
571
  if (options.files) {
566
572
  return options.files;
567
573
  }
568
- if (options.templateSet || options.aiTools) {
569
- return getSelectedTemplateFiles(options.templateSet ?? "full", options.aiTools ?? [], allTemplateFiles);
570
- }
571
- return allTemplateFiles;
574
+ return getSelectedTemplateFiles(options.templateSet ?? "standard", options.aiTools ?? [], allTemplateFiles);
572
575
  }
573
576
  async function installTemplates(targetArg, options) {
574
577
  const targetDir = path.resolve(process.cwd(), targetArg || ".");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thomas-agentkit",
3
- "version": "0.6.1",
3
+ "version": "0.8.0",
4
4
  "description": "Install AI-agent-ready development templates into a project.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,26 +1,27 @@
1
1
  # Cursor AgentKit Rules
2
2
 
3
- Use these rules with Cursor agents and composer workflows.
3
+ Use this rule as a repository guidance router for Cursor agents and composer workflows.
4
4
 
5
- ## Default Behavior
5
+ ## Primary Guidance
6
6
 
7
- - Read `AGENTS.md` before implementation.
8
- - Read `DESIGN-SYSTEM.md` before UI, styling, layout, navigation, or component work.
9
- - Read `CODE-QUALITY.md` before review or refactor work.
10
- - Create or update an implementation brief for complex work.
7
+ - Follow `AGENTS.md` first.
8
+ - Treat `AGENTS.md` as the source of truth for repository-wide agent behavior.
9
+ - Do not load companion files for routine coding unless a trigger in `AGENTS.md` applies or the user asks.
11
10
 
12
- ## Implementation Rules
11
+ ## When Relevant
13
12
 
14
- - Prefer the smallest complete solution.
15
- - Reuse existing components, utilities, and patterns.
16
- - Keep diffs focused and reviewable.
17
- - Avoid speculative abstractions and dependency bloat.
18
- - Do not change foundational theme, schema, or architecture without explicit approval.
13
+ - **File edits (final message):** change-explanation format in `AGENTS.md` and `CHANGE-EXPLANATION.md`.
14
+ - **UI / styling / layout:** `DESIGN-SYSTEM.md` or the project design-system path from `AGENTS.md`.
15
+ - **Review / refactor / dependencies:** `CODE-QUALITY.md`.
16
+ - **Tests / QA strategy:** `TESTING.md` if present.
17
+ - **Auth / secrets / PII:** `SECURITY-CHECKLIST.md` if present.
18
+ - **Stack-specific code:** `STACK.md` if present.
19
+ - **Planning docs requested:** create from `PRD-TEMPLATE.md` or `IMPLEMENTATION-BRIEF-TEMPLATE.md` under the project's briefs path.
20
+ - **Process map (optional):** `WORKFLOWS.md` if present.
19
21
 
20
- ## Handoff
22
+ ## Cursor Behavior
21
23
 
22
- Always summarize:
23
-
24
- - Files or areas changed.
25
- - Checks run.
26
- - Known risks or follow-up work.
24
+ - Prefer existing repository patterns over generic generated patterns.
25
+ - Keep changes scoped and reviewable.
26
+ - Do not change foundational architecture, schema, dependencies, or theme primitives without explicit approval.
27
+ - After modifying files, end every task with a change explanation per `AGENTS.md` (summary, what changed, verification, risks, review focus). Scale depth to the change; do not skip for small fixes.
@@ -1,25 +1,9 @@
1
1
  # GitHub Copilot Instructions
2
2
 
3
- Follow the repository rules in `AGENTS.md`, `CODE-QUALITY.md`, and `DESIGN-SYSTEM.md`.
3
+ Follow `AGENTS.md` first. It is the primary source of truth for this repository's AI-agent guidance.
4
4
 
5
- ## Coding Style
5
+ Do not load companion files for routine coding. Use `AGENTS.md` triggers: change explanation after file edits; `CODE-QUALITY.md` for review/refactors; design-system path or `DESIGN-SYSTEM.md` for UI; `TESTING.md`, `SECURITY-CHECKLIST.md`, or `STACK.md` when present and relevant; planning templates only when explicitly requested.
6
6
 
7
- - Prefer simple, maintainable, production-friendly code.
8
- - Match existing project patterns.
9
- - Keep changes small and explicit.
10
- - Avoid adding dependencies unless the benefit is clear.
11
- - Do not hardcode design tokens, colors, or font families in UI code.
7
+ For files covered by additional GitHub instructions under `.github/instructions/`, apply those path-specific instructions together with this file.
12
8
 
13
- ## Before Suggesting Code
14
-
15
- - Inspect nearby code and reuse existing utilities or components.
16
- - Preserve public APIs unless the task requires a change.
17
- - Include validation at external boundaries.
18
- - Include tests when behavior changes.
19
-
20
- ## Avoid
21
-
22
- - Speculative abstractions.
23
- - Broad rewrites for narrow requests.
24
- - Unrelated formatting churn.
25
- - Placeholder logic that looks production-ready but is incomplete.
9
+ Prefer existing repository patterns over generic suggestions. Do not introduce new dependencies, architecture, or broad rewrites unless the task explicitly requires them.
@@ -3,17 +3,33 @@
3
3
  - [What changed?]
4
4
  - [Why?]
5
5
 
6
+ ## Linked Context
7
+
8
+ - Issue:
9
+ - PRD / brief:
10
+ - Related discussion:
11
+
6
12
  ## Checks
7
13
 
8
- - [ ] Tests run or intentionally skipped
9
- - [ ] Lint/build checks run or intentionally skipped
14
+ - [ ] Tests run or intentionally skipped with reason
15
+ - [ ] Lint/build checks run or intentionally skipped with reason
10
16
  - [ ] Docs updated if behavior changed
11
17
  - [ ] No unrelated formatting or refactor churn
12
18
 
13
19
  ## Risk
14
20
 
15
- [Known risks, limitations, or rollout notes.]
21
+ [Known risks, limitations, rollout notes, or rollback considerations.]
22
+
23
+ ## Reviewer Focus
24
+
25
+ [Where should reviewers focus their attention?]
16
26
 
17
27
  ## Screenshots / Demo
18
28
 
19
29
  [Add screenshots, recordings, or notes for UI changes.]
30
+
31
+ ## Agent Checklist
32
+
33
+ - [ ] Followed `AGENTS.md` and relevant companion guidance
34
+ - [ ] Explained important decisions and trade-offs
35
+ - [ ] Called out skipped checks or remaining uncertainty
@@ -2,109 +2,138 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- This file gives coding agents the project rules they need to work safely and consistently.
5
+ This is the primary instruction file for AI coding agents working in this repository.
6
6
 
7
- [Project Name] is [short project description]. Agents should optimize for fast iteration, low complexity, and production-ready delivery.
7
+ [Project Name] is [short project description]. Agents should optimize for safe, focused, production-ready changes that follow local patterns.
8
8
 
9
- ## Guidelines
9
+ ## Source Of Truth
10
10
 
11
- - Act like a high-performing senior engineer. Be concise, direct, decisive, and execution-focused.
12
- - Solve problems with simple, maintainable, production-friendly solutions.
13
- - Prefer low-complexity code that is easy to read, debug, and modify.
14
- - Prefer the smallest path that fully satisfies the requirement.
15
- - Do not overengineer. Do not introduce heavy abstractions, extra layers, broad fallbacks, or large dependencies for small features.
16
- - Keep implementations clean, APIs small, behavior explicit, and naming clear.
17
- - Avoid cleverness unless it clearly improves the outcome.
18
- - Write code that another strong engineer can quickly understand, safely extend, and confidently ship.
19
- - Treat user edits as intentional. Do not overwrite or revert work you did not make.
11
+ Follow this file first. It defines the repository-wide operating rules for agents.
20
12
 
21
- ## Do Not
13
+ Use companion guides only when a trigger below applies. Do not load or restate every guide by default.
22
14
 
23
- - Do not add edge-case logic for scenarios outside the current requirements.
24
- - Do not create new components, utilities, or abstractions before checking existing patterns.
25
- - Do not introduce new dependencies without a clear production benefit.
26
- - Do not make broad theme, schema, architecture, or formatting changes without explicit approval.
27
- - Do not run destructive git commands unless explicitly asked.
15
+ For routine bugfixes and small features, do not open `WORKFLOWS.md`, planning templates, or optional guides unless a trigger applies or the user asks.
28
16
 
29
- ## Maintainability
17
+ ## When To Use Other Guides
30
18
 
31
- Long-term maintainability is a core priority. Keep code direct and easy to change.
19
+ | Trigger | Action |
20
+ | --- | --- |
21
+ | Any file edits (final message) | Use the change-explanation format in **After Coding (Required)**; see `CHANGE-EXPLANATION.md` for detail |
22
+ | UI, components, styling, layout | Read `[design system path, e.g. docs/design-system.md]` or `DESIGN-SYSTEM.md` |
23
+ | Review, refactor, dependencies | Read `CODE-QUALITY.md` |
24
+ | Tests, fixtures, QA strategy | Read `TESTING.md` if present |
25
+ | Auth, permissions, secrets, PII | Read `SECURITY-CHECKLIST.md` if present |
26
+ | Stack-specific code | Read `STACK.md` if present |
27
+ | User or issue requests a PRD | Create from `PRD-TEMPLATE.md` under `[briefs path, e.g. docs/briefs]` |
28
+ | User or issue requests an implementation brief | Create from `IMPLEMENTATION-BRIEF-TEMPLATE.md` under `[briefs path, e.g. docs/briefs]` |
29
+ | Release or branching process (optional) | Read `WORKFLOWS.md` if present |
30
+
31
+ ### Optional Guides (Full Template Set)
32
+
33
+ These files are not installed with the standard template set. Do not assume they exist unless present in the repository:
34
+
35
+ - `TESTING.md`
36
+ - `SECURITY-CHECKLIST.md`
37
+ - `PRD-TEMPLATE.md`
38
+ - `IMPLEMENTATION-BRIEF-TEMPLATE.md`
39
+ - `WORKFLOWS.md`
40
+
41
+ ## Planning Artifacts
42
+
43
+ Use this decision tree before creating planning documents:
44
+
45
+ - **Tiny obvious fix** — implement directly; no PRD or brief required.
46
+ - **Product uncertainty** — create a PRD from `PRD-TEMPLATE.md` only when the user, issue, or task explicitly requests planning documentation. Save it under `[briefs path, e.g. docs/briefs]`.
47
+ - **Multi-file engineering with meaningful risk** — create an implementation brief from `IMPLEMENTATION-BRIEF-TEMPLATE.md` only when the user, issue, or task explicitly requests it. Save it under `[briefs path, e.g. docs/briefs]`.
48
+ - **Security-sensitive change** — follow `SECURITY-CHECKLIST.md` if present.
32
49
 
33
- Extract shared logic when duplication is real or immediately likely, but do not create speculative abstractions. Do not be afraid to improve existing code when it helps the task, but avoid unrelated refactors.
50
+ Do not read planning templates on every task. Copy and fill them only when planning documentation is requested.
51
+
52
+ ## Local Guidance
53
+
54
+ This root `AGENTS.md` applies to the whole repository.
55
+
56
+ If a subdirectory contains its own `AGENTS.md` or equivalent local guidance, follow the most specific local guidance for files in that subtree. When instructions conflict, prefer the more specific local guidance unless it violates repository-wide safety, security, or quality rules.
57
+
58
+ ## Operating Rules
59
+
60
+ - Inspect existing code and patterns before changing files.
61
+ - Prefer the smallest complete solution that satisfies the task.
62
+ - Keep diffs focused and reviewable.
63
+ - Preserve user changes. Do not overwrite or revert work you did not make.
64
+ - Avoid speculative abstractions, broad rewrites, and dependency bloat.
65
+ - Validate external input at system boundaries.
66
+ - Keep public APIs and persisted data shapes stable unless the task requires a change.
67
+ - Ask before destructive commands, broad refactors, schema changes, dependency additions, or security-sensitive changes.
68
+ - Run the narrowest useful checks before finishing (use **Project Commands** below).
69
+ - After any coding work that changes files, end with a change explanation per **After Coding (Required)**. Do not skip this for small fixes.
70
+ - Watch for common AI mistakes: invented APIs or commands, placeholder logic that looks production-ready, client-only authorization, and tests that do not exercise changed behavior.
71
+ - When reviewing or flagging issues, use severity: **Blocker** (must fix), **Concern** (should fix soon), **Suggestion** (optional).
72
+ - For review, refactor, or dependency work, read `CODE-QUALITY.md` for the full checklist.
34
73
 
35
74
  ## Before Coding
36
75
 
37
76
  Before making meaningful code changes:
38
77
 
39
- 1. Check whether the task is linked to an issue in [issue tracker, e.g. Linear or GitHub Issues].
40
- 2. For non-trivial work without an issue, ask whether one should be created before implementation.
41
- 3. Create or switch to an appropriate branch:
42
- - Prefer the branch generated by the issue tracker when available.
43
- - Otherwise create a clear branch name, such as `feature/bookmark-dedupe` or `fix/auth-redirect`.
44
- 4. Identify the smallest complete solution that satisfies the task.
45
- 5. If the task touches UI, layout, styling, navigation, or components, read `[design system path, e.g. docs/design-system.md]`.
46
- 6. If the task touches framework-specific or backend-specific code, read the local guidance for that system first.
47
- 7. Inspect existing patterns before adding new ones.
48
- 8. For complex or multi-file work, create a short PRD or implementation brief in `[briefs path, e.g. docs/briefs]` before implementation.
49
-
50
- Tiny fixes do not need a branch-and-brief ceremony unless the project owner asks for it.
51
-
52
- For complex work, the brief should include:
53
-
54
- - Problem
55
- - Scope
56
- - Out of scope
57
- - Acceptance criteria
58
- - Implementation plan
59
- - Files likely to change
60
- - Risks
61
- - Manual QA steps
78
+ 1. Confirm the task, scope, and acceptance criteria.
79
+ 2. Inspect nearby code, tests, and existing patterns.
80
+ 3. Read at most one triggered companion from **When To Use Other Guides** if it applies.
81
+ 4. For non-trivial work: link to or create an issue in [issue tracker, e.g. Linear or GitHub Issues] and use an appropriate branch when the project expects branches.
82
+ 5. Ask for clarification if requirements, risk, or approval boundaries are unclear.
83
+
84
+ Tiny fixes can skip issue-and-branch ceremony when the change is obvious and low risk.
62
85
 
63
86
  ## During Coding
64
87
 
65
88
  While implementing:
66
89
 
67
- - Keep the diff small and reviewable.
68
- - Prefer modifying existing patterns over inventing new ones.
90
+ - Modify existing patterns before creating new ones.
91
+ - Keep behavior explicit and easy to test.
69
92
  - Avoid unrelated formatting churn.
70
- - Keep behavior explicit.
71
- - Add validation where external input enters the system.
72
- - Follow `[design system path]` for UI work.
73
- - Use semantic styling tokens instead of hardcoded colors or fonts.
74
- - Preserve the project's established density, layout, and interaction patterns.
75
- - Add loading, empty, error, disabled, and focus states where relevant.
76
- - Add or update tests when touching pure logic, parsing, data transforms, search, AI output handling, or bug fixes.
77
- - Preserve existing UX and styling unless the task asks for changes.
93
+ - Prefer existing utilities, components, and conventions.
94
+ - Add or update tests when behavior changes.
95
+ - For UI work, follow `[design system path, e.g. docs/design-system.md]` and preserve existing interaction patterns.
96
+ - For stack-specific work, read `STACK.md` when present.
97
+ - Document meaningful decisions in the change explanation when they matter.
98
+
99
+ ## Approval Boundaries
100
+
101
+ Ask before:
102
+
103
+ - Adding a new runtime dependency.
104
+ - Changing schemas, migrations, permissions, auth, billing, or data retention behavior.
105
+ - Running destructive commands or deleting files.
106
+ - Changing global design tokens, theme primitives, or foundational layout rules.
107
+ - Performing broad refactors or large formatting-only rewrites.
108
+ - Editing generated, vendored, or external-source files unless the task explicitly requires it.
109
+
110
+ ## After Coding (Required)
111
+
112
+ If you modified any files in the repository, your **final message** must include a change explanation.
113
+
114
+ This is how developers catch up on agent work. It is required for bugfixes, refactors, and small edits—not only large features or PRs. Scale section depth to the change; do not omit the explanation because the diff is small.
115
+
116
+ Do not write a separate change-explanation file unless the project asks for one. Use this structure in your reply:
117
+
118
+ - **Summary** — outcome in plain language (behavior delivered, not only files touched).
119
+ - **What changed** — main files or areas; what, why, and how each fits existing patterns.
120
+ - **Key decisions** — approach, alternatives, trade-offs (skip when straightforward).
121
+ - **Verification** — checks run and results; note any skipped checks and why.
122
+ - **Risks or limitations** — merge blockers, untested paths, follow-up (use "None identified" for trivial low-risk fixes when appropriate).
123
+ - **Suggested review focus** — where the developer should look first.
124
+
125
+ See `CHANGE-EXPLANATION.md` for examples and style rules.
78
126
 
79
127
  ## Before Finishing
80
128
 
81
129
  Before marking work complete:
82
130
 
83
- 1. Re-read the original task and acceptance criteria.
131
+ 1. Re-read the original request and acceptance criteria.
84
132
  2. Confirm the implementation satisfies the requested scope.
85
- 3. Run the relevant checks:
86
- - `[test command, e.g. npm test]`
87
- - `[lint command, e.g. npm run lint]`
88
- - `[build/check command, e.g. npm run build]` for larger changes
133
+ 3. Run the narrowest relevant checks from **Project Commands**.
89
134
  4. Review the diff for unrelated changes.
90
135
  5. Confirm no unnecessary dependencies, schema changes, theme changes, or broad refactors were introduced.
91
- 6. Provide a clear summary of the changes made.
92
- 7. Mention:
93
- - Files or areas changed
94
- - Checks run
95
- - Known risks or limitations
96
- - Follow-up work, if any
97
-
98
- ## Working Style
99
-
100
- - Be concise, direct, and execution-focused.
101
- - Prefer the smallest production-ready solution that fully meets the requirement.
102
- - Keep code explicit, maintainable, and easy to modify.
103
- - Avoid speculative abstractions, edge-case overengineering, and dependency bloat.
104
- - Improve nearby code when helpful, but avoid unrelated refactors.
105
- - Use existing UI primitives from `[UI component library or path]` before creating custom UI.
106
- - Do not create reusable custom components unless the task actually needs them.
107
- - Do not change global color tokens, theme colors, or foundational layout rules without explicit approval.
136
+ 6. Include the change explanation from **After Coding (Required)** in your final message.
108
137
 
109
138
  ## Project Commands
110
139
 
@@ -129,7 +158,9 @@ Never commit API keys, tokens, private keys, or local `.env` values. Keep secret
129
158
 
130
159
  ## Stack
131
160
 
132
- Document the real stack for this project:
161
+ When `STACK.md` is present (for example after a preset install), read it before changing stack-specific code.
162
+
163
+ Otherwise document the real stack for this project:
133
164
 
134
165
  - [Primary framework]
135
166
  - [Language/runtime]
@@ -137,13 +168,3 @@ Document the real stack for this project:
137
168
  - [Styling system]
138
169
  - [Test tools]
139
170
  - [Lint/format tools]
140
-
141
- ## Optional Framework Rules
142
-
143
- Add project-specific rules here when a framework or backend has important local guidance.
144
-
145
- Examples:
146
-
147
- - Always read generated backend/framework guidance before editing generated or platform-specific code.
148
- - Follow local generated patterns over generic assumptions.
149
- - Keep schemas, validators, and API boundaries strict and explicit.
@@ -0,0 +1,95 @@
1
+ # Change Explanation Guide
2
+
3
+ ## Purpose
4
+
5
+ Use this guide **after every task that modifies repository files**.
6
+
7
+ The goal is to help the developer get up to speed quickly: what changed, why it changed, how it works, what was verified, and what deserves review attention.
8
+
9
+ This is a **response format** for agent messages. Do **not** create a new markdown file per task unless the project explicitly asks for one.
10
+
11
+ Research-only tasks that do not edit files do not require this format.
12
+
13
+ ## When Required
14
+
15
+ | Situation | Change explanation |
16
+ | --- | --- |
17
+ | Any bugfix, feature, refactor, config, or doc edit in the repo | **Required** — follow this guide in your final message |
18
+ | Research, options, or questions with no file edits | Not required |
19
+ | User asks only to explain existing code (no edits) | Not required |
20
+
21
+ Scale depth to the size of the change. A one-line fix still needs a short explanation; a large feature needs full sections.
22
+
23
+ ## Change Explanation Format
24
+
25
+ ### Summary
26
+
27
+ Briefly state the outcome in plain language. Focus on the behavior or capability delivered, not just the files edited.
28
+
29
+ ### What Changed
30
+
31
+ List the main files, modules, or areas changed.
32
+
33
+ For each important area, explain:
34
+
35
+ - what changed
36
+ - why it changed
37
+ - how it fits existing project patterns
38
+
39
+ ### Key Decisions
40
+
41
+ Explain notable implementation decisions.
42
+
43
+ Include when relevant:
44
+
45
+ - why this approach was chosen
46
+ - alternatives considered
47
+ - trade-offs or constraints
48
+ - assumptions made because requirements were unclear
49
+
50
+ Skip this section when the change is straightforward and has no meaningful trade-offs.
51
+
52
+ ### Verification
53
+
54
+ List checks run, such as:
55
+
56
+ - tests
57
+ - lint
58
+ - build/typecheck
59
+ - manual QA
60
+ - screenshots or visual checks for UI work
61
+
62
+ If a relevant check was skipped, say why.
63
+
64
+ ### Risks Or Limitations
65
+
66
+ Call out anything the developer should know before merging or shipping:
67
+
68
+ - untested paths
69
+ - migration concerns
70
+ - UX edge cases
71
+ - security or privacy considerations
72
+ - performance concerns
73
+ - follow-up cleanup
74
+
75
+ Use "None identified" when appropriate for very small, low-risk changes.
76
+
77
+ ### Suggested Review Focus
78
+
79
+ Tell the developer where to focus review attention.
80
+
81
+ Examples:
82
+
83
+ - Review the validation path in `[path]`.
84
+ - Confirm the empty/error states match product intent.
85
+ - Check whether the authorization behavior matches policy.
86
+ - Verify the new abstraction is worth keeping.
87
+
88
+ ## Style Rules
89
+
90
+ - Be concise but specific.
91
+ - Mention file paths clearly.
92
+ - Explain reasoning, not only actions.
93
+ - Do not hide uncertainty or skipped validation.
94
+ - Do not claim tests passed unless they were run and passed.
95
+ - Prefer bullets for scanability.
@@ -1,44 +1,9 @@
1
1
  # CLAUDE.md
2
2
 
3
- ## Purpose
3
+ Claude Code guidance for this repository.
4
4
 
5
- Project guidance for Claude-based coding and agent workflows.
5
+ Follow `AGENTS.md` first. It is the source of truth for operating rules, triggers for companion guides, planning artifacts, and required change explanations.
6
6
 
7
- ## Local Commands
7
+ Do not load companion files for routine coding. Read or create from other guides only when `AGENTS.md` **When To Use Other Guides** applies or the user asks.
8
8
 
9
- Replace these examples with the project’s real commands:
10
-
11
- ```bash
12
- npm install
13
- npm test
14
- npm run build
15
- npm run lint
16
- ```
17
-
18
- ## Coding Standards
19
-
20
- - Keep changes focused on the requested behavior.
21
- - Prefer clear names and direct control flow.
22
- - Avoid new abstractions until duplication or complexity justifies them.
23
- - Preserve existing public interfaces unless the task requires a change.
24
- - Update nearby documentation when behavior or setup changes.
25
-
26
- ## Agent Development
27
-
28
- - Document each agent’s goal, inputs, outputs, tools, and permission boundaries.
29
- - Keep prompts and tool schemas versioned with the code that depends on them.
30
- - Make failure modes explicit: retries, timeouts, partial results, and user-facing errors.
31
- - Use deterministic tests for core orchestration logic.
32
-
33
- ## Review And Verification
34
-
35
- - Run the narrowest relevant test command first.
36
- - For UI changes, verify responsive behavior and obvious accessibility states.
37
- - For agent changes, test success, tool failure, invalid input, and timeout paths.
38
- - Summarize verification results in the final handoff.
39
-
40
- ## Secrets
41
-
42
- - Use environment variables for local credentials.
43
- - Do not paste secrets into prompts, logs, fixtures, or committed files.
44
- - Provide `.env.example` entries for required variables without real values.
9
+ Do not duplicate repository rules here. Update `AGENTS.md` or the relevant companion guide instead.
@@ -4,7 +4,7 @@
4
4
 
5
5
  This guide defines the baseline quality bar for changes in this repository.
6
6
 
7
- Agents and contributors should optimize for code that is simple, readable, testable, and safe to modify.
7
+ Agents and contributors should optimize for code that is simple, readable, testable, secure, and safe to modify.
8
8
 
9
9
  ## Principles
10
10
 
@@ -14,31 +14,36 @@ Agents and contributors should optimize for code that is simple, readable, testa
14
14
  - Avoid speculative abstractions and dependency bloat.
15
15
  - Match existing project patterns before introducing new ones.
16
16
  - Make failure modes explicit at system boundaries.
17
+ - Validate external input and avoid leaking secrets or private data.
18
+ - Preserve behavior unless the task explicitly changes it.
19
+
20
+ ## Review Severity
21
+
22
+ Use clear severity when reviewing or explaining issues:
23
+
24
+ - **Blocker**: likely bug, data loss, security issue, broken build, failing tests, or unmet requirement.
25
+ - **Concern**: maintainability, test gap, confusing behavior, or risk that should be addressed soon.
26
+ - **Suggestion**: optional improvement that does not block shipping.
17
27
 
18
28
  ## Review Checklist
19
29
 
20
30
  - The change solves the stated problem and does not expand scope unexpectedly.
21
31
  - The diff is small enough to review confidently.
22
32
  - No unrelated formatting churn or broad refactors were introduced.
33
+ - Existing patterns were reused where practical.
23
34
  - New behavior has relevant tests or a clear reason tests were not added.
24
35
  - External inputs are validated at boundaries.
25
- - Errors are actionable and do not leak secrets.
36
+ - Authorization checks remain server-side and resource-specific.
37
+ - Errors are actionable and do not leak secrets or sensitive data.
26
38
  - User-facing copy is clear and specific.
27
39
  - UI changes include loading, empty, error, disabled, and focus states where relevant.
40
+ - Documentation was updated when behavior, setup, or commands changed.
28
41
 
29
42
  ## Testing Expectations
30
43
 
31
44
  Run the narrowest useful checks first, then broaden verification for larger changes.
32
45
 
33
- Document project commands here:
34
-
35
- ```bash
36
- npm test
37
- npm run lint
38
- npm run build
39
- ```
40
-
41
- Remove commands that do not apply.
46
+ Use the commands documented in `AGENTS.md` **Project Commands**. For deeper testing strategy, read `TESTING.md` when present.
42
47
 
43
48
  ## Dependency Policy
44
49
 
@@ -49,11 +54,25 @@ Before adding a dependency, confirm:
49
54
  - The package is actively maintained.
50
55
  - The API surface is small enough for the need.
51
56
  - The behavior would be meaningfully harder or riskier to implement locally.
52
- - The dependency does not create avoidable runtime, security, or bundle-size risk.
57
+ - The dependency does not create avoidable runtime, security, licensing, or bundle-size risk.
58
+
59
+ ## AI-Specific Quality Risks
60
+
61
+ Watch for common AI-generated issues:
62
+
63
+ - invented APIs, commands, environment variables, or project conventions
64
+ - placeholder logic that appears production-ready
65
+ - broad abstractions created before duplication exists
66
+ - tests that do not exercise the changed behavior
67
+ - silent error swallowing or vague fallback behavior
68
+ - client-only validation or authorization for sensitive actions
69
+ - excessive comments explaining obvious code instead of clarifying intent
70
+
71
+ ## Change Explanation Standard
53
72
 
54
- ## Handoff Standard
73
+ Every completed change that edits files must end with a developer-facing explanation that follows `CHANGE-EXPLANATION.md` in the agent's final message.
55
74
 
56
- Every completed change should include:
75
+ At minimum, cover:
57
76
 
58
77
  - What changed.
59
78
  - Why it changed.
@@ -1,13 +1,24 @@
1
1
  # Implementation Brief
2
2
 
3
+ Copy this file into `[briefs path, e.g. docs/briefs]` when the user, issue, or task explicitly requests an implementation brief. Agents should not read this template on every task.
4
+
3
5
  ## Title
4
6
 
5
7
  [Feature or fix name]
6
8
 
9
+ ## Context
10
+
11
+ [Relevant issue, PRD, discussion, logs, screenshots, or code paths.]
12
+
7
13
  ## Problem
8
14
 
9
15
  [What problem are we solving?]
10
16
 
17
+ ## Goals
18
+
19
+ - [Goal]
20
+ - [Goal]
21
+
11
22
  ## Scope
12
23
 
13
24
  - [In-scope item]
@@ -18,6 +29,15 @@
18
29
  - [Out-of-scope item]
19
30
  - [Out-of-scope item]
20
31
 
32
+ ## Proposed Approach
33
+
34
+ [Describe the intended implementation approach and why it fits the existing codebase.]
35
+
36
+ ## Alternatives Considered
37
+
38
+ - [Alternative]: [why not chosen]
39
+ - [Alternative]: [why not chosen]
40
+
21
41
  ## Acceptance Criteria
22
42
 
23
43
  - [ ] [Concrete scenario passes]
@@ -35,14 +55,30 @@
35
55
  - `[path]`: [reason]
36
56
  - `[path]`: [reason]
37
57
 
58
+ ## API / Schema / Dependency Changes
59
+
60
+ - API changes: [none or details]
61
+ - Schema or migration changes: [none or details]
62
+ - Dependency changes: [none or details]
63
+
64
+ ## Verification Plan
65
+
66
+ - Automated checks: [commands]
67
+ - Manual QA: [steps]
68
+ - Regression coverage: [areas]
69
+
70
+ ## Rollback Plan
71
+
72
+ [How to revert or mitigate if this causes problems.]
73
+
38
74
  ## Risks
39
75
 
40
76
  - [Risk]: [mitigation]
41
77
 
42
- ## Manual QA
78
+ ## Open Questions
43
79
 
44
- - [Manual verification step]
45
- - [Manual verification step]
80
+ - [Question]
81
+ - [Question]
46
82
 
47
83
  ## Notes
48
84
 
@@ -1,5 +1,7 @@
1
1
  # PRD Template
2
2
 
3
+ Copy this file into `[briefs path, e.g. docs/briefs]` when the user, issue, or task explicitly requests a PRD. Agents should not read this template on every task.
4
+
3
5
  ## Title
4
6
 
5
7
  [Project or feature name]
@@ -24,6 +26,12 @@ Describe the user problem, business problem, or technical gap this work addresse
24
26
  - Secondary users:
25
27
  - Internal operators or reviewers:
26
28
 
29
+ ## User Stories / Key Flows
30
+
31
+ - As a [user], I want [capability], so that [outcome].
32
+ - [Primary workflow]
33
+ - [Secondary workflow]
34
+
27
35
  ## Requirements
28
36
 
29
37
  ### Functional
@@ -45,6 +53,7 @@ Describe the user problem, business problem, or technical gap this work addresse
45
53
  - Empty state:
46
54
  - Error state:
47
55
  - Permission or authentication state:
56
+ - Loading or pending state:
48
57
 
49
58
  ## Technical Notes
50
59
 
@@ -52,18 +61,42 @@ Describe the user problem, business problem, or technical gap this work addresse
52
61
  - APIs or schemas:
53
62
  - Data flow:
54
63
  - Migration or compatibility concerns:
64
+ - Dependencies:
65
+
66
+ ## Success Metrics
67
+
68
+ - [Metric or signal]
69
+ - [Metric or signal]
70
+
71
+ ## Rollout / Migration
72
+
73
+ - Rollout plan:
74
+ - Migration/backfill plan:
75
+ - Rollback or mitigation plan:
55
76
 
56
77
  ## Risks
57
78
 
58
79
  - [Risk and mitigation]
59
80
  - [Risk and mitigation]
60
81
 
82
+ ## Decision Log
83
+
84
+ | Decision | Rationale | Date |
85
+ | --- | --- | --- |
86
+ | [Decision] | [Why] | [Date] |
87
+
61
88
  ## Acceptance Criteria
62
89
 
63
90
  - [ ] [Concrete scenario passes]
64
91
  - [ ] [Concrete scenario passes]
65
92
  - [ ] Tests cover success and failure paths.
66
93
 
94
+ ## Launch Criteria
95
+
96
+ - [ ] Required checks pass.
97
+ - [ ] Documentation and release notes are updated if needed.
98
+ - [ ] Rollout, monitoring, and rollback expectations are clear.
99
+
67
100
  ## Open Questions
68
101
 
69
102
  - [Question]
@@ -0,0 +1,87 @@
1
+ # Security Checklist
2
+
3
+ ## Purpose
4
+
5
+ Use this checklist before and during changes that touch authentication, authorization, secrets, user data, dependencies, network boundaries, logging, or data persistence.
6
+
7
+ Security-sensitive changes should be explicit, reviewed carefully, and verified with relevant tests or manual checks.
8
+
9
+ ## Ask Before Changing
10
+
11
+ Ask for approval before:
12
+
13
+ - changing authentication or authorization behavior
14
+ - adding permissions, roles, scopes, or bypasses
15
+ - changing data retention, deletion, export, or privacy behavior
16
+ - adding a new dependency for security-sensitive code
17
+ - modifying secrets management or environment variable handling
18
+ - weakening validation, rate limits, CSP, CORS, CSRF, or other protections
19
+ - running migrations that could expose, destroy, or transform sensitive data
20
+
21
+ ## Secrets
22
+
23
+ - Never commit secrets, tokens, private keys, certificates, or real `.env` values.
24
+ - Do not paste secrets into prompts, logs, fixtures, test snapshots, or documentation.
25
+ - Keep required variables documented with placeholder values only.
26
+ - Redact secrets from error messages and debug output.
27
+
28
+ ## Authentication And Authorization
29
+
30
+ - Treat authentication and authorization as separate concerns.
31
+ - Verify the caller is allowed to access or mutate the specific resource.
32
+ - Enforce authorization on the server side, not only in UI state.
33
+ - Include unauthorized and forbidden cases in tests when behavior changes.
34
+ - Preserve existing tenant, workspace, organization, or ownership boundaries.
35
+
36
+ ## Input And Output Boundaries
37
+
38
+ - Validate external input at route, action, API, webhook, CLI, and file-upload boundaries.
39
+ - Prefer allowlists and typed schemas where practical.
40
+ - Escape or sanitize output in contexts that can execute or render markup.
41
+ - Avoid leaking internal errors, stack traces, tokens, or PII to users.
42
+
43
+ ## Data Handling And Privacy
44
+
45
+ - Collect and store only data required for the feature.
46
+ - Avoid logging PII, credentials, session tokens, or authorization headers.
47
+ - Be explicit about data migrations and backfills.
48
+ - Preserve auditability for sensitive operations when the project supports it.
49
+
50
+ ## Dependencies
51
+
52
+ Before adding or upgrading a dependency, consider:
53
+
54
+ - maintenance and release history
55
+ - known vulnerabilities
56
+ - transitive dependency risk
57
+ - bundle/runtime impact
58
+ - whether existing platform APIs or project utilities are sufficient
59
+
60
+ ## Network And Integration Boundaries
61
+
62
+ - Use HTTPS for external services.
63
+ - Keep timeouts and failure behavior explicit.
64
+ - Validate webhook signatures when applicable.
65
+ - Avoid sending sensitive data to third-party services unless required and approved.
66
+
67
+ ## Agent-Specific Pitfalls
68
+
69
+ Avoid these common AI-generated security problems:
70
+
71
+ - placeholder auth checks that look real
72
+ - client-only permission enforcement
73
+ - broad `admin` or `owner` bypasses without policy confirmation
74
+ - logging complete request objects
75
+ - swallowing security-relevant errors
76
+ - adding permissive CORS or CSP rules to fix local issues
77
+ - assuming user IDs, workspace IDs, or tenant IDs from untrusted input
78
+
79
+ ## Change Explanation Requirements
80
+
81
+ For security-sensitive work, include in the change explanation after coding:
82
+
83
+ - security-sensitive files or behavior changed
84
+ - tests or checks run
85
+ - authorization and validation paths reviewed
86
+ - known risks or unverified assumptions
87
+ - follow-up recommendations
@@ -0,0 +1,88 @@
1
+ # Testing Guide
2
+
3
+ ## Purpose
4
+
5
+ This guide defines how agents and contributors should choose, write, run, and report tests.
6
+
7
+ Optimize for fast, meaningful feedback. Run the narrowest useful check first, then broaden validation when risk or scope requires it.
8
+
9
+ ## Test Selection Strategy
10
+
11
+ Choose tests based on the change:
12
+
13
+ | Change type | Expected verification |
14
+ | --- | --- |
15
+ | Pure logic, parsing, transforms | Unit tests for success and failure paths |
16
+ | API, server actions, routes, permissions | Boundary tests for valid, invalid, unauthorized, and error cases |
17
+ | UI behavior | Component or integration tests plus manual interaction checks when needed |
18
+ | Data access or schema changes | Integration tests or migration validation |
19
+ | Bug fix | Regression test that fails without the fix when practical |
20
+ | Refactor only | Existing relevant tests plus type/lint/build checks |
21
+
22
+ ## Running Checks
23
+
24
+ Document project-specific commands here:
25
+
26
+ ```bash
27
+ npm test
28
+ npm run lint
29
+ npm run build
30
+ ```
31
+
32
+ Remove commands that do not apply.
33
+
34
+ Prefer file-scoped or package-scoped commands when available. Use full-suite checks for broad, risky, or release-bound changes.
35
+
36
+ ## Writing Tests
37
+
38
+ - Test observable behavior, not implementation details.
39
+ - Cover at least one success path and relevant failure paths.
40
+ - Keep tests deterministic and isolated.
41
+ - Prefer realistic fixtures over excessive mocking.
42
+ - Name tests by behavior or scenario.
43
+ - Avoid snapshots unless they are stable and intentionally reviewed.
44
+ - Do not weaken or delete tests to make a change pass unless the task explicitly updates expected behavior.
45
+
46
+ ## Mocks And Fixtures
47
+
48
+ - Mock network, time, randomness, and external services at clear boundaries.
49
+ - Keep fixtures small and relevant to the scenario.
50
+ - Reuse existing fixture helpers before adding new ones.
51
+ - Avoid global test state that can leak between tests.
52
+
53
+ ## UI And Accessibility Checks
54
+
55
+ For UI changes, verify relevant states:
56
+
57
+ - loading
58
+ - empty
59
+ - error
60
+ - disabled
61
+ - hover/active/focus
62
+ - keyboard navigation
63
+ - responsive layout
64
+ - text overflow
65
+ - light/dark themes when supported
66
+
67
+ Use automated accessibility checks when available, but do not rely on automation alone for focus order, semantics, or interaction quality.
68
+
69
+ ## Agent-Specific Pitfalls
70
+
71
+ Avoid these common AI-generated testing problems:
72
+
73
+ - tests that assert mocked implementation details instead of behavior
74
+ - tests that pass without exercising the changed code
75
+ - broad snapshot updates without review
76
+ - skipped tests without explanation
77
+ - invented test utilities or commands that do not exist
78
+ - replacing meaningful coverage with shallow smoke tests
79
+
80
+ ## Reporting Verification
81
+
82
+ In the change explanation after coding work, include:
83
+
84
+ - checks run
85
+ - whether they passed
86
+ - checks not run and why
87
+ - any manual QA performed
88
+ - remaining test gaps or follow-up recommendations
@@ -2,53 +2,22 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- This document defines lightweight workflows for planning, implementation, review, and release.
5
+ Optional process reference for repositories that installed the **full** AgentKit template set.
6
6
 
7
- Keep this file practical. Delete sections that do not apply to the project.
7
+ `AGENTS.md` is the canonical source of truth for daily agent work. Use this file only when you need a quick map of which companion guide fits a situation.
8
8
 
9
- ## Planning Workflow
9
+ ## Choose The Right Document
10
10
 
11
- Use a PRD for product or user-facing work that needs intent, requirements, and acceptance criteria.
11
+ | Situation | Use |
12
+ | --- | --- |
13
+ | Daily implementation, approval boundaries, change explanations | `AGENTS.md` |
14
+ | Tiny obvious fix | Implement directly; no formal planning doc |
15
+ | User-facing feature or product uncertainty (planning requested) | Create from `PRD-TEMPLATE.md` under `[briefs path, e.g. docs/briefs]` |
16
+ | Multi-file engineering with risk (planning requested) | Create from `IMPLEMENTATION-BRIEF-TEMPLATE.md` under `[briefs path, e.g. docs/briefs]` |
17
+ | UI, styling, layout, navigation, components | `DESIGN-SYSTEM.md` or project design-system path |
18
+ | Security-sensitive change | `SECURITY-CHECKLIST.md` if present |
19
+ | Test strategy or test implementation | `TESTING.md` if present |
20
+ | Review, refactor, dependencies | `CODE-QUALITY.md` |
21
+ | Any task that edits repository files | Change-explanation format in `AGENTS.md` and `CHANGE-EXPLANATION.md` |
12
22
 
13
- Use an implementation brief for engineering work that is already understood but needs a clear execution plan.
14
-
15
- Tiny fixes can skip formal planning when the change is obvious and low risk.
16
-
17
- ## Branch Workflow
18
-
19
- - Prefer an issue-linked branch when available.
20
- - Use short, descriptive branch names:
21
- - `feature/[short-name]`
22
- - `fix/[short-name]`
23
- - `chore/[short-name]`
24
- - Keep each branch focused on one coherent change.
25
-
26
- ## Coding Workflow
27
-
28
- 1. Read the issue, PRD, or implementation brief.
29
- 2. Inspect existing patterns.
30
- 3. Make the smallest complete change.
31
- 4. Add or update tests where behavior changes.
32
- 5. Run relevant checks.
33
- 6. Review the diff before handoff.
34
-
35
- ## Review Workflow
36
-
37
- Review for correctness first, then maintainability, tests, UX, and style.
38
-
39
- Call out:
40
-
41
- - Bugs or regressions.
42
- - Missing validation or error handling.
43
- - Overly broad abstractions.
44
- - Missing tests for changed behavior.
45
- - UI states that are missing or inaccessible.
46
-
47
- ## Release Workflow
48
-
49
- Before release:
50
-
51
- - Confirm tests and build pass.
52
- - Confirm docs match behavior.
53
- - Confirm environment variables and migrations are documented.
54
- - Confirm no secrets or local-only files are included.
23
+ For branching, implementation steps, review expectations, and release checks, follow `AGENTS.md`.