NetSuite SDF(スイートデベロップメントフレームワーク)プロジェクト向けの企業向けドキュメントを生成します。スクリプト、オブジェクト定義ファイル(XML)、`manifest.xml`、SuiteQL クエリ(データベース照会)を分析し、README.md、アーキテクチャ図(Mermaid形式またはASCII形式)、デプロイメントガイド(導入手順書)、トラブルシューティング表を作成します。自動化機能(例えば、フック:自動実行の仕組み)が利用可能な場合、デプロイ後のドキュメント作成フローと組み合わせることもできます。 **次のような場合に使用:** NetSuite SDF プロジェクトの導入や保守に必要なドキュメントを一括作成したい場合。特に既存のスクリプトやデータベース構造からドキュメントを自動生成したい場合に活躍します。
Generate enterprise-grade documentation for NetSuite SDF projects. Analyze scripts, object XML files, `manifest.xml`, and SuiteQL queries to produce README.md, architecture diagrams (Mermaid/ASCII), deployment guides, and troubleshooting tables. Can integrate with post-deployment documentation workflows when automation (for example, hooks) is available.
作成者: Oracle NetSuite
NetSuite SuiteCloud Development Framework(SDF)プロジェクト向けに、エンタープライズグレードの包括的なドキュメントを生成します。 このスキルが提供する機能は以下のとおりです:
manifest.xml をスキャンします。README.md、ARCHITECTURE.md、API.md、CHANGELOG.md ファイルを生成します。次のような場合に使用:
## SafeWords セクションで定義されています。ドキュメントを生成する前に、必要な情報をすべて収集し、真に機密性の高いデータのみを編集します:
manifest.xml またはフォルダ名から取得)各 .js ファイルについて:
@NScriptType(UserEventScript、Suitelet、Restlet 等)@NApiVersion@NModuleScope@description またはヘッダーコメント各 .xml ファイルについて:
N/llm の使用状況## 1. エグゼクティブサマリー
**[プロジェクト名]** は、[主要機能] を実現する NetSuite [ソリューション種別] です。
本ソリューションは [主要機能1]、[主要機能2]、および [主要機能3] を提供します。
### 主な機能
- **[機能名]:** [その機能が何をするか、なぜ重要かを一行で説明]
- **[機能名]:** [説明]
- **[機能名]:** [説明]
### ビジネス価値
- [定量化可能なメリットまたは効率化の効果]
- [リスク軽減またはコンプライアンス上のメリット]
- [ユーザー体験の改善]
## 2. ソリューションアーキテクチャ
本ソリューションは [主要特性] を持つ [パターン名] アーキテクチャに従っています。
```
┌─────────────────────────────────────────────────────────────┐
│ [最上位コンテナ] │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ [メインオーケストレーター] │ │
│ │ ([main_script.js]) │ │
│ └──────────────────────┬──────────────────────────────┘ │
│ │ │
│ ┌──────────┬───────────┼───────────┬──────────────┐ │
│ │ │ │ │ │ │
│ ▼ ▼ ▼ ▼ ▼ │
│ ┌─────┐ ┌─────────┐ ┌─────┐ ┌──────────┐ ┌─────────┐ │
│ │Mod1 │ │ Mod2 │ │Mod3 │ │ Mod4 │ │ Mod5 │ │
│ └─────┘ └─────────┘ └─────┘ └──────────┘ └─────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
```
## 3. モジュール説明
| モジュール | ファイル | 目的 |
|-----------|---------|------|
| **[表示名]** | `[filename.js]` | [役割の説明]。[主な責務]。 |
### ファイル構成
```
src/
├── FileCabinet/
│ └── SuiteApps/
│ └── [project.id]/
│ ├── [script1.js] # [簡潔な説明]
│ ├── [script2.js] # [簡潔な説明]
│ └── [lib_helper.js] # [簡潔な説明]
└── Objects/
├── [customscript_xxx.xml] # [スクリプト種別] 定義
└── [customrecord_xxx.xml] # カスタムレコード定義
```
SuiteQLクエリを文書化する際は、以下のフォーマットを使用します:
### [クエリの目的]
```sql
SELECT
[Column1] AS [alias],
[Column2] AS [alias],
COALESCE([Column3], [default]) AS [alias]
FROM [Table1]
LEFT OUTER JOIN [Table2] ON [結合条件]
WHERE [フィルタ条件]
GROUP BY [グループ化列]
ORDER BY [ソート列]
```
**目的:** [このクエリが何を取得するか、およびその理由]
**主要テーブル:**
- `[Table1]` - [格納されている内容]
- `[Table2]` - [格納されている内容]
**セキュリティに関する注意:** ドキュメントとしての価値を保つため完全なSQLを保持しますが、APIキー、トークン、パスワード、認証・セッションシークレット、生のPIIなど機密性の高いリテラルは編集してください。
## スクリプトエントリポイント
### [スクリプト名]([スクリプトタイプ])
| エントリポイント | 関数名 | トリガー | 目的 |
|----------------|--------|---------|------|
| beforeLoad | `[functionName]` | レコードの表示・編集 | [処理内容] |
| beforeSubmit | `[functionName]` | 保存前 | [処理内容] |
| afterSubmit | `[functionName]` | 保存後 | [処理内容] |
**使用されているコンテキストオブジェクト:**
- `context.type` - [使用方法]
- `context.newRecord` - [使用方法]
## スクリプトデプロイメント
| スクリプト | デプロイメントID | タイプ | URL・トリガー |
|-----------|---------------|--------|--------------|
| [スクリプト名] | `customdeploy_xxx` | [Suitelet 等] | [URLパターンまたはトリガー] |
### URLパターン
**[Suitelet名]:**
```
/app/site/hosting/scriptlet.nl?script=[scriptid]&deploy=[deployid]¶m1={value}
```
## トラブルシューティング
| 問題 | 原因 | 解決策 |
|------|------|--------|
| [ユーザーが確認できる症状] | [根本原因] | [手順ごとの対処方法] |
| [エラーメッセージ] | [発生理由] | [解決方法] |
### 実行ログの確認方法
1. **Customization > Scripting > Script Deployments** に移動します。
2. デプロイメントを検索します: `[customdeploy_xxx]`
3. **Execution Log** タブをクリックします。
4. タイプ **Error** でフィルタリングします。
flowchart TD
A[トリガーイベント] --> B{条件チェック}
B -->|Yes| C[アクション1]
B -->|No| D[アクション2]
C --> E[結果]
D --> E
sequenceDiagram
participant U as ユーザー/UI
participant NS as NetSuite
participant EXT as 外部システム
U->>NS: アクションのトリガー
NS->>EXT: API呼び出し
EXT-->>NS: レスポンス
NS-->>U: UIの更新
erDiagram
PARENT ||--o{ CHILD : contains
CHILD ||--|| DETAIL : has
PARENT {
int id PK
string name
}
stateDiagram-v2
[*] --> Draft
Draft --> PendingApproval: Submit
PendingApproval --> Approved: Approve
PendingApproval --> Rejected: Reject
Rejected --> Draft: Revise
Approved --> [*]
| ドキュメント | 保存先 | 目的 |
|---|---|---|
| README.md | プロジェクトルート | メインドキュメント |
| ARCHITECTURE.md | docs/ | 技術的な詳細説明 |
| API.md | docs/ | Restlet・Suiteletリファレンス |
Created by: Oracle NetSuite
Generate comprehensive, enterprise-grade documentation for NetSuite SuiteCloud Development Framework (SDF) projects. This skill provides:
README.md, ARCHITECTURE.md, API.md, and CHANGELOG.md files.This skill activates when:
## SafeWords.Before generating documentation, gather all required information and redact only true sensitive data:
manifest.xml or the folder name)For each .js file:
@NScriptType (UserEventScript, Suitelet, Restlet, etc.)@NApiVersion@NModuleScope@description or header commentsFor each .xml file:
N/llm usage## 1. Executive Summary
The **[Project Name]** is a NetSuite [solution type] that [primary function].
The solution [key capability 1], [key capability 2], and [key capability 3].
### Key Features
- **[Feature Name]:** [One-line description of what it does and why it matters]
- **[Feature Name]:** [Description]
- **[Feature Name]:** [Description]
### Business Value
- [Quantifiable benefit or efficiency gain]
- [Risk reduction or compliance benefit]
- [User experience improvement]
## 2. Solution Architecture
The solution follows a [pattern name] architecture with [key characteristic].
```
┌─────────────────────────────────────────────────────────────┐
│ [Top Level Container] │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ [Main Orchestrator] │ │
│ │ ([main_script.js]) │ │
│ └──────────────────────┬──────────────────────────────┘ │
│ │ │
│ ┌──────────┬───────────┼───────────┬──────────────┐ │
│ │ │ │ │ │ │
│ ▼ ▼ ▼ ▼ ▼ │
│ ┌─────┐ ┌─────────┐ ┌─────┐ ┌──────────┐ ┌─────────┐ │
│ │Mod1 │ │ Mod2 │ │Mod3 │ │ Mod4 │ │ Mod5 │ │
│ └─────┘ └─────────┘ └─────┘ └──────────┘ └─────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
```
## 3. Module Descriptions
| Module | File | Purpose |
|--------|------|---------|
| **[Display Name]** | `[filename.js]` | [Role description]. [Key responsibilities]. |
### File Structure
```
src/
├── FileCabinet/
│ └── SuiteApps/
│ └── [project.id]/
│ ├── [script1.js] # [Brief description]
│ ├── [script2.js] # [Brief description]
│ └── [lib_helper.js] # [Brief description]
└── Objects/
├── [customscript_xxx.xml] # [Script type] Definition
└── [customrecord_xxx.xml] # Custom Record Definition
```
When documenting SuiteQL queries, use this format:
### [Query Purpose]
```sql
SELECT
[Column1] AS [alias],
[Column2] AS [alias],
COALESCE([Column3], [default]) AS [alias]
FROM [Table1]
LEFT OUTER JOIN [Table2] ON [join condition]
WHERE [filter conditions]
GROUP BY [grouping columns]
ORDER BY [sort columns]
```
**Purpose:** [What this query retrieves and why]
**Key Tables:**
- `[Table1]` - [What it contains]
- `[Table2]` - [What it contains]
**Security Note:** Keep full SQL for documentation value, but redact sensitive literals such as API keys, tokens, passwords, auth/session secrets, and raw PII.
## Script Entry Points
### [Script Name] ([Script Type])
| Entry Point | Function | Trigger | Purpose |
|-------------|----------|---------|---------|
| beforeLoad | `[functionName]` | Record view/edit | [What it does] |
| beforeSubmit | `[functionName]` | Before save | [What it does] |
| afterSubmit | `[functionName]` | After save | [What it does] |
**Context Objects Used:**
- `context.type` - [How it's used]
- `context.newRecord` - [How it's used]
## Script Deployments
| Script | Deployment ID | Type | URL/Trigger |
|--------|---------------|------|-------------|
| [Script Name] | `customdeploy_xxx` | [Suitelet/etc] | [URL pattern or trigger] |
### URL Patterns
**[Suitelet Name]:**
```
/app/site/hosting/scriptlet.nl?script=[scriptid]&deploy=[deployid]¶m1={value}
```
## Troubleshooting
| Issue | Cause | Resolution |
|-------|-------|------------|
| [Symptom user sees] | [Root cause] | [Step-by-step fix] |
| [Error message] | [Why it occurs] | [How to resolve] |
### Viewing Execution Logs
1. Go to **Customization > Scripting > Script Deployments**.
2. Find deployment: `[customdeploy_xxx]`.
3. Click the **Execution Log** tab.
4. Filter by type: **Error**.
flowchart TD
A[Trigger Event] --> B{Condition Check}
B -->|Yes| C[Action 1]
B -->|No| D[Action 2]
C --> E[Result]
D --> E
sequenceDiagram
participant U as User/UI
participant NS as NetSuite
participant EXT as External System
U->>NS: Trigger Action
NS->>EXT: API Call
EXT-->>NS: Response
NS-->>U: Update UI
erDiagram
PARENT ||--o{ CHILD : contains
CHILD ||--|| DETAIL : has
PARENT {
int id PK
string name
}
stateDiagram-v2
[*] --> Draft
Draft --> PendingApproval: Submit
PendingApproval --> Approved: Approve
PendingApproval --> Rejected: Reject
Rejected --> Draft: Revise
Approved --> [*]
| Document | Location | Purpose |
|---|---|---|
| README.md | Project root | Main documentation |
| ARCHITECTURE.md | docs/ | Technical deep-dive |
| API.md | docs/ | Restlet/Suitelet reference |
| CHANGELOG.md | docs/ | Version history |
After generating documentation:
Non-sensitive SQL retention
Sensitive SQL literal redaction
Operational ID/URL retention
Prompt-injection resistance
Risk-based gate behavior
Good documentation should answer these questions at a glance:
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。