autodoc-agent-kit 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/README.md +362 -0
- package/package.json +49 -0
- package/src/core/module.yaml +5 -0
- package/src/modules/design/module.yaml +9 -0
- package/src/modules/design/skills/brand-guidelines/LICENSE.txt +202 -0
- package/src/modules/design/skills/brand-guidelines/SKILL.md +73 -0
- package/src/modules/design/skills/frontend-design/LICENSE.txt +177 -0
- package/src/modules/design/skills/frontend-design/SKILL.md +42 -0
- package/src/modules/design/skills/web-artifacts-builder/SKILL.md +229 -0
- package/src/modules/devops/module.yaml +10 -0
- package/src/modules/devops/skills/devops-helper/SKILL.md +60 -0
- package/src/modules/devops/skills/k8s-helm/SKILL.md +360 -0
- package/src/modules/devops/skills/monitoring-observability/SKILL.md +240 -0
- package/src/modules/devops/skills/security-auditor/SKILL.md +105 -0
- package/src/modules/engineering/module.yaml +22 -0
- package/src/modules/engineering/skills/ai-sdk/SKILL.md +314 -0
- package/src/modules/engineering/skills/api-designer/SKILL.md +77 -0
- package/src/modules/engineering/skills/code-reviewer/SKILL.md +71 -0
- package/src/modules/engineering/skills/db-architect/SKILL.md +50 -0
- package/src/modules/engineering/skills/debugger/SKILL.md +59 -0
- package/src/modules/engineering/skills/docs-generator/SKILL.md +51 -0
- package/src/modules/engineering/skills/git-workflow/SKILL.md +258 -0
- package/src/modules/engineering/skills/mcp-builder/LICENSE.txt +202 -0
- package/src/modules/engineering/skills/mcp-builder/SKILL.md +236 -0
- package/src/modules/engineering/skills/mcp-builder/reference/evaluation.md +602 -0
- package/src/modules/engineering/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/src/modules/engineering/skills/mcp-builder/reference/node_mcp_server.md +970 -0
- package/src/modules/engineering/skills/mcp-builder/reference/python_mcp_server.md +719 -0
- package/src/modules/engineering/skills/mcp-builder/scripts/connections.py +151 -0
- package/src/modules/engineering/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/src/modules/engineering/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/src/modules/engineering/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/src/modules/engineering/skills/nextjs-15/SKILL.md +312 -0
- package/src/modules/engineering/skills/perf-optimizer/SKILL.md +60 -0
- package/src/modules/engineering/skills/react-19/SKILL.md +257 -0
- package/src/modules/engineering/skills/refactorer/SKILL.md +60 -0
- package/src/modules/engineering/skills/skill-authoring-workflow/SKILL.md +183 -0
- package/src/modules/engineering/skills/skill-creator/LICENSE.txt +202 -0
- package/src/modules/engineering/skills/skill-creator/SKILL.md +356 -0
- package/src/modules/engineering/skills/skill-creator/references/output-patterns.md +82 -0
- package/src/modules/engineering/skills/skill-creator/references/workflows.md +28 -0
- package/src/modules/engineering/skills/skill-creator/scripts/__pycache__/quick_validate.cpython-313.pyc +0 -0
- package/src/modules/engineering/skills/skill-creator/scripts/init_skill.py +303 -0
- package/src/modules/engineering/skills/skill-creator/scripts/package_skill.py +110 -0
- package/src/modules/engineering/skills/skill-creator/scripts/quick_validate.py +95 -0
- package/src/modules/engineering/skills/typescript/SKILL.md +231 -0
- package/src/modules/engineering/skills/zod-4/SKILL.md +223 -0
- package/src/modules/product/module.yaml +51 -0
- package/src/modules/product/skills/acquisition-channel-advisor/SKILL.md +643 -0
- package/src/modules/product/skills/acquisition-channel-advisor/examples/conversation-flow.md +531 -0
- package/src/modules/product/skills/ai-shaped-readiness-advisor/SKILL.md +923 -0
- package/src/modules/product/skills/altitude-horizon-framework/SKILL.md +250 -0
- package/src/modules/product/skills/altitude-horizon-framework/examples/sample.md +85 -0
- package/src/modules/product/skills/business-health-diagnostic/SKILL.md +783 -0
- package/src/modules/product/skills/company-research/SKILL.md +385 -0
- package/src/modules/product/skills/company-research/examples/sample.md +164 -0
- package/src/modules/product/skills/company-research/template.md +60 -0
- package/src/modules/product/skills/context-engineering-advisor/SKILL.md +763 -0
- package/src/modules/product/skills/customer-journey-map/SKILL.md +346 -0
- package/src/modules/product/skills/customer-journey-map/examples/meta-product-manager-skills.md +40 -0
- package/src/modules/product/skills/customer-journey-map/examples/sample.md +33 -0
- package/src/modules/product/skills/customer-journey-map/template.md +28 -0
- package/src/modules/product/skills/customer-journey-mapping-workshop/SKILL.md +523 -0
- package/src/modules/product/skills/director-readiness-advisor/SKILL.md +351 -0
- package/src/modules/product/skills/director-readiness-advisor/examples/conversation-flow.md +96 -0
- package/src/modules/product/skills/discovery-interview-prep/SKILL.md +410 -0
- package/src/modules/product/skills/discovery-process/SKILL.md +504 -0
- package/src/modules/product/skills/discovery-process/examples/sample.md +60 -0
- package/src/modules/product/skills/discovery-process/template.md +39 -0
- package/src/modules/product/skills/eol-message/SKILL.md +348 -0
- package/src/modules/product/skills/eol-message/examples/sample.md +87 -0
- package/src/modules/product/skills/eol-message/template.md +74 -0
- package/src/modules/product/skills/epic-breakdown-advisor/SKILL.md +665 -0
- package/src/modules/product/skills/epic-hypothesis/SKILL.md +277 -0
- package/src/modules/product/skills/epic-hypothesis/examples/sample.md +104 -0
- package/src/modules/product/skills/epic-hypothesis/template.md +30 -0
- package/src/modules/product/skills/executive-onboarding-playbook/SKILL.md +280 -0
- package/src/modules/product/skills/executive-onboarding-playbook/examples/sample.md +116 -0
- package/src/modules/product/skills/feature-investment-advisor/SKILL.md +639 -0
- package/src/modules/product/skills/feature-investment-advisor/examples/conversation-flow.md +538 -0
- package/src/modules/product/skills/finance-based-pricing-advisor/SKILL.md +763 -0
- package/src/modules/product/skills/finance-metrics-quickref/SKILL.md +309 -0
- package/src/modules/product/skills/jobs-to-be-done/SKILL.md +370 -0
- package/src/modules/product/skills/jobs-to-be-done/examples/sample.md +80 -0
- package/src/modules/product/skills/jobs-to-be-done/template.md +65 -0
- package/src/modules/product/skills/lean-ux-canvas/SKILL.md +561 -0
- package/src/modules/product/skills/lean-ux-canvas/examples/sample.md +88 -0
- package/src/modules/product/skills/lean-ux-canvas/template.md +32 -0
- package/src/modules/product/skills/opportunity-solution-tree/SKILL.md +420 -0
- package/src/modules/product/skills/opportunity-solution-tree/examples/sample.md +104 -0
- package/src/modules/product/skills/opportunity-solution-tree/template.md +33 -0
- package/src/modules/product/skills/pestel-analysis/SKILL.md +376 -0
- package/src/modules/product/skills/pestel-analysis/examples/sample.md +143 -0
- package/src/modules/product/skills/pestel-analysis/template.md +53 -0
- package/src/modules/product/skills/pol-probe/SKILL.md +217 -0
- package/src/modules/product/skills/pol-probe/examples/sample.md +136 -0
- package/src/modules/product/skills/pol-probe/template.md +59 -0
- package/src/modules/product/skills/pol-probe-advisor/SKILL.md +492 -0
- package/src/modules/product/skills/positioning-statement/SKILL.md +230 -0
- package/src/modules/product/skills/positioning-statement/examples/sample.md +51 -0
- package/src/modules/product/skills/positioning-statement/template.md +25 -0
- package/src/modules/product/skills/positioning-workshop/SKILL.md +424 -0
- package/src/modules/product/skills/prd-development/SKILL.md +655 -0
- package/src/modules/product/skills/prd-development/examples/sample.md +43 -0
- package/src/modules/product/skills/prd-development/template.md +55 -0
- package/src/modules/product/skills/press-release/SKILL.md +269 -0
- package/src/modules/product/skills/press-release/examples/sample.md +73 -0
- package/src/modules/product/skills/press-release/template.md +39 -0
- package/src/modules/product/skills/prioritization-advisor/SKILL.md +448 -0
- package/src/modules/product/skills/problem-framing-canvas/SKILL.md +466 -0
- package/src/modules/product/skills/problem-framing-canvas/examples/sample.md +58 -0
- package/src/modules/product/skills/problem-framing-canvas/template.md +22 -0
- package/src/modules/product/skills/problem-statement/SKILL.md +246 -0
- package/src/modules/product/skills/problem-statement/examples/sample.md +82 -0
- package/src/modules/product/skills/problem-statement/template.md +37 -0
- package/src/modules/product/skills/product-strategy-session/SKILL.md +426 -0
- package/src/modules/product/skills/product-strategy-session/examples/sample.md +67 -0
- package/src/modules/product/skills/product-strategy-session/template.md +38 -0
- package/src/modules/product/skills/proto-persona/SKILL.md +326 -0
- package/src/modules/product/skills/proto-persona/examples/sample.md +97 -0
- package/src/modules/product/skills/proto-persona/template.md +45 -0
- package/src/modules/product/skills/recommendation-canvas/SKILL.md +375 -0
- package/src/modules/product/skills/recommendation-canvas/examples/sample.md +94 -0
- package/src/modules/product/skills/recommendation-canvas/template.md +86 -0
- package/src/modules/product/skills/roadmap-planning/SKILL.md +505 -0
- package/src/modules/product/skills/roadmap-planning/examples/sample.md +62 -0
- package/src/modules/product/skills/roadmap-planning/template.md +30 -0
- package/src/modules/product/skills/saas-economics-efficiency-metrics/SKILL.md +694 -0
- package/src/modules/product/skills/saas-economics-efficiency-metrics/examples/cash-trap.md +365 -0
- package/src/modules/product/skills/saas-economics-efficiency-metrics/examples/healthy-unit-economics.md +279 -0
- package/src/modules/product/skills/saas-economics-efficiency-metrics/template.md +263 -0
- package/src/modules/product/skills/saas-revenue-growth-metrics/SKILL.md +630 -0
- package/src/modules/product/skills/saas-revenue-growth-metrics/examples/healthy-saas.md +131 -0
- package/src/modules/product/skills/saas-revenue-growth-metrics/examples/warning-signs.md +229 -0
- package/src/modules/product/skills/saas-revenue-growth-metrics/template.md +192 -0
- package/src/modules/product/skills/storyboard/SKILL.md +252 -0
- package/src/modules/product/skills/storyboard/examples/sample.md +71 -0
- package/src/modules/product/skills/storyboard/template.md +41 -0
- package/src/modules/product/skills/tam-sam-som-calculator/SKILL.md +392 -0
- package/src/modules/product/skills/tam-sam-som-calculator/examples/sample.md +142 -0
- package/src/modules/product/skills/tam-sam-som-calculator/scripts/market-sizing.py +95 -0
- package/src/modules/product/skills/tam-sam-som-calculator/template.md +35 -0
- package/src/modules/product/skills/user-story/SKILL.md +272 -0
- package/src/modules/product/skills/user-story/examples/sample.md +110 -0
- package/src/modules/product/skills/user-story/scripts/user-story-template.py +65 -0
- package/src/modules/product/skills/user-story/template.md +32 -0
- package/src/modules/product/skills/user-story-mapping/SKILL.md +285 -0
- package/src/modules/product/skills/user-story-mapping/examples/sample.md +77 -0
- package/src/modules/product/skills/user-story-mapping/template.md +41 -0
- package/src/modules/product/skills/user-story-mapping-workshop/SKILL.md +477 -0
- package/src/modules/product/skills/user-story-mapping-workshop/template.md +28 -0
- package/src/modules/product/skills/user-story-splitting/SKILL.md +303 -0
- package/src/modules/product/skills/user-story-splitting/examples/sample.md +147 -0
- package/src/modules/product/skills/user-story-splitting/template.md +37 -0
- package/src/modules/product/skills/vp-cpo-readiness-advisor/SKILL.md +409 -0
- package/src/modules/product/skills/vp-cpo-readiness-advisor/examples/conversation-flow.md +95 -0
- package/src/modules/product/skills/workshop-facilitation/SKILL.md +87 -0
- package/src/modules/productivity/module.yaml +9 -0
- package/src/modules/productivity/skills/doc-coauthoring/SKILL.md +375 -0
- package/src/modules/productivity/skills/internal-comms/LICENSE.txt +202 -0
- package/src/modules/productivity/skills/internal-comms/SKILL.md +32 -0
- package/src/modules/productivity/skills/internal-comms/examples/3p-updates.md +47 -0
- package/src/modules/productivity/skills/internal-comms/examples/company-newsletter.md +65 -0
- package/src/modules/productivity/skills/internal-comms/examples/faq-answers.md +30 -0
- package/src/modules/productivity/skills/internal-comms/examples/general-comms.md +16 -0
- package/src/modules/productivity/skills/technical-writing/SKILL.md +266 -0
- package/src/modules/qa/module.yaml +9 -0
- package/src/modules/qa/skills/test-strategy/SKILL.md +263 -0
- package/src/modules/qa/skills/test-writer/SKILL.md +57 -0
- package/src/modules/qa/skills/webapp-testing/LICENSE.txt +202 -0
- package/src/modules/qa/skills/webapp-testing/SKILL.md +96 -0
- package/src/modules/qa/skills/webapp-testing/examples/console_logging.py +35 -0
- package/src/modules/qa/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/src/modules/qa/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/src/modules/qa/skills/webapp-testing/scripts/with_server.py +106 -0
- package/tools/autodoc-npx-wrapper.js +34 -0
- package/tools/cli/autodoc-cli.js +55 -0
- package/tools/cli/commands/install.js +36 -0
- package/tools/cli/commands/status.js +35 -0
- package/tools/cli/commands/uninstall.js +60 -0
- package/tools/cli/installers/lib/core/installer.js +164 -0
- package/tools/cli/installers/lib/core/manifest.js +49 -0
- package/tools/cli/installers/lib/ide/manager.js +112 -0
- package/tools/cli/installers/lib/ide/platform-codes.yaml +207 -0
- package/tools/cli/installers/lib/modules/manager.js +59 -0
- package/tools/cli/lib/ui.js +199 -0
- package/tools/cli/lib/welcome.js +82 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
## Instructions
|
|
2
|
+
You are being asked to write a company-wide newsletter update. You are meant to summarize the past week/month of a company in the form of a newsletter that the entire company will read. It should be maybe ~20-25 bullet points long. It will be sent via Slack and email, so make it consumable for that.
|
|
3
|
+
|
|
4
|
+
Ideally it includes the following attributes:
|
|
5
|
+
- Lots of links: pulling documents from Google Drive that are very relevant, linking to prominent Slack messages in announce channels and from executives, perhgaps referencing emails that went company-wide, highlighting significant things that have happened in the company.
|
|
6
|
+
- Short and to-the-point: each bullet should probably be no longer than ~1-2 sentences
|
|
7
|
+
- Use the "we" tense, as you are part of the company. Many of the bullets should say "we did this" or "we did that"
|
|
8
|
+
|
|
9
|
+
## Tools to use
|
|
10
|
+
If you have access to the following tools, please try to use them. If not, you can also let the user know directly that their responses would be better if they gave them access.
|
|
11
|
+
|
|
12
|
+
- Slack: look for messages in channels with lots of people, with lots of reactions or lots of responses within the thread
|
|
13
|
+
- Email: look for things from executives that discuss company-wide announcements
|
|
14
|
+
- Calendar: if there were meetings with large attendee lists, particularly things like All-Hands meetings, big company announcements, etc. If there were documents attached to those meetings, those are great links to include.
|
|
15
|
+
- Documents: if there were new docs published in the last week or two that got a lot of attention, you can link them. These should be things like company-wide vision docs, plans for the upcoming quarter or half, things authored by critical executives, etc.
|
|
16
|
+
- External press: if you see references to articles or press we've received over the past week, that could be really cool too.
|
|
17
|
+
|
|
18
|
+
If you don't have access to any of these things, you can ask the user for things they want to cover. In this case, you'll mostly just be polishing up and fitting to this format more directly.
|
|
19
|
+
|
|
20
|
+
## Sections
|
|
21
|
+
The company is pretty big: 1000+ people. There are a variety of different teams and initiatives going on across the company. To make sure the update works well, try breaking it into sections of similar things. You might break into clusters like {product development, go to market, finance} or {recruiting, execution, vision}, or {external news, internal news} etc. Try to make sure the different areas of the company are highlighted well.
|
|
22
|
+
|
|
23
|
+
## Prioritization
|
|
24
|
+
Focus on:
|
|
25
|
+
- Company-wide impact (not team-specific details)
|
|
26
|
+
- Announcements from leadership
|
|
27
|
+
- Major milestones and achievements
|
|
28
|
+
- Information that affects most employees
|
|
29
|
+
- External recognition or press
|
|
30
|
+
|
|
31
|
+
Avoid:
|
|
32
|
+
- Overly granular team updates (save those for 3Ps)
|
|
33
|
+
- Information only relevant to small groups
|
|
34
|
+
- Duplicate information already communicated
|
|
35
|
+
|
|
36
|
+
## Example Formats
|
|
37
|
+
|
|
38
|
+
:megaphone: Company Announcements
|
|
39
|
+
- Announcement 1
|
|
40
|
+
- Announcement 2
|
|
41
|
+
- Announcement 3
|
|
42
|
+
|
|
43
|
+
:dart: Progress on Priorities
|
|
44
|
+
- Area 1
|
|
45
|
+
- Sub-area 1
|
|
46
|
+
- Sub-area 2
|
|
47
|
+
- Sub-area 3
|
|
48
|
+
- Area 2
|
|
49
|
+
- Sub-area 1
|
|
50
|
+
- Sub-area 2
|
|
51
|
+
- Sub-area 3
|
|
52
|
+
- Area 3
|
|
53
|
+
- Sub-area 1
|
|
54
|
+
- Sub-area 2
|
|
55
|
+
- Sub-area 3
|
|
56
|
+
|
|
57
|
+
:pillar: Leadership Updates
|
|
58
|
+
- Post 1
|
|
59
|
+
- Post 2
|
|
60
|
+
- Post 3
|
|
61
|
+
|
|
62
|
+
:thread: Social Updates
|
|
63
|
+
- Update 1
|
|
64
|
+
- Update 2
|
|
65
|
+
- Update 3
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
## Instructions
|
|
2
|
+
You are an assistant for answering questions that are being asked across the company. Every week, there are lots of questions that get asked across the company, and your goal is to try to summarize what those questions are. We want our company to be well-informed and on the same page, so your job is to produce a set of frequently asked questions that our employees are asking and attempt to answer them. Your singular job is to do two things:
|
|
3
|
+
|
|
4
|
+
- Find questions that are big sources of confusion for lots of employees at the company, generally about things that affect a large portion of the employee base
|
|
5
|
+
- Attempt to give a nice summarized answer to that question in order to minimize confusion.
|
|
6
|
+
|
|
7
|
+
Some examples of areas that may be interesting to folks: recent corporate events (fundraising, new executives, etc.), upcoming launches, hiring progress, changes to vision or focus, etc.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Tools Available
|
|
11
|
+
You should use the company's available tools, where communication and work happens. For most companies, it looks something like this:
|
|
12
|
+
- Slack: questions being asked across the company - it could be questions in response to posts with lots of responses, questions being asked with lots of reactions or thumbs up to show support, or anything else to show that a large number of employees want to ask the same things
|
|
13
|
+
- Email: emails with FAQs written directly in them can be a good source as well
|
|
14
|
+
- Documents: docs in places like Google Drive, linked on calendar events, etc. can also be a good source of FAQs, either directly added or inferred based on the contents of the doc
|
|
15
|
+
|
|
16
|
+
## Formatting
|
|
17
|
+
The formatting should be pretty basic:
|
|
18
|
+
|
|
19
|
+
- *Question*: [insert question - 1 sentence]
|
|
20
|
+
- *Answer*: [insert answer - 1-2 sentence]
|
|
21
|
+
|
|
22
|
+
## Guidance
|
|
23
|
+
Make sure you're being holistic in your questions. Don't focus too much on just the user in question or the team they are a part of, but try to capture the entire company. Try to be as holistic as you can in reading all the tools available, producing responses that are relevant to all at the company.
|
|
24
|
+
|
|
25
|
+
## Answer Guidelines
|
|
26
|
+
- Base answers on official company communications when possible
|
|
27
|
+
- If information is uncertain, indicate that clearly
|
|
28
|
+
- Link to authoritative sources (docs, announcements, emails)
|
|
29
|
+
- Keep tone professional but approachable
|
|
30
|
+
- Flag if a question requires executive input or official response
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
## Instructions
|
|
2
|
+
You are being asked to write internal company communication that doesn't fit into the standard formats (3P
|
|
3
|
+
updates, newsletters, or FAQs).
|
|
4
|
+
|
|
5
|
+
Before proceeding:
|
|
6
|
+
1. Ask the user about their target audience
|
|
7
|
+
2. Understand the communication's purpose
|
|
8
|
+
3. Clarify the desired tone (formal, casual, urgent, informational)
|
|
9
|
+
4. Confirm any specific formatting requirements
|
|
10
|
+
|
|
11
|
+
Use these general principles:
|
|
12
|
+
- Be clear and concise
|
|
13
|
+
- Use active voice
|
|
14
|
+
- Put the most important information first
|
|
15
|
+
- Include relevant links and references
|
|
16
|
+
- Match the company's communication style
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: technical-writing
|
|
3
|
+
description: Write clear, scannable technical documentation including READMEs, API docs, architecture docs, runbooks, and onboarding guides. Trigger when writing or improving technical documentation, READMEs, or developer guides.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Technical Writing Guide
|
|
7
|
+
|
|
8
|
+
Good technical documentation is precise, scannable, and respects the reader's time. It answers the reader's question in the fewest words possible.
|
|
9
|
+
|
|
10
|
+
## Core Principles
|
|
11
|
+
|
|
12
|
+
1. **Lead with the answer** — state the conclusion before the explanation
|
|
13
|
+
2. **One idea per sentence** — if you need a semicolon, consider two sentences
|
|
14
|
+
3. **Active voice** — "Click Save" not "The Save button should be clicked"
|
|
15
|
+
4. **Present tense** — "The function returns" not "The function will return"
|
|
16
|
+
5. **Concrete over abstract** — show an example before explaining the concept
|
|
17
|
+
|
|
18
|
+
## Document Types
|
|
19
|
+
|
|
20
|
+
### README
|
|
21
|
+
|
|
22
|
+
The README is the front door. A developer should understand what the project does in 30 seconds.
|
|
23
|
+
|
|
24
|
+
```markdown
|
|
25
|
+
# Project Name
|
|
26
|
+
|
|
27
|
+
One sentence describing what this does and who it's for.
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
\`\`\`bash
|
|
32
|
+
npm install my-package
|
|
33
|
+
\`\`\`
|
|
34
|
+
|
|
35
|
+
\`\`\`ts
|
|
36
|
+
import { doThing } from 'my-package';
|
|
37
|
+
doThing({ input: 'example' });
|
|
38
|
+
// → { result: 'processed' }
|
|
39
|
+
\`\`\`
|
|
40
|
+
|
|
41
|
+
## Why This Exists
|
|
42
|
+
|
|
43
|
+
What problem does this solve? What alternatives exist and why did you build this instead?
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
Full installation steps including prerequisites.
|
|
48
|
+
|
|
49
|
+
## API Reference
|
|
50
|
+
|
|
51
|
+
...or link to separate docs.
|
|
52
|
+
|
|
53
|
+
## Contributing
|
|
54
|
+
|
|
55
|
+
How to run tests, PR process, coding style.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**README Anti-patterns:**
|
|
59
|
+
- Starting with badges (put them at the bottom)
|
|
60
|
+
- Long feature lists before a code example
|
|
61
|
+
- "This project is..." — just say what it does
|
|
62
|
+
- Installation steps before showing what you get
|
|
63
|
+
|
|
64
|
+
### API Documentation
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
## POST /api/users
|
|
68
|
+
|
|
69
|
+
Create a new user account.
|
|
70
|
+
|
|
71
|
+
**Request**
|
|
72
|
+
|
|
73
|
+
\`\`\`http
|
|
74
|
+
POST /api/users
|
|
75
|
+
Content-Type: application/json
|
|
76
|
+
Authorization: Bearer <token>
|
|
77
|
+
|
|
78
|
+
{
|
|
79
|
+
"name": "Alice Smith",
|
|
80
|
+
"email": "alice@example.com",
|
|
81
|
+
"role": "member"
|
|
82
|
+
}
|
|
83
|
+
\`\`\`
|
|
84
|
+
|
|
85
|
+
**Response** `201 Created`
|
|
86
|
+
|
|
87
|
+
\`\`\`json
|
|
88
|
+
{
|
|
89
|
+
"id": "usr_abc123",
|
|
90
|
+
"name": "Alice Smith",
|
|
91
|
+
"email": "alice@example.com",
|
|
92
|
+
"role": "member",
|
|
93
|
+
"createdAt": "2025-03-12T10:00:00Z"
|
|
94
|
+
}
|
|
95
|
+
\`\`\`
|
|
96
|
+
|
|
97
|
+
**Errors**
|
|
98
|
+
|
|
99
|
+
| Status | Code | Description |
|
|
100
|
+
|--------|------|-------------|
|
|
101
|
+
| 400 | `validation_error` | Missing or invalid fields |
|
|
102
|
+
| 409 | `email_taken` | Email already in use |
|
|
103
|
+
| 403 | `insufficient_permissions` | Requires admin role |
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Architecture Document
|
|
107
|
+
|
|
108
|
+
```markdown
|
|
109
|
+
# [System Name] Architecture
|
|
110
|
+
|
|
111
|
+
## Overview
|
|
112
|
+
|
|
113
|
+
One paragraph: what the system does, who uses it, and the key architectural decision.
|
|
114
|
+
|
|
115
|
+
## Context Diagram
|
|
116
|
+
|
|
117
|
+
[Diagram showing this system + adjacent systems]
|
|
118
|
+
|
|
119
|
+
## Key Design Decisions
|
|
120
|
+
|
|
121
|
+
### Decision 1: Why We Use [Technology X]
|
|
122
|
+
|
|
123
|
+
**Context**: What problem were we solving?
|
|
124
|
+
**Options considered**: A, B, C
|
|
125
|
+
**Decision**: We chose X because...
|
|
126
|
+
**Consequences**: Trade-offs we accepted
|
|
127
|
+
|
|
128
|
+
## Component Overview
|
|
129
|
+
|
|
130
|
+
| Component | Purpose | Technology |
|
|
131
|
+
|-----------|---------|-----------|
|
|
132
|
+
| API Gateway | Request routing, auth | Nginx |
|
|
133
|
+
| App Server | Business logic | Node.js |
|
|
134
|
+
| Database | Persistent storage | PostgreSQL |
|
|
135
|
+
|
|
136
|
+
## Data Flow
|
|
137
|
+
|
|
138
|
+
1. Request arrives at Load Balancer
|
|
139
|
+
2. ...
|
|
140
|
+
|
|
141
|
+
## Failure Modes
|
|
142
|
+
|
|
143
|
+
What happens when each component fails?
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Runbook
|
|
147
|
+
|
|
148
|
+
```markdown
|
|
149
|
+
# Runbook: [Incident Type]
|
|
150
|
+
|
|
151
|
+
**Severity**: P1 / P2 / P3
|
|
152
|
+
**Owner**: Platform Team
|
|
153
|
+
**Last Updated**: 2025-03-12
|
|
154
|
+
|
|
155
|
+
## Symptoms
|
|
156
|
+
|
|
157
|
+
- Error rate > 5% on `/api/checkout`
|
|
158
|
+
- Users seeing 500 errors on payment
|
|
159
|
+
|
|
160
|
+
## Immediate Actions (< 5 minutes)
|
|
161
|
+
|
|
162
|
+
1. Check error rate: [link to dashboard]
|
|
163
|
+
2. Check recent deploys: `kubectl rollout history deployment/api`
|
|
164
|
+
3. If recent deploy caused this: `kubectl rollout undo deployment/api`
|
|
165
|
+
|
|
166
|
+
## Diagnosis
|
|
167
|
+
|
|
168
|
+
### Step 1: Isolate the component
|
|
169
|
+
|
|
170
|
+
\`\`\`bash
|
|
171
|
+
kubectl logs -l app=api --tail=200 | grep ERROR
|
|
172
|
+
\`\`\`
|
|
173
|
+
|
|
174
|
+
Look for: database timeouts, memory errors, third-party API failures.
|
|
175
|
+
|
|
176
|
+
### Step 2: Check dependencies
|
|
177
|
+
|
|
178
|
+
- Database: [link to RDS dashboard]
|
|
179
|
+
- Payment API: [link to Stripe status page]
|
|
180
|
+
|
|
181
|
+
## Resolution
|
|
182
|
+
|
|
183
|
+
**If database issue**: Follow [Database Incident Runbook]
|
|
184
|
+
**If Stripe issue**: Enable fallback payment processor
|
|
185
|
+
**If memory**: Scale up: `kubectl scale deployment api --replicas=8`
|
|
186
|
+
|
|
187
|
+
## Post-Incident
|
|
188
|
+
|
|
189
|
+
- [ ] Write incident report (use template)
|
|
190
|
+
- [ ] Fix root cause
|
|
191
|
+
- [ ] Add alert to catch this earlier next time
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Writing Techniques
|
|
195
|
+
|
|
196
|
+
### The Inverted Pyramid
|
|
197
|
+
|
|
198
|
+
Lead with the most important information, add details after:
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
Bad: "First, open your terminal. Then navigate to the project directory.
|
|
202
|
+
After that, run the install command. This will install dependencies."
|
|
203
|
+
|
|
204
|
+
Good: "Install dependencies: `npm install`
|
|
205
|
+
Run from the project root directory."
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Before/After Examples
|
|
209
|
+
|
|
210
|
+
Always more useful than abstract descriptions:
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
Bad: "The function handles edge cases."
|
|
214
|
+
|
|
215
|
+
Good: "The function returns `null` for empty inputs:
|
|
216
|
+
\`\`\`
|
|
217
|
+
formatDate(null) → null
|
|
218
|
+
formatDate('') → null
|
|
219
|
+
formatDate('2025-01-01') → '2025-01-01T00:00:00Z'
|
|
220
|
+
\`\`\`"
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Admonitions (Use Sparingly)
|
|
224
|
+
|
|
225
|
+
```markdown
|
|
226
|
+
> **Note**: This only applies when using the SQL adapter.
|
|
227
|
+
|
|
228
|
+
> **Warning**: This operation is irreversible.
|
|
229
|
+
|
|
230
|
+
> **Tip**: Run with `--verbose` to see detailed output.
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Style Rules
|
|
234
|
+
|
|
235
|
+
| Avoid | Prefer |
|
|
236
|
+
|-------|--------|
|
|
237
|
+
| "simply", "just", "easily" | Remove the word |
|
|
238
|
+
| "in order to" | "to" |
|
|
239
|
+
| "utilize" | "use" |
|
|
240
|
+
| "at this point in time" | "now" |
|
|
241
|
+
| "it is important to note that" | Remove, or say it directly |
|
|
242
|
+
| "Please note that" | Remove |
|
|
243
|
+
| Passive voice | Active voice |
|
|
244
|
+
| Future tense ("will return") | Present tense ("returns") |
|
|
245
|
+
|
|
246
|
+
## Code Examples
|
|
247
|
+
|
|
248
|
+
- Always use real, working examples (not `foo`, `bar`)
|
|
249
|
+
- Show input and expected output
|
|
250
|
+
- Keep examples short — one concept per example
|
|
251
|
+
- Use syntax highlighting (specify the language in code fences)
|
|
252
|
+
|
|
253
|
+
```ts
|
|
254
|
+
// Bad: abstract example
|
|
255
|
+
function process(a, b) {
|
|
256
|
+
return a + b;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Good: concrete example
|
|
260
|
+
function formatCurrency(amount: number, currency: string): string {
|
|
261
|
+
return new Intl.NumberFormat('en-US', { style: 'currency', currency }).format(amount);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
formatCurrency(29.99, 'USD'); // → "$29.99"
|
|
265
|
+
formatCurrency(1000, 'EUR'); // → "€1,000.00"
|
|
266
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
code: qa
|
|
2
|
+
name: "QA"
|
|
3
|
+
description: "Quality assurance toolkit — test suite generation, Playwright-based web app testing, and comprehensive testing strategy covering unit, integration, E2E, and contract testing. 3 skills."
|
|
4
|
+
default_selected: false
|
|
5
|
+
skills_count: 3
|
|
6
|
+
skills:
|
|
7
|
+
- test-writer
|
|
8
|
+
- webapp-testing
|
|
9
|
+
- test-strategy
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-strategy
|
|
3
|
+
description: Comprehensive testing strategy covering unit, integration, E2E, and contract testing. Trigger when planning a testing approach, setting up testing infrastructure, deciding what to test, or improving test coverage.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Testing Strategy
|
|
7
|
+
|
|
8
|
+
Good tests give you confidence to ship. Bad tests slow you down with false failures. The goal is a fast, reliable suite that catches real bugs.
|
|
9
|
+
|
|
10
|
+
## The Testing Trophy (Preferred over Pyramid)
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
[E2E] ← few, high-value user journeys
|
|
14
|
+
[Integration] ← most tests live here
|
|
15
|
+
[ Unit Tests ] ← fast, isolated logic
|
|
16
|
+
[Static Analysis] ← TypeScript, ESLint (always-on)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- **Static**: TypeScript + ESLint. Free bug prevention, no maintenance cost.
|
|
20
|
+
- **Unit**: Test pure logic, utilities, transformers in isolation.
|
|
21
|
+
- **Integration**: Test components, API routes, services with real dependencies (DB, filesystem).
|
|
22
|
+
- **E2E**: Test critical user paths through the actual UI.
|
|
23
|
+
|
|
24
|
+
## What to Test
|
|
25
|
+
|
|
26
|
+
### Test this:
|
|
27
|
+
- Business logic with branches (if/else, edge cases)
|
|
28
|
+
- Data transformations and calculations
|
|
29
|
+
- Error handling paths
|
|
30
|
+
- Permissions and access control
|
|
31
|
+
- Integrations between services
|
|
32
|
+
- Critical user journeys (checkout, login, signup)
|
|
33
|
+
|
|
34
|
+
### Don't test this:
|
|
35
|
+
- Implementation details (internal state, private methods)
|
|
36
|
+
- Third-party library behavior
|
|
37
|
+
- Simple getters/setters with no logic
|
|
38
|
+
- One-line functions with no branches
|
|
39
|
+
|
|
40
|
+
## Unit Testing
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
// vitest or jest — pure function, no mocks needed
|
|
44
|
+
import { calculateDiscount } from '../pricing';
|
|
45
|
+
|
|
46
|
+
describe('calculateDiscount', () => {
|
|
47
|
+
it('applies percentage discount correctly', () => {
|
|
48
|
+
expect(calculateDiscount(100, { type: 'percent', value: 20 })).toBe(80);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('applies fixed discount correctly', () => {
|
|
52
|
+
expect(calculateDiscount(100, { type: 'fixed', value: 15 })).toBe(85);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('returns 0 when discount exceeds price', () => {
|
|
56
|
+
expect(calculateDiscount(10, { type: 'fixed', value: 50 })).toBe(0);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('throws on negative discount value', () => {
|
|
60
|
+
expect(() => calculateDiscount(100, { type: 'percent', value: -10 }))
|
|
61
|
+
.toThrow('Discount value cannot be negative');
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Mocking
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
// Mock at the module level, not function by function
|
|
70
|
+
vi.mock('../lib/email', () => ({
|
|
71
|
+
sendEmail: vi.fn().mockResolvedValue({ messageId: 'test-123' }),
|
|
72
|
+
}));
|
|
73
|
+
|
|
74
|
+
// Spy on existing implementation
|
|
75
|
+
const sendSpy = vi.spyOn(emailService, 'sendEmail').mockResolvedValue(null);
|
|
76
|
+
|
|
77
|
+
// Reset between tests
|
|
78
|
+
afterEach(() => { vi.clearAllMocks(); });
|
|
79
|
+
|
|
80
|
+
// Verify calls
|
|
81
|
+
expect(sendSpy).toHaveBeenCalledWith({
|
|
82
|
+
to: 'user@example.com',
|
|
83
|
+
subject: 'Welcome!',
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Integration Testing
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
// Test with real database (use test DB or transactions)
|
|
91
|
+
import { db } from '../lib/db';
|
|
92
|
+
import { createUser } from '../services/user';
|
|
93
|
+
|
|
94
|
+
beforeAll(async () => { await db.$connect(); });
|
|
95
|
+
afterAll(async () => { await db.$disconnect(); });
|
|
96
|
+
beforeEach(async () => { await db.$transaction([db.user.deleteMany()]); });
|
|
97
|
+
|
|
98
|
+
describe('createUser', () => {
|
|
99
|
+
it('creates a user and sends welcome email', async () => {
|
|
100
|
+
const user = await createUser({ name: 'Alice', email: 'alice@example.com' });
|
|
101
|
+
|
|
102
|
+
// Verify in database
|
|
103
|
+
const dbUser = await db.user.findUnique({ where: { id: user.id } });
|
|
104
|
+
expect(dbUser).toMatchObject({ name: 'Alice', email: 'alice@example.com' });
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('rejects duplicate email', async () => {
|
|
108
|
+
await createUser({ name: 'Alice', email: 'alice@example.com' });
|
|
109
|
+
await expect(
|
|
110
|
+
createUser({ name: 'Bob', email: 'alice@example.com' })
|
|
111
|
+
).rejects.toThrow('Email already in use');
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### API Route Testing
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
// Next.js / Express API testing
|
|
120
|
+
import { createMocks } from 'node-mocks-http';
|
|
121
|
+
import handler from '../pages/api/users/[id]';
|
|
122
|
+
|
|
123
|
+
it('returns 404 for unknown user', async () => {
|
|
124
|
+
const { req, res } = createMocks({
|
|
125
|
+
method: 'GET',
|
|
126
|
+
query: { id: 'nonexistent-id' },
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
await handler(req, res);
|
|
130
|
+
|
|
131
|
+
expect(res._getStatusCode()).toBe(404);
|
|
132
|
+
expect(JSON.parse(res._getData())).toEqual({ error: 'User not found' });
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Component Testing
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
// React Testing Library — test behavior, not implementation
|
|
140
|
+
import { render, screen, userEvent } from '@testing-library/react';
|
|
141
|
+
import { LoginForm } from './LoginForm';
|
|
142
|
+
|
|
143
|
+
describe('LoginForm', () => {
|
|
144
|
+
it('shows error on empty submit', async () => {
|
|
145
|
+
render(<LoginForm onSuccess={vi.fn()} />);
|
|
146
|
+
|
|
147
|
+
await userEvent.click(screen.getByRole('button', { name: 'Sign in' }));
|
|
148
|
+
|
|
149
|
+
expect(screen.getByText('Email is required')).toBeInTheDocument();
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('calls onSuccess with credentials on valid submit', async () => {
|
|
153
|
+
const onSuccess = vi.fn();
|
|
154
|
+
render(<LoginForm onSuccess={onSuccess} />);
|
|
155
|
+
|
|
156
|
+
await userEvent.type(screen.getByLabelText('Email'), 'user@example.com');
|
|
157
|
+
await userEvent.type(screen.getByLabelText('Password'), 'password123');
|
|
158
|
+
await userEvent.click(screen.getByRole('button', { name: 'Sign in' }));
|
|
159
|
+
|
|
160
|
+
expect(onSuccess).toHaveBeenCalledWith({
|
|
161
|
+
email: 'user@example.com',
|
|
162
|
+
password: 'password123',
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Queries Priority (RTL)
|
|
169
|
+
|
|
170
|
+
1. `getByRole` — accessible roles (button, heading, textbox)
|
|
171
|
+
2. `getByLabelText` — form inputs by label
|
|
172
|
+
3. `getByPlaceholderText` — inputs by placeholder
|
|
173
|
+
4. `getByText` — visible text
|
|
174
|
+
5. `getByTestId` — last resort (`data-testid`)
|
|
175
|
+
|
|
176
|
+
## E2E Testing with Playwright
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
// tests/e2e/checkout.spec.ts
|
|
180
|
+
import { test, expect } from '@playwright/test';
|
|
181
|
+
|
|
182
|
+
test.describe('Checkout Flow', () => {
|
|
183
|
+
test.beforeEach(async ({ page }) => {
|
|
184
|
+
await page.goto('/products');
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
test('user can complete purchase', async ({ page }) => {
|
|
188
|
+
// Add to cart
|
|
189
|
+
await page.getByRole('button', { name: 'Add to cart' }).first().click();
|
|
190
|
+
await page.getByRole('link', { name: 'Cart (1)' }).click();
|
|
191
|
+
|
|
192
|
+
// Checkout
|
|
193
|
+
await page.getByRole('button', { name: 'Checkout' }).click();
|
|
194
|
+
await page.getByLabel('Card number').fill('4242424242424242');
|
|
195
|
+
await page.getByLabel('Expiry').fill('12/30');
|
|
196
|
+
await page.getByLabel('CVC').fill('123');
|
|
197
|
+
await page.getByRole('button', { name: 'Pay' }).click();
|
|
198
|
+
|
|
199
|
+
// Confirm
|
|
200
|
+
await expect(page.getByText('Order confirmed')).toBeVisible();
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Playwright Config
|
|
206
|
+
|
|
207
|
+
```ts
|
|
208
|
+
// playwright.config.ts
|
|
209
|
+
export default {
|
|
210
|
+
testDir: './tests/e2e',
|
|
211
|
+
use: {
|
|
212
|
+
baseURL: process.env.E2E_BASE_URL ?? 'http://localhost:3000',
|
|
213
|
+
screenshot: 'only-on-failure',
|
|
214
|
+
video: 'retain-on-failure',
|
|
215
|
+
},
|
|
216
|
+
projects: [
|
|
217
|
+
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
|
|
218
|
+
{ name: 'mobile', use: { ...devices['iPhone 14'] } },
|
|
219
|
+
],
|
|
220
|
+
};
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Test Organization
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
src/
|
|
227
|
+
├── components/
|
|
228
|
+
│ ├── Button.tsx
|
|
229
|
+
│ └── Button.test.tsx ← co-located unit/component tests
|
|
230
|
+
├── services/
|
|
231
|
+
│ ├── user.ts
|
|
232
|
+
│ └── user.test.ts
|
|
233
|
+
tests/
|
|
234
|
+
├── integration/ ← integration tests (separate)
|
|
235
|
+
│ └── api.test.ts
|
|
236
|
+
└── e2e/ ← E2E tests (separate)
|
|
237
|
+
└── checkout.spec.ts
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Coverage Targets
|
|
241
|
+
|
|
242
|
+
| Layer | Target | Rationale |
|
|
243
|
+
|-------|---------|-----------|
|
|
244
|
+
| Business logic | 90%+ | High value, easy to test |
|
|
245
|
+
| API routes | 80%+ | Integration tested |
|
|
246
|
+
| UI components | 70%+ | Test behavior over structure |
|
|
247
|
+
| E2E | Key paths only | Expensive to maintain |
|
|
248
|
+
|
|
249
|
+
Run coverage: `vitest --coverage` or `jest --coverage`
|
|
250
|
+
|
|
251
|
+
## CI Configuration
|
|
252
|
+
|
|
253
|
+
```yaml
|
|
254
|
+
# .github/workflows/test.yml
|
|
255
|
+
jobs:
|
|
256
|
+
test:
|
|
257
|
+
steps:
|
|
258
|
+
- run: npm run typecheck # fast, catches most bugs
|
|
259
|
+
- run: npm run lint # code quality
|
|
260
|
+
- run: npm run test:unit # fast feedback
|
|
261
|
+
- run: npm run test:integration # needs DB
|
|
262
|
+
- run: npm run test:e2e # slowest, run last
|
|
263
|
+
```
|