スキル一覧に戻る
nimag

document-types

by nimag

0🍴 0📅 2025年12月22日
GitHubで見るManusで実行

SKILL.md


name: document-types description: Understand and work with mortgage document types and classification. Use when asking about document types, adding new document support, debugging classification, or understanding what DocType constants mean. allowed-tools:

  • Read
  • Grep
  • Glob

Mortgage Document Types

Purpose

Work with document classification in the mortgage underwriting system.

Document Type Constants

Located in internal/model/document.go:

Income Documents

ConstantDescriptionFilename Patterns
DocTypeW2W-2 wage statements*w2*, *w-2*
DocType10991099 contractor income*1099*
DocTypePaystubPay stubs/earnings*paystub*, *pay_stub*, *pay-stub*, *earnings*
DocTypeTaxReturnTax returns (1040)*tax*, *1040*
DocTypeProfitLossP&L statements*profit*, *p&l*, *pnl*
DocTypeEmploymentLetterEmployment verification*employment*, *verification*

Asset Documents

ConstantDescriptionFilename Patterns
DocTypeBankStatementBank statements*bank*
DocTypeAssetStatementGeneral assets*asset*
DocTypeRetirementStmt401k/IRA statements*retirement*, *401k*, *ira*
DocTypeGiftLetterGift fund letters*gift*

Credit Documents

ConstantDescriptionFilename Patterns
DocTypeCreditReportCredit bureau reports*credit*
DocTypeDebtPayoffDebt payoff letters*payoff*, *debt*

Collateral Documents

ConstantDescriptionFilename Patterns
DocTypeAppraisalProperty appraisals*appraisal*
DocTypePurchaseContractPurchase agreements*purchase*, *contract*
DocTypeTitleReportTitle reports*title*
DocTypePropertyInsuranceHazard insurance*insurance*, *hazard*, *homeowner*

Type Inference Logic

Located in internal/document/store.go:

// Files are classified by checking if filename contains pattern
lower := strings.ToLower(filepath.Base(path))
for pattern, docType := range patterns {
    if strings.Contains(lower, pattern) {
        return docType
    }
}

Adding a New Document Type

Step 1: Add constant to internal/model/document.go

const (
    // ... existing types ...
    DocTypeNewType DocumentType = "new_type"
)

Step 2: Add pattern to internal/document/store.go

patterns := map[string]model.DocumentType{
    // ... existing patterns ...
    "new_pattern": model.DocTypeNewType,
}

Step 3: Add to agent's document lists

In the relevant agent (e.g., internal/agent/income/income.go):

func (a *Agent) RequiredDocuments() []model.DocumentType {
    return []model.DocumentType{
        model.DocTypeW2,
        model.DocTypeNewType,  // Add here
    }
}

Step 4: Update prompts

Update the agent's prompt to describe how to handle the new document type.

Document Structure

type Document struct {
    ID            string            // Hash-based unique ID
    ApplicationID string            // Loan application ID
    Type          DocumentType      // One of the DocType* constants
    FileName      string            // Original filename
    MimeType      string            // application/pdf, image/png, etc.
    FilePath      string            // Local filesystem path
    GeminiURI     string            // Cached Gemini File API URI
    UploadedAt    time.Time
    BorrowerID    string
    Year          int               // Tax year for tax docs
    Period        string            // Pay period for paystubs
    Metadata      map[string]string // Additional metadata
}

Supported MIME Types

From internal/document/store.go:MimeTypeFromExtension:

  • .pdf -> application/pdf
  • .png -> image/png
  • .jpg, .jpeg -> image/jpeg
  • .gif -> image/gif
  • .webp -> image/webp
  • internal/model/document.go - Type definitions
  • internal/document/store.go - Loading and type inference
  • cmd/underwriter/main.go - CLI type inference

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です