thomas-agentkit 0.6.1 → 0.7.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`, `WORKFLOWS.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.
package/dist/cli.js CHANGED
@@ -47,7 +47,14 @@ 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
+ "WORKFLOWS.md",
56
+ ".github/pull_request_template.md",
57
+ ],
51
58
  full: [],
52
59
  };
53
60
  const stackGuidance = {
@@ -390,7 +397,7 @@ function cleanPersonalizationValue(value) {
390
397
  }
391
398
  function getResolvedConfig(options) {
392
399
  const config = {
393
- templateSet: options.templateSet ?? "full",
400
+ templateSet: options.templateSet ?? "standard",
394
401
  aiTools: options.aiTools ?? [],
395
402
  designSystem: effectiveDesignSystem(options.designSystem),
396
403
  };
@@ -565,10 +572,7 @@ async function resolveInitTemplateFiles(options) {
565
572
  if (options.files) {
566
573
  return options.files;
567
574
  }
568
- if (options.templateSet || options.aiTools) {
569
- return getSelectedTemplateFiles(options.templateSet ?? "full", options.aiTools ?? [], allTemplateFiles);
570
- }
571
- return allTemplateFiles;
575
+ return getSelectedTemplateFiles(options.templateSet ?? "standard", options.aiTools ?? [], allTemplateFiles);
572
576
  }
573
577
  async function installTemplates(targetArg, options) {
574
578
  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.7.0",
4
4
  "description": "Install AI-agent-ready development templates into a project.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,26 +1,26 @@
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
+ - Keep context focused. Read companion files only when relevant to the task.
11
10
 
12
- ## Implementation Rules
11
+ ## Read 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
+ - `CODE-QUALITY.md`: code quality, review, refactors, dependencies.
14
+ - `WORKFLOWS.md`: planning, implementation, review, release.
15
+ - `CHANGE-EXPLANATION.md`: final handoff and developer-facing explanation.
16
+ - `DESIGN-SYSTEM.md`: UI, styling, layout, navigation, components.
17
+ - `TESTING.md`: tests, fixtures, mocks, QA strategy.
18
+ - `SECURITY-CHECKLIST.md`: auth, permissions, secrets, PII, data handling.
19
+ - `STACK.md`: stack-specific rules when present.
19
20
 
20
- ## Handoff
21
+ ## Cursor Behavior
21
22
 
22
- Always summarize:
23
-
24
- - Files or areas changed.
25
- - Checks run.
26
- - Known risks or follow-up work.
23
+ - Prefer existing repository patterns over generic generated patterns.
24
+ - Keep changes scoped and reviewable.
25
+ - Do not change foundational architecture, schema, dependencies, or theme primitives without explicit approval.
26
+ - Summarize changed files, checks run, risks, and review focus before handoff.
@@ -1,25 +1,17 @@
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
+ When relevant, also read:
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
+ - `CODE-QUALITY.md`
8
+ - `WORKFLOWS.md`
9
+ - `CHANGE-EXPLANATION.md`
10
+ - `DESIGN-SYSTEM.md`
11
+ - `TESTING.md`
12
+ - `SECURITY-CHECKLIST.md`
13
+ - `STACK.md`
12
14
 
13
- ## Before Suggesting Code
15
+ For files covered by additional GitHub instructions under `.github/instructions/`, apply those path-specific instructions together with this file.
14
16
 
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.
17
+ 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,105 @@
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 relevant to the task. 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
+ ## Reference Map
28
16
 
29
- ## Maintainability
17
+ Read these files when the task calls for them:
30
18
 
31
- Long-term maintainability is a core priority. Keep code direct and easy to change.
32
-
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.
19
+ | Task type | Read first |
20
+ | --- | --- |
21
+ | Any implementation | `AGENTS.md` |
22
+ | Code quality, refactors, review, dependencies | `CODE-QUALITY.md` |
23
+ | Planning, branching, implementation, review, release | `WORKFLOWS.md` |
24
+ | Final handoff or PR explanation | `CHANGE-EXPLANATION.md` |
25
+ | UI, styling, layout, navigation, components | `[design system path, e.g. docs/design-system.md]` |
26
+ | Tests, fixtures, mocks, QA strategy | `TESTING.md` |
27
+ | Auth, permissions, secrets, PII, data handling | `SECURITY-CHECKLIST.md` |
28
+ | Complex engineering execution | `IMPLEMENTATION-BRIEF-TEMPLATE.md` |
29
+ | Product or user-facing feature definition | `PRD-TEMPLATE.md` |
30
+ | Stack-specific work | `STACK.md` when present |
31
+
32
+ ## Local Guidance
33
+
34
+ This root `AGENTS.md` applies to the whole repository.
35
+
36
+ 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.
37
+
38
+ ## Operating Rules
39
+
40
+ - Inspect existing code and patterns before changing files.
41
+ - Prefer the smallest complete solution that satisfies the task.
42
+ - Keep diffs focused and reviewable.
43
+ - Preserve user changes. Do not overwrite or revert work you did not make.
44
+ - Avoid speculative abstractions, broad rewrites, and dependency bloat.
45
+ - Validate external input at system boundaries.
46
+ - Keep public APIs and persisted data shapes stable unless the task requires a change.
47
+ - Ask before destructive commands, broad refactors, schema changes, dependency additions, or security-sensitive changes.
48
+ - Run the narrowest useful checks before handoff.
49
+ - Explain completed work clearly using `CHANGE-EXPLANATION.md` when present.
34
50
 
35
51
  ## Before Coding
36
52
 
37
53
  Before making meaningful code changes:
38
54
 
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
55
+ 1. Confirm the task, scope, and acceptance criteria.
56
+ 2. Check whether the task is linked to an issue in [issue tracker, e.g. Linear or GitHub Issues].
57
+ 3. For non-trivial work without an issue, ask whether one should be created before implementation.
58
+ 4. Create or switch to an appropriate branch when the workflow expects branches.
59
+ 5. Inspect nearby code, tests, and existing patterns.
60
+ 6. Read relevant companion guidance from the Reference Map.
61
+ 7. Identify the smallest complete approach.
62
+ 8. Ask for clarification if requirements, risk, or approval boundaries are unclear.
63
+
64
+ Tiny fixes can skip branch-and-brief ceremony when the change is obvious and low risk.
62
65
 
63
66
  ## During Coding
64
67
 
65
68
  While implementing:
66
69
 
67
- - Keep the diff small and reviewable.
68
- - Prefer modifying existing patterns over inventing new ones.
70
+ - Modify existing patterns before creating new ones.
71
+ - Keep behavior explicit and easy to test.
69
72
  - 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.
73
+ - Prefer existing utilities, components, and conventions.
74
+ - Add or update tests when behavior changes.
75
+ - For UI work, follow `[design system path, e.g. docs/design-system.md]` and preserve existing interaction patterns.
76
+ - For stack-specific work, read `STACK.md` when present.
77
+ - Document meaningful decisions in the implementation brief, PR, or final handoff.
78
+
79
+ ## Approval Boundaries
80
+
81
+ Ask before:
82
+
83
+ - Adding a new runtime dependency.
84
+ - Changing schemas, migrations, permissions, auth, billing, or data retention behavior.
85
+ - Running destructive commands or deleting files.
86
+ - Changing global design tokens, theme primitives, or foundational layout rules.
87
+ - Performing broad refactors or large formatting-only rewrites.
88
+ - Editing generated, vendored, or external-source files unless the task explicitly requires it.
78
89
 
79
90
  ## Before Finishing
80
91
 
81
92
  Before marking work complete:
82
93
 
83
- 1. Re-read the original task and acceptance criteria.
94
+ 1. Re-read the original request and acceptance criteria.
84
95
  2. Confirm the implementation satisfies the requested scope.
85
- 3. Run the relevant checks:
96
+ 3. Run the narrowest relevant checks:
86
97
  - `[test command, e.g. npm test]`
87
98
  - `[lint command, e.g. npm run lint]`
88
99
  - `[build/check command, e.g. npm run build]` for larger changes
89
100
  4. Review the diff for unrelated changes.
90
101
  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.
102
+ 6. Summarize what changed, why it changed, checks run, risks, and follow-up work.
103
+ 7. If `CHANGE-EXPLANATION.md` exists, follow it for the final handoff.
108
104
 
109
105
  ## Project Commands
110
106
 
@@ -137,13 +133,3 @@ Document the real stack for this project:
137
133
  - [Styling system]
138
134
  - [Test tools]
139
135
  - [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,79 @@
1
+ # Change Explanation Guide
2
+
3
+ ## Purpose
4
+
5
+ Use this guide when explaining completed work to the developer.
6
+
7
+ The goal is to help the developer understand what changed, why it changed, how the implementation works, what was verified, and what deserves review attention.
8
+
9
+ This is a reusable handoff guide. Do not create a new change-explanation file for every task unless the project explicitly asks for one.
10
+
11
+ ## Handoff Format
12
+
13
+ ### Summary
14
+
15
+ Briefly state the outcome in plain language. Focus on the behavior or capability delivered, not just the files edited.
16
+
17
+ ### What Changed
18
+
19
+ List the main files, modules, or areas changed.
20
+
21
+ For each important area, explain:
22
+
23
+ - what changed
24
+ - why it changed
25
+ - how it fits existing project patterns
26
+
27
+ ### Key Decisions
28
+
29
+ Explain notable implementation decisions.
30
+
31
+ Include when relevant:
32
+
33
+ - why this approach was chosen
34
+ - alternatives considered
35
+ - trade-offs or constraints
36
+ - assumptions made because requirements were unclear
37
+
38
+ ### Verification
39
+
40
+ List checks run, such as:
41
+
42
+ - tests
43
+ - lint
44
+ - build/typecheck
45
+ - manual QA
46
+ - screenshots or visual checks for UI work
47
+
48
+ If a relevant check was skipped, say why.
49
+
50
+ ### Risks Or Limitations
51
+
52
+ Call out anything the developer should know before merging or shipping:
53
+
54
+ - untested paths
55
+ - migration concerns
56
+ - UX edge cases
57
+ - security or privacy considerations
58
+ - performance concerns
59
+ - follow-up cleanup
60
+
61
+ ### Suggested Review Focus
62
+
63
+ Tell the developer where to focus review attention.
64
+
65
+ Examples:
66
+
67
+ - Review the validation path in `[path]`.
68
+ - Confirm the empty/error states match product intent.
69
+ - Check whether the authorization behavior matches policy.
70
+ - Verify the new abstraction is worth keeping.
71
+
72
+ ## Style Rules
73
+
74
+ - Be concise but specific.
75
+ - Mention file paths clearly.
76
+ - Explain reasoning, not only actions.
77
+ - Do not hide uncertainty or skipped validation.
78
+ - Do not claim tests passed unless they were run and passed.
79
+ - Prefer bullets for scanability.
@@ -1,44 +1,19 @@
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. Treat it as the primary source of truth for project rules, workflows, quality standards, and handoff expectations.
6
6
 
7
- ## Local Commands
7
+ When relevant, also read:
8
8
 
9
- Replace these examples with the project’s real commands:
9
+ - `CODE-QUALITY.md`
10
+ - `WORKFLOWS.md`
11
+ - `CHANGE-EXPLANATION.md`
12
+ - `DESIGN-SYSTEM.md`
13
+ - `TESTING.md`
14
+ - `SECURITY-CHECKLIST.md`
15
+ - `STACK.md`
10
16
 
11
- ```bash
12
- npm install
13
- npm test
14
- npm run build
15
- npm run lint
16
- ```
17
+ Keep context focused. Do not load companion files unless they are relevant to the task.
17
18
 
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.
19
+ 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,17 +14,30 @@ 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
 
@@ -40,6 +53,8 @@ npm run build
40
53
 
41
54
  Remove commands that do not apply.
42
55
 
56
+ For deeper testing guidance, use `TESTING.md` when present.
57
+
43
58
  ## Dependency Policy
44
59
 
45
60
  Add a dependency only when it clearly reduces real complexity or improves correctness. Prefer existing project utilities and platform APIs for small features.
@@ -49,7 +64,19 @@ Before adding a dependency, confirm:
49
64
  - The package is actively maintained.
50
65
  - The API surface is small enough for the need.
51
66
  - The behavior would be meaningfully harder or riskier to implement locally.
52
- - The dependency does not create avoidable runtime, security, or bundle-size risk.
67
+ - The dependency does not create avoidable runtime, security, licensing, or bundle-size risk.
68
+
69
+ ## AI-Specific Quality Risks
70
+
71
+ Watch for common AI-generated issues:
72
+
73
+ - invented APIs, commands, environment variables, or project conventions
74
+ - placeholder logic that appears production-ready
75
+ - broad abstractions created before duplication exists
76
+ - tests that do not exercise the changed behavior
77
+ - silent error swallowing or vague fallback behavior
78
+ - client-only validation or authorization for sensitive actions
79
+ - excessive comments explaining obvious code instead of clarifying intent
53
80
 
54
81
  ## Handoff Standard
55
82
 
@@ -60,3 +87,5 @@ Every completed change should include:
60
87
  - What checks were run.
61
88
  - Known risks or limitations.
62
89
  - Follow-up work, if any.
90
+
91
+ Use `CHANGE-EXPLANATION.md` when present for the final developer-facing handoff.
@@ -4,10 +4,19 @@
4
4
 
5
5
  [Feature or fix name]
6
6
 
7
+ ## Context
8
+
9
+ [Relevant issue, PRD, discussion, logs, screenshots, or code paths.]
10
+
7
11
  ## Problem
8
12
 
9
13
  [What problem are we solving?]
10
14
 
15
+ ## Goals
16
+
17
+ - [Goal]
18
+ - [Goal]
19
+
11
20
  ## Scope
12
21
 
13
22
  - [In-scope item]
@@ -18,6 +27,15 @@
18
27
  - [Out-of-scope item]
19
28
  - [Out-of-scope item]
20
29
 
30
+ ## Proposed Approach
31
+
32
+ [Describe the intended implementation approach and why it fits the existing codebase.]
33
+
34
+ ## Alternatives Considered
35
+
36
+ - [Alternative]: [why not chosen]
37
+ - [Alternative]: [why not chosen]
38
+
21
39
  ## Acceptance Criteria
22
40
 
23
41
  - [ ] [Concrete scenario passes]
@@ -35,14 +53,30 @@
35
53
  - `[path]`: [reason]
36
54
  - `[path]`: [reason]
37
55
 
56
+ ## API / Schema / Dependency Changes
57
+
58
+ - API changes: [none or details]
59
+ - Schema or migration changes: [none or details]
60
+ - Dependency changes: [none or details]
61
+
62
+ ## Verification Plan
63
+
64
+ - Automated checks: [commands]
65
+ - Manual QA: [steps]
66
+ - Regression coverage: [areas]
67
+
68
+ ## Rollback Plan
69
+
70
+ [How to revert or mitigate if this causes problems.]
71
+
38
72
  ## Risks
39
73
 
40
74
  - [Risk]: [mitigation]
41
75
 
42
- ## Manual QA
76
+ ## Open Questions
43
77
 
44
- - [Manual verification step]
45
- - [Manual verification step]
78
+ - [Question]
79
+ - [Question]
46
80
 
47
81
  ## Notes
48
82
 
@@ -24,6 +24,12 @@ Describe the user problem, business problem, or technical gap this work addresse
24
24
  - Secondary users:
25
25
  - Internal operators or reviewers:
26
26
 
27
+ ## User Stories / Key Flows
28
+
29
+ - As a [user], I want [capability], so that [outcome].
30
+ - [Primary workflow]
31
+ - [Secondary workflow]
32
+
27
33
  ## Requirements
28
34
 
29
35
  ### Functional
@@ -45,6 +51,7 @@ Describe the user problem, business problem, or technical gap this work addresse
45
51
  - Empty state:
46
52
  - Error state:
47
53
  - Permission or authentication state:
54
+ - Loading or pending state:
48
55
 
49
56
  ## Technical Notes
50
57
 
@@ -52,18 +59,42 @@ Describe the user problem, business problem, or technical gap this work addresse
52
59
  - APIs or schemas:
53
60
  - Data flow:
54
61
  - Migration or compatibility concerns:
62
+ - Dependencies:
63
+
64
+ ## Success Metrics
65
+
66
+ - [Metric or signal]
67
+ - [Metric or signal]
68
+
69
+ ## Rollout / Migration
70
+
71
+ - Rollout plan:
72
+ - Migration/backfill plan:
73
+ - Rollback or mitigation plan:
55
74
 
56
75
  ## Risks
57
76
 
58
77
  - [Risk and mitigation]
59
78
  - [Risk and mitigation]
60
79
 
80
+ ## Decision Log
81
+
82
+ | Decision | Rationale | Date |
83
+ | --- | --- | --- |
84
+ | [Decision] | [Why] | [Date] |
85
+
61
86
  ## Acceptance Criteria
62
87
 
63
88
  - [ ] [Concrete scenario passes]
64
89
  - [ ] [Concrete scenario passes]
65
90
  - [ ] Tests cover success and failure paths.
66
91
 
92
+ ## Launch Criteria
93
+
94
+ - [ ] Required checks pass.
95
+ - [ ] Documentation and release notes are updated if needed.
96
+ - [ ] Rollout, monitoring, and rollback expectations are clear.
97
+
67
98
  ## Open Questions
68
99
 
69
100
  - [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
+ ## Handoff Requirements
80
+
81
+ For security-sensitive work, explicitly report:
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 final handoff, 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,10 +2,33 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- This document defines lightweight workflows for planning, implementation, review, and release.
5
+ This document defines lightweight workflows for research, planning, implementation, review, and release.
6
6
 
7
7
  Keep this file practical. Delete sections that do not apply to the project.
8
8
 
9
+ ## Choose The Right Document
10
+
11
+ | Situation | Use |
12
+ | --- | --- |
13
+ | Tiny obvious fix | No formal planning doc required |
14
+ | User-facing feature or product uncertainty | `PRD-TEMPLATE.md` |
15
+ | Known engineering work with multiple files or risks | `IMPLEMENTATION-BRIEF-TEMPLATE.md` |
16
+ | UI, styling, layout, navigation, components | `DESIGN-SYSTEM.md` |
17
+ | Security-sensitive change | `SECURITY-CHECKLIST.md` |
18
+ | Test strategy or test implementation | `TESTING.md` |
19
+ | Final handoff or PR explanation | `CHANGE-EXPLANATION.md` |
20
+
21
+ ## Research-Only Workflow
22
+
23
+ Use this when the task asks for investigation, options, or recommendations without coding.
24
+
25
+ 1. Confirm the research question and scope.
26
+ 2. Inspect relevant code, docs, tests, and history.
27
+ 3. Use external sources only when current ecosystem knowledge is needed.
28
+ 4. Separate facts from recommendations.
29
+ 5. Summarize trade-offs, risks, and a recommended path.
30
+ 6. Do not edit files unless the task changes from research to implementation.
31
+
9
32
  ## Planning Workflow
10
33
 
11
34
  Use a PRD for product or user-facing work that needs intent, requirements, and acceptance criteria.
@@ -23,26 +46,43 @@ Tiny fixes can skip formal planning when the change is obvious and low risk.
23
46
  - `chore/[short-name]`
24
47
  - Keep each branch focused on one coherent change.
25
48
 
26
- ## Coding Workflow
49
+ ## Implementation Workflow
27
50
 
28
51
  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.
52
+ 2. Inspect existing patterns and nearby tests.
53
+ 3. Read relevant companion guidance from `AGENTS.md`.
54
+ 4. Make the smallest complete change.
55
+ 5. Add or update tests where behavior changes.
56
+ 6. Run relevant checks.
57
+ 7. Review the diff before handoff.
58
+ 8. Explain the change using `CHANGE-EXPLANATION.md` when present.
59
+
60
+ ## Pause And Ask Triggers
61
+
62
+ Pause and ask before:
63
+
64
+ - expanding scope beyond the request
65
+ - adding dependencies
66
+ - changing schemas or migrations
67
+ - changing auth, permissions, privacy, billing, or data retention behavior
68
+ - running destructive commands
69
+ - changing design tokens, themes, or foundational layout rules
70
+ - performing broad refactors or formatting-only rewrites
71
+ - removing tests or weakening validation
34
72
 
35
73
  ## Review Workflow
36
74
 
37
- Review for correctness first, then maintainability, tests, UX, and style.
75
+ Review for correctness first, then maintainability, tests, UX, security, and style.
38
76
 
39
77
  Call out:
40
78
 
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.
79
+ - bugs or regressions
80
+ - missing validation or error handling
81
+ - missing authorization checks
82
+ - overly broad abstractions
83
+ - missing tests for changed behavior
84
+ - UI states that are missing or inaccessible
85
+ - unclear handoff, risks, or rollout notes
46
86
 
47
87
  ## Release Workflow
48
88
 
@@ -52,3 +92,5 @@ Before release:
52
92
  - Confirm docs match behavior.
53
93
  - Confirm environment variables and migrations are documented.
54
94
  - Confirm no secrets or local-only files are included.
95
+ - Confirm changelog or release notes are updated when the project expects them.
96
+ - Confirm rollback or mitigation steps for risky changes.