Get the FREE Ultimate OpenClaw Setup Guide →

project-structure

Scanned
npx machina-cli add skill jpavley/meta-loop-ios/project-structure --openclaw
Files (1)
SKILL.md
6.8 KB

Project Structure

How meta-loop artifacts fit into an iOS/SwiftUI Xcode project. Covers directory layout, who creates each file, and what belongs in the Xcode project navigator.

Directory Layout

MyApp/                              # Git repo root
├── MyApp.xcodeproj                 # Xcode project (you create)
├── MyApp/                          # Swift source (you + AI create)
│   ├── MyAppApp.swift
│   ├── ContentView.swift
│   └── Views/
│       └── FeatureView.swift
├── MyAppTests/                     # Test source (you + AI create)
├── CLAUDE.md                       # AI agent file (ml-setup creates, you maintain)
├── PROJECT-NOTES.md                # Session notes (ml-setup creates, you maintain)
├── PROJECT-TODO.md                 # Task tracking (ml-setup creates, you maintain)
├── README.md                       # Project readme (ml-setup creates, you maintain)
├── .claude/                        # Claude Code config (install.sh creates)
│   ├── commands/                   # Slash commands
│   │   ├── ml-setup.md
│   │   ├── ml-wireframe.md
│   │   ├── ml-spec.md
│   │   ├── ml-impl.md
│   │   └── ml-retain.md
│   ├── skills/                     # Reference docs
│   │   ├── meta-loop-methodology/
│   │   │   ├── SKILL.md
│   │   │   └── meta-loop-diagram.png
│   │   ├── wireframe-design/
│   │   │   └── SKILL.md
│   │   ├── view-specifications/
│   │   │   └── SKILL.md
│   │   └── project-structure/
│   │       └── SKILL.md
│   └── settings.json               # MCP servers, permissions (you create)
├── specs/                          # Specifications (ml-setup creates dir)
│   └── views/                      # View specs
│       └── feature-name/           # One directory per feature
│           ├── *-wireframe.png     # You create (drawing tool, one or more)
│           ├── about-this-view.md  # You create (optional context)
│           ├── spec.md             # ml-spec generates
│           └── notes.md            # ml-spec generates, you + AI update
├── supporting-docs/                # App-level context (ml-setup creates dir)
│   └── about-this-app.md          # You create
└── doc/                            # Retained learnings (ml-retain creates dir)
    ├── SHARED-PATTERNS.md          # ml-retain generates (optional)
    └── DECISIONS.md                # ml-retain generates (optional)

File Responsibility Matrix

File / DirectoryCreated ByMaintained ByIn Xcode Project?Purpose
MyApp.xcodeprojYou (Xcode)You / XcodeXcode project file
MyApp/ (Swift source)You + AIYou + AIYesApp source code
MyAppTests/You + AIYou + AIYesTest source code
CLAUDE.md/ml-setupYouNoAI agent context file
PROJECT-NOTES.md/ml-setupYouNoSession notes and observations
PROJECT-TODO.md/ml-setupYou + AINoTask tracking
README.md/ml-setupYouNoProject readme
.claude/commands/install.shPlugin updatesNoSlash command definitions
.claude/skills/install.shPlugin updatesNoReference skill documents
.claude/settings.jsonYouYouNoMCP servers, permissions
specs/views//ml-setupNoParent directory for view specs
specs/views/*/*-wireframe.pngYouYouNoHand-drawn wireframe images (screen and/or logic)
specs/views/*/spec.md/ml-specAI (regenerated)NoGenerated view specification
specs/views/*/notes.md/ml-specYou + AINoDecisions and context per feature
specs/views/*/about-this-view.mdYouYouNoOptional extra context for a view
supporting-docs//ml-setupNoParent directory for app context
supporting-docs/about-this-app.mdYouYouNoApp purpose, audience, features
doc//ml-retainAI (on demand)NoRetained learnings
doc/SHARED-PATTERNS.md/ml-retainAINoCross-feature patterns (optional)
doc/DECISIONS.md/ml-retainAINoArchitectural decisions (optional)

Xcode Integration

Only Swift/asset source goes into the Xcode project navigator. Everything else lives in the repo but outside Xcode's project references.

In Xcode project (managed by Xcode)

  • MyApp/ — Swift source, assets, Info.plist
  • MyAppTests/ — Test source

