@mohammadhprp/system-prompt 0.11.0 → 0.11.2
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/framework/agents/backend-architect.md +1 -1
- package/framework/commands/commit.md +0 -3
- package/framework/mcps/figma-mcp-go/README.md +0 -1
- package/framework/mcps/gitlab-mcp/README.md +0 -1
- package/framework/mcps/jira-mcp/README.md +0 -1
- package/framework/mcps/laravel-boost/README.md +0 -1
- package/framework/mcps/notion-mcp/README.md +0 -1
- package/framework/mcps/supabase-mcp/README.md +0 -1
- package/framework/plugins/opencode-goal-plugin/README.md +0 -1
- package/framework/references/standards/api.md +0 -1
- package/framework/references/standards/architecture.md +0 -1
- package/framework/references/standards/database.md +0 -1
- package/framework/references/standards/debugging.md +0 -1
- package/framework/references/standards/documentation.md +0 -2
- package/framework/references/standards/logging.md +0 -1
- package/framework/references/standards/naming.md +0 -1
- package/framework/references/standards/observability.md +0 -1
- package/framework/references/standards/performance.md +0 -1
- package/framework/references/standards/pull-requests.md +0 -1
- package/framework/references/standards/security.md +0 -1
- package/framework/references/standards/testing.md +0 -1
- package/framework/skills/README.md +15 -3
- package/framework/skills/codenavi/SKILL.md +306 -0
- package/framework/skills/codenavi/examples.md +33 -0
- package/framework/skills/codenavi/references/coding-principles.md +143 -0
- package/framework/skills/codenavi/references/notebook-spec.md +171 -0
- package/framework/skills/create-adr/SKILL.md +429 -0
- package/framework/skills/create-adr/examples.md +35 -0
- package/framework/skills/docs-writer/SKILL.md +39 -0
- package/framework/skills/docs-writer/examples.md +34 -0
- package/framework/skills/docs-writer/references/style-guide.md +72 -0
- package/framework/skills/frontend-design/SKILL.md +55 -0
- package/framework/skills/frontend-design/examples.md +45 -0
- package/framework/skills/humanizer/SKILL.md +412 -0
- package/framework/skills/humanizer/examples.md +46 -0
- package/framework/skills/learning-opportunities/SKILL.md +140 -0
- package/framework/skills/learning-opportunities/examples.md +34 -0
- package/framework/skills/learning-opportunities/references/PRINCIPLES.md +42 -0
- package/framework/skills/perf-web-optimization/SKILL.md +163 -0
- package/framework/skills/perf-web-optimization/examples.md +35 -0
- package/framework/skills/perf-web-optimization/references/bundle-optimization.md +180 -0
- package/framework/skills/perf-web-optimization/references/core-web-vitals.md +154 -0
- package/framework/skills/perf-web-optimization/references/image-optimization.md +170 -0
- package/framework/skills/security-best-practices/LICENSE.txt +201 -0
- package/framework/skills/security-best-practices/SKILL.md +89 -0
- package/framework/skills/security-best-practices/examples.md +35 -0
- package/framework/skills/security-best-practices/references/golang-general-backend-security.md +988 -0
- package/framework/skills/security-best-practices/references/javascript-express-web-server-security.md +1151 -0
- package/framework/skills/security-best-practices/references/javascript-general-web-frontend-security.md +725 -0
- package/framework/skills/security-best-practices/references/javascript-jquery-web-frontend-security.md +672 -0
- package/framework/skills/security-best-practices/references/javascript-typescript-nextjs-web-server-security.md +1138 -0
- package/framework/skills/security-best-practices/references/javascript-typescript-react-web-frontend-security.md +975 -0
- package/framework/skills/security-best-practices/references/javascript-typescript-vue-web-frontend-security.md +789 -0
- package/framework/skills/security-best-practices/references/python-django-web-server-security.md +880 -0
- package/framework/skills/security-best-practices/references/python-fastapi-web-server-security.md +1030 -0
- package/framework/skills/security-best-practices/references/python-flask-web-server-security.md +835 -0
- package/framework/skills/sentry/SKILL.md +127 -0
- package/framework/skills/sentry/examples.md +34 -0
- package/framework/skills/sentry/scripts/sentry_api.py +238 -0
- package/framework/skills/show-me/SKILL.md +127 -0
- package/framework/skills/show-me/examples.md +78 -0
- package/framework/skills/spec-driven-eval/SKILL.md +341 -0
- package/framework/skills/spec-driven-eval/examples.md +35 -0
- package/framework/skills/spec-driven-eval/references/quickstart.md +118 -0
- package/framework/skills/spec-driven-eval/references/reference.md +295 -0
- package/framework/skills/technical-design-doc-creator/README.md +411 -0
- package/framework/skills/technical-design-doc-creator/SKILL.md +1484 -0
- package/framework/skills/technical-design-doc-creator/examples.md +35 -0
- package/framework/skills/tlc-spec-driven/SKILL.md +184 -0
- package/framework/skills/tlc-spec-driven/examples.md +34 -0
- package/framework/skills/tlc-spec-driven/references/code-analysis.md +98 -0
- package/framework/skills/tlc-spec-driven/references/coding-principles.md +72 -0
- package/framework/skills/tlc-spec-driven/references/context-limits.md +31 -0
- package/framework/skills/tlc-spec-driven/references/design.md +199 -0
- package/framework/skills/tlc-spec-driven/references/discuss.md +159 -0
- package/framework/skills/tlc-spec-driven/references/implement.md +436 -0
- package/framework/skills/tlc-spec-driven/references/lessons.md +115 -0
- package/framework/skills/tlc-spec-driven/references/memory.md +144 -0
- package/framework/skills/tlc-spec-driven/references/specify.md +228 -0
- package/framework/skills/tlc-spec-driven/references/sub-agents.md +147 -0
- package/framework/skills/tlc-spec-driven/references/tasks.md +451 -0
- package/framework/skills/tlc-spec-driven/references/validate.md +355 -0
- package/framework/skills/tlc-spec-driven/scripts/check_commit.py +115 -0
- package/framework/skills/tlc-spec-driven/scripts/lessons.py +412 -0
- package/framework/skills/tlc-spec-driven/scripts/validate_spec.py +260 -0
- package/framework/skills/tlc-spec-driven/scripts/validate_state.py +162 -0
- package/framework/skills/tlc-spec-driven/scripts/validate_tasks.py +251 -0
- package/framework/skills/web-design-guidelines/SKILL.md +65 -0
- package/framework/skills/web-design-guidelines/examples.md +32 -0
- package/framework/skills/web-design-guidelines/references/guideline.md +174 -0
- package/package.json +1 -1
- package/src/catalog.js +15 -3
- package/src/installer.js +66 -1
- package/framework/skills/backend-engineer/SKILL.md +0 -76
- package/framework/skills/backend-engineer/examples.md +0 -31
- package/framework/skills/documentation/SKILL.md +0 -74
- package/framework/skills/documentation/examples.md +0 -31
package/package.json
CHANGED
package/src/catalog.js
CHANGED
|
@@ -6,20 +6,32 @@ export const categories = {
|
|
|
6
6
|
items: [
|
|
7
7
|
{ id: 'agent-browser', name: 'Agent Browser', description: 'Automate browser and Electron workflows for navigation, testing, screenshots, and data extraction' },
|
|
8
8
|
{ id: 'backend-best-practices', name: 'Backend Best Practices', description: 'Consolidated backend engineering practices across API, data, security, testing, and operations' },
|
|
9
|
-
{ id: 'backend-engineer', name: 'Backend Engineer', description: 'Analyze backend requirements, risks, and implementation plans' },
|
|
10
9
|
{ id: 'brainstorming', name: 'Brainstorming', description: 'Turn ideas into fully formed designs through dialogue' },
|
|
11
10
|
{ id: 'brand-guidelines', name: 'Brand Guidelines', description: 'Apply official brand colors and typography' },
|
|
12
11
|
{ id: 'code-review', name: 'Code Review', description: 'Review backend changes for correctness and maintainability' },
|
|
12
|
+
{ id: 'codenavi', name: 'CodeNavi', description: 'Navigate unknown codebases with precision, a persistent .notebook knowledge base, and surgical implementation' },
|
|
13
|
+
{ id: 'create-adr', name: 'Create ADR', description: 'Create Architecture Decision Records documenting significant architectural choices and rationale' },
|
|
13
14
|
{ id: 'design', name: 'Design Like Damien', description: 'Premium UI design philosophy and Lovable prompting' },
|
|
14
15
|
{ id: 'diagram-design', name: 'Diagram Design', description: 'Create technical and product diagrams as standalone HTML with inline SVG' },
|
|
15
|
-
{ id: '
|
|
16
|
+
{ id: 'docs-writer', name: 'Docs Writer', description: 'Write, review, and edit documentation files with consistent structure, tone, and technical accuracy' },
|
|
16
17
|
{ id: 'find-skills', name: 'Find Skills', description: 'Discover, evaluate, and install agent skills for specialized tasks' },
|
|
18
|
+
{ id: 'frontend-design', name: 'Frontend Design', description: 'Distinctive, intentional visual design for new UI or reshaping existing UI' },
|
|
17
19
|
{ id: 'gitlab-mcp', name: 'GitLab MCP', description: 'Work with GitLab via MCP for MRs, issues, pipelines' },
|
|
20
|
+
{ id: 'humanizer', name: 'Humanizer', description: 'Remove signs of AI-generated writing to make text sound more natural and human' },
|
|
18
21
|
{ id: 'jira-mcp', name: 'Jira MCP', description: 'Work with Jira MCP for issue management and JQL search' },
|
|
19
22
|
{ id: 'laravel-best-practices', name: 'Laravel Best Practices', description: 'Laravel patterns for Eloquent, validation, testing' },
|
|
23
|
+
{ id: 'learning-opportunities', name: 'Learning Opportunities', description: 'Facilitate deliberate skill development during AI-assisted coding with short, interactive exercises' },
|
|
20
24
|
{ id: 'lavish', name: 'Lavish', description: 'Turn complex responses into rich HTML artifacts' },
|
|
21
25
|
{ id: 'notion-mcp', name: 'Notion MCP', description: 'Work with Notion MCP for pages, databases, search' },
|
|
22
|
-
{ id: '
|
|
26
|
+
{ id: 'perf-web-optimization', name: 'Web Performance Optimization', description: 'Optimize web performance: bundle size, images, caching, lazy loading, and overall page speed' },
|
|
27
|
+
{ id: 'security-best-practices', name: 'Security Best Practices', description: 'Language and framework specific security best-practice reviews and secure-by-default coding help' },
|
|
28
|
+
{ id: 'sentry', name: 'Sentry', description: 'Inspect Sentry issues, summarize production errors, and pull health data via the Sentry API' },
|
|
29
|
+
{ id: 'show-me', name: 'Show Me', description: 'Explain the current topic visually with diagrams, code-shape sketches, and focused HTML artifacts' },
|
|
30
|
+
{ id: 'skill-creator', name: 'Skill Creator', description: 'Create and evaluate new agent skills' },
|
|
31
|
+
{ id: 'spec-driven-eval', name: 'Spec-Driven Eval', description: 'Score how completely an implementation fulfills a PRD/spec, case by case, into a single comparable grade' },
|
|
32
|
+
{ id: 'technical-design-doc-creator', name: 'Technical Design Doc Creator', description: 'Create comprehensive Technical Design Documents with mandatory and optional sections through interactive discovery' },
|
|
33
|
+
{ id: 'tlc-spec-driven', name: 'TLC Spec-Driven', description: 'Feature planning and implementation with adaptive phases, EARS testable requirements, atomic commits, and independent verification' },
|
|
34
|
+
{ id: 'web-design-guidelines', name: 'Web Design Guidelines', description: 'Review UI code for Web Interface Guidelines compliance: accessibility, interaction patterns, and design best practices' }
|
|
23
35
|
],
|
|
24
36
|
},
|
|
25
37
|
|
package/src/installer.js
CHANGED
|
@@ -10,7 +10,72 @@ const packageRoot = resolve(__dirname, '..');
|
|
|
10
10
|
|
|
11
11
|
const AGENTS_MD = `# AGENTS.md
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
|
|
14
|
+
|
|
15
|
+
Read CONTEXT.md for repository-specific setup, commands, architecture, tests, and workflow guidance.
|
|
16
|
+
|
|
17
|
+
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
|
|
18
|
+
|
|
19
|
+
## 1. Think Before Coding
|
|
20
|
+
|
|
21
|
+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
|
|
22
|
+
|
|
23
|
+
Before implementing:
|
|
24
|
+
- State your assumptions explicitly. If uncertain, ask.
|
|
25
|
+
- If multiple interpretations exist, present them - don't pick silently.
|
|
26
|
+
- If a simpler approach exists, say so. Push back when warranted.
|
|
27
|
+
- If something is unclear, stop. Name what's confusing. Ask.
|
|
28
|
+
|
|
29
|
+
## 2. Simplicity First
|
|
30
|
+
|
|
31
|
+
**Minimum code that solves the problem. Nothing speculative.**
|
|
32
|
+
|
|
33
|
+
- No features beyond what was asked.
|
|
34
|
+
- No abstractions for single-use code.
|
|
35
|
+
- No "flexibility" or "configurability" that wasn't requested.
|
|
36
|
+
- No error handling for impossible scenarios.
|
|
37
|
+
- If you write 200 lines, and it could be 50, rewrite it.
|
|
38
|
+
|
|
39
|
+
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
|
|
40
|
+
|
|
41
|
+
## 3. Surgical Changes
|
|
42
|
+
|
|
43
|
+
**Touch only what you must. Clean up only your own mess.**
|
|
44
|
+
|
|
45
|
+
When editing existing code:
|
|
46
|
+
- Don't "improve" adjacent code, comments, or formatting.
|
|
47
|
+
- Don't refactor things that aren't broken.
|
|
48
|
+
- Match existing style, even if you'd do it differently.
|
|
49
|
+
- If you notice unrelated dead code, mention it - don't delete it.
|
|
50
|
+
|
|
51
|
+
When your changes create orphans:
|
|
52
|
+
- Remove imports/variables/functions that YOUR changes made unused.
|
|
53
|
+
- Don't remove pre-existing dead code unless asked.
|
|
54
|
+
|
|
55
|
+
The test: Every changed line should trace directly to the user's request.
|
|
56
|
+
|
|
57
|
+
## 4. Goal-Driven Execution
|
|
58
|
+
|
|
59
|
+
**Define success criteria. Loop until verified.**
|
|
60
|
+
|
|
61
|
+
Transform tasks into verifiable goals:
|
|
62
|
+
- "Add validation" → "Write tests for invalid inputs, then make them pass"
|
|
63
|
+
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
|
|
64
|
+
- "Refactor X" → "Ensure tests pass before and after"
|
|
65
|
+
|
|
66
|
+
For multistep tasks, state a brief plan:
|
|
67
|
+
|
|
68
|
+
1. [Step] → verify: [check]
|
|
69
|
+
2. [Step] → verify: [check]
|
|
70
|
+
3. [Step] → verify: [check]
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
|
|
78
|
+
|
|
14
79
|
`;
|
|
15
80
|
|
|
16
81
|
const OPENCODE_GITIGNORE = `.env*
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: backend-engineer
|
|
3
|
-
description: Analyze backend requirements, risks, and implementation plans before coding.
|
|
4
|
-
version: 0.1.0
|
|
5
|
-
---
|
|
6
|
-
# Purpose
|
|
7
|
-
Analyze backend requirements, risks, and implementation plans before coding. This skill guides an AI agent to act with senior backend judgment: clarify the outcome, identify constraints, choose the least complex safe path, and make production impact visible.
|
|
8
|
-
|
|
9
|
-
# When to Activate
|
|
10
|
-
Use this skill when the task involves general backend planning, requirement analysis, problem breakdown, complexity estimates, risk evaluation, and simple solution selection. It is also useful when a request is vague, risky, touches production behavior, changes contracts, changes data, or needs a reviewable engineering plan. Do not activate it for trivial text edits unless the edit changes engineering guidance.
|
|
11
|
-
|
|
12
|
-
# Principles
|
|
13
|
-
- Correctness and data integrity come before speed of implementation.
|
|
14
|
-
- Simplicity is a feature: fewer moving parts means fewer failure modes.
|
|
15
|
-
- Existing contracts must remain compatible unless a breaking change is approved.
|
|
16
|
-
- Every important decision should have a reason, an alternative considered, and an operational consequence.
|
|
17
|
-
- Work should be testable, observable, deployable, and reversible.
|
|
18
|
-
- Prefer explicit boundaries, clear names, and local reasoning over clever shared abstractions.
|
|
19
|
-
- Security and privacy are design inputs, not final review steps.
|
|
20
|
-
|
|
21
|
-
- Requirements analysis must identify users, workflows, data ownership, invariants, and constraints.
|
|
22
|
-
- Break problems into contract, domain, persistence, operations, and delivery concerns.
|
|
23
|
-
- Estimate complexity by counting boundaries, state transitions, migration steps, and failure modes.
|
|
24
|
-
- Evaluate risks before implementation: data loss, authorization gaps, compatibility breaks, latency, and operational burden.
|
|
25
|
-
- Choose the simplest solution that satisfies current known needs and can evolve safely.
|
|
26
|
-
|
|
27
|
-
# Workflow
|
|
28
|
-
1. Restate the user goal in concrete backend terms with explicit scope and non-goals.
|
|
29
|
-
2. Identify actors, data entities, invariants, and failure modes.
|
|
30
|
-
3. Identify external dependencies, integration points, and data flows.
|
|
31
|
-
4. Inspect existing project patterns and conventions before proposing changes.
|
|
32
|
-
5. Decide whether clarifying questions are needed. Ask only questions that materially affect design or risk.
|
|
33
|
-
6. Produce a small plan: contract, data changes, behavior changes, tests, observability, deployment, rollback.
|
|
34
|
-
7. Compare at least one simpler alternative when the proposed solution adds complexity.
|
|
35
|
-
8. Verify with the narrowest meaningful tests, then broader checks when risk justifies them.
|
|
36
|
-
9. Summarize tradeoffs, residual risks, and follow-up work.
|
|
37
|
-
|
|
38
|
-
# Rules
|
|
39
|
-
- Never assume hidden requirements, traffic scale, compliance needs, or data retention rules.
|
|
40
|
-
- Do not introduce new infrastructure unless the current requirement cannot be met safely without it.
|
|
41
|
-
- Do not hide breaking changes in refactors.
|
|
42
|
-
- Do not weaken authorization, validation, transaction safety, or error handling to make implementation easier.
|
|
43
|
-
- Keep public contracts, migrations, and operational changes explicit in the deliverable.
|
|
44
|
-
- Reference related standards: references/standards/architecture.md, references/standards/testing.md.
|
|
45
|
-
|
|
46
|
-
# Deliverables
|
|
47
|
-
- A concise engineering plan or review summary.
|
|
48
|
-
- Explicit assumptions and clarifying questions when needed.
|
|
49
|
-
- Contract, data, test, observability, deployment, and rollback notes for production changes.
|
|
50
|
-
- Concrete risks with mitigations.
|
|
51
|
-
- A checklist showing completion evidence.
|
|
52
|
-
|
|
53
|
-
# Common Mistakes
|
|
54
|
-
- Starting with code before understanding invariants, data ownership, or failure modes.
|
|
55
|
-
- Designing for imagined future scale while ignoring present correctness.
|
|
56
|
-
- Treating validation, authorization, logging, and tests as optional polish.
|
|
57
|
-
- Creating generic abstractions after seeing only one use case.
|
|
58
|
-
- Optimizing without measurement or failing to define the target metric.
|
|
59
|
-
- Writing documents that describe implementation but omit failure handling.
|
|
60
|
-
|
|
61
|
-
# Failure Modes
|
|
62
|
-
- A simple request becomes a broad rewrite because scope was not bounded.
|
|
63
|
-
- A change works locally but cannot be safely deployed or rolled back.
|
|
64
|
-
- Data becomes inconsistent because constraints or transactions were skipped.
|
|
65
|
-
- Operators cannot diagnose incidents because logs and metrics are missing.
|
|
66
|
-
- Reviewers cannot evaluate risk because decisions and assumptions are implicit.
|
|
67
|
-
|
|
68
|
-
# Checklist
|
|
69
|
-
- [ ] Goal, scope, and non-goals are clearly defined.
|
|
70
|
-
- [ ] Simpler alternatives were considered and documented.
|
|
71
|
-
- [ ] Data integrity and backward compatibility are protected.
|
|
72
|
-
- [ ] Security and authorization impact is reviewed.
|
|
73
|
-
- [ ] Tests cover normal paths, edge cases, and failure paths.
|
|
74
|
-
- [ ] Logs, metrics, traces, or health signals are included when operationally relevant.
|
|
75
|
-
- [ ] Deployment and rollback are understood and tested.
|
|
76
|
-
- [ ] The deliverable explains reasoning and evidence, not just code.
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# Backend Engineer Examples
|
|
2
|
-
|
|
3
|
-
## Example 1: User Settings API
|
|
4
|
-
|
|
5
|
-
Implement an endpoint that reads and updates user notification preferences. Good agent behavior:
|
|
6
|
-
|
|
7
|
-
- Identify actors (user, admin) and data ownership rules—user sees own settings, admin sees tenant-wide defaults.
|
|
8
|
-
- Choose a caching strategy: cache by user_id with a short TTL; invalidate on write via cache-aside pattern.
|
|
9
|
-
- Validate setting keys against an allowlist, reject unknown keys with a 422 error and a list of valid options.
|
|
10
|
-
- Design the update to be partial (PATCH) so clients send only changed fields; merge with stored defaults.
|
|
11
|
-
- Add a rate limit on writes to prevent abuse; reads can be higher but still bounded.
|
|
12
|
-
|
|
13
|
-
## Example 2: Notification Service
|
|
14
|
-
|
|
15
|
-
Design a service that sends email and push notifications when orders are placed. Good agent behavior:
|
|
16
|
-
|
|
17
|
-
- Evaluate sync vs async delivery: accept the notification request synchronously but hand delivery off to a queue for resilience.
|
|
18
|
-
- Implement a retry mechanism with exponential backoff for transient failures; dead-letter after 3 attempts.
|
|
19
|
-
- Deduplicate by notification_id so the same event is not sent twice if the producer retries.
|
|
20
|
-
- Template notifications server-side so copy changes don't require app releases.
|
|
21
|
-
- Emit telemetry for each notification channel (sent, delivered, bounced, opened) to track provider health.
|
|
22
|
-
|
|
23
|
-
## Example 3: Inventory Reservation
|
|
24
|
-
|
|
25
|
-
Design inventory reservation for a checkout flow with a 15-minute payment window. Good agent behavior:
|
|
26
|
-
|
|
27
|
-
- Reserve inventory atomically at checkout time; release the reservation if payment is not completed within the window.
|
|
28
|
-
- Handle concurrent requests: use SELECT FOR UPDATE or optimistic locking to prevent overselling.
|
|
29
|
-
- On payment failure, roll back the reservation immediately and asynchronously notify the warehouse.
|
|
30
|
-
- Implement a background job that releases expired reservations every minute; log releases for audit.
|
|
31
|
-
- Add metrics for reservation success, expiration, and contention rate to tune the timeout and capacity.
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: documentation
|
|
3
|
-
description: Create ADRs, design docs, runbooks, API docs, and operational knowledge that stays useful.
|
|
4
|
-
version: 0.1.0
|
|
5
|
-
---
|
|
6
|
-
# Purpose
|
|
7
|
-
Create ADRs, design docs, runbooks, API docs, and operational knowledge that stays useful. This skill guides an AI agent to act with senior backend judgment: clarify the outcome, identify constraints, choose the least complex safe path, and make production impact visible.
|
|
8
|
-
|
|
9
|
-
# When to Activate
|
|
10
|
-
Use this skill when the task involves ADRs, design documents, runbooks, API documentation, operational documentation, architecture diagrams, or knowledge transfer. It is also useful when a request is vague, risky, touches production behavior, changes contracts, changes data, or needs a reviewable engineering plan. Do not activate it for trivial text edits unless the edit changes engineering guidance.
|
|
11
|
-
|
|
12
|
-
# Principles
|
|
13
|
-
- Correctness and data integrity come before speed of implementation.
|
|
14
|
-
- Simplicity is a feature: fewer moving parts means fewer failure modes.
|
|
15
|
-
- Existing contracts must remain compatible unless a breaking change is approved.
|
|
16
|
-
- Every important decision should have a reason, an alternative considered, and an operational consequence.
|
|
17
|
-
- Work should be testable, observable, deployable, and reversible.
|
|
18
|
-
- Prefer explicit boundaries, clear names, and local reasoning over clever shared abstractions.
|
|
19
|
-
- Security and privacy are design inputs, not final review steps.
|
|
20
|
-
|
|
21
|
-
- ADRs record decisions, context, consequences, and alternatives.
|
|
22
|
-
- Design documents explain proposed behavior before expensive implementation.
|
|
23
|
-
- Runbooks explain how to operate, diagnose, mitigate, and escalate.
|
|
24
|
-
- API documentation must define contracts, errors, authorization, examples, limits, and compatibility.
|
|
25
|
-
- Architecture diagrams should show boundaries, data flow, ownership, and failure paths.
|
|
26
|
-
- Documentation should be close to the workflow where it is used.
|
|
27
|
-
|
|
28
|
-
# Workflow
|
|
29
|
-
1. Identify the audience and their primary use case for the document.
|
|
30
|
-
2. Choose the right document type: ADR, design doc, runbook, API reference, README.
|
|
31
|
-
3. Define the scope: what decisions, behavior, or procedures are covered.
|
|
32
|
-
4. Write the document starting with the summary for busy readers.
|
|
33
|
-
5. Include concrete examples, not just abstract descriptions.
|
|
34
|
-
6. Add failure modes and operational notes where relevant.
|
|
35
|
-
7. Cross-reference related documentation, code, and standards.
|
|
36
|
-
8. Place the document close to where it is used (same repo, same directory).
|
|
37
|
-
9. Review for accuracy with someone who was not involved in the writing.
|
|
38
|
-
|
|
39
|
-
# Rules
|
|
40
|
-
- Never assume hidden requirements, traffic scale, compliance needs, or data retention rules.
|
|
41
|
-
- Do not introduce new infrastructure unless the current requirement cannot be met safely without it.
|
|
42
|
-
- Do not hide breaking changes in refactors.
|
|
43
|
-
- Do not weaken authorization, validation, transaction safety, or error handling to make implementation easier.
|
|
44
|
-
- Keep public contracts, migrations, and operational changes explicit in the deliverable.
|
|
45
|
-
- Reference related standards: references/standards/documentation.md.
|
|
46
|
-
|
|
47
|
-
# Deliverables
|
|
48
|
-
- Document with clear audience, purpose, and type.
|
|
49
|
-
- Concrete examples reflecting real usage.
|
|
50
|
-
- Failure modes and operational notes where relevant.
|
|
51
|
-
- Cross-references to related code, standards, and docs.
|
|
52
|
-
- Ownership and update cadence defined.
|
|
53
|
-
|
|
54
|
-
# Common Mistakes
|
|
55
|
-
- Writing documents that repeat what the code already expresses without adding decision context.
|
|
56
|
-
- Creating documentation that is too long or too vague to be useful under time pressure.
|
|
57
|
-
- Letting documentation become stale because there is no ownership or review process.
|
|
58
|
-
- Writing for an imaginary audience instead of actual readers.
|
|
59
|
-
- Including implementation details that change frequently while omitting stable design decisions.
|
|
60
|
-
|
|
61
|
-
# Failure Modes
|
|
62
|
-
- A runbook is too long to read during an incident.
|
|
63
|
-
- An ADR describes what was decided but not why alternatives were rejected.
|
|
64
|
-
- Documentation lives in a separate wiki that no one updates after the initial write.
|
|
65
|
-
- Critical operational knowledge exists only in the head of one team member.
|
|
66
|
-
|
|
67
|
-
# Checklist
|
|
68
|
-
- [ ] The document has a clear audience and purpose.
|
|
69
|
-
- [ ] The document type matches the content (ADR, runbook, design doc, etc.).
|
|
70
|
-
- [ ] Examples are concrete and reflect real usage.
|
|
71
|
-
- [ ] Failure modes and operational notes are included where applicable.
|
|
72
|
-
- [ ] Cross-references to code, standards, or related docs are accurate.
|
|
73
|
-
- [ ] The document is reviewable by someone not involved in its creation.
|
|
74
|
-
- [ ] Ownership and update cadence are defined.
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# Documentation Examples
|
|
2
|
-
|
|
3
|
-
## Example 1: ADR for Cache Strategy
|
|
4
|
-
|
|
5
|
-
Write an ADR documenting the decision to add Redis caching for product catalog reads. Good agent behavior:
|
|
6
|
-
|
|
7
|
-
- State the context: product catalog reads are 500 req/s, each takes 50ms from PostgreSQL, and latency spikes during flash sales.
|
|
8
|
-
- List alternatives considered: in-memory cache (lost on restart, per-node inconsistency), read replicas (cost, replication lag), CDN (static data only).
|
|
9
|
-
- Describe the decision: Redis cache-aside with 5-minute TTL and immediate invalidation on price or stock changes.
|
|
10
|
-
- Record consequences: increased operational complexity (need Redis cluster, monitoring), cache hit ratio must be >90% to justify cost.
|
|
11
|
-
- Link to related ADRs for deployment topology and monitoring setup.
|
|
12
|
-
|
|
13
|
-
## Example 2: Runbook for Payment Failure
|
|
14
|
-
|
|
15
|
-
Write a runbook for diagnosing payment processing failures. Good agent behavior:
|
|
16
|
-
|
|
17
|
-
- Start with the alert trigger (e.g., >5% payment failures in 5 minutes) and the severity level.
|
|
18
|
-
- Provide step-by-step diagnosis: check the payment provider status page, then look at the circuit breaker state, then inspect dead-letter queue.
|
|
19
|
-
- List the dashboards and log queries needed (payment error rate by provider, latency p95, DLQ count).
|
|
20
|
-
- Include remediation steps: toggle the kill switch to fallback provider, reset circuit breaker after provider recovers, replay DLQ messages.
|
|
21
|
-
- End with escalation contacts and a post-mortem template link for the follow-up.
|
|
22
|
-
|
|
23
|
-
## Example 3: API Docs for Public Endpoint
|
|
24
|
-
|
|
25
|
-
Document a public POST /orders endpoint for external developers. Good agent behavior:
|
|
26
|
-
|
|
27
|
-
- Show a complete request example with all fields, including `Idempotency-Key` in the header and `X-Api-Version`.
|
|
28
|
-
- Show success (201), validation error (422), and conflict (409) response bodies with annotated fields.
|
|
29
|
-
- Document authentication: `Bearer` token in the `Authorization` header with required scopes.
|
|
30
|
-
- Note rate limits (100 req/min per token) and include `X-RateLimit-Remaining` in the response.
|
|
31
|
-
- List every error code with a human-readable message, a likely cause, and a recovery action.
|