007
無料Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.
日本語の概要は準備中です。原文の説明を表示しています。
Guidelines for building frontend applications that integrate with Botpress ADK bots - covering authentication, type generation, client setup, and calling bot actions
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Use this skill when users ask questions about building frontend applications that connect to Botpress ADK bots. This covers authentication patterns, type-safe API calls, client configuration, and integrating generated types.
When you build a bot with the Botpress ADK, you often need a frontend application that interacts with it. This skill provides production-tested patterns for:
Activate this skill when users ask frontend-related questions like:
Documentation files in ./references/:
Frontend questions typically fall into these categories:
When users ask about authentication, reference the complete pattern from authentication.md:
Key Concepts:
Response Pattern:
When users ask about client configuration, reference botpress-client.md:
Key Concepts:
Response Pattern:
When users ask about types, reference type-generation.md:
Key Concepts:
.adk/ directory during dev/buildResponse Pattern:
When users ask about calling actions, reference calling-actions.md:
Key Concepts:
Response Pattern:
// 1. Cookie helpers
function setCookie(name: string, value: string, days = 365);
function getCookie(name: string): string | null;
function deleteCookie(name: string);
// 2. AuthContext
interface AuthContextType {
token: string | null;
isAuthenticated: boolean;
userProfile: UserProfile | null;
isLoadingProfile: boolean;
login: (token: string) => void;
logout: () => void;
}
// 3. OAuth Flow
// Redirect: https://app.botpress.cloud/cli-login?redirect=...
// Callback: /auth/callback?pat=bp_pat_...
// Store PAT in cookie and navigate to app
// stores/clientsStore.ts
const useClientsStore = create<ClientsState>()((set, get) => ({
APIClients: {},
getAPIClient: (props) => {
const key = props?.botId
? `${props.workspaceId}-${props.botId}`
: (props?.workspaceId ?? DEFAULT_API_CLIENT_KEY);
const cached = get().APIClients[key];
if (cached) return cached;
const newClient = new APIClient({
apiUrl: API_BASE_URL,
workspaceId: props?.workspaceId,
token: getPat() ?? "",
botId: props?.botId,
});
set((state) => ({
APIClients: { ...state.APIClients, [key]: newClient },
}));
return newClient;
},
}));
export const getApiClient = (props?) =>
useClientsStore.getState().getAPIClient(props);
// types/index.ts
/// <reference path="../../../bot/.adk/action-types.d.ts" />
/// <reference path="../../../bot/.adk/table-types.d.ts" />
import type { BotActionDefinitions } from "@botpress/runtime/_types/actions";
import type { TableDefinitions } from "@botpress/runtime/_types/tables";
// Create type aliases
export type SendMessageAction = BotActionDefinitions["sendMessage"];
export type TicketTableRow = TableDefinitions["TicketsTable"]["Output"];
// services/bot-service.ts
export async function sendMessage(input: SendMessageAction["input"]) {
const client = getApiClient({ botId, workspaceId });
const result = await client.callAction({
type: "sendMessage",
input,
});
return result.output as SendMessageAction["output"];
}
// Component usage with useMutation
const { mutate: send, isPending } = useMutation({
mutationFn: sendMessage,
onSuccess: () => {
toast.success("Message sent");
queryClient.invalidateQueries({ queryKey: ["messages"] });
},
onError: (error) => {
toast.error("Failed to send message");
},
});
When answering:
Question: "How do I authenticate users in my frontend?"
Answer:
The recommended pattern uses cookie-based PAT storage with OAuth flow.
Here's the complete implementation:
1. Cookie Helpers (authentication.md:89-111)
[code example]
2. AuthContext Setup (authentication.md:64-76)
[code example]
3. OAuth Flow (authentication.md:473-533)
[code example]
Key Security Considerations:
- Use SameSite=Lax for CSRF protection
- Always use HTTPS in production
- Never log PATs to console
- Implement token expiration handling
Related Topics:
- Route protection: authentication.md:369-467
- Profile fetching: authentication.md:304-347
- Client initialization: botpress-client.md:29-51
When answering questions, always verify these patterns against the documentation:
// ✅ CORRECT - Use client store
const client = getApiClient({ workspaceId, botId });
// ❌ WRONG - Create new client every time
const client = new Client({ apiUrl, workspaceId, token, botId });
// ✅ CORRECT - Triple-slash at top of file
/// <reference path="../../../bot/.adk/action-types.d.ts" />
import type { BotActionDefinitions } from "@botpress/runtime/_types/actions";
// ❌ WRONG - No triple-slash reference
import type { BotActionDefinitions } from "@botpress/runtime/_types/actions";
// ✅ CORRECT - Service layer with types
export async function sendMessage(input: SendMessageAction["input"]) {
const client = getApiClient({ botId, workspaceId });
const result = await client.callAction({ type: "sendMessage", input });
return result.output as SendMessageAction["output"];
}
// ❌ WRONG - Direct call in component
const result = await client.callAction({ type: "sendMessage", input: data });
// ✅ CORRECT - Cookie with SameSite
document.cookie = `token=${value};expires=${expires};path=/;SameSite=Lax`;
// ❌ WRONG - localStorage without security
localStorage.setItem("token", value);
When answering, always mention relevant best practices:
Be prepared to help with these common problems:
This skill covers the complete frontend integration story for Botpress ADK:
Core Topics:
When to Use:
Key Principle: Always provide production-ready patterns that emphasize type safety, security, and maintainability.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.
日本語の概要は準備中です。原文の説明を表示しています。
Guides the creation of agile user stories and Gherkin feature files. Use when the user wants to create a user story, write acceptance criteria, define Gherkin scenarios, or author BDD feature files. This should trigger for requests such as Create a user story; Write a user story; I need to write a user story. Part of cursor-rules-java project
日本語の概要は準備中です。原文の説明を表示しています。
Facilitates conversational discovery to create Architectural Decision Records (ADRs) for non-functional requirements using the ISO/IEC 25010:2023 quality model. Use when the user wants to document quality attributes, NFR decisions, security/performance/scalability architecture, or design systems with measurable quality criteria. This should trigger for requests such as Create ADR for Non-functional requirements; Document Non-functional requirements; Capture Non-functional requirements; Generate Non-functional requirements in an ADR. Part of cursor-rules-java project
日本語の概要は準備中です。原文の説明を表示しています。
Run a health check on an existing project: dependency audit, security scan, test runner detection, CI/CD evaluation, and missing configuration analysis. Maps the three execution gates (pre/in/post) from /10x-bootstrapper to an assessment framework for existing codebases. Reads optional context/foundation/stack-assessment.md from /10x-stack-assess to focus checks on identified gaps. Writes context/foundation/health-check.md with findings, prioritized fixes, and an agent-readiness verdict. Use when the user has an existing project and wants to verify its health before working with an agent. Trigger phrases: "health check", "check my project", "audit my project", "is my project healthy", "sprawdź projekt", "audyt projektu", "health-check", "project health". Use AFTER /10x-stack-assess (brownfield chain), BEFORE agent onboarding (m1-l4).
日本語の概要は準備中です。原文の説明を表示しています。
You MUST use this when building projects end-to-end. Orchestrates all 12 team roles — automatically switches between CTO, architect, PM, engineers, SRE, security, DBA, QA, and EM based on the current phase of work. Starts with brainstorming before any implementation.
日本語の概要は準備中です。原文の説明を表示しています。
Use when you need to add or configure Maven plugins in your pom.xml — including quality tools (enforcer, surefire, failsafe, jacoco, pitest, spotbugs, pmd), security scanning (OWASP), code formatting (Spotless), version management, container image build (Jib), build information tracking, and benchmarking (JMH) — through a consultative, modular step-by-step approach that only adds what you actually need. This should trigger for requests such as Add Maven plugins in pom.xml; Improve Maven plugins in pom.xml. Part of cursor-rules-java project
日本語の概要は準備中です。原文の説明を表示しています。