Skip to content
← Public packages

@kody/kody-factory

Forkable multi-project software factory: signals, priority queue, project UI, sweep job. Agent runners and Sentry reach it by events.

FollowFork

Files

guide.ts

79 lines · 2.6 KB · TypeScript
/**
 * Open-ended setup guide for fork onboarding.
 * Asks questions, wires credentials by name, requires human approval for webhooks.
 */

export type SetupQuestion = {
	id: string
	prompt: string
	why: string
}

export const setupQuestions: SetupQuestion[] = [
	{
		id: 'projects',
		prompt: 'Which projects should this factory instance manage (ids + display names + default repos)?',
		why: 'Every signal and plan item needs a projectId; one package instance can run many projects.',
	},
	{
		id: 'repo-hosts',
		prompt: 'For each project, is the repo on GitHub, GitLab, or Kody-native Artifacts?',
		why: 'Repo adapters are swappable; kody-hq/kody stays on GitHub for now.',
	},
	{
		id: 'agent-shape',
		prompt: 'Cole-style orchestrator + implementers, or single-agent fallback?',
		why: 'Chooses which AgentRunner adapters to bind in project config.',
	},
	{
		id: 'signal-sources',
		prompt: 'Which signal sources should be live first (Sentry, GitHub issues, feedback, Discord, X, email, friction, CI)?',
		why: 'v1 ships skills for each; wiring webhooks still needs owner Approve.',
	},
	{
		id: 'policy',
		prompt: 'What must agents never do, and which changes are always human? Merge low only, or low+medium?',
		why: 'Seeds factory policy and autopilot interview answers.',
	},
	{
		id: 'shadow',
		prompt: 'Keep shadow mode on until you have seen N correct proposed actions?',
		why: 'Default is shadow on; live actions are per-stage later.',
	},
]

export type CredentialNeed = {
	key: string
	description: string
	requiredFor: string[]
}

export const credentialNeeds: CredentialNeed[] = [
	{
		key: 'runner',
		description: 'Start implementer agent sessions (Devin service user key, or another runner adapter)',
		requiredFor: ['implement'],
	},
	{
		key: 'model',
		description: 'Optional model for triage decisions',
		requiredFor: ['triage'],
	},
	{
		key: 'discord',
		description: 'Optional notifications (never the official Kody bot token unless using kody-discord)',
		requiredFor: ['notify'],
	},
]

export function setupSteps(): string[] {
	return [
		'1. Copy setup/fork-prompt.md into your agent and answer the open-ended questions.',
		'2. Create or fork @kody/kody-factory into your org (imports are self-contained).',
		'3. Map credentials on Connect links (runner, model). Never paste secret values into chat.',
		'4. Owner Approves each webhook destination and any credential-using triggers.',
		'5. Call setup-status / ensure default project; keep jobs disabled until shadow looks right.',
		'6. Ingest one feedback or manual item; confirm it appears on the global queue and project drill-in.',
		'7. Only then enable the sweep job and any webhooks the owner approved.',
	]
}