thomas-agentkit 0.8.0 → 0.9.0-alpha.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.
@@ -0,0 +1,119 @@
1
+ # agentkit repair (skill workflow)
2
+
3
+ Repair AgentKit guidance structure after an explicit user request. This workflow fixes guidance-file safety problems that block `agentkit update`, especially malformed managed blocks, unmanaged-file conversion, broken adapters, stale companion references, and missing managed wrappers.
4
+
5
+ Repair is not a general rewrite workflow. Use `agentkit update` for stale content and `agentkit doctor` for read-only audits.
6
+
7
+ ## Preconditions
8
+
9
+ - Read `references/file-contract.md` before repairing any file.
10
+ - Read `agentkit.config.json` when present.
11
+ - Inspect the affected guidance files before proposing repairs.
12
+ - Briefly tell the user which files need repair and what will change before editing.
13
+
14
+ ## Non-negotiables
15
+
16
+ - Preserve user-written content.
17
+ - Modify only AgentKit guidance files and AI tool adapters.
18
+ - Do not modify application source files, lockfiles, package manifests, or CI config.
19
+ - Do not guess ownership when managed block markers are ambiguous.
20
+ - Do not regenerate whole files unless the user explicitly asks for that exact file.
21
+ - Keep `AGENTS.md` as the source of truth; adapters stay thin pointers.
22
+
23
+ ## Procedure
24
+
25
+ ### 1. Identify Repair Targets
26
+
27
+ Inspect:
28
+
29
+ - `AGENTS.md`
30
+ - `STACK.md`
31
+ - companion guidance files
32
+ - AI tool adapters
33
+ - managed block markers
34
+ - companion references in `AGENTS.md`
35
+
36
+ Classify each target:
37
+
38
+ - Malformed managed block markers
39
+ - Missing managed wrapper around AgentKit-owned content
40
+ - Unmanaged guidance file the user wants converted
41
+ - AI adapter that duplicates full guidance or points to the wrong source
42
+ - `AGENTS.md` references to missing companion files
43
+ - Configured guidance file missing a safe managed block
44
+
45
+ ### 2. Plan The Repair
46
+
47
+ Before editing, report:
48
+
49
+ - Files to repair
50
+ - Repair type for each file
51
+ - Files deferred because ownership is ambiguous
52
+ - Any user confirmation needed
53
+
54
+ If ownership is ambiguous, defer the file and ask the user whether to convert, preserve, or leave it unmanaged.
55
+
56
+ ### 3. Repair Managed Blocks
57
+
58
+ For malformed markers:
59
+
60
+ - Repair obvious one-start/one-end pairing issues only when the intended block boundaries are clear.
61
+ - Preserve all text outside the repaired block.
62
+ - Keep the same stable block id when clear.
63
+ - If there are multiple starts, multiple ends, overlapping blocks, or unclear ownership, defer instead of guessing.
64
+
65
+ For missing wrappers:
66
+
67
+ - Add one top-level AgentKit managed block around clearly AgentKit-owned generated content.
68
+ - Preserve pre-existing user notes outside the managed block when possible.
69
+ - Do not wrap unrelated project documentation.
70
+
71
+ ### 4. Convert Unmanaged Files
72
+
73
+ Only convert an unmanaged file when the user explicitly asks.
74
+
75
+ When converting:
76
+
77
+ - Preserve existing user-written content outside the new managed block when possible.
78
+ - Add one AgentKit managed block for generated AgentKit guidance.
79
+ - Do not delete custom instructions.
80
+ - Do not convert application docs that are not part of AgentKit guidance.
81
+
82
+ ### 5. Repair AI Adapters
83
+
84
+ For `.cursor/rules/agentkit.md`, `CLAUDE.md`, and `.github/copilot-instructions.md`:
85
+
86
+ - Replace thick duplicated guidance with a thin pointer to `AGENTS.md`.
87
+ - Wrap the adapter body in a managed block.
88
+ - Preserve any user-specific adapter notes outside the managed block when present.
89
+
90
+ ### 6. Repair Companion References
91
+
92
+ For `AGENTS.md` companion references:
93
+
94
+ - Remove references to companion files that do not exist and are not being created.
95
+ - Add references to existing configured companions when useful.
96
+ - Reference `STACK.md` only when it exists or will be created.
97
+
98
+ ### 7. Verify
99
+
100
+ Before finishing, check:
101
+
102
+ - Managed block markers are paired and stable.
103
+ - User-written content outside managed blocks was preserved.
104
+ - AI adapters point to `AGENTS.md` and do not duplicate full guidance.
105
+ - `AGENTS.md` references only companion files that exist.
106
+ - No application source files, lockfiles, package manifests, or CI files were modified.
107
+
108
+ Docs-only repair does not require running the project's test/build commands.
109
+
110
+ ### 8. Report
111
+
112
+ Tell the user:
113
+
114
+ - Files repaired
115
+ - Files deferred and why
116
+ - Repairs performed
117
+ - Any follow-up recommendation, such as `/agentkit update` after structural repair
118
+
119
+ Keep the report concise.
@@ -0,0 +1,201 @@
1
+ # agentkit update (skill workflow)
2
+
3
+ Sync existing AgentKit guidance files with the current repository context. This workflow runs **inside the agent** for skill-path projects; it is not the CLI `agentkit update` managed-block template merger.
4
+
5
+ The skill path is context-aware. Re-read the repository, compare guidance against current codebase reality, and update only AgentKit-managed content.
6
+
7
+ ## Preconditions
8
+
9
+ - Read `references/file-contract.md` before editing any AgentKit-managed file.
10
+ - Read `agentkit.config.json` when present.
11
+ - If `installMode: skill`, continue with this workflow.
12
+ - If `installMode: template` or config is missing, continue only when the user explicitly asked for the skill workflow; otherwise direct them to CLI `agentkit update`.
13
+
14
+ ## Non-negotiables
15
+
16
+ - Preserve user content outside AgentKit managed blocks.
17
+ - Never invent commands. Commands must come from `package.json` scripts or explicit user/config personalization.
18
+ - Do not overwrite unmanaged existing files.
19
+ - Stop on malformed managed block markers and recommend `agentkit repair` before updating that file.
20
+ - Do not modify application source files, lockfiles, package manifests, or CI config during update.
21
+ - Keep `AGENTS.md` as the source-of-truth router; adapters stay thin pointers.
22
+
23
+ ## Procedure
24
+
25
+ ### 1. Build Fresh Repo Profile
26
+
27
+ Inspect the repository again before deciding what to update.
28
+
29
+ Collect:
30
+
31
+ - Project name and description from `package.json`, README, or directory name
32
+ - Package manager from lockfiles
33
+ - Current scripts from `package.json`
34
+ - Framework/runtime signals, such as Next.js, SvelteKit, Express, Convex, Vite, React, Node, TypeScript
35
+ - Current source layout, such as `src/`, `app/`, `pages/`, `convex/`, `test/`, `docs/`
36
+ - Current test, lint, build, typecheck, and dev tooling
37
+ - UI/design system signals, such as Tailwind, CSS files, component folders, design docs
38
+ - Backend/data/auth signals, such as API routes, database/schema files, auth packages
39
+ - Existing docs, briefs, PR templates, workflow docs, or agent guidance files
40
+ - Issue tracker/workflow hints from `.github/`, Linear docs, or config personalization
41
+
42
+ Prefer repository facts over config personalization. Use config personalization only as fallback.
43
+
44
+ ### 2. Read Current AgentKit State
45
+
46
+ Inspect:
47
+
48
+ - `agentkit.config.json`
49
+ - `AGENTS.md`
50
+ - `STACK.md`
51
+ - companion guidance files
52
+ - AI tool adapters
53
+ - managed block markers in every AgentKit guidance file
54
+
55
+ Record:
56
+
57
+ - Files present
58
+ - Files missing for the configured `templateSet`, `preset`, and `aiTools`
59
+ - Files with managed blocks
60
+ - Files without managed blocks
61
+ - Files with malformed managed blocks
62
+
63
+ ### 3. Decide Sync Scope
64
+
65
+ Use `references/file-contract.md` as the source of truth for inventory.
66
+
67
+ Update should handle:
68
+
69
+ - Stale commands
70
+ - Stale project name or description
71
+ - Stale stack/framework guidance
72
+ - Changed source layout
73
+ - Changed test/build/lint tooling
74
+ - Changed design system or docs paths
75
+ - Missing companion files implied by `templateSet`
76
+ - Missing `STACK.md` when `preset` is set or stack is confidently inferred
77
+ - Missing AI adapters implied by `aiTools`
78
+ - Adapters that duplicate operating rules instead of pointing to `AGENTS.md`
79
+ - Remaining bracket placeholders
80
+
81
+ Before writing, briefly tell the user which files will be updated, created, skipped, or deferred.
82
+
83
+ ### 4. Update Managed Files
84
+
85
+ For each existing AgentKit guidance file:
86
+
87
+ - If the file has a valid AgentKit managed block, replace only the managed block content.
88
+ - Preserve all text before and after the managed block exactly.
89
+ - If the file exists but has no managed block, skip it unless the user explicitly asks to convert it.
90
+ - If the file has malformed managed blocks, defer it and recommend `agentkit repair`.
91
+ - Use current repo facts from the fresh repo profile.
92
+ - Avoid generic filler.
93
+ - Keep guidance concise and operational.
94
+
95
+ File roles:
96
+
97
+ - `AGENTS.md`
98
+ - Refresh project purpose, project map, real commands, workflow expectations, companion-doc routing, safety rules, and before-finishing checklist
99
+ - Reference only companion files that exist or will be created in this update
100
+ - Reference `STACK.md` only when it exists or will be created
101
+
102
+ - `STACK.md`
103
+ - Refresh stack-specific guidance based on current repo facts and configured/inferred preset
104
+ - Include current framework boundaries, source layout, validation points, and relevant checks
105
+ - Remove or avoid generic framework advice that does not apply to the repo
106
+
107
+ - `CHANGE-EXPLANATION.md`
108
+ - Refresh handoff and change-summary expectations when project workflow signals changed
109
+
110
+ - `CODE-QUALITY.md`
111
+ - Refresh review, refactor, and maintainability guidance
112
+ - Reference real project commands from `AGENTS.md`
113
+ - Avoid duplicating large command tables
114
+
115
+ - `DESIGN-SYSTEM.md`
116
+ - Refresh UI guidance only when a UI/design surface exists or the file is configured
117
+ - Use configured `designSystem` as a style lens
118
+ - Mention current component/style paths when visible
119
+
120
+ - `.github/pull_request_template.md`
121
+ - Keep concise and generally useful
122
+ - Do not over-personalize per-work-item templates
123
+
124
+ - `TESTING.md`
125
+ - Refresh detected test tools, test locations, and real test commands
126
+
127
+ - `SECURITY-CHECKLIST.md`
128
+ - Refresh project-relevant security boundaries such as auth, secrets, API inputs, and data access
129
+ - Avoid irrelevant compliance boilerplate
130
+
131
+ - `WORKFLOWS.md`
132
+ - Refresh repo-specific development workflows, planning docs, release steps, or review flow when visible
133
+
134
+ - `PRD-TEMPLATE.md` and `IMPLEMENTATION-BRIEF-TEMPLATE.md`
135
+ - Keep as reusable work-item templates
136
+ - Avoid filling them with current project facts beyond light path references
137
+
138
+ - AI adapters
139
+ - Keep thin
140
+ - Point to `AGENTS.md`
141
+ - Do not duplicate operating rules
142
+
143
+ ### 5. Create Missing Configured Files
144
+
145
+ Create missing files implied by `templateSet`, `preset`, or `aiTools`.
146
+
147
+ For each created file:
148
+
149
+ - Create parent directories if needed.
150
+ - Wrap AgentKit-owned content in managed block markers from `references/file-contract.md`.
151
+ - Use current repo facts from the fresh repo profile.
152
+ - Report the file as created.
153
+
154
+ Do not create unrelated guidance files outside the configured inventory unless the user asks.
155
+
156
+ ### 6. Handle Unmanaged Or Malformed Files
157
+
158
+ Default behavior:
159
+
160
+ - Skip unmanaged existing files.
161
+ - Defer malformed files.
162
+ - Report why each file was skipped or deferred.
163
+
164
+ If the user explicitly asks to convert an unmanaged file:
165
+
166
+ - Preserve the original content outside the new managed block when possible.
167
+ - Add one AgentKit managed block for generated content.
168
+ - Do not delete user-written guidance.
169
+
170
+ If the user explicitly asks to repair malformed blocks, use the repair workflow when available. If no repair workflow is available, ask before making structural marker changes.
171
+
172
+ ### 7. Verify
173
+
174
+ Before finishing, check:
175
+
176
+ - Managed block markers are paired and use stable ids.
177
+ - No `[Project Name]`-style placeholders remain in AgentKit-managed content.
178
+ - Commands in guidance match `package.json` scripts or explicit config/user personalization.
179
+ - `AGENTS.md` references only companion files that exist.
180
+ - `AGENTS.md` references `STACK.md` only when `STACK.md` exists.
181
+ - AI adapters point to `AGENTS.md` and do not duplicate full guidance.
182
+ - Missing configured files were created or explicitly deferred with a reason.
183
+ - No application source files, lockfiles, package manifests, or CI files were modified.
184
+
185
+ Docs-only update does not require running the project's test/build commands.
186
+
187
+ ### 8. Report
188
+
189
+ Tell the user:
190
+
191
+ - Files updated
192
+ - Files created
193
+ - Files skipped because they were unmanaged
194
+ - Files deferred because managed blocks were malformed
195
+ - Stale facts fixed
196
+ - Stack and package manager inferred
197
+ - Commands inferred
198
+ - Config values used
199
+ - Assumptions made
200
+
201
+ Keep the report concise.