claude-dev-env 1.17.5 → 1.19.1

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.
Files changed (25) hide show
  1. package/hooks/blocking/content-search-to-zoekt-redirector.py +6 -2
  2. package/hooks/blocking/content_search_zoekt_block_payload.py +9 -5
  3. package/hooks/blocking/content_search_zoekt_redirect_guidance.py +7 -1
  4. package/hooks/blocking/test_content_search_to_zoekt_redirector_integration.py +8 -1
  5. package/hooks/blocking/test_content_search_to_zoekt_redirector_unit.py +7 -2
  6. package/hooks/hooks.json +15 -0
  7. package/package.json +1 -1
  8. package/hooks/HOOK_SPECS_PROMPT_WORKFLOW.md +0 -64
  9. package/hooks/blocking/prompt_workflow_clipboard.py +0 -63
  10. package/hooks/blocking/prompt_workflow_gate_config.py +0 -113
  11. package/hooks/blocking/prompt_workflow_gate_core.py +0 -289
  12. package/hooks/blocking/prompt_workflow_validate.py +0 -218
  13. package/hooks/blocking/test_prompt_workflow_clipboard.py +0 -54
  14. package/hooks/blocking/test_prompt_workflow_gate_core.py +0 -195
  15. package/hooks/blocking/test_prompt_workflow_validate.py +0 -339
  16. package/rules/prompt-workflow-context-controls.md +0 -48
  17. package/skills/agent-prompt/SKILL.md +0 -199
  18. package/skills/prompt-generator/ARCHITECTURE.md +0 -18
  19. package/skills/prompt-generator/REFERENCE.md +0 -254
  20. package/skills/prompt-generator/REFINEMENT_PIPELINE_RUNBOOK.md +0 -177
  21. package/skills/prompt-generator/SKILL.md +0 -354
  22. package/skills/prompt-generator/TARGET_OUTPUT.md +0 -133
  23. package/skills/prompt-generator/evals/prompt-generator.json +0 -207
  24. package/skills/prompt-generator/templates/skill-from-ground-up.md +0 -104
  25. package/skills/prompt-generator/templates/skill-refinement-package.md +0 -109
