agents-templated 1.2.7 → 1.2.9
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 +40 -9
- package/bin/cli.js +5 -3
- package/package.json +1 -1
- package/templates/.github/copilot-instructions.md +11 -3
- package/templates/AGENTS.MD +579 -2
- package/templates/CLAUDE.md +13 -4
- package/templates/GEMINI.md +15 -6
- package/templates/README.md +13 -4
- package/templates/agent-docs/ARCHITECTURE.md +1 -1
- package/templates/agent-docs/README.md +2 -2
- package/templates/agents/commands/README.md +24 -0
- package/templates/agents/commands/SCHEMA.md +22 -0
- package/templates/agents/commands/audit.md +38 -0
- package/templates/agents/commands/docs.md +34 -0
- package/templates/agents/commands/fix.md +34 -0
- package/templates/agents/commands/perf.md +34 -0
- package/templates/agents/commands/plan.md +34 -0
- package/templates/agents/commands/pr.md +35 -0
- package/templates/agents/commands/refactor.md +34 -0
- package/templates/agents/commands/release.md +39 -0
- package/templates/agents/commands/scaffold.md +34 -0
- package/templates/agents/commands/task.md +35 -0
- package/templates/agents/commands/test.md +34 -0
- package/templates/agents/rules/hardening.mdc +52 -0
- package/templates/agents/rules/intent-routing.mdc +45 -0
- package/templates/agents/rules/security.mdc +9 -1
- package/templates/agents/rules/system-workflow.mdc +63 -0
- package/templates/agents/rules/testing.mdc +14 -1
- package/templates/agents/rules/workflows.mdc +7 -0
- package/templates/agents/skills/README.md +15 -1
- package/templates/agents/skills/app-hardening/SKILL.md +45 -0
- package/templates/agents/skills/bug-triage/SKILL.md +36 -0
- package/templates/agents/skills/feature-delivery/SKILL.md +38 -0
package/templates/AGENTS.MD
CHANGED
|
@@ -4,7 +4,7 @@ This project follows enterprise-grade, technology-agnostic development patterns.
|
|
|
4
4
|
|
|
5
5
|
## Primary Documentation (Always Reference)
|
|
6
6
|
|
|
7
|
-
- **`AGENTS.
|
|
7
|
+
- **`AGENTS.MD`** - This file! AI instructions for working with AI assistants
|
|
8
8
|
- **`agent-docs/ARCHITECTURE.md`** - Overall project guidelines, architecture principles, and technology stack selection
|
|
9
9
|
- **`agents/skills/`** - Custom skills for domain-specific tasks in your project
|
|
10
10
|
|
|
@@ -19,6 +19,9 @@ When implementing features, always check the relevant rule file:
|
|
|
19
19
|
- **`agents/rules/database.mdc`** - Database schema design, migrations, query optimization
|
|
20
20
|
- **`agents/rules/style.mdc`** - Code style guidelines, formatting rules, naming conventions
|
|
21
21
|
- **`agents/rules/workflows.mdc`** - Development workflow (validate, doctor, pre-commit)
|
|
22
|
+
- **`agents/rules/intent-routing.mdc`** - Deterministic intent-to-command routing and ambiguity handling
|
|
23
|
+
- **`agents/rules/system-workflow.mdc`** - End-to-end delivery lifecycle gates and required artifacts
|
|
24
|
+
- **`agents/rules/hardening.mdc`** - Risk-based application hardening and obfuscation guidance
|
|
22
25
|
|
|
23
26
|
## Usage Workflow
|
|
24
27
|
|
|
@@ -30,6 +33,579 @@ When implementing any feature:
|
|
|
30
33
|
4. **Always apply security patterns** from `agents/rules/security.mdc`
|
|
31
34
|
5. **Always apply testing patterns** from `agents/rules/testing.mdc`
|
|
32
35
|
|
|
36
|
+
## Deterministic Slash Command System Standard
|
|
37
|
+
|
|
38
|
+
----------------------------------------
|
|
39
|
+
1. SYSTEM PRINCIPLES
|
|
40
|
+
----------------------------------------
|
|
41
|
+
|
|
42
|
+
### Determinism Rules
|
|
43
|
+
- Slash command mode is entered when input starts with `/` at position 0.
|
|
44
|
+
- Implicit slash-command mode is entered when non-slash input is deterministically mapped to a command contract.
|
|
45
|
+
- Command parsing is exact, case-sensitive, and whitespace-normalized.
|
|
46
|
+
- Unknown or malformed slash commands return a structured error and stop.
|
|
47
|
+
- No conversational fallback is allowed while in slash command mode.
|
|
48
|
+
- Each command executes a fixed algorithm defined in this standard.
|
|
49
|
+
|
|
50
|
+
### Output Standardization
|
|
51
|
+
- Every command response must be structured and audit-ready.
|
|
52
|
+
- Mandatory top-level output fields for all commands:
|
|
53
|
+
- `command`
|
|
54
|
+
- `execution_id`
|
|
55
|
+
- `mode`
|
|
56
|
+
- `status`
|
|
57
|
+
- `inputs`
|
|
58
|
+
- `prechecks`
|
|
59
|
+
- `execution_log`
|
|
60
|
+
- `artifacts`
|
|
61
|
+
- `risks`
|
|
62
|
+
- `safety_checks`
|
|
63
|
+
- `stop_condition`
|
|
64
|
+
- `next_action`
|
|
65
|
+
- If any field is unknown, set value to `null` and continue schema compliance.
|
|
66
|
+
|
|
67
|
+
### Escalation Policy
|
|
68
|
+
- Escalate only for safety, permission, or logical blockers.
|
|
69
|
+
- Escalation output must include:
|
|
70
|
+
- `escalation_required: true`
|
|
71
|
+
- `blocker_type`
|
|
72
|
+
- `required_user_confirmation`
|
|
73
|
+
- `safe_alternative`
|
|
74
|
+
|
|
75
|
+
### Destructive Action Policy
|
|
76
|
+
- Any destructive action requires explicit confirmation token in user input:
|
|
77
|
+
- `CONFIRM-DESTRUCTIVE:<target>`
|
|
78
|
+
- Without token, command must return `status: blocked` and no execution.
|
|
79
|
+
|
|
80
|
+
### Minimal Clarification Policy
|
|
81
|
+
- Do not ask questions unless execution is unsafe or logically blocked.
|
|
82
|
+
- Maximum clarification prompts per command: 2.
|
|
83
|
+
- Clarification prompt must be decision-critical and single-purpose.
|
|
84
|
+
|
|
85
|
+
----------------------------------------
|
|
86
|
+
2. UNIVERSAL COMMAND RULE
|
|
87
|
+
----------------------------------------
|
|
88
|
+
|
|
89
|
+
If input matches regex `^/[a-z]+(\s|$)` then the agent must:
|
|
90
|
+
1. Parse command and arguments.
|
|
91
|
+
2. Set `mode = slash-command`.
|
|
92
|
+
3. Disable conversational style and narrative prose.
|
|
93
|
+
4. Execute only the deterministic flow for that command.
|
|
94
|
+
5. Return output strictly using the defined structured schema.
|
|
95
|
+
6. If parsing fails, return structured error and stop.
|
|
96
|
+
|
|
97
|
+
If input does NOT start with `/`, the agent must run implicit command routing:
|
|
98
|
+
1. Evaluate whether the input intent maps to one command from this standard.
|
|
99
|
+
2. If a single command is selected with sufficient confidence, set `mode = slash-command-auto`.
|
|
100
|
+
3. Transform free text into required command inputs using deterministic field mapping.
|
|
101
|
+
4. Execute the selected command's deterministic flow.
|
|
102
|
+
5. Return output using the same structured schema with selected `command`.
|
|
103
|
+
6. If command selection is ambiguous or unsafe, return `status: blocked` with minimal missing inputs.
|
|
104
|
+
|
|
105
|
+
----------------------------------------
|
|
106
|
+
3. COMMAND DEFINITIONS
|
|
107
|
+
----------------------------------------
|
|
108
|
+
|
|
109
|
+
### /plan
|
|
110
|
+
#### A. Intent
|
|
111
|
+
Generate an executable implementation plan with ordered steps and risk controls.
|
|
112
|
+
|
|
113
|
+
#### B. When to Use
|
|
114
|
+
Use for non-trivial work requiring sequencing, dependencies, and checkpoints.
|
|
115
|
+
|
|
116
|
+
#### C. Required Inputs
|
|
117
|
+
- Objective
|
|
118
|
+
- Scope boundaries
|
|
119
|
+
- Constraints (security, testing, timeline)
|
|
120
|
+
|
|
121
|
+
#### D. Deterministic Execution Flow
|
|
122
|
+
1. Parse objective and constraints.
|
|
123
|
+
2. Identify atomic work units.
|
|
124
|
+
3. Compute dependency order.
|
|
125
|
+
4. Attach validation checkpoint to each unit.
|
|
126
|
+
5. Attach risk and rollback note to each unit.
|
|
127
|
+
6. Emit plan artifact.
|
|
128
|
+
|
|
129
|
+
#### E. Structured Output Template
|
|
130
|
+
- `plan_summary`
|
|
131
|
+
- `work_units[]`
|
|
132
|
+
- `dependency_graph`
|
|
133
|
+
- `validation_checkpoints[]`
|
|
134
|
+
- `risk_register[]`
|
|
135
|
+
|
|
136
|
+
#### F. Stop Conditions
|
|
137
|
+
- Missing objective or scope.
|
|
138
|
+
- Contradictory constraints.
|
|
139
|
+
|
|
140
|
+
#### G. Safety Constraints
|
|
141
|
+
- Must include security and test gates for all code-changing units.
|
|
142
|
+
|
|
143
|
+
### /task
|
|
144
|
+
#### A. Intent
|
|
145
|
+
Convert a plan item into a deterministic execution task.
|
|
146
|
+
|
|
147
|
+
#### B. When to Use
|
|
148
|
+
Use when a specific task must be executed with clear acceptance criteria.
|
|
149
|
+
|
|
150
|
+
#### C. Required Inputs
|
|
151
|
+
- Task identifier
|
|
152
|
+
- Acceptance criteria
|
|
153
|
+
- Allowed files/modules
|
|
154
|
+
|
|
155
|
+
#### D. Deterministic Execution Flow
|
|
156
|
+
1. Resolve task identifier.
|
|
157
|
+
2. Validate acceptance criteria completeness.
|
|
158
|
+
3. Validate file/module boundaries.
|
|
159
|
+
4. Define execution steps.
|
|
160
|
+
5. Define verification steps.
|
|
161
|
+
6. Emit task contract.
|
|
162
|
+
|
|
163
|
+
#### E. Structured Output Template
|
|
164
|
+
- `task_id`
|
|
165
|
+
- `objective`
|
|
166
|
+
- `allowed_scope`
|
|
167
|
+
- `execution_steps[]`
|
|
168
|
+
- `verification_steps[]`
|
|
169
|
+
- `acceptance_criteria[]`
|
|
170
|
+
|
|
171
|
+
#### F. Stop Conditions
|
|
172
|
+
- Task not found.
|
|
173
|
+
- Acceptance criteria missing.
|
|
174
|
+
|
|
175
|
+
#### G. Safety Constraints
|
|
176
|
+
- Must reject tasks that exceed declared scope.
|
|
177
|
+
|
|
178
|
+
### /scaffold
|
|
179
|
+
#### A. Intent
|
|
180
|
+
Create deterministic boilerplate artifacts from declared architecture constraints.
|
|
181
|
+
|
|
182
|
+
#### B. When to Use
|
|
183
|
+
Use to initialize new modules/features with approved structure.
|
|
184
|
+
|
|
185
|
+
#### C. Required Inputs
|
|
186
|
+
- Target feature/module name
|
|
187
|
+
- Stack/runtime
|
|
188
|
+
- Required architectural patterns
|
|
189
|
+
|
|
190
|
+
#### D. Deterministic Execution Flow
|
|
191
|
+
1. Validate target does not conflict with existing paths.
|
|
192
|
+
2. Resolve scaffold template by stack/runtime.
|
|
193
|
+
3. Generate file tree.
|
|
194
|
+
4. Generate minimal secure defaults.
|
|
195
|
+
5. Generate baseline tests.
|
|
196
|
+
6. Emit scaffold manifest.
|
|
197
|
+
|
|
198
|
+
#### E. Structured Output Template
|
|
199
|
+
- `target`
|
|
200
|
+
- `template_source`
|
|
201
|
+
- `files_created[]`
|
|
202
|
+
- `secure_defaults[]`
|
|
203
|
+
- `tests_created[]`
|
|
204
|
+
|
|
205
|
+
#### F. Stop Conditions
|
|
206
|
+
- Path collision.
|
|
207
|
+
- Unsupported runtime/template.
|
|
208
|
+
|
|
209
|
+
#### G. Safety Constraints
|
|
210
|
+
- Must not overwrite existing files without explicit confirmation.
|
|
211
|
+
|
|
212
|
+
### /fix
|
|
213
|
+
#### A. Intent
|
|
214
|
+
Apply the smallest safe change that resolves a verified defect.
|
|
215
|
+
|
|
216
|
+
#### B. When to Use
|
|
217
|
+
Use for bugs with reproducible evidence.
|
|
218
|
+
|
|
219
|
+
#### C. Required Inputs
|
|
220
|
+
- Defect description
|
|
221
|
+
- Reproduction steps or failing test
|
|
222
|
+
- Target scope
|
|
223
|
+
|
|
224
|
+
#### D. Deterministic Execution Flow
|
|
225
|
+
1. Validate defect evidence.
|
|
226
|
+
2. Reproduce failure condition.
|
|
227
|
+
3. Locate root cause.
|
|
228
|
+
4. Generate minimal patch.
|
|
229
|
+
5. Execute targeted validation.
|
|
230
|
+
6. Emit fix report.
|
|
231
|
+
|
|
232
|
+
#### E. Structured Output Template
|
|
233
|
+
- `defect_id`
|
|
234
|
+
- `root_cause`
|
|
235
|
+
- `patch_summary`
|
|
236
|
+
- `files_changed[]`
|
|
237
|
+
- `validation_results[]`
|
|
238
|
+
|
|
239
|
+
#### F. Stop Conditions
|
|
240
|
+
- Failure cannot be reproduced.
|
|
241
|
+
- Root cause unresolved.
|
|
242
|
+
|
|
243
|
+
#### G. Safety Constraints
|
|
244
|
+
- Must not broaden scope beyond defect boundary.
|
|
245
|
+
|
|
246
|
+
### /refactor
|
|
247
|
+
#### A. Intent
|
|
248
|
+
Improve internal structure without changing externally observable behavior.
|
|
249
|
+
|
|
250
|
+
#### B. When to Use
|
|
251
|
+
Use for maintainability, readability, and modularity improvements.
|
|
252
|
+
|
|
253
|
+
#### C. Required Inputs
|
|
254
|
+
- Target component/module
|
|
255
|
+
- Non-functional goals
|
|
256
|
+
- Behavior invariants
|
|
257
|
+
|
|
258
|
+
#### D. Deterministic Execution Flow
|
|
259
|
+
1. Capture behavior invariants.
|
|
260
|
+
2. Identify refactor units.
|
|
261
|
+
3. Apply transformations incrementally.
|
|
262
|
+
4. Run invariant checks after each unit.
|
|
263
|
+
5. Produce delta and complexity impact.
|
|
264
|
+
6. Emit refactor report.
|
|
265
|
+
|
|
266
|
+
#### E. Structured Output Template
|
|
267
|
+
- `target`
|
|
268
|
+
- `invariants[]`
|
|
269
|
+
- `transformations[]`
|
|
270
|
+
- `behavior_check_results[]`
|
|
271
|
+
- `complexity_delta`
|
|
272
|
+
|
|
273
|
+
#### F. Stop Conditions
|
|
274
|
+
- Invariant violation.
|
|
275
|
+
- Missing behavior baseline.
|
|
276
|
+
|
|
277
|
+
#### G. Safety Constraints
|
|
278
|
+
- Must abort on behavior change risk.
|
|
279
|
+
|
|
280
|
+
### /audit
|
|
281
|
+
#### A. Intent
|
|
282
|
+
Run structured engineering audit across security, correctness, and maintainability.
|
|
283
|
+
|
|
284
|
+
#### B. When to Use
|
|
285
|
+
Use before high-impact merges, releases, or external reviews.
|
|
286
|
+
|
|
287
|
+
#### C. Required Inputs
|
|
288
|
+
- Audit scope
|
|
289
|
+
- Risk profile
|
|
290
|
+
- Compliance/security baseline
|
|
291
|
+
- Hardening profile requirement (if applicable)
|
|
292
|
+
|
|
293
|
+
#### D. Deterministic Execution Flow
|
|
294
|
+
1. Resolve audit scope.
|
|
295
|
+
2. Run static checks.
|
|
296
|
+
3. Run security rule checks.
|
|
297
|
+
4. Run dependency and configuration checks.
|
|
298
|
+
5. Verify hardening evidence when hardening-required profile applies.
|
|
299
|
+
6. Classify findings by severity.
|
|
300
|
+
7. Emit audit report.
|
|
301
|
+
|
|
302
|
+
#### E. Structured Output Template
|
|
303
|
+
- `scope`
|
|
304
|
+
- `checks_executed[]`
|
|
305
|
+
- `findings[]`
|
|
306
|
+
- `severity_summary`
|
|
307
|
+
- `remediation_plan[]`
|
|
308
|
+
- `hardening_evidence_status`
|
|
309
|
+
|
|
310
|
+
#### F. Stop Conditions
|
|
311
|
+
- Scope inaccessible.
|
|
312
|
+
- Tooling unavailable.
|
|
313
|
+
|
|
314
|
+
#### G. Safety Constraints
|
|
315
|
+
- Must flag secret leaks and auth bypass as critical.
|
|
316
|
+
- Must classify missing hardening verification evidence as release-blocking when hardening is required.
|
|
317
|
+
|
|
318
|
+
### /perf
|
|
319
|
+
#### A. Intent
|
|
320
|
+
Evaluate and optimize performance using measurable baselines.
|
|
321
|
+
|
|
322
|
+
#### B. When to Use
|
|
323
|
+
Use when latency, throughput, memory, or build-time regressions are reported.
|
|
324
|
+
|
|
325
|
+
#### C. Required Inputs
|
|
326
|
+
- Performance target metrics
|
|
327
|
+
- Baseline environment
|
|
328
|
+
- Candidate optimization scope
|
|
329
|
+
|
|
330
|
+
#### D. Deterministic Execution Flow
|
|
331
|
+
1. Capture baseline metrics.
|
|
332
|
+
2. Identify bottleneck candidates.
|
|
333
|
+
3. Apply one optimization unit.
|
|
334
|
+
4. Re-measure metrics.
|
|
335
|
+
5. Compare against baseline.
|
|
336
|
+
6. Emit performance report.
|
|
337
|
+
|
|
338
|
+
#### E. Structured Output Template
|
|
339
|
+
- `baseline_metrics`
|
|
340
|
+
- `optimization_units[]`
|
|
341
|
+
- `post_metrics`
|
|
342
|
+
- `regression_check`
|
|
343
|
+
- `recommendation`
|
|
344
|
+
|
|
345
|
+
#### F. Stop Conditions
|
|
346
|
+
- Baseline unavailable.
|
|
347
|
+
- Non-reproducible benchmark.
|
|
348
|
+
|
|
349
|
+
#### G. Safety Constraints
|
|
350
|
+
- Must not trade security for performance.
|
|
351
|
+
|
|
352
|
+
### /test
|
|
353
|
+
#### A. Intent
|
|
354
|
+
Generate or execute deterministic test plans and test artifacts.
|
|
355
|
+
|
|
356
|
+
#### B. When to Use
|
|
357
|
+
Use for feature validation, bug regression, and release readiness.
|
|
358
|
+
|
|
359
|
+
#### C. Required Inputs
|
|
360
|
+
- Target scope
|
|
361
|
+
- Test level (unit/integration/e2e)
|
|
362
|
+
- Expected behavior
|
|
363
|
+
|
|
364
|
+
#### D. Deterministic Execution Flow
|
|
365
|
+
1. Resolve test scope.
|
|
366
|
+
2. Map behavior to test cases.
|
|
367
|
+
3. Execute or generate tests.
|
|
368
|
+
4. Capture pass/fail artifacts.
|
|
369
|
+
5. Classify failures.
|
|
370
|
+
6. Emit test report.
|
|
371
|
+
|
|
372
|
+
#### E. Structured Output Template
|
|
373
|
+
- `scope`
|
|
374
|
+
- `test_matrix[]`
|
|
375
|
+
- `execution_results[]`
|
|
376
|
+
- `coverage_delta`
|
|
377
|
+
- `failures[]`
|
|
378
|
+
|
|
379
|
+
#### F. Stop Conditions
|
|
380
|
+
- Test runtime unavailable.
|
|
381
|
+
- Scope undefined.
|
|
382
|
+
|
|
383
|
+
#### G. Safety Constraints
|
|
384
|
+
- Must not mark success if critical tests are skipped.
|
|
385
|
+
|
|
386
|
+
### /pr
|
|
387
|
+
#### A. Intent
|
|
388
|
+
Prepare a deterministic pull request payload with implementation evidence.
|
|
389
|
+
|
|
390
|
+
#### B. When to Use
|
|
391
|
+
Use after code changes are validated and ready for review.
|
|
392
|
+
|
|
393
|
+
#### C. Required Inputs
|
|
394
|
+
- Change summary
|
|
395
|
+
- Linked issues/tasks
|
|
396
|
+
- Validation evidence
|
|
397
|
+
|
|
398
|
+
#### D. Deterministic Execution Flow
|
|
399
|
+
1. Collect changed files.
|
|
400
|
+
2. Summarize change intent and impact.
|
|
401
|
+
3. Attach test/audit evidence.
|
|
402
|
+
4. Classify risk and rollout impact.
|
|
403
|
+
5. Generate reviewer checklist.
|
|
404
|
+
6. Emit PR package.
|
|
405
|
+
|
|
406
|
+
#### E. Structured Output Template
|
|
407
|
+
- `title`
|
|
408
|
+
- `summary`
|
|
409
|
+
- `files_changed[]`
|
|
410
|
+
- `validation_evidence[]`
|
|
411
|
+
- `risk_assessment`
|
|
412
|
+
- `review_checklist[]`
|
|
413
|
+
|
|
414
|
+
#### F. Stop Conditions
|
|
415
|
+
- Missing validation evidence.
|
|
416
|
+
- Unresolved high severity issues.
|
|
417
|
+
|
|
418
|
+
#### G. Safety Constraints
|
|
419
|
+
- Must block PR package when critical findings remain open.
|
|
420
|
+
|
|
421
|
+
### /release
|
|
422
|
+
#### A. Intent
|
|
423
|
+
Produce deterministic release decision and rollout contract.
|
|
424
|
+
|
|
425
|
+
#### B. When to Use
|
|
426
|
+
Use when promoting validated changes to release channels.
|
|
427
|
+
|
|
428
|
+
#### C. Required Inputs
|
|
429
|
+
- Version/tag target
|
|
430
|
+
- Change manifest
|
|
431
|
+
- Rollback strategy
|
|
432
|
+
- Hardening verification evidence (when required by risk profile)
|
|
433
|
+
|
|
434
|
+
#### D. Deterministic Execution Flow
|
|
435
|
+
1. Validate release prerequisites.
|
|
436
|
+
2. Validate migration and compatibility risks.
|
|
437
|
+
3. Validate security/test gates.
|
|
438
|
+
4. Validate hardening verification evidence when hardening-required profile applies.
|
|
439
|
+
5. Build release notes.
|
|
440
|
+
6. Build rollout and rollback steps.
|
|
441
|
+
7. Emit release contract.
|
|
442
|
+
|
|
443
|
+
#### E. Structured Output Template
|
|
444
|
+
- `version`
|
|
445
|
+
- `release_readiness`
|
|
446
|
+
- `gates[]`
|
|
447
|
+
- `rollout_plan[]`
|
|
448
|
+
- `rollback_plan[]`
|
|
449
|
+
- `release_notes`
|
|
450
|
+
- `hardening_verification`
|
|
451
|
+
|
|
452
|
+
#### F. Stop Conditions
|
|
453
|
+
- Gate failure.
|
|
454
|
+
- Missing rollback strategy.
|
|
455
|
+
|
|
456
|
+
#### G. Safety Constraints
|
|
457
|
+
- Must block release if any critical gate fails.
|
|
458
|
+
- Must block release when required hardening evidence is missing.
|
|
459
|
+
|
|
460
|
+
### /docs
|
|
461
|
+
#### A. Intent
|
|
462
|
+
Generate or update documentation with traceable alignment to implemented behavior.
|
|
463
|
+
|
|
464
|
+
#### B. When to Use
|
|
465
|
+
Use when code, APIs, workflows, or operations change.
|
|
466
|
+
|
|
467
|
+
#### C. Required Inputs
|
|
468
|
+
- Documentation scope
|
|
469
|
+
- Source changes
|
|
470
|
+
- Target audience
|
|
471
|
+
|
|
472
|
+
#### D. Deterministic Execution Flow
|
|
473
|
+
1. Resolve source-of-truth artifacts.
|
|
474
|
+
2. Extract behavior/API deltas.
|
|
475
|
+
3. Map deltas to docs sections.
|
|
476
|
+
4. Apply concise updates.
|
|
477
|
+
5. Validate examples/commands.
|
|
478
|
+
6. Emit docs change report.
|
|
479
|
+
|
|
480
|
+
#### E. Structured Output Template
|
|
481
|
+
- `scope`
|
|
482
|
+
- `sources[]`
|
|
483
|
+
- `sections_updated[]`
|
|
484
|
+
- `example_validation`
|
|
485
|
+
- `follow_up_actions[]`
|
|
486
|
+
|
|
487
|
+
#### F. Stop Conditions
|
|
488
|
+
- Source artifacts missing.
|
|
489
|
+
- Behavioral ambiguity unresolved.
|
|
490
|
+
|
|
491
|
+
#### G. Safety Constraints
|
|
492
|
+
- Must not publish secrets, tokens, or internal credentials.
|
|
493
|
+
|
|
494
|
+
----------------------------------------
|
|
495
|
+
4. SAFETY & DESTRUCTIVE ACTION FRAMEWORK
|
|
496
|
+
----------------------------------------
|
|
497
|
+
|
|
498
|
+
The agent must enforce the following hard rules:
|
|
499
|
+
|
|
500
|
+
1. Production database drops are prohibited by default.
|
|
501
|
+
- Require explicit token: `CONFIRM-DESTRUCTIVE:prod-db-drop`.
|
|
502
|
+
- Require backup verification artifact before execution.
|
|
503
|
+
|
|
504
|
+
2. Secret exposure is prohibited.
|
|
505
|
+
- Never output full secrets, API keys, private tokens, or credentials.
|
|
506
|
+
- Redact using fixed mask pattern: `****REDACTED****`.
|
|
507
|
+
|
|
508
|
+
3. Mass deletions are prohibited without threshold and confirmation.
|
|
509
|
+
- If deletion target count > 20 files, block and escalate.
|
|
510
|
+
- Require explicit token: `CONFIRM-DESTRUCTIVE:mass-delete`.
|
|
511
|
+
|
|
512
|
+
4. Forced migrations are prohibited by default.
|
|
513
|
+
- Block destructive/irreversible migrations without rollback artifact.
|
|
514
|
+
- Require explicit token: `CONFIRM-DESTRUCTIVE:forced-migration`.
|
|
515
|
+
|
|
516
|
+
5. Security bypass is prohibited.
|
|
517
|
+
- Never disable authentication, authorization, validation, or rate limiting to pass checks.
|
|
518
|
+
|
|
519
|
+
6. Dependency upgrades require impact analysis.
|
|
520
|
+
- Must provide compatibility matrix, changelog risk scan, and test impact summary.
|
|
521
|
+
- If missing, set `status: blocked`.
|
|
522
|
+
|
|
523
|
+
----------------------------------------
|
|
524
|
+
5. FAILURE MODES
|
|
525
|
+
----------------------------------------
|
|
526
|
+
|
|
527
|
+
### Insufficient Context
|
|
528
|
+
1. Return `status: blocked`.
|
|
529
|
+
2. Return `blocker_type: insufficient_context`.
|
|
530
|
+
3. Request only decision-critical missing inputs.
|
|
531
|
+
|
|
532
|
+
### Conflicting Instructions
|
|
533
|
+
1. Return `status: blocked`.
|
|
534
|
+
2. Return `blocker_type: conflicting_instructions`.
|
|
535
|
+
3. List conflicts with deterministic precedence order:
|
|
536
|
+
- Safety rules
|
|
537
|
+
- Explicit non-negotiable constraints
|
|
538
|
+
- Command contract
|
|
539
|
+
- Secondary preferences
|
|
540
|
+
|
|
541
|
+
### High-Risk Change Detected
|
|
542
|
+
1. Return `status: blocked` unless explicit confirmation token is present.
|
|
543
|
+
2. Return `blocker_type: high_risk_change`.
|
|
544
|
+
3. Provide `safe_alternative` path.
|
|
545
|
+
|
|
546
|
+
### Unknown Framework Detected
|
|
547
|
+
1. Return `status: blocked`.
|
|
548
|
+
2. Return `blocker_type: unknown_framework`.
|
|
549
|
+
3. Fallback to technology-agnostic baseline rules from `agent-docs/ARCHITECTURE.md` and request minimum framework metadata.
|
|
550
|
+
|
|
551
|
+
----------------------------------------
|
|
552
|
+
6. EXAMPLE USAGE
|
|
553
|
+
----------------------------------------
|
|
554
|
+
|
|
555
|
+
### Example 1
|
|
556
|
+
User input:
|
|
557
|
+
`/plan objective="Implement deterministic slash commands" scope="AGENTS docs only" constraints="security,test"`
|
|
558
|
+
|
|
559
|
+
Expected output structure:
|
|
560
|
+
- `command: /plan`
|
|
561
|
+
- `execution_id: <uuid>`
|
|
562
|
+
- `mode: slash-command`
|
|
563
|
+
- `status: completed`
|
|
564
|
+
- `inputs: {...}`
|
|
565
|
+
- `prechecks: [...]`
|
|
566
|
+
- `execution_log: [...]`
|
|
567
|
+
- `artifacts: { plan_summary, work_units, dependency_graph }`
|
|
568
|
+
- `risks: [...]`
|
|
569
|
+
- `safety_checks: [...]`
|
|
570
|
+
- `stop_condition: none`
|
|
571
|
+
- `next_action: /task`
|
|
572
|
+
|
|
573
|
+
### Example 2
|
|
574
|
+
User input:
|
|
575
|
+
`/fix defect="Null pointer in auth middleware" evidence="failing test auth.middleware.spec"`
|
|
576
|
+
|
|
577
|
+
Expected output structure:
|
|
578
|
+
- `command: /fix`
|
|
579
|
+
- `execution_id: <uuid>`
|
|
580
|
+
- `mode: slash-command`
|
|
581
|
+
- `status: completed|blocked`
|
|
582
|
+
- `inputs: {...}`
|
|
583
|
+
- `prechecks: [...]`
|
|
584
|
+
- `execution_log: [...]`
|
|
585
|
+
- `artifacts: { root_cause, patch_summary, files_changed, validation_results }`
|
|
586
|
+
- `risks: [...]`
|
|
587
|
+
- `safety_checks: [...]`
|
|
588
|
+
- `stop_condition: <reason|null>`
|
|
589
|
+
- `next_action: /test`
|
|
590
|
+
|
|
591
|
+
### Example 3
|
|
592
|
+
User input:
|
|
593
|
+
`/release version="v2.4.0"`
|
|
594
|
+
|
|
595
|
+
Expected output structure:
|
|
596
|
+
- `command: /release`
|
|
597
|
+
- `execution_id: <uuid>`
|
|
598
|
+
- `mode: slash-command`
|
|
599
|
+
- `status: blocked` (if any gate fails)
|
|
600
|
+
- `inputs: {...}`
|
|
601
|
+
- `prechecks: [...]`
|
|
602
|
+
- `execution_log: [...]`
|
|
603
|
+
- `artifacts: { release_readiness, gates, rollout_plan, rollback_plan }`
|
|
604
|
+
- `risks: [...]`
|
|
605
|
+
- `safety_checks: [...]`
|
|
606
|
+
- `stop_condition: gate_failure|none`
|
|
607
|
+
- `next_action: resolve_failed_gates`
|
|
608
|
+
|
|
33
609
|
## Critical Rules (Always Apply)
|
|
34
610
|
|
|
35
611
|
### Security-First Development
|
|
@@ -49,7 +625,7 @@ When implementing any feature:
|
|
|
49
625
|
- **Type safety**: Use strong typing, validate at boundaries
|
|
50
626
|
- **Performance**: Monitor bundle/binary size, implement lazy loading
|
|
51
627
|
- **Accessibility**: WCAG 2.1 AA compliance for user-facing components
|
|
52
|
-
- **Documentation**: Keep README, agent-docs/ARCHITECTURE.md, and AGENTS.
|
|
628
|
+
- **Documentation**: Keep README, agent-docs/ARCHITECTURE.md, and AGENTS.MD updated
|
|
53
629
|
|
|
54
630
|
## Architecture Principles
|
|
55
631
|
|
|
@@ -75,6 +651,7 @@ When implementing any feature:
|
|
|
75
651
|
|
|
76
652
|
### For Security Reviews
|
|
77
653
|
→ Apply `agents/rules/security.mdc` comprehensively
|
|
654
|
+
→ Apply `agents/rules/hardening.mdc` for hardening profile and obfuscation decisions
|
|
78
655
|
→ Check OWASP Top 10 compliance
|
|
79
656
|
|
|
80
657
|
## When in Doubt
|
package/templates/CLAUDE.md
CHANGED
|
@@ -4,7 +4,7 @@ This project uses enterprise-grade, technology-agnostic development patterns for
|
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
7
|
-
- **AI Guide**: See `AGENTS.
|
|
7
|
+
- **AI Guide**: See `AGENTS.MD` for comprehensive instructions
|
|
8
8
|
- **Architecture**: See `agent-docs/ARCHITECTURE.md` for project guidelines
|
|
9
9
|
- **Custom Skills**: See `agents/skills/` directory for domain-specific extensions
|
|
10
10
|
- **Detailed Rules**: See `agents/rules/*.mdc` files
|
|
@@ -22,13 +22,21 @@ This project uses enterprise-grade, technology-agnostic development patterns for
|
|
|
22
22
|
|
|
23
23
|
## Agent Delegation
|
|
24
24
|
|
|
25
|
-
When implementing features, reference `AGENTS.
|
|
25
|
+
When implementing features, reference `AGENTS.MD`:
|
|
26
26
|
- **UI/Design** → FrontendAgent patterns (`agents/rules/frontend.mdc`)
|
|
27
27
|
- **API/Logic** → BackendAgent patterns (`agents/rules/security.mdc`)
|
|
28
28
|
- **Database** → DatabaseAgent patterns (`agents/rules/database.mdc`)
|
|
29
29
|
- **Testing** → TestAgent patterns (`agents/rules/testing.mdc`)
|
|
30
30
|
- **Security** → SecurityAgent patterns (`agents/rules/security.mdc`)
|
|
31
31
|
|
|
32
|
+
## Deterministic Slash Commands
|
|
33
|
+
|
|
34
|
+
- Slash command protocol is defined in `AGENTS.MD` under `Deterministic Slash Command System Standard`.
|
|
35
|
+
- Modular command contracts are stored in `agents/commands/`.
|
|
36
|
+
- Command mode is strict: unknown or malformed slash commands must return structured error output and stop.
|
|
37
|
+
- No conversational fallback is allowed once slash-command mode is entered.
|
|
38
|
+
- Destructive actions require explicit confirmation token format: `CONFIRM-DESTRUCTIVE:<target>`.
|
|
39
|
+
|
|
32
40
|
## Critical Rules
|
|
33
41
|
|
|
34
42
|
- Validate ALL user inputs with schema validation
|
|
@@ -41,9 +49,10 @@ When implementing features, reference `AGENTS.md`:
|
|
|
41
49
|
|
|
42
50
|
## Reference Files
|
|
43
51
|
|
|
44
|
-
- `AGENTS.
|
|
52
|
+
- `AGENTS.MD` - Primary AI assistant guide
|
|
45
53
|
- `agent-docs/ARCHITECTURE.md` - Architecture and technology stack guidance
|
|
46
|
-
- `AGENTS.
|
|
54
|
+
- `AGENTS.MD` - AI assistant guide and patterns
|
|
55
|
+
- `agents/commands/` - Deterministic slash command contracts
|
|
47
56
|
- `agents/rules/core.mdc` - Core principles
|
|
48
57
|
- `agents/rules/security.mdc` - Security patterns (CRITICAL)
|
|
49
58
|
- `agents/rules/testing.mdc` - Testing strategy (CRITICAL)
|
package/templates/GEMINI.md
CHANGED
|
@@ -8,7 +8,7 @@ This project uses enterprise-grade, technology-agnostic development patterns for
|
|
|
8
8
|
|
|
9
9
|
## Quick Start
|
|
10
10
|
|
|
11
|
-
- **AI Guide**: See `AGENTS.
|
|
11
|
+
- **AI Guide**: See `AGENTS.MD` for comprehensive instructions
|
|
12
12
|
- **Architecture**: See `agent-docs/ARCHITECTURE.md` for project guidelines
|
|
13
13
|
- **Custom Skills**: See `agents/skills/` directory for domain-specific extensions
|
|
14
14
|
- **Detailed Rules**: See `agents/rules/*.mdc` files
|
|
@@ -63,6 +63,14 @@ This project follows an agent-based pattern where different roles handle differe
|
|
|
63
63
|
|
|
64
64
|
When implementing features, identify which agent responsibility applies and refer to the appropriate rules file.
|
|
65
65
|
|
|
66
|
+
## Deterministic Slash Commands
|
|
67
|
+
|
|
68
|
+
- Slash command protocol is defined in `AGENTS.MD` under `Deterministic Slash Command System Standard`.
|
|
69
|
+
- Modular command contracts are stored in `agents/commands/`.
|
|
70
|
+
- Command mode is strict: unknown or malformed slash commands must return structured error output and stop.
|
|
71
|
+
- No conversational fallback is allowed once slash-command mode is entered.
|
|
72
|
+
- Destructive actions require explicit confirmation token format: `CONFIRM-DESTRUCTIVE:<target>`.
|
|
73
|
+
|
|
66
74
|
## Technology Stack Independence
|
|
67
75
|
|
|
68
76
|
These patterns apply regardless of your tech stack. Adapt them to your chosen framework:
|
|
@@ -100,9 +108,10 @@ These patterns apply regardless of your tech stack. Adapt them to your chosen fr
|
|
|
100
108
|
|
|
101
109
|
| File | Purpose | When to Use |
|
|
102
110
|
|------|---------|------------|
|
|
103
|
-
| `AGENTS.
|
|
111
|
+
| `AGENTS.MD` | Primary AI assistant guide | Always start here |
|
|
104
112
|
| `agent-docs/ARCHITECTURE.md` | Architecture and technology stack decisions | Need architectural guidance |
|
|
105
|
-
| `AGENTS.
|
|
113
|
+
| `AGENTS.MD` | AI assistant guide and patterns | How to work effectively with AI |
|
|
114
|
+
| `agents/commands/` | Deterministic slash command contracts | Slash-command execution |
|
|
106
115
|
| `agents/rules/core.mdc` | Core development principles | General development questions |
|
|
107
116
|
| `agents/rules/security.mdc` | Security patterns and implementations | Building secure features |
|
|
108
117
|
| `agents/rules/testing.mdc` | Testing strategy and best practices | Writing tests or test strategy |
|
|
@@ -113,9 +122,9 @@ These patterns apply regardless of your tech stack. Adapt them to your chosen fr
|
|
|
113
122
|
|
|
114
123
|
## Workflow Recommendations
|
|
115
124
|
|
|
116
|
-
1. **Read AGENTS.
|
|
125
|
+
1. **Read AGENTS.MD** for comprehensive AI assistance guidance
|
|
117
126
|
2. **Read agent-docs/ARCHITECTURE.md** to understand the overall architecture
|
|
118
|
-
3. **Reference AGENTS.
|
|
127
|
+
3. **Reference AGENTS.MD** for AI working patterns and guidance
|
|
119
128
|
3. **Reference the appropriate rule file** for implementation patterns
|
|
120
129
|
4. **Look in agents/skills/** for domain-specific guidance
|
|
121
130
|
5. **Follow all critical rules** without exception
|
|
@@ -130,4 +139,4 @@ These patterns apply regardless of your tech stack. Adapt them to your chosen fr
|
|
|
130
139
|
|
|
131
140
|
---
|
|
132
141
|
|
|
133
|
-
For best results with Gemini AI assistance, reference the appropriate context from `AGENTS.
|
|
142
|
+
For best results with Gemini AI assistance, reference the appropriate context from `AGENTS.MD`, `agent-docs/ARCHITECTURE.md`, and the relevant `agents/rules/*.mdc` files in your prompts.
|