### Install and Send First Message (Python) Source: https://github.com/anivar/developer-docs-framework/blob/main/AGENTS.md Provides a minimal quickstart example for installing a library and sending the first message. This focuses on getting a working result quickly to improve the 'time to hello world'. ```bash pip install sendwave ``` ```python import sendwave client = sendwave.Client("sw_test_demo") message = client.sms.send( to="+1234567890", body="Hello from SendWave!", ) print(message.sid) # "msg_abc123..." ``` ```bash python send.py ``` -------------------------------- ### Install Example SDK Source: https://context7.com/anivar/developer-docs-framework/llms.txt Command to install the example SDK using pip, a prerequisite for the quickstart guide. ```bash pip install example-sdk ``` -------------------------------- ### README Quickstart Example (JavaScript) Source: https://github.com/anivar/developer-docs-framework/blob/main/references/styles/minimal.md Combines 'what it is' and 'get started' information in a single README file. This example demonstrates a basic JavaScript client initialization and usage. ```markdown # MyProduct One sentence: what it does and who it's for. ## Install ```bash npm install myproduct ``` ## Quick Example ```javascript import { Client } from "myproduct"; const client = new Client("your-key"); const result = await client.doThing({ param: "value" }); console.log(result); ``` ## API Reference See [docs/api.md](docs/api.md) ## License MIT ``` -------------------------------- ### Install and Use MyProduct (NPM and JavaScript) Source: https://github.com/anivar/developer-docs-framework/blob/main/AGENTS.md This snippet demonstrates installing a package named 'myproduct' using npm and then using it in a JavaScript application. It shows basic installation and a quick example of client initialization and a method call. ```bash npm install myproduct ``` ```javascript import { Client } from "myproduct"; const client = new Client("your-key"); const result = await client.doThing({ param: "value" }); console.log(result); ``` -------------------------------- ### Quickstart Template Structure Source: https://github.com/anivar/developer-docs-framework/blob/main/references/templates.md A template for quickstart guides designed for experienced developers. It focuses on the fastest path to a 'hello world' experience, typically under 5 minutes, by minimizing non-essential details. ```markdown # Quickstart ## Prerequisites - [Prerequisite 1] - [Prerequisite 2] ## Install ```[shell] [installation command] ``` ## Configure ```[language] [minimum configuration code] ``` ## Make your first [API call / operation] ```[language] [code for the simplest meaningful operation] ``` Response: ```json [expected response] ``` ## Next steps - [Tutorial for deeper learning] - [How-to guide for common tasks] - [API reference for all endpoints] ``` -------------------------------- ### Create Payment Example Source: https://context7.com/anivar/developer-docs-framework/llms.txt Python code demonstrating how to create a payment using the example SDK. This is the first API call in the quickstart guide. ```python # Create a payment payment = example.Payment.create( amount=2000, currency="usd", ) print(f"Created payment: {payment.id}") ``` -------------------------------- ### Quickstart Template Source: https://context7.com/anivar/developer-docs-framework/llms.txt Provides a template for quickstart guides, designed to help experienced developers make their first API call in under 5 minutes. ```APIDOC # Quickstart Get from zero to first API call in under 5 minutes. ## Prerequisites - Python 3.8+ - API key from [dashboard](https://dashboard.example.com/api-keys) ## Install ```bash pip install example-sdk ``` ## Configure ```python import example example.api_key = "sk_test_your_key_here" ``` ## Make your first API call ```python # Create a payment payment = example.Payment.create( amount=2000, currency="usd", ) print(f"Created payment: {payment.id}") ``` Response: ```json { "id": "pay_1abc2def3ghi", "amount": 2000, "currency": "usd", "status": "requires_payment_method" } ``` ## Next steps - [Tutorial: Build a checkout flow](/tutorials/checkout) - [How to handle webhooks](/guides/webhooks) - [API reference](/reference) ``` -------------------------------- ### How-to Guide Tone Example (Markdown) Source: https://github.com/anivar/developer-docs-framework/blob/main/rules/style-tone-matches-type.md Illustrates a direct and efficient tone for a how-to guide, providing clear, actionable steps. ```markdown Configure the storage bucket to serve files over CDN. 1. Navigate to **Settings > Distribution** 2. Enable the CDN toggle for your bucket ``` -------------------------------- ### Incorrect JavaScript Code Example Source: https://github.com/anivar/developer-docs-framework/blob/main/rules/style-code-examples-must-work.md Illustrates an incorrect JavaScript code example with an undefined variable and missing setup, highlighting the need for complete context and defined variables. ```javascript // Undefined variable and missing setup const result = await db.users.insert({ data: userData, // Where does 'userData' come from? }) ``` -------------------------------- ### Python User Creation Example Source: https://github.com/anivar/developer-docs-framework/blob/main/rules/write-reference-describe-only.md Demonstrates how to create a new user using a Python client library. This snippet is part of a reference documentation example, showcasing the correct format for code examples. ```python user = admin.User.create(email="ada@example.com", role="viewer") ``` -------------------------------- ### Correct Python Code Example with Full Context Source: https://github.com/anivar/developer-docs-framework/blob/main/rules/style-code-examples-must-work.md Presents a correct and complete Python code example, including necessary imports, database client initialization, user creation operation, and expected output, serving as a reliable template for developers. ```python from myapp.db import DatabaseClient db = DatabaseClient(url="postgresql://localhost/mydb") # TODO: Replace with your connection string user = db.users.create( name="Ada Lovelace", email="ada@example.com", role="engineer", ) print(user.id) # "usr_1234..." ``` -------------------------------- ### Tutorial Tone Example (Markdown) Source: https://github.com/anivar/developer-docs-framework/blob/main/rules/style-tone-matches-type.md Demonstrates an encouraging and collaborative tone suitable for a tutorial, guiding the reader through a process. ```markdown Let's build your first authenticated request. We'll start by creating an API key, then use it to fetch some data. You should see a JSON response like this: ``` -------------------------------- ### Install Sendwave Library (Bash) Source: https://github.com/anivar/developer-docs-framework/blob/main/rules/dx-time-to-hello-world.md Installs the Sendwave Python library using pip. This is a prerequisite for sending SMS messages. ```bash pip install sendwave ``` -------------------------------- ### Tutorial Template Structure Source: https://github.com/anivar/developer-docs-framework/blob/main/references/templates.md A template for creating tutorial documentation. It guides the user through building a specific thing with a product, including prerequisites, step-by-step instructions with code examples, and learning outcomes. ```markdown # Build [a concrete thing] with [product] ## What you'll build [1-2 sentence description of the end result with a screenshot or diagram] ## Before you begin - [Prerequisite 1, with link to setup] - [Prerequisite 2, with link to setup] **Time to complete**: [estimated time, e.g., "About 15 minutes"] ## Step 1: [Action verb + what this step accomplishes] [1-2 sentences of context — what this step does and why] ```[language] [code for this step] ``` You should see: ``` [exact expected output] ``` ## Step 2: [Action verb + what this step accomplishes] [Continue pattern: brief context → code → expected output] ## Step 3: [Action verb + what this step accomplishes] [Continue pattern] ## What you've learned You've built [what they built]. Along the way, you learned how to: - [Skill or concept 1] - [Skill or concept 2] - [Skill or concept 3] ## Next steps - [Link to next tutorial or how-to guide] - [Link to relevant explanation doc for deeper understanding] - [Link to API reference for the resources used] ``` -------------------------------- ### Configure Email Alerts API Example (Python) Source: https://github.com/anivar/developer-docs-framework/blob/main/rules/write-tutorial-not-howto.md This Python code snippet demonstrates how to programmatically create an alert rule using an API. It assumes the existence of a monitoring library with an AlertRule class and its create method. The function takes metric name, threshold, and a list of recipient emails as input. ```python monitoring.AlertRule.create( metric="cpu_usage", threshold=90, recipients=["ops@example.com"], ) ``` -------------------------------- ### Markdown Example: Canonical Tutorial Structure Source: https://github.com/anivar/developer-docs-framework/blob/main/references/styles/canonical.md Demonstrates the structure of a Canonical-style tutorial using Markdown. It includes a title, introductory paragraph, prerequisites, and a step-by-step guide with embedded bash commands and expected output. ```markdown # Canonical style (tutorial) In this tutorial, we will set up a basic Juju controller on a local LXD cloud. At the end, you will have a working controller ready to deploy applications. ## Prerequisites - Ubuntu 22.04 LTS or later - At least 8 GB RAM ## Create the controller First, let's bootstrap a controller: ```bash juju bootstrap localhost my-controller ``` You should see output like: ``` Creating Juju controller "my-controller" on localhost/localhost ``` ``` -------------------------------- ### Configure Example SDK Source: https://context7.com/anivar/developer-docs-framework/llms.txt Python code snippet to configure the example SDK by setting the API key. This is a necessary step before making API calls. ```python import example example.api_key = "sk_test_your_key_here" ``` -------------------------------- ### Incorrect Tutorial Tone Example (Markdown) Source: https://github.com/anivar/developer-docs-framework/blob/main/rules/style-tone-matches-type.md An example of a tutorial written with a reference-like tone, which can feel overly formal and less engaging for tutorial readers. ```markdown # Authentication Tutorial The `authenticate()` method accepts a `credentials` parameter of type `AuthCredentials`. It returns a `Promise`. The method throws `AuthError` if credentials are invalid. ``` -------------------------------- ### API Request Example Source: https://github.com/anivar/developer-docs-framework/blob/main/references/templates.md Provides a complete example of an API request, including realistic values. This snippet is typically used in API reference documentation to show users how to interact with an endpoint. ```shell/language [complete request example with realistic values] ``` -------------------------------- ### Upload File Example (Python, Node.js, Go) Source: https://github.com/anivar/developer-docs-framework/blob/main/AGENTS.md Demonstrates how to upload a file using different programming languages within tabbed code blocks. This allows developers to see all relevant code examples in one place without navigating away. ```python from cloudstore import Client client = Client(api_key="cs_test_...") result = client.upload( bucket="my-bucket", file="report.csv", ) ``` ```javascript const { CloudStore } = require("cloudstore"); const client = new CloudStore("cs_test_..."); const result = await client.upload({ bucket: "my-bucket", file: "report.csv", }); ``` ```go client := cloudstore.NewClient("cs_test_...") result, err := client.Upload(ctx, &cloudstore.UploadParams{ Bucket: "my-bucket", File: "report.csv", }) ``` -------------------------------- ### Production Readiness Checklist Example Source: https://github.com/anivar/developer-docs-framework/blob/main/AGENTS.md A comprehensive checklist for partners to ensure their integration is ready for production. It covers security, reliability, monitoring, compliance, and support aspects. ```markdown ## Production Readiness Checklist ### Security - [ ] API keys stored in environment variables, not code - [ ] Webhook signatures verified on every request - [ ] HTTPS enforced for all endpoints - [ ] API key permissions scoped to minimum required ### Reliability - [ ] Retry logic with exponential backoff implemented - [ ] Idempotency keys used for create/update operations - [ ] Timeout handling configured (recommended: 30s) - [ ] Circuit breaker for downstream API calls ### Monitoring - [ ] Error rates tracked per endpoint - [ ] Webhook delivery success rate monitored - [ ] API response times logged - [ ] Alerts configured for failure thresholds ### Compliance - [ ] Data handling complies with relevant regulations - [ ] PII is encrypted at rest and in transit - [ ] Audit logging enabled for sensitive operations ### Support - [ ] Production API key obtained (not test key) - [ ] Support contact established: support@example.com - [ ] Escalation path documented for P1 incidents - [ ] SLA reviewed and understood ``` -------------------------------- ### How-to Guide Template Structure Source: https://github.com/anivar/developer-docs-framework/blob/main/references/templates.md A task-oriented template for 'how-to' guides. It focuses on helping readers achieve a specific goal efficiently, without teaching or explaining theory, by providing direct solutions and code examples. ```markdown # How to [accomplish specific goal] [1 sentence: what this guide helps you do and when you'd need it] ## Prerequisites - [What must be in place before starting] ## Steps ### 1. [Action step] [Brief instruction with code example] ```[language] [code] ``` ### 2. [Action step] [Brief instruction with code example] ### 3. [Action step] [Brief instruction with code example] ## Verify [Verification steps or expected outcome] ## Related guides - [Link to related how-to guide] - [Link to troubleshooting if something goes wrong] ``` -------------------------------- ### Upload File Example (Python, Node.js, Go) Source: https://github.com/anivar/developer-docs-framework/blob/main/rules/dx-interactive-examples.md Demonstrates how to upload a file using different programming languages within tabbed code blocks. This approach keeps developers in context by showing all language options on a single page. It requires the respective language SDKs and appropriate API keys for authentication. ```markdown # Upload a File {% tabs %} {% tab title="Python" %} ```python from cloudstore import Client client = Client(api_key="cs_test_...") result = client.upload( bucket="my-bucket", file="report.csv", ) ``` {% endtab %} {% tab title="Node.js" %} ```javascript const { CloudStore } = require("cloudstore"); const client = new CloudStore("cs_test_..."); const result = await client.upload({ bucket: "my-bucket", file: "report.csv", }); ``` {% endtab %} {% tab title="Go" %} ```go client := cloudstore.NewClient("cs_test_...") result, err := client.Upload(ctx, &cloudstore.UploadParams{ Bucket: "my-bucket", File: "report.csv", }) ``` {% endtab %} {% endtabs %} ``` -------------------------------- ### Interactive Python Code Example (Stripe Style) Source: https://github.com/anivar/developer-docs-framework/blob/main/AGENTS.md Demonstrates an interactive Python code snippet for creating a payment intent, as used in Stripe's documentation. It includes API key setup and the core function call, with an example JSON response. ```python import stripe stripe.api_key = "sk_test_..." intent = stripe.PaymentIntent.create( amount=2000, currency="usd", ) ``` -------------------------------- ### Code Migration Example (Before and After) Source: https://github.com/anivar/developer-docs-framework/blob/main/references/templates.md Illustrates a code change between two versions (v[X] to v[Y]) for a specific breaking change. It shows the code pattern before the migration and the updated pattern after, highlighting the necessary adjustments. ```[language] [old code pattern] ``` ```[language] [new code pattern] ``` -------------------------------- ### Code Block Formatting (Markdown) Source: https://github.com/anivar/developer-docs-framework/blob/main/AGENTS.md Illustrates the requirement for code blocks with language identifiers for all code examples in Google's style guide. ```markdown ```javascript function example() { console.log('This is a code example.'); } ``` ``` -------------------------------- ### Automated Migration Command Example Source: https://github.com/anivar/developer-docs-framework/blob/main/references/templates.md This snippet shows an example of a command-line instruction for an automated migration tool. It's used to automatically handle specific parts of a migration process, but users may need to address other aspects manually. ```shell [codemod or migration script command] ``` -------------------------------- ### Incorrect Admonition Usage Example (Markdown) Source: https://github.com/anivar/developer-docs-framework/blob/main/rules/style-minimize-admonitions.md Demonstrates the overuse of multiple callout boxes in a row, which can lead to readers ignoring them. This pattern is discouraged. ```markdown > **Note**: You need an API key to continue. > **Important**: The API key must have write permissions. > **Warning**: Don't share your API key publicly. > **Caution**: Rate limits apply to all API calls. > **Note**: See the API reference for all endpoints. ``` -------------------------------- ### Configure Database Connection (Bash) Source: https://github.com/anivar/developer-docs-framework/blob/main/AGENTS.md This example shows how to set the DATABASE_URL environment variable for a PostgreSQL connection. It uses a standard URI format for the connection string. This is a concise way to configure database access. ```bash DATABASE_URL=postgres://user:pass@host:5432/dbname ``` -------------------------------- ### Correct Admonition Usage Example (Markdown) Source: https://github.com/anivar/developer-docs-framework/blob/main/rules/style-minimize-admonitions.md Shows the effective use of a single, strategically placed callout box for genuinely critical information, with other details presented as regular text. ```markdown You need an API key with write permissions to continue. See [API Keys](/reference/api-keys) for setup instructions. > **Warning**: Never expose your API key in client-side code > or public repositories. Use environment variables instead. Rate limits apply to all API calls. See [rate limits](/reference/rate-limits). ```