In repo, outside Xcode project

  • specs/ — Wireframes and specifications
  • supporting-docs/ — App context documents
  • doc/ — Retained learnings
  • .claude/ — Commands, skills, settings
  • CLAUDE.md, PROJECT-NOTES.md, PROJECT-TODO.md

Xcode ignores files that aren't added to the project navigator. No special configuration is needed — just don't drag the meta-loop directories into Xcode.

.gitignore Guidance

Track all meta-loop artifacts in git. Specs, wireframes, supporting docs, and retained learnings are the persistent value of the meta-loop process. Code can be regenerated from them; they cannot be regenerated from code.

Your .gitignore should exclude only standard Xcode/macOS build artifacts:

# Xcode
build/
DerivedData/
*.xcuserdata
*.xcworkspace/xcuserdata/

# macOS
.DS_Store

# Swift Package Manager
.build/

Do not gitignore:

  • specs/ — These are your source of truth
  • supporting-docs/ — Context that drives spec generation
  • doc/ — Retained learnings from past sessions
  • .claude/ — Commands and skills needed by every collaborator
  • CLAUDE.md — Shared AI context for the project

Directory Creation

DirectoryCreated ByWhen
.claude/commands/install.shPlugin installation
.claude/skills/install.shPlugin installation
specs/views//ml-setupProject scaffolding
supporting-docs//ml-setupProject scaffolding
doc//ml-retainFirst learning retention session

You create feature subdirectories (e.g., specs/views/bookmarks/) manually when you save your wireframes.

Optional Files

These files are not created by any command but can add useful context:

FilePurposeWho Reads It
specs/views/*/about-this-view.mdExtra context for a specific view (design rationale, edge cases)/ml-spec, /ml-impl
doc/SHARED-PATTERNS.mdPatterns that apply across multiple features/ml-impl via CLAUDE.md reference
doc/DECISIONS.mdArchitectural decisions with rationale/ml-impl via CLAUDE.md reference

Source

git clone https://github.com/jpavley/meta-loop-ios/blob/main/skills/project-structure/SKILL.mdView on GitHub

Overview

Defines the directory layout, file ownership, and Xcode integration for meta-loop iOS projects. It explains where each file lives, who creates or maintains it, and how it maps to the Xcode project navigator.

How This Skill Works

The skill lays out a root MyApp structure with clear directories (MyApp/, MyAppTests/, specs/, supporting-docs/, .claude/...). It provides a File Responsibility Matrix that records Created By, Maintained By, In Xcode Project, and Purpose for each item, guiding what AI should generate versus what you maintain.

When to Use It

  • When initializing a new meta-loop iOS project and setting up the root structure
  • When integrating AI-generated artifacts (CLAUDE.md, specs, notes) into the Xcode workflow
  • When adding or updating a feature by extending specs/views and related app code
  • When auditing the project to confirm what lives in Xcode (which files are included and who owns them)
  • When reorganizing roles between you and the AI to reflect ownership and maintenance duties

Quick Start

  1. Step 1: Create the repo root with MyApp.xcodeproj and the directories shown (MyApp/, MyAppTests/, specs/, .claude/, doc/).
  2. Step 2: Add app sources under MyApp/ and tests under MyAppTests/, and place AI context files (CLAUDE.md, PROJECT-NOTES.md, PROJECT-TODO.md, README.md) in ml-setup relevant areas per the Matrix.
  3. Step 3: Add feature wireframes under specs/views/ and reference ML-generated spec.md; verify the items are included in the Xcode project and navigator.

Best Practices

  • Follow the Directory Layout to keep repo structure consistent (MyApp/, specs/, .claude/ and doc/)
  • Maintain the File Responsibility Matrix to track ownership and Xcode inclusion for every item
  • Keep Created By and Maintained By sections up to date as responsibilities shift
  • Put app source in MyApp/ and tests in MyAppTests/; avoid nesting unrelated assets in the Xcode project
  • Regularly update specs/*/spec.md and about-this-view.md to reflect current view designs

Example Use Cases

  • Starting a new project and laying out folders exactly as in the Directory Layout example
  • AI generates CLAUDE.md and spec wires while you maintain README and notes
  • A new FeatureView is added under MyApp/Views and wired into ContentView.swift
  • An auditor checks the File Responsibility Matrix to ensure only intended files are in the Xcode project
  • A feature-name specs directory gets a -wireframe.png plus spec.md and notes.md to drive implementation

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers