@sallmarta/eye-hate-agent 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/.agents/rules/agent.md +66 -0
- package/.claude/commands/eha/README.md +3 -0
- package/.claude/commands/eha/eha-bootstrap.md +9 -0
- package/.claude/commands/eha/eha-discuss.md +9 -0
- package/.claude/commands/eha/eha-execute.md +9 -0
- package/.claude/commands/eha/eha-parity.md +9 -0
- package/.claude/commands/eha/eha-refresh.md +9 -0
- package/.claude/commands/eha/eha-verify.md +9 -0
- package/.claude/rules/agent-rules.md +64 -0
- package/.github/instructions/agent-rules.instructions.md +63 -0
- package/.github/instructions/eha-workflows.instructions.md +21 -0
- package/LICENSE +21 -0
- package/README.md +337 -0
- package/bin/eha.js +163 -0
- package/docs/eyehateagent-contract.md +475 -0
- package/docs/eyehateagent-maintenance.md +103 -0
- package/docs/project-docs/changelog.md +287 -0
- package/docs/project-docs/foundation/architecture.md +117 -0
- package/docs/project-docs/foundation/status.md +32 -0
- package/docs/project-docs/foundation/workflow.md +63 -0
- package/docs/project-docs/index.md +20 -0
- package/docs/project-docs/testing.md +73 -0
- package/docs/vibes/project-docs-template/foundation/architecture.md +79 -0
- package/docs/vibes/project-docs-template/foundation/changelog.md +53 -0
- package/docs/vibes/project-docs-template/foundation/feature-inventory.md +46 -0
- package/docs/vibes/project-docs-template/foundation/phases.md +60 -0
- package/docs/vibes/project-docs-template/foundation/prd.md +69 -0
- package/docs/vibes/project-docs-template/foundation/status.md +57 -0
- package/docs/vibes/project-docs-template/foundation/workflow.md +59 -0
- package/docs/vibes/project-docs-template/getting-started.md +52 -0
- package/docs/vibes/project-docs-template/index.md +66 -0
- package/docs/vibes/project-docs-template/operations/ci-cd.md +56 -0
- package/docs/vibes/project-docs-template/operations/compliance.md +46 -0
- package/docs/vibes/project-docs-template/operations/governance.md +46 -0
- package/docs/vibes/project-docs-template/operations/observability.md +53 -0
- package/docs/vibes/project-docs-template/operations/production-runbook.md +62 -0
- package/docs/vibes/project-docs-template/operations/security.md +49 -0
- package/docs/vibes/project-docs-template/technical/api-contract.md +49 -0
- package/docs/vibes/project-docs-template/technical/database.md +59 -0
- package/docs/vibes/project-docs-template/technical/error-handling.md +54 -0
- package/docs/vibes/project-docs-template/technical/internationalization.md +46 -0
- package/docs/vibes/project-docs-template/technical/testing.md +57 -0
- package/docs/vibes/project-docs-template/technical/ui-ux.md +68 -0
- package/docs/vibes/project-docs-template/technical-guidelines/index.md +52 -0
- package/docs/vibes/reusable-prompts/00-project-docs-bootstrap.md +59 -0
- package/docs/vibes/reusable-prompts/00-project-docs-parity.md +88 -0
- package/docs/vibes/reusable-prompts/00-project-docs-refresh.md +81 -0
- package/docs/vibes/reusable-prompts/01-sdd-execute.md +34 -0
- package/docs/vibes/reusable-prompts/02-sdd-discuss.md +27 -0
- package/docs/vibes/skills/analysis/SKILL.md +173 -0
- package/docs/vibes/skills/api-design/SKILL.md +199 -0
- package/docs/vibes/skills/code-audit/SKILL.md +170 -0
- package/docs/vibes/skills/full-verification/SKILL.md +173 -0
- package/docs/vibes/skills/parity/SKILL.md +158 -0
- package/docs/vibes/skills/project-elevation/SKILL.md +157 -0
- package/docs/vibes/skills/test-authoring/SKILL.md +201 -0
- package/docs/vibes/skills/test-authoring/references/patterns.md +116 -0
- package/docs/vibes/skills/test-authoring/references/test-types.md +52 -0
- package/package.json +53 -0
- package/src/engine/index.js +22 -0
- package/src/engine/install.js +222 -0
- package/src/engine/runtime-adapters.js +106 -0
- package/src/engine/state.js +109 -0
- package/src/engine/workflow-registry.js +75 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Project Docs Parity Reusable Prompt
|
|
2
|
+
|
|
3
|
+
Read `docs/eyehateagent-contract.md` first.
|
|
4
|
+
|
|
5
|
+
Audit the repository for **documentation-system drift**.
|
|
6
|
+
|
|
7
|
+
## Goal
|
|
8
|
+
|
|
9
|
+
Find mismatches where project docs, platform instruction surfaces (mirrored rule files), skills, reusable prompts, workflow docs, quick-reference material, or relevant implementation evidence disagree about the same fact.
|
|
10
|
+
|
|
11
|
+
## Scope
|
|
12
|
+
|
|
13
|
+
Check at least these areas when present:
|
|
14
|
+
|
|
15
|
+
- `docs/project-docs/`
|
|
16
|
+
- `docs/project-docs/index.md`
|
|
17
|
+
- `docs/project-docs/technical-guidelines/`
|
|
18
|
+
- relevant code, tests, configs, or runtime-facing artifacts when a finding depends on current implementation behavior or source-of-truth ownership
|
|
19
|
+
- clearly named reference or archive folders such as `docs-legacy/`, `docs-old/`, `archive/`, or `reference/`
|
|
20
|
+
- platform instruction surfaces (mirrored rule files)
|
|
21
|
+
- `docs/vibes/skills/`
|
|
22
|
+
- `docs/vibes/reusable-prompts/`
|
|
23
|
+
- workflow docs and handoff docs
|
|
24
|
+
|
|
25
|
+
### High-Value Drift Categories
|
|
26
|
+
|
|
27
|
+
- stack and dependency choices
|
|
28
|
+
- test commands and quality gates
|
|
29
|
+
- architecture and dependency rules
|
|
30
|
+
- optional and conditional regular-doc inventory mismatches
|
|
31
|
+
- API / integration ownership
|
|
32
|
+
- technical guideline ownership, overlap, and missing guideline index coverage
|
|
33
|
+
- semantic legacy-to-owner mapping mismatches where content is relevant but naming differs
|
|
34
|
+
- code-vs-doc authority mismatches where current implementation and active docs disagree
|
|
35
|
+
- workflow expectations
|
|
36
|
+
- roadmap / phase naming
|
|
37
|
+
- project identity and naming
|
|
38
|
+
- undocumented domain knowledge embedded in the codebase (e.g., decision rationale in comments, architectural constraints in configs, domain rules in validation logic) that should be surfaced into project docs
|
|
39
|
+
|
|
40
|
+
## Required Behavior
|
|
41
|
+
|
|
42
|
+
1. Use project docs as the primary source of truth for documentation ownership and doc-to-doc drift unless the repository explicitly states otherwise.
|
|
43
|
+
2. Treat `docs/eyehateagent-contract.md` as the ownership map.
|
|
44
|
+
3. Treat `docs/project-docs/index.md` and `docs/project-docs/technical-guidelines/index.md` as the authoritative inventories for optional regular docs and guideline docs when present.
|
|
45
|
+
4. Treat clearly named reference or archive folders such as `docs-legacy/`, `docs-old/`, `archive/`, or `reference/` as migration input only, not as owner-doc paths.
|
|
46
|
+
5. When evaluating legacy material, classify it by the durable concern it governs rather than by its legacy name or path. Treat names such as `epic`, `milestone`, `roadmap`, `protocol`, `procedure`, `policy`, or `standard` as hints only.
|
|
47
|
+
6. Report likely mappings when content points to an active owner even if naming differs, such as phased-planning content that should map to `foundation/phases/` or technical-rule content that should map to `technical-guidelines/`.
|
|
48
|
+
7. Distinguish between:
|
|
49
|
+
- true contradiction
|
|
50
|
+
- stale summary
|
|
51
|
+
- historical artifact
|
|
52
|
+
- optional module not currently active
|
|
53
|
+
8. When a repo is migrating from another documentation format, use those reference folders to map legacy topics into the correct owner docs under `docs/project-docs/`.
|
|
54
|
+
9. Treat a missing `docs/project-docs/index.md` as drift when optional or conditional regular docs exist beyond the always-required core set.
|
|
55
|
+
10. Treat a missing `technical-guidelines/index.md` as drift when guideline files exist.
|
|
56
|
+
11. Treat registry entries without matching files and files without matching registry entries as drift unless the registry explicitly marks them deprecated or archived.
|
|
57
|
+
12. Treat a missing recommended guideline as drift only when the repo already claims that domain is covered or the repo claims to be fully documented for that domain.
|
|
58
|
+
13. When a finding depends on whether the implementation or the documentation is authoritative, inspect the relevant code, tests, configs, or runtime-facing artifacts before classifying the issue.
|
|
59
|
+
14. If code and documentation conflict and the repository does not explicitly declare which source is authoritative for that fact, do not assume. Report the conflict and ask the user for direction before recommending a fix path.
|
|
60
|
+
15. If a legacy artifact could plausibly map to more than one active owner, or if preserving the legacy label may be intentional, ask the user for direction instead of silently classifying it.
|
|
61
|
+
16. When asking for that direction, prefer a concise question that names the fact in conflict and the likely choices. Example: `I found a conflict between the code and the docs for the active API behavior. Should I treat 1. the code as correct and update the docs, 2. the docs as correct and treat the code as drift, or 3. mark this as an intentional temporary mismatch?`
|
|
62
|
+
17. If strong repository evidence already establishes the authority order for that fact, state that evidence explicitly instead of asking.
|
|
63
|
+
18. Treat missing code evidence the same as missing doc evidence: reduce confidence, state the limitation, and avoid guessing.
|
|
64
|
+
19. Do not fix anything unless explicitly asked.
|
|
65
|
+
|
|
66
|
+
## Output Contract
|
|
67
|
+
|
|
68
|
+
For each finding, include:
|
|
69
|
+
|
|
70
|
+
- severity
|
|
71
|
+
- fact in conflict
|
|
72
|
+
- source-of-truth file
|
|
73
|
+
- conflicting file
|
|
74
|
+
- whether the conflict is doc-vs-doc, code-vs-doc, or registry-vs-file
|
|
75
|
+
- why it matters
|
|
76
|
+
- recommended owner to update
|
|
77
|
+
- whether user direction is required before deciding the fix path
|
|
78
|
+
|
|
79
|
+
## Final Pass
|
|
80
|
+
|
|
81
|
+
End with:
|
|
82
|
+
|
|
83
|
+
1. a short list of highest-priority drift items
|
|
84
|
+
2. a short list of acceptable historical artifacts that should not be treated as blockers
|
|
85
|
+
|
|
86
|
+
## Inputs
|
|
87
|
+
|
|
88
|
+
Use the current repository docs, platform instruction surfaces, skills, reusable prompts, and any relevant workflow or summary artifacts available below.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Project Docs Refresh Reusable Prompt
|
|
2
|
+
|
|
3
|
+
Read `docs/eyehateagent-contract.md` first.
|
|
4
|
+
|
|
5
|
+
Refresh the existing project documentation after a change in scope, stack, workflow, architecture, testing policy, or product behavior.
|
|
6
|
+
|
|
7
|
+
## Goal
|
|
8
|
+
|
|
9
|
+
Update **only the docs that own the changed information** while keeping the documentation set consistent.
|
|
10
|
+
|
|
11
|
+
## Required Behavior
|
|
12
|
+
|
|
13
|
+
1. Read the current project docs before editing anything.
|
|
14
|
+
2. Use `docs/eyehateagent-contract.md` to identify which files own the changed information.
|
|
15
|
+
3. Read `docs/project-docs/index.md` and `docs/project-docs/technical-guidelines/index.md` when present and treat them as the authoritative inventories for optional docs and guideline docs.
|
|
16
|
+
4. When clearly named reference or archive folders such as `docs-legacy/`, `docs-old/`, `archive/`, or `reference/` exist, read them as migration input only and do not treat them as owner-doc paths.
|
|
17
|
+
5. Update only the affected docs and any documents that summarize them.
|
|
18
|
+
6. Preserve stable headings wherever possible.
|
|
19
|
+
7. Avoid rewriting unrelated sections.
|
|
20
|
+
8. If the change introduces a new durable concern, create the smallest justified new doc.
|
|
21
|
+
9. If the change affects an optional regular doc or its metadata, update `docs/project-docs/index.md` when present.
|
|
22
|
+
10. If the change affects domain-specific technical guidance, update the owning guideline and `technical-guidelines/index.md` when present.
|
|
23
|
+
11. When legacy or reference docs are being mapped into the active owner-doc set, classify them by the durable concern they govern rather than by the legacy folder or filename; legacy names are hints only.
|
|
24
|
+
12. Normalize non-standard legacy labels by meaning when they map cleanly to an active owner. For example, `epic`, `milestone`, or `roadmap` material may map to `docs/project-docs/foundation/phases/`, while `protocol`, `procedure`, `policy`, or `standard` material may map to `docs/project-docs/technical-guidelines/` when the content is domain-specific technical guidance.
|
|
25
|
+
13. When legacy or reference docs show that a justified optional doc should become active under `docs/project-docs/`, promote it into the active owner-doc set instead of leaving it stranded in reference-only folders.
|
|
26
|
+
14. When legacy or reference docs contain domain-specific technical guidance that is still valid, create or update the relevant files under `docs/project-docs/technical-guidelines/` and create `technical-guidelines/index.md` when any guideline becomes active.
|
|
27
|
+
15. When legacy or reference docs contain explicit phased planning, epic tracking, or execution-map detail that should stay active, create or update the relevant files under `docs/project-docs/foundation/phases/`, including `foundation/phases/index.md`, and register the active optional doc in `docs/project-docs/index.md`.
|
|
28
|
+
16. If a legacy artifact could plausibly map to more than one active owner, or if preserving the legacy label may be intentional, ask the user for direction instead of guessing.
|
|
29
|
+
17. Preserve valuable legacy sections (e.g., 'Decision Rationale') that do not exist in the starter templates. Decide whether this information belongs as a new custom section in an existing document or warrants a new separate file entirely. Ask the user if the best approach is ambiguous. Do not discard domain-specific knowledge just because it lacks a standard template heading.
|
|
30
|
+
18. When asking for that direction, prefer a concise question that states the inferred owner and the fallback choices. Example: `I found legacy "protocol" docs that look like technical guidance. Should I 1. skip them, 2. migrate them into active guideline docs, or 3. preserve "protocol" as a project-specific doc type?`
|
|
31
|
+
19. When docs are being created for the first time against an existing codebase with no prior documentation, inspect code, comments, configs, tests, and repository structure for valuable domain knowledge that goes beyond standard template headings. Surface these findings as new custom sections or new files where justified. Mark codebase-inferred facts as `Inferred from code` or `Open Question` until the user confirms them.
|
|
32
|
+
|
|
33
|
+
### Review Sequence
|
|
34
|
+
|
|
35
|
+
1. Read the change summary.
|
|
36
|
+
2. Read the owning project docs.
|
|
37
|
+
3. Read `docs/project-docs/index.md` and `docs/project-docs/technical-guidelines/index.md` when present.
|
|
38
|
+
4. Read clearly named reference or archive folders such as `docs-legacy/`, `docs-old/`, `archive/`, or `reference/` when the repo is migrating from another documentation format.
|
|
39
|
+
5. Decide whether any legacy material should be promoted into active optional docs such as `technical-guidelines/` or `foundation/phases/` instead of staying reference-only, using content and governed concern as the primary signal rather than legacy names.
|
|
40
|
+
6. Read the relevant guideline docs when the change touches technical rules or implementation conventions.
|
|
41
|
+
7. Identify impacted dependent docs.
|
|
42
|
+
8. Refresh the owning docs first.
|
|
43
|
+
9. Refresh summary or index docs second.
|
|
44
|
+
10. Run a consistency pass.
|
|
45
|
+
|
|
46
|
+
## Ownership Examples
|
|
47
|
+
|
|
48
|
+
- stack or dependency changes → `foundation/architecture.md`, `technical/testing.md`
|
|
49
|
+
- feature scope changes → `foundation/prd.md`, `foundation/feature-inventory.md`, `foundation/status.md`
|
|
50
|
+
- detailed requirements or acceptance changes → `foundation/prd.md`, `foundation/status.md`
|
|
51
|
+
- workflow or roadmap changes → `foundation/status.md`, `foundation/phases/index.md`, workflow docs if present
|
|
52
|
+
- validation / CI changes → `technical/testing.md`, `getting-started.md`
|
|
53
|
+
- production environment, rollout, rollback, or smoke-check changes → `operations/production-runbook.md`, `foundation/architecture.md`, `technical/testing.md`
|
|
54
|
+
- API or integration changes → relevant API / integration docs plus `foundation/architecture.md`
|
|
55
|
+
- optional or conditional doc inventory changes → `docs/project-docs/index.md` plus the affected optional owner docs
|
|
56
|
+
- cross-cutting technical conventions or implementation rules → relevant `technical-guidelines/*.md`, `technical-guidelines/index.md`, and any summarizing core docs that reference them
|
|
57
|
+
- documentation-system migration from legacy docs → active owner docs under `docs/project-docs/` first, with `docs-legacy/`, `docs-old/`, or other clearly named archive/reference folders used only as source material
|
|
58
|
+
- semantic legacy-name normalization → map legacy names by content, for example `epic` or `roadmap` material to `foundation/phases/` and `protocol` or `standard` material to `technical-guidelines/` when their governed concern matches those owners
|
|
59
|
+
- legacy technical-guidance promotion → `docs/project-docs/technical-guidelines/*.md`, `technical-guidelines/index.md`, and any summarizing core docs that now depend on those active guidelines
|
|
60
|
+
- legacy phased-planning promotion → `docs/project-docs/foundation/phases/index.md`, the relevant phase or epic docs, `foundation/status.md`, and `docs/project-docs/index.md`
|
|
61
|
+
|
|
62
|
+
## Output Contract
|
|
63
|
+
|
|
64
|
+
Your result should state:
|
|
65
|
+
|
|
66
|
+
1. which docs were updated
|
|
67
|
+
2. why each doc was updated
|
|
68
|
+
3. which docs were intentionally left unchanged
|
|
69
|
+
4. any remaining consistency risks or open questions
|
|
70
|
+
|
|
71
|
+
## Final Pass
|
|
72
|
+
|
|
73
|
+
Before finishing, check that:
|
|
74
|
+
|
|
75
|
+
1. the updated docs still match the contract in `docs/eyehateagent-contract.md`
|
|
76
|
+
2. platform instruction surfaces and skills would now read the correct project-specific truth
|
|
77
|
+
3. no stale summary remains in `foundation/status.md`, `docs/project-docs/index.md`, `technical-guidelines/index.md`, or other index docs
|
|
78
|
+
|
|
79
|
+
## Inputs
|
|
80
|
+
|
|
81
|
+
Use the change summary, affected artifacts, and current project docs provided below.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Spec-Driven Development (SDD) Execute
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Translate a newly updated project specification into tested, working code by following a strict Test-Driven Development (TDD) and Spec-Driven Development (SDD) lifecycle.
|
|
6
|
+
|
|
7
|
+
## Required Behavior
|
|
8
|
+
|
|
9
|
+
1. **Read the Specs:** First, read `docs/project-docs/foundation/prd.md` and `docs/project-docs/foundation/architecture.md`.
|
|
10
|
+
2. **Verify Spec Completeness:** Check if the user's requested feature is documented in the specs.
|
|
11
|
+
- If the feature is NOT documented, **do not write code yet**. Instead, immediately draft the necessary additions for `foundation/prd.md` and `foundation/architecture.md` and present them to the user. Ask the user: "Should I add these specifications to the project docs and then proceed with implementation?"
|
|
12
|
+
3. **Generate Tests (TDD):** If the spec is present, author the test cases that validate the acceptance criteria.
|
|
13
|
+
4. **Generate Code:** Write the implementation code to pass the generated tests.
|
|
14
|
+
5. **Verify Completeness:** Ensure the code passes the tests and fulfills the architectural rules defined in `foundation/architecture.md`.
|
|
15
|
+
|
|
16
|
+
## Output Contract
|
|
17
|
+
|
|
18
|
+
1. **Spec Mapping:** A brief list linking the code changes you are about to make to the specific lines/sections in the project docs.
|
|
19
|
+
2. **Tests Authored:** The tests written to fulfill the spec.
|
|
20
|
+
3. **Code Authored:** The implementation code.
|
|
21
|
+
4. **Validation:** A summary of how the implementation satisfies the initial specification.
|
|
22
|
+
|
|
23
|
+
## Final Pass
|
|
24
|
+
|
|
25
|
+
- Does the implementation violate any constraints in `foundation/architecture.md`?
|
|
26
|
+
- Are there any tests missing for the acceptance criteria listed in `foundation/prd.md`?
|
|
27
|
+
- Did I write code for a feature that wasn't in the spec? (If yes, revert it).
|
|
28
|
+
|
|
29
|
+
## Inputs
|
|
30
|
+
|
|
31
|
+
- The user's prompt requesting the execution of a feature.
|
|
32
|
+
- `docs/project-docs/foundation/prd.md`
|
|
33
|
+
- `docs/project-docs/foundation/architecture.md`
|
|
34
|
+
- `docs/project-docs/technical/testing.md`
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# SDD Discuss Phase (Brainstorming)
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Act as a Senior Engineer / Agile Product Manager to help the user brainstorm and finalize the specifications for a new feature or architectural change *before* it gets committed to the permanent documentation or implemented in code.
|
|
6
|
+
|
|
7
|
+
## Required Behavior
|
|
8
|
+
|
|
9
|
+
1. **Do NOT Write Code:** This is purely a planning and discussion phase. Do not output any implementation code.
|
|
10
|
+
2. **Interview the User:** Ask clarifying questions to eliminate ambiguity. Consider:
|
|
11
|
+
- Edge cases and error states.
|
|
12
|
+
- API shapes and payload structures.
|
|
13
|
+
- UI/UX constraints or responsive layouts.
|
|
14
|
+
- Data model changes (new tables, columns, relations).
|
|
15
|
+
3. **Draft the Spec:** Once the user answers your questions and you reach an agreement, output a drafted, markdown-formatted snippet that is ready to be injected into the specific target documents (e.g., `foundation/prd.md`, `foundation/architecture.md`, `technical/api-contract.md`).
|
|
16
|
+
4. **Final Approval:** Ask the user: "Should I execute the SDD workflow (`01-sdd-execute.md`) with these specifications?"
|
|
17
|
+
|
|
18
|
+
## Output Contract
|
|
19
|
+
|
|
20
|
+
1. **Your Questions:** 1-3 highly targeted technical questions about the gray areas of the feature.
|
|
21
|
+
2. **The Drafted Spec:** A clear, concise markdown block representing the final agreed-upon rules.
|
|
22
|
+
|
|
23
|
+
## Inputs
|
|
24
|
+
|
|
25
|
+
- The user's rough feature idea or concept.
|
|
26
|
+
- `docs/project-docs/foundation/prd.md` (to understand current scope)
|
|
27
|
+
- `docs/project-docs/foundation/architecture.md` (to understand current stack constraints)
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: analysis
|
|
3
|
+
description: "Project-aware expert-role analysis for architecture, debugging, trade-offs, risk, performance, requirements, and design questions. Reads project docs first, then applies expert structured reasoning to the current repository context."
|
|
4
|
+
argument-hint: "Describe the problem, decision, artifact, or system to analyze"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Analysis — Project-Aware
|
|
8
|
+
|
|
9
|
+
Produces a **rigorous, expert-level analysis** of a problem, decision, artifact, or system after first reading the project documentation that defines the repository's actual context.
|
|
10
|
+
|
|
11
|
+
This skill is reusable across product, backend, frontend, infrastructure, monorepo, and documentation-heavy projects. It should not assume a particular stack until the project docs confirm it.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Required Project Inputs
|
|
16
|
+
|
|
17
|
+
| Document | Why it matters |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
|
|
20
|
+
| `docs/project-docs/foundation/prd.md` | Clarifies goals, scope, stakeholders, and success metrics |
|
|
21
|
+
| `docs/project-docs/foundation/architecture.md` | Defines stack, boundaries, integration model, constraints, and runtime assumptions |
|
|
22
|
+
| `docs/project-docs/foundation/status.md` | Reveals maturity, roadmap, active workstreams, and known blockers |
|
|
23
|
+
| `docs/project-docs/technical/testing.md` | Shows what validation exists and how strong the available evidence can be |
|
|
24
|
+
| Relevant feature, workflow, API, or guideline docs | Supply domain-specific truth for the topic being analyzed |
|
|
25
|
+
| Relevant code, logs, tests, or runtime evidence | Support findings with direct evidence rather than guesswork |
|
|
26
|
+
|
|
27
|
+
If the required project docs are missing, note the gap explicitly and limit confidence accordingly.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## When To Use
|
|
32
|
+
|
|
33
|
+
| Trigger | Example request |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| Architecture review | "Analyze this module boundary for coupling risk" |
|
|
36
|
+
| Debugging | "Analyze why this workflow fails intermittently" |
|
|
37
|
+
| Trade-off decision | "Analyze option A vs option B for this integration" |
|
|
38
|
+
| Requirements review | "Analyze these specs for gaps and contradictions" |
|
|
39
|
+
| Risk assessment | "Analyze the release risk of this change" |
|
|
40
|
+
| Performance diagnosis | "Analyze where this request path will bottleneck" |
|
|
41
|
+
| Product or roadmap question | "Analyze whether this feature belongs in MVP" |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Procedure
|
|
46
|
+
|
|
47
|
+
### Step 1 — Understand the question
|
|
48
|
+
|
|
49
|
+
- Restate the problem in precise terms.
|
|
50
|
+
- Identify the decision being made or the behavior being explained.
|
|
51
|
+
- Identify what counts as success or failure.
|
|
52
|
+
- Identify any missing context that materially changes the analysis.
|
|
53
|
+
|
|
54
|
+
### Step 2 — Ground the analysis in project reality
|
|
55
|
+
|
|
56
|
+
Read the relevant project docs first.
|
|
57
|
+
|
|
58
|
+
Extract:
|
|
59
|
+
|
|
60
|
+
- actual stack and runtime model
|
|
61
|
+
- architecture rules and boundaries
|
|
62
|
+
- scope and non-goals
|
|
63
|
+
- available verification signals
|
|
64
|
+
- known constraints such as team size, maturity, environment, or performance budget
|
|
65
|
+
|
|
66
|
+
### Step 3 — Decompose the subject
|
|
67
|
+
|
|
68
|
+
Break the problem into:
|
|
69
|
+
|
|
70
|
+
- components
|
|
71
|
+
- boundaries
|
|
72
|
+
- dependencies
|
|
73
|
+
- failure points
|
|
74
|
+
- assumptions
|
|
75
|
+
- decision criteria
|
|
76
|
+
|
|
77
|
+
Identify the most load-bearing parts first.
|
|
78
|
+
|
|
79
|
+
### Step 4 — Gather evidence
|
|
80
|
+
|
|
81
|
+
Prefer direct evidence from:
|
|
82
|
+
|
|
83
|
+
- code
|
|
84
|
+
- tests
|
|
85
|
+
- runtime logs
|
|
86
|
+
- project docs
|
|
87
|
+
- API or contract docs
|
|
88
|
+
- existing workflows
|
|
89
|
+
|
|
90
|
+
Separate:
|
|
91
|
+
|
|
92
|
+
- facts
|
|
93
|
+
- inferences
|
|
94
|
+
- assumptions
|
|
95
|
+
|
|
96
|
+
### Step 5 — Apply the right reasoning mode
|
|
97
|
+
|
|
98
|
+
Use one or more of:
|
|
99
|
+
|
|
100
|
+
- first-principles reasoning
|
|
101
|
+
- causal reasoning
|
|
102
|
+
- adversarial reasoning
|
|
103
|
+
- deductive reasoning
|
|
104
|
+
- inductive reasoning
|
|
105
|
+
- comparative or trade-off analysis
|
|
106
|
+
- probabilistic reasoning
|
|
107
|
+
|
|
108
|
+
### Step 6 — Evaluate and rank
|
|
109
|
+
|
|
110
|
+
When comparing options or hypotheses:
|
|
111
|
+
|
|
112
|
+
- use explicit criteria
|
|
113
|
+
- surface hidden costs
|
|
114
|
+
- distinguish reversible vs irreversible decisions
|
|
115
|
+
- distinguish local optimization vs system impact
|
|
116
|
+
|
|
117
|
+
### Step 7 — Form a judgment
|
|
118
|
+
|
|
119
|
+
- state the conclusion directly
|
|
120
|
+
- say what is known vs inferred
|
|
121
|
+
- say what could change the conclusion
|
|
122
|
+
- tie the recommendation back to the project's actual constraints
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Output Contract
|
|
127
|
+
|
|
128
|
+
Your output should include:
|
|
129
|
+
|
|
130
|
+
1. summary
|
|
131
|
+
2. analysis by area or component
|
|
132
|
+
3. key findings ordered by importance
|
|
133
|
+
4. recommendation or decision guidance
|
|
134
|
+
5. risks and open questions
|
|
135
|
+
6. confidence and evidence limitations when relevant
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Quality Checks
|
|
140
|
+
|
|
141
|
+
- No claim without evidence or clearly marked assumption
|
|
142
|
+
- No false precision when evidence is weak
|
|
143
|
+
- No generic advice detached from project constraints
|
|
144
|
+
- No vague recommendation without an actionable next step
|
|
145
|
+
- No hidden stack assumptions that were not confirmed from project docs
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Anti-Patterns
|
|
150
|
+
|
|
151
|
+
- Listing facts without evaluating them
|
|
152
|
+
- Jumping to the first plausible conclusion
|
|
153
|
+
- Treating all options as equally valid when evidence favors one
|
|
154
|
+
- Recommending a rewrite when an incremental fix would solve the problem
|
|
155
|
+
- Ignoring the project stage, roadmap, or non-goals in `prd.md` and `status.md`
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Natural Prompt Shapes
|
|
160
|
+
|
|
161
|
+
- "Why is this failing, and what do you think is the real cause?"
|
|
162
|
+
- "Analyze this decision and tell me whether it still makes sense."
|
|
163
|
+
- "What are the trade-offs and risks of these two options?"
|
|
164
|
+
- "Check whether these requirements or assumptions still hold up."
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Example Requests
|
|
169
|
+
|
|
170
|
+
- "Analyze this module boundary for coupling risk"
|
|
171
|
+
- "Analyze why this workflow fails intermittently"
|
|
172
|
+
- "Analyze option A vs option B for this integration"
|
|
173
|
+
- "Analyze whether this feature belongs in MVP"
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-design
|
|
3
|
+
description: "Project-aware expert-role contract design for APIs, interfaces, repositories, services, message schemas, and module boundaries. Reads project docs first, then produces or reviews a contract consistent with the current repository."
|
|
4
|
+
argument-hint: "Describe the boundary, interface, endpoint, message contract, or service behavior to design or review"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Interface & API Contract Design — Project-Aware
|
|
8
|
+
|
|
9
|
+
Produces a **project-aware, expert-level contract design or design review** by reading the repository's project docs first, then applying a reusable method to the current boundary type.
|
|
10
|
+
|
|
11
|
+
This skill is intentionally reusable across:
|
|
12
|
+
|
|
13
|
+
- HTTP APIs
|
|
14
|
+
- internal service interfaces
|
|
15
|
+
- repositories and adapters
|
|
16
|
+
- event or message contracts
|
|
17
|
+
- data-transfer schemas
|
|
18
|
+
- client or SDK boundaries
|
|
19
|
+
|
|
20
|
+
It should **not** assume one language, framework, transport, or architecture style until the project docs confirm them.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Required Project Inputs
|
|
25
|
+
|
|
26
|
+
| Document | Why it matters |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
|
|
29
|
+
| `docs/project-docs/foundation/architecture.md` | Defines stack, architecture boundaries, dependency rules, and integration patterns |
|
|
30
|
+
| `docs/project-docs/foundation/prd.md` | Clarifies scope, constraints, stakeholders, and non-goals |
|
|
31
|
+
| `docs/project-docs/technical/testing.md` | Defines how the contract should be validated |
|
|
32
|
+
| Relevant feature docs, API docs, or guidelines | Provide domain-specific rules, request/response shapes, workflows, and edge cases |
|
|
33
|
+
| Existing code or contracts in the repo | Show local naming, layering, serialization, validation, and error conventions |
|
|
34
|
+
|
|
35
|
+
If the repository lacks the contract-defining docs needed for the task, call that out and create or update the missing docs instead of inventing local rules in the skill.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## When To Use
|
|
40
|
+
|
|
41
|
+
Use this skill when designing or reviewing one of these boundary types.
|
|
42
|
+
|
|
43
|
+
| Boundary type | Typical artifacts |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| External HTTP / RPC API | route, handler, controller, request/response schema, auth, pagination, versioning |
|
|
46
|
+
| Internal service interface | method signatures, error contract, idempotency, retries, transaction boundaries |
|
|
47
|
+
| Repository or persistence boundary | interface, query contract, mapping rules, transaction semantics |
|
|
48
|
+
| Adapter or integration boundary | client interface, DTOs, transport mapping, failure translation |
|
|
49
|
+
| Event or message contract | payload schema, producer/consumer expectations, ordering, retry, dead-letter rules |
|
|
50
|
+
| Module boundary | public interface, dependency direction, allowed imports, extension points |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Procedure
|
|
55
|
+
|
|
56
|
+
### Step 1 — Identify the contract owner
|
|
57
|
+
|
|
58
|
+
Determine which layer or module owns the boundary.
|
|
59
|
+
|
|
60
|
+
Questions to answer:
|
|
61
|
+
|
|
62
|
+
- Is this public or internal?
|
|
63
|
+
- Is it synchronous or asynchronous?
|
|
64
|
+
- Is it request/response, command, query, event, or stream based?
|
|
65
|
+
- Which side owns validation?
|
|
66
|
+
- Which side owns retries and failure translation?
|
|
67
|
+
|
|
68
|
+
Use `architecture.md` to avoid violating the project's dependency or layering rules.
|
|
69
|
+
|
|
70
|
+
### Step 2 — Identify the project-specific constraints
|
|
71
|
+
|
|
72
|
+
Extract from project docs:
|
|
73
|
+
|
|
74
|
+
- naming conventions
|
|
75
|
+
- error model
|
|
76
|
+
- serialization format
|
|
77
|
+
- auth and authorization expectations
|
|
78
|
+
- pagination / filtering conventions
|
|
79
|
+
- idempotency or transaction expectations
|
|
80
|
+
- observability or auditing requirements
|
|
81
|
+
- compatibility or versioning rules
|
|
82
|
+
|
|
83
|
+
Do not assume REST, JSON, SQL, Clean Architecture, CQRS, or any other pattern unless the docs require it.
|
|
84
|
+
|
|
85
|
+
### Step 3 — Define the contract shape
|
|
86
|
+
|
|
87
|
+
Design the minimal contract that supports the required behavior.
|
|
88
|
+
|
|
89
|
+
Depending on the boundary, specify:
|
|
90
|
+
|
|
91
|
+
- inputs
|
|
92
|
+
- outputs
|
|
93
|
+
- failure modes
|
|
94
|
+
- validation rules
|
|
95
|
+
- side effects
|
|
96
|
+
- ordering or transaction semantics
|
|
97
|
+
- timeouts or retry expectations
|
|
98
|
+
- invariants that must always hold
|
|
99
|
+
|
|
100
|
+
Prefer explicit types or schemas over ambiguous free-form payloads.
|
|
101
|
+
|
|
102
|
+
### Step 4 — Separate durable domain concepts from transport details
|
|
103
|
+
|
|
104
|
+
If the project distinguishes domain models from transport or persistence models, keep them separate.
|
|
105
|
+
|
|
106
|
+
Typical separations include:
|
|
107
|
+
|
|
108
|
+
- domain entity vs API DTO
|
|
109
|
+
- service input object vs controller request body
|
|
110
|
+
- repository interface vs database table model
|
|
111
|
+
- event contract vs internal aggregate or entity state
|
|
112
|
+
|
|
113
|
+
Use the separation rules already defined by the project docs. Do not invent new layering rules casually.
|
|
114
|
+
|
|
115
|
+
### Step 5 — Define the error contract
|
|
116
|
+
|
|
117
|
+
Specify:
|
|
118
|
+
|
|
119
|
+
- expected failure categories
|
|
120
|
+
- how they surface to callers
|
|
121
|
+
- which failures are retriable
|
|
122
|
+
- which failures are validation vs business vs infrastructure errors
|
|
123
|
+
- what data is safe to expose externally
|
|
124
|
+
|
|
125
|
+
If the repo already defines a standard result wrapper, exception hierarchy, or error envelope, reuse it.
|
|
126
|
+
|
|
127
|
+
### Step 6 — Define verification requirements
|
|
128
|
+
|
|
129
|
+
Use `testing.md` to decide how the contract should be validated.
|
|
130
|
+
|
|
131
|
+
Examples:
|
|
132
|
+
|
|
133
|
+
- schema or serialization tests
|
|
134
|
+
- handler / controller tests
|
|
135
|
+
- repository or persistence tests
|
|
136
|
+
- integration tests against a real dependency
|
|
137
|
+
- compatibility or migration checks
|
|
138
|
+
- documentation consistency review
|
|
139
|
+
|
|
140
|
+
### Step 7 — Produce the design output
|
|
141
|
+
|
|
142
|
+
The output should fit the repository style and include enough detail to implement safely without locking the repo into one stack-specific pattern that the docs do not support.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Output Contract
|
|
147
|
+
|
|
148
|
+
When using this skill, the output should include:
|
|
149
|
+
|
|
150
|
+
1. the boundary type
|
|
151
|
+
2. the project docs consulted
|
|
152
|
+
3. the proposed contract shape
|
|
153
|
+
4. validation and error rules
|
|
154
|
+
5. ownership and dependency implications
|
|
155
|
+
6. verification strategy
|
|
156
|
+
7. open questions that still require product or architecture decisions
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Quality Checks
|
|
161
|
+
|
|
162
|
+
Use this checklist when reviewing an existing contract:
|
|
163
|
+
|
|
164
|
+
- Is the boundary owned by the correct layer or module?
|
|
165
|
+
- Does the contract match project naming and error conventions?
|
|
166
|
+
- Are validation rules explicit?
|
|
167
|
+
- Are transport details separated from durable domain concepts where required?
|
|
168
|
+
- Are failure modes documented and actionable?
|
|
169
|
+
- Does the contract create hidden coupling or leak implementation details?
|
|
170
|
+
- Is there a clear verification strategy in `testing.md`?
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Anti-Patterns
|
|
175
|
+
|
|
176
|
+
- Embedding one stack's rules into the skill instead of reading project docs
|
|
177
|
+
- Designing an interface before understanding the owning boundary
|
|
178
|
+
- Mixing transport payload shape with domain concepts when the project separates them
|
|
179
|
+
- Returning ambiguous success or failure semantics
|
|
180
|
+
- Ignoring versioning, compatibility, or migration concerns for externally visible contracts
|
|
181
|
+
- Over-designing the contract far beyond the current scope in `prd.md`
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Natural Prompt Shapes
|
|
186
|
+
|
|
187
|
+
- "Design the contract for this API or service boundary."
|
|
188
|
+
- "Check whether this endpoint or DTO shape is designed correctly."
|
|
189
|
+
- "Define the interface, error contract, and validation rules for this boundary."
|
|
190
|
+
- "Review whether this event or repository contract matches the architecture."
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Example Requests
|
|
195
|
+
|
|
196
|
+
- "Design the repository contract for this feature"
|
|
197
|
+
- "Review this controller and DTO boundary"
|
|
198
|
+
- "Design an event payload for this workflow"
|
|
199
|
+
- "Define the error contract for this external integration"
|