[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H9RGX8PH6GRZNDZE6Q9EF1":3,"skill-same:01M6H9RGX8PH6GRZNDZE6Q9EF1":55},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":26,"linkOnly":27,"markdownContent":28,"markdownBody":29,"frontMatter":30,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":14,"repositoryHtmlUrl":36,"repositoryHomepageUrl":6,"ownerHtmlUrl":37,"ownerBlogUrl":38,"ownerDescription":39,"updatedAt":40,"install":41,"resources":54},"01M6H9RGX8PH6GRZNDZE6Q9EF1","fastapi",null,"FastAPI web framework best practices and patterns","NeuralBlitz\u002FMito","NeuralBlitz","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F79354388?v=4","01M6H8T2TFH477HRS0KTSTKR2E","David Riggs","01M6H8T2YQQDXPYM092P670Z21",0,"MIT","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Ffastapi\u002FSKILL.md",[],[5,19,20,21,22,23,24,25],"web","best practices","framework","web framework","opencode","patterns","frameworks","2026-11-10 10:12:30",false,"---\nname: fastapi\ndescription: FastAPI web framework best practices and patterns\nlicense: MIT\ncompatibility: opencode\nmetadata:\n  audience: developers\n  category: frameworks\n---\n## What I do\n- Create REST APIs with FastAPI\n- Use Pydantic models for validation\n- Implement dependency injection\n- Handle async database operations\n- Create OpenAPI documentation\n- Implement authentication (OAuth2, JWT)\n- Use background tasks\n- Write pytest for FastAPI tests\n\n## When to use me\nWhen building APIs with FastAPI.\n\n## FastAPI Application\n```python\nfrom fastapi import FastAPI, Depends, HTTPException, status\nfrom fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm\nfrom typing import Annotated\nfrom pydantic import BaseModel, EmailStr\nfrom datetime import datetime, timedelta\nfrom jose import JWTError, jwt\n\napp = FastAPI(\n    title=\"API\",\n    description=\"My FastAPI Application\",\n    version=\"1.0.0\",\n    docs_url=\"\u002Fdocs\",\n    redoc_url=\"\u002Fredoc\",\n)\n\nSECRET_KEY = \"your-secret-key\"\nALGORITHM = \"HS256\"\nACCESS_TOKEN_EXPIRE_MINUTES = 30\n\noauth2_scheme = OAuth2PasswordBearer(tokenUrl=\"\u002Fapi\u002Fv1\u002Fauth\u002Ftoken\")\n\n\nclass Token(BaseModel):\n    access_token: str\n    token_type: str\n\n\nclass UserCreate(BaseModel):\n    email: EmailStr\n    password: str\n    full_name: str | None = None\n\n\nclass User(BaseModel):\n    id: int\n    email: EmailStr\n    full_name: str | None\n    is_active: bool = True\n    created_at: datetime\n\n\nclass UserResponse(BaseModel):\n    id: int\n    email: EmailStr\n    full_name: str | None\n\n    class Config:\n        from_attributes = True\n\n\n@app.post(\"\u002Fapi\u002Fv1\u002Fusers\", response_model=UserResponse, status_code=status.HTTP_201_CREATED)\nasync def create_user(user: UserCreate, db: Session = Depends(get_db)) -> UserResponse:\n    existing = db.query(User).filter(User.email == user.email).first()\n    if existing:\n        raise HTTPException(\n            status_code=status.HTTP_400_BAD_REQUEST,\n            detail=\"Email already registered\",\n        )\n\n    hashed_password = hash_password(user.password)\n    db_user = User(\n        email=user.email,\n        full_name=user.full_name,\n        hashed_password=hashed_password,\n    )\n    db.add(db_user)\n    db.commit()\n    db.refresh(db_user)\n\n    return UserResponse.model_validate(db_user)\n\n\n@app.post(\"\u002Fapi\u002Fv1\u002Fauth\u002Ftoken\")\nasync def login(\n    form_data: Annotated[OAuth2PasswordRequestForm, Depends()],\n    db: Session = Depends(get_db),\n) -> Token:\n    user = authenticate_user(db, form_data.username, form_data.password)\n    if not user:\n        raise HTTPException(\n            status_code=status.HTTP_401_UNAUTHORIZED,\n            detail=\"Incorrect username or password\",\n            headers={\"WWW-Authenticate\": \"Bearer\"},\n        )\n\n    access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)\n    access_token = create_access_token(\n        data={\"sub\": user.email}, expires_delta=access_token_expires\n    )\n\n    return Token(access_token=access_token, token_type=\"bearer\")\n\n\nasync def get_current_user(\n    token: Annotated[str, Depends(oauth2_scheme)],\n    db: Session = Depends(get_db),\n) -> User:\n    credentials_exception = HTTPException(\n        status_code=status.HTTP_401_UNAUTHORIZED,\n        detail=\"Could not validate credentials\",\n        headers={\"WWW-Authenticate\": \"Bearer\"},\n    )\n\n    try:\n        payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])\n        email: str = payload.get(\"sub\")\n        if email is None:\n            raise credentials_exception\n    except JWTError:\n        raise credentials_exception\n\n    user = get_user_by_email(db, email=email)\n    if user is None:\n        raise credentials_exception\n    return user\n\n\n@app.get(\"\u002Fapi\u002Fv1\u002Fusers\u002Fme\")\nasync def read_users_me(\n    current_user: Annotated[User, Depends(get_current_user)],\n) -> UserResponse:\n    return UserResponse.model_validate(current_user)\n```\n\n## Testing FastAPI\n```python\nfrom fastapi.testclient import TestClient\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker\n\n@pytest.fixture\ndef client():\n    app = create_app()\n    return TestClient(app)\n\n\n@pytest.fixture\ndef db_session():\n    engine = create_engine(\"sqlite:\u002F\u002F\u002F.\u002Ftest.db\")\n    Session = sessionmaker(bind=engine)\n    session = Session()\n    yield session\n    session.close()\n\n\ndef test_create_user(client: TestClient):\n    response = client.post(\n        \"\u002Fapi\u002Fv1\u002Fusers\",\n        json={\"email\": \"test@example.com\", \"password\": \"secret123\"},\n    )\n    assert response.status_code == status.HTTP_201_CREATED\n    data = response.json()\n    assert data[\"email\"] == \"test@example.com\"\n    assert \"id\" in data\n    assert \"password\" not in data\n\n\ndef test_login(client: TestClient):\n    # First create user\n    client.post(\n        \"\u002Fapi\u002Fv1\u002Fusers\",\n        json={\"email\": \"test@example.com\", \"password\": \"secret123\"},\n    )\n\n    # Then login\n    response = client.post(\n        \"\u002Fapi\u002Fv1\u002Fauth\u002Ftoken\",\n        data={\"username\": \"test@example.com\", \"password\": \"secret123\"},\n    )\n    assert response.status_code == 200\n    token = response.json()\n    assert \"access_token\" in token\n    assert token[\"token_type\"] == \"bearer\"\n```\n","## What I do\n- Create REST APIs with FastAPI\n- Use Pydantic models for validation\n- Implement dependency injection\n- Handle async database operations\n- Create OpenAPI documentation\n- Implement authentication (OAuth2, JWT)\n- Use background tasks\n- Write pytest for FastAPI tests\n\n## When to use me\nWhen building APIs with FastAPI.\n\n## FastAPI Application\n```python\nfrom fastapi import FastAPI, Depends, HTTPException, status\nfrom fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm\nfrom typing import Annotated\nfrom pydantic import BaseModel, EmailStr\nfrom datetime import datetime, timedelta\nfrom jose import JWTError, jwt\n\napp = FastAPI(\n    title=\"API\",\n    description=\"My FastAPI Application\",\n    version=\"1.0.0\",\n    docs_url=\"\u002Fdocs\",\n    redoc_url=\"\u002Fredoc\",\n)\n\nSECRET_KEY = \"your-secret-key\"\nALGORITHM = \"HS256\"\nACCESS_TOKEN_EXPIRE_MINUTES = 30\n\noauth2_scheme = OAuth2PasswordBearer(tokenUrl=\"\u002Fapi\u002Fv1\u002Fauth\u002Ftoken\")\n\n\nclass Token(BaseModel):\n    access_token: str\n    token_type: str\n\n\nclass UserCreate(BaseModel):\n    email: EmailStr\n    password: str\n    full_name: str | None = None\n\n\nclass User(BaseModel):\n    id: int\n    email: EmailStr\n    full_name: str | None\n    is_active: bool = True\n    created_at: datetime\n\n\nclass UserResponse(BaseModel):\n    id: int\n    email: EmailStr\n    full_name: str | None\n\n    class Config:\n        from_attributes = True\n\n\n@app.post(\"\u002Fapi\u002Fv1\u002Fusers\", response_model=UserResponse, status_code=status.HTTP_201_CREATED)\nasync def create_user(user: UserCreate, db: Session = Depends(get_db)) -> UserResponse:\n    existing = db.query(User).filter(User.email == user.email).first()\n    if existing:\n        raise HTTPException(\n            status_code=status.HTTP_400_BAD_REQUEST,\n            detail=\"Email already registered\",\n        )\n\n    hashed_password = hash_password(user.password)\n    db_user = User(\n        email=user.email,\n        full_name=user.full_name,\n        hashed_password=hashed_password,\n    )\n    db.add(db_user)\n    db.commit()\n    db.refresh(db_user)\n\n    return UserResponse.model_validate(db_user)\n\n\n@app.post(\"\u002Fapi\u002Fv1\u002Fauth\u002Ftoken\")\nasync def login(\n    form_data: Annotated[OAuth2PasswordRequestForm, Depends()],\n    db: Session = Depends(get_db),\n) -> Token:\n    user = authenticate_user(db, form_data.username, form_data.password)\n    if not user:\n        raise HTTPException(\n            status_code=status.HTTP_401_UNAUTHORIZED,\n            detail=\"Incorrect username or password\",\n            headers={\"WWW-Authenticate\": \"Bearer\"},\n        )\n\n    access_token_expires = timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES)\n    access_token = create_access_token(\n        data={\"sub\": user.email}, expires_delta=access_token_expires\n    )\n\n    return Token(access_token=access_token, token_type=\"bearer\")\n\n\nasync def get_current_user(\n    token: Annotated[str, Depends(oauth2_scheme)],\n    db: Session = Depends(get_db),\n) -> User:\n    credentials_exception = HTTPException(\n        status_code=status.HTTP_401_UNAUTHORIZED,\n        detail=\"Could not validate credentials\",\n        headers={\"WWW-Authenticate\": \"Bearer\"},\n    )\n\n    try:\n        payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])\n        email: str = payload.get(\"sub\")\n        if email is None:\n            raise credentials_exception\n    except JWTError:\n        raise credentials_exception\n\n    user = get_user_by_email(db, email=email)\n    if user is None:\n        raise credentials_exception\n    return user\n\n\n@app.get(\"\u002Fapi\u002Fv1\u002Fusers\u002Fme\")\nasync def read_users_me(\n    current_user: Annotated[User, Depends(get_current_user)],\n) -> UserResponse:\n    return UserResponse.model_validate(current_user)\n```\n\n## Testing FastAPI\n```python\nfrom fastapi.testclient import TestClient\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker\n\n@pytest.fixture\ndef client():\n    app = create_app()\n    return TestClient(app)\n\n\n@pytest.fixture\ndef db_session():\n    engine = create_engine(\"sqlite:\u002F\u002F\u002F.\u002Ftest.db\")\n    Session = sessionmaker(bind=engine)\n    session = Session()\n    yield session\n    session.close()\n\n\ndef test_create_user(client: TestClient):\n    response = client.post(\n        \"\u002Fapi\u002Fv1\u002Fusers\",\n        json={\"email\": \"test@example.com\", \"password\": \"secret123\"},\n    )\n    assert response.status_code == status.HTTP_201_CREATED\n    data = response.json()\n    assert data[\"email\"] == \"test@example.com\"\n    assert \"id\" in data\n    assert \"password\" not in data\n\n\ndef test_login(client: TestClient):\n    # First create user\n    client.post(\n        \"\u002Fapi\u002Fv1\u002Fusers\",\n        json={\"email\": \"test@example.com\", \"password\": \"secret123\"},\n    )\n\n    # Then login\n    response = client.post(\n        \"\u002Fapi\u002Fv1\u002Fauth\u002Ftoken\",\n        data={\"username\": \"test@example.com\", \"password\": \"secret123\"},\n    )\n    assert response.status_code == 200\n    token = response.json()\n    assert \"access_token\" in token\n    assert token[\"token_type\"] == \"bearer\"\n```\n",{"name":5,"license":15,"metadata":31,"description":7,"compatibility":23},{"audience":32,"category":25},"developers","main","2ea764e153842704d24a2e9aa4170441a7f03081",".opencode\u002Fskills\u002Ffastapi","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito","https:\u002F\u002Fgithub.com\u002FNeuralBlitz","nuralnexus.org","Independent Multidisciplinary Researcher, Creative Producer, and AI Systems Architect\r\nAn independent creator and research-driven systems designer.","2026-11-12 03:13:05",{"source":8,"skillName":5,"commands":42,"prompt":52,"zipAvailable":53},[43,46,49],{"tool":44,"command":45},"npx","npx skills add NeuralBlitz\u002FMito --skill fastapi",{"tool":47,"command":48},"bunx","bunx skills add NeuralBlitz\u002FMito --skill fastapi",{"tool":50,"command":51},"pnpm","pnpm dlx skills add NeuralBlitz\u002FMito --skill fastapi","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Ffastapi\u002FSKILL.md",true,[],[56,72,84,97,105,120],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":26},"01M6HAZSAQK1S27CEZYAYJTQDX","wireless-communications","Wireless systems, mobile networks, and 5G\u002F6G","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fwireless-communications\u002FSKILL.md",[],[63,64,65,66,67,68,69,70,23,71],"communications","wireless communications","wireless","systems","engineering","networks","5G","students","mobile",{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":26},"01M6HAZFX6E8NK3WZWDX5YCKYY","websockets","WebSocket implementation and best practices","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fwebassembly\u002Fwebsockets\u002FSKILL.md",[],[74,79,80,81,23,82,83,20],"websocket implementation","time","implementation","real-time","websocket",{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":26},"01M6HAZ6DAXBQ7QHXXM1EM7715","vulnerability-auditing","Vulnerability assessment and auditing","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fvulnerability-auditing\u002FSKILL.md",[],[91,92,93,94,23,95,96],"vulnerability","vulnerability auditing","security","vulnerability assessment","cybersecurity","assessment",{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":26},"01M6HAZ3FKF3CS9Z3J96RVE2ZE","vulnerability-assessment","Finding and assessing security vulnerabilities","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fvue\u002Fvulnerability-assessment\u002FSKILL.md",[],[94,91,96,93,104,23],"vulnerabilities",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":26},"01M6HAYSHM6HKRKEHFP0SGZQX7","vlsi-design","Very-Large-Scale Integration circuit design and semiconductor engineering","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fvlsi-design\u002FSKILL.md",[],[112,113,114,115,116,67,117,23,118,70,119],"vlsi design","VLSI","design","hardware","integration","computer","scale","circuit",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":26},"01M6HAYPQ30FFE2JXD7WQJ8R6C","unsupervised","Unsupervised learning concepts","https:\u002F\u002Fgithub.com\u002FNeuralBlitz\u002FMito\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fvisualization\u002Funsupervised\u002FSKILL.md",[],[122,127,23,128,129,130,131,132],"learning","intelligence","unsupervised learning","machine","concepts","machine-learning"]