@@ -1,207 +0,0 @@
1
- {
2
- "skill_name": "prompt-generator",
3
- "target_output_spec": "TARGET_OUTPUT.md",
4
- "source": "https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices#evaluation-and-iteration",
5
- "evals": [
6
- {
7
- "id": 1,
8
- "name": "fresh_chat_brief_goal",
9
- "scenario": "Scenario 1",
10
- "prompt": "/prompt-generator Write a system prompt for a Python linting agent that auto-fixes code style issues in this repo",
11
- "files": [],
12
- "expected_behavior": [
13
- "Discovery tool calls (Glob/Grep) execute before any AskUserQuestion",
14
- "All questions delivered via AskUserQuestion — zero questions in direct chat text",
15
- "AskUserQuestion contains 2-4 questions, each with 2-4 options, recommended option first",
16
- "After internal drafting finishes, one assistant turn shows ### Outcome preview with bullets only: what executing the generated prompt will produce, primary inputs or tools, done-when, short sample (TARGET_OUTPUT.md)",
17
- "That same turn uses AskUserQuestion (2-4 options): recommended option first = user confirms the preview matches their intent and proceeds to the final handoff; two options offer scope or emphasis shifts grounded in discovery; one option collects free-text refinements and triggers another drafting pass (at most three such preview rounds unless the user raises the cap in chat)",
18
- "Final response: Audit line, one Markdown code fence tagged xml with the full prompt, then ## Outcome digest after the closing fence",
19
- "No second outer ```xml fence in the digest (samples use four spaces or tilde fences only)",
20
- "Fenced block contains <role>, <background>, <instructions>, <constraints>, <output_format>",
21
- "Prompt generation delegated to a subagent (Agent tool call visible in the flow)"
22
- ]
23
- },
24
- {
25
- "id": 2,
26
- "name": "session_handoff",
27
- "scenario": "Scenario 2",
28
- "prompt": "[Preceded by 20+ turns debugging a theme export race condition, modifying download_manager.py and orchestrator.py, deciding on retry logic] /prompt-generator Generate a handoff prompt so a new session can continue this work",
29
- "files": [
30
- "packages/samsung-automation/download_manager.py",
31
- "packages/samsung-automation/orchestrator.py"
32
- ],
33
- "expected_behavior": [
34
- "AskUserQuestion has 1-2 questions — lighter than Scenario 1",
35
- "Generated prompt <background> includes: session state, decisions, files modified, next steps",
36
- "No redundant discovery tool calls for information already in conversation",
37
- "Handoff prompt is self-contained — a new session can resume without prior context",
38
- "Prior decisions preserved in the handoff, not lost or paraphrased away",
39
- "After internal drafting finishes, ### Outcome preview bullets plus AskUserQuestion as in eval id 1 (confirm match as recommended first option; two contextual alternates; free-text refine option; preview loop cap)",
40
- "Final output: 1-liner audit + fenced XML prompt + ## Outcome digest after the fence"
41
- ]
42
- },
43
- {
44
- "id": 3,
45
- "name": "long_unstructured_input",
46
- "scenario": "Scenario 3",
47
- "prompt": "/prompt-generator i need a prompt for an agent that goes through our samsung seller portal automation scripts and finds all the places where we hardcoded timeouts or selectors and then extracts them into config files, the scripts are in packages/samsung-automation and they use playwright and theres shared_utils that already has some config patterns i think, also make sure it doesnt break existing tests and follows our TDD approach and code rules",
48
- "files": [],
49
- "expected_behavior": [
50
- "First AskUserQuestion question confirms extracted intent — not generic",
51
- "Ambiguities surfaced as specific options, not open-ended questions",
52
- "Discovery tool calls verify references from input (shared_utils, config patterns)",
53
- "ALL requirements from unstructured input captured (timeouts, selectors, config extraction, TDD, code rules, test safety) — none dropped",
54
- "After internal drafting finishes, ### Outcome preview bullets plus AskUserQuestion as in eval id 1 (confirm match as recommended first option; two contextual alternates; free-text refine option; preview loop cap)",
55
- "Final output: 1-liner audit + fenced XML prompt + ## Outcome digest after the fence"
56
- ]
57
- },
58
- {
59
- "id": 4,
60
- "name": "noisy_context_no_degradation",
61
- "scenario": "Scenario 4",
62
- "prompt": "[Preceded by 80+ turns: failed git push, hook debugging, unrelated Samsung portal discussion, Python tracebacks, Midjourney tangent, 15+ empty Grep results] /prompt-generator Write a system prompt for a code review agent that checks for security vulnerabilities",
63
- "files": [],
64
- "expected_behavior": [
65
- "Output format matches Scenario 1: 1-liner audit + fenced XML prompt + ## Outcome digest after the fence",
66
- "After internal drafting finishes, ### Outcome preview bullets plus AskUserQuestion as in eval id 1 (confirm match as recommended first option; two contextual alternates; free-text refine option; preview loop cap)",
67
- "Prompt content about code review and security — zero contamination from prior noise",
68
- "No references to prior errors, tangents, or unrelated tool calls in the prompt",
69
- "XML structure complete and well-formed — no truncation from context pressure",
70
- "Subagent delegation visible (Agent tool call with curated context, not raw conversation)"
71
- ]
72
- },
73
- {
74
- "id": 5,
75
- "name": "no_tool_calls_after_fence",
76
- "scenario": "Structural invariant A (Issue #41 Eval A)",
77
- "prompt": "/prompt-generator Create a prompt for an agent that traces a routing bug across shared_utils/export_handler.py, orchestrator.py, and download_manager.py — find where extract_apk is called and whether it handles APK signature check failures",
78
- "files": ["packages/samsung-automation/shared_utils/export_handler.py"],
79
- "expected_behavior": [
80
- "No tool_use blocks appear after the first fence marker of the canonical prompt artifact",
81
- "All Glob/Grep discovery calls precede the AskUserQuestion",
82
- "AskUserQuestion interactions precede the subagent; Outcome preview AskUserQuestion precedes the final Audit line and xml fence",
83
- "Review the last successful Audit + fenced xml pair; blocked retry attempts preserved by exported conversation logs do not count as additional delivered artifacts"
84
- ]
85
- },
86
- {
87
- "id": 6,
88
- "name": "fenced_block_closes_cleanly",
89
- "scenario": "Structural invariant B (Issue #41 Eval B)",
90
- "prompt": "/prompt-generator Write a detailed agent-harness prompt for a TDD bug-fix workflow that traces a routing error across 5+ files, with state management for multi-window execution and structured test tracking",
91
- "files": [],
92
- "expected_behavior": [
93
- "The canonical prompt artifact has one opening xml fence and one matching closing fence; exported conversation logs are normalized to that same boundary before review",
94
- "Every XML tag properly opened and closed",
95
- "No truncation at numbered-list bullets (the Issue #41 failure mode)",
96
- "No mid-sentence cuts or incomplete sections",
97
- "Artifact is copy-pasteable as-is without manual repair"
98
- ]
99
- },
100
- {
101
- "id": 7,
102
- "name": "discovery_complete_gate",
103
- "scenario": "Structural invariant C (Issue #41 Eval C)",
104
- "prompt": "/prompt-generator Create a prompt for an agent that refactors the Samsung theme scoring pipeline — but I'm not sure if the scoring logic is in theme_scorer.py or distributed across multiple files",
105
- "files": [],
106
- "expected_behavior": [
107
- "Discovery tool calls attempt to locate scoring logic before prompt generation",
108
- "If resolved: prompt references concrete file paths from discovery",
109
- "If unresolved: prompt contains <open_question> in <background> for downstream agent",
110
- "No re-entry to discovery after the canonical artifact fence starts",
111
- "AskUserQuestion may surface the uncertainty if discovery was inconclusive; when discovery resolves concrete paths before the artifact, absence of <open_question> is expected"
112
- ]
113
- },
114
- {
115
- "id": 8,
116
- "name": "no_mid_artifact_hedging",
117
- "scenario": "Structural invariant D (Issue #41 Eval D)",
118
- "prompt": "/prompt-generator Write a comprehensive agent prompt for migrating all 12 Samsung portal automation scripts from hardcoded selectors to centralized config, covering full test suite update",
119
- "files": [],
120
- "expected_behavior": [
121
- "Zero instances of 'let me also check', 'actually', 'one more consideration' inside fenced block",
122
- "No tentative language ('might be', 'possibly', 'I think') in instructions or constraints",
123
- "All uncertainty expressed as <open_question> tags, not inline hedges",
124
- "Prompt reads as confident complete instructions, not a draft-in-progress"
125
- ]
126
- },
127
- {
128
- "id": 9,
129
- "name": "zero_negative_phrasing_in_output",
130
- "scenario": "Content quality gate A (anti-pattern elimination)",
131
- "prompt": "/prompt-generator Write a system prompt for an agent that reviews TypeScript code for type safety, enforces strict null checks, and ensures all function signatures have complete type annotations",
132
- "files": [],
133
- "expected_behavior": [
134
- "Fenced prompt artifact contains zero hard anti-pattern keywords: 'no', 'not', 'don't', 'do not', 'never', 'avoid', 'without', 'refrain', 'stop', 'prevent', 'exclude', 'prohibit', 'forbid', 'reject'",
135
- "Zero indirect anti-patterns: 'instead of X' (implies X is bad), 'rather than X', 'as opposed to'",
136
- "Every instruction phrased as a positive directive: what TO do, what TO produce, what TO enforce",
137
- "Constraints section uses affirmative boundaries: 'only X', 'always X', 'ensure X', 'require X' — positive framing throughout",
138
- "Example: 'Ensure all functions have explicit return types' passes; 'Do not leave return types implicit' fails; 'Avoid missing return types' fails",
139
- "Applies to all sections inside the fenced block: <role>, <background>, <instructions>, <constraints>, <output_format>"
140
- ]
141
- },
142
- {
143
- "id": 10,
144
- "name": "required_sections_present_in_artifact",
145
- "scenario": "Section completeness gate (render-survival)",
146
- "prompt": "/prompt-generator Write a system prompt for a Python linting agent that auto-fixes code style issues in this repo",
147
- "files": [],
148
- "expected_behavior": [
149
- "Fenced XML block contains opening and closing tags for all five required sections: role, background, instructions, constraints, output_format",
150
- "Each required section contains substantive content (minimum one sentence each)",
151
- "The Stop hook section-presence check passes for this output (no missing section tags)",
152
- "Sections appear in order: role first, output_format last among the five required sections"
153
- ]
154
- },
155
- {
156
- "id": 11,
157
- "name": "section_missing_triggers_hook_block",
158
- "scenario": "Section completeness gate — failure path",
159
- "prompt": "Synthetic eval: assistant final message is prompt-workflow shaped (overall_status, checklist, scope anchors, runtime signals) with a fenced Markdown XML block whose body omits the entire background section (no background opening/closing tags); observer asserts Stop hook behavior and successful retry.",
160
- "files": [],
161
- "expected_behavior": [
162
- "The Stop hook runs _check_required_xml_sections and returns a block decision naming background as a missing section",
163
- "The model retry includes all five required sections with both opening and closing tags",
164
- "The retry output passes the section-presence gate (empty missing list from missing_required_xml_sections)"
165
- ]
166
- },
167
- {
168
- "id": 12,
169
- "name": "render_survival_file_fallback",
170
- "scenario": "Render-layer mitigation",
171
- "prompt": "/prompt-generator Write a comprehensive agent prompt for migrating a large Prisma schema and all related API routes, with step-by-step rollout, rollback, and verification — artifact sized like the migration prompt that triggered chat render stripping.",
172
- "files": [],
173
- "expected_behavior": [
174
- "When the artifact exceeds a size threshold or contains XML section tag names that collide with HTML5 elements (section, summary, details, header, footer, main, aside, article, nav, figure), the orchestrator writes the full artifact to a file under data/prompts/ or a user-specified path",
175
- "The file contains the complete XML with all tags preserved as literal text",
176
- "The user-facing message states the file path and briefly inventories which required sections the artifact contains"
177
- ]
178
- },
179
- {
180
- "id": 13,
181
- "name": "nested_inner_fence_does_not_truncate_xml_for_hooks",
182
- "scenario": "Structural invariant E — nested Markdown fences inside ```xml",
183
- "prompt": "/prompt-generator Include <illustrations> with a bash snippet using triple-backtick fences inside the XML, mirroring real prompts that previously hid </illustrations> in chat and broke hook extraction.",
184
- "files": [],
185
- "expected_behavior": [
186
- "prompt_workflow_gate_core.extract_fenced_xml_content includes text after inner ```bash ... ``` lines up to the final closing ``` of the xml fence",
187
- "missing_required_xml_sections sees closing tags for role, background, instructions, constraints, output_format when those appear after nested fences",
188
- "SKILL.md §7 states ordered authoring steps for <illustrations>: four-space-indented sample lines, then tilde fences, then a complete triple-backtick pair when required"
189
- ]
190
- },
191
- {
192
- "id": 14,
193
- "name": "outcome_preview_gate_and_digest_placement",
194
- "scenario": "Outcome preview + post-fence digest (refinement contract)",
195
- "prompt": "/prompt-generator Write a short user-task prompt for triaging GitHub issues by label in this repo",
196
- "files": [],
197
- "expected_behavior": [
198
- "Subagent returns final XML plus preview summary fields for orchestrator use",
199
- "### Outcome preview markdown block precedes AskUserQuestion; bullets cover executor output, inputs or tools, done when, sample excerpt (~20 lines max)",
200
- "AskUserQuestion: recommended first option labels accepting the described outcome and proceeding (SKILL.md may phrase this as 'Ship this outcome profile' or equivalent); plus two contextual alternates and a free-text refinement path; at most three preview rounds unless user extends cap in chat",
201
- "At most three preview refinement loops unless user raises cap in chat",
202
- "Final handoff order: Audit line, single ```xml fence, ## Outcome digest, then optional hook validation block (defined in SKILL.md Terminology) after digest",
203
- "extract_fenced_xml_content returns only the XML body (digest uses no second ```xml fence)"
204
- ]
205
- }
206
- ]
207
- }
@@ -1,104 +0,0 @@
1
- # Template: ground-up skill build (collaborative)
2
-
3
- Use this artifact when you want a **new** Agent Skill package built **architecture-first**, then **implementation in layers**, with **human checkpoints** and **evaluation rows tied to real evidence** (pasted threads or explicit user approval), aligned with [Agent Skills best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices).
4
-
5
- ## Before you paste
6
-
7
- Replace every `[[TOKEN]]` below (keep the brackets off in the final prompt you paste into a session, or substitute literal values).
8
-
9
- | Token | Meaning |
10
- | --- | --- |
11
- | `[[SKILL_PURPOSE]]` | Two to five sentences: capability, user pain, success shape. |
12
- | `[[WORKSPACE_ROOT]]` | Repo-relative folder for all Phase A–B files (e.g. `my-skill-workspace/`). |
13
- | `[[DESIGN_INPUT_GLOB]]` | Hypothesis or gap doc path (e.g. `my-skill-workspace/gap-analysis.md`), or `None` carried into `ARCHITECTURE.md` `Design inputs`. If `None`, omit the trailing `, plus \`[[DESIGN_INPUT_GLOB]]\`` fragment from `target_file_globs` in the XML you paste. |
14
- | `[[OPTIONAL_PACKAGE_TARGET]]` | Future install path (e.g. `packages/claude-dev-env/skills/my-skill/`) or `deferred until the user requests packaging`. |
15
- | `[[SKILL_SLUG]]` | Short kebab-case id for eval filename and metadata (e.g. `my-skill`). |
16
- | `[[DESCRIPTION_TRIGGERS]]` | Comma-separated phrases for third-person `description` triggers (user says, user asks, …). |
17
- | `[[EVIDENCE_RULE]]` | One sentence: what counts as authorized eval material (e.g. pasted excerpts only). |
18
-
19
- Optional: run `/prompt-generator` with this template as the brief so **AskUserQuestion** can lock scope before drafting.
20
-
21
- ---
22
-
23
- ## Paste-ready XML (after substitution)
24
-
25
- ```xml
26
- <role>
27
- You are a skill architect and implementer for Claude Agent Skills. You build a skill package under human review. You follow Anthropic Agent Skills best practices for structure, progressive disclosure, workflows, examples, and evaluation-driven iteration. You treat the user as the sole authority for real evaluation evidence.
28
- </role>
29
-
30
- <background>
31
- Motivation: [[SKILL_PURPOSE]] The user builds collaboratively: evaluation scenarios must trace to material the user pasted or explicitly approved in thread. Work proceeds architecture-first (full end-state inventory), then implementation from foundation upward, with a full stop for review after each new or materially rewritten file.
32
-
33
- Scope block (ground every instruction here):
34
- - target_local_roots: `[[WORKSPACE_ROOT]]` at the repository root of this project (primary drafting and documentation area).
35
- - target_canonical_roots: Optional future install under `[[OPTIONAL_PACKAGE_TARGET]]`; until packaging is requested, keep all writes inside `[[WORKSPACE_ROOT]]`.
36
- - target_file_globs: `[[WORKSPACE_ROOT]]ARCHITECTURE.md`, `[[WORKSPACE_ROOT]]SKILL.md`, `[[WORKSPACE_ROOT]]REFERENCE.md`, `[[WORKSPACE_ROOT]]EXAMPLES.md`, `[[WORKSPACE_ROOT]]WORKFLOWS.md`, `[[WORKSPACE_ROOT]]evals/*.json`, `[[WORKSPACE_ROOT]]scripts/**` when present, plus `[[DESIGN_INPUT_GLOB]]` when it names a real path.
37
- - comparison_basis: Anthropic Agent Skills best practices for concise metadata, third-person descriptions, progressive disclosure (SKILL.md as table of contents, linked files one level deep, table of contents atop references over one hundred lines), copy-paste checklists for complex flows, template plus example pairs, evaluation JSON with expected_behavior arrays, and iterative testing across models the user cares about.
38
- - completion_boundary: Phase A delivers `[[WORKSPACE_ROOT]]ARCHITECTURE.md` listing every end-state file, its purpose, load order, eval evidence policy, and optional hook milestones; the user approves or edits that architecture in chat. Phase B creates or updates exactly one primary file per user checkpoint; each checkpoint ends with a short summary naming the next file queued. Phase C closes when SKILL.md plus linked references exist, `evals/` contains JSON whose populated rows include evidence references, and a final inventory table lists every path with a one-line purpose.
39
-
40
- Hypothesis note: When `[[DESIGN_INPUT_GLOB]]` names a file, treat that file as design input; each eval row still needs a matching pasted thread excerpt or explicit user approval before it counts as grounded behavior truth.
41
-
42
- Source priority for structure and quality bars: Anthropic Agent Skills documentation and prompting best practices first; user pasted materials for behavioral truth; repository AGENTS.md or package README when they touch path layout.
43
-
44
- Citation policy: Quote user-pasted excerpts inside evaluation records or EXAMPLES.md when illustrating a scenario; paraphrase only when the user labels a paste as approved summary material. Ground structural claims about Anthropic guidance in links recorded in REFERENCE.md.
45
-
46
- Evaluation evidence rule: [[EVIDENCE_RULE]]
47
- </background>
48
-
49
- <instructions>
50
- 1. Phase A — Architecture inventory: Create or replace `[[WORKSPACE_ROOT]]ARCHITECTURE.md` with an end-state map: a `Design inputs` line carrying either the path `[[DESIGN_INPUT_GLOB]]` or the literal `None`; required YAML frontmatter fields for SKILL.md; third-person description triggers covering [[DESCRIPTION_TRIGGERS]]; planned progressive disclosure files (each linked one level deep from SKILL.md); workflow checklist locations; EXAMPLES.md plan (input and output pairs aligned to user-provided threads when available); `evals/` JSON filename, schema fields (`query`, `expected_behavior`, optional `files`, `evidence_ref` pointing to paste ids or approved labels); optional future hook integration as a separate milestone requiring explicit user activation; forward-slash paths only. Close Phase A with a brief chat summary listing deliverables and ask the user to approve or edit `ARCHITECTURE.md` before Phase B begins.
51
- 2. Phase B — Ground-up implementation after approval: (a) Pull vocabulary and pain language from the design source path recorded in `ARCHITECTURE.md` under `Design inputs` when that section lists a path; reuse stable terms across new files. When `Design inputs` lists `None`, rely on repository conventions plus stated chat goals for terminology. (b) Draft `[[WORKSPACE_ROOT]]SKILL.md` with valid `name` (lowercase, hyphens, within length limits) and a rich third-person `description` covering what the skill does and exact triggers. (c) Add `REFERENCE.md` for terminology, links to Anthropic docs, and eval evidence rules. (d) Add `EXAMPLES.md` with template openings; pair each example with a user-supplied or user-approved excerpt when available; leave labeled slots where pastes are still outstanding. (e) Add `WORKFLOWS.md` containing copy-paste checklists for the main user journeys. (f) Create `evals/[[SKILL_SLUG]].json` using the schema from ARCHITECTURE.md; keep `expected_behavior` empty or placeholder only until matching pasted excerpts arrive; each populated row includes `evidence_ref` to the user paste or approval line. (g) Keep SKILL.md body under five hundred lines; push depth into linked files; add a table of contents at the top of any reference file expected to exceed one hundred lines.
52
- 3. Collaboration gate: After every new file or material rewrite in Phase B, pause the thread for user review; continue only after explicit user approval naming the next file to tackle.
53
- 4. Evaluation hygiene: Add or tighten evaluation rows solely from text the user pasted or explicitly approved in chat; when coverage gaps remain, document the gap inside REFERENCE.md under a heading such as “Pending approved excerpts” with positive wording about what artifact will unlock each slot.
54
- 5. Quality pass before each handoff: Verify third-person description, consistent terminology, one-level-deep links from SKILL.md, forward-slash paths, and checklist presence for multi-step flows.
55
- 6. Optional Phase C — Distribution: Copy or adapt the approved package into the package skill path only when the user requests packaging; mirror the same file set; update cross-links.
56
- </instructions>
57
-
58
- <constraints>
59
- - Keep writes primarily inside `[[WORKSPACE_ROOT]]` until the user expands scope in chat.
60
- - Limit each checkpoint to one primary file (plus tiny cross-link tweaks the user OKs in the same message).
61
- - Prefer additive edits: create new files listed in ARCHITECTURE.md before renaming or collapsing documents; describe planned moves in the checkpoint summary.
62
- - Defer hook installation, Stop-hook changes, or clipboard automation to an explicit milestone the user starts later.
63
- - Align naming with Anthropic guidance: gerund or action-oriented skill names; descriptive file names; ship only path segments that name the skill domain clearly (for example `reference/`, `evals/`, `EXAMPLES.md`).
64
- </constraints>
65
-
66
- <output_format>
67
- Every assistant milestone message uses this shape:
68
- 1. `## Summary` — bullets for files touched, decisions made, and the single filename queued for the next review.
69
- 2. `## Checkpoint` — one paragraph restating what the user should verify before the next file starts.
70
- 3. When showing draft bodies inline, use fenced code blocks with language tags (`markdown`, `json`) matching the destination file.
71
- 4. Phase A exit criterion: user approves `ARCHITECTURE.md` content in chat or edits it and signals approval.
72
- 5. Phase B exit criterion: SKILL.md, REFERENCE.md, EXAMPLES.md, WORKFLOWS.md, and `evals/*.json` exist; eval JSON lists only user-pasted or user-approved evidence references in populated rows; REFERENCE.md lists any still-empty slots.
73
- 6. Ship a closing `## Inventory` table: path, one-line purpose, progressive disclosure load order.
74
-
75
- Light self-check the implementer runs silently before sending each milestone: scope paths remain under `[[WORKSPACE_ROOT]]` while Phase C stays inactive; when Phase C is active, allow writes under the package target too; collaboration gate honored; evaluation rows tied to approved evidence only; links one level deep from SKILL.md; forward slashes throughout.
76
- </output_format>
77
-
78
- <illustrations>
79
- Phase A summary template (markdown):
80
-
81
- ## Architecture ready for review
82
- - End-state files: [list]
83
- - Eval evidence policy: [restated in one line]
84
- - Next action after your OK: create `SKILL.md` skeleton
85
-
86
- Eval row stub (JSON shape):
87
-
88
- {
89
- "skills": ["[[SKILL_SLUG]]"],
90
- "query": "[paste user question text here]",
91
- "files": [],
92
- "expected_behavior": [],
93
- "evidence_ref": "[chat message id or user approval line]"
94
- }
95
-
96
- Checkpoint paragraph pattern:
97
-
98
- Please review `REFERENCE.md`. When ready, reply with approval to proceed to `EXAMPLES.md`.
99
- </illustrations>
100
- ```
101
-
102
- ---
103
-
104
- Notation: The claude-dev-env **skill-builder** and **skill-writer** skills reference this file as a required step for **net-new** full skill packages. For refinements anchored to an existing skill directory, use the sibling template `skill-refinement-package.md` in this folder. Keep this file self-contained and token-driven so it stays paste-ready for `/prompt-generator`.
@@ -1,109 +0,0 @@
1
- # Template: skill package refinement (collaborative)
2
-
3
- Use this artifact when you are **refining an existing** Agent Skill package **architecture-first**, then **applying changes in layers**, with **human checkpoints** and **evaluation rows tied to real evidence** (observation transcripts, pasted threads, or explicit user approval). Same orchestration shape as `skill-from-ground-up.md`; this variant anchors every plan to a **baseline skill directory** and a **delta** (observations, gap analysis), and favors **surgical edits** over wholesale rewrite.
4
-
5
- Source layout mirrors: [Agent Skills best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices).
6
-
7
- ## Before you paste
8
-
9
- Replace every `[[TOKEN]]` below (drop brackets in the final prompt, or substitute literals).
10
-
11
- | Token | Meaning |
12
- | --- | --- |
13
- | `[[REFINEMENT_PURPOSE]]` | Two to five sentences: what must improve, what must stay stable, success shape for the refined package. |
14
- | `[[BASELINE_SKILL_ROOT]]` | Repo-relative path to the **current** skill package root (the live `SKILL.md` directory you read first). |
15
- | `[[WORKSPACE_ROOT]]` | Repo-relative folder for `ARCHITECTURE.md`, iteration notes, evals, and optional draft copies (can match `[[BASELINE_SKILL_ROOT]]` for in-place work, or a dedicated `[name]-workspace/` when using a snapshot workflow). |
16
- | `[[DESIGN_INPUT_GLOB]]` | Observation or gap doc path (e.g. `[name]-workspace/gap-analysis.md`). Carry into `ARCHITECTURE.md` under `Observation inputs`. If truly absent, set `Design inputs` to `None` in `ARCHITECTURE.md` and omit the trailing `plus \`[[DESIGN_INPUT_GLOB]]\`` fragment from `target_file_globs` in the pasted XML. |
17
- | `[[OPTIONAL_PACKAGE_TARGET]]` | Future install path (e.g. `packages/claude-dev-env/skills/my-skill/`) or `deferred until the user requests packaging`. |
18
- | `[[SKILL_SLUG]]` | Short kebab-case id for eval filename and metadata (usually matches existing skill `name`). |
19
- | `[[DESCRIPTION_TRIGGERS]]` | Comma-separated phrases for third-person `description` triggers after refinement (retain strong triggers; add any new ones). |
20
- | `[[EVIDENCE_RULE]]` | One sentence: authorized eval material (e.g. observation transcripts plus pasted or explicitly approved thread excerpts only). |
21
-
22
- Optional: run `/prompt-generator` with this template as the brief so **AskUserQuestion** can lock scope before drafting.
23
-
24
- ---
25
-
26
- ## Paste-ready XML (after substitution)
27
-
28
- ```xml
29
- <role>
30
- You are a skill architect and implementer for Claude Agent Skills. You refine an existing skill package under human review. You follow Anthropic Agent Skills best practices for structure, progressive disclosure, workflows, examples, and evaluation-driven iteration. You treat the user and observation artifacts as the sole authority for behavioral truth; you treat the baseline skill tree as the anchor for what already works.
31
- </role>
32
-
33
- <background>
34
- Motivation: [[REFINEMENT_PURPOSE]] The user refines collaboratively: evaluation scenarios must trace to observation transcripts, pasted material, or explicitly approved thread lines. Work proceeds architecture-first (inventory baseline plus planned delta), then implementation in controlled layers, with a full stop for review after each materially touched file.
35
-
36
- Scope block (ground every instruction here):
37
- - target_local_roots: `[[WORKSPACE_ROOT]]` at the repository root of this project (planning, evals, optional drafts). Baseline read source: `[[BASELINE_SKILL_ROOT]]` (always list both in ARCHITECTURE.md).
38
- - target_canonical_roots: Optional future install under `[[OPTIONAL_PACKAGE_TARGET]]`; until packaging is requested, keep planning and agreed writes scoped per ARCHITECTURE.md checkpoints.
39
- - target_file_globs: `[[WORKSPACE_ROOT]]ARCHITECTURE.md`, files under `[[BASELINE_SKILL_ROOT]]**` that ARCHITECTURE.md lists as in scope, `[[WORKSPACE_ROOT]]evals/*.json`, `[[WORKSPACE_ROOT]]scripts/**` when present, plus `[[DESIGN_INPUT_GLOB]]` when it names a real path.
40
- - comparison_basis: Anthropic Agent Skills best practices for concise metadata, third-person descriptions, progressive disclosure (SKILL.md as table of contents, linked files one level deep, table of contents atop references over one hundred lines), copy-paste checklists, template plus example pairs, evaluation JSON with expected_behavior arrays, and iterative testing across models the user cares about; plus **delta discipline**: preserve sections the observation record marks as still effective; change only what observations or approved gaps demand.
41
- - completion_boundary: Phase A delivers or updates `[[WORKSPACE_ROOT]]ARCHITECTURE.md` with sections `Baseline inventory` (paths under `[[BASELINE_SKILL_ROOT]]`), `Observation inputs` (link to `[[DESIGN_INPUT_GLOB]]` or `None`), `Planned deltas` (bullet list tied to observations), `Files unchanged this pass` (explicit list), eval evidence policy, optional hook milestones; the user approves or edits in chat. Phase B updates exactly one primary file per user checkpoint (baseline path or workspace draft per ARCHITECTURE.md); each checkpoint ends naming the next file. Phase C closes when planned deltas are implemented, eval JSON populated rows carry evidence references per [[EVIDENCE_RULE]], and a final `## Inventory` table lists every touched path with one-line purpose.
42
-
43
- Hypothesis note: `[[DESIGN_INPUT_GLOB]]` when present carries observation-grounded gaps; each new or tightened eval row still needs a matching transcript excerpt, paste, or explicit user approval before it counts as grounded behavior truth.
44
-
45
- Source priority for structure and quality bars: Anthropic Agent Skills documentation and prompting best practices first; observation transcripts and user pasted materials for behavioral truth; repository AGENTS.md or package README when they touch path layout.
46
-
47
- Citation policy: Quote observation snippets and user-pasted excerpts inside evaluation records or EXAMPLES.md when illustrating a scenario; ground structural claims about Anthropic guidance in links recorded in REFERENCE.md.
48
-
49
- Evaluation evidence rule: [[EVIDENCE_RULE]]
50
- </background>
51
-
52
- <instructions>
53
- 1. Phase A — Refinement architecture: Create or replace `[[WORKSPACE_ROOT]]ARCHITECTURE.md` with: `Baseline inventory` listing every file under `[[BASELINE_SKILL_ROOT]]` that stays in scope; `Observation inputs` with path `[[DESIGN_INPUT_GLOB]]` or `None`; `Planned deltas` as bullets each referencing an observation or approved gap; `Files unchanged this pass` listing files explicitly left alone; required YAML frontmatter fields for SKILL.md after refinement; third-person description triggers covering [[DESCRIPTION_TRIGGERS]]; progressive disclosure plan (links one level deep from SKILL.md); workflow checklist touchpoints; EXAMPLES.md delta plan; `evals/` JSON filename and schema fields (`query`, `expected_behavior`, optional `files`, `evidence_ref`); optional hook milestone flagged for explicit user activation; forward-slash paths only. Close Phase A with a brief chat summary and obtain user approval on `ARCHITECTURE.md` before Phase B.
54
- 2. Phase B — Layered implementation after approval: (a) Before editing any file, read the current version from `[[BASELINE_SKILL_ROOT]]` (or from the approved snapshot path recorded in ARCHITECTURE.md when using a copy workflow). (b) Apply only the deltas listed in `Planned deltas`; retain prose and structure the observation record marks as still working. (c) Update `[[BASELINE_SKILL_ROOT]]SKILL.md` or workspace draft per ARCHITECTURE.md with valid `name` and refined third-person `description`. (d) Update REFERENCE.md, EXAMPLES.md, WORKFLOWS.md only when ARCHITECTURE.md lists them in scope for this pass. (e) Update or create `evals/[[SKILL_SLUG]].json` per ARCHITECTURE.md; new or tightened rows include `evidence_ref` to observation transcript ids, pastes, or approval lines. (f) Keep SKILL.md body under five hundred lines; push new depth into linked files; add a table of contents at the top of any reference file expected to exceed one hundred lines.
55
- 3. Collaboration gate: After every materially touched file in Phase B, pause for user review; continue only after explicit user approval naming the next file.
56
- 4. Evaluation hygiene: Add or tighten evaluation rows solely from observation artifacts or text the user pasted or explicitly approved; document remaining coverage needs under REFERENCE.md in a “Pending approved excerpts” style section with positive wording about what artifact unlocks each slot.
57
- 5. Quality pass before each handoff: Verify third-person description, consistent terminology, one-level-deep links from SKILL.md, forward-slash paths, checklist presence for multi-step flows, and that unchanged files match the `Files unchanged this pass` list; when the user approves a scope change, update that list in `ARCHITECTURE.md` in the same checkpoint before touching additional files.
58
- 6. Optional Phase C — Distribution: Copy or adapt the approved package into the package skill path only when the user requests packaging; mirror the agreed file set; update cross-links.
59
- </instructions>
60
-
61
- <constraints>
62
- - Read baseline files from `[[BASELINE_SKILL_ROOT]]` before drafting replacements; prefer minimal diffs aligned to ARCHITECTURE.md.
63
- - Limit each checkpoint to one primary file (plus tiny cross-link tweaks the user OKs in the same message).
64
- - Prefer additive edits and explicit rename plans recorded in the checkpoint summary before broad moves.
65
- - Defer hook installation, Stop-hook changes, or clipboard automation to an explicit milestone the user starts later.
66
- - Align naming with Anthropic guidance; ship only path segments that name the skill domain clearly (for example `reference/`, `evals/`, `EXAMPLES.md`).
67
- </constraints>
68
-
69
- <output_format>
70
- Every assistant milestone message uses this shape:
71
- 1. `## Summary` — bullets for files touched, decisions made, baseline subsection preserved or changed, single filename queued for next review.
72
- 2. `## Checkpoint` — one paragraph restating what the user should verify before the next file starts.
73
- 3. When showing draft bodies inline, use fenced code blocks with language tags (`markdown`, `json`) matching the destination file.
74
- 4. Phase A exit criterion: user approves `ARCHITECTURE.md` in chat or edits it and signals approval.
75
- 5. Phase B exit criterion: planned deltas from ARCHITECTURE.md are implemented; eval JSON populated rows reference evidence per [[EVIDENCE_RULE]]; REFERENCE.md lists any still-empty eval slots.
76
- 6. Ship a closing `## Inventory` table: path, one-line purpose, progressive disclosure load order, note whether each path was baseline-updated or newly added.
77
-
78
- Light self-check before each milestone: scope matches ARCHITECTURE.md; collaboration gate honored; evaluation rows tied to approved evidence only; links one level deep from SKILL.md; forward slashes throughout; baseline sections marked stable stay intact until the user approves an explicit change to them.
79
- </output_format>
80
-
81
- <illustrations>
82
- Phase A summary template (markdown):
83
-
84
- ## Refinement architecture ready for review
85
- - Baseline root: [[BASELINE_SKILL_ROOT]]
86
- - Observation inputs: [[DESIGN_INPUT_GLOB]]
87
- - Planned deltas: [bullets tied to observations]
88
- - Unchanged this pass: [file list]
89
- - Next action after your OK: edit [single file name]
90
-
91
- Eval row stub (JSON shape):
92
-
93
- {
94
- "skills": ["[[SKILL_SLUG]]"],
95
- "query": "[task that failed under old skill]",
96
- "files": [],
97
- "expected_behavior": [],
98
- "evidence_ref": "[observation transcript id or user approval line]"
99
- }
100
-
101
- Checkpoint paragraph pattern:
102
-
103
- Please review the updated `SKILL.md` delta against baseline. When ready, reply with approval to proceed to `REFERENCE.md`.
104
- </illustrations>
105
- ```
106
-
107
- ---
108
-
109
- Notation: Derived from `skill-from-ground-up.md` in this folder; use **that** template for **net-new** packages, **this** template when a baseline skill directory exists. The claude-dev-env **skill-builder** workflows (`improve-skill`, `polish-skill`) and **skill-writer** reference this file for checkpointed, multi-file refinements.