thomas-agentkit 0.6.0 → 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 +10 -5
- package/dist/cli.js +194 -245
- package/package.json +1 -1
- package/templates/.cursor/rules/agentkit.md +18 -18
- package/templates/.github/copilot-instructions.md +11 -19
- package/templates/.github/pull_request_template.md +19 -3
- package/templates/AGENTS.md +70 -84
- package/templates/CHANGE-EXPLANATION.md +79 -0
- package/templates/CLAUDE.md +12 -37
- package/templates/CODE-QUALITY.md +32 -3
- package/templates/IMPLEMENTATION-BRIEF-TEMPLATE.md +37 -3
- package/templates/PRD-TEMPLATE.md +31 -0
- package/templates/SECURITY-CHECKLIST.md +87 -0
- package/templates/TESTING.md +88 -0
- package/templates/WORKFLOWS.md +55 -13
|
@@ -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
|
package/templates/WORKFLOWS.md
CHANGED
|
@@ -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
|
-
##
|
|
49
|
+
## Implementation Workflow
|
|
27
50
|
|
|
28
51
|
1. Read the issue, PRD, or implementation brief.
|
|
29
|
-
2. Inspect existing patterns.
|
|
30
|
-
3.
|
|
31
|
-
4.
|
|
32
|
-
5.
|
|
33
|
-
6.
|
|
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
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
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.
|