forge-dev 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- forge_core/__init__.py +3 -0
- forge_core/agents/__init__.py +1 -0
- forge_core/auditor.py +330 -0
- forge_core/cli.py +552 -0
- forge_core/detector.py +209 -0
- forge_core/editor_bridge.py +543 -0
- forge_core/models.py +332 -0
- forge_core/phases/__init__.py +1 -0
- forge_core/phases/coherence.py +293 -0
- forge_core/phases/context.py +264 -0
- forge_core/phases/intake.py +340 -0
- forge_core/registry.py +247 -0
- forge_core/standards/api-first-design.yaml +24 -0
- forge_core/standards/microservice-packaging.yaml +30 -0
- forge_core/standards/observability.yaml +31 -0
- forge_core/standards/security-baseline.yaml +43 -0
- forge_core/standards/type-safety.yaml +23 -0
- forge_core/templates/__init__.py +1 -0
- forge_core/utils/__init__.py +1 -0
- forge_dev-0.1.0.dist-info/METADATA +134 -0
- forge_dev-0.1.0.dist-info/RECORD +25 -0
- forge_dev-0.1.0.dist-info/WHEEL +4 -0
- forge_dev-0.1.0.dist-info/entry_points.txt +2 -0
- mcp_server/__init__.py +1 -0
- mcp_server/server.py +1086 -0
forge_core/registry.py
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"""Forge Registry — manages the global ~/.forge/ directory.
|
|
2
|
+
|
|
3
|
+
The registry is the brain of Forge. It stores:
|
|
4
|
+
- core/: Upstream workflow definitions (updated via `forge upgrade`)
|
|
5
|
+
- user/: User customizations (never touched by upgrade)
|
|
6
|
+
- user/history/: Project history and learnings
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import shutil
|
|
12
|
+
from datetime import datetime, timezone
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
import yaml
|
|
16
|
+
from rich.console import Console
|
|
17
|
+
|
|
18
|
+
from forge_core.models import MCPEntry, UserConfig
|
|
19
|
+
|
|
20
|
+
console = Console()
|
|
21
|
+
|
|
22
|
+
FORGE_HOME = Path.home() / ".forge"
|
|
23
|
+
CORE_DIR = FORGE_HOME / "core"
|
|
24
|
+
USER_DIR = FORGE_HOME / "user"
|
|
25
|
+
VERSION_FILE = CORE_DIR / "VERSION"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def get_forge_home() -> Path:
|
|
29
|
+
"""Return the global Forge home directory."""
|
|
30
|
+
return FORGE_HOME
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def ensure_registry() -> None:
|
|
34
|
+
"""Ensure the global ~/.forge/ registry exists with default structure."""
|
|
35
|
+
dirs = [
|
|
36
|
+
CORE_DIR / "phases",
|
|
37
|
+
CORE_DIR / "agents",
|
|
38
|
+
CORE_DIR / "templates",
|
|
39
|
+
CORE_DIR / "standards",
|
|
40
|
+
USER_DIR / "standards",
|
|
41
|
+
USER_DIR / "patterns",
|
|
42
|
+
USER_DIR / "anti-patterns",
|
|
43
|
+
USER_DIR / "history",
|
|
44
|
+
FORGE_HOME / "versions",
|
|
45
|
+
]
|
|
46
|
+
for d in dirs:
|
|
47
|
+
d.mkdir(parents=True, exist_ok=True)
|
|
48
|
+
|
|
49
|
+
# Write version if missing
|
|
50
|
+
if not VERSION_FILE.exists():
|
|
51
|
+
from forge_core import __version__
|
|
52
|
+
VERSION_FILE.write_text(__version__)
|
|
53
|
+
|
|
54
|
+
# Create default user config if missing
|
|
55
|
+
config_path = USER_DIR / "config.yaml"
|
|
56
|
+
if not config_path.exists():
|
|
57
|
+
_write_default_user_config(config_path)
|
|
58
|
+
|
|
59
|
+
# Create default MCP registry if missing
|
|
60
|
+
mcps_path = USER_DIR / "mcps.yaml"
|
|
61
|
+
if not mcps_path.exists():
|
|
62
|
+
_write_default_mcps(mcps_path)
|
|
63
|
+
|
|
64
|
+
console.print("[dim]Forge registry ready at ~/.forge/[/dim]")
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def load_user_config() -> UserConfig:
|
|
68
|
+
"""Load the user's global configuration."""
|
|
69
|
+
config_path = USER_DIR / "config.yaml"
|
|
70
|
+
if not config_path.exists():
|
|
71
|
+
return UserConfig()
|
|
72
|
+
|
|
73
|
+
with open(config_path) as f:
|
|
74
|
+
data = yaml.safe_load(f) or {}
|
|
75
|
+
return UserConfig(**data)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def save_user_config(config: UserConfig) -> None:
|
|
79
|
+
"""Save the user's global configuration."""
|
|
80
|
+
config_path = USER_DIR / "config.yaml"
|
|
81
|
+
config_path.parent.mkdir(parents=True, exist_ok=True)
|
|
82
|
+
with open(config_path, "w") as f:
|
|
83
|
+
yaml.dump(config.model_dump(mode="json"), f, default_flow_style=False, sort_keys=False)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def load_mcps() -> list[MCPEntry]:
|
|
87
|
+
"""Load the MCP registry."""
|
|
88
|
+
mcps_path = USER_DIR / "mcps.yaml"
|
|
89
|
+
if not mcps_path.exists():
|
|
90
|
+
return []
|
|
91
|
+
with open(mcps_path) as f:
|
|
92
|
+
data = yaml.safe_load(f) or {}
|
|
93
|
+
return [MCPEntry(**m) for m in data.get("mcps", [])]
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def get_forge_version() -> str:
|
|
97
|
+
"""Return current Forge version."""
|
|
98
|
+
if VERSION_FILE.exists():
|
|
99
|
+
return VERSION_FILE.read_text().strip()
|
|
100
|
+
from forge_core import __version__
|
|
101
|
+
return __version__
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def record_project(project_name: str, project_path: str, context_summary: dict) -> None:
|
|
105
|
+
"""Record a project in the history for cross-project learning."""
|
|
106
|
+
history_dir = USER_DIR / "history"
|
|
107
|
+
history_dir.mkdir(parents=True, exist_ok=True)
|
|
108
|
+
|
|
109
|
+
timestamp = datetime.now(timezone.utc).isoformat()
|
|
110
|
+
# Ensure all values are plain types (not enums)
|
|
111
|
+
clean_context = {}
|
|
112
|
+
for k, v in context_summary.items():
|
|
113
|
+
clean_context[k] = v.value if hasattr(v, "value") else v
|
|
114
|
+
|
|
115
|
+
entry = {
|
|
116
|
+
"project": project_name,
|
|
117
|
+
"path": project_path,
|
|
118
|
+
"timestamp": timestamp,
|
|
119
|
+
"forge_version": get_forge_version(),
|
|
120
|
+
"context": clean_context,
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
history_file = history_dir / "projects.yaml"
|
|
124
|
+
existing: list = []
|
|
125
|
+
if history_file.exists():
|
|
126
|
+
with open(history_file) as f:
|
|
127
|
+
data = yaml.safe_load(f) or {}
|
|
128
|
+
existing = data.get("projects", [])
|
|
129
|
+
|
|
130
|
+
existing.append(entry)
|
|
131
|
+
with open(history_file, "w") as f:
|
|
132
|
+
yaml.dump({"projects": existing}, f, default_flow_style=False, sort_keys=False)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def load_standards(include_user: bool = True) -> list[dict]:
|
|
136
|
+
"""Load all standards (core + user)."""
|
|
137
|
+
standards = []
|
|
138
|
+
|
|
139
|
+
# Core standards
|
|
140
|
+
core_standards_dir = CORE_DIR / "standards"
|
|
141
|
+
if core_standards_dir.exists():
|
|
142
|
+
for f in sorted(core_standards_dir.glob("*.yaml")):
|
|
143
|
+
with open(f) as fp:
|
|
144
|
+
data = yaml.safe_load(fp) or {}
|
|
145
|
+
data["_source"] = "core"
|
|
146
|
+
data["_file"] = str(f)
|
|
147
|
+
standards.append(data)
|
|
148
|
+
|
|
149
|
+
# User standards
|
|
150
|
+
if include_user:
|
|
151
|
+
user_standards_dir = USER_DIR / "standards"
|
|
152
|
+
if user_standards_dir.exists():
|
|
153
|
+
for f in sorted(user_standards_dir.glob("*.yaml")):
|
|
154
|
+
with open(f) as fp:
|
|
155
|
+
data = yaml.safe_load(fp) or {}
|
|
156
|
+
data["_source"] = "user"
|
|
157
|
+
data["_file"] = str(f)
|
|
158
|
+
standards.append(data)
|
|
159
|
+
|
|
160
|
+
return standards
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def version_workflow(change_description: str) -> str:
|
|
164
|
+
"""Create a new version snapshot of the workflow."""
|
|
165
|
+
versions_dir = FORGE_HOME / "versions"
|
|
166
|
+
versions_dir.mkdir(parents=True, exist_ok=True)
|
|
167
|
+
|
|
168
|
+
timestamp = datetime.now(timezone.utc).strftime("%Y%m%d_%H%M%S")
|
|
169
|
+
version_dir = versions_dir / timestamp
|
|
170
|
+
|
|
171
|
+
# Snapshot core + user
|
|
172
|
+
shutil.copytree(CORE_DIR, version_dir / "core", dirs_exist_ok=True)
|
|
173
|
+
shutil.copytree(USER_DIR, version_dir / "user", dirs_exist_ok=True)
|
|
174
|
+
|
|
175
|
+
# Write change log
|
|
176
|
+
changelog = version_dir / "CHANGELOG.md"
|
|
177
|
+
changelog.write_text(
|
|
178
|
+
f"# Forge Workflow Version {timestamp}\n\n"
|
|
179
|
+
f"**Date:** {datetime.now(timezone.utc).isoformat()}\n"
|
|
180
|
+
f"**Change:** {change_description}\n"
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
return timestamp
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
# ── Private helpers ────────────────────────────────────────────────────────
|
|
187
|
+
|
|
188
|
+
def _write_default_user_config(path: Path) -> None:
|
|
189
|
+
"""Write the default user config with Luis's preferences."""
|
|
190
|
+
config = UserConfig(
|
|
191
|
+
cloud="azure",
|
|
192
|
+
backend=None, # Ask each time
|
|
193
|
+
frontend="react",
|
|
194
|
+
database="postgresql",
|
|
195
|
+
auth="azure-ad-b2c",
|
|
196
|
+
ai={"enabled": True, "providers": ["anthropic", "openai"], "observability": True},
|
|
197
|
+
observability={
|
|
198
|
+
"apm": "azure-app-insights",
|
|
199
|
+
"metrics": "prometheus",
|
|
200
|
+
"logs": "loki",
|
|
201
|
+
"dashboards": "grafana",
|
|
202
|
+
},
|
|
203
|
+
api={
|
|
204
|
+
"style": "rest",
|
|
205
|
+
"spec": "openapi-3.1",
|
|
206
|
+
"mcp_ready": True,
|
|
207
|
+
"versioning": "url-prefix",
|
|
208
|
+
},
|
|
209
|
+
cicd={
|
|
210
|
+
"provider": "github-actions",
|
|
211
|
+
"iac": "pulumi",
|
|
212
|
+
"environments": ["dev", "staging", "production"],
|
|
213
|
+
},
|
|
214
|
+
standards={
|
|
215
|
+
"type_checking": "strict",
|
|
216
|
+
"linting": "enforced",
|
|
217
|
+
"test_coverage_min": 80,
|
|
218
|
+
},
|
|
219
|
+
)
|
|
220
|
+
with open(path, "w") as f:
|
|
221
|
+
yaml.dump(config.model_dump(mode="json"), f, default_flow_style=False, sort_keys=False)
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def _write_default_mcps(path: Path) -> None:
|
|
225
|
+
"""Write the default MCP registry."""
|
|
226
|
+
mcps = {
|
|
227
|
+
"mcps": [
|
|
228
|
+
{
|
|
229
|
+
"name": "context7",
|
|
230
|
+
"description": "Library documentation by version — essential for accurate dependency usage",
|
|
231
|
+
"url": "npx -y @upstash/context7-mcp@latest",
|
|
232
|
+
"transport": "stdio",
|
|
233
|
+
"auto_suggest": True,
|
|
234
|
+
"conditions": ["has_package_json", "has_requirements_txt", "has_pyproject_toml"],
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"name": "github",
|
|
238
|
+
"description": "GitHub operations — repos, issues, PRs, actions",
|
|
239
|
+
"url": "npx -y @modelcontextprotocol/server-github",
|
|
240
|
+
"transport": "stdio",
|
|
241
|
+
"auto_suggest": True,
|
|
242
|
+
"conditions": ["has_git"],
|
|
243
|
+
},
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
with open(path, "w") as f:
|
|
247
|
+
yaml.dump(mcps, f, default_flow_style=False, sort_keys=False)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: api-first-design
|
|
2
|
+
area: api-design
|
|
3
|
+
description: All services must be API-first with OpenAPI 3.1 specs, MCP-ready endpoints, and URL-prefix versioning.
|
|
4
|
+
enforcement: required
|
|
5
|
+
|
|
6
|
+
rules:
|
|
7
|
+
- Every microservice MUST have an OpenAPI 3.1 specification defined before implementation
|
|
8
|
+
- All endpoints MUST use URL-prefix versioning (e.g., /v1/users, /v2/users)
|
|
9
|
+
- All endpoints MUST be designed for MCP consumption — clear input/output schemas, no implicit state
|
|
10
|
+
- Response formats MUST support both JSON (default) and optionally Markdown for AI agent consumption
|
|
11
|
+
- Every endpoint MUST have rate limiting configured
|
|
12
|
+
- Health check endpoints (/health, /ready) MUST exist on every service
|
|
13
|
+
- Error responses MUST follow RFC 7807 Problem Details format
|
|
14
|
+
- Pagination MUST use cursor-based or offset-based with consistent patterns across all endpoints
|
|
15
|
+
- All APIs MUST be independently packageable — any microservice's API can be extracted and sold/integrated separately
|
|
16
|
+
|
|
17
|
+
examples:
|
|
18
|
+
good:
|
|
19
|
+
- "GET /v1/users?cursor=abc123&limit=20 with Link headers for pagination"
|
|
20
|
+
- "POST /v1/claims with OpenAPI-validated request body and RFC 7807 errors"
|
|
21
|
+
bad:
|
|
22
|
+
- "GET /users with no versioning"
|
|
23
|
+
- "POST /submit-form returning HTML instead of JSON"
|
|
24
|
+
- "Endpoints that depend on session state instead of explicit parameters"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: microservice-packaging
|
|
2
|
+
area: architecture
|
|
3
|
+
description: Every microservice must be independently deployable, packageable, and sellable. API-driven, MCP-ready, reusable.
|
|
4
|
+
enforcement: required
|
|
5
|
+
|
|
6
|
+
rules:
|
|
7
|
+
- Each microservice MUST have its own repository or clearly isolated module with independent deployment
|
|
8
|
+
- Each microservice MUST have a complete OpenAPI spec that documents its full API surface
|
|
9
|
+
- Each microservice MUST be containerized with its own Dockerfile
|
|
10
|
+
- Each microservice MUST have independent health checks and readiness probes
|
|
11
|
+
- Services MUST communicate via well-defined APIs — no shared databases between services
|
|
12
|
+
- Each service MUST be configurable via environment variables following 12-factor app principles
|
|
13
|
+
- Services MUST implement circuit breaker patterns for external dependencies
|
|
14
|
+
- Each service MUST be independently scalable
|
|
15
|
+
- Service APIs MUST be designed for repackaging — any service can be extracted and offered as a standalone product or integration
|
|
16
|
+
- MCP tool definitions SHOULD be generated from OpenAPI specs for each service
|
|
17
|
+
|
|
18
|
+
patterns:
|
|
19
|
+
- Strangler Fig for incremental modernization of legacy services
|
|
20
|
+
- Saga pattern for distributed transactions
|
|
21
|
+
- Event sourcing for audit-critical domains
|
|
22
|
+
- CQRS when read and write patterns differ significantly
|
|
23
|
+
- Sidecar pattern for cross-cutting concerns (auth, logging, metrics)
|
|
24
|
+
|
|
25
|
+
anti_patterns:
|
|
26
|
+
- Distributed monolith — services that must be deployed together
|
|
27
|
+
- Shared database between services
|
|
28
|
+
- Synchronous chains of more than 3 services
|
|
29
|
+
- Services that know internal details of other services
|
|
30
|
+
- Hard-coded service URLs instead of service discovery
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: observability-from-day-one
|
|
2
|
+
area: observability
|
|
3
|
+
description: Every project ships with full observability from the first commit. APM, metrics, structured logging, dashboards, and AI-specific tracking.
|
|
4
|
+
enforcement: required
|
|
5
|
+
|
|
6
|
+
rules:
|
|
7
|
+
- APM (Azure Application Insights or equivalent) MUST be configured before any business logic
|
|
8
|
+
- All log output MUST be structured (JSON format) with correlation IDs
|
|
9
|
+
- Custom metrics MUST be exposed via Prometheus-compatible endpoint (/metrics)
|
|
10
|
+
- Grafana dashboards MUST be defined as code (JSON/YAML) and version-controlled
|
|
11
|
+
- Every HTTP request MUST be traced with distributed tracing (W3C Trace Context)
|
|
12
|
+
- Every database query MUST be instrumented with timing metrics
|
|
13
|
+
- Error rates, latency percentiles (p50, p95, p99), and throughput MUST be tracked per endpoint
|
|
14
|
+
- Alert rules MUST be defined for error rate spikes, latency degradation, and service unavailability
|
|
15
|
+
|
|
16
|
+
ai_observability:
|
|
17
|
+
- When AI is enabled, track per-request: model used, tokens in/out, latency, cost
|
|
18
|
+
- Track AI session context window utilization
|
|
19
|
+
- Monitor prompt injection attempts and safety filter triggers
|
|
20
|
+
- Alert on AI cost anomalies (>2x normal daily spend)
|
|
21
|
+
- Log all AI interactions with trace IDs for debugging
|
|
22
|
+
- Track AI response quality metrics where measurable
|
|
23
|
+
|
|
24
|
+
examples:
|
|
25
|
+
good:
|
|
26
|
+
- "Structured log: {\"level\": \"info\", \"correlation_id\": \"abc\", \"action\": \"claim_submitted\", \"duration_ms\": 142}"
|
|
27
|
+
- "AI metrics: {\"model\": \"claude-sonnet-4-20250514\", \"tokens_in\": 1200, \"tokens_out\": 450, \"cost_usd\": 0.003, \"trace_id\": \"xyz\"}"
|
|
28
|
+
bad:
|
|
29
|
+
- "print('claim submitted')"
|
|
30
|
+
- "console.log('error:', err)"
|
|
31
|
+
- "No monitoring until production issues arise"
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: security-baseline
|
|
2
|
+
area: security
|
|
3
|
+
description: Security is built-in from Phase 3, not bolted on later. Auth, input validation, secrets management, and compliance guardrails.
|
|
4
|
+
enforcement: required
|
|
5
|
+
|
|
6
|
+
rules:
|
|
7
|
+
- Authentication MUST be implemented before any business logic endpoint
|
|
8
|
+
- All user input MUST be validated at the API boundary using typed models (Pydantic/Zod)
|
|
9
|
+
- Secrets MUST never appear in code, config files, or logs — use Azure Key Vault or equivalent
|
|
10
|
+
- CORS MUST be explicitly configured — never use wildcard (*) in production
|
|
11
|
+
- All inter-service communication MUST be authenticated (service-to-service tokens or mTLS)
|
|
12
|
+
- SQL queries MUST use parameterized queries — no string concatenation
|
|
13
|
+
- File uploads MUST validate type, size, and content — never trust client-provided MIME types
|
|
14
|
+
- Rate limiting MUST be applied to all public endpoints
|
|
15
|
+
- Security headers MUST be set (HSTS, X-Content-Type-Options, X-Frame-Options, CSP)
|
|
16
|
+
- Dependency vulnerabilities MUST be scanned in CI (npm audit, safety, trivy)
|
|
17
|
+
|
|
18
|
+
regulatory_extensions:
|
|
19
|
+
hipaa:
|
|
20
|
+
- All PHI must be encrypted at rest and in transit (AES-256, TLS 1.2+)
|
|
21
|
+
- Audit logging of all PHI access with user identity and timestamp
|
|
22
|
+
- Business Associate Agreements must be in place for all cloud services
|
|
23
|
+
- Minimum necessary access principle enforced via RBAC
|
|
24
|
+
- Session timeouts must not exceed 15 minutes of inactivity
|
|
25
|
+
ferpa:
|
|
26
|
+
- Student education records must have restricted access controls
|
|
27
|
+
- Consent tracking for data sharing
|
|
28
|
+
- Audit trail for all record access
|
|
29
|
+
gdpr:
|
|
30
|
+
- Data processing consent must be explicit and recorded
|
|
31
|
+
- Right to deletion must be implementable
|
|
32
|
+
- Data portability exports must be available
|
|
33
|
+
- Privacy impact assessment for new features
|
|
34
|
+
|
|
35
|
+
examples:
|
|
36
|
+
good:
|
|
37
|
+
- "Azure Key Vault integration for all secrets with managed identity"
|
|
38
|
+
- "Pydantic model validation on all FastAPI endpoints"
|
|
39
|
+
- "RBAC middleware checking permissions before handler execution"
|
|
40
|
+
bad:
|
|
41
|
+
- "API_KEY = 'sk-abc123' in settings.py"
|
|
42
|
+
- "cors(origin='*') in production"
|
|
43
|
+
- "f'SELECT * FROM users WHERE id = {user_id}'"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: type-safety
|
|
2
|
+
area: code-quality
|
|
3
|
+
description: Strict type checking enforced across all languages. No any types, no implicit conversions, full type coverage.
|
|
4
|
+
enforcement: required
|
|
5
|
+
|
|
6
|
+
rules:
|
|
7
|
+
- Python projects MUST use strict mypy configuration (strict = true)
|
|
8
|
+
- TypeScript projects MUST use strict: true in tsconfig.json
|
|
9
|
+
- No use of `any` type in TypeScript — use `unknown` with type guards instead
|
|
10
|
+
- No use of `# type: ignore` in Python without an explanatory comment
|
|
11
|
+
- All function parameters and return types MUST be annotated
|
|
12
|
+
- Pydantic models MUST be used for all data validation boundaries (API input, config, external data)
|
|
13
|
+
- Generic types MUST be parameterized (List[str] not List, Dict[str, int] not Dict)
|
|
14
|
+
- Runtime type validation at all system boundaries (API endpoints, message consumers, file parsers)
|
|
15
|
+
|
|
16
|
+
examples:
|
|
17
|
+
good:
|
|
18
|
+
- "def process_claim(claim: ClaimModel) -> ProcessingResult:"
|
|
19
|
+
- "const user: User = await getUser(id)"
|
|
20
|
+
bad:
|
|
21
|
+
- "def process_claim(claim):"
|
|
22
|
+
- "const user: any = await getUser(id)"
|
|
23
|
+
- "data: dict = {}"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Forge project templates."""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Forge utilities."""
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: forge-dev
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AI-Native Development Workflow Engine
|
|
5
|
+
Author: NaiaTech
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: ai,development,mcp,scaffold,workflow
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
14
|
+
Requires-Python: >=3.11
|
|
15
|
+
Requires-Dist: click>=8.1.0
|
|
16
|
+
Requires-Dist: gitpython>=3.1.0
|
|
17
|
+
Requires-Dist: httpx>=0.27.0
|
|
18
|
+
Requires-Dist: jinja2>=3.1
|
|
19
|
+
Requires-Dist: mcp>=1.0.0
|
|
20
|
+
Requires-Dist: pydantic>=2.0
|
|
21
|
+
Requires-Dist: pyyaml>=6.0
|
|
22
|
+
Requires-Dist: rich>=13.0
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# Forge — AI-Native Development Workflow Engine
|
|
31
|
+
|
|
32
|
+
Forge is a development workflow system that transforms requirements into production-ready, audited, observable code. It is designed exclusively for AI-assisted development, optimizing every step for how AI coding agents work.
|
|
33
|
+
|
|
34
|
+
## Philosophy
|
|
35
|
+
|
|
36
|
+
Forge encodes a complete development paradigm — from receiving a vague requirement to deploying a fully observable SaaS application. It handles all the non-functional requirements (security, observability, auth, API design, compliance) so you can focus on business logic.
|
|
37
|
+
|
|
38
|
+
**Core principles:**
|
|
39
|
+
- Requirements in, production code out
|
|
40
|
+
- Strong defaults, flexible overrides
|
|
41
|
+
- Every project starts with everything (observability, auth, CI/CD, IaC)
|
|
42
|
+
- AI-coding-agent-first task ordering
|
|
43
|
+
- Continuous auditing — not just at the end
|
|
44
|
+
- API-first, MCP-ready, repackageable microservices
|
|
45
|
+
- The workflow evolves and versions itself
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install forge-dev
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or install from source:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
git clone https://github.com/<org>/forge.git
|
|
57
|
+
cd forge
|
|
58
|
+
pip install -e .
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Quick Start
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# New project — empty folder
|
|
65
|
+
cd my-new-project
|
|
66
|
+
forge init
|
|
67
|
+
|
|
68
|
+
# New project — with requirements doc
|
|
69
|
+
cd my-new-project
|
|
70
|
+
cp ~/requirements.md .
|
|
71
|
+
forge init
|
|
72
|
+
|
|
73
|
+
# Existing project — assess maturity
|
|
74
|
+
cd my-existing-project
|
|
75
|
+
forge assess
|
|
76
|
+
|
|
77
|
+
# Upgrade Forge to latest version
|
|
78
|
+
forge upgrade
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Commands
|
|
82
|
+
|
|
83
|
+
| Command | Description |
|
|
84
|
+
|---------|-------------|
|
|
85
|
+
| `forge init` | Initialize Forge in a project (detects context automatically) |
|
|
86
|
+
| `forge intake <file>` | Process a requirement document into a Forge Brief |
|
|
87
|
+
| `forge plan` | Generate AI-optimized implementation plan |
|
|
88
|
+
| `forge audit` | Run all audit agents against current code |
|
|
89
|
+
| `forge assess` | Evaluate existing project against current standards |
|
|
90
|
+
| `forge upgrade` | Update Forge core from upstream |
|
|
91
|
+
| `forge journal` | Add learnings/nuances to project journal |
|
|
92
|
+
| `forge status` | Show current project state and plan progress |
|
|
93
|
+
| `forge standards` | View, add, or modify standards |
|
|
94
|
+
| `forge mcps` | View or configure recommended MCPs |
|
|
95
|
+
|
|
96
|
+
## Architecture
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
~/.forge/ ← Global Forge installation
|
|
100
|
+
├── core/ ← Upstream (updated via forge upgrade)
|
|
101
|
+
│ ├── VERSION
|
|
102
|
+
│ ├── phases/ ← Workflow phase definitions
|
|
103
|
+
│ ├── agents/ ← Audit agent configurations
|
|
104
|
+
│ ├── templates/ ← Project scaffold templates
|
|
105
|
+
│ └── standards/ ← Base standards
|
|
106
|
+
├── user/ ← Your customizations (never touched by upgrade)
|
|
107
|
+
│ ├── config.yaml ← Your defaults (cloud, stack, preferences)
|
|
108
|
+
│ ├── standards/ ← Standards you've added
|
|
109
|
+
│ ├── patterns/ ← Approved patterns with code examples
|
|
110
|
+
│ ├── anti-patterns/ ← Things to never do
|
|
111
|
+
│ ├── mcps.yaml ← Your MCP registry
|
|
112
|
+
│ └── history/ ← Project history and learnings
|
|
113
|
+
|
|
114
|
+
project/.forge/ ← Per-project Forge state
|
|
115
|
+
├── context.yaml ← Stack, infra, decisions
|
|
116
|
+
├── brief.md ← Normalized requirement
|
|
117
|
+
├── plan.yaml ← AI-optimized implementation plan
|
|
118
|
+
├── journal.md ← Project-specific learnings
|
|
119
|
+
├── overrides/ ← Local standard overrides
|
|
120
|
+
├── audit/ ← Audit logs
|
|
121
|
+
└── maturity.yaml ← Assessment results
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## MCP Server
|
|
125
|
+
|
|
126
|
+
Forge also runs as an MCP server, making it accessible from any editor (Cursor, Copilot, Windsurf, etc.):
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
forge mcp start
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
MIT
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
forge_core/__init__.py,sha256=2_hzXS_uodiCQQJSacDf01rQ5CNbqLp4Q47nyOjhNJs,78
|
|
2
|
+
forge_core/auditor.py,sha256=nC2cVMUNyaq-d6Y5mT5ClWFZsS7yOj0Cb-FJyhixuHA,10840
|
|
3
|
+
forge_core/cli.py,sha256=-Lv83xYMcZdZI_xvEcIwrOSQ1_tG6K5Mz6l7typlKec,20041
|
|
4
|
+
forge_core/detector.py,sha256=maC14GRswmCXKuR3yc6Er9tVzXkOrEsrTOfWxZk7tT0,7100
|
|
5
|
+
forge_core/editor_bridge.py,sha256=8xychBHscActLqgmHG4NydJtqIHQtVO8rbJXfXIy7Go,20028
|
|
6
|
+
forge_core/models.py,sha256=eg9_UQhiwBp0_aXY0bdor4KU79D9VzR0KwzrO0bZiCU,12488
|
|
7
|
+
forge_core/registry.py,sha256=iRP1T95KTn8Q1hGK4__RKj0T4WbkgBGgTw2Rko_aiME,8027
|
|
8
|
+
forge_core/agents/__init__.py,sha256=8AZVjeixljFUfoEmcAiX9qCUYS1iump6IRJw3oKgxGs,26
|
|
9
|
+
forge_core/phases/__init__.py,sha256=-mhvjdohztV4g2LT5vIQyc1tztJP7ZTBlVos9-GG8z0,29
|
|
10
|
+
forge_core/phases/coherence.py,sha256=P1NLLDzbdG1RrG7lsSUl4ZlbybU5_ivi2rw20bK0mrs,10450
|
|
11
|
+
forge_core/phases/context.py,sha256=oXaq6OjOTfmU14Mxu9WHMaesoLbmx4-VbocxrJCW11k,8720
|
|
12
|
+
forge_core/phases/intake.py,sha256=YDqwe3VUE1MfJTXol5mwubBkvrA3jnlRNYgBgglNR98,11833
|
|
13
|
+
forge_core/standards/api-first-design.yaml,sha256=gt6OFtT6aNAayGcQwrLUQhpWSIjBJgkyJdB6s7H4De8,1333
|
|
14
|
+
forge_core/standards/microservice-packaging.yaml,sha256=1TbR19Er22bKCKU2MzO8bfmjJpbj4qo1iixdX7JqsZI,1668
|
|
15
|
+
forge_core/standards/observability.yaml,sha256=s9r1gUsI8GLr3tTxHaZShcp9CKqurTBngubbXQpeqho,1725
|
|
16
|
+
forge_core/standards/security-baseline.yaml,sha256=GRBgu5mUn2etN56bd_nrlWwiLhzkHW2vuWtUJzpT7QU,2157
|
|
17
|
+
forge_core/standards/type-safety.yaml,sha256=kOR4YOShJhEVHXMTQ6pxUQ0Uu_cTMMpiRr08AOAvYzw,1072
|
|
18
|
+
forge_core/templates/__init__.py,sha256=lZPSsHngAlmGqGojg1P73r7x5RbQTOlnlSXGsUJ0iA4,31
|
|
19
|
+
forge_core/utils/__init__.py,sha256=jjr0XYM79zIoqtjkW8DGFqqEzEIcbD0bsZK9Om5SB6g,23
|
|
20
|
+
mcp_server/__init__.py,sha256=ctQnNQ6nhaORB2xg3xHa8409rRLqmnVIx5bxBHpAz-Y,24
|
|
21
|
+
mcp_server/server.py,sha256=VtqA209TwkBK7F4fImXkAi_uETdxMtFXbavDkDwk5K0,36416
|
|
22
|
+
forge_dev-0.1.0.dist-info/METADATA,sha256=wUU5dH1PUdTVfWulyxRgE9rvqIHMZ-O0FSH5ysMTOp8,4811
|
|
23
|
+
forge_dev-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
24
|
+
forge_dev-0.1.0.dist-info/entry_points.txt,sha256=2f220Su2tReWGnflhQnNtaiIj3d-sL5NmuN0Mw6mGfo,46
|
|
25
|
+
forge_dev-0.1.0.dist-info/RECORD,,
|
mcp_server/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Forge MCP Server."""
|