@prateek_ai/agents-maker 1.0.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/LICENSE +21 -0
- package/README.md +659 -0
- package/agents/architect_agent.md +175 -0
- package/agents/code_agent.md +178 -0
- package/agents/compression_agent.md +226 -0
- package/agents/execution_agent.md +157 -0
- package/agents/orchestrator.md +406 -0
- package/agents/reviewer_agent.md +134 -0
- package/agents/ui_agent.md +147 -0
- package/agents/ux_agent.md +144 -0
- package/bin/cli.js +79 -0
- package/config/agents.yaml +388 -0
- package/config/domain_profiles.yaml +394 -0
- package/config/project.yaml.example +16 -0
- package/config/token_policies.yaml +325 -0
- package/context_loaders/__init__.py +15 -0
- package/context_loaders/__pycache__/__init__.cpython-314.pyc +0 -0
- package/context_loaders/__pycache__/file_chunker.cpython-314.pyc +0 -0
- package/context_loaders/__pycache__/project_summary.cpython-314.pyc +0 -0
- package/context_loaders/__pycache__/repo_tree.cpython-314.pyc +0 -0
- package/context_loaders/file_chunker.py +252 -0
- package/context_loaders/project_summary.py +369 -0
- package/context_loaders/repo_tree.py +203 -0
- package/package.json +46 -0
- package/quickstart.ps1 +252 -0
- package/quickstart.sh +232 -0
- package/requirements.txt +3 -0
- package/skills/analyze_repo.md +86 -0
- package/skills/animated_website.md +285 -0
- package/skills/compare_approaches.md +86 -0
- package/skills/define_data_schema.md +99 -0
- package/skills/design_api.md +126 -0
- package/skills/improve_copy.md +69 -0
- package/skills/review_code.md +83 -0
- package/skills/review_layout.md +89 -0
- package/skills/suggest_next.md +105 -0
- package/skills/summarize_history.md +89 -0
- package/skills/write_process_map.md +105 -0
- package/skills/write_tests.md +97 -0
- package/token_optimization/__pycache__/compressor.cpython-314.pyc +0 -0
- package/token_optimization/compressor.py +502 -0
- package/token_optimization/output_styles.md +80 -0
- package/tools/__pycache__/domain_utils.cpython-314.pyc +0 -0
- package/tools/__pycache__/generate_claude_md.cpython-314.pyc +0 -0
- package/tools/__pycache__/validate_kit.cpython-314.pyc +0 -0
- package/tools/domain_utils.py +141 -0
- package/tools/generate_claude_md.py +269 -0
- package/tools/generate_platform_configs.py +467 -0
- package/tools/generate_prompt.py +461 -0
- package/tools/init_project.py +454 -0
- package/tools/test_kit.py +363 -0
- package/tools/validate_kit.py +504 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Skill: review_code
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Perform a structured code review of one or more file snippets. Return a severity-rated issue table covering correctness, security, performance, readability, and test coverage. Each finding includes file:line, issue description, and a concrete recommendation.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to invoke
|
|
10
|
+
|
|
11
|
+
- The Code Agent is asked to review or critique existing code.
|
|
12
|
+
- The Orchestrator routes a "review this PR" or "audit this file" request.
|
|
13
|
+
- A refactoring task requires a baseline assessment before changes.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Input expectations
|
|
18
|
+
|
|
19
|
+
| Input | Required | Description |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| `files` | Yes | One or more file snippets with paths |
|
|
22
|
+
| `review_focus` | No | One or more of: `security`, `performance`, `correctness`, `readability`, `test_coverage`, `all` (default: `all`) |
|
|
23
|
+
| `language` | No | Programming language (inferred from file extension if omitted) |
|
|
24
|
+
| `context` | No | Brief description of what the code does, to avoid false positives |
|
|
25
|
+
|
|
26
|
+
**If required input is missing:**
|
|
27
|
+
- `files` — ask: "Please paste the code files or snippets you want reviewed." Do not produce a review without actual code.
|
|
28
|
+
- `review_focus` — default to `all`; note this in the output summary line.
|
|
29
|
+
- `language` — infer from file extension or code syntax; if indeterminate, note "Language inferred as [X] — correct if wrong."
|
|
30
|
+
- `context` — proceed without it; note any assumptions made about the code's purpose in the Positive Findings section.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Output format
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
## Code Review: <file(s) reviewed>
|
|
38
|
+
|
|
39
|
+
**Summary**: N critical, N high, N medium, N low, N info
|
|
40
|
+
|
|
41
|
+
| Severity | File:Line | Category | Issue | Recommendation |
|
|
42
|
+
|---|---|---|---|---|
|
|
43
|
+
| critical | auth.py:47 | security | SQL query built via string concat | Use parameterized queries |
|
|
44
|
+
| high | user_service.py:112 | correctness | `get_user()` returns None without handling | Add None check or raise a typed exception |
|
|
45
|
+
| medium | utils.py:23 | performance | List comprehension inside tight loop | Pre-compute outside the loop |
|
|
46
|
+
| low | models.py:8 | readability | Variable name `d` is ambiguous | Rename to `user_data` |
|
|
47
|
+
| info | api.py:55 | test_coverage | No test covers the 404 path | Add a test case for missing resource |
|
|
48
|
+
|
|
49
|
+
## Positive Findings
|
|
50
|
+
- <bullet: what is done well — not just issues>
|
|
51
|
+
|
|
52
|
+
## Out of scope
|
|
53
|
+
- <bullet: anything noticed but not within the requested review_focus>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Severity definitions
|
|
59
|
+
|
|
60
|
+
| Severity | Meaning |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `critical` | Bug, security vulnerability, or data corruption risk in production |
|
|
63
|
+
| `high` | Likely to cause incorrect behavior under normal conditions |
|
|
64
|
+
| `medium` | Degraded performance, poor error handling, or maintainability risk |
|
|
65
|
+
| `low` | Style, naming, or minor readability issue |
|
|
66
|
+
| `info` | Observation or suggestion; no action required |
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Token cost tier
|
|
71
|
+
|
|
72
|
+
**Medium.** Scales with number of files. Typical output per 100-line file: 200–400 tokens.
|
|
73
|
+
|
|
74
|
+
Compression hint: for large codebases, filter to `review_focus: security` or `review_focus: correctness` to reduce output. Ask the requester which categories matter most.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Notes
|
|
79
|
+
|
|
80
|
+
- Always include at least one "Positive Findings" item. Reviews with no positive findings tend to be ignored.
|
|
81
|
+
- `[SECURITY]` findings must be present in the table even if `review_focus` does not include security — security is never optional.
|
|
82
|
+
- Do not flag style issues as `high` or `critical`. Enforce severity discipline.
|
|
83
|
+
- If a file has no issues, return: "No findings for `<file>` at the requested severity level."
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Skill: review_layout
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Critique the visual hierarchy, spacing, responsive behavior, and accessibility of a UI layout. Input can be a component tree, file snippet, or plain-text screen description. Output is a structured table of findings with severity and specific recommendations.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to invoke
|
|
10
|
+
|
|
11
|
+
- The UI Agent needs a baseline assessment before making layout recommendations.
|
|
12
|
+
- The UX Agent identifies a layout-level problem (not a flow problem) and defers it.
|
|
13
|
+
- A design review specifically calls out visual or accessibility issues.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Input expectations
|
|
18
|
+
|
|
19
|
+
| Input | Required | Description |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| `screen_description` | Yes | Component tree, file snippet, or plain-text description of the layout |
|
|
22
|
+
| `framework` | No | `React` \| `Vue` \| `HTML/CSS` \| `Svelte` \| `other` |
|
|
23
|
+
| `target_devices` | No | `desktop` \| `mobile` \| `both` (default: `both`) |
|
|
24
|
+
| `accessibility_level` | No | `A` \| `AA` \| `AAA` \| `none` (default: `AA`) |
|
|
25
|
+
| `existing_tokens` | No | Design token values in scope (colors, spacing scale) |
|
|
26
|
+
|
|
27
|
+
**If required input is missing:**
|
|
28
|
+
- `screen_description` — ask: "Please paste a component tree, file snippet, or describe the layout you want reviewed." Do not produce findings without it.
|
|
29
|
+
- `framework` — infer from component syntax (JSX → React, SFC → Vue, `.svelte` → Svelte); if indeterminate, note "Framework assumed: [X] — correct if wrong."
|
|
30
|
+
- `target_devices` — default to `both`.
|
|
31
|
+
- `accessibility_level` — default to `AA`.
|
|
32
|
+
- `existing_tokens` — proceed without; note that token-specific recommendations (e.g., "use spacing-4") cannot be made and generic values will be suggested instead.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Output format
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
## Layout Review: <screen/component name>
|
|
40
|
+
|
|
41
|
+
**Summary**: N critical, N high, N medium, N low
|
|
42
|
+
|
|
43
|
+
### Visual Hierarchy
|
|
44
|
+
|
|
45
|
+
| Severity | Element | Issue | Recommendation |
|
|
46
|
+
|---|---|---|---|
|
|
47
|
+
| high | Page title | Same font size as body text | Increase to heading level; use h1 |
|
|
48
|
+
| medium | CTA button | Low contrast against background | Use primary brand color |
|
|
49
|
+
|
|
50
|
+
### Spacing
|
|
51
|
+
|
|
52
|
+
| Severity | Element | Issue | Recommendation |
|
|
53
|
+
|---|---|---|---|
|
|
54
|
+
| medium | Card grid | Inconsistent gap (12px and 16px mixed) | Standardize to spacing-4 (16px) |
|
|
55
|
+
|
|
56
|
+
### Responsive Behavior
|
|
57
|
+
|
|
58
|
+
| Severity | Breakpoint | Issue | Recommendation |
|
|
59
|
+
|---|---|---|---|
|
|
60
|
+
| high | Mobile (<768px) | Table overflows viewport | Use horizontal scroll or card layout |
|
|
61
|
+
|
|
62
|
+
### Accessibility
|
|
63
|
+
|
|
64
|
+
| Severity | Element | WCAG criterion | Issue | Fix |
|
|
65
|
+
|---|---|---|---|---|
|
|
66
|
+
| critical | Icon button | 1.1.1 Non-text content | No aria-label | Add `aria-label="<action>"` |
|
|
67
|
+
| high | Link color | 1.4.3 Contrast | 2.8:1 ratio (AA requires 4.5:1) | Darken link color |
|
|
68
|
+
|
|
69
|
+
### Positive Findings
|
|
70
|
+
- <bullet>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Omit sections with no findings.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Token cost tier
|
|
78
|
+
|
|
79
|
+
**Low.** Typical output: 200–400 tokens. Does not require reading large file trees.
|
|
80
|
+
|
|
81
|
+
Compression hint: if scoped to a single component, this skill is already token-light. No further compression needed.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Notes
|
|
86
|
+
|
|
87
|
+
- WCAG criterion references should use the format `N.N.N Title`.
|
|
88
|
+
- Do not flag every spacing inconsistency as `high`. Reserve `high` for issues that visually break the layout or prevent task completion.
|
|
89
|
+
- If the input is text-only (no actual CSS/tokens), note: "Review based on description only — actual values may differ."
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Skill: Suggest Next Steps
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
After completing any deliverable — an approved artifact, an approved increment, or any answer to a
|
|
6
|
+
user question — surface three concrete, prioritized next moves so the user always knows what to do
|
|
7
|
+
without having to think about it.
|
|
8
|
+
|
|
9
|
+
This skill fires **automatically** at the end of every response when Companion Mode is active.
|
|
10
|
+
It may also be invoked on demand: "what should I do next?" / "what's next?" / "options?"
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Trigger Conditions
|
|
15
|
+
|
|
16
|
+
- After every approved phase artifact (`task_profile`, `requirements_spec`, `solution_design`,
|
|
17
|
+
`work_product`, `refinement_report`, `handoff_package`)
|
|
18
|
+
- After every approved implementation increment in the `build_log`
|
|
19
|
+
- When the user explicitly asks about next steps
|
|
20
|
+
- When the user selects option A/B/C at an approval gate and you need to confirm what follows
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Input Expectations
|
|
25
|
+
|
|
26
|
+
This skill fires automatically — it does not require explicit user input. It reads from the active session context:
|
|
27
|
+
|
|
28
|
+
| Input | Source | Description |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| `current_phase` | `project_state.md` or context | Lifecycle phase just completed or currently active |
|
|
31
|
+
| `current_domain` | Detected or stated in session | Domain key (software, content, research, etc.) |
|
|
32
|
+
| `last_artifact` | Just produced in this response | The deliverable, approved increment, or answered question |
|
|
33
|
+
| `open_decisions` | `project_state.md` | Any unresolved questions or deferred choices |
|
|
34
|
+
| `project_constraints` | `project.yaml` or stated constraints | Hard limits that options must not violate |
|
|
35
|
+
|
|
36
|
+
**If context is missing:**
|
|
37
|
+
- `current_phase` — if unclear (e.g., session just started), surface 3 clarifying questions instead of next-step options.
|
|
38
|
+
- `last_artifact` — if no artifact was just produced, use the most recent approved item from the conversation.
|
|
39
|
+
- `open_decisions` — if none recorded, infer likely next steps from the current phase alone.
|
|
40
|
+
- `project_constraints` — if none known, options may be generic; note this and suggest running `init_project.py` to load project context.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Output Format
|
|
45
|
+
|
|
46
|
+
Append this block at the end of the response, after the main artifact or answer:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
---
|
|
50
|
+
**What to do next** (pick one):
|
|
51
|
+
|
|
52
|
+
**[Recommended] A: <specific, action-verb name>**
|
|
53
|
+
Why: <one sentence — must connect to the project's current state, known constraint, or open risk>
|
|
54
|
+
Effort: <~N mins | ~N hours | ~1 session | ~N sessions>
|
|
55
|
+
Token cost: <low | medium | high>
|
|
56
|
+
Command: `python agents-maker/tools/generate_prompt.py "<A description verbatim>"`
|
|
57
|
+
|
|
58
|
+
**B: <specific, action-verb name>**
|
|
59
|
+
Why: <one sentence>
|
|
60
|
+
Effort: <estimate> | Token cost: <low | medium | high>
|
|
61
|
+
|
|
62
|
+
**C: <specific, action-verb name>**
|
|
63
|
+
Why: <one sentence>
|
|
64
|
+
Effort: <estimate> | Token cost: <low | medium | high>
|
|
65
|
+
|
|
66
|
+
_Not what you need? Describe your actual next step and the Orchestrator will re-plan._
|
|
67
|
+
---
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Token Cost Key
|
|
73
|
+
|
|
74
|
+
| Level | Meaning |
|
|
75
|
+
|---|---|
|
|
76
|
+
| low | Conversation only — no files needed; very short context |
|
|
77
|
+
| medium | 3–5 source files needed; normal session size |
|
|
78
|
+
| high | Full repo scan or large diff needed; use `project_summary.py` first |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Ranking Rules
|
|
83
|
+
|
|
84
|
+
**Option A — Recommended** must be:
|
|
85
|
+
- The highest-impact move given the current phase and project state
|
|
86
|
+
- The lowest-risk choice (reversible, testable, doesn't lock future decisions)
|
|
87
|
+
- Directly executable in the next session
|
|
88
|
+
|
|
89
|
+
**Option B** — A valid alternative with a different priority axis (e.g., speed vs. quality,
|
|
90
|
+
breadth vs. depth, technical vs. documentation).
|
|
91
|
+
|
|
92
|
+
**Option C** — A "don't ignore this later" option: something with lower immediate urgency but
|
|
93
|
+
higher future cost if deferred (e.g., a growing tech debt item, an untested path, a doc gap).
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Rules
|
|
98
|
+
|
|
99
|
+
- Never suggest an option that contradicts an already-approved artifact or ADR.
|
|
100
|
+
- Options must be specific to this project — not generic advice.
|
|
101
|
+
- If the current phase is unclear (e.g., session just started), surface 3 clarifying questions
|
|
102
|
+
instead of next-step options.
|
|
103
|
+
- The `Command:` field on Option A always uses the exact phrasing a user can copy-paste.
|
|
104
|
+
- If the project has `key_constraints` in `project.yaml`, check each option against them.
|
|
105
|
+
- Never repeat an option that was just completed in this session.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Skill: summarize_history
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Compress a multi-turn conversation history into a structured state block that preserves everything critical (requirements, decisions, constraints, open questions) while discarding redundant exchanges, repeated context, and resolved sub-questions. Used by the Compression Agent to reduce context size before sending to any specialist.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to invoke
|
|
10
|
+
|
|
11
|
+
- Conversation history exceeds `history_summarize_after_turns` from the active token policy.
|
|
12
|
+
- Total context token count exceeds `max_input_tokens` × 0.75.
|
|
13
|
+
- The user requests "summarize our session so far" or "reset context but keep decisions."
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Input expectations
|
|
18
|
+
|
|
19
|
+
| Input | Required | Description |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| `history` | Yes | Full conversation history (list of turns) |
|
|
22
|
+
| `active_query` | Yes | The user's current or next question — determines what is most relevant to keep |
|
|
23
|
+
| `never_drop` | No | Explicit list of items the user marked as critical |
|
|
24
|
+
|
|
25
|
+
**If required input is missing:**
|
|
26
|
+
- `history` — this skill cannot proceed without conversation history. If no history is available, return: "No history to compress — this appears to be a fresh session. Proceed with the active query directly." Do not fabricate history.
|
|
27
|
+
- `active_query` — infer from the most recent user message in the history; note the inference explicitly in the output.
|
|
28
|
+
- `never_drop` — proceed without; apply the standard "What must never be dropped" rules defined below.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Output format
|
|
33
|
+
|
|
34
|
+
The skill produces a **Conversation State** block:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
## Conversation State
|
|
38
|
+
|
|
39
|
+
**Session goal**: <one sentence: what the user is trying to accomplish overall>
|
|
40
|
+
|
|
41
|
+
**Completed subtasks**:
|
|
42
|
+
- <subtask> → <outcome>
|
|
43
|
+
- <subtask> → <outcome>
|
|
44
|
+
|
|
45
|
+
**Active constraints**:
|
|
46
|
+
- Language: <e.g., Python 3.11, no new dependencies>
|
|
47
|
+
- Must not change: <API surface, DB schema, etc.>
|
|
48
|
+
- Must reuse: <existing utilities, patterns>
|
|
49
|
+
- Other: <any hard constraint stated by the user>
|
|
50
|
+
|
|
51
|
+
**Key decisions made**:
|
|
52
|
+
- <decision> (turn N)
|
|
53
|
+
- <decision> (turn N)
|
|
54
|
+
|
|
55
|
+
**Open questions**:
|
|
56
|
+
- <question> — <who needs to answer: user | architect | code | unresolved>
|
|
57
|
+
|
|
58
|
+
**Last action**: <what was produced or agreed in the most recent turn>
|
|
59
|
+
|
|
60
|
+
**Next action**: <what the user or agent was about to do>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## What must never be dropped
|
|
66
|
+
|
|
67
|
+
Regardless of age or apparent redundancy:
|
|
68
|
+
|
|
69
|
+
- Any requirement prefixed with "must", "never", "always", "required", "constraint".
|
|
70
|
+
- Any confirmed architectural decision.
|
|
71
|
+
- Any security finding flagged `[SECURITY]`.
|
|
72
|
+
- Any item the user marked "remember this" or "keep this in mind."
|
|
73
|
+
- The user's most recent message (always retained verbatim in the context block).
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Token cost tier
|
|
78
|
+
|
|
79
|
+
**Low.** The skill itself is lightweight. Input (history) can be large; output (state block) is always compact: 150–350 tokens.
|
|
80
|
+
|
|
81
|
+
Compression hint: this skill is the primary mechanism for token reduction. Invoke it before other compression steps — it usually provides the largest reduction.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Notes
|
|
86
|
+
|
|
87
|
+
- The state block is a **lossy** compression. Make the loss explicit: always include a "Not captured" line if anything material was omitted for brevity.
|
|
88
|
+
- Do not fabricate decisions. If a decision was discussed but not confirmed, list it under "Open questions" as "Under discussion: <topic>."
|
|
89
|
+
- Turn references (e.g., "turn N") help the user verify accuracy without replaying the full history. Include them for key decisions.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Skill: write_process_map
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Document a business or operational process as a structured, executable artifact: numbered step table, RACI matrix, and exception-handling table. Used by the Execution Agent in `ops_process` tasks (Phase 3) and the Architect Agent when designing workflows for any domain.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to invoke
|
|
10
|
+
|
|
11
|
+
- User requests an SOP, runbook, procedure, workflow, or process documentation.
|
|
12
|
+
- Architect Agent needs to specify an operational process as part of a solution design.
|
|
13
|
+
- Review phase identifies a process that lacks owner assignments or exception paths.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Input expectations
|
|
18
|
+
|
|
19
|
+
| Input | Required | Description |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| `process_name` | Yes | Name of the process (e.g., "Incident Response", "Customer Onboarding") |
|
|
22
|
+
| `actors` | Yes | List of roles involved (e.g., `["On-call Engineer", "Team Lead", "Customer"]`) |
|
|
23
|
+
| `trigger` | Yes | What initiates this process (e.g., alert fired, form submitted, scheduled) |
|
|
24
|
+
| `steps` | Yes | Ordered list of steps. Each step: `{action, actor, tool_or_system, output}` |
|
|
25
|
+
| `exception_paths` | No | List of known failure conditions and their recovery steps |
|
|
26
|
+
| `goal` | No | One-sentence description of the successful outcome |
|
|
27
|
+
| `sla` | No | Time constraints (e.g., "acknowledge within 15 min, resolve within 4h") |
|
|
28
|
+
|
|
29
|
+
**If required input is missing:**
|
|
30
|
+
- `process_name` — ask: "What is this process called? (e.g., 'Weekly Deploy', 'Customer Escalation')"
|
|
31
|
+
- `actors` — ask: "Who are the roles involved? List each as a job title or system name."
|
|
32
|
+
- `trigger` — ask: "What starts this process? (e.g., an alert, a request, a scheduled event)"
|
|
33
|
+
- `steps` — ask: "Walk me through the steps. For each, tell me: who does what, using which tool, and what is the output?"
|
|
34
|
+
- `exception_paths` — default to "None documented" and note the gap in the output.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Output format
|
|
39
|
+
|
|
40
|
+
### 1. Process Overview
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
## Process: <process_name>
|
|
44
|
+
**Trigger**: <trigger>
|
|
45
|
+
**Goal**: <goal or "not specified">
|
|
46
|
+
**SLA**: <sla or "not specified">
|
|
47
|
+
**Actors**: <comma-separated list>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 2. Step Table
|
|
51
|
+
|
|
52
|
+
```markdown
|
|
53
|
+
## Process Steps
|
|
54
|
+
|
|
55
|
+
| # | Step | Actor | Tool / System | Output |
|
|
56
|
+
|---|---|---|---|---|
|
|
57
|
+
| 1 | <action> | <actor> | <tool> | <output> |
|
|
58
|
+
| 2 | ... | ... | ... | ... |
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 3. RACI Matrix
|
|
62
|
+
|
|
63
|
+
```markdown
|
|
64
|
+
## RACI Matrix
|
|
65
|
+
|
|
66
|
+
| Step | <Actor 1> | <Actor 2> | <Actor N> |
|
|
67
|
+
|---|---|---|---|
|
|
68
|
+
| 1 — <step name> | R | A | I |
|
|
69
|
+
| 2 — <step name> | C | R | — |
|
|
70
|
+
|
|
71
|
+
Legend: R = Responsible, A = Accountable, C = Consulted, I = Informed, — = Not involved
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Each step must have exactly one **A** (Accountable). If no accountable role is clear, flag it: `[A: unassigned — confirm ownership]`.
|
|
75
|
+
|
|
76
|
+
### 4. Exception-Handling Table
|
|
77
|
+
|
|
78
|
+
```markdown
|
|
79
|
+
## Exception Paths
|
|
80
|
+
|
|
81
|
+
| Condition | Detected at step | Recovery action | Owner |
|
|
82
|
+
|---|---|---|---|
|
|
83
|
+
| <failure condition> | <step #> | <what to do> | <role> |
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
If no exception paths were provided, output:
|
|
87
|
+
```
|
|
88
|
+
## Exception Paths
|
|
89
|
+
No exception paths documented. Recommended: add paths for the 2–3 most likely failure conditions.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Token cost tier
|
|
95
|
+
|
|
96
|
+
**Low.** Pure document generation from structured inputs. Typical output: 200–500 tokens.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Notes
|
|
101
|
+
|
|
102
|
+
- Validate that every step has an actor. If a step has no actor, flag it: `[Actor: unassigned]`.
|
|
103
|
+
- RACI matrix rows correspond 1:1 to the steps in the step table.
|
|
104
|
+
- If `actors` contains systems (not people), assign them R only, never A.
|
|
105
|
+
- For processes with more than 20 steps, suggest splitting into sub-processes at natural phase boundaries.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Skill: write_tests
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Generate unit and integration test stubs for a given function, class, or endpoint. Tests follow the project's existing fixture patterns, assertion style, and test framework. Output is ready-to-run test code with one-line explanations per test case.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to invoke
|
|
10
|
+
|
|
11
|
+
- The Code Agent is asked to add or improve test coverage.
|
|
12
|
+
- A new function or endpoint has been implemented and needs tests.
|
|
13
|
+
- A bug fix needs a regression test to prevent recurrence.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Input expectations
|
|
18
|
+
|
|
19
|
+
| Input | Required | Description |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| `target_code` | Yes | The function, class, or endpoint to test |
|
|
22
|
+
| `test_type` | Yes | `unit` \| `integration` \| `both` |
|
|
23
|
+
| `existing_tests` | No | A representative existing test file to extract fixture and assertion patterns |
|
|
24
|
+
| `test_framework` | No | `pytest` \| `unittest` \| `jest` \| `vitest` \| `go test` \| other (inferred from existing_tests) |
|
|
25
|
+
| `fixtures_available` | No | List of fixture names available in the project |
|
|
26
|
+
| `coverage_targets` | No | Specific paths/branches to target (default: happy path + top 3 error cases) |
|
|
27
|
+
|
|
28
|
+
**If required input is missing:**
|
|
29
|
+
- `target_code` absent → ask: "Please paste the function, class, or endpoint you want tests for."
|
|
30
|
+
- `test_type` absent → default to `unit`; state this assumption in the output header.
|
|
31
|
+
- `existing_tests` absent and `test_framework` absent → infer framework from the project stack in `project.yaml` (e.g., Python → pytest, JS → jest). State the inferred framework explicitly. If stack is unknown, default to pytest and note it.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Output format
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
# tests/test_<module>.py
|
|
39
|
+
|
|
40
|
+
import pytest
|
|
41
|
+
# (other imports matching project conventions)
|
|
42
|
+
|
|
43
|
+
# --- Fixtures (only if new fixtures are needed) ---
|
|
44
|
+
|
|
45
|
+
@pytest.fixture
|
|
46
|
+
def <fixture_name>():
|
|
47
|
+
# <one-line: what this fixture provides>
|
|
48
|
+
...
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# --- Test cases ---
|
|
52
|
+
|
|
53
|
+
def test_<function>_<scenario>():
|
|
54
|
+
# Happy path: <what is being verified>
|
|
55
|
+
...
|
|
56
|
+
|
|
57
|
+
def test_<function>_<error_scenario>():
|
|
58
|
+
# Error case: <what condition triggers this>
|
|
59
|
+
...
|
|
60
|
+
|
|
61
|
+
def test_<function>_<edge_case>():
|
|
62
|
+
# Edge case: <what boundary is being tested>
|
|
63
|
+
...
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
After the code block, append a coverage summary:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
## Coverage Summary
|
|
70
|
+
|
|
71
|
+
| Test case | Type | What it verifies |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `test_create_user_success` | unit | Returns 201 and user ID on valid input |
|
|
74
|
+
| `test_create_user_duplicate_email` | unit | Returns 409 when email already exists |
|
|
75
|
+
| `test_create_user_invalid_payload` | unit | Returns 400 with field-level errors |
|
|
76
|
+
|
|
77
|
+
## Not covered (out of scope or requires additional fixtures)
|
|
78
|
+
- Database rollback behavior on concurrent inserts
|
|
79
|
+
- Token expiry edge case (requires time-mocking fixture)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Token cost tier
|
|
85
|
+
|
|
86
|
+
**Medium.** Scales with number of test cases. Typical output: 300–600 tokens per function under test.
|
|
87
|
+
|
|
88
|
+
Compression hint: request `test_type: unit` and `coverage_targets: happy_path_only` for a minimal first pass. Integration tests can be added in a follow-up turn.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Notes
|
|
93
|
+
|
|
94
|
+
- **Never use `time.sleep()` in tests.** If time-dependent behavior must be tested, note it in "Not covered" and suggest the appropriate mocking approach.
|
|
95
|
+
- **Do not generate tests for third-party libraries** — test only the project's own logic.
|
|
96
|
+
- **Match existing patterns exactly**: if the project uses `assert response.status_code == 200` (not `assertEqual`), follow that style throughout.
|
|
97
|
+
- **Regression tests**: if invoked after a bug fix, prefix the test name with `test_regression_` and include a comment: `# Regression: <short description of the bug>`.
|
|
Binary file
|