feed-the-machine 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +268 -0
- package/bin/generate-manifest.mjs +210 -0
- package/bin/install.mjs +114 -0
- package/ftm/SKILL.md +88 -0
- package/ftm-audit/SKILL.md +146 -0
- package/ftm-audit/references/protocols/PROJECT-PATTERNS.md +91 -0
- package/ftm-audit/references/protocols/RUNTIME-WIRING.md +66 -0
- package/ftm-audit/references/protocols/WIRING-CONTRACTS.md +135 -0
- package/ftm-audit/references/strategies/AUTO-FIX-STRATEGIES.md +69 -0
- package/ftm-audit/references/templates/REPORT-FORMAT.md +96 -0
- package/ftm-audit/scripts/run-knip.sh +23 -0
- package/ftm-audit.yml +2 -0
- package/ftm-brainstorm/SKILL.md +379 -0
- package/ftm-brainstorm/evals/evals.json +100 -0
- package/ftm-brainstorm/evals/promptfoo.yaml +109 -0
- package/ftm-brainstorm/references/agent-prompts.md +224 -0
- package/ftm-brainstorm/references/plan-template.md +121 -0
- package/ftm-brainstorm.yml +2 -0
- package/ftm-browse/SKILL.md +415 -0
- package/ftm-browse/daemon/browser-manager.ts +206 -0
- package/ftm-browse/daemon/bun.lock +30 -0
- package/ftm-browse/daemon/cli.ts +347 -0
- package/ftm-browse/daemon/commands.ts +410 -0
- package/ftm-browse/daemon/main.ts +357 -0
- package/ftm-browse/daemon/package.json +17 -0
- package/ftm-browse/daemon/server.ts +189 -0
- package/ftm-browse/daemon/snapshot.ts +519 -0
- package/ftm-browse/daemon/tsconfig.json +22 -0
- package/ftm-browse.yml +4 -0
- package/ftm-codex-gate/SKILL.md +302 -0
- package/ftm-codex-gate.yml +2 -0
- package/ftm-config/SKILL.md +310 -0
- package/ftm-config.default.yml +80 -0
- package/ftm-config.yml +2 -0
- package/ftm-council/SKILL.md +132 -0
- package/ftm-council/references/prompts/CLAUDE-INVESTIGATION.md +60 -0
- package/ftm-council/references/prompts/CODEX-INVESTIGATION.md +58 -0
- package/ftm-council/references/prompts/GEMINI-INVESTIGATION.md +58 -0
- package/ftm-council/references/prompts/REBUTTAL-TEMPLATE.md +57 -0
- package/ftm-council/references/protocols/PREREQUISITES.md +47 -0
- package/ftm-council/references/protocols/STEP-0-FRAMING.md +46 -0
- package/ftm-council.yml +2 -0
- package/ftm-dashboard.yml +4 -0
- package/ftm-debug/SKILL.md +146 -0
- package/ftm-debug/references/phases/PHASE-0-INTAKE.md +58 -0
- package/ftm-debug/references/phases/PHASE-1-TRIAGE.md +46 -0
- package/ftm-debug/references/phases/PHASE-2-WAR-ROOM-AGENTS.md +279 -0
- package/ftm-debug/references/phases/PHASE-3-TO-6-EXECUTION.md +436 -0
- package/ftm-debug/references/protocols/BLACKBOARD.md +86 -0
- package/ftm-debug/references/protocols/EDGE-CASES.md +103 -0
- package/ftm-debug.yml +2 -0
- package/ftm-diagram/SKILL.md +233 -0
- package/ftm-diagram.yml +2 -0
- package/ftm-executor/SKILL.md +657 -0
- package/ftm-executor/references/STYLE-TEMPLATE.md +73 -0
- package/ftm-executor/references/phases/PHASE-0-VERIFICATION.md +62 -0
- package/ftm-executor/references/phases/PHASE-2-AGENT-ASSEMBLY.md +34 -0
- package/ftm-executor/references/phases/PHASE-3-WORKTREES.md +38 -0
- package/ftm-executor/references/phases/PHASE-4-5-AUDIT.md +72 -0
- package/ftm-executor/references/phases/PHASE-4-DISPATCH.md +66 -0
- package/ftm-executor/references/phases/PHASE-5-5-CODEX-GATE.md +73 -0
- package/ftm-executor/references/protocols/DOCUMENTATION-BOOTSTRAP.md +36 -0
- package/ftm-executor/references/protocols/MODEL-PROFILE.md +44 -0
- package/ftm-executor/references/protocols/PROGRESS-TRACKING.md +66 -0
- package/ftm-executor/runtime/ftm-runtime.mjs +252 -0
- package/ftm-executor/runtime/package.json +8 -0
- package/ftm-executor.yml +2 -0
- package/ftm-git/SKILL.md +195 -0
- package/ftm-git/evals/evals.json +26 -0
- package/ftm-git/evals/promptfoo.yaml +75 -0
- package/ftm-git/hooks/post-commit-experience.sh +92 -0
- package/ftm-git/references/patterns/SECRET-PATTERNS.md +104 -0
- package/ftm-git/references/protocols/REMEDIATION.md +139 -0
- package/ftm-git/scripts/pre-commit-secrets.sh +110 -0
- package/ftm-git.yml +2 -0
- package/ftm-intent/SKILL.md +198 -0
- package/ftm-intent.yml +2 -0
- package/ftm-map.yml +2 -0
- package/ftm-mind/SKILL.md +986 -0
- package/ftm-mind/evals/promptfoo.yaml +142 -0
- package/ftm-mind/references/blackboard-schema.md +328 -0
- package/ftm-mind/references/complexity-guide.md +110 -0
- package/ftm-mind/references/event-registry.md +299 -0
- package/ftm-mind/references/mcp-inventory.md +296 -0
- package/ftm-mind/references/protocols/COMPLEXITY-SIZING.md +72 -0
- package/ftm-mind/references/protocols/MCP-HEURISTICS.md +32 -0
- package/ftm-mind/references/protocols/PLAN-APPROVAL.md +80 -0
- package/ftm-mind/references/reflexion-protocol.md +249 -0
- package/ftm-mind/references/routing/SCENARIOS.md +22 -0
- package/ftm-mind/references/routing-scenarios.md +35 -0
- package/ftm-mind.yml +2 -0
- package/ftm-pause/SKILL.md +133 -0
- package/ftm-pause/references/protocols/SKILL-RESTORE-PROTOCOLS.md +186 -0
- package/ftm-pause/references/protocols/VALIDATION.md +80 -0
- package/ftm-pause.yml +2 -0
- package/ftm-researcher.yml +2 -0
- package/ftm-resume/SKILL.md +166 -0
- package/ftm-resume/references/protocols/VALIDATION.md +172 -0
- package/ftm-resume.yml +2 -0
- package/ftm-retro/SKILL.md +189 -0
- package/ftm-retro/references/protocols/SCORING-RUBRICS.md +89 -0
- package/ftm-retro/references/templates/REPORT-FORMAT.md +109 -0
- package/ftm-retro.yml +2 -0
- package/ftm-routine.yml +4 -0
- package/ftm-state/blackboard/context.json +23 -0
- package/ftm-state/blackboard/experiences/index.json +9 -0
- package/ftm-state/blackboard/patterns.json +6 -0
- package/ftm-state/schemas/context.schema.json +130 -0
- package/ftm-state/schemas/experience-index.schema.json +77 -0
- package/ftm-state/schemas/experience.schema.json +78 -0
- package/ftm-state/schemas/patterns.schema.json +44 -0
- package/ftm-upgrade/SKILL.md +153 -0
- package/ftm-upgrade/scripts/check-version.sh +76 -0
- package/ftm-upgrade/scripts/upgrade.sh +143 -0
- package/ftm-upgrade.yml +2 -0
- package/ftm.yml +2 -0
- package/install.sh +102 -0
- package/package.json +74 -0
- package/uninstall.sh +25 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "experience.schema.json",
|
|
4
|
+
"title": "Blackboard Experience Entry",
|
|
5
|
+
"description": "Schema for an individual experience file stored in ftm-state/blackboard/experiences/",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["task_type", "task_description", "timestamp"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"task_type": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "Category of task this experience was recorded from (e.g. feature, bugfix, refactor)"
|
|
13
|
+
},
|
|
14
|
+
"task_description": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Human-readable description of the task that generated this experience"
|
|
17
|
+
},
|
|
18
|
+
"agent_team": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"description": "Names of agents that participated in executing the task",
|
|
21
|
+
"items": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"wave_count": {
|
|
26
|
+
"type": "integer",
|
|
27
|
+
"minimum": 1,
|
|
28
|
+
"description": "Number of execution waves that occurred during the task"
|
|
29
|
+
},
|
|
30
|
+
"audit_outcomes": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"description": "Summary of audit results across all waves",
|
|
33
|
+
"additionalProperties": false,
|
|
34
|
+
"properties": {
|
|
35
|
+
"pass": {
|
|
36
|
+
"type": "integer",
|
|
37
|
+
"minimum": 0,
|
|
38
|
+
"description": "Number of audit checks that passed without modification"
|
|
39
|
+
},
|
|
40
|
+
"auto_fix": {
|
|
41
|
+
"type": "integer",
|
|
42
|
+
"minimum": 0,
|
|
43
|
+
"description": "Number of audit checks that were automatically corrected"
|
|
44
|
+
},
|
|
45
|
+
"fail": {
|
|
46
|
+
"type": "integer",
|
|
47
|
+
"minimum": 0,
|
|
48
|
+
"description": "Number of audit checks that failed and required manual resolution"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"lessons_learned": {
|
|
53
|
+
"type": "array",
|
|
54
|
+
"description": "Key takeaways extracted from this experience for future sessions",
|
|
55
|
+
"items": {
|
|
56
|
+
"type": "string"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"timestamp": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"format": "date-time",
|
|
62
|
+
"description": "ISO 8601 timestamp when this experience was recorded"
|
|
63
|
+
},
|
|
64
|
+
"confidence": {
|
|
65
|
+
"type": "number",
|
|
66
|
+
"minimum": 0,
|
|
67
|
+
"maximum": 1,
|
|
68
|
+
"description": "Confidence score for this experience (0.0 = low, 1.0 = high)"
|
|
69
|
+
},
|
|
70
|
+
"tags": {
|
|
71
|
+
"type": "array",
|
|
72
|
+
"description": "Free-form labels for indexing and retrieval",
|
|
73
|
+
"items": {
|
|
74
|
+
"type": "string"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "patterns.schema.json",
|
|
4
|
+
"title": "Blackboard Patterns",
|
|
5
|
+
"description": "Schema for the blackboard patterns file that accumulates learned behavioral and structural patterns",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"codebase_insights",
|
|
9
|
+
"execution_patterns",
|
|
10
|
+
"user_behavior",
|
|
11
|
+
"recurring_issues"
|
|
12
|
+
],
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"properties": {
|
|
15
|
+
"codebase_insights": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"description": "Observations about the structure, conventions, and characteristics of the codebase",
|
|
18
|
+
"items": {
|
|
19
|
+
"type": "object"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"execution_patterns": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"description": "Recurring patterns observed in how tasks are executed (e.g. common wave shapes, frequent agent combos)",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "object"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"user_behavior": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"description": "Inferred patterns about user preferences and interaction style",
|
|
32
|
+
"items": {
|
|
33
|
+
"type": "object"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"recurring_issues": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"description": "Issues or failure modes that have appeared more than once across sessions",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "object"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ftm-upgrade
|
|
3
|
+
description: Self-upgrade mechanism for ftm skills ecosystem. Checks GitHub Releases for new versions, caches results for 60min, shows changelog, and copies updated files. Use when user says "upgrade", "update skills", "new version", "check for updates", "ftm upgrade".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Events
|
|
7
|
+
|
|
8
|
+
### Emits
|
|
9
|
+
- `task_completed` — when a full upgrade completes successfully (files updated, version confirmed)
|
|
10
|
+
|
|
11
|
+
### Listens To
|
|
12
|
+
(none — ftm-upgrade is explicitly invoked by the user and does not respond to events)
|
|
13
|
+
|
|
14
|
+
# ftm-upgrade
|
|
15
|
+
|
|
16
|
+
Self-upgrade mechanism for the ftm skills ecosystem. Fetches the latest release from `kkudumu/ftm-brain` on GitHub, compares it to the locally installed version, and copies updated skill files in place.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Version Check Preamble (Passive Notice Pattern)
|
|
21
|
+
|
|
22
|
+
At the start of any ftm skill invocation, you may optionally run the version check to surface available updates without blocking the user's primary task.
|
|
23
|
+
|
|
24
|
+
**When to run the preamble**: When the user invokes a ftm skill and no version check has been shown in this conversation yet.
|
|
25
|
+
|
|
26
|
+
**Steps**:
|
|
27
|
+
1. Run `bash ~/.claude/skills/ftm-upgrade/scripts/check-version.sh`
|
|
28
|
+
2. Parse the output:
|
|
29
|
+
- `UP_TO_DATE` → Do nothing. Continue with the user's requested skill.
|
|
30
|
+
- `UPGRADE_AVAILABLE <version> <changelog_url>` → Show a one-line notice at the top of your response, then continue:
|
|
31
|
+
```
|
|
32
|
+
FTM skills update available: <current_version> → <version>. Run /ftm upgrade to install. (Changelog: <changelog_url>)
|
|
33
|
+
```
|
|
34
|
+
- `CHECK_FAILED <reason>` → Silently skip the notice. Do not surface version check errors during preamble checks.
|
|
35
|
+
|
|
36
|
+
The preamble notice is informational only — do not interrupt the user's workflow or ask for confirmation.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Full Upgrade Flow — `/ftm upgrade`
|
|
41
|
+
|
|
42
|
+
Triggered when the user explicitly says: "upgrade", "update skills", "ftm upgrade", "install update", "check for updates", or similar.
|
|
43
|
+
|
|
44
|
+
### Step 1 — Check Current Status
|
|
45
|
+
|
|
46
|
+
Run:
|
|
47
|
+
```bash
|
|
48
|
+
bash ~/.claude/skills/ftm-upgrade/scripts/check-version.sh
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Parse output and branch:
|
|
52
|
+
|
|
53
|
+
**Branch A — `UP_TO_DATE`**:
|
|
54
|
+
> You're on the latest version. No upgrade needed.
|
|
55
|
+
|
|
56
|
+
Read the current version from `~/.claude/skills/ftm-version.txt` (if it exists) and include it in the message:
|
|
57
|
+
> You're already on the latest version (vX.Y.Z).
|
|
58
|
+
|
|
59
|
+
**Branch B — `UPGRADE_AVAILABLE <version> <changelog_url>`**:
|
|
60
|
+
Proceed to Step 2.
|
|
61
|
+
|
|
62
|
+
**Branch C — `CHECK_FAILED <reason>`**:
|
|
63
|
+
Show the appropriate error message (see Error Handling section below) and stop.
|
|
64
|
+
|
|
65
|
+
### Step 2 — Show Upgrade Prompt (UPGRADE_AVAILABLE)
|
|
66
|
+
|
|
67
|
+
Present the following to the user:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
FTM skills upgrade available!
|
|
71
|
+
|
|
72
|
+
Current: <current_version from ftm-version.txt or "(not installed)">
|
|
73
|
+
Latest: <version>
|
|
74
|
+
Changes: <changelog_url>
|
|
75
|
+
|
|
76
|
+
Would you like to install this upgrade? (yes/no)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Wait for user confirmation before proceeding.
|
|
80
|
+
|
|
81
|
+
### Step 3 — Run Upgrade (after user confirms)
|
|
82
|
+
|
|
83
|
+
Run:
|
|
84
|
+
```bash
|
|
85
|
+
bash ~/.claude/skills/ftm-upgrade/scripts/upgrade.sh
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Stream the output to the user as it runs.
|
|
89
|
+
|
|
90
|
+
On success, confirm:
|
|
91
|
+
> Upgrade complete. FTM skills updated to <version>. Restart Claude Code to load new skills.
|
|
92
|
+
|
|
93
|
+
On failure (non-zero exit or error lines in output):
|
|
94
|
+
> Upgrade failed. See error above. If the problem persists, try: `bash ~/.claude/skills/ftm-upgrade/scripts/upgrade.sh` manually.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Manual Version Check — `/ftm upgrade check`
|
|
99
|
+
|
|
100
|
+
When the user says "ftm upgrade check", "check version", or "what version am I on":
|
|
101
|
+
|
|
102
|
+
1. Run `bash ~/.claude/skills/ftm-upgrade/scripts/check-version.sh`
|
|
103
|
+
2. Also read `~/.claude/skills/ftm-version.txt` for the installed version
|
|
104
|
+
3. Show a status summary:
|
|
105
|
+
|
|
106
|
+
**If UP_TO_DATE**:
|
|
107
|
+
```
|
|
108
|
+
FTM skills version: <version> (latest)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**If UPGRADE_AVAILABLE**:
|
|
112
|
+
```
|
|
113
|
+
FTM skills version: <current> (update available: <latest>)
|
|
114
|
+
Changelog: <changelog_url>
|
|
115
|
+
|
|
116
|
+
Run /ftm upgrade to install.
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**If CHECK_FAILED**:
|
|
120
|
+
Show the appropriate error (see Error Handling below).
|
|
121
|
+
|
|
122
|
+
**If ftm-version.txt does not exist**:
|
|
123
|
+
```
|
|
124
|
+
No version file found at ~/.claude/skills/ftm-version.txt.
|
|
125
|
+
FTM skills may not have been installed via ftm-upgrade, or this is a fresh install.
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Error Handling
|
|
131
|
+
|
|
132
|
+
Map `CHECK_FAILED <reason>` codes to user-facing messages:
|
|
133
|
+
|
|
134
|
+
| Reason code | User message |
|
|
135
|
+
|---|---|
|
|
136
|
+
| `gh_not_installed` | GitHub CLI is not installed. Install it with: `brew install gh` (macOS) or see https://cli.github.com |
|
|
137
|
+
| `no_internet` | Cannot reach GitHub. Check your internet connection and try again. |
|
|
138
|
+
| `repo_not_found` | Repository `kkudumu/ftm-brain` not found. Verify you have access to the repository. |
|
|
139
|
+
| `no_releases_found` | No releases found in the repository yet. Check back later. |
|
|
140
|
+
| any other reason | Version check failed: `<reason>`. Try running manually: `bash ~/.claude/skills/ftm-upgrade/scripts/check-version.sh` |
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Script Reference
|
|
145
|
+
|
|
146
|
+
| Script | Purpose |
|
|
147
|
+
|---|---|
|
|
148
|
+
| `~/.claude/skills/ftm-upgrade/scripts/check-version.sh` | Query GitHub for latest release, cache result 60 min |
|
|
149
|
+
| `~/.claude/skills/ftm-upgrade/scripts/upgrade.sh` | Download and install latest release |
|
|
150
|
+
|
|
151
|
+
**Cache location**: `~/.cache/ftm-brain/version-check`
|
|
152
|
+
**Version file**: `~/.claude/skills/ftm-version.txt`
|
|
153
|
+
**Repo**: `kkudumu/ftm-brain`
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# check-version.sh — Check for ftm-skills updates via GitHub Releases
|
|
3
|
+
# Outputs: UP_TO_DATE | UPGRADE_AVAILABLE <version> <changelog_url> | CHECK_FAILED <reason>
|
|
4
|
+
|
|
5
|
+
set -uo pipefail
|
|
6
|
+
|
|
7
|
+
CACHE_DIR="${HOME}/.cache/ftm-brain"
|
|
8
|
+
CACHE_FILE="${CACHE_DIR}/version-check"
|
|
9
|
+
VERSION_FILE="${HOME}/.claude/skills/ftm-version.txt"
|
|
10
|
+
REPO="kkudumu/ftm-brain"
|
|
11
|
+
|
|
12
|
+
# Ensure cache directory exists
|
|
13
|
+
mkdir -p "${CACHE_DIR}"
|
|
14
|
+
|
|
15
|
+
# Check if cache is fresh (less than 60 minutes old)
|
|
16
|
+
if [ -f "${CACHE_FILE}" ]; then
|
|
17
|
+
STALE=$(find "${CACHE_FILE}" -mmin +60 2>/dev/null | wc -l | tr -d ' ')
|
|
18
|
+
if [ "${STALE}" = "0" ]; then
|
|
19
|
+
# Cache is fresh — return cached result
|
|
20
|
+
cat "${CACHE_FILE}"
|
|
21
|
+
exit 0
|
|
22
|
+
fi
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
# Check that gh CLI is installed
|
|
26
|
+
if ! command -v gh >/dev/null 2>&1; then
|
|
27
|
+
RESULT="CHECK_FAILED gh_not_installed"
|
|
28
|
+
printf '%s\n' "${RESULT}" | tee "${CACHE_FILE}"
|
|
29
|
+
exit 0
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
# Query latest release from GitHub
|
|
33
|
+
RELEASE_OUTPUT=$(gh release list -R "${REPO}" --limit 1 2>&1)
|
|
34
|
+
GH_EXIT=$?
|
|
35
|
+
|
|
36
|
+
if [ ${GH_EXIT} -ne 0 ]; then
|
|
37
|
+
# Distinguish between network and repo errors
|
|
38
|
+
if printf '%s' "${RELEASE_OUTPUT}" | grep -qi "could not resolve\|network\|timeout\|no such host"; then
|
|
39
|
+
RESULT="CHECK_FAILED no_internet"
|
|
40
|
+
elif printf '%s' "${RELEASE_OUTPUT}" | grep -qi "not found\|404\|Could not find"; then
|
|
41
|
+
RESULT="CHECK_FAILED repo_not_found"
|
|
42
|
+
else
|
|
43
|
+
REASON=$(printf '%s' "${RELEASE_OUTPUT}" | tr '\n' ' ' | cut -c1-80)
|
|
44
|
+
RESULT="CHECK_FAILED ${REASON}"
|
|
45
|
+
fi
|
|
46
|
+
printf '%s\n' "${RESULT}" | tee "${CACHE_FILE}"
|
|
47
|
+
exit 0
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
# Parse latest release tag (first column of gh release list output)
|
|
51
|
+
LATEST_TAG=$(printf '%s' "${RELEASE_OUTPUT}" | awk 'NR==1{print $1}')
|
|
52
|
+
|
|
53
|
+
if [ -z "${LATEST_TAG}" ]; then
|
|
54
|
+
RESULT="CHECK_FAILED no_releases_found"
|
|
55
|
+
printf '%s\n' "${RESULT}" | tee "${CACHE_FILE}"
|
|
56
|
+
exit 0
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
# Read current installed version
|
|
60
|
+
if [ -f "${VERSION_FILE}" ]; then
|
|
61
|
+
CURRENT_VERSION=$(tr -d '[:space:]' < "${VERSION_FILE}")
|
|
62
|
+
else
|
|
63
|
+
CURRENT_VERSION="unknown"
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
# Compare versions
|
|
67
|
+
if [ "${CURRENT_VERSION}" = "${LATEST_TAG}" ]; then
|
|
68
|
+
RESULT="UP_TO_DATE"
|
|
69
|
+
else
|
|
70
|
+
CHANGELOG_URL="https://github.com/${REPO}/releases/tag/${LATEST_TAG}"
|
|
71
|
+
RESULT="UPGRADE_AVAILABLE ${LATEST_TAG} ${CHANGELOG_URL}"
|
|
72
|
+
fi
|
|
73
|
+
|
|
74
|
+
# Write to cache and output
|
|
75
|
+
printf '%s\n' "${RESULT}" | tee "${CACHE_FILE}"
|
|
76
|
+
exit 0
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# upgrade.sh — Download and install latest ftm-skills release
|
|
3
|
+
# Usage: upgrade.sh [--version <tag>]
|
|
4
|
+
|
|
5
|
+
set -uo pipefail
|
|
6
|
+
|
|
7
|
+
REPO="kkudumu/ftm-brain"
|
|
8
|
+
SKILLS_DIR="${HOME}/.claude/skills"
|
|
9
|
+
VERSION_FILE="${SKILLS_DIR}/ftm-version.txt"
|
|
10
|
+
DOWNLOAD_DIR="/tmp/ftm-upgrade"
|
|
11
|
+
CACHE_FILE="${HOME}/.cache/ftm-brain/version-check"
|
|
12
|
+
|
|
13
|
+
# ── Helpers ──────────────────────────────────────────────────────────────────
|
|
14
|
+
|
|
15
|
+
log() { printf '[ftm-upgrade] %s\n' "$*"; }
|
|
16
|
+
die() { printf '[ftm-upgrade] ERROR: %s\n' "$*" >&2; exit 1; }
|
|
17
|
+
|
|
18
|
+
# ── Preflight checks ─────────────────────────────────────────────────────────
|
|
19
|
+
|
|
20
|
+
if ! command -v gh >/dev/null 2>&1; then
|
|
21
|
+
die "GitHub CLI (gh) is not installed. Install it with: brew install gh"
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
if ! command -v tar >/dev/null 2>&1; then
|
|
25
|
+
die "tar is required but not found."
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
# ── Determine target version ─────────────────────────────────────────────────
|
|
29
|
+
|
|
30
|
+
TARGET_VERSION=""
|
|
31
|
+
while [ $# -gt 0 ]; do
|
|
32
|
+
case "$1" in
|
|
33
|
+
--version) TARGET_VERSION="$2"; shift 2 ;;
|
|
34
|
+
*) die "Unknown argument: $1" ;;
|
|
35
|
+
esac
|
|
36
|
+
done
|
|
37
|
+
|
|
38
|
+
if [ -z "${TARGET_VERSION}" ]; then
|
|
39
|
+
log "Fetching latest release tag..."
|
|
40
|
+
TARGET_VERSION=$(gh release list -R "${REPO}" --limit 1 2>&1 | awk 'NR==1{print $1}')
|
|
41
|
+
if [ -z "${TARGET_VERSION}" ]; then
|
|
42
|
+
die "Could not determine latest release. Check GitHub access and repository name."
|
|
43
|
+
fi
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
log "Target version: ${TARGET_VERSION}"
|
|
47
|
+
|
|
48
|
+
# ── Read current version ─────────────────────────────────────────────────────
|
|
49
|
+
|
|
50
|
+
if [ -f "${VERSION_FILE}" ]; then
|
|
51
|
+
CURRENT_VERSION=$(tr -d '[:space:]' < "${VERSION_FILE}")
|
|
52
|
+
else
|
|
53
|
+
CURRENT_VERSION="(not installed)"
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
log "Current version: ${CURRENT_VERSION}"
|
|
57
|
+
|
|
58
|
+
if [ "${CURRENT_VERSION}" = "${TARGET_VERSION}" ]; then
|
|
59
|
+
log "Already on the latest version (${TARGET_VERSION}). Nothing to do."
|
|
60
|
+
exit 0
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# ── Download ──────────────────────────────────────────────────────────────────
|
|
64
|
+
|
|
65
|
+
rm -rf "${DOWNLOAD_DIR}"
|
|
66
|
+
mkdir -p "${DOWNLOAD_DIR}"
|
|
67
|
+
|
|
68
|
+
log "Downloading release archive for ${TARGET_VERSION}..."
|
|
69
|
+
|
|
70
|
+
gh release download "${TARGET_VERSION}" \
|
|
71
|
+
-R "${REPO}" \
|
|
72
|
+
--archive tar.gz \
|
|
73
|
+
-D "${DOWNLOAD_DIR}" 2>&1 || die "Download failed. Check your internet connection and repository access."
|
|
74
|
+
|
|
75
|
+
# Find the downloaded archive
|
|
76
|
+
ARCHIVE=$(find "${DOWNLOAD_DIR}" -maxdepth 1 -name '*.tar.gz' | head -1)
|
|
77
|
+
if [ -z "${ARCHIVE}" ]; then
|
|
78
|
+
die "No archive found in ${DOWNLOAD_DIR} after download."
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
log "Downloaded: ${ARCHIVE}"
|
|
82
|
+
|
|
83
|
+
# ── Extract ───────────────────────────────────────────────────────────────────
|
|
84
|
+
|
|
85
|
+
EXTRACT_DIR="${DOWNLOAD_DIR}/extracted"
|
|
86
|
+
mkdir -p "${EXTRACT_DIR}"
|
|
87
|
+
|
|
88
|
+
log "Extracting archive..."
|
|
89
|
+
tar -xzf "${ARCHIVE}" -C "${EXTRACT_DIR}" 2>&1 || die "Extraction failed. Archive may be corrupt."
|
|
90
|
+
|
|
91
|
+
# GitHub archives typically extract into a directory named <repo>-<tag>/
|
|
92
|
+
REPO_DIR=$(find "${EXTRACT_DIR}" -maxdepth 1 -mindepth 1 -type d | head -1)
|
|
93
|
+
if [ -z "${REPO_DIR}" ]; then
|
|
94
|
+
die "Could not find extracted repository directory."
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
log "Extracted to: ${REPO_DIR}"
|
|
98
|
+
|
|
99
|
+
# ── Copy skill files ──────────────────────────────────────────────────────────
|
|
100
|
+
|
|
101
|
+
# Look for a skills/ subdirectory in the archive; fall back to root
|
|
102
|
+
SOURCE_SKILLS=""
|
|
103
|
+
if [ -d "${REPO_DIR}/skills" ]; then
|
|
104
|
+
SOURCE_SKILLS="${REPO_DIR}/skills"
|
|
105
|
+
elif [ -d "${REPO_DIR}" ]; then
|
|
106
|
+
# The repo root might itself contain SKILL.md files and .yml files
|
|
107
|
+
SOURCE_SKILLS="${REPO_DIR}"
|
|
108
|
+
fi
|
|
109
|
+
|
|
110
|
+
if [ -z "${SOURCE_SKILLS}" ]; then
|
|
111
|
+
die "No skills directory found in release archive."
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
log "Copying skill files from ${SOURCE_SKILLS} to ${SKILLS_DIR}..."
|
|
115
|
+
|
|
116
|
+
# Use rsync if available for cleaner copy, else cp
|
|
117
|
+
if command -v rsync >/dev/null 2>&1; then
|
|
118
|
+
rsync -av --exclude='.git' "${SOURCE_SKILLS}/" "${SKILLS_DIR}/" 2>&1
|
|
119
|
+
else
|
|
120
|
+
cp -R "${SOURCE_SKILLS}/." "${SKILLS_DIR}/" 2>&1
|
|
121
|
+
fi
|
|
122
|
+
|
|
123
|
+
# ── Update version file ───────────────────────────────────────────────────────
|
|
124
|
+
|
|
125
|
+
printf '%s\n' "${TARGET_VERSION}" > "${VERSION_FILE}"
|
|
126
|
+
|
|
127
|
+
# Invalidate version cache so next check-version.sh run is fresh
|
|
128
|
+
rm -f "${CACHE_FILE}"
|
|
129
|
+
|
|
130
|
+
# ── Summary ───────────────────────────────────────────────────────────────────
|
|
131
|
+
|
|
132
|
+
log ""
|
|
133
|
+
log "Upgrade complete."
|
|
134
|
+
log " ${CURRENT_VERSION} → ${TARGET_VERSION}"
|
|
135
|
+
log " Changelog: https://github.com/${REPO}/releases/tag/${TARGET_VERSION}"
|
|
136
|
+
log ""
|
|
137
|
+
log "Installed files updated in: ${SKILLS_DIR}"
|
|
138
|
+
|
|
139
|
+
# ── Cleanup ───────────────────────────────────────────────────────────────────
|
|
140
|
+
|
|
141
|
+
rm -rf "${DOWNLOAD_DIR}"
|
|
142
|
+
|
|
143
|
+
exit 0
|
package/ftm-upgrade.yml
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
name: ftm-upgrade
|
|
2
|
+
description: Self-upgrade mechanism for ftm skills ecosystem. Checks GitHub Releases for new versions, caches results for 60min, shows changelog, and copies updated files. Use when user says "upgrade", "update skills", "new version", "check for updates", "ftm upgrade".
|
package/ftm.yml
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
name: ftm
|
|
2
|
+
description: Universal entry point for all ftm skills. Routes freeform text to the right ftm skill automatically. Use when user says "/ftm" followed by anything. ftm-mind is the default cognitive entry point for all unclassified input (OODA reasoning). Explicit prefixes route directly: brainstorm, execute, debug, audit, council, intent, diagram, codex-gate, pause, resume, browse, upgrade, retro, config, mind. Also use when user is unsure which ftm skill they need.
|
package/install.sh
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# FTM Skills Installer
|
|
5
|
+
# Creates symlinks from this repo into ~/.claude/skills/ so slash commands work.
|
|
6
|
+
# Safe to re-run — idempotent. Run after cloning or adding new skills.
|
|
7
|
+
|
|
8
|
+
REPO_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
9
|
+
SKILLS_DIR="$HOME/.claude/skills"
|
|
10
|
+
STATE_DIR="$HOME/.claude/ftm-state"
|
|
11
|
+
CONFIG_DIR="$HOME/.claude"
|
|
12
|
+
|
|
13
|
+
echo "Installing ftm skills from: $REPO_DIR"
|
|
14
|
+
echo "Linking into: $SKILLS_DIR"
|
|
15
|
+
echo ""
|
|
16
|
+
|
|
17
|
+
mkdir -p "$SKILLS_DIR"
|
|
18
|
+
|
|
19
|
+
# Link all ftm*.yml files
|
|
20
|
+
for yml in "$REPO_DIR"/ftm*.yml; do
|
|
21
|
+
name=$(basename "$yml")
|
|
22
|
+
target="$SKILLS_DIR/$name"
|
|
23
|
+
if [ -L "$target" ]; then
|
|
24
|
+
rm "$target"
|
|
25
|
+
elif [ -f "$target" ]; then
|
|
26
|
+
echo " SKIP $name (real file exists — back it up first)"
|
|
27
|
+
continue
|
|
28
|
+
fi
|
|
29
|
+
ln -s "$yml" "$target"
|
|
30
|
+
echo " LINK $name"
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
# Link all ftm* directories (skills with SKILL.md)
|
|
34
|
+
for dir in "$REPO_DIR"/ftm*/; do
|
|
35
|
+
name=$(basename "$dir")
|
|
36
|
+
[ "$name" = "ftm-state" ] && continue # state is handled separately
|
|
37
|
+
target="$SKILLS_DIR/$name"
|
|
38
|
+
if [ -L "$target" ]; then
|
|
39
|
+
rm "$target"
|
|
40
|
+
elif [ -d "$target" ]; then
|
|
41
|
+
echo " SKIP $name/ (real directory exists — back it up first)"
|
|
42
|
+
continue
|
|
43
|
+
fi
|
|
44
|
+
ln -s "$dir" "$target"
|
|
45
|
+
echo " LINK $name/"
|
|
46
|
+
done
|
|
47
|
+
|
|
48
|
+
# Set up blackboard state (copy templates, don't overwrite existing data)
|
|
49
|
+
if [ -d "$REPO_DIR/ftm-state" ]; then
|
|
50
|
+
mkdir -p "$STATE_DIR/blackboard/experiences"
|
|
51
|
+
for f in "$REPO_DIR/ftm-state/blackboard"/*.json; do
|
|
52
|
+
name=$(basename "$f")
|
|
53
|
+
target="$STATE_DIR/blackboard/$name"
|
|
54
|
+
if [ ! -f "$target" ]; then
|
|
55
|
+
cp "$f" "$target"
|
|
56
|
+
echo " INIT $name (blackboard template)"
|
|
57
|
+
fi
|
|
58
|
+
done
|
|
59
|
+
idx="$STATE_DIR/blackboard/experiences/index.json"
|
|
60
|
+
if [ ! -f "$idx" ]; then
|
|
61
|
+
cp "$REPO_DIR/ftm-state/blackboard/experiences/index.json" "$idx"
|
|
62
|
+
echo " INIT experiences/index.json (blackboard template)"
|
|
63
|
+
fi
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
# Copy default config if none exists
|
|
67
|
+
if [ ! -f "$CONFIG_DIR/ftm-config.yml" ] && [ -f "$REPO_DIR/ftm-config.default.yml" ]; then
|
|
68
|
+
cp "$REPO_DIR/ftm-config.default.yml" "$CONFIG_DIR/ftm-config.yml"
|
|
69
|
+
echo " INIT ftm-config.yml (from default template)"
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
# Install hooks (copy to ~/.claude/hooks/, don't overwrite existing)
|
|
73
|
+
HOOKS_DIR="$HOME/.claude/hooks"
|
|
74
|
+
if [ -d "$REPO_DIR/hooks" ]; then
|
|
75
|
+
mkdir -p "$HOOKS_DIR"
|
|
76
|
+
HOOK_COUNT=0
|
|
77
|
+
for hook in "$REPO_DIR/hooks"/ftm-*.sh; do
|
|
78
|
+
[ -f "$hook" ] || continue
|
|
79
|
+
name=$(basename "$hook")
|
|
80
|
+
target="$HOOKS_DIR/$name"
|
|
81
|
+
if [ -f "$target" ]; then
|
|
82
|
+
# Overwrite — hooks should always be the latest version
|
|
83
|
+
cp "$hook" "$target"
|
|
84
|
+
chmod +x "$target"
|
|
85
|
+
echo " UPDATE $name"
|
|
86
|
+
else
|
|
87
|
+
cp "$hook" "$target"
|
|
88
|
+
chmod +x "$target"
|
|
89
|
+
echo " INSTALL $name"
|
|
90
|
+
fi
|
|
91
|
+
HOOK_COUNT=$((HOOK_COUNT + 1))
|
|
92
|
+
done
|
|
93
|
+
if [ "$HOOK_COUNT" -gt 0 ]; then
|
|
94
|
+
echo ""
|
|
95
|
+
echo " $HOOK_COUNT hooks installed to $HOOKS_DIR"
|
|
96
|
+
echo " To activate, add them to ~/.claude/settings.json (see docs/HOOKS.md)"
|
|
97
|
+
fi
|
|
98
|
+
fi
|
|
99
|
+
|
|
100
|
+
echo ""
|
|
101
|
+
echo "Done. $(ls "$REPO_DIR"/ftm*.yml 2>/dev/null | wc -l | tr -d ' ') skills linked."
|
|
102
|
+
echo "Try: /ftm help"
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "feed-the-machine",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A unified intelligence layer for Claude Code — 16 skills with OODA-based reasoning, persistent memory, and multi-model deliberation",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "kkudumu",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/kkudumu/feed-the-machine.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/kkudumu/feed-the-machine",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"claude-code",
|
|
15
|
+
"ai-agents",
|
|
16
|
+
"skills",
|
|
17
|
+
"ooda",
|
|
18
|
+
"multi-model",
|
|
19
|
+
"blackboard-architecture",
|
|
20
|
+
"agentic"
|
|
21
|
+
],
|
|
22
|
+
"bin": {
|
|
23
|
+
"feed-the-machine": "bin/install.mjs"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"bin/",
|
|
27
|
+
"install.sh",
|
|
28
|
+
"uninstall.sh",
|
|
29
|
+
"ftm.yml",
|
|
30
|
+
"ftm-*.yml",
|
|
31
|
+
"ftm/",
|
|
32
|
+
"ftm-mind/",
|
|
33
|
+
"ftm-executor/",
|
|
34
|
+
"ftm-debug/",
|
|
35
|
+
"ftm-brainstorm/",
|
|
36
|
+
"ftm-audit/",
|
|
37
|
+
"ftm-council/",
|
|
38
|
+
"ftm-codex-gate/",
|
|
39
|
+
"ftm-retro/",
|
|
40
|
+
"ftm-intent/",
|
|
41
|
+
"ftm-diagram/",
|
|
42
|
+
"ftm-browse/",
|
|
43
|
+
"ftm-git/",
|
|
44
|
+
"ftm-pause/",
|
|
45
|
+
"ftm-resume/",
|
|
46
|
+
"ftm-upgrade/",
|
|
47
|
+
"ftm-config/",
|
|
48
|
+
"ftm-state/",
|
|
49
|
+
"ftm-config.default.yml",
|
|
50
|
+
"README.md",
|
|
51
|
+
"LICENSE"
|
|
52
|
+
],
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"prepare": "husky",
|
|
58
|
+
"generate-manifest": "node bin/generate-manifest.mjs"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"gray-matter": "^4.0.3"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@commitlint/cli": "^19.8.0",
|
|
65
|
+
"@commitlint/config-conventional": "^19.8.0",
|
|
66
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
67
|
+
"@semantic-release/git": "^10.0.1",
|
|
68
|
+
"@semantic-release/github": "^11.0.1",
|
|
69
|
+
"ajv-cli": "^5.0.0",
|
|
70
|
+
"husky": "^9.1.7",
|
|
71
|
+
"promptfoo": "^0.100.0",
|
|
72
|
+
"semantic-release": "^24.2.3"
|
|
73
|
+
}
|
|
74
|
+
}